Add dynamic map refresh

This commit is contained in:
Gustas
2022-02-10 14:57:43 +02:00
committed by Matthias Mailänder
parent 61df7974b0
commit b254eb0f3d
6 changed files with 263 additions and 46 deletions

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2021 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2022 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of
@@ -158,7 +158,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic
// Loading into the map editor
Game.BeforeGameStart += RemoveShellmapUI;
var onSelect = new Action<string>(uid => LoadMapIntoEditor(modData.MapCache[uid].Uid));
var onSelect = new Action<string>(uid =>
{
if (modData.MapCache[uid].Status != MapStatus.Available)
SwitchMenu(MenuType.Extras);
else
LoadMapIntoEditor(modData.MapCache[uid].Uid);
});
var newMapButton = widget.Get<ButtonWidget>("NEW_MAP_BUTTON");
newMapButton.OnClick = () =>