mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2025-02-07 08:21:10 +00:00
Reload resources if a global script was changed
This commit is contained in:
parent
40ebb654a3
commit
c9bf195778
2 changed files with 41 additions and 0 deletions
|
@ -132,6 +132,9 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
|
|
||||||
editor.SetSavePoint(); //mxd
|
editor.SetSavePoint(); //mxd
|
||||||
UpdateTitle(); //mxd
|
UpdateTitle(); //mxd
|
||||||
|
|
||||||
|
panel.Reload = true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,7 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
private ScriptStatusInfo status;
|
private ScriptStatusInfo status;
|
||||||
private int statusflashcount;
|
private int statusflashcount;
|
||||||
private bool statusflashicon;
|
private bool statusflashicon;
|
||||||
|
private bool reload;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -62,6 +63,8 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
|
|
||||||
public ScriptDocumentTab ActiveTab { get { return (tabs.SelectedTab as ScriptDocumentTab); } }
|
public ScriptDocumentTab ActiveTab { get { return (tabs.SelectedTab as ScriptDocumentTab); } }
|
||||||
|
|
||||||
|
public bool Reload { get { return reload; } set { reload = value; } }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ================== Constructor
|
#region ================== Constructor
|
||||||
|
@ -75,6 +78,7 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
// This initializes the control
|
// This initializes the control
|
||||||
public void Initialize()
|
public void Initialize()
|
||||||
{
|
{
|
||||||
|
reload = false;
|
||||||
// Make list of script configs
|
// Make list of script configs
|
||||||
scriptconfigs = new List<ScriptConfiguration>(General.ScriptConfigs.Values);
|
scriptconfigs = new List<ScriptConfiguration>(General.ScriptConfigs.Values);
|
||||||
scriptconfigs.Add(new ScriptConfiguration());
|
scriptconfigs.Add(new ScriptConfiguration());
|
||||||
|
@ -467,6 +471,12 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Reload)
|
||||||
|
{
|
||||||
|
General.Map.ReloadResources();
|
||||||
|
Reload = false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -528,6 +538,12 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
if (!t.ExplicitSave) t.Save();
|
if (!t.ExplicitSave) t.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Reload)
|
||||||
|
{
|
||||||
|
General.Map.ReloadResources();
|
||||||
|
Reload = false;
|
||||||
|
}
|
||||||
|
|
||||||
UpdateToolbar(false);
|
UpdateToolbar(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -865,6 +881,11 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
// Save the current script
|
// Save the current script
|
||||||
ScriptDocumentTab t = (tabs.SelectedTab as ScriptDocumentTab);
|
ScriptDocumentTab t = (tabs.SelectedTab as ScriptDocumentTab);
|
||||||
SaveScript(t);
|
SaveScript(t);
|
||||||
|
if (Reload)
|
||||||
|
{
|
||||||
|
General.Map.ReloadResources();
|
||||||
|
Reload = false;
|
||||||
|
}
|
||||||
UpdateToolbar(true);
|
UpdateToolbar(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -881,6 +902,12 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Reload)
|
||||||
|
{
|
||||||
|
General.Map.ReloadResources();
|
||||||
|
Reload = false;
|
||||||
|
}
|
||||||
|
|
||||||
UpdateToolbar(true);
|
UpdateToolbar(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -921,6 +948,11 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
{
|
{
|
||||||
ScriptDocumentTab t = (tabs.SelectedTab as ScriptDocumentTab);
|
ScriptDocumentTab t = (tabs.SelectedTab as ScriptDocumentTab);
|
||||||
CloseScript(t, false);
|
CloseScript(t, false);
|
||||||
|
if (Reload)
|
||||||
|
{
|
||||||
|
General.Map.ReloadResources();
|
||||||
|
Reload = false;
|
||||||
|
}
|
||||||
UpdateToolbar(true);
|
UpdateToolbar(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -952,6 +984,12 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
if (!SaveScript(t)) return;
|
if (!SaveScript(t)) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Reload)
|
||||||
|
{
|
||||||
|
General.Map.ReloadResources();
|
||||||
|
Reload = false;
|
||||||
|
}
|
||||||
|
|
||||||
// Compile now
|
// Compile now
|
||||||
DisplayStatus(ScriptStatusType.Busy, "Compiling script \"" + t.Title + "\"...");
|
DisplayStatus(ScriptStatusType.Busy, "Compiling script \"" + t.Title + "\"...");
|
||||||
Cursor.Current = Cursors.WaitCursor;
|
Cursor.Current = Cursors.WaitCursor;
|
||||||
|
|
Loading…
Reference in a new issue