Changeset 24979
- Timestamp:
- Mar 2, 2021, 4:43:44 PM (3 years ago)
- Location:
- ps/trunk
- Files:
-
- 31 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/binaries/data/mods/mod/gui/common/modern/styles.xml
r24439 r24979 31 31 sprite="ModernDarkBoxGoldNoTop" 32 32 sprite_selectarea="ModernDarkBoxWhite" 33 sprite_heading="ModernDarkBoxGoldNoBottom"34 33 textcolor="white" 35 34 textcolor_selected="white" -
ps/trunk/binaries/data/mods/mod/gui/modmod/modmod.xml
r24439 r24979 102 102 103 103 <object name="modsEnabledList" 104 style="Modern List"104 style="ModernList" 105 105 type="olist" 106 106 size="0 25 100%-32-2-2 100%" -
ps/trunk/binaries/data/mods/public/gui/gamesetup/Controls/GameSettingsControl.js
r24900 r24979 107 107 if (initData && initData.map && initData.mapType) 108 108 { 109 Object.defineProperty(this, "autostart", { 110 "value": true, 111 "writable": false, 112 "configurable": false 113 }); 109 if (initData.autostart) 110 Object.defineProperty(this, "autostart", { 111 "value": true, 112 "writable": false, 113 "configurable": false 114 }); 114 115 115 116 // TODO: Fix g_GameAttributes, g_GameAttributes.settings, … … 117 118 // copy over each attribute individually when receiving 118 119 // settings from the server or the local file. 119 g_GameAttributes = { 120 "mapType": initData.mapType, 121 "map": initData.map 122 }; 120 g_GameAttributes = initData; 123 121 124 122 this.updateGameAttributes(); -
ps/trunk/binaries/data/mods/public/gui/loadgame/SavegameList.js
r22985 r24979 9 9 class SavegameList 10 10 { 11 constructor( )11 constructor() 12 12 { 13 13 this.savedGamesMetadata = []; 14 14 this.selectionChangeHandlers = []; 15 16 17 18 19 20 21 15 22 16 23 this.gameSelection = Engine.GetGUIObjectByName("gameSelection"); … … 68 75 69 76 if (this.compatibilityFilter.checked) 70 savedGames = savedGames.filter(game => this.isCompatibleSavegame(game.metadata, engineInfo)); 77 savedGames = savedGames.filter(game => { 78 return this.isCompatibleSavegame(game.metadata, engineInfo) && 79 this.campaignFilter(game.metadata, this.campaignRun); 80 }); 81 else if (this.campaignRun) 82 savedGames = savedGames.filter(game => this.campaignFilter(game.metadata, this.campaignRun)); 83 71 84 72 85 this.gameSelection.enabled = !!savedGames.length; … … 115 128 116 129 let list = this.savedGamesMetadata.map(metadata => { 117 let isCompatible = this.isCompatibleSavegame(metadata, engineInfo); 130 let isCompatible = this.isCompatibleSavegame(metadata, engineInfo) && 131 this.campaignFilter(metadata, this.campaignRun); 118 132 return { 119 133 "date": this.generateSavegameDateString(metadata, engineInfo), … … 143 157 else if (this.gameSelection.selected >= this.savedGamesMetadata.length) 144 158 this.gameSelection.selected = this.savedGamesMetadata.length - 1; 159 160 161 162 163 164 165 166 167 145 168 } 146 169 -
ps/trunk/binaries/data/mods/public/gui/loadgame/SavegamePage.js
r24677 r24979 1 /**2 * This class architecture is an example of how to use classes3 * to encapsulate and to avoid fragmentation and globals.4 */5 var g_SavegamePage;6 7 function init(data)8 {9 g_SavegamePage = new SavegamePage(data);10 }11 12 1 /** 13 2 * This class is responsible for loading the affected GUI control classes, … … 18 7 constructor(data) 19 8 { 20 this.savegameList = new SavegameList( );9 this.savegameList = new SavegameList(); 21 10 22 11 this.savegameDetails = new SavegameDetails(); … … 47 36 } 48 37 } 38 39 40 41 42 43 44 -
ps/trunk/binaries/data/mods/public/gui/pregame/MainMenuItemHandler.js
r23701 r24979 39 39 button.caption = item.caption; 40 40 button.tooltip = item.tooltip; 41 button.enabled = item.enabled === undefined || item.enabled ;41 button.enabled = item.enabled === undefined || item.enabled; 42 42 button.onPress = this.pressButton.bind(this, item, i); 43 43 button.hidden = false; -
ps/trunk/binaries/data/mods/public/gui/pregame/MainMenuItems.js
r24726 r24979 16 16 "onPress": () => { 17 17 Engine.SwitchGuiPage("page_gamesetup.xml", { 18 18 19 "mapType": "scenario", 19 20 "map": "maps/tutorials/starting_economy_walkthrough" … … 62 63 }, 63 64 { 65 66 67 68 69 70 71 72 73 74 64 75 "caption": translate("Single-player"), 65 76 "tooltip": translate("Start, load, or replay a single-player game."), … … 73 84 }, 74 85 { 75 "caption": translate("Campaigns"),76 "tooltip": translate("Relive history through historical military campaigns. \\[NOT YET IMPLEMENTED]"),77 "enabled": false78 },79 {80 86 "caption": translate("Load Game"), 81 87 "tooltip": translate("Load a saved game."), 82 88 "onPress": () => { 83 89 Engine.PushGuiPage("page_loadgame.xml"); 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 84 117 } 85 118 }, … … 127 160 colorizeHotkey(translate("%(hotkey)s: Launch the multiplayer lobby to join and host publicly visible games and chat with other players."), "lobby") + 128 161 (Engine.StartXmppClient ? "" : translate("Launch the multiplayer lobby. \\[DISABLED BY BUILD]")), 129 "enabled": !!Engine.StartXmppClient,162 "enabled": !!Engine.StartXmppClient, 130 163 "hotkey": "lobby", 131 164 "onPress": () => { -
ps/trunk/binaries/data/mods/public/gui/pregame/mainmenu.xml
r23093 r24979 3 3 4 4 <script directory="gui/common/"/> 5 5 6 <script directory="gui/pregame/"/> 6 7 <script directory="gui/pregame/backgrounds/"/> -
ps/trunk/binaries/data/mods/public/gui/session/MenuButtons.js
r24215 r24979 62 62 Engine.PushGuiPage( 63 63 "page_loadgame.xml", 64 { "savedGameData": getSavedGameData() }, 64 { 65 "savedGameData": getSavedGameData(), 66 "campaignRun": g_CampaignSession ? g_CampaignSession.run.filename : null 67 }, 65 68 resumeGame); 66 69 } -
ps/trunk/binaries/data/mods/public/gui/session/session.js
r24952 r24979 267 267 } 268 268 269 270 271 269 272 let mapCache = new MapCache(); 270 273 g_Cheats = new Cheats(); … … 525 528 Engine.SendUnregisterGame(); 526 529 527 Engine.SwitchGuiPage("page_summary.xml",{530 { 528 531 "sim": simData, 529 532 "gui": { … … 535 538 "replaySelectionData": g_ReplaySelectionData 536 539 } 537 }); 540 }; 541 542 if (g_GameAttributes.campaignData) 543 { 544 let menu = g_CampaignSession.getMenu(); 545 if (g_GameAttributes.campaignData.skipSummary) 546 { 547 Engine.SwitchGuiPage(menu); 548 return; 549 } 550 summaryData.campaignData = { "filename": g_GameAttributes.campaignData.run }; 551 summaryData.nextPage = menu; 552 } 553 554 Engine.SwitchGuiPage("page_summary.xml", summaryData); 538 555 } 539 556 -
ps/trunk/binaries/data/mods/public/gui/session/session.xml
r24565 r24979 4 4 5 5 <script directory="gui/common/"/> 6 6 7 <script directory="gui/maps/"/> 7 8 <script directory="gui/session/"/> 9 8 10 <script directory="gui/session/chat/"/> 9 11 <script directory="gui/session/developer_overlay/"/> -
ps/trunk/binaries/data/mods/public/gui/summary/summary.js
r24721 r24979 474 474 "summarySelection": summarySelection 475 475 }); 476 477 476 478 else 477 479 Engine.SwitchGuiPage("page_pregame.xml"); -
ps/trunk/binaries/data/mods/public/l10n/.tx/config
r21911 r24979 30 30 file_filter = <lang>.public-gui-other.po 31 31 source_file = public-gui-other.pot 32 33 34 35 36 32 37 source_lang = en 33 38 -
ps/trunk/binaries/data/mods/public/l10n/messages.json
r24947 r24979 237 237 ], 238 238 "options": { 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 239 297 } 240 298 } -
ps/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
r24967 r24979 210 210 "mapSettings": InitAttributes.settings 211 211 }; 212 213 214 215 216 217 218 219 220 221 222 212 223 }; 213 224 … … 2013 2024 "GetInitAttributes": 1, 2014 2025 "GetReplayMetadata": 1, 2026 2015 2027 "GetRenamedEntities": 1, 2016 2028 "ClearRenamedEntities": 1, -
ps/trunk/source/ps/scripting/JSInterface_VFS.cpp
r24333 r24979 1 /* Copyright (C) 202 0Wildfire Games.1 /* Copyright (C) 202 Wildfire Games. 2 2 * This file is part of 0 A.D. 3 3 * … … 210 210 } 211 211 212 213 214 215 216 217 218 219 220 221 222 223 212 224 bool JSI_VFS::PathRestrictionMet(ScriptInterface::CmptPrivate* pCmptPrivate, const std::vector<CStrW>& validPaths, const CStrW& filePath) 213 225 { … … 260 272 scriptInterface.RegisterFunction<JS::Value, std::wstring, &Script_ReadJSONFile_GUI>("ReadJSONFile"); 261 273 scriptInterface.RegisterFunction<void, std::wstring, JS::HandleValue, &WriteJSONFile>("WriteJSONFile"); 274 262 275 } 263 276 -
ps/trunk/source/ps/scripting/JSInterface_VFS.h
r24177 r24979 1 /* Copyright (C) 20 18Wildfire Games.1 /* Copyright (C) 20 Wildfire Games. 2 2 * This file is part of 0 A.D. 3 3 * … … 48 48 void WriteJSONFile(ScriptInterface::CmptPrivate* pCmptPrivate, const std::wstring& filePath, JS::HandleValue val1); 49 49 50 51 52 53 50 54 // Tests whether the current script context is allowed to read from the given directory 51 55 bool PathRestrictionMet(ScriptInterface::CmptPrivate* pCmptPrivate, const std::vector<CStrW>& validPaths, const CStrW& filePath);
Note:
See TracChangeset
for help on using the changeset viewer.