mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2024-11-10 06:41:49 +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
|
||||
UpdateTitle(); //mxd
|
||||
|
||||
panel.Reload = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
private ScriptStatusInfo status;
|
||||
private int statusflashcount;
|
||||
private bool statusflashicon;
|
||||
private bool reload;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -62,6 +63,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
public ScriptDocumentTab ActiveTab { get { return (tabs.SelectedTab as ScriptDocumentTab); } }
|
||||
|
||||
public bool Reload { get { return reload; } set { reload = value; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Constructor
|
||||
|
@ -75,6 +78,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// This initializes the control
|
||||
public void Initialize()
|
||||
{
|
||||
reload = false;
|
||||
// Make list of script configs
|
||||
scriptconfigs = new List<ScriptConfiguration>(General.ScriptConfigs.Values);
|
||||
scriptconfigs.Add(new ScriptConfiguration());
|
||||
|
@ -467,6 +471,12 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
}
|
||||
|
||||
if (Reload)
|
||||
{
|
||||
General.Map.ReloadResources();
|
||||
Reload = false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -528,6 +538,12 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
if (!t.ExplicitSave) t.Save();
|
||||
}
|
||||
|
||||
if (Reload)
|
||||
{
|
||||
General.Map.ReloadResources();
|
||||
Reload = false;
|
||||
}
|
||||
|
||||
UpdateToolbar(false);
|
||||
}
|
||||
|
||||
|
@ -865,6 +881,11 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// Save the current script
|
||||
ScriptDocumentTab t = (tabs.SelectedTab as ScriptDocumentTab);
|
||||
SaveScript(t);
|
||||
if (Reload)
|
||||
{
|
||||
General.Map.ReloadResources();
|
||||
Reload = false;
|
||||
}
|
||||
UpdateToolbar(true);
|
||||
}
|
||||
|
||||
|
@ -881,6 +902,12 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
}
|
||||
|
||||
if (Reload)
|
||||
{
|
||||
General.Map.ReloadResources();
|
||||
Reload = false;
|
||||
}
|
||||
|
||||
UpdateToolbar(true);
|
||||
}
|
||||
|
||||
|
@ -921,6 +948,11 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
ScriptDocumentTab t = (tabs.SelectedTab as ScriptDocumentTab);
|
||||
CloseScript(t, false);
|
||||
if (Reload)
|
||||
{
|
||||
General.Map.ReloadResources();
|
||||
Reload = false;
|
||||
}
|
||||
UpdateToolbar(true);
|
||||
}
|
||||
|
||||
|
@ -952,6 +984,12 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
if (!SaveScript(t)) return;
|
||||
}
|
||||
|
||||
if (Reload)
|
||||
{
|
||||
General.Map.ReloadResources();
|
||||
Reload = false;
|
||||
}
|
||||
|
||||
// Compile now
|
||||
DisplayStatus(ScriptStatusType.Busy, "Compiling script \"" + t.Title + "\"...");
|
||||
Cursor.Current = Cursors.WaitCursor;
|
||||
|
|
Loading…
Reference in a new issue