Opened 9 years ago
Last modified 8 years ago
#3355 closed defect
[PATCH] Move gamesetup strings to simulation/data/settings/ — at Version 20
Reported by: | elexis | Owned by: | |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 20 |
Component: | UI & Simulation | Keywords: | patch |
Cc: | Patch: |
Description (last modified by )
Many strings are hardcoded in the gamesetup and used in other places like the lobby, session and summary screen and will also be used in the visual replay menu (#3258).
The affected settings are:
AI Difficulties
Ceasefire
GameSpeeds
GameTypes
MapTypes
MapSizes
PlayerDefaults
PopulationCapacity
StartingResources
The strings should be moved to simulation/data/settings/
and treated consistently, so that redundant code can be removed.
Notice: For visual replay menu, MapSizes
and PlayerDefaults
are not required to be moved, as they are present in functions_utility.js
Refs #3049
Change History (48)
by , 9 years ago
Attachment: | t3355_move_gamesetup_strings_v1.patch added |
---|
comment:1 by , 9 years ago
Keywords: | patch review added |
---|---|
Milestone: | Backlog → Alpha 19 |
Summary: | Move gamesetup strings to simulation/data/settings/ → [PATCH] Move gamesetup strings to simulation/data/settings/ |
comment:2 by , 9 years ago
# 1. After applying the patch make sure the old files are actually removed rm binaries/data/mods/public/simulation/data/game_speeds.json rm binaries/data/mods/public/simulation/data/map_sizes.json rm binaries/data/mods/public/simulation/data/player_defaults.json rm -R binaries/data/mods/public/gui/gamesetup/victory_conditions # AI difficulties were hardcoded in aiconfig.js # Map types were hardcoded in gamesetup.js and lobby.js # Ceasefire, starting resources, population capacity were hardcoded in gamesetup.js # 2. Make sure the removed files are unrevisioned too svn rm binaries/data/mods/public/simulation/data/game_speeds.json svn rm binaries/data/mods/public/simulation/data/map_sizes.json svn rm binaries/data/mods/public/simulation/data/player_defaults.json svn rm binaries/data/mods/public/gui/gamesetup/victory_conditions/ # 3. Make sure the new files are all revisioned svn add binaries/data/mods/public/gui/common/settings.js svn add binaries/data/mods/public/simulation/data/settings/
Also "map_sizes.json" and "player_defaults.json" in http://trac.wildfiregames.com/wiki/Random_Map_Generator_Internals should be updated.
by , 9 years ago
Attachment: | t3355_move_gamesetup_strings_v1.1.patch added |
---|
Doesn't remove the context of existing translation.
by , 9 years ago
Attachment: | t3355_move_gamesetup_strings_v1.2.patch added |
---|
Updates the translation extractor to support context for json files (to correctly extract the translated strings of our new files). To quickly verify the function, insert if templateSettings["output"] != "public-simulation-other.pot": continue;
to L74 of updateTemplates.py
.
by , 9 years ago
Attachment: | t3355_move_gamesetup_strings_v2.patch added |
---|
by , 9 years ago
Attachment: | t3355_move_gamesetup_strings_v2.1.patch added |
---|
Fixes wrong TranslatedKeys
entry in the GameTypes
json files.
by , 9 years ago
Attachment: | t3355_translate_json_files_with_context_v1.patch added |
---|
Splitting the patch into many parts now. This patch allows translating JSON files with context. It tells the translation extractor to add the context, which is given as a parameter in the binaries/data/mods/mod/l10n/messages.json
file.
by , 9 years ago
Attachment: | t3355_move_player_limit_v1.patch added |
---|
Moves "MaxPlayers": 8
and MaxTeams": 4
and creates the settings.js
file needed for all further patches.
by , 9 years ago
Attachment: | t3355_move_player_limit_v2.patch added |
---|
Doesn't create player_limit.json
but moves the constant to settings.js
. Doesn't show a popup anymore, but returns immediatel on error. Needs to wait one onTick
in session.js, otherwise it segfaults.
by , 9 years ago
Attachment: | t3355_move_player_limit_v2.1.patch added |
---|
Renamed variables, changed comments, added newlines.
by , 9 years ago
Attachment: | t3355_move_player_limit_v3.patch added |
---|
Split once more. This is the smallest patch possible to move the player limits.
by , 9 years ago
Attachment: | t3355_move_ceasefire_v1.patch added |
---|
Also includes the 1-4min ceasefire options the community wished for.
by , 9 years ago
Attachment: | t3355_move_ceasefire_v1.1.patch added |
---|
Makes the translation context coherent for the case unknown
.
by , 9 years ago
Attachment: | t3355_move_ceasefire_v1.2.patch added |
---|
Removes unused function translateCeasefire
.
by , 9 years ago
Attachment: | t3355_move_ceasefire_v2.patch added |
---|
Broke uniform loading of files to remove redundant ceasefire translations. Also a simplification in gamesetup error handling and made g_Ceasefire
const.
by , 9 years ago
Attachment: | t3355_move_ceasefire_v2.1.patch added |
---|
Alternative version where undefined
instead of false
is returned in case of error.
by , 9 years ago
Attachment: | t3355_move_starting_resources_v1.patch added |
---|
by , 9 years ago
Attachment: | t3355_move_starting_resources_v1.1.patch added |
---|
After a review by mimo: Renamed loadAvailableSettings
and in case of error, print all erroneous files.
by , 9 years ago
Attachment: | t3355_move_population_capacities_v1.patch added |
---|
by , 9 years ago
Attachment: | t3355_move_game_speeds_v1.patch added |
---|
by , 9 years ago
Attachment: | t3355_move_game_speeds_v1.1.patch added |
---|
Simplifies that changed line in settings.js
, renames m_IsReplay
to m_IsVisualReplay
and CGame::StartReplay
to CGame::StartVisualReplay
so that it's clear that this code is not run in non-visual replaymode (after a review by mimo).
by , 9 years ago
Attachment: | t3355_move_gametypes_v1.patch added |
---|
Don't forget to delete gui/gamesetup/victory_conditions/
by , 9 years ago
Attachment: | t3355_move_gametypes_v2.patch added |
---|
Derives the name element from the filename and changes variable names to "victory conditions", as we might support having multiple of them simultaneously in the future.
by , 9 years ago
Attachment: | t3355_move_gametypes_v3.patch added |
---|
by , 9 years ago
Attachment: | t3355_move_maptypes_v1.patch added |
---|
comment:12 by , 9 years ago
Description: | modified (diff) |
---|
comment:14 by , 9 years ago
Description: | modified (diff) |
---|
by , 9 years ago
Attachment: | t3355_move_ai_difficulties_v1.patch added |
---|
comment:15 by , 9 years ago
Some comments for that patch:
aiconfig.js
function init(settings)
: moved both arrays used tosettings.js
and simplifiedfunction selectAI(idx)
:id
andname
were unusedfunction returnAI()
: only simplifications and style fix
gamesetup.js
- doesn't transfer
g_AIs
anymore, since it is accessible fromg_Settings
aiCodes
: unused variable
- doesn't transfer
Notice: For visual replay menu, MapSizes
and PlayerDefaults
are not required to be moved, as they are present in functions_utility.js
. We might push this to A20 after the next commit.
comment:17 by , 9 years ago
Description: | modified (diff) |
---|---|
Keywords: | review removed |
Milestone: | Alpha 19 → Alpha 20 |
by , 9 years ago
Attachment: | t3355_fix_translation_context_v1.patch added |
---|
The translations of the starting resources were still extracted correctly after r17052, but the translation context wasn't handed over anymore to the actual translation call.
comment:20 by , 8 years ago
Description: | modified (diff) |
---|
Moves all the hardcoded values from lobby/gamesetup/session/summary to
simulation/data
. Doesn't break atlas. Notice that the AI difficulties, ceasefire times, starting resources and maptypes have their translation context removed. Includes some more ceasefire times desired by the community.Reintroduces the code that was removed in r16840 for non-random maps, so that both #3001 and #3209 are covered. That code was necessary for a bug that was explained in IRC on 2015-01-27 at 4pm: < niektb> Pick a skirmish map, set the conditions to None and then change to a scenario that has a Conquest condition. You'll see that when you load the map no victory conditions are set.
You can test that all settings are accepted correctly by starting a game and comparing the settings in the commands.txt (improve json readability with http://jsonlint.com/)