Add developer shortcut to reload chrome files
Hitting Ctrl+Shift+C will re-initialize the chrome provider, reloading all chrome files instantly. Useful when changing the UI. Note: A new "RootWidget" was created to trap top-level (global) shortcuts instead of putting everything in Widget.
This commit is contained in:
@@ -27,6 +27,8 @@ namespace OpenRA.Graphics
|
||||
static Dictionary<string, Sheet> cachedSheets;
|
||||
static Dictionary<string, Dictionary<string, Sprite>> cachedSprites;
|
||||
|
||||
static string[] storedChromeFiles;
|
||||
|
||||
public static void Initialize(params string[] chromeFiles)
|
||||
{
|
||||
collections = new Dictionary<string, Collection>();
|
||||
@@ -34,7 +36,13 @@ namespace OpenRA.Graphics
|
||||
cachedSprites = new Dictionary<string, Dictionary<string, Sprite>>();
|
||||
|
||||
if (chromeFiles.Length == 0)
|
||||
return;
|
||||
{
|
||||
chromeFiles = storedChromeFiles;
|
||||
if (chromeFiles == null || chromeFiles.Length == 0)
|
||||
return;
|
||||
}
|
||||
else
|
||||
storedChromeFiles = chromeFiles;
|
||||
|
||||
var chrome = chromeFiles.Select(s => MiniYaml.FromFile(s)).Aggregate(MiniYaml.MergeLiberal);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user