Fixed, "Open map in current wad" action: MAPINFO data must be updated when using the action.

Changed, "Open map in current wad" action: current map resources are now carried over to the map being switched to.
This commit is contained in:
MaxED 2016-01-18 11:39:59 +00:00
parent 4837385037
commit fbb30f6f91
4 changed files with 12 additions and 22 deletions

View file

@ -366,8 +366,7 @@ namespace CodeImp.DoomBuilder.Data
LoadSprites();
//mxd. Load MAPINFO. Should happen before parisng DECORATE
Dictionary<int, string> spawnnums;
Dictionary<int, string> doomednums;
Dictionary<int, string> spawnnums, doomednums;
LoadMapInfo(out spawnnums, out doomednums);
int thingcount = LoadDecorateThings(spawnnums, doomednums);
@ -2077,6 +2076,13 @@ namespace CodeImp.DoomBuilder.Data
skyboxes = parser.Skyboxes;
}
//mxd. This updates mapinfo class only
internal void ReloadMapInfoPartial()
{
Dictionary<int, string> spawnnums, doomednums;
LoadMapInfo(out spawnnums, out doomednums);
}
//mxd. This loads (Z)MAPINFO
private void LoadMapInfo(out Dictionary<int, string> spawnnums, out Dictionary<int, string> doomednums)
{

View file

@ -1242,26 +1242,6 @@ namespace CodeImp.DoomBuilder
ChangeMapForm changemapwindow = new ChangeMapForm(map.FilePathName, map.Options);
if(changemapwindow.ShowDialog(mainwindow) != DialogResult.OK) return;
// If resources don't match, perform regular map loading
bool resourcesmismatch = changemapwindow.Options.Resources.Count != map.Options.Resources.Count;
if(!resourcesmismatch)
{
for(int i = 0; i < changemapwindow.Options.Resources.Count; i++)
{
if(changemapwindow.Options.Resources[i].location != map.Options.Resources[i].location)
{
resourcesmismatch = true;
break;
}
}
}
if(resourcesmismatch)
{
OpenMapFileWithOptions(map.FilePathName, changemapwindow.Options);
return;
}
// Display status
mainwindow.DisplayStatus(StatusType.Busy, "Switching to map '" + changemapwindow.Options.CurrentName + "'...");
WriteLogLine("Switching to map '" + changemapwindow.Options.CurrentName + "'...");

View file

@ -526,6 +526,9 @@ namespace CodeImp.DoomBuilder
// Sector textures may've been changed
data.UpdateUsedTextures();
// This will update DataManager.mapinfo only
data.ReloadMapInfoPartial();
// Skybox may've been changed
data.SetupSkybox();

View file

@ -198,6 +198,7 @@ namespace CodeImp.DoomBuilder.Windows
MapOptions newoptions = new MapOptions(mapsettings, mapslist.SelectedItems[0].Text, options.UseLongTextureNames);
newoptions.ConfigFile = options.ConfigFile;
newoptions.ScriptCompiler = options.ScriptCompiler;
newoptions.CopyResources(options.Resources);
options = newoptions;
// Hide window