Ticket #3883: persist_match_settings_v8.patch
File persist_match_settings_v8.patch, 1.8 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/gui/gamesetup/gamesetup.js
868 868 if (Engine.ConfigDB_GetValue("user", "persistmatchsettings") != "true") 869 869 return; 870 870 871 // Load file 871 872 let settingsFile = g_IsNetworked ? g_MatchSettings_MP : g_MatchSettings_SP; 872 873 if (!Engine.FileExists(settingsFile)) 873 874 return; … … 878 879 879 880 g_IsInGuiUpdate = true; 880 881 882 // Find which settings can be changed by the user 883 let allowedSettings = ["PlayerData"]; 884 885 if (attrs.mapType == "skirmish" || attrs.mapType == "random") 886 allowedSettings = allowedSettings.concat( 887 [ 888 "GameType", 889 "WonderDuration", 890 "PopulationCap", 891 "Ceasefire", 892 "StartingResources", 893 "RevealMap", 894 "LockTeams", 895 "ExploreMap", 896 "DisableTreasures" 897 ]); 898 899 if (attrs.mapType == "random") 900 allowedSettings.push("Size"); 901 902 if (g_IsNetworked) 903 allowedSettings.push("CheatsEnabled"); 904 905 if (Engine.HasXmppClient()) 906 allowedSettings.push("RatingEnabled"); 907 908 // Only load settings which can be changed by the user 909 for (let prop in attrs.settings) 910 if (!(prop in allowedSettings)) 911 delete attrs.settings[prop]; 912 913 if (attrs.settings.RatingEnabled) 914 attrs.settings.CheatsEnabled = false; 915 916 // Restore valid matchsettings 881 917 let mapName = attrs.map || ""; 882 918 let mapSettings = attrs.settings; 883 919 … … 913 949 // Reload, as the maptype or mapfilter might have changed 914 950 initMapNameList(); 915 951 916 g_GameAttributes.settings.RatingEnabled = Engine.HasXmppClient(); 917 Engine.SetRankedGame(g_GameAttributes.settings.RatingEnabled); 952 Engine.SetRankedGame(!!g_GameAttributes.settings.RatingEnabled); 918 953 919 954 updateGUIObjects(); 920 955 }