mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2025-02-07 08:21:10 +00:00
Fixed map lumps duplication when saving the map several times after converting the map from/to UDMF map format by changing it in the Map Options window.
Fixed, cosmetic: in some cases incorrect resource loading time was displayed after saving the map.
This commit is contained in:
parent
c930ba17c2
commit
66fb6c39b7
4 changed files with 17 additions and 3 deletions
|
@ -560,6 +560,12 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
internalsprites = null;
|
internalsprites = null;
|
||||||
mapinfo = null; //mxd
|
mapinfo = null; //mxd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//mxd. Called before Clock is reset
|
||||||
|
internal void OnBeforeClockReset()
|
||||||
|
{
|
||||||
|
if(loadstarttime > 0) loadstarttime -= Clock.CurrentTime;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -745,6 +751,7 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
loadfinishtime = Clock.CurrentTime;
|
loadfinishtime = Clock.CurrentTime;
|
||||||
string deltatimesec = ((loadfinishtime - loadstarttime) / 1000.0f).ToString("########0.00");
|
string deltatimesec = ((loadfinishtime - loadstarttime) / 1000.0f).ToString("########0.00");
|
||||||
General.WriteLogLine("Resources loading took " + deltatimesec + " seconds");
|
General.WriteLogLine("Resources loading took " + deltatimesec + " seconds");
|
||||||
|
loadstarttime = 0; //mxd
|
||||||
|
|
||||||
//mxd. Show more detailed message
|
//mxd. Show more detailed message
|
||||||
if(notifiedbusy)
|
if(notifiedbusy)
|
||||||
|
|
|
@ -1062,9 +1062,6 @@ namespace CodeImp.DoomBuilder
|
||||||
// Ask the user to save changes (if any)
|
// Ask the user to save changes (if any)
|
||||||
if(AskSaveMap())
|
if(AskSaveMap())
|
||||||
{
|
{
|
||||||
//mxd. Reset the clock...
|
|
||||||
MainWindow.ResetClock();
|
|
||||||
|
|
||||||
// Open map options dialog
|
// Open map options dialog
|
||||||
MapOptionsForm optionswindow = new MapOptionsForm(newoptions, true);
|
MapOptionsForm optionswindow = new MapOptionsForm(newoptions, true);
|
||||||
if(optionswindow.ShowDialog(mainwindow) == DialogResult.OK)
|
if(optionswindow.ShowDialog(mainwindow) == DialogResult.OK)
|
||||||
|
@ -1123,6 +1120,9 @@ namespace CodeImp.DoomBuilder
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
mainwindow.DisplayReady();
|
mainwindow.DisplayReady();
|
||||||
|
|
||||||
|
//mxd. Also reset the clock...
|
||||||
|
MainWindow.ResetClock();
|
||||||
|
|
||||||
Cursor.Current = Cursors.Default;
|
Cursor.Current = Cursors.Default;
|
||||||
}
|
}
|
||||||
|
|
|
@ -962,6 +962,9 @@ namespace CodeImp.DoomBuilder
|
||||||
{
|
{
|
||||||
ConfigurationInfo ci = General.GetConfigurationInfo(origmapconfigname);
|
ConfigurationInfo ci = General.GetConfigurationInfo(origmapconfigname);
|
||||||
origcfg = new GameConfiguration(ci.Configuration);
|
origcfg = new GameConfiguration(ci.Configuration);
|
||||||
|
|
||||||
|
// Needed only once!
|
||||||
|
origmapconfigname = configinfo.Filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
mapheaderindex = CopyAllLumpsExceptMap(origwad, targetwad, origcfg, origmapname);
|
mapheaderindex = CopyAllLumpsExceptMap(origwad, targetwad, origcfg, origmapname);
|
||||||
|
|
|
@ -4205,6 +4205,10 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
//mxd
|
//mxd
|
||||||
internal void ResetClock()
|
internal void ResetClock()
|
||||||
{
|
{
|
||||||
|
// Let the data manager know...
|
||||||
|
if(General.Map != null && General.Map.Data != null)
|
||||||
|
General.Map.Data.OnBeforeClockReset();
|
||||||
|
|
||||||
Clock.Reset();
|
Clock.Reset();
|
||||||
lastupdatetime = 0;
|
lastupdatetime = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue