mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2024-11-10 06:41:49 +00:00
- Fixed an issue where the current editing mode was not re-initialized properly when opening a map from current WAD
This commit is contained in:
parent
c6a2288c22
commit
0043160e30
1 changed files with 12 additions and 4 deletions
|
@ -543,13 +543,17 @@ namespace CodeImp.DoomBuilder
|
||||||
|
|
||||||
if(General.Editing.Mode != null)
|
if(General.Editing.Mode != null)
|
||||||
{
|
{
|
||||||
if(General.Editing.Mode is ClassicMode)
|
if (General.Editing.Mode is ClassicMode)
|
||||||
{
|
{
|
||||||
ClassicMode mode = (ClassicMode)General.Editing.Mode;
|
ClassicMode mode = (ClassicMode)General.Editing.Mode;
|
||||||
mode.OnRedoEnd();
|
mode.OnRedoEnd();
|
||||||
|
|
||||||
|
// biwa. Cancel current mode. This will re-engage non-volatile modes to make sure it's
|
||||||
|
// properly initialized for the new map. Fixes issues mentioned in #196
|
||||||
|
General.Editing.CancelMode();
|
||||||
|
|
||||||
// Center map in screen or on stored coordinates
|
// Center map in screen or on stored coordinates
|
||||||
if(options.ViewPosition.IsFinite() && !float.IsNaN(options.ViewScale))
|
if (options.ViewPosition.IsFinite() && !float.IsNaN(options.ViewScale))
|
||||||
mode.CenterOnCoordinates(options.ViewPosition, options.ViewScale);
|
mode.CenterOnCoordinates(options.ViewPosition, options.ViewScale);
|
||||||
else
|
else
|
||||||
mode.CenterInScreen();
|
mode.CenterInScreen();
|
||||||
|
@ -557,12 +561,16 @@ namespace CodeImp.DoomBuilder
|
||||||
else if(General.Editing.Mode is VisualMode)
|
else if(General.Editing.Mode is VisualMode)
|
||||||
{
|
{
|
||||||
VisualMode mode = (VisualMode)General.Editing.Mode;
|
VisualMode mode = (VisualMode)General.Editing.Mode;
|
||||||
|
|
||||||
|
// biwa. Cancel current mode. This will re-engage non-volatile modes to make sure it's
|
||||||
|
// properly initialized for the new map. Fixes issues mentioned in #196
|
||||||
|
General.Editing.CancelMode();
|
||||||
|
|
||||||
// This will rebuild blockmap, among the other things
|
// This will rebuild blockmap, among the other things
|
||||||
General.Editing.Mode.OnReloadResources();
|
General.Editing.Mode.OnReloadResources();
|
||||||
|
|
||||||
// Update camera position
|
// Update camera position
|
||||||
if(options.ViewPosition.IsFinite()) mode.CenterOnCoordinates(options.ViewPosition);
|
if (options.ViewPosition.IsFinite()) mode.CenterOnCoordinates(options.ViewPosition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue