From 8f584a32c7230cf62c99e32850ee405cf2fde69d Mon Sep 17 00:00:00 2001 From: Daniel Harvey Date: Mon, 30 Mar 2026 21:27:06 -0600 Subject: [PATCH] gen(bar_codemod): detach-bar-modules --- common/springOverrides.lua | 2 +- gamedata/alldefs_post.lua | 4 +- gamedata/unitdefs.lua | 4 +- gamedata/unitdefs_post.lua | 6 +- init.lua | 8 +- luaintro/Addons/main.lua | 6 +- luaintro/Addons/music.lua | 22 +- .../Utilities/damgam_lib/position_checks.lua | 2 +- luarules/gadgets/ai_ruin_blueprint_tester.lua | 2 +- luarules/gadgets/ai_ruins.lua | 2 +- luarules/gadgets/api_build_blocking.lua | 4 +- luarules/gadgets/api_damage_stats.lua | 2 +- luarules/gadgets/api_permissions.lua | 10 +- luarules/gadgets/cmd_dev_helpers.lua | 2 +- luarules/gadgets/cmd_get_player_data.lua | 4 +- luarules/gadgets/cmd_give.lua | 4 +- luarules/gadgets/cmd_idle_players.lua | 2 +- luarules/gadgets/cmd_limiter.lua | 2 +- luarules/gadgets/cmd_paused_is_paused.lua | 2 +- luarules/gadgets/cmd_sendcommand.lua | 4 +- luarules/gadgets/cmd_undo.lua | 4 +- luarules/gadgets/dbg_synced_proxy.lua | 2 +- luarules/gadgets/dbg_test_env_helper.lua | 2 +- luarules/gadgets/dbg_unitposition_logger.lua | 2 +- luarules/gadgets/game_allyteam_ranking.lua | 2 +- luarules/gadgets/game_assistdronespawn.lua | 2 +- luarules/gadgets/game_autocolors.lua | 4 +- luarules/gadgets/game_commander_builder.lua | 2 +- luarules/gadgets/game_easter_eggs.lua | 2 +- luarules/gadgets/game_end.lua | 2 +- luarules/gadgets/game_ffa_start_setup.lua | 4 +- luarules/gadgets/game_initial_spawn.lua | 4 +- luarules/gadgets/game_logger.lua | 2 +- luarules/gadgets/game_replace_afk_players.lua | 6 +- luarules/gadgets/game_selfd_resign.lua | 2 +- luarules/gadgets/game_team_power_watcher.lua | 4 +- luarules/gadgets/game_tech_blocking.lua | 4 +- luarules/gadgets/game_volcano_pyroclastic.lua | 2 +- luarules/gadgets/gfx_raptor_scum_gl4.lua | 4 +- .../graphics_territorial_domination.lua | 2 +- .../gadgets/include/startbox_utilities.lua | 2 +- luarules/gadgets/map_lava.lua | 2 +- luarules/gadgets/map_waterlevel.lua | 4 +- luarules/gadgets/mo_ffa.lua | 4 +- luarules/gadgets/pve_areahealers.lua | 8 +- luarules/gadgets/pve_boss_drones.lua | 4 +- luarules/gadgets/pve_builder_controller.lua | 6 +- luarules/gadgets/pve_nuke_controller.lua | 6 +- luarules/gadgets/pve_supply_drops.lua | 6 +- luarules/gadgets/raptor_spawner_defense.lua | 6 +- .../ruins/Blueprints/BYAR/blueprint_tiers.lua | 2 +- luarules/gadgets/scav_cloud_spawner.lua | 4 +- luarules/gadgets/scav_lootbox_collector.lua | 8 +- luarules/gadgets/scav_spawner_defense.lua | 6 +- luarules/gadgets/system_info.lua | 2 +- luarules/gadgets/unit_direct_control.lua | 2 +- luarules/gadgets/unit_intergrated_hats.lua | 4 +- luarules/gadgets/unit_xmas.lua | 2 +- luarules/gadgets/unit_zombies.lua | 2 +- .../gui_quick_start/gui_quick_start.lua | 2 +- .../gui_tech_points/gui_tech_points.lua | 2 +- .../gui_territorial_domination.lua | 10 +- luaui/Widgets/api_blueprint.lua | 2 +- luaui/Widgets/api_ignore.lua | 8 +- luaui/Widgets/api_playernames.lua | 6 +- luaui/Widgets/api_unit_tracker_gl4.lua | 26 +- luaui/Widgets/camera_player_tv.lua | 30 +- luaui/Widgets/cmd_context_build.lua | 2 +- luaui/Widgets/cmd_gamespeed.lua | 2 +- luaui/Widgets/cmd_resolution_switcher.lua | 12 +- luaui/Widgets/cmd_share_unit.lua | 4 +- luaui/Widgets/dbg_ceg_auto_reloader.lua | 2 +- luaui/Widgets/dbg_engine_shader_reload.lua | 2 +- luaui/Widgets/dbg_ffa_startpoints_picker.lua | 2 +- luaui/Widgets/dbg_reloadcob.lua | 2 +- luaui/Widgets/dbg_test_headless_overrides.lua | 2 +- luaui/Widgets/dbg_test_runner.lua | 4 +- luaui/Widgets/dbg_test_runner_watchdog.lua | 2 +- luaui/Widgets/dbg_widget_auto_reloader.lua | 2 +- luaui/Widgets/dbg_widget_profiler.lua | 2 +- luaui/Widgets/death_messages.lua | 2 +- luaui/Widgets/dev_autocheat.lua | 2 +- luaui/Widgets/flowui_gl4.lua | 12 +- luaui/Widgets/gfx_DrawUnitShape_GL4.lua | 8 +- luaui/Widgets/gfx_HighlightUnit_GL4.lua | 2 +- luaui/Widgets/gfx_decals_gl4.lua | 2 +- luaui/Widgets/gfx_deferred_rendering_GL4.lua | 8 +- luaui/Widgets/gfx_distortion_gl4.lua | 8 +- luaui/Widgets/gfx_glass.lua | 2 +- luaui/Widgets/gfx_norush_timer_gl4.lua | 2 +- luaui/Widgets/gui_advplayerslist.lua | 92 +- luaui/Widgets/gui_advplayerslist_mascot.lua | 2 +- .../Widgets/gui_advplayerslist_music_new.lua | 44 +- .../Widgets/gui_advplayerslist_unittotals.lua | 2 +- luaui/Widgets/gui_awards.lua | 42 +- luaui/Widgets/gui_build_eta.lua | 8 +- luaui/Widgets/gui_buildmenu.lua | 6 +- luaui/Widgets/gui_changelog_info.lua | 2 +- luaui/Widgets/gui_chat.lua | 56 +- luaui/Widgets/gui_clearmapmarks.lua | 2 +- luaui/Widgets/gui_com_nametags.lua | 18 +- luaui/Widgets/gui_converter_usage.lua | 8 +- luaui/Widgets/gui_ecostats.lua | 6 +- luaui/Widgets/gui_factionpicker.lua | 10 +- luaui/Widgets/gui_game_type_info.lua | 6 +- luaui/Widgets/gui_gameinfo.lua | 36 +- luaui/Widgets/gui_gridmenu.lua | 28 +- luaui/Widgets/gui_ground_ao_plates_gl4.lua | 2 +- luaui/Widgets/gui_healthbars_gl4.lua | 12 +- luaui/Widgets/gui_idle_builders.lua | 14 +- luaui/Widgets/gui_info.lua | 94 +- luaui/Widgets/gui_keybind_info.lua | 172 ++-- luaui/Widgets/gui_language.lua | 6 +- luaui/Widgets/gui_mapinfo.lua | 2 +- luaui/Widgets/gui_options.lua | 950 +++++++++--------- luaui/Widgets/gui_ordermenu.lua | 6 +- luaui/Widgets/gui_pausescreen.lua | 2 +- luaui/Widgets/gui_pip.lua | 42 +- luaui/Widgets/gui_pregameui.lua | 28 +- luaui/Widgets/gui_pregameui_draft.lua | 54 +- luaui/Widgets/gui_prospector.lua | 2 +- luaui/Widgets/gui_rank_icons_gl4.lua | 4 +- luaui/Widgets/gui_raptorStatsPanel.lua | 54 +- luaui/Widgets/gui_reclaiminfo.lua | 2 +- luaui/Widgets/gui_rejoinprogress.lua | 2 +- luaui/Widgets/gui_scavStatsPanel.lua | 54 +- luaui/Widgets/gui_scavenger_info.lua | 4 +- luaui/Widgets/gui_screen_mode_info.lua | 2 +- luaui/Widgets/gui_spectatingstats.lua | 4 +- luaui/Widgets/gui_spectator_hud.lua | 4 +- luaui/Widgets/gui_teamstats.lua | 36 +- luaui/Widgets/gui_top_bar.lua | 78 +- luaui/Widgets/gui_unit_stats.lua | 4 +- luaui/Widgets/gui_unitgroups.lua | 8 +- luaui/Widgets/gui_vote_interface.lua | 12 +- luaui/Widgets/map_draw_blocker.lua | 4 +- luaui/Widgets/map_edge_extension2.lua | 2 +- luaui/Widgets/map_grass_gl4.lua | 6 +- .../map_start_position_suggestions.lua | 18 +- luaui/Widgets/map_startbox.lua | 16 +- luaui/Widgets/map_startpolygon_gl4.lua | 4 +- luaui/Widgets/snd_notifications.lua | 12 +- ...d_notifications_addon_scavraptorstatus.lua | 6 +- luaui/Widgets/stats_damage.lua | 2 +- luaui/Widgets/tweakdefs_unit_translations.lua | 4 +- luaui/Widgets/unit_attackMoveNotification.lua | 4 +- luaui/Widgets/unit_auto_group.lua | 6 +- luaui/Widgets/unit_share_tracker.lua | 2 +- luaui/Widgets/widget_selector.lua | 26 +- luaui/configs/DeferredLightsGL4config.lua | 2 +- luaui/configs/gridmenu_config.lua | 8 +- luaui/configs/gridmenu_layouts.lua | 2 +- luaui/i18nhelpers.lua | 18 +- luaui/main.lua | 2 +- modules/graphics/instancevboidtable.lua | 4 +- modules/graphics/instancevbotable.lua | 8 +- units/Scavengers/Boss/scavengerbossv4.lua | 2 +- .../raptors/Queens/raptor_queen_easy.lua | 2 +- .../raptors/Queens/raptor_queen_epic.lua | 2 +- .../raptors/Queens/raptor_queen_hard.lua | 2 +- .../raptors/Queens/raptor_queen_normal.lua | 2 +- .../raptors/Queens/raptor_queen_veryeasy.lua | 2 +- .../raptors/Queens/raptor_queen_veryhard.lua | 2 +- 163 files changed, 1299 insertions(+), 1299 deletions(-) diff --git a/common/springOverrides.lua b/common/springOverrides.lua index 0e0829b56fa..c421b8285c7 100644 --- a/common/springOverrides.lua +++ b/common/springOverrides.lua @@ -37,7 +37,7 @@ if Spring.GetModOptions then -- Returns a copy of the modOptions table. Slower, but allows iterating over -- the returned table using pairs/ipairs. - Spring.GetModOptionsCopy = function () + GetModOptionsCopy = function () return table.copy(modOptions) end end diff --git a/gamedata/alldefs_post.lua b/gamedata/alldefs_post.lua index 971e9ef78dc..bd67b7b20eb 100644 --- a/gamedata/alldefs_post.lua +++ b/gamedata/alldefs_post.lua @@ -79,7 +79,7 @@ function UnitDef_Post(name, uDef) -- Cache holiday checks for performance if not holidays then - holidays = Spring.Utilities.Gametype.GetCurrentHolidays() + holidays = Utilities.Gametype.GetCurrentHolidays() isAprilFools = holidays["aprilfools"] isHalloween = holidays["halloween"] isXmas = holidays["xmas"] @@ -1773,7 +1773,7 @@ function WeaponDef_Post(name, wDef) modOptions = Spring.GetModOptions() end if isXmas == nil then - isXmas = Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"] + isXmas = Utilities.Gametype.GetCurrentHolidays()["xmas"] end local customparams = wDef.customparams diff --git a/gamedata/unitdefs.lua b/gamedata/unitdefs.lua index ec86b268582..14296515d4f 100644 --- a/gamedata/unitdefs.lua +++ b/gamedata/unitdefs.lua @@ -46,8 +46,8 @@ end local luaFiles = VFS.DirList('units/', '*.lua', nil, true) local legionEnabled = Spring.GetModOptions().experimentallegionfaction -local scavengersEnabled = Spring.Utilities.Gametype.IsScavengers() -local raptorsEnabled = Spring.Utilities.Gametype.IsRaptors() +local scavengersEnabled = Utilities.Gametype.IsScavengers() +local raptorsEnabled = Utilities.Gametype.IsRaptors() if Spring.GetModOptions().ruins == "enabled" then legionEnabled = true diff --git a/gamedata/unitdefs_post.lua b/gamedata/unitdefs_post.lua index 8ba2d7a7e06..177e8d917b0 100644 --- a/gamedata/unitdefs_post.lua +++ b/gamedata/unitdefs_post.lua @@ -221,8 +221,8 @@ end local function preProcessTweakOptions() local modOptions = {} - if Spring.GetModOptionsCopy then - modOptions = Spring.GetModOptionsCopy() + if GetModOptionsCopy then + modOptions = GetModOptionsCopy() end -------------------------------------------------------------------------------- @@ -275,7 +275,7 @@ local function preProcessTweakOptions() Spring.Echo("Error parsing and decoding tweakdef", name, modOptions[name], "Error :" .. postsFuncStr) end else - local success, tweakunits = pcall(Spring.Utilities.CustomKeyToUsefulTable, modOptions[name]) + local success, tweakunits = pcall(Utilities.CustomKeyToUsefulTable, modOptions[name]) if success then if type(tweakunits) == "table" then Spring.Echo("Loading ".. name .. " modoption") diff --git a/init.lua b/init.lua index 1eb9d0840a7..5d0904a4304 100644 --- a/init.lua +++ b/init.lua @@ -45,14 +45,14 @@ local commonFunctions = { if commonFunctions.spring[environment] then local springFunctions = VFS.Include('common/springFunctions.lua') - Spring.Utilities = Spring.Utilities or springFunctions.Utilities - Spring.Debug = Spring.Debug or springFunctions.Debug + Utilities = Utilities or springFunctions.Utilities + Debug = Debug or springFunctions.Debug VFS.Include('common/platformFunctions.lua') VFS.Include('common/constants.lua') end if commonFunctions.i18n[environment] then - Spring.I18N = Spring.I18N or VFS.Include("modules/i18n/i18n.lua") + I18N = I18N or VFS.Include("modules/i18n/i18n.lua") end if commonFunctions.cmd[environment] then @@ -61,7 +61,7 @@ if commonFunctions.cmd[environment] then end if commonFunctions.map[environment] then - Spring.Lava = VFS.Include("modules/lava.lua") + Lava = VFS.Include("modules/lava.lua") end if commonFunctions.graphics[environment] then diff --git a/luaintro/Addons/main.lua b/luaintro/Addons/main.lua index 9bec09a3f78..feeb3459cd4 100644 --- a/luaintro/Addons/main.lua +++ b/luaintro/Addons/main.lua @@ -170,11 +170,11 @@ local tipKeys = { local randomTip = '' if showTips then local index = math.random(#tipKeys) - randomTip = Spring.I18N('tips.loadscreen.' .. tipKeys[index]) + randomTip = I18N('tips.loadscreen.' .. tipKeys[index]) end if showDonationTip then - randomTip = Spring.I18N('tips.loadscreen.donations') + randomTip = I18N('tips.loadscreen.donations') end @@ -705,7 +705,7 @@ function addon.DrawLoadScreen() gl.Translate(vsx/2, (usingIntelPotato and 0.938 or 0.988)*vsy, 0) font2:SetTextColor(0.8,0.8,0.8,1) font2:SetOutlineColor(0,0,0,0.8) - font2:Print(Spring.I18N('ui.loadScreen.lowRamWarning', { textColor = '\255\200\200\200', warnColor = '\255\255\255\255' }), 0, 0, height*0.66, "oac") + font2:Print(I18N('ui.loadScreen.lowRamWarning', { textColor = '\255\200\200\200', warnColor = '\255\255\255\255' }), 0, 0, height*0.66, "oac") gl.PopMatrix() end end diff --git a/luaintro/Addons/music.lua b/luaintro/Addons/music.lua index 866887d6029..31a602dd9bb 100644 --- a/luaintro/Addons/music.lua +++ b/luaintro/Addons/music.lua @@ -42,14 +42,14 @@ function addon.Initialize() -- Events ---------------------------------------------------------------------------------------------------------------------- -- Raptors - if Spring.Utilities.Gametype.IsRaptors() then + if Utilities.Gametype.IsRaptors() then table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal..'/events/raptors/loading', allowedExtensions)) elseif Spring.GetConfigInt('UseSoundtrackRaptors', 0) == 1 then table.append(musicPlaylist, VFS.DirList(musicDirOriginal..'/events/raptors/loading', allowedExtensions)) end -- Scavengers - if Spring.Utilities.Gametype.IsScavengers() then + if Utilities.Gametype.IsScavengers() then table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal..'/events/scavengers/loading', allowedExtensions)) elseif Spring.GetConfigInt('UseSoundtrackScavengers', 0) == 1 then table.append(musicPlaylist, VFS.DirList(musicDirOriginal..'/events/scavengers/loading', allowedExtensions)) @@ -57,37 +57,37 @@ function addon.Initialize() -- April Fools ---- Day 1 - 100% chance - if Spring.GetConfigInt('UseSoundtrackAprilFools', 1) == 1 and Spring.Utilities.Gametype.GetCurrentHolidays()["aprilfools_specialDay"] then + if Spring.GetConfigInt('UseSoundtrackAprilFools', 1) == 1 and Utilities.Gametype.GetCurrentHolidays()["aprilfools_specialDay"] then table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal..'/events/aprilfools/loading', allowedExtensions)) ---- Day 2-7 - 50% chance - elseif Spring.GetConfigInt('UseSoundtrackAprilFools', 1) == 1 and Spring.Utilities.Gametype.GetCurrentHolidays()["aprilfools"] and math.random() <= 0.5 then + elseif Spring.GetConfigInt('UseSoundtrackAprilFools', 1) == 1 and Utilities.Gametype.GetCurrentHolidays()["aprilfools"] and math.random() <= 0.5 then table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal..'/events/aprilfools/loading', allowedExtensions)) ---- Post Event - Add to regular playlist - elseif Spring.GetConfigInt('UseSoundtrackAprilFoolsPostEvent', 0) == 1 and (not Spring.Utilities.Gametype.GetCurrentHolidays()["aprilfools"]) then + elseif Spring.GetConfigInt('UseSoundtrackAprilFoolsPostEvent', 0) == 1 and (not Utilities.Gametype.GetCurrentHolidays()["aprilfools"]) then table.append(musicPlaylist, VFS.DirList(musicDirOriginal..'/events/aprilfools/loading', allowedExtensions)) end -- Halloween ---- Halloween Day - 100% chance - if Spring.GetConfigInt('UseSoundtrackHalloween', 1) == 1 and Spring.Utilities.Gametype.GetCurrentHolidays()["halloween_specialDay"] then + if Spring.GetConfigInt('UseSoundtrackHalloween', 1) == 1 and Utilities.Gametype.GetCurrentHolidays()["halloween_specialDay"] then table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal..'/events/halloween/loading', allowedExtensions)) ---- 2 Weeks Before Halloween - 50% chance - elseif Spring.GetConfigInt('UseSoundtrackHalloween', 1) == 1 and Spring.Utilities.Gametype.GetCurrentHolidays()["halloween"] and math.random() <= 0.5 then + elseif Spring.GetConfigInt('UseSoundtrackHalloween', 1) == 1 and Utilities.Gametype.GetCurrentHolidays()["halloween"] and math.random() <= 0.5 then table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal..'/events/halloween/loading', allowedExtensions)) ---- Post Event - Add to regular playlist - elseif Spring.GetConfigInt('UseSoundtrackHalloweenPostEvent', 0) == 1 and (not Spring.Utilities.Gametype.GetCurrentHolidays()["halloween_specialDay"]) then + elseif Spring.GetConfigInt('UseSoundtrackHalloweenPostEvent', 0) == 1 and (not Utilities.Gametype.GetCurrentHolidays()["halloween_specialDay"]) then table.append(musicPlaylist, VFS.DirList(musicDirOriginal..'/events/halloween/loading', allowedExtensions)) end -- Xmas ---- Christmas Days - 100% chance - if Spring.GetConfigInt('UseSoundtrackXmas', 1) == 1 and Spring.Utilities.Gametype.GetCurrentHolidays()["xmas_specialDay"] then + if Spring.GetConfigInt('UseSoundtrackXmas', 1) == 1 and Utilities.Gametype.GetCurrentHolidays()["xmas_specialDay"] then table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal..'/events/xmas/loading', allowedExtensions)) ---- The Rest of the event - 50% chance - elseif Spring.GetConfigInt('UseSoundtrackXmas', 1) == 1 and Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"] and math.random() <= 0.5 then + elseif Spring.GetConfigInt('UseSoundtrackXmas', 1) == 1 and Utilities.Gametype.GetCurrentHolidays()["xmas"] and math.random() <= 0.5 then table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal..'/events/xmas/loading', allowedExtensions)) ---- Post Event - Add to regular playlist - elseif Spring.GetConfigInt('UseSoundtrackXmasPostEvent', 0) == 1 and (not Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"]) then + elseif Spring.GetConfigInt('UseSoundtrackXmasPostEvent', 0) == 1 and (not Utilities.Gametype.GetCurrentHolidays()["xmas"]) then table.append(musicPlaylist, VFS.DirList(musicDirOriginal..'/events/xmas/loading', allowedExtensions)) end diff --git a/luarules/Utilities/damgam_lib/position_checks.lua b/luarules/Utilities/damgam_lib/position_checks.lua index 5c7637220fd..73e48e17928 100644 --- a/luarules/Utilities/damgam_lib/position_checks.lua +++ b/luarules/Utilities/damgam_lib/position_checks.lua @@ -18,7 +18,7 @@ local mapSizeZ = Game.mapSizeZ local landLevel local seaLevel -local scavengerAllyTeamID = Spring.Utilities.GetScavAllyTeamID() +local scavengerAllyTeamID = Utilities.GetScavAllyTeamID() -- Team Startboxes local AllyTeamStartboxes = {} diff --git a/luarules/gadgets/ai_ruin_blueprint_tester.lua b/luarules/gadgets/ai_ruin_blueprint_tester.lua index 1a120531b2d..1906872db2f 100644 --- a/luarules/gadgets/ai_ruin_blueprint_tester.lua +++ b/luarules/gadgets/ai_ruin_blueprint_tester.lua @@ -1,7 +1,7 @@ local cmdname = 'ruinblueprinttest' local blueprintspath = "luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/" -local enabled = Spring.Utilities.IsDevMode() -- only enable in test environment +local enabled = Utilities.IsDevMode() -- only enable in test environment local queue = {} local mapsizeX = Game.mapSizeX local blueprintpositions = {} diff --git a/luarules/gadgets/ai_ruins.lua b/luarules/gadgets/ai_ruins.lua index 95a9843a7e0..2c2f570f29a 100644 --- a/luarules/gadgets/ai_ruins.lua +++ b/luarules/gadgets/ai_ruins.lua @@ -1,5 +1,5 @@ -if not (Spring.GetModOptions().ruins == "enabled" or (Spring.GetModOptions().ruins == "scav_only" and Spring.Utilities.Gametype.IsScavengers())) then +if not (Spring.GetModOptions().ruins == "enabled" or (Spring.GetModOptions().ruins == "scav_only" and Utilities.Gametype.IsScavengers())) then return end diff --git a/luarules/gadgets/api_build_blocking.lua b/luarules/gadgets/api_build_blocking.lua index 7d13eae76a0..93f3848c0d1 100644 --- a/luarules/gadgets/api_build_blocking.lua +++ b/luarules/gadgets/api_build_blocking.lua @@ -46,7 +46,7 @@ if gadgetHandler:IsSyncedCode() then local teamsList = Spring.GetTeamList() local ignoredTeams = {} - local scavTeamID, raptorTeamID = Spring.Utilities.GetScavTeamID(), Spring.Utilities.GetRaptorTeamID() + local scavTeamID, raptorTeamID = Utilities.GetScavTeamID(), Utilities.GetRaptorTeamID() if scavTeamID then ignoredTeams[scavTeamID] = true end @@ -75,7 +75,7 @@ if gadgetHandler:IsSyncedCode() then if Spring.IsCheatingEnabled() then return true else - local accountID = Spring.Utilities.GetAccountID(playerID) + local accountID = Utilities.GetAccountID(playerID) if _G.permissions.cmd[accountID] and not _G.isSinglePlayer then return true end diff --git a/luarules/gadgets/api_damage_stats.lua b/luarules/gadgets/api_damage_stats.lua index 834a032afe2..465193b9e1a 100644 --- a/luarules/gadgets/api_damage_stats.lua +++ b/luarules/gadgets/api_damage_stats.lua @@ -30,7 +30,7 @@ local gameType function gadget:Initialize() local tList = Spring.GetTeamList() - if Spring.Utilities.Gametype.IsFFA() then + if Utilities.Gametype.IsFFA() then gameType = "free for all" return end diff --git a/luarules/gadgets/api_permissions.lua b/luarules/gadgets/api_permissions.lua index b954140a263..8f778892a89 100644 --- a/luarules/gadgets/api_permissions.lua +++ b/luarules/gadgets/api_permissions.lua @@ -23,19 +23,19 @@ local trustedNames = powerusers.trustedNames powerusers.trustedNames = nil if trustedNames then for _, playerID in ipairs(Spring.GetPlayerList()) do - local accountID = Spring.Utilities.GetAccountID(playerID) + local accountID = Utilities.GetAccountID(playerID) if not powerusers[accountID] and trustedNames[Spring.GetPlayerInfo(playerID)] then powerusers[accountID] = trustedNames[Spring.GetPlayerInfo(playerID)] end end end -local numPlayers = Spring.Utilities.GetPlayerCount() +local numPlayers = Utilities.GetPlayerCount() -- give permissions when in singleplayer if numPlayers <= 1 then for _, playerID in ipairs(Spring.GetPlayerList()) do - local accountID = Spring.Utilities.GetAccountID(playerID) + local accountID = Utilities.GetAccountID(playerID) local _, _, spec = Spring.GetPlayerInfo(playerID) -- dont give permissions to the spectators when there is a player is playing @@ -70,8 +70,8 @@ _G.isSinglePlayer = isSinglePlayer -- and patch GetAccountID so other gadgets also see it. local trustedNameAccountIDs = {} local nextSyntheticAccountID = -1000 -local originalGetAccountID = Spring.Utilities.GetAccountID -Spring.Utilities.GetAccountID = function(playerID) +local originalGetAccountID = Utilities.GetAccountID +Utilities.GetAccountID = function(playerID) local syntheticID = trustedNameAccountIDs[playerID] if syntheticID then return syntheticID diff --git a/luarules/gadgets/cmd_dev_helpers.lua b/luarules/gadgets/cmd_dev_helpers.lua index d874582f163..06ed4362d69 100644 --- a/luarules/gadgets/cmd_dev_helpers.lua +++ b/luarules/gadgets/cmd_dev_helpers.lua @@ -31,7 +31,7 @@ function isAuthorized(playerID, subPermission) return true end local playername = Spring.GetPlayerInfo(playerID) - local accountID = Spring.Utilities.GetAccountID(playerID) + local accountID = Utilities.GetAccountID(playerID) local hasPermission = false -- check catch-all devhelpers permission if (_G and _G.permissions.devhelpers and _G.permissions.devhelpers[accountID]) or (SYNCED and SYNCED.permissions.devhelpers and SYNCED.permissions.devhelpers[accountID]) then diff --git a/luarules/gadgets/cmd_get_player_data.lua b/luarules/gadgets/cmd_get_player_data.lua index 7d9dcba1b50..bddaad9e4df 100644 --- a/luarules/gadgets/cmd_get_player_data.lua +++ b/luarules/gadgets/cmd_get_player_data.lua @@ -22,7 +22,7 @@ local screenshotWidthHq = 900 -------------------------------------------------------------------------------- -local isSingleplayer = Spring.Utilities.Gametype.IsSinglePlayer() +local isSingleplayer = Utilities.Gametype.IsSinglePlayer() if gadgetHandler:IsSyncedCode() then @@ -76,7 +76,7 @@ else local myPlayerID = Spring.GetMyPlayerID() local myPlayerName = Spring.GetPlayerInfo(myPlayerID) - local accountID = Spring.Utilities.GetAccountID(myPlayerID) + local accountID = Utilities.GetAccountID(myPlayerID) local authorized = SYNCED.permissions.playerdata[accountID] function gadget:Initialize() diff --git a/luarules/gadgets/cmd_give.lua b/luarules/gadgets/cmd_give.lua index 9a35760ecc0..2fff015450e 100644 --- a/luarules/gadgets/cmd_give.lua +++ b/luarules/gadgets/cmd_give.lua @@ -94,7 +94,7 @@ if gadgetHandler:IsSyncedCode() then end local playername, _, spec = Spring.GetPlayerInfo(playerID) - local accountID = Spring.Utilities.GetAccountID(playerID) + local accountID = Utilities.GetAccountID(playerID) local authorized = false if _G.permissions.give[accountID] then authorized = true @@ -118,7 +118,7 @@ if gadgetHandler:IsSyncedCode() then else -- UNSYNCED local myPlayerID = Spring.GetMyPlayerID() - local accountID = Spring.Utilities.GetAccountID(myPlayerID) + local accountID = Utilities.GetAccountID(myPlayerID) local authorized = SYNCED.permissions.give[accountID] local function RequestGive(cmd, line, words, playerID) diff --git a/luarules/gadgets/cmd_idle_players.lua b/luarules/gadgets/cmd_idle_players.lua index 4b4bb0e9cdc..0caf2ad4e64 100644 --- a/luarules/gadgets/cmd_idle_players.lua +++ b/luarules/gadgets/cmd_idle_players.lua @@ -1,5 +1,5 @@ -if Spring.Utilities.Gametype.IsSinglePlayer() then +if Utilities.Gametype.IsSinglePlayer() then return end diff --git a/luarules/gadgets/cmd_limiter.lua b/luarules/gadgets/cmd_limiter.lua index 2fb1b1ecd8b..bd54d272053 100644 --- a/luarules/gadgets/cmd_limiter.lua +++ b/luarules/gadgets/cmd_limiter.lua @@ -21,7 +21,7 @@ local historyFrames = 180 local maxCommands = 600 local startWarningOffences = 3 local maxOffences = 6 -local isSingleplayer = Spring.Utilities.Gametype.IsSinglePlayer() +local isSingleplayer = Utilities.Gametype.IsSinglePlayer() local mathFloor = math.floor local mathMax = math.max diff --git a/luarules/gadgets/cmd_paused_is_paused.lua b/luarules/gadgets/cmd_paused_is_paused.lua index a3d24b84dd5..cc14f636775 100644 --- a/luarules/gadgets/cmd_paused_is_paused.lua +++ b/luarules/gadgets/cmd_paused_is_paused.lua @@ -1,4 +1,4 @@ -if Spring.GetModOptions().allowpausegameplay or Spring.Utilities.Gametype.IsSinglePlayer() then +if Spring.GetModOptions().allowpausegameplay or Utilities.Gametype.IsSinglePlayer() then return end diff --git a/luarules/gadgets/cmd_sendcommand.lua b/luarules/gadgets/cmd_sendcommand.lua index 191e7aa2e75..5b65d559c9c 100644 --- a/luarules/gadgets/cmd_sendcommand.lua +++ b/luarules/gadgets/cmd_sendcommand.lua @@ -42,7 +42,7 @@ if gadgetHandler:IsSyncedCode() then return end local playername, _, spec = Spring.GetPlayerInfo(playerID) - local accountID = Spring.Utilities.GetAccountID(playerID) + local accountID = Utilities.GetAccountID(playerID) local authorized = false if _G.permissions.cmd[accountID] then authorized = true @@ -65,7 +65,7 @@ if gadgetHandler:IsSyncedCode() then else -- UNSYNCED local myPlayerID = Spring.GetMyPlayerID() - local accountID = Spring.Utilities.GetAccountID(myPlayerID) + local accountID = Utilities.GetAccountID(myPlayerID) local authorized = SYNCED.permissions.cmd[accountID] local function execCmd(_, playername, cmd) diff --git a/luarules/gadgets/cmd_undo.lua b/luarules/gadgets/cmd_undo.lua index 790c9fe8ef3..3c3b0f3d790 100644 --- a/luarules/gadgets/cmd_undo.lua +++ b/luarules/gadgets/cmd_undo.lua @@ -175,7 +175,7 @@ if gadgetHandler:IsSyncedCode() then function gadget:RecvLuaMsg(msg, playerID) if msg:sub(1,2)=="un" and msg:sub(3,4)==validation then - local accountID = Spring.Utilities.GetAccountID(playerID) + local accountID = Utilities.GetAccountID(playerID) local authorized = false if _G.permissions.undo[accountID] then authorized = true @@ -190,7 +190,7 @@ if gadgetHandler:IsSyncedCode() then local function notify(message) for _,playerID in pairs(Spring.GetPlayerList()) do - local accountID = Spring.Utilities.GetAccountID(playerID) + local accountID = Utilities.GetAccountID(playerID) if _G.permissions.undo[accountID] then Spring.SendMessageToPlayer(playerID, message) end diff --git a/luarules/gadgets/dbg_synced_proxy.lua b/luarules/gadgets/dbg_synced_proxy.lua index 4a7bf21f2cf..19da38f9ebf 100644 --- a/luarules/gadgets/dbg_synced_proxy.lua +++ b/luarules/gadgets/dbg_synced_proxy.lua @@ -14,7 +14,7 @@ if not gadgetHandler:IsSyncedCode() then return end -if not Spring.Utilities.IsDevMode() or not Spring.Utilities.Gametype.IsSinglePlayer() then +if not Utilities.IsDevMode() or not Utilities.Gametype.IsSinglePlayer() then Spring.SetGameRulesParam('isSyncedProxyEnabled', false) return end diff --git a/luarules/gadgets/dbg_test_env_helper.lua b/luarules/gadgets/dbg_test_env_helper.lua index 1cf874817a9..23d673204c2 100644 --- a/luarules/gadgets/dbg_test_env_helper.lua +++ b/luarules/gadgets/dbg_test_env_helper.lua @@ -13,7 +13,7 @@ end local ENABLED_RULES_PARAM = 'isTestEnvironmentHelperEnabled' -if not Spring.Utilities.IsDevMode() or not Spring.Utilities.Gametype.IsSinglePlayer() then +if not Utilities.IsDevMode() or not Utilities.Gametype.IsSinglePlayer() then return end diff --git a/luarules/gadgets/dbg_unitposition_logger.lua b/luarules/gadgets/dbg_unitposition_logger.lua index 0ea03a9b74b..85bc7323b13 100644 --- a/luarules/gadgets/dbg_unitposition_logger.lua +++ b/luarules/gadgets/dbg_unitposition_logger.lua @@ -51,7 +51,7 @@ if not gadgetHandler:IsSyncedCode() then local math_ceil = math.ceil local myPlayerID = Spring.GetMyPlayerID() - local isSinglePlayer = Spring.Utilities.Gametype.IsSinglePlayer() + local isSinglePlayer = Utilities.Gametype.IsSinglePlayer() local logRate = minLogRate local lastLogFrame = 30-minLogRate diff --git a/luarules/gadgets/game_allyteam_ranking.lua b/luarules/gadgets/game_allyteam_ranking.lua index 9b39d6b4181..8bc5210f0d2 100644 --- a/luarules/gadgets/game_allyteam_ranking.lua +++ b/luarules/gadgets/game_allyteam_ranking.lua @@ -16,7 +16,7 @@ if gadgetHandler:IsSyncedCode() then return end -if not Spring.Utilities.Gametype.IsFFA() or Spring.Utilities.Gametype.IsSinglePlayer() then +if not Utilities.Gametype.IsFFA() or Utilities.Gametype.IsSinglePlayer() then return end diff --git a/luarules/gadgets/game_assistdronespawn.lua b/luarules/gadgets/game_assistdronespawn.lua index 877ed50f6bd..36905857d98 100644 --- a/luarules/gadgets/game_assistdronespawn.lua +++ b/luarules/gadgets/game_assistdronespawn.lua @@ -1,4 +1,4 @@ -if not (Spring.GetModOptions().assistdronesenabled == "enabled" or (Spring.GetModOptions().assistdronesenabled == "pve_only" and Spring.Utilities.Gametype.IsPvE())) then +if not (Spring.GetModOptions().assistdronesenabled == "enabled" or (Spring.GetModOptions().assistdronesenabled == "pve_only" and Utilities.Gametype.IsPvE())) then return end diff --git a/luarules/gadgets/game_autocolors.lua b/luarules/gadgets/game_autocolors.lua index 8c274eed14b..16cdc45f23e 100644 --- a/luarules/gadgets/game_autocolors.lua +++ b/luarules/gadgets/game_autocolors.lua @@ -17,7 +17,7 @@ local gaiaTeamID = Spring.GetGaiaTeamID() local teamList = Spring.GetTeamList() local allyTeamList = Spring.GetAllyTeamList() local allyTeamCount = #allyTeamList - 1 -local isSurvival = Spring.Utilities.Gametype.IsPvE() +local isSurvival = Utilities.Gametype.IsPvE() local survivalColorNum = 1 -- Starting from color #1 local survivalColorVariation = 0 -- Current color variation @@ -440,7 +440,7 @@ local function hex2RGB(hex) end -- we don't want to use FFA colors for TeamFFA, because we want each team to have its own color theme -local useFFAColors = Spring.Utilities.Gametype.IsFFA() and not Spring.Utilities.Gametype.IsTeams() +local useFFAColors = Utilities.Gametype.IsFFA() and not Utilities.Gametype.IsTeams() if not useFFAColors and not teamColors[allyTeamCount] and not isSurvival then -- Edge case for TeamFFA with more than supported number of teams useFFAColors = true end diff --git a/luarules/gadgets/game_commander_builder.lua b/luarules/gadgets/game_commander_builder.lua index 5c369a4fe7e..fe79c238320 100644 --- a/luarules/gadgets/game_commander_builder.lua +++ b/luarules/gadgets/game_commander_builder.lua @@ -1,5 +1,5 @@ local spawnpadSpawnEnabled = false -local PvEEnabled = Spring.Utilities.Gametype.IsPvE() +local PvEEnabled = Utilities.Gametype.IsPvE() if Spring.GetModOptions().commanderbuildersenabled == "enabled" or (Spring.GetModOptions().commanderbuildersenabled == "pve_only" and PvEEnabled) then spawnpadSpawnEnabled = true end diff --git a/luarules/gadgets/game_easter_eggs.lua b/luarules/gadgets/game_easter_eggs.lua index 56904bb5c45..09040d336d6 100644 --- a/luarules/gadgets/game_easter_eggs.lua +++ b/luarules/gadgets/game_easter_eggs.lua @@ -12,7 +12,7 @@ function gadget:GetInfo() } end -if not Spring.Utilities.Gametype.GetCurrentHolidays()["easter"] then +if not Utilities.Gametype.GetCurrentHolidays()["easter"] then return false end diff --git a/luarules/gadgets/game_end.lua b/luarules/gadgets/game_end.lua index d13723ec133..02cd53d9284 100644 --- a/luarules/gadgets/game_end.lua +++ b/luarules/gadgets/game_end.lua @@ -77,7 +77,7 @@ if gadgetHandler:IsSyncedCode() then local playerIDtoAIs = {} local playerList = GetPlayerList() local killTeamQueue = {} - local isFFA = Spring.Utilities.Gametype.IsFFA() + local isFFA = Utilities.Gametype.IsFFA() local gameoverFrame local gameoverWinners diff --git a/luarules/gadgets/game_ffa_start_setup.lua b/luarules/gadgets/game_ffa_start_setup.lua index fbec20224cf..56544c0649b 100644 --- a/luarules/gadgets/game_ffa_start_setup.lua +++ b/luarules/gadgets/game_ffa_start_setup.lua @@ -7,7 +7,7 @@ The gadget will only be enabled in FFA / TeamFFA games, and only in a synced context, and runs in one-shot before disabling itself. ]] -if not Spring.Utilities.Gametype.IsFFA() or not gadgetHandler:IsSyncedCode() then +if not Utilities.Gametype.IsFFA() or not gadgetHandler:IsSyncedCode() then return end @@ -164,7 +164,7 @@ end function gadget:Initialize() -- list of ally teams (humans and AIs, but not Raptors and Scavengers) - local allyTeamList = Spring.Utilities.GetAllyTeamList() + local allyTeamList = Utilities.GetAllyTeamList() setFFAStartPoints(allyTeamList) if Spring.GetModOptions().teamffa_start_boxes_shuffle then diff --git a/luarules/gadgets/game_initial_spawn.lua b/luarules/gadgets/game_initial_spawn.lua index 5ee4654a197..7a03bec698e 100644 --- a/luarules/gadgets/game_initial_spawn.lua +++ b/luarules/gadgets/game_initial_spawn.lua @@ -233,8 +233,8 @@ if gadgetHandler:IsSyncedCode() then ---------------------------------------------------------------- -- FFA start points (provided by `game_ffa_start_setup`) ---------------------------------------------------------------- - local isFFA = Spring.Utilities.Gametype.IsFFA() - local isTeamFFA = isFFA and Spring.Utilities.Gametype.IsTeams() + local isFFA = Utilities.Gametype.IsFFA() + local isTeamFFA = isFFA and Utilities.Gametype.IsTeams() ---------------------------------------------------------------- -- Draft Spawn Order -- only enabled when startPosType is 2 diff --git a/luarules/gadgets/game_logger.lua b/luarules/gadgets/game_logger.lua index 3dc1a5c2d74..3c2899be15d 100644 --- a/luarules/gadgets/game_logger.lua +++ b/luarules/gadgets/game_logger.lua @@ -1,5 +1,5 @@ -if Spring.Utilities.Gametype.IsSinglePlayer() then +if Utilities.Gametype.IsSinglePlayer() then return end diff --git a/luarules/gadgets/game_replace_afk_players.lua b/luarules/gadgets/game_replace_afk_players.lua index 585a6212fad..b024749814f 100644 --- a/luarules/gadgets/game_replace_afk_players.lua +++ b/luarules/gadgets/game_replace_afk_players.lua @@ -20,7 +20,7 @@ function gadget:GetInfo() } end -local numPlayers = Spring.Utilities.GetPlayerCount() +local numPlayers = Utilities.GetPlayerCount() if numPlayers <= 4 then -- not needed to show sub button for small games where restarting one the better option @@ -247,7 +247,7 @@ else local myPlayerID = Spring.GetMyPlayerID() local spec, _ = Spring.GetSpectatingState() local isReplay = Spring.IsReplay() - local ColorString = Spring.Utilities.Color.ToString + local ColorString = Utilities.Color.ToString local revealed = false @@ -271,7 +271,7 @@ else end function gadget:Initialize() - if isReplay or Spring.Utilities.Gametype.IsFFA() or Spring.GetGameFrame() > 6 then + if isReplay or Utilities.Gametype.IsFFA() or Spring.GetGameFrame() > 6 then gadgetHandler:RemoveGadget() -- don't run in FFA mode return end diff --git a/luarules/gadgets/game_selfd_resign.lua b/luarules/gadgets/game_selfd_resign.lua index f6ef41838ca..b58b5836177 100644 --- a/luarules/gadgets/game_selfd_resign.lua +++ b/luarules/gadgets/game_selfd_resign.lua @@ -1,6 +1,6 @@ -if Spring.Utilities.Gametype.IsSinglePlayer() then +if Utilities.Gametype.IsSinglePlayer() then return end diff --git a/luarules/gadgets/game_team_power_watcher.lua b/luarules/gadgets/game_team_power_watcher.lua index 5c6f32e7178..f56f8efc463 100644 --- a/luarules/gadgets/game_team_power_watcher.lua +++ b/luarules/gadgets/game_team_power_watcher.lua @@ -21,8 +21,8 @@ local mathHuge = math.huge local mathMax = math.max local teamList = Spring.GetTeamList() -local scavengerTeam = Spring.Utilities.GetScavTeamID() -local raptorTeam = Spring.Utilities.GetRaptorTeamID() +local scavengerTeam = Utilities.GetScavTeamID() +local raptorTeam = Utilities.GetRaptorTeamID() local aiTeams = {} local neutralTeam local humanTeams = {} diff --git a/luarules/gadgets/game_tech_blocking.lua b/luarules/gadgets/game_tech_blocking.lua index 6db6dbb7aca..df0fcdb4519 100644 --- a/luarules/gadgets/game_tech_blocking.lua +++ b/luarules/gadgets/game_tech_blocking.lua @@ -39,11 +39,11 @@ local techCoreValueDefs = {} local ignoredTeams = { [Spring.GetGaiaTeamID()] = true, } -local scavTeamID = Spring.Utilities.GetScavTeamID() +local scavTeamID = Utilities.GetScavTeamID() if scavTeamID then ignoredTeams[scavTeamID] = true end -local raptorTeamID = Spring.Utilities.GetRaptorTeamID() +local raptorTeamID = Utilities.GetRaptorTeamID() if raptorTeamID then ignoredTeams[raptorTeamID] = true end diff --git a/luarules/gadgets/game_volcano_pyroclastic.lua b/luarules/gadgets/game_volcano_pyroclastic.lua index ef511576694..38774a0644f 100644 --- a/luarules/gadgets/game_volcano_pyroclastic.lua +++ b/luarules/gadgets/game_volcano_pyroclastic.lua @@ -123,7 +123,7 @@ function gadget:Initialize() end gadgetHandler:AddChatAction("volcano", function(cmd, line, words, playerID) -local accountID = Spring.Utilities.GetAccountID(playerID) +local accountID = Utilities.GetAccountID(playerID) local authorized = _G.permissions.volcano[accountID] if not (authorized or Spring.IsCheatingEnabled()) then diff --git a/luarules/gadgets/gfx_raptor_scum_gl4.lua b/luarules/gadgets/gfx_raptor_scum_gl4.lua index 11e96beb5b1..ea9ca9563b7 100644 --- a/luarules/gadgets/gfx_raptor_scum_gl4.lua +++ b/luarules/gadgets/gfx_raptor_scum_gl4.lua @@ -20,7 +20,7 @@ end if gadgetHandler:IsSyncedCode() then - local pveTeamID = Spring.Utilities.GetScavTeamID() or Spring.Utilities.GetRaptorTeamID() + local pveTeamID = Utilities.GetScavTeamID() or Utilities.GetRaptorTeamID() local scumSpawnerIDs = {} @@ -302,7 +302,7 @@ if gadgetHandler:IsSyncedCode() then -elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED +elseif not Utilities.Gametype.IsScavengers() then -- UNSYNCED diff --git a/luarules/gadgets/graphics_territorial_domination.lua b/luarules/gadgets/graphics_territorial_domination.lua index 69b963f0538..49f6785abe8 100644 --- a/luarules/gadgets/graphics_territorial_domination.lua +++ b/luarules/gadgets/graphics_territorial_domination.lua @@ -15,7 +15,7 @@ local modOptions = Spring.GetModOptions() local isSynced = gadgetHandler:IsSyncedCode() if modOptions.deathmode ~= "territorial_domination" or isSynced then return false end -if Spring.Utilities.Gametype.IsRaptors() or Spring.Utilities.Gametype.IsScavengers() then +if Utilities.Gametype.IsRaptors() or Utilities.Gametype.IsScavengers() then return false end diff --git a/luarules/gadgets/include/startbox_utilities.lua b/luarules/gadgets/include/startbox_utilities.lua index 681ba184cf1..80a80acb63c 100644 --- a/luarules/gadgets/include/startbox_utilities.lua +++ b/luarules/gadgets/include/startbox_utilities.lua @@ -1,7 +1,7 @@ local function WrappedInclude(x) local env = getfenv() local prevGTC = env.GetTeamCount -- typically nil but also works otherwise - env.GetTeamCount = Spring.Utilities.GetAllyTeamCount -- for legacy mapside boxes + env.GetTeamCount = Utilities.GetAllyTeamCount -- for legacy mapside boxes local ret = VFS.Include(x, env) env.GetTeamCount = prevGTC return ret diff --git a/luarules/gadgets/map_lava.lua b/luarules/gadgets/map_lava.lua index 4529ab1f01c..b9b63ea2270 100644 --- a/luarules/gadgets/map_lava.lua +++ b/luarules/gadgets/map_lava.lua @@ -12,7 +12,7 @@ function gadget:GetInfo() } end -local lava = Spring.Lava +local lava = Lava local lavaMap = lava.isLavaMap local gameSpeed = Game.gameSpeed diff --git a/luarules/gadgets/map_waterlevel.lua b/luarules/gadgets/map_waterlevel.lua index e0756c49893..f45f0c9893c 100644 --- a/luarules/gadgets/map_waterlevel.lua +++ b/luarules/gadgets/map_waterlevel.lua @@ -77,7 +77,7 @@ if gadgetHandler:IsSyncedCode() then return end - local accountID = Spring.Utilities.GetAccountID(playerID) + local accountID = Utilities.GetAccountID(playerID) local authorized = _G.permissions.waterlevel[accountID] if not (authorized or Spring.IsCheatingEnabled()) then @@ -93,7 +93,7 @@ if gadgetHandler:IsSyncedCode() then else -- UNSYNCED local myPlayerID = Spring.GetMyPlayerID() - local accountID = Spring.Utilities.GetAccountID(myPlayerID) + local accountID = Utilities.GetAccountID(myPlayerID) local authorized = SYNCED.permissions.waterlevel[accountID] local function waterlevel(cmd, line, words, playerID) diff --git a/luarules/gadgets/mo_ffa.lua b/luarules/gadgets/mo_ffa.lua index 00b882d2b50..996a8cdb414 100644 --- a/luarules/gadgets/mo_ffa.lua +++ b/luarules/gadgets/mo_ffa.lua @@ -12,7 +12,7 @@ function gadget:GetInfo() } end -if not Spring.Utilities.Gametype.IsFFA() then +if not Utilities.Gametype.IsFFA() then return false end @@ -22,7 +22,7 @@ if gadgetHandler:IsSyncedCode() then local earlyDropGrace = Game.gameSpeed * 60 * 1 -- in frames local lateDropGrace = Game.gameSpeed * 60 * 2 -- in frames - local isTeamFFA = Spring.Utilities.Gametype.IsTeams() + local isTeamFFA = Utilities.Gametype.IsTeams() if isTeamFFA then lateDropGrace = Game.gameSpeed * 8 end diff --git a/luarules/gadgets/pve_areahealers.lua b/luarules/gadgets/pve_areahealers.lua index b781b24abf3..f4ee128e96d 100644 --- a/luarules/gadgets/pve_areahealers.lua +++ b/luarules/gadgets/pve_areahealers.lua @@ -16,9 +16,9 @@ if not gadgetHandler:IsSyncedCode() then return end -if Spring.Utilities.Gametype.IsRaptors() then +if Utilities.Gametype.IsRaptors() then Spring.Log(gadget:GetInfo().name, LOG.INFO, "Raptor Defense Spawner Activated!") -elseif Spring.Utilities.Gametype.IsScavengers() then +elseif Utilities.Gametype.IsScavengers() then Spring.Log(gadget:GetInfo().name, LOG.INFO, "Scav Defense Spawner Activated!") else Spring.Log(gadget:GetInfo().name, LOG.INFO, "Defense Spawner Deactivated!") @@ -38,11 +38,11 @@ local mathCeil = math.ceil local unitTeams = {} -local pveTeamID = Spring.Utilities.GetRaptorTeamID() or Spring.Utilities.GetScavTeamID() +local pveTeamID = Utilities.GetRaptorTeamID() or Utilities.GetScavTeamID() local aliveHealers = {} local healersTable = {} -if Spring.Utilities.Gametype.IsRaptors() then +if Utilities.Gametype.IsRaptors() then healersTable[UnitDefNames["raptor_land_swarmer_heal_t1_v1"].id] = { healingpower = UnitDefNames["raptor_land_swarmer_heal_t1_v1"].repairSpeed, healingrange = UnitDefNames["raptor_land_swarmer_heal_t1_v1"].buildDistance*2, diff --git a/luarules/gadgets/pve_boss_drones.lua b/luarules/gadgets/pve_boss_drones.lua index aef5734479a..b5eb05bf9eb 100644 --- a/luarules/gadgets/pve_boss_drones.lua +++ b/luarules/gadgets/pve_boss_drones.lua @@ -1,4 +1,4 @@ -if not (Spring.Utilities.Gametype.IsRaptors() or Spring.Utilities.Gametype.IsScavengers()) then +if not (Utilities.Gametype.IsRaptors() or Utilities.Gametype.IsScavengers()) then Spring.Echo("REMOVED PVE BOSS DRONES") return false end @@ -21,7 +21,7 @@ if not gadgetHandler:IsSyncedCode() then return end -local pveTeamID = Spring.Utilities.GetScavTeamID() or Spring.Utilities.GetRaptorTeamID() +local pveTeamID = Utilities.GetScavTeamID() or Utilities.GetRaptorTeamID() local raptorQueenCount = Spring.GetModOptions().raptor_queen_count local positionCheckLibrary = VFS.Include("luarules/utilities/damgam_lib/position_checks.lua") diff --git a/luarules/gadgets/pve_builder_controller.lua b/luarules/gadgets/pve_builder_controller.lua index 9844ef4be28..6c4f0b307f2 100644 --- a/luarules/gadgets/pve_builder_controller.lua +++ b/luarules/gadgets/pve_builder_controller.lua @@ -16,16 +16,16 @@ if not gadgetHandler:IsSyncedCode() then return end -if Spring.Utilities.Gametype.IsRaptors() then +if Utilities.Gametype.IsRaptors() then Spring.Log(gadget:GetInfo().name, LOG.INFO, "Raptor Defense Spawner Activated!") -elseif Spring.Utilities.Gametype.IsScavengers() then +elseif Utilities.Gametype.IsScavengers() then Spring.Log(gadget:GetInfo().name, LOG.INFO, "Scav Defense Spawner Activated!") else Spring.Log(gadget:GetInfo().name, LOG.INFO, "Defense Spawner Deactivated!") return false end -local scavengerAITeamID = Spring.Utilities.GetScavTeamID() +local scavengerAITeamID = Utilities.GetScavTeamID() local builderDefs = {} for unitDefID, data in pairs(UnitDefs) do diff --git a/luarules/gadgets/pve_nuke_controller.lua b/luarules/gadgets/pve_nuke_controller.lua index 7ede3e54715..da40574b5b9 100644 --- a/luarules/gadgets/pve_nuke_controller.lua +++ b/luarules/gadgets/pve_nuke_controller.lua @@ -18,10 +18,10 @@ end local difficulty = "normal" -if Spring.Utilities.Gametype.IsRaptors() then +if Utilities.Gametype.IsRaptors() then Spring.Log(gadget:GetInfo().name, LOG.INFO, "Raptor Defense Spawner Activated!") difficulty = Spring.GetModOptions().raptor_difficulty -elseif Spring.Utilities.Gametype.IsScavengers() then +elseif Utilities.Gametype.IsScavengers() then Spring.Log(gadget:GetInfo().name, LOG.INFO, "Scav Defense Spawner Activated!") difficulty = Spring.GetModOptions().scav_difficulty else @@ -29,7 +29,7 @@ else return false end -local pveTeamID = Spring.Utilities.GetScavTeamID() or Spring.Utilities.GetRaptorTeamID() +local pveTeamID = Utilities.GetScavTeamID() or Utilities.GetRaptorTeamID() local nukeDefs = {} for unitDefID, def in ipairs(UnitDefs) do diff --git a/luarules/gadgets/pve_supply_drops.lua b/luarules/gadgets/pve_supply_drops.lua index a378b0de723..2e7933cfc16 100644 --- a/luarules/gadgets/pve_supply_drops.lua +++ b/luarules/gadgets/pve_supply_drops.lua @@ -1,10 +1,10 @@ local teams = Spring.GetTeamList() mapsizeX = Game.mapSizeX mapsizeZ = Game.mapSizeZ -local scavengerAITeamID = Spring.Utilities.GetScavTeamID() -local scavengerAllyTeamID = Spring.Utilities.GetScavAllyTeamID() +local scavengerAITeamID = Utilities.GetScavTeamID() +local scavengerAllyTeamID = Utilities.GetScavAllyTeamID() -if Spring.Utilities.Gametype.IsScavengers() then +if Utilities.Gametype.IsScavengers() then scavengersAIEnabled = true ScavengerStartboxXMin, ScavengerStartboxZMin, ScavengerStartboxXMax, ScavengerStartboxZMax = Spring.GetAllyTeamStartBox(scavengerAllyTeamID) if ScavengerStartboxXMin == 0 and ScavengerStartboxZMin == 0 and ScavengerStartboxXMax == mapsizeX and ScavengerStartboxZMax == mapsizeZ then diff --git a/luarules/gadgets/raptor_spawner_defense.lua b/luarules/gadgets/raptor_spawner_defense.lua index 0a2c1c42d4c..57e6afa245b 100644 --- a/luarules/gadgets/raptor_spawner_defense.lua +++ b/luarules/gadgets/raptor_spawner_defense.lua @@ -1,5 +1,5 @@ -if Spring.Utilities.Gametype.IsRaptors() and not Spring.Utilities.Gametype.IsScavengers() then +if Utilities.Gametype.IsRaptors() and not Utilities.Gametype.IsScavengers() then Spring.Log("Raptor Defense Spawner", LOG.INFO, "Raptor Defense Spawner Activated!") else Spring.Log("Raptor Defense Spawner", LOG.INFO, "Raptor Defense Spawner Deactivated!") @@ -163,8 +163,8 @@ if gadgetHandler:IsSyncedCode() then local queenResistance = {} local queenIDs = {} local bosses = {resistances = queenResistance, statuses = {}, playerDamages = {}} - local raptorTeamID = Spring.Utilities.GetRaptorTeamID() - local raptorAllyTeamID = Spring.Utilities.GetRaptorAllyTeamID() + local raptorTeamID = Utilities.GetRaptorTeamID() + local raptorAllyTeamID = Utilities.GetRaptorAllyTeamID() local lsx1, lsz1, lsx2, lsz2 local burrows = {} local heroRaptor = {} diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/blueprint_tiers.lua b/luarules/gadgets/ruins/Blueprints/BYAR/blueprint_tiers.lua index 70561fd5c16..998ebfd2aec 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/blueprint_tiers.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/blueprint_tiers.lua @@ -1,5 +1,5 @@ local UDN = UnitDefNames -local gaiaTeamID = Spring.Utilities.GetScavTeamID() or Spring.GetGaiaTeamID() +local gaiaTeamID = Utilities.GetScavTeamID() or Spring.GetGaiaTeamID() local wallUnitDefs = { ["arm"] = { diff --git a/luarules/gadgets/scav_cloud_spawner.lua b/luarules/gadgets/scav_cloud_spawner.lua index 93637c4860f..aac36966269 100644 --- a/luarules/gadgets/scav_cloud_spawner.lua +++ b/luarules/gadgets/scav_cloud_spawner.lua @@ -12,13 +12,13 @@ function gadget:GetInfo() } end -if not Spring.Utilities.Gametype.IsScavengers() then +if not Utilities.Gametype.IsScavengers() then return end if gadgetHandler:IsSyncedCode() then -- Synced local teams = Spring.GetTeamList() - local scavTeamID = Spring.Utilities.GetScavTeamID() + local scavTeamID = Utilities.GetScavTeamID() local mapx = Game.mapSizeX local mapz = Game.mapSizeZ local cloudMult = math.ceil((math.ceil(((mapx+mapz)*0.5)/512)^2)/18) diff --git a/luarules/gadgets/scav_lootbox_collector.lua b/luarules/gadgets/scav_lootbox_collector.lua index 7bd09d47c12..94c35c9b95e 100644 --- a/luarules/gadgets/scav_lootbox_collector.lua +++ b/luarules/gadgets/scav_lootbox_collector.lua @@ -12,9 +12,9 @@ function gadget:GetInfo() } end -if (not gadgetHandler:IsSyncedCode()) or (not Spring.Utilities.Gametype.IsScavengers()) or Spring.GetModOptions().unit_restrictions_noair then +if (not gadgetHandler:IsSyncedCode()) or (not Utilities.Gametype.IsScavengers()) or Spring.GetModOptions().unit_restrictions_noair then return false -elseif Spring.Utilities.Gametype.IsRaptors() then +elseif Utilities.Gametype.IsRaptors() then return false end @@ -52,8 +52,8 @@ if UnitDefNames["scavbeacon_t1_scav"] then spawnerList[UnitDefNames["scavbeacon_t4_scav"].id] = true end -local scavTeamID = Spring.Utilities.GetScavTeamID() -local scavAllyTeamID = Spring.Utilities.GetScavAllyTeamID() +local scavTeamID = Utilities.GetScavTeamID() +local scavAllyTeamID = Utilities.GetScavAllyTeamID() local aliveLootboxes = {} local aliveLootboxesCount = 0 local aliveSpawners = {} diff --git a/luarules/gadgets/scav_spawner_defense.lua b/luarules/gadgets/scav_spawner_defense.lua index 996d35626d1..54f65461758 100644 --- a/luarules/gadgets/scav_spawner_defense.lua +++ b/luarules/gadgets/scav_spawner_defense.lua @@ -12,7 +12,7 @@ function gadget:GetInfo() } end -if Spring.Utilities.Gametype.IsScavengers() and not Spring.Utilities.Gametype.IsRaptors() then +if Utilities.Gametype.IsScavengers() and not Utilities.Gametype.IsRaptors() then Spring.Log(gadget:GetInfo().name, LOG.INFO, "Scav Defense Spawner Activated!") else Spring.Log(gadget:GetInfo().name, LOG.INFO, "Scav Defense Spawner Deactivated!") @@ -150,8 +150,8 @@ if gadgetHandler:IsSyncedCode() then local bossResistance = {} local bossIDs = {} local bosses = {resistances = bossResistance, statuses = {}, playerDamages = {}} - local scavTeamID = Spring.Utilities.GetScavTeamID() - local scavAllyTeamID = Spring.Utilities.GetScavAllyTeamID() + local scavTeamID = Utilities.GetScavTeamID() + local scavAllyTeamID = Utilities.GetScavAllyTeamID() local lsx1, lsz1, lsx2, lsz2 local burrows = {} local squadsTable = {} diff --git a/luarules/gadgets/system_info.lua b/luarules/gadgets/system_info.lua index b7fcb7c6689..9a67eaaa9f7 100644 --- a/luarules/gadgets/system_info.lua +++ b/luarules/gadgets/system_info.lua @@ -35,7 +35,7 @@ else local myPlayerID = Spring.GetMyPlayerID() local myPlayerName = Spring.GetPlayerInfo(myPlayerID) - local accountID = Spring.Utilities.GetAccountID(myPlayerID) + local accountID = Utilities.GetAccountID(myPlayerID) local authorized = SYNCED.permissions.sysinfo[accountID] local function handleSystemEvent(_,playerID,system) diff --git a/luarules/gadgets/unit_direct_control.lua b/luarules/gadgets/unit_direct_control.lua index 0ff2d361ad1..92e7998882e 100644 --- a/luarules/gadgets/unit_direct_control.lua +++ b/luarules/gadgets/unit_direct_control.lua @@ -15,7 +15,7 @@ end -- Direct control ("fps mode") is disabled for players because: -- Commands given in fps mode bypass lua & would bypass all anti-hax gadgets -- It is buggy and unpolished -local enabled = Spring.Utilities.IsDevMode() +local enabled = Utilities.IsDevMode() if (not gadgetHandler:IsSyncedCode()) then return false diff --git a/luarules/gadgets/unit_intergrated_hats.lua b/luarules/gadgets/unit_intergrated_hats.lua index 9f7e1478e66..d76d6487287 100644 --- a/luarules/gadgets/unit_intergrated_hats.lua +++ b/luarules/gadgets/unit_intergrated_hats.lua @@ -29,11 +29,11 @@ local unitCount = 0 do local hats - if Spring.Utilities.Gametype.GetCurrentHolidays()["aprilfools"] then + if Utilities.Gametype.GetCurrentHolidays()["aprilfools"] then hats = "april" end - if Spring.Utilities.Gametype.GetCurrentHolidays()["halloween"] then + if Utilities.Gametype.GetCurrentHolidays()["halloween"] then hats = "halloween" end diff --git a/luarules/gadgets/unit_xmas.lua b/luarules/gadgets/unit_xmas.lua index 66e5b95f80e..81bdc4bc736 100644 --- a/luarules/gadgets/unit_xmas.lua +++ b/luarules/gadgets/unit_xmas.lua @@ -1,4 +1,4 @@ -if not Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"] then +if not Utilities.Gametype.GetCurrentHolidays()["xmas"] then return end diff --git a/luarules/gadgets/unit_zombies.lua b/luarules/gadgets/unit_zombies.lua index ee9f7fc59fa..bb009ea2fa2 100644 --- a/luarules/gadgets/unit_zombies.lua +++ b/luarules/gadgets/unit_zombies.lua @@ -1007,7 +1007,7 @@ local function isAuthorized(playerID) if Spring.IsCheatingEnabled() then return true end - local accountID = Spring.Utilities.GetAccountID(playerID) + local accountID = Utilities.GetAccountID(playerID) if (_G and _G.permissions.devhelpers[accountID]) or (SYNCED and SYNCED.permissions.devhelpers[accountID]) then return true end diff --git a/luaui/RmlWidgets/gui_quick_start/gui_quick_start.lua b/luaui/RmlWidgets/gui_quick_start/gui_quick_start.lua index b2debde4f09..ec89c3cb8be 100644 --- a/luaui/RmlWidgets/gui_quick_start/gui_quick_start.lua +++ b/luaui/RmlWidgets/gui_quick_start/gui_quick_start.lua @@ -37,7 +37,7 @@ local shouldApplyFactoryDiscount = modOptions.quick_start == "factory_discount" local spGetGameRulesParam = Spring.GetGameRulesParam local spGetMyTeamID = Spring.GetMyTeamID -local spI18N = Spring.I18N +local spI18N = I18N local wgBuildMenu, wgGridMenu, wgTopbar, wgPregameBuild, wgPregameUI, wgPregameUIDraft, wgGetBuildQueueFunc, wgGetBuildPositionsFunc, wgGetPregameUnitSelectedFunc diff --git a/luaui/RmlWidgets/gui_tech_points/gui_tech_points.lua b/luaui/RmlWidgets/gui_tech_points/gui_tech_points.lua index 0cc951c4923..70c51491193 100644 --- a/luaui/RmlWidgets/gui_tech_points/gui_tech_points.lua +++ b/luaui/RmlWidgets/gui_tech_points/gui_tech_points.lua @@ -24,7 +24,7 @@ end local spGetTeamRulesParam = Spring.GetTeamRulesParam local spGetMyTeamID = Spring.GetMyTeamID -local spI18N = Spring.I18N +local spI18N = I18N local POPUP_DELAY_FRAMES = Game.gameSpeed * 10 local UPDATE_INTERVAL = 1.0 diff --git a/luaui/RmlWidgets/gui_territorial_domination/gui_territorial_domination.lua b/luaui/RmlWidgets/gui_territorial_domination/gui_territorial_domination.lua index 42862b6ba41..ac01cc465b8 100644 --- a/luaui/RmlWidgets/gui_territorial_domination/gui_territorial_domination.lua +++ b/luaui/RmlWidgets/gui_territorial_domination/gui_territorial_domination.lua @@ -18,7 +18,7 @@ end local modOptions = Spring.GetModOptions() if modOptions.deathmode ~= "territorial_domination" then return false end -if Spring.Utilities.Gametype.IsRaptors() or Spring.Utilities.Gametype.IsScavengers() then return false end +if Utilities.Gametype.IsRaptors() or Utilities.Gametype.IsScavengers() then return false end local MODEL_NAME = "territorial_score_model" local RML_PATH = "luaui/RmlWidgets/gui_territorial_domination/gui_territorial_domination.rml" @@ -29,12 +29,12 @@ local spGetAllyTeamList = Spring.GetAllyTeamList local spGetTeamList = Spring.GetTeamList local spGetTeamColor = Spring.GetTeamColor local spGetSpectatingState = Spring.GetSpectatingState -local spI18N = Spring.I18N +local spI18N = I18N local spGetGaiaTeamID = Spring.GetGaiaTeamID local spGetTeamInfo = Spring.GetTeamInfo local spGetPlayerInfo = Spring.GetPlayerInfo local spGetAIInfo = Spring.GetAIInfo -local ColorString = Spring.Utilities.Color.ToString +local ColorString = Utilities.Color.ToString local DEFAULT_MAX_ROUNDS = 7 local DEFAULT_POINTS_CAP = 100 @@ -149,12 +149,12 @@ local function getAIName(teamID) if niceName then name = niceName - if Spring.Utilities.ShowDevUI() and options.profile then + if Utilities.ShowDevUI() and options.profile then name = name .. " [" .. options.profile .. "]" end end - return Spring.I18N('ui.playersList.aiName', { name = name }) + return I18N('ui.playersList.aiName', { name = name }) end local function fetchAllyTeamPlayerNames(allyTeamID) diff --git a/luaui/Widgets/api_blueprint.lua b/luaui/Widgets/api_blueprint.lua index ad6ecf29bb5..8f57e2fe229 100644 --- a/luaui/Widgets/api_blueprint.lua +++ b/luaui/Widgets/api_blueprint.lua @@ -5,7 +5,7 @@ local BpDefs = VFS.Include("luaui/Include/blueprint_substitution/definitions.lua local SubLogic = VFS.Include("luaui/Include/blueprint_substitution/logic.lua") -local ENABLE_REPORTS = Spring.Utilities.IsDevMode() +local ENABLE_REPORTS = Utilities.IsDevMode() local reportFunctions = nil diff --git a/luaui/Widgets/api_ignore.lua b/luaui/Widgets/api_ignore.lua index baa7b6a7205..91ded07bcbb 100644 --- a/luaui/Widgets/api_ignore.lua +++ b/luaui/Widgets/api_ignore.lua @@ -80,14 +80,14 @@ local function ignoreAccount(accountID) if resolvedName ~= '' then ignoredAccountsAndNames[resolvedName] = playerID or true end - spEcho(Spring.I18N('ui.ignore.ignored', { name = resolvedName, accountID = accountID })) + spEcho(I18N('ui.ignore.ignored', { name = resolvedName, accountID = accountID })) end elseif accountID ~= '' then -- if accountID wasnt known and player name was supplied instead local name = accountID if playernames[name] then ignoredPlayers[name] = true ignoredAccountsAndNames[name] = playernames[name] - spEcho(Spring.I18N('ui.ignore.ignored', { name = name, accountID = Spring.I18N('ui.ignore.unknown') })) + spEcho(I18N('ui.ignore.ignored', { name = name, accountID = I18N('ui.ignore.unknown') })) end end end @@ -96,7 +96,7 @@ local function unignoreAccount(accountID) if type(tonumber(accountID)) == 'number' then accountID = tonumber(accountID) if ignoredAccounts[accountID] and validAccounts[accountID] then - spEcho(Spring.I18N('ui.ignore.unignored', { name = ignoredAccounts[accountID], accountID = accountID })) + spEcho(I18N('ui.ignore.unignored', { name = ignoredAccounts[accountID], accountID = accountID })) ignoredAccountsAndNames[accountID] = nil ignoredAccountsAndNames[ignoredAccounts[accountID]] = nil ignoredAccountsAndNames[validAccounts[accountID]] = nil @@ -107,7 +107,7 @@ local function unignoreAccount(accountID) if playernames[name] then ignoredPlayers[name] = nil ignoredAccountsAndNames[name] = nil - spEcho(Spring.I18N('ui.ignore.unignored', { name = name, accountID = Spring.I18N('ui.ignore.unknown') })) + spEcho(I18N('ui.ignore.unignored', { name = name, accountID = I18N('ui.ignore.unknown') })) end end end diff --git a/luaui/Widgets/api_playernames.lua b/luaui/Widgets/api_playernames.lua index 7c3b6c76af8..45ef8795b69 100644 --- a/luaui/Widgets/api_playernames.lua +++ b/luaui/Widgets/api_playernames.lua @@ -177,7 +177,7 @@ local function setaliasCmd(_, _, params) if accountID then local alias = params[2] if alias then - spEcho(Spring.I18N('ui.playernames.setalias', { name = name, accountID = accountID, alias = alias })) + spEcho(I18N('ui.playernames.setalias', { name = name, accountID = accountID, alias = alias })) -- ensure history entry exists if not history[accountID] then history[accountID] = { i = 1, d = tonumber(os.date("%y%m%d")), [1] = name } @@ -188,7 +188,7 @@ local function setaliasCmd(_, _, params) else -- ensure history entry exists before accessing alias if history[accountID] and history[accountID].alias then - spEcho(Spring.I18N('ui.playernames.removealias', { name = name, accountID = accountID, alias = history[accountID].alias })) + spEcho(I18N('ui.playernames.removealias', { name = name, accountID = accountID, alias = history[accountID].alias })) currentNames[playerID] = name currentAccounts[accountID] = name history[accountID].alias = nil @@ -200,7 +200,7 @@ local function setaliasCmd(_, _, params) end else - spEcho(Spring.I18N('ui.playernames.notfound', { param = params[1] })) + spEcho(I18N('ui.playernames.notfound', { param = params[1] })) end end end diff --git a/luaui/Widgets/api_unit_tracker_gl4.lua b/luaui/Widgets/api_unit_tracker_gl4.lua index bbae88014b0..5e103ea53cc 100644 --- a/luaui/Widgets/api_unit_tracker_gl4.lua +++ b/luaui/Widgets/api_unit_tracker_gl4.lua @@ -131,7 +131,7 @@ local scriptLuauiAlliedUnitsChanged local function Scream(reason, unitID) -- This will pause the game and play some sound to alert anyone in debug mode of issue --Spring.Debug.TraceFullEcho(nil,nil,nil, reason) - Spring.Debug.TraceEcho('API Unit Tracker error', reason) + Debug.TraceEcho('API Unit Tracker error', reason) if unitID ~= nil then -- gather as much info as possible about this unitID local unitDefID = spGetUnitDefID(unitID) @@ -142,7 +142,7 @@ local function Scream(reason, unitID) -- This will pause the game and play some if lastknownunitpos[unitID] then Spring.MarkerAddPoint(lastknownunitpos[unitID][1], lastknownunitpos[unitID][2], lastknownunitpos[unitID][3], lastknownunitpos[unitID][4], true) end - Spring.Debug.TraceFullEcho() + Debug.TraceFullEcho() local unittrackerapinil = nil unittrackerapinil = unittrackerapinil + 1 -- this intentionally crashes this widget so that it will show up in analytics if debuglevel >=3 then @@ -152,7 +152,7 @@ local function Scream(reason, unitID) -- This will pause the game and play some end local function alliedUnitsChanged() - if debuglevel >= 2 then Spring.Debug.TraceEcho() end + if debuglevel >= 2 then Debug.TraceEcho() end if Script.LuaUI('AlliedUnitsChanged') then Script.LuaUI.AlliedUnitsChanged(visibleUnits, numVisibleUnits) else @@ -161,7 +161,7 @@ local function alliedUnitsChanged() end local function alliedUnitsAdd(unitID, unitDefID, unitTeam, silent) - if debuglevel >= 3 then Spring.Debug.TraceEcho(numAlliedUnits) end + if debuglevel >= 3 then Debug.TraceEcho(numAlliedUnits) end if alliedUnits[unitID] then if debuglevel >= 2 then spEcho("alliedUnitsAdd", "tried to add existing unitID", unitID) end return @@ -179,7 +179,7 @@ local function alliedUnitsAdd(unitID, unitDefID, unitTeam, silent) end local function alliedUnitsRemove(unitID, reason) - if debuglevel >= 3 then Spring.Debug.TraceEcho(numAlliedUnits) end + if debuglevel >= 3 then Debug.TraceEcho(numAlliedUnits) end if alliedUnits[unitID] then local unitDefID = alliedUnits[unitID] alliedUnits[unitID] = nil @@ -196,12 +196,12 @@ local function alliedUnitsRemove(unitID, reason) end local function GetAlliedUnits() - if debuglevel >= 2 then Spring.Debug.TraceEcho() end + if debuglevel >= 2 then Debug.TraceEcho() end return alliedUnits, numAlliedUnits end local function visibleUnitsChanged() - if debuglevel >=3 then Spring.Debug.TraceEcho() end + if debuglevel >=3 then Debug.TraceEcho() end if Script.LuaUI('VisibleUnitsChanged') then Script.LuaUI.VisibleUnitsChanged(visibleUnits, numVisibleUnits) else @@ -219,7 +219,7 @@ local instanceVBOCacheTable = { } local function visibleUnitsAdd(unitID, unitDefID, unitTeam, silent, reason) - if debuglevel >= 3 then Spring.Debug.TraceEcho(numVisibleUnits) end + if debuglevel >= 3 then Debug.TraceEcho(numVisibleUnits) end if visibleUnits[unitID] then -- already known if debuglevel >= 2 then spEcho("visibleUnitsAdd", "tried to add existing unitID", unitID) end return @@ -252,7 +252,7 @@ end local function visibleUnitsRemove(unitID, reason) if debuglevel >= 3 then - Spring.Debug.TraceEcho(numVisibleUnits) + Debug.TraceEcho(numVisibleUnits) if lastknownunitpos[unitID] then lastknownunitpos[unitID] = nil end end if visibleUnits[unitID] then @@ -275,7 +275,7 @@ local function visibleUnitsRemove(unitID, reason) end local function GetVisibleUnits() - if debuglevel >= 2 then Spring.Debug.TraceEcho() end + if debuglevel >= 2 then Debug.TraceEcho() end return visibleUnits, numVisibleUnits end @@ -314,7 +314,7 @@ local function isValidLivingSeenUnit(unitID, unitDefID, verbose) ((not fullview) and (spGetUnitLosState(unitID, myAllyTeamID, true) % 2 == 0)) or -- outside of LOS unitDefIgnore[unitDefID] then if debuglevel >= (verbose or 0) then - Spring.Debug.TraceEcho() + Debug.TraceEcho() spEcho("not isValidLivingSeenUnit", 'unitDefID', unitDefID, 'ValidUnitID', spValidUnitID(unitID), @@ -722,8 +722,8 @@ function widget:GameStart() local test = false if not test then if Spring.IsReplay() then return end - if Spring.Utilities.GetPlayerCount() < 2 then return end - if Spring.Utilities.Gametype.IsSinglePlayer == true then return end + if Utilities.GetPlayerCount() < 2 then return end + if Utilities.Gametype.IsSinglePlayer == true then return end end local pnl = {a = "a"} diff --git a/luaui/Widgets/camera_player_tv.lua b/luaui/Widgets/camera_player_tv.lua index d9c8a242dcf..5c014dfd01c 100644 --- a/luaui/Widgets/camera_player_tv.lua +++ b/luaui/Widgets/camera_player_tv.lua @@ -68,7 +68,7 @@ local playersList = Spring.GetPlayerList() local spGetTeamColor = Spring.GetTeamColor local spGetPlayerInfo = Spring.GetPlayerInfo -local ColorIsDark = Spring.Utilities.Color.ColorIsDark +local ColorIsDark = Utilities.Color.ColorIsDark local aiTeams = {} local teamColorKeys = {} @@ -183,11 +183,11 @@ local function refreshUiDrawing() -- Player TV Button if not toggled and not lockPlayerID then - text = '\255\222\255\222 ' .. Spring.I18N('ui.playerTV.playerTV') .. ' ' + text = '\255\222\255\222 ' .. I18N('ui.playerTV.playerTV') .. ' ' color1 = { 0, 0.8*mult, 0, buttonOpacity } color2 = { 0, 0.55*mult, 0, buttonOpacity } else - text = '\255\255\222\222 ' .. (nextTrackingPlayerChange - os.clock() > -1 and Spring.I18N('ui.playerTV.cancelPlayerTV') or Spring.I18N('ui.playerTV.cancelCamera')) .. ' ' + text = '\255\255\222\222 ' .. (nextTrackingPlayerChange - os.clock() > -1 and I18N('ui.playerTV.cancelPlayerTV') or I18N('ui.playerTV.cancelCamera')) .. ' ' color1 = { 0.88*mult, 0.1*mult, 0.1*mult, buttonOpacity } color2 = { 0.6*mult, 0.05*mult, 0.05*mult, buttonOpacity } end @@ -203,7 +203,7 @@ local function refreshUiDrawing() -- Player Camera Button if isSpec and not toggled and not lockPlayerID and not aiTeams[myTeamID] then - text = '\255\255\255\255 ' .. Spring.I18N('ui.playerTV.playerCamera') .. ' ' + text = '\255\255\255\255 ' .. I18N('ui.playerTV.playerCamera') .. ' ' color1 = { 0.6*mult, 0.6*mult, 0.6*mult, buttonOpacity } color2 = { 0.4*mult, 0.4*mult, 0.4*mult, buttonOpacity } textWidth = mathFloor(font:GetTextWidth(text) * fontSize) @@ -217,11 +217,11 @@ local function refreshUiDrawing() -- Player Viewpoint Button if not toggled2 then - text = '\255\255\255\255 ' .. Spring.I18N('ui.playerTV.playerView') .. ' ' + text = '\255\255\255\255 ' .. I18N('ui.playerTV.playerView') .. ' ' color1 = { 0.6*mult, 0.6*mult, 0.6*mult, buttonOpacity } color2 = { 0.4*mult, 0.4*mult, 0.4*mult, buttonOpacity } else - text = '\255\255\255\255 ' .. Spring.I18N('ui.playerTV.globalView') .. ' ' + text = '\255\255\255\255 ' .. I18N('ui.playerTV.globalView') .. ' ' color1 = { 0.88*mult, 0.1*mult, 0.1*mult, buttonOpacity } color2 = { 0.6*mult, 0.05*mult, 0.05*mult, buttonOpacity } end @@ -249,9 +249,9 @@ local function refreshUiDrawing() gl.Color(0, 0, 0, 0.14*mult) RectRound(toggleButton[1] + bgpadding, toggleButton[2], toggleButton[3], toggleButton[4] - bgpadding, elementCorner*0.66, 1, 1, 1, 0) - local text = '\255\255\225\225 ' .. (nextTrackingPlayerChange - os.clock() > -1 and Spring.I18N('ui.playerTV.cancelPlayerTV') or Spring.I18N('ui.playerTV.cancelCamera')) .. ' ' + local text = '\255\255\225\225 ' .. (nextTrackingPlayerChange - os.clock() > -1 and I18N('ui.playerTV.cancelPlayerTV') or I18N('ui.playerTV.cancelCamera')) .. ' ' if not toggled and not lockPlayerID then - text = '\255\225\255\225 ' .. Spring.I18N('ui.playerTV.playerTV') .. ' ' + text = '\255\225\255\225 ' .. I18N('ui.playerTV.playerTV') .. ' ' end local fontSize = (widgetHeight * widgetScale) * 0.5 * math.clamp(1+((1-(vsy/1200))*0.33), 1, 1.15) local textWidth = mathFloor(font:GetTextWidth(text) * fontSize) @@ -271,9 +271,9 @@ local function refreshUiDrawing() gl.Color(0, 0, 0, 0.14*mult) RectRound(toggleButton2[1] + bgpadding, toggleButton2[2], toggleButton2[3]-bgpadding, toggleButton2[4] - bgpadding, elementCorner*0.66, 1, 1, 0, toggleButton2[1] < left and 1 or 0) - local text = '\255\255\255\244 ' .. Spring.I18N('ui.playerTV.globalView') .. ' ' + local text = '\255\255\255\244 ' .. I18N('ui.playerTV.globalView') .. ' ' if not toggled2 then - text = '\255\255\255\255 ' .. Spring.I18N('ui.playerTV.playerView') .. ' ' + text = '\255\255\255\255 ' .. I18N('ui.playerTV.playerView') .. ' ' end local fontSize = (widgetHeight * widgetScale) * 0.5 * math.clamp(1+((1-(vsy/1200))*0.33), 1, 1.15) local textWidth = mathFloor(font:GetTextWidth(text) * fontSize) @@ -294,7 +294,7 @@ local function refreshUiDrawing() gl.Color(0, 0, 0, 0.14*mult) RectRound(toggleButton3[1] + bgpadding, toggleButton3[2], toggleButton3[3]-bgpadding, toggleButton3[4] - bgpadding, elementCorner*0.66, 1, 1, 0, toggleButton3[1] < left and 1 or 0) - local text = '\255\255\255\244 ' .. Spring.I18N('ui.playerTV.playerCamera') .. ' ' + local text = '\255\255\255\244 ' .. I18N('ui.playerTV.playerCamera') .. ' ' local fontSize = (widgetHeight * widgetScale) * 0.5 * math.clamp(1+((1-(vsy/1200))*0.33), 1, 1.15) local textWidth = mathFloor(font:GetTextWidth(text) * fontSize) font:Begin() @@ -524,15 +524,15 @@ function widget:Update(dt) if WG['tooltip'] and not toggled and not lockPlayerID then if buttonHovered and buttonHovered == 1 then Spring.SetMouseCursor('cursornormal') - WG['tooltip'].ShowTooltip('playertv', Spring.I18N('ui.playerTV.tooltip')) + WG['tooltip'].ShowTooltip('playertv', I18N('ui.playerTV.tooltip')) end if buttonHovered and buttonHovered == 2 then Spring.SetMouseCursor('cursornormal') - WG['tooltip'].ShowTooltip('playertv', Spring.I18N('ui.playerTV.playerViewTooltip')) + WG['tooltip'].ShowTooltip('playertv', I18N('ui.playerTV.playerViewTooltip')) end if buttonHovered and buttonHovered == 3 then Spring.SetMouseCursor('cursornormal') - WG['tooltip'].ShowTooltip('playertv', Spring.I18N('ui.playerTV.playerCameraTooltip')) + WG['tooltip'].ShowTooltip('playertv', I18N('ui.playerTV.playerCameraTooltip')) end end @@ -600,7 +600,7 @@ local function drawContent() local _, _, _, aiName = Spring.GetAIInfo(myTeamID) local niceName = Spring.GetGameRulesParam('ainame_' .. myTeamID) name = niceName or aiName - name = Spring.I18N('ui.playersList.aiName', { name = name }) + name = I18N('ui.playersList.aiName', { name = name }) end if not name then name = '---' end -- create player name diff --git a/luaui/Widgets/cmd_context_build.lua b/luaui/Widgets/cmd_context_build.lua index 0ecf10c25b4..1eb95032d61 100644 --- a/luaui/Widgets/cmd_context_build.lua +++ b/luaui/Widgets/cmd_context_build.lua @@ -1,7 +1,7 @@ local voidWater = false local waterLevel = Spring.GetModOptions().map_waterlevel -local waterIsLava = Spring.Lava.isLavaMap +local waterIsLava = Lava.isLavaMap local minHeight, _, _, _ = Spring.GetGroundExtremes() local success, mapinfo = pcall(VFS.Include,"mapinfo.lua") -- load mapinfo.lua confs if success and mapinfo then diff --git a/luaui/Widgets/cmd_gamespeed.lua b/luaui/Widgets/cmd_gamespeed.lua index e4310b0cce4..d850a43c8ca 100644 --- a/luaui/Widgets/cmd_gamespeed.lua +++ b/luaui/Widgets/cmd_gamespeed.lua @@ -31,7 +31,7 @@ local speedLevels = { } local function setGameSpeed(speed) - if Spring.Utilities.Gametype.IsSinglePlayer() or Spring.IsCheatingEnabled() or Spring.IsReplay() then + if Utilities.Gametype.IsSinglePlayer() or Spring.IsCheatingEnabled() or Spring.IsReplay() then Spring.SendCommands("setspeed " .. speed) end end diff --git a/luaui/Widgets/cmd_resolution_switcher.lua b/luaui/Widgets/cmd_resolution_switcher.lua index 34e548afb95..89c723ace8d 100644 --- a/luaui/Widgets/cmd_resolution_switcher.lua +++ b/luaui/Widgets/cmd_resolution_switcher.lua @@ -112,7 +112,7 @@ local function refreshScreenModes() local fullscreen = { display = display, displayName = videoMode.displayName, - name = Spring.I18N('ui.resolutionswitcher.fullscreen'), + name = I18N('ui.resolutionswitcher.fullscreen'), type = windowType.fullscreen, width = videoMode.w, height = videoMode.h, @@ -120,7 +120,7 @@ local function refreshScreenModes() local borderless = { display = display, - name = Spring.I18N('ui.resolutionswitcher.borderless'), + name = I18N('ui.resolutionswitcher.borderless'), displayName = videoMode.displayName, type = windowType.borderless, width = videoMode.w, @@ -135,7 +135,7 @@ local function refreshScreenModes() local windowed = { display = display, displayName = videoMode.displayName, - name = Spring.I18N('ui.resolutionswitcher.window').." " .. videoMode.w .. " × " .. videoMode.h.." (" .. videoMode.hz.."hz)", + name = I18N('ui.resolutionswitcher.window').." " .. videoMode.w .. " × " .. videoMode.h.." (" .. videoMode.hz.."hz)", type = windowType.windowed, width = videoMode.w, height = videoMode.h, @@ -168,7 +168,7 @@ local function refreshScreenModes() tableInsert(screenModes, { display = #displays+1, -- not actual display number actualDisplay = (x < x2 and display or display2), - name = Spring.I18N('ui.resolutionswitcher.displays').." " .. display .. " + " .. display2.." ("..w + w2 .." x "..mathMin(h, h2)..")", + name = I18N('ui.resolutionswitcher.displays').." " .. display .. " + " .. display2.." ("..w + w2 .." x "..mathMin(h, h2)..")", displayName = "", type = windowType.multimonitor, x = mathMin(x, x2), @@ -181,7 +181,7 @@ local function refreshScreenModes() tableInsert(screenModes, { display = #displays+1, -- not actual display number actualDisplay = (x < x2 and display or display2), - name = Spring.I18N('ui.resolutionswitcher.displays').." " .. display .. " + " .. display2.." ("..w + w2 .." x "..mathMax(h, h2)..")", + name = I18N('ui.resolutionswitcher.displays').." " .. display .. " + " .. display2.." ("..w + w2 .." x "..mathMax(h, h2)..")", displayName = "", type = windowType.multimonitor, x = mathMin(x, x2), @@ -200,7 +200,7 @@ local function refreshScreenModes() -- only add the "Multi Display" option when there are valid display combos to choose from for k,v in pairs(addedDisplayCombo) do displays[#displays+1] = { - name = Spring.I18N('ui.resolutionswitcher.multidisplay'), + name = I18N('ui.resolutionswitcher.multidisplay'), width = 0, height = 0, hz = 0, diff --git a/luaui/Widgets/cmd_share_unit.lua b/luaui/Widgets/cmd_share_unit.lua index 932b5c04549..e04d22a14cf 100644 --- a/luaui/Widgets/cmd_share_unit.lua +++ b/luaui/Widgets/cmd_share_unit.lua @@ -34,7 +34,7 @@ local GetUnitTeam = Spring.GetUnitTeam local GetSelectedUnits = Spring.GetSelectedUnits local GetTeamAllyTeamID = Spring.GetTeamAllyTeamID local ShareResources = Spring.ShareResources -local I18N = Spring.I18N +local I18N = I18N local GetSpectatingState = Spring.GetSpectatingState local WorldToScreenCoords = Spring.WorldToScreenCoords local PlaySoundFile = Spring.PlaySoundFile @@ -202,7 +202,7 @@ local function colourNames(teamId) return "" end local nameColourR, nameColourG, nameColourB, nameColourA = Spring.GetTeamColor(teamId) - return Spring.Utilities.Color.ToString(nameColourR, nameColourG, nameColourB) + return Utilities.Color.ToString(nameColourR, nameColourG, nameColourB) end local function drawName(teamId) diff --git a/luaui/Widgets/dbg_ceg_auto_reloader.lua b/luaui/Widgets/dbg_ceg_auto_reloader.lua index 1e0c4215057..c829b360a84 100644 --- a/luaui/Widgets/dbg_ceg_auto_reloader.lua +++ b/luaui/Widgets/dbg_ceg_auto_reloader.lua @@ -1,4 +1,4 @@ -if not Spring.Utilities.IsDevMode() then -- and not Spring.Utilities.ShowDevUI() then +if not Utilities.IsDevMode() then -- and not Spring.Utilities.ShowDevUI() then return end diff --git a/luaui/Widgets/dbg_engine_shader_reload.lua b/luaui/Widgets/dbg_engine_shader_reload.lua index def406a27f4..6f9fbc1bd0e 100644 --- a/luaui/Widgets/dbg_engine_shader_reload.lua +++ b/luaui/Widgets/dbg_engine_shader_reload.lua @@ -1,4 +1,4 @@ -if not Spring.Utilities.IsDevMode() then -- and not Spring.Utilities.ShowDevUI() then +if not Utilities.IsDevMode() then -- and not Spring.Utilities.ShowDevUI() then return end diff --git a/luaui/Widgets/dbg_ffa_startpoints_picker.lua b/luaui/Widgets/dbg_ffa_startpoints_picker.lua index 6e9e5d79e33..06464807aa4 100644 --- a/luaui/Widgets/dbg_ffa_startpoints_picker.lua +++ b/luaui/Widgets/dbg_ffa_startpoints_picker.lua @@ -816,7 +816,7 @@ local function isSoloDevMode() local isSolo = allyTeamCount == 1 and teamCount == 1 -- we only run in solo games with dev mode enabled, and not in replays - if not isSolo or not Spring.Utilities.IsDevMode() or Spring.IsReplay() then + if not isSolo or not Utilities.IsDevMode() or Spring.IsReplay() then return false end return true diff --git a/luaui/Widgets/dbg_reloadcob.lua b/luaui/Widgets/dbg_reloadcob.lua index ab73e993f89..72a19e4de90 100644 --- a/luaui/Widgets/dbg_reloadcob.lua +++ b/luaui/Widgets/dbg_reloadcob.lua @@ -32,7 +32,7 @@ function widget:KeyPress(key, modifier, isRepeat) end function widget:Initialize() - if not Spring.Utilities.IsDevMode() then + if not Utilities.IsDevMode() then spEcho("ReloadCob widget requires devmode") widgetHandler:RemoveWidget() return diff --git a/luaui/Widgets/dbg_test_headless_overrides.lua b/luaui/Widgets/dbg_test_headless_overrides.lua index 64590cdefcf..604522ee162 100644 --- a/luaui/Widgets/dbg_test_headless_overrides.lua +++ b/luaui/Widgets/dbg_test_headless_overrides.lua @@ -10,7 +10,7 @@ function widget:GetInfo() } end -if not Spring.Utilities.IsDevMode() or not Spring.Utilities.Gametype.IsSinglePlayer() or Platform.gl then +if not Utilities.IsDevMode() or not Utilities.Gametype.IsSinglePlayer() or Platform.gl then return end diff --git a/luaui/Widgets/dbg_test_runner.lua b/luaui/Widgets/dbg_test_runner.lua index b7ef9bd39e2..1c16ba7767a 100644 --- a/luaui/Widgets/dbg_test_runner.lua +++ b/luaui/Widgets/dbg_test_runner.lua @@ -15,7 +15,7 @@ end -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame -if not Spring.Utilities.IsDevMode() or not Spring.Utilities.Gametype.IsSinglePlayer() then +if not Utilities.IsDevMode() or not Utilities.Gametype.IsSinglePlayer() then return end @@ -1309,7 +1309,7 @@ end function widget:Initialize() widgetHandler:DisableWidget("Test Runner Watchdog") - if not Spring.Utilities.IsDevMode() then + if not Utilities.IsDevMode() then widgetHandler:RemoveWidget(self) end diff --git a/luaui/Widgets/dbg_test_runner_watchdog.lua b/luaui/Widgets/dbg_test_runner_watchdog.lua index 7aeeb3835a2..cea377f4365 100644 --- a/luaui/Widgets/dbg_test_runner_watchdog.lua +++ b/luaui/Widgets/dbg_test_runner_watchdog.lua @@ -11,7 +11,7 @@ function widget:GetInfo() } end -if not Spring.Utilities.IsDevMode() or not Spring.Utilities.Gametype.IsSinglePlayer() then +if not Utilities.IsDevMode() or not Utilities.Gametype.IsSinglePlayer() then return end diff --git a/luaui/Widgets/dbg_widget_auto_reloader.lua b/luaui/Widgets/dbg_widget_auto_reloader.lua index 3fce12b76d9..20fe114d775 100644 --- a/luaui/Widgets/dbg_widget_auto_reloader.lua +++ b/luaui/Widgets/dbg_widget_auto_reloader.lua @@ -1,4 +1,4 @@ -if not Spring.Utilities.IsDevMode() then -- and not Spring.Utilities.ShowDevUI() then +if not Utilities.IsDevMode() then -- and not Spring.Utilities.ShowDevUI() then return end diff --git a/luaui/Widgets/dbg_widget_profiler.lua b/luaui/Widgets/dbg_widget_profiler.lua index 03447ed5753..31cc7e4de4a 100644 --- a/luaui/Widgets/dbg_widget_profiler.lua +++ b/luaui/Widgets/dbg_widget_profiler.lua @@ -103,7 +103,7 @@ local sortedList = {} local deltaTime local redStrength = {} -local ColorString = Spring.Utilities.Color.ToString +local ColorString = Utilities.Color.ToString if Spring.GetTimerMicros and Spring.GetConfigInt("UseHighResTimer", 0) == 1 then spGetTimer = Spring.GetTimerMicros diff --git a/luaui/Widgets/death_messages.lua b/luaui/Widgets/death_messages.lua index c984f3602ad..2c81ad2b318 100644 --- a/luaui/Widgets/death_messages.lua +++ b/luaui/Widgets/death_messages.lua @@ -66,7 +66,7 @@ local function notifyTeamDeath(teamID) else local playerNames = table.concat(playerNameList, ', ') local n = math.random(#deathMessageKeys) - local message = Spring.I18N('tips.deathMessages.team.' .. deathMessageKeys[n], { playerList = playerNames }) + local message = I18N('tips.deathMessages.team.' .. deathMessageKeys[n], { playerList = playerNames }) Spring.SendMessage(message) end diff --git a/luaui/Widgets/dev_autocheat.lua b/luaui/Widgets/dev_autocheat.lua index 8529f608ed2..f07ade102ae 100644 --- a/luaui/Widgets/dev_autocheat.lua +++ b/luaui/Widgets/dev_autocheat.lua @@ -1,4 +1,4 @@ -if not Spring.Utilities.IsDevMode() then +if not Utilities.IsDevMode() then return end diff --git a/luaui/Widgets/flowui_gl4.lua b/luaui/Widgets/flowui_gl4.lua index d245b1e2886..5c3639e258e 100644 --- a/luaui/Widgets/flowui_gl4.lua +++ b/luaui/Widgets/flowui_gl4.lua @@ -253,7 +253,7 @@ end local function newElement(o) -- This table contains the default properties if o == nil then o = {} end - if type(o) ~= 'table' then Spring.Debug.TraceEcho() end + if type(o) ~= 'table' then Debug.TraceEcho() end if o.name == nil then -- auto namer nameCounter = nameCounter + 1 end @@ -301,7 +301,7 @@ local function newElement(o) -- This table contains the default properties if parent.layer then obj.layer = parent.layer else - Spring.Debug.TraceEcho(obj.name .. " parented to ".. obj.parent.name.. " has no layer") + Debug.TraceEcho(obj.name .. " parented to ".. obj.parent.name.. " has no layer") end end -- Ok, so this is where parent-relative positioning comes in, and is expressed in percent @@ -331,8 +331,8 @@ end -- [4 5 6] -- [7 8 9] function metaElement:UpdateTextPosition(newtext) -- for internal use only! - if newtext.text == nil then Spring.Debug.TraceEcho() end - if newtext.fontsize == nil then Spring.Debug.TraceEcho() end + if newtext.text == nil then Debug.TraceEcho() end + if newtext.fontsize == nil then Debug.TraceEcho() end newtext.textwidth = font:GetTextWidth(newtext.text) * newtext.fontsize newtext.textheight = font:GetTextHeight(newtext.text) * newtext.fontsize if newtext.alignment == nil then return end @@ -372,7 +372,7 @@ end function metaElement:AddText(ox, oy, text, fontsize, textoptions, alignment, textcolor, outlinecolor) -- it is now that we need to cache text height, and width if self.layer == nil then - Spring.Debug.TraceEcho(self.name) + Debug.TraceEcho(self.name) --Spring.Debug.TraceFullEcho() end self.layer.textChanged = true @@ -468,7 +468,7 @@ function metaElement:UpdateVBOKeys(keyname, value, delta) local success = getElementInstanceData(VBO, instanceKey, self.vboCache) -- this is empty! probbly instance does not exist in this if success == nil then spEcho("element not found",self.name, VBO.myName,instanceKey) - Spring.Debug.TraceFullEcho() + Debug.TraceFullEcho() end if delta then diff --git a/luaui/Widgets/gfx_DrawUnitShape_GL4.lua b/luaui/Widgets/gfx_DrawUnitShape_GL4.lua index 429a10b04b0..dcf79eb0919 100644 --- a/luaui/Widgets/gfx_DrawUnitShape_GL4.lua +++ b/luaui/Widgets/gfx_DrawUnitShape_GL4.lua @@ -292,7 +292,7 @@ local function DrawUnitGL4(unitID, unitDefID, px, py, pz, rotationY, alpha, team elseif armUnitDefIDs[unitDefID] then DrawUnitVBOTable = armDrawUnitVBOTable else spEcho("DrawUnitGL4 : The given unitDefID", unitDefID, UnitDefs[unitDefID].name, "is neither arm nor cor, only those two are supported at the moment") - Spring.Debug.TraceFullEcho(nil,nil,nil,"DrawUnitGL4") + Debug.TraceFullEcho(nil,nil,nil,"DrawUnitGL4") return nil end @@ -343,7 +343,7 @@ local function DrawUnitShapeGL4(unitDefID, px, py, pz, rotationY, alpha, teamID, if not DrawUnitShapeVBOTable then spEcho("DrawUnitShapeGL4: The given unitDefID", unitDefID, UnitDefs[unitDefID].name, "is missing a target DrawUnitShapeVBOTable") - Spring.Debug.TraceFullEcho(nil,nil,nil,"DrawUnitGL4") + Debug.TraceFullEcho(nil,nil,nil,"DrawUnitGL4") return nil end uniqueIDtoUnitShapeVBOTable[uniqueID] = DrawUnitShapeVBOTable @@ -584,7 +584,7 @@ end function widget:Shutdown() for i,VBOTable in ipairs(VBOTables) do if VBOTable.VAO then - if Spring.Utilities.IsDevMode() then + if Utilities.IsDevMode() then InstanceVBOTable.dumpAndCompareInstanceData(VBOTable) end VBOTable.VAO:Delete() @@ -593,7 +593,7 @@ function widget:Shutdown() for tex1,VBOTable in ipairs(tex1ToVBO) do if VBOTable.VAO then - if Spring.Utilities.IsDevMode() then + if Utilities.IsDevMode() then InstanceVBOTable.dumpAndCompareInstanceData(VBOTable) end VBOTable.VAO:Delete() diff --git a/luaui/Widgets/gfx_HighlightUnit_GL4.lua b/luaui/Widgets/gfx_HighlightUnit_GL4.lua index cbae7037ea5..f2f1e9c674a 100644 --- a/luaui/Widgets/gfx_HighlightUnit_GL4.lua +++ b/luaui/Widgets/gfx_HighlightUnit_GL4.lua @@ -396,7 +396,7 @@ end function widget:Shutdown() if highlightUnitVBOTable and highlightUnitVBOTable.VAO then - if Spring.Utilities.IsDevMode() then + if Utilities.IsDevMode() then InstanceVBOTable.dumpAndCompareInstanceData(highlightUnitVBOTable) end highlightUnitVBOTable.VAO:Delete() diff --git a/luaui/Widgets/gfx_decals_gl4.lua b/luaui/Widgets/gfx_decals_gl4.lua index 14eca929840..6490b1f4964 100644 --- a/luaui/Widgets/gfx_decals_gl4.lua +++ b/luaui/Widgets/gfx_decals_gl4.lua @@ -332,7 +332,7 @@ local floor = mathFloor local function hashPos(mapx, mapz) -- packs XZ into 1000*x + z if mapx == nil or mapz == nil then - Spring.Debug.TraceFullEcho() + Debug.TraceFullEcho() end return floor(mapx / areaResolution) * 1000 + floor(mapz/areaResolution) diff --git a/luaui/Widgets/gfx_deferred_rendering_GL4.lua b/luaui/Widgets/gfx_deferred_rendering_GL4.lua index 4570b09e390..d0f49740621 100644 --- a/luaui/Widgets/gfx_deferred_rendering_GL4.lua +++ b/luaui/Widgets/gfx_deferred_rendering_GL4.lua @@ -261,7 +261,7 @@ local projectileDefLights -- one light per weaponDefID local explosionLights -- one light per weaponDefID local gibLight -- one light for all pieceprojectiles -local isSinglePlayer = Spring.Utilities.Gametype.IsSinglePlayer() +local isSinglePlayer = Utilities.Gametype.IsSinglePlayer() local shaderConfig = { MIERAYLEIGHRATIO = 0.1, -- The ratio of Rayleigh scattering to Mie scattering @@ -508,7 +508,7 @@ local function InitializeLight(lightTable, unitID) if not lightTable.lightParamTable then -- perform correct init local lightparams = {} for i = 1, lightParamTableSize do lightparams[i] = 0 end - if lightTable.lightConfig == nil then Spring.Debug.TraceFullEcho() end + if lightTable.lightConfig == nil then Debug.TraceFullEcho() end for paramname, tablepos in pairs(lightParamKeyOrder) do lightparams[tablepos] = lightTable.lightConfig[paramname] or lightparams[tablepos] end @@ -1378,7 +1378,7 @@ local function PrintProjectileInfo(projectileID) local px, py, pz = spGetProjectilePosition(projectileID) local weapon, piece = Spring.GetProjectileType(projectileID) local weaponDefID = weapon and Spring.GetProjectileDefID ( projectileID ) - Spring.Debug.TraceFullEcho() + Debug.TraceFullEcho() end @@ -1746,7 +1746,7 @@ end function widget:Initialize() - Spring.Debug.TraceEcho("Initialize DLGL4") + Debug.TraceEcho("Initialize DLGL4") if spGetConfigString("AllowDeferredMapRendering") == '0' or spGetConfigString("AllowDeferredModelRendering") == '0' then spEcho('Deferred Rendering (gfx_deferred_rendering.lua) requires AllowDeferredMapRendering and AllowDeferredModelRendering to be enabled in springsettings.cfg!') widgetHandler:RemoveWidget() diff --git a/luaui/Widgets/gfx_distortion_gl4.lua b/luaui/Widgets/gfx_distortion_gl4.lua index 56d7953bb59..1208aa5946d 100644 --- a/luaui/Widgets/gfx_distortion_gl4.lua +++ b/luaui/Widgets/gfx_distortion_gl4.lua @@ -118,7 +118,7 @@ local projectileDefDistortions -- one distortion per weaponDefID local explosionDistortions -- one distortion per weaponDefID local gibDistortion -- one distortion for all pieceprojectiles -local isSinglePlayer = Spring.Utilities.Gametype.IsSinglePlayer() +local isSinglePlayer = Utilities.Gametype.IsSinglePlayer() local shaderConfig = { VOIDWATER = gl.GetMapRendering("voidWater") and 1 or 0, @@ -413,7 +413,7 @@ local function InitializeDistortion(distortionTable, unitID) if not distortionTable.distortionParamTable then -- perform correct init local distortionparams = {} for i = 1, distortionParamTableSize do distortionparams[i] = 0 end - if distortionTable.distortionConfig == nil then Spring.Debug.TraceFullEcho() end + if distortionTable.distortionConfig == nil then Debug.TraceFullEcho() end for paramname, tablepos in pairs(distortionParamKeyOrder) do if paramname == "effectType" and type(distortionTable.distortionConfig[paramname]) == 'string' then distortionparams[tablepos] = distortionEffectTypes[distortionTable.distortionConfig[paramname]] or distortionparams[tablepos] @@ -1016,7 +1016,7 @@ local function PrintProjectileInfo(projectileID) local px, py, pz = spGetProjectilePosition(projectileID) local weapon, piece = Spring.GetProjectileType(projectileID) local weaponDefID = weapon and Spring.GetProjectileDefID ( projectileID ) - Spring.Debug.TraceFullEcho() + Debug.TraceFullEcho() end @@ -1336,7 +1336,7 @@ end function widget:Initialize() - Spring.Debug.TraceEcho("Initialize distortionGL4") + Debug.TraceEcho("Initialize distortionGL4") if spGetConfigString("AllowDeferredMapRendering") == '0' or spGetConfigString("AllowDeferredModelRendering") == '0' then spEcho('Distortion GL4 requires AllowDeferredMapRendering and AllowDeferredModelRendering to be enabled in springsettings.cfg!') widgetHandler:RemoveWidget() diff --git a/luaui/Widgets/gfx_glass.lua b/luaui/Widgets/gfx_glass.lua index a2bbbde0df3..0954b9dcef2 100644 --- a/luaui/Widgets/gfx_glass.lua +++ b/luaui/Widgets/gfx_glass.lua @@ -240,7 +240,7 @@ end if next(glasstriggerfeaturedefsids) == nil then return end function widget:Initialize() - if Spring.Utilities.Gametype.IsSinglePlayer ~= true then + if Utilities.Gametype.IsSinglePlayer ~= true then widgetHandler:RemoveWidget() return end diff --git a/luaui/Widgets/gfx_norush_timer_gl4.lua b/luaui/Widgets/gfx_norush_timer_gl4.lua index e1b79b7fe69..6ec2d956fa3 100644 --- a/luaui/Widgets/gfx_norush_timer_gl4.lua +++ b/luaui/Widgets/gfx_norush_timer_gl4.lua @@ -18,7 +18,7 @@ local spEcho = Spring.Echo -- spEcho(Spring.GetTeamInfo(Spring.GetMyTeamID())) -local pveAllyTeamID = Spring.Utilities.GetScavAllyTeamID() or Spring.Utilities.GetRaptorAllyTeamID() +local pveAllyTeamID = Utilities.GetScavAllyTeamID() or Utilities.GetRaptorAllyTeamID() ---- Config stuff ------------------ local autoReload = false -- refresh shader code every second (disable in production!) diff --git a/luaui/Widgets/gui_advplayerslist.lua b/luaui/Widgets/gui_advplayerslist.lua index 3fcb8d59736..eb49fec74f8 100644 --- a/luaui/Widgets/gui_advplayerslist.lua +++ b/luaui/Widgets/gui_advplayerslist.lua @@ -125,9 +125,9 @@ local sp = { } local Color = { - ToString = Spring.Utilities.Color.ToString, - ToIntArray = Spring.Utilities.Color.ToIntArray, - IsDark = Spring.Utilities.Color.ColorIsDark, + ToString = Utilities.Color.ToString, + ToIntArray = Utilities.Color.ToIntArray, + IsDark = Utilities.Color.ColorIsDark, } local gl_Texture = gl.Texture @@ -311,7 +311,7 @@ local absentName = " --- " local gameStarted = false local gameStartRefreshed = spGetGameFrame() > 30 -local isSinglePlayer = Spring.Utilities.Gametype.IsSinglePlayer() +local isSinglePlayer = Utilities.Gametype.IsSinglePlayer() local isSingle = false if not mySpecStatus then @@ -621,7 +621,7 @@ if mySpecStatus or numTeamsInAllyTeam <= 1 then end local teamRanking = {} -local isPvE = Spring.Utilities.Gametype.IsPvE() +local isPvE = Utilities.Gametype.IsPvE() --------------------------------------------------------------------------------------------------- -- Geometry @@ -1314,12 +1314,12 @@ function GetAIName(teamID) if niceName then name = niceName - if Spring.Utilities.ShowDevUI() and options.profile then + if Utilities.ShowDevUI() and options.profile then name = name .. " [" .. options.profile .. "]" end end - return Spring.I18N('ui.playersList.aiName', { name = name }) + return I18N('ui.playersList.aiName', { name = name }) end function CreatePlayerFromTeam(teamID) @@ -2056,12 +2056,12 @@ function drawMainList() if numberOfSpecs == 0 or (specListShow and numberOfSpecs < 10) then specAmount = "" end - DrawLabel(" ".. Spring.I18N('ui.playersList.spectators', { amount = specAmount }), drawListOffset[i], specListShow) + DrawLabel(" ".. I18N('ui.playersList.spectators', { amount = specAmount }), drawListOffset[i], specListShow) if spGetGameFrame() <= 0 then if specListShow then - DrawLabelTip( Spring.I18N('ui.playersList.hideSpecs'), drawListOffset[i], 95) + DrawLabelTip( I18N('ui.playersList.hideSpecs'), drawListOffset[i], 95) else - DrawLabelTip(Spring.I18N('ui.playersList.showSpecs'), drawListOffset[i], 95) + DrawLabelTip(I18N('ui.playersList.showSpecs'), drawListOffset[i], 95) end end elseif drawObject == -4 then -- enemy teams separator @@ -2076,26 +2076,26 @@ function drawMainList() enemyAmount = "" end if WG.allyTeamRanking and enemyListShow then - DrawLabel(" "..Spring.I18N('ui.playersList.leaderboard'), drawListOffset[i], true) + DrawLabel(" "..I18N('ui.playersList.leaderboard'), drawListOffset[i], true) leaderboardOffset = drawListOffset[i] else - DrawLabel(" "..Spring.I18N('ui.playersList.enemies', { amount = enemyAmount }), drawListOffset[i], true) + DrawLabel(" "..I18N('ui.playersList.enemies', { amount = enemyAmount }), drawListOffset[i], true) end if spGetGameFrame() <= 0 then if enemyListShow then - DrawLabelTip( Spring.I18N('ui.playersList.hideEnemies'), drawListOffset[i], 95) + DrawLabelTip( I18N('ui.playersList.hideEnemies'), drawListOffset[i], 95) else - DrawLabelTip(Spring.I18N('ui.playersList.showEnemies'), drawListOffset[i], 95) + DrawLabelTip(I18N('ui.playersList.showEnemies'), drawListOffset[i], 95) end end end elseif drawObject == -6 then - DrawLabel(" "..Spring.I18N('ui.playersList.scoreboard'), drawListOffset[i], true) + DrawLabel(" "..I18N('ui.playersList.scoreboard'), drawListOffset[i], true) leaderboardOffset = drawListOffset[i] elseif drawObject == -2 then - DrawLabel(" " .. Spring.I18N('ui.playersList.allies'), drawListOffset[i], true) + DrawLabel(" " .. I18N('ui.playersList.allies'), drawListOffset[i], true) if spGetGameFrame() <= 0 then - DrawLabelTip(Spring.I18N('ui.playersList.trackPlayer'), drawListOffset[i], 46) + DrawLabelTip(I18N('ui.playersList.trackPlayer'), drawListOffset[i], 46) end elseif drawObject == -1 then leader = true @@ -2861,7 +2861,7 @@ function DrawName(name, nameIsAlias, team, posY, dark, playerID, accountID, desy font2:SetOutlineColor(0, 0, 0, 1) end font2:SetTextColor(1,0.45,0.45,1) - font2:Print(Spring.I18N('ui.playersList.desynced'), m_name.posX + widgetPosX + 5 + xPadding + (font2:GetTextWidth(nameText)*14*pScale), posY + (5.7*playerScale), 8*pScale, "o") + font2:Print(I18N('ui.playersList.desynced'), m_name.posX + widgetPosX + 5 + xPadding + (font2:GetTextWidth(nameText)*14*pScale), posY + (5.7*playerScale), 8*pScale, "o") elseif pDraw and not pDraw.dead and pDraw.incomeMultiplier and pDraw.incomeMultiplier ~= 1 then if dark then font2:SetOutlineColor(0, 0, 0, 1) @@ -3064,7 +3064,7 @@ end function TakeTip(mouseX) if mouseX >= widgetPosX - 57 * widgetScale and mouseX <= widgetPosX - 1 * widgetScale then - tipText = Spring.I18N('ui.playersList.takeUnits') + tipText = I18N('ui.playersList.takeUnits') tipTextTime = osClock() end end @@ -3106,24 +3106,24 @@ end function ShareTip(mouseX, playerID) if playerID == myPlayerID then if mouseX >= widgetPosX + (m_share.posX + (1*playerScale)) * widgetScale and mouseX <= widgetPosX + (m_share.posX + (17*playerScale)) * widgetScale then - tipText = Spring.I18N('ui.playersList.requestSupport') + tipText = I18N('ui.playersList.requestSupport') tipTextTime = osClock() elseif mouseX >= widgetPosX + (m_share.posX + (19*playerScale)) * widgetScale and mouseX <= widgetPosX + (m_share.posX + (35*playerScale)) * widgetScale then - tipText = Spring.I18N('ui.playersList.requestEnergy') + tipText = I18N('ui.playersList.requestEnergy') tipTextTime = osClock() elseif mouseX >= widgetPosX + (m_share.posX + (37*playerScale)) * widgetScale and mouseX <= widgetPosX + (m_share.posX + (53*playerScale)) * widgetScale then - tipText = Spring.I18N('ui.playersList.requestMetal') + tipText = I18N('ui.playersList.requestMetal') tipTextTime = osClock() end else if mouseX >= widgetPosX + (m_share.posX + (1*playerScale)) * widgetScale and mouseX <= widgetPosX + (m_share.posX + (17*playerScale)) * widgetScale then - tipText = Spring.I18N('ui.playersList.shareUnits') + tipText = I18N('ui.playersList.shareUnits') tipTextTime = osClock() elseif mouseX >= widgetPosX + (m_share.posX + (19*playerScale)) * widgetScale and mouseX <= widgetPosX + (m_share.posX + (35*playerScale)) * widgetScale then - tipText = Spring.I18N('ui.playersList.shareEnergy') + tipText = I18N('ui.playersList.shareEnergy') tipTextTime = osClock() elseif mouseX >= widgetPosX + (m_share.posX + (37*playerScale)) * widgetScale and mouseX <= widgetPosX + (m_share.posX + (53*playerScale)) * widgetScale then - tipText = Spring.I18N('ui.playersList.shareMetal') + tipText = I18N('ui.playersList.shareMetal') tipTextTime = osClock() end end @@ -3132,10 +3132,10 @@ end function AllyTip(mouseX, playerID) if mouseX >= widgetPosX + (m_alliance.posX + (1*playerScale)) * widgetScale and mouseX <= widgetPosX + (m_alliance.posX + (11*playerScale)) * widgetScale then if sp.AreTeamsAllied(player[playerID].team, myTeamID) then - tipText = Spring.I18N('ui.playersList.becomeEnemy') + tipText = I18N('ui.playersList.becomeEnemy') tipTextTime = osClock() else - tipText = Spring.I18N('ui.playersList.becomeAlly') + tipText = I18N('ui.playersList.becomeAlly') tipTextTime = osClock() end end @@ -3168,16 +3168,16 @@ function ResourcesTip(mouseX, energy, energyStorage, energyIncome, metal, metalS metalIncome = mathFloor(metalIncome / 10) * 10 end if energy >= 10000 then - energy = Spring.I18N('ui.playersList.thousands', { number = mathFloor(energy / 1000) }) + energy = I18N('ui.playersList.thousands', { number = mathFloor(energy / 1000) }) end if metal >= 10000 then - metal = Spring.I18N('ui.playersList.thousands', { number = mathFloor(metal / 1000) }) + metal = I18N('ui.playersList.thousands', { number = mathFloor(metal / 1000) }) end if energyIncome >= 10000 then - energyIncome = Spring.I18N('ui.playersList.thousands', { number = mathFloor(energyIncome / 1000) }) + energyIncome = I18N('ui.playersList.thousands', { number = mathFloor(energyIncome / 1000) }) end if metalIncome >= 10000 then - metalIncome = Spring.I18N('ui.playersList.thousands', { number = mathFloor(metalIncome / 1000) }) + metalIncome = I18N('ui.playersList.thousands', { number = mathFloor(metalIncome / 1000) }) end tipTextTitle = (spec and "\255\240\240\240" or colourNames(teamID)) .. name tipText = "\255\255\255\255+" .. metalIncome.. "\n\255\255\255\255" .. metal .. "\n\255\255\255\000" .. energy .. "\n\255\255\255\000+" .. energyIncome @@ -3202,13 +3202,13 @@ function IncomeTip(mouseX, energyIncome, metalIncome, name, teamID) metalIncome = mathFloor(metalIncome / 10) * 10 end if energyIncome >= 10000 then - energyIncome = Spring.I18N('ui.playersList.thousands', { number = mathFloor(energyIncome / 1000) }) + energyIncome = I18N('ui.playersList.thousands', { number = mathFloor(energyIncome / 1000) }) end if metalIncome >= 10000 then - metalIncome = Spring.I18N('ui.playersList.thousands', { number = mathFloor(metalIncome / 1000) }) + metalIncome = I18N('ui.playersList.thousands', { number = mathFloor(metalIncome / 1000) }) end tipTextTitle = (spec and "\255\240\240\240" or colourNames(teamID)) .. name - tipText = Spring.I18N('ui.playersList.resincome') .. "\n\255\255\255\000+" .. energyIncome .. "\n\255\255\255\255+" .. metalIncome + tipText = I18N('ui.playersList.resincome') .. "\n\255\255\255\000+" .. energyIncome .. "\n\255\255\255\255+" .. metalIncome tipTextTime = osClock() end end @@ -3216,24 +3216,24 @@ end function PingCpuTip(mouseX, pingLvl, cpuLvl, fps, gpumem, system, name, teamID, spec, apm) if mouseX >= widgetPosX + (m_cpuping.posX + (13*playerScale)) * widgetScale and mouseX <= widgetPosX + (m_cpuping.posX + (23*playerScale)) * widgetScale then if pingLvl < 2000 then - pingLvl = Spring.I18N('ui.playersList.milliseconds', { number = pingLvl }) + pingLvl = I18N('ui.playersList.milliseconds', { number = pingLvl }) elseif pingLvl >= 2000 then - pingLvl = Spring.I18N('ui.playersList.seconds', { number = round(pingLvl / 1000, 0) }) + pingLvl = I18N('ui.playersList.seconds', { number = round(pingLvl / 1000, 0) }) end - tipText = Spring.I18N('ui.playersList.commandDelay', { labelColor = "\255\190\190\190", delayColor = "\255\255\255\255", delay = pingLvl }) + tipText = I18N('ui.playersList.commandDelay', { labelColor = "\255\190\190\190", delayColor = "\255\255\255\255", delay = pingLvl }) tipTextTitle = (spec and "\255\240\240\240" or colourNames(teamID)) .. name tipTextTime = osClock() elseif mouseX >= widgetPosX + (m_cpuping.posX + (1*playerScale)) * widgetScale and mouseX <= widgetPosX + (m_cpuping.posX + (11*playerScale)) * widgetScale then tipText = '' if not spec and apm ~= nil then - tipText = tipText .. Spring.I18N('ui.playersList.apm', { apm = apm }) .."\n" + tipText = tipText .. I18N('ui.playersList.apm', { apm = apm }) .."\n" end if fps ~= nil then - tipText = tipText .. Spring.I18N('ui.playersList.framerate', { fps = fps }) + tipText = tipText .. I18N('ui.playersList.framerate', { fps = fps }) end - tipText = tipText .. " " .. Spring.I18N('ui.playersList.cpu', { cpuUsage = cpuLvl }) + tipText = tipText .. " " .. I18N('ui.playersList.cpu', { cpuUsage = cpuLvl }) if gpumem ~= nil then - tipText = tipText .. " " .. Spring.I18N('ui.playersList.gpuMemory', { gpuUsage = gpumem }) + tipText = tipText .. " " .. I18N('ui.playersList.gpuMemory', { gpuUsage = gpumem }) end tipTextTitle = (spec and "\255\240\240\240" or colourNames(teamID)) .. name if system ~= nil then @@ -3245,7 +3245,7 @@ end function PointTip(mouseX) if mouseX >= widgetPosX - 28 * widgetScale and mouseX <= widgetPosX - 1 * widgetScale then - tipText = Spring.I18N('ui.playersList.pointClickTooltip') + tipText = I18N('ui.playersList.pointClickTooltip') tipTextTime = osClock() end end @@ -3950,11 +3950,11 @@ function widget:Update(delta) local posY = widgetPosY + widgetHeight - (leaderboardOffset or 0) if IsOnRect(mx, my, widgetPosX, posY, widgetPosX + widgetWidth, posY + (playerOffset*playerScale)) then if teamRanking[myAllyTeamID] then - tipTextTitle = Spring.I18N('ui.playersList.scoreboard') - tipText = Spring.I18N('ui.playersList.scoreboardTooltip') + tipTextTitle = I18N('ui.playersList.scoreboard') + tipText = I18N('ui.playersList.scoreboardTooltip') else - tipTextTitle = Spring.I18N('ui.playersList.leaderboard') - tipText = Spring.I18N('ui.playersList.leaderboardTooltip') + tipTextTitle = I18N('ui.playersList.leaderboard') + tipText = I18N('ui.playersList.leaderboardTooltip') end tipTextTime = osClock() end diff --git a/luaui/Widgets/gui_advplayerslist_mascot.lua b/luaui/Widgets/gui_advplayerslist_mascot.lua index 66c7e49fde8..7f48620cc9b 100644 --- a/luaui/Widgets/gui_advplayerslist_mascot.lua +++ b/luaui/Widgets/gui_advplayerslist_mascot.lua @@ -127,7 +127,7 @@ local xPos = 0 local yPos = 0 local drawSantahat = false -if Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"] then +if Utilities.Gametype.GetCurrentHolidays()["xmas"] then drawSantahat = true end diff --git a/luaui/Widgets/gui_advplayerslist_music_new.lua b/luaui/Widgets/gui_advplayerslist_music_new.lua index c618af8a2a7..b2febdeca36 100644 --- a/luaui/Widgets/gui_advplayerslist_music_new.lua +++ b/luaui/Widgets/gui_advplayerslist_music_new.lua @@ -163,7 +163,7 @@ local function ReloadMusicPlaylists() if newSoundtrackEnabled then -- Raptors -------------------------------------------------------------------------------------------------------------------- - if Spring.Utilities.Gametype.IsRaptors() then + if Utilities.Gametype.IsRaptors() then table.append(eventPeaceTracks, VFS.DirList(musicDirNew..'/events/raptors/peace', allowedExtensions)) table.append(eventWarLowTracks, VFS.DirList(musicDirNew..'/events/raptors/warlow', allowedExtensions)) table.append(eventWarHighTracks, VFS.DirList(musicDirNew..'/events/raptors/warhigh', allowedExtensions)) @@ -183,7 +183,7 @@ local function ReloadMusicPlaylists() table.append(raptorTracks, VFS.DirList(musicDirNew..'/events/raptors/bossfight', allowedExtensions)) -- Scavengers -------------------------------------------------------------------------------------------------------------------- - if Spring.Utilities.Gametype.IsScavengers() then + if Utilities.Gametype.IsScavengers() then table.append(eventPeaceTracks, VFS.DirList(musicDirNew..'/events/scavengers/peace', allowedExtensions)) table.append(eventWarLowTracks, VFS.DirList(musicDirNew..'/events/scavengers/warlow', allowedExtensions)) table.append(eventWarHighTracks, VFS.DirList(musicDirNew..'/events/scavengers/warhigh', allowedExtensions)) @@ -203,14 +203,14 @@ local function ReloadMusicPlaylists() table.append(scavTracks, VFS.DirList(musicDirNew..'/events/scavengers/bossfight', allowedExtensions)) -- April Fools -------------------------------------------------------------------------------------------------------------------- - if (Spring.Utilities.Gametype.GetCurrentHolidays()["aprilfools"] and Spring.GetConfigInt('UseSoundtrackAprilFools', 1) == 1) then + if (Utilities.Gametype.GetCurrentHolidays()["aprilfools"] and Spring.GetConfigInt('UseSoundtrackAprilFools', 1) == 1) then table.append(eventPeaceTracks, VFS.DirList(musicDirNew..'/events/aprilfools/peace', allowedExtensions)) table.append(eventWarLowTracks, VFS.DirList(musicDirNew..'/events/aprilfools/war', allowedExtensions)) table.append(eventWarHighTracks, VFS.DirList(musicDirNew..'/events/aprilfools/war', allowedExtensions)) table.append(eventWarLowTracks, VFS.DirList(musicDirNew..'/events/aprilfools/warlow', allowedExtensions)) table.append(eventWarHighTracks, VFS.DirList(musicDirNew..'/events/aprilfools/warhigh', allowedExtensions)) table.append(interludeTracks, VFS.DirList(musicDirNew..'/events/aprilfools/interludes', allowedExtensions)) - elseif ((not Spring.Utilities.Gametype.GetCurrentHolidays()["aprilfools"]) and Spring.GetConfigInt('UseSoundtrackAprilFoolsPostEvent', 0) == 1) then + elseif ((not Utilities.Gametype.GetCurrentHolidays()["aprilfools"]) and Spring.GetConfigInt('UseSoundtrackAprilFoolsPostEvent', 0) == 1) then table.append(peaceTracksNew, VFS.DirList(musicDirNew..'/events/aprilfools/peace', allowedExtensions)) table.append(warlowTracksNew, VFS.DirList(musicDirNew..'/events/aprilfools/war', allowedExtensions)) table.append(warhighTracksNew, VFS.DirList(musicDirNew..'/events/aprilfools/war', allowedExtensions)) @@ -227,14 +227,14 @@ local function ReloadMusicPlaylists() table.append(bonusTracks, VFS.DirList(musicDirNew..'/events/aprilfools/interludes', allowedExtensions)) -- Halloween -------------------------------------------------------------------------------------------------------------------- - if (Spring.Utilities.Gametype.GetCurrentHolidays()["halloween"] and Spring.GetConfigInt('UseSoundtrackHalloween', 1) == 1) then + if (Utilities.Gametype.GetCurrentHolidays()["halloween"] and Spring.GetConfigInt('UseSoundtrackHalloween', 1) == 1) then table.append(eventPeaceTracks, VFS.DirList(musicDirNew..'/events/halloween/peace', allowedExtensions)) table.append(eventWarLowTracks, VFS.DirList(musicDirNew..'/events/halloween/war', allowedExtensions)) table.append(eventWarHighTracks, VFS.DirList(musicDirNew..'/events/halloween/war', allowedExtensions)) table.append(eventWarLowTracks, VFS.DirList(musicDirNew..'/events/halloween/warlow', allowedExtensions)) table.append(eventWarHighTracks, VFS.DirList(musicDirNew..'/events/halloween/warhigh', allowedExtensions)) table.append(interludeTracks, VFS.DirList(musicDirNew..'/events/halloween/interludes', allowedExtensions)) - elseif ((not Spring.Utilities.Gametype.GetCurrentHolidays()["halloween"]) and Spring.GetConfigInt('UseSoundtrackHalloweenPostEvent', 0) == 1) then + elseif ((not Utilities.Gametype.GetCurrentHolidays()["halloween"]) and Spring.GetConfigInt('UseSoundtrackHalloweenPostEvent', 0) == 1) then table.append(peaceTracksNew, VFS.DirList(musicDirNew..'/events/halloween/peace', allowedExtensions)) table.append(warlowTracksNew, VFS.DirList(musicDirNew..'/events/halloween/war', allowedExtensions)) table.append(warhighTracksNew, VFS.DirList(musicDirNew..'/events/halloween/war', allowedExtensions)) @@ -251,14 +251,14 @@ local function ReloadMusicPlaylists() table.append(bonusTracks, VFS.DirList(musicDirNew..'/events/halloween/interludes', allowedExtensions)) -- Christmas -------------------------------------------------------------------------------------------------------------------- - if (Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"] and Spring.GetConfigInt('UseSoundtrackXmas', 1) == 1) then + if (Utilities.Gametype.GetCurrentHolidays()["xmas"] and Spring.GetConfigInt('UseSoundtrackXmas', 1) == 1) then table.append(eventPeaceTracks, VFS.DirList(musicDirNew..'/events/xmas/peace', allowedExtensions)) table.append(eventWarLowTracks, VFS.DirList(musicDirNew..'/events/xmas/war', allowedExtensions)) table.append(eventWarHighTracks, VFS.DirList(musicDirNew..'/events/xmas/war', allowedExtensions)) table.append(eventWarLowTracks, VFS.DirList(musicDirNew..'/events/xmas/warlow', allowedExtensions)) table.append(eventWarHighTracks, VFS.DirList(musicDirNew..'/events/xmas/warhigh', allowedExtensions)) table.append(interludeTracks, VFS.DirList(musicDirNew..'/events/xmas/interludes', allowedExtensions)) - elseif ((not Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"]) and Spring.GetConfigInt('UseSoundtrackXmasPostEvent', 0) == 1) then + elseif ((not Utilities.Gametype.GetCurrentHolidays()["xmas"]) and Spring.GetConfigInt('UseSoundtrackXmasPostEvent', 0) == 1) then table.append(peaceTracksNew, VFS.DirList(musicDirNew..'/events/xmas/peace', allowedExtensions)) table.append(warlowTracksNew, VFS.DirList(musicDirNew..'/events/xmas/war', allowedExtensions)) table.append(warhighTracksNew, VFS.DirList(musicDirNew..'/events/xmas/war', allowedExtensions)) @@ -855,7 +855,7 @@ function widget:Initialize() sortPlaylist(menuTracksSorted) for k,v in pairs(menuTracksSorted) do if menuTracksSorted[k] and not string.find(menuTracksSorted[k], "/events/") then - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.menu'), processTrackname(v), v} + tracksConfig[#tracksConfig+1] = {I18N('ui.music.menu'), processTrackname(v), v} end end @@ -863,7 +863,7 @@ function widget:Initialize() sortPlaylist(loadingTracksSorted) for k,v in pairs(loadingTracksSorted) do if loadingTracksSorted[k] and not string.find(loadingTracksSorted[k], "/events/") then - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.loading'), processTrackname(v), v} + tracksConfig[#tracksConfig+1] = {I18N('ui.music.loading'), processTrackname(v), v} end end @@ -871,7 +871,7 @@ function widget:Initialize() sortPlaylist(peaceTracksSorted) for k,v in pairs(peaceTracksSorted) do if peaceTracksSorted[k] and not string.find(peaceTracksSorted[k], "/events/") then - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.peace'), processTrackname(v), v} + tracksConfig[#tracksConfig+1] = {I18N('ui.music.peace'), processTrackname(v), v} end end @@ -879,7 +879,7 @@ function widget:Initialize() sortPlaylist(warlowTracksSorted) for k,v in pairs(warlowTracksSorted) do if warlowTracksSorted[k] and not string.find(warlowTracksSorted[k], "/events/") then - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.warlow'), processTrackname(v), v} + tracksConfig[#tracksConfig+1] = {I18N('ui.music.warlow'), processTrackname(v), v} end end @@ -887,7 +887,7 @@ function widget:Initialize() sortPlaylist(warhighTracksSorted) for k,v in pairs(warhighTracksSorted) do if warhighTracksSorted[k] and not string.find(warhighTracksSorted[k], "/events/") then - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.warhigh'), processTrackname(v), v} + tracksConfig[#tracksConfig+1] = {I18N('ui.music.warhigh'), processTrackname(v), v} end end @@ -895,44 +895,44 @@ function widget:Initialize() sortPlaylist(interludeTracksSorted) for k,v in pairs(interludeTracksSorted) do if interludeTracksSorted[k] and not string.find(interludeTracksSorted[k], "/events/") then - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.interludes'), processTrackname(v), v} + tracksConfig[#tracksConfig+1] = {I18N('ui.music.interludes'), processTrackname(v), v} end end local raptorTracksSorted = table.copy(raptorTracks) sortPlaylist(raptorTracksSorted) for k,v in pairs(raptorTracksSorted) do - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.raptors'), processTrackname(v), v} + tracksConfig[#tracksConfig+1] = {I18N('ui.music.raptors'), processTrackname(v), v} end local scavTracksSorted = table.copy(scavTracks) sortPlaylist(scavTracksSorted) for k,v in pairs(scavTracksSorted) do - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.scavengers'), processTrackname(v), v} + tracksConfig[#tracksConfig+1] = {I18N('ui.music.scavengers'), processTrackname(v), v} end local victoryTracksSorted = table.copy(victoryTracks) sortPlaylist(victoryTracksSorted) for k,v in pairs(victoryTracksSorted) do - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.victory'), processTrackname(v), v} + tracksConfig[#tracksConfig+1] = {I18N('ui.music.victory'), processTrackname(v), v} end local defeatTracksSorted = table.copy(defeatTracks) sortPlaylist(defeatTracksSorted) for k,v in pairs(defeatTracksSorted) do - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.defeat'), processTrackname(v), v} + tracksConfig[#tracksConfig+1] = {I18N('ui.music.defeat'), processTrackname(v), v} end local gameoverTracksSorted = table.copy(gameoverTracks) sortPlaylist(gameoverTracksSorted) for k,v in pairs(gameoverTracksSorted) do - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.gameover'), processTrackname(v), v} + tracksConfig[#tracksConfig+1] = {I18N('ui.music.gameover'), processTrackname(v), v} end local bonusTracksSorted = table.copy(bonusTracks) sortPlaylist(bonusTracksSorted) for k,v in pairs(bonusTracksSorted) do - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.bonus'), processTrackname(v), v} + tracksConfig[#tracksConfig+1] = {I18N('ui.music.bonus'), processTrackname(v), v} end return tracksConfig end @@ -1453,13 +1453,13 @@ function widget:GameFrame(n) end end - if Spring.Utilities.Gametype.IsRaptors() then + if Utilities.Gametype.IsRaptors() then if (Spring.GetGameRulesParam("raptorQueenAnger", 0)) > 60 and warMeter < warHighLevel+1 then warMeter = warHighLevel+1 elseif (Spring.GetGameRulesParam("raptorQueenAnger", 0)) > 20 and warMeter < warLowLevel+1 then warMeter = warLowLevel+1 end - elseif Spring.Utilities.Gametype.IsScavengers() then + elseif Utilities.Gametype.IsScavengers() then if (Spring.GetGameRulesParam("scavBossAnger", 0)) > 60 and warMeter < warHighLevel+1 then warMeter = warHighLevel+1 elseif (Spring.GetGameRulesParam("scavBossAnger", 0)) > 20 and warMeter < warLowLevel+1 then diff --git a/luaui/Widgets/gui_advplayerslist_unittotals.lua b/luaui/Widgets/gui_advplayerslist_unittotals.lua index c3a175e7c75..c2ebe2c5997 100644 --- a/luaui/Widgets/gui_advplayerslist_unittotals.lua +++ b/luaui/Widgets/gui_advplayerslist_unittotals.lua @@ -73,7 +73,7 @@ local function drawContent() local textXPadding = 10*widgetScale local maxUnits, currentUnits = Spring.GetTeamMaxUnits(myTeamID) - local text = Spring.I18N('ui.unitTotals.totals', { titleColor = '\255\210\210\210', textColor = '\255\245\245\245', units = currentUnits, maxUnits = maxUnits, totalUnits = totalUnits }) + local text = I18N('ui.unitTotals.totals', { titleColor = '\255\210\210\210', textColor = '\255\245\245\245', units = currentUnits, maxUnits = maxUnits, totalUnits = totalUnits }) if displayFeatureCount then local features = Spring.GetAllFeatures() diff --git a/luaui/Widgets/gui_awards.lua b/luaui/Widgets/gui_awards.lua index 294a6f1d55e..1cda48cec41 100644 --- a/luaui/Widgets/gui_awards.lua +++ b/luaui/Widgets/gui_awards.lua @@ -60,7 +60,7 @@ local function colourNames(teamID) return "" end local nameColourR, nameColourG, nameColourB, nameColourA = Spring.GetTeamColor(teamID) - return Spring.Utilities.Color.ToString(nameColourR, nameColourG, nameColourB) + return Utilities.Color.ToString(nameColourR, nameColourG, nameColourB) end local function round(num, idp) @@ -74,10 +74,10 @@ local function findPlayerName(teamID) if plList[1] then name = plList[1] if #plList > 1 then - name = Spring.I18N('ui.awards.coop', { name = name }) + name = I18N('ui.awards.coop', { name = name }) end else - name = Spring.I18N('ui.awards.unknown') + name = I18N('ui.awards.unknown') end return name @@ -91,7 +91,7 @@ local function createAward(pic, award, note, noteColour, winnersTable, offset) local winnerName, secondName, thirdName --award is: 0 for a normal award, 1 for the cow award, 2 for the no-cow awards - local notAwardedText = Spring.I18N('ui.awards.notAwarded') + local notAwardedText = I18N('ui.awards.notAwarded') winnerName = winnerTeamID >= 0 and findPlayerName(winnerTeamID) or notAwardedText secondName = secondTeamID >= 0 and findPlayerName(secondTeamID) or notAwardedText @@ -117,15 +117,15 @@ local function createAward(pic, award, note, noteColour, winnersTable, offset) else -- others local heightoffset = 0 if winnerTeamID >= 0 then - font:Print(Spring.I18N('ui.awards.resourcesProduced', { playerColor = colourNames(winnerTeamID), player = winnerName, textColor = white, score = mathFloor(winnerScore) }), widgetX + mathFloor(70*widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(10*widgetScale) - heightoffset, 14*widgetScale, "o") + font:Print(I18N('ui.awards.resourcesProduced', { playerColor = colourNames(winnerTeamID), player = winnerName, textColor = white, score = mathFloor(winnerScore) }), widgetX + mathFloor(70*widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(10*widgetScale) - heightoffset, 14*widgetScale, "o") heightoffset = heightoffset + (20 * widgetScale) end if secondTeamID >= 0 then - font:Print(Spring.I18N('ui.awards.damageTaken', { playerColor = colourNames(secondTeamID), player = secondName, textColor = white, score = mathFloor(secondScore) }), widgetX + mathFloor(70*widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(10*widgetScale) - heightoffset, 14*widgetScale, "o") + font:Print(I18N('ui.awards.damageTaken', { playerColor = colourNames(secondTeamID), player = secondName, textColor = white, score = mathFloor(secondScore) }), widgetX + mathFloor(70*widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(10*widgetScale) - heightoffset, 14*widgetScale, "o") heightoffset = heightoffset + (20 * widgetScale) end if thirdTeamID >= 0 then - font:Print(Spring.I18N('ui.awards.sleptLongest', { playerColor = colourNames(thirdTeamID), player = thirdName, textColor = white, score = mathFloor(thirdScore / 60) }), widgetX + mathFloor(70*widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(10*widgetScale) - heightoffset, 14*widgetScale, "o") + font:Print(I18N('ui.awards.sleptLongest', { playerColor = colourNames(thirdTeamID), player = thirdName, textColor = white, score = mathFloor(thirdScore / 60) }), widgetX + mathFloor(70*widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(10*widgetScale) - heightoffset, 14*widgetScale, "o") end end @@ -142,7 +142,7 @@ local function createAward(pic, award, note, noteColour, winnersTable, offset) else font:Print('-', widgetX + widgetWidthScaled / 2 + mathFloor(275*widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(5*widgetScale), 17*widgetScale, "o") end - font:Print("\255\120\120\120"..Spring.I18N('ui.awards.runnersUp'), widgetX + mathFloor(512*widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(5*widgetScale), 14*widgetScale, "o") + font:Print("\255\120\120\120"..I18N('ui.awards.runnersUp'), widgetX + mathFloor(512*widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(5*widgetScale), 14*widgetScale, "o") if secondScore > 0 then if pic == 'comwreath' then @@ -193,11 +193,11 @@ local function createBackground() gl.Color(1, 1, 1, 1) titleFont:Begin() - titleFont:Print("\255\254\184\64" .. Spring.I18N('ui.awards.awards'), widgetX + widgetWidthScaled / 2, widgetY + widgetHeightScaled - mathFloor(75*widgetScale), 72 * widgetScale, "c") + titleFont:Print("\255\254\184\64" .. I18N('ui.awards.awards'), widgetX + widgetWidthScaled / 2, widgetY + widgetHeightScaled - mathFloor(75*widgetScale), 72 * widgetScale, "c") titleFont:End() font:Begin() - font:Print(Spring.I18N('ui.awards.score'), widgetX + widgetWidthScaled / 2 + mathFloor(275*widgetScale), widgetY + widgetHeightScaled - mathFloor(65*widgetScale), 15*widgetScale, "o") + font:Print(I18N('ui.awards.score'), widgetX + widgetWidthScaled / 2 + mathFloor(275*widgetScale), widgetY + widgetHeightScaled - mathFloor(65*widgetScale), 15*widgetScale, "o") font:End() end) end @@ -252,24 +252,24 @@ local function ProcessAwards(awards) local offset = 120 if awards.ecoKill[1].teamID >= 0 then - FirstAward = createAward('fuscup', 0, Spring.I18N('ui.awards.resourcesDestroyed'), white, awards.ecoKill, offset) + FirstAward = createAward('fuscup', 0, I18N('ui.awards.resourcesDestroyed'), white, awards.ecoKill, offset) offset = offset + offsetAdd end if awards.fightKill[1].teamID >= 0 then - SecondAward = createAward('bullcup', 0, Spring.I18N('ui.awards.enemiesDestroyed'), white, awards.fightKill, offset) + SecondAward = createAward('bullcup', 0, I18N('ui.awards.enemiesDestroyed'), white, awards.fightKill, offset) offset = offset + offsetAdd end if awards.efficiency[1].teamID >= 0 then - ThirdAward = createAward('comwreath', 0, Spring.I18N('ui.awards.resourcesEfficiency'), white, awards.efficiency, offset) + ThirdAward = createAward('comwreath', 0, I18N('ui.awards.resourcesEfficiency'), white, awards.efficiency, offset) offset = offset + offsetAdd end if traitorWinner.score > threshold then - FourthAward = createAward('traitor', 0, Spring.I18N('ui.awards.traitor'), white, awards.traitor, offset) + FourthAward = createAward('traitor', 0, I18N('ui.awards.traitor'), white, awards.traitor, offset) offset = offset + offsetAdd end if cowAwardWinner ~= -1 then - CowAward = createAward('cow', 1, Spring.I18N('ui.awards.didEverything'), white, awards.goldenCow, offset) + CowAward = createAward('cow', 1, I18N('ui.awards.didEverything'), white, awards.goldenCow, offset) offset = offset + offsetAdd end -- make sure the other awards lines are at the bottom @@ -293,7 +293,7 @@ function widget:MousePress(x, y, button) -- Leave button if (x > widgetX + widgetWidthScaled - quitRightX - mathFloor(5*widgetScale) - and (x < widgetX + widgetWidthScaled - quitRightX + mathFloor(20*widgetScale) * font:GetTextWidth(Spring.I18N('ui.awards.leave')) + mathFloor(5*widgetScale)) + and (x < widgetX + widgetWidthScaled - quitRightX + mathFloor(20*widgetScale) * font:GetTextWidth(I18N('ui.awards.leave')) + mathFloor(5*widgetScale)) and (y > widgetY + mathFloor((50 - 5)*widgetScale)) and (y < widgetY + mathFloor((50 + 17 + 5)*widgetScale))) then if chobbyLoaded then @@ -305,7 +305,7 @@ function widget:MousePress(x, y, button) -- Show Graphs button if (x > widgetX + widgetWidthScaled - graphsRightX - mathFloor(5*widgetScale)) - and (x < widgetX + widgetWidthScaled - graphsRightX + mathFloor(20*widgetScale) * font:GetTextWidth(Spring.I18N('ui.awards.showGraphs')) + mathFloor(5*widgetScale)) + and (x < widgetX + widgetWidthScaled - graphsRightX + mathFloor(20*widgetScale) * font:GetTextWidth(I18N('ui.awards.showGraphs')) + mathFloor(5*widgetScale)) and (y > widgetY + mathFloor((50 - 5)*widgetScale) and (y < widgetY + mathFloor((50 + 17 + 5)*widgetScale))) then Spring.SendCommands('endgraph 2') @@ -364,25 +364,25 @@ function widget:DrawScreen() -- Leave button if (x > widgetX + widgetWidthScaled - quitRightX - mathFloor(5*widgetScale)) - and (x < widgetX + widgetWidthScaled - quitRightX + mathFloor(20*widgetScale) * font2:GetTextWidth(Spring.I18N('ui.awards.leave')) + mathFloor(5*widgetScale)) + and (x < widgetX + widgetWidthScaled - quitRightX + mathFloor(20*widgetScale) * font2:GetTextWidth(I18N('ui.awards.leave')) + mathFloor(5*widgetScale)) and (y > widgetY + mathFloor((50 - 5)*widgetScale)) and (y < widgetY + mathFloor((50 + 17 + 5)*widgetScale)) then quitColour = "\255" .. string.char(201) .. string.char(51) .. string.char(51) else quitColour = "\255" .. string.char(201) .. string.char(201) .. string.char(201) end - font2:Print(quitColour .. Spring.I18N('ui.awards.leave'), widgetX + widgetWidthScaled - quitRightX, widgetY + mathFloor(50*widgetScale), 20*widgetScale, "o") + font2:Print(quitColour .. I18N('ui.awards.leave'), widgetX + widgetWidthScaled - quitRightX, widgetY + mathFloor(50*widgetScale), 20*widgetScale, "o") -- Show Graphs button if (x > widgetX + widgetWidthScaled - graphsRightX - (5*widgetScale)) - and (x < widgetX + widgetWidthScaled - graphsRightX + mathFloor(20*widgetScale) * font2:GetTextWidth(Spring.I18N('ui.awards.showGraphs')) + mathFloor(5*widgetScale)) + and (x < widgetX + widgetWidthScaled - graphsRightX + mathFloor(20*widgetScale) * font2:GetTextWidth(I18N('ui.awards.showGraphs')) + mathFloor(5*widgetScale)) and (y > widgetY + mathFloor((50 - 5)*widgetScale)) and (y < widgetY + mathFloor((50 + 17 + 5))*widgetScale) then graphColour = "\255" .. string.char(201) .. string.char(51) .. string.char(51) else graphColour = "\255" .. string.char(201) .. string.char(201) .. string.char(201) end - font2:Print(graphColour .. Spring.I18N('ui.awards.showGraphs'), widgetX + widgetWidthScaled - graphsRightX, widgetY + mathFloor(50*widgetScale), 20*widgetScale, "o") + font2:Print(graphColour .. I18N('ui.awards.showGraphs'), widgetX + widgetWidthScaled - graphsRightX, widgetY + mathFloor(50*widgetScale), 20*widgetScale, "o") -- Close button if (x > widgetX + widgetWidthScaled - closeRightX - (5*widgetScale)) diff --git a/luaui/Widgets/gui_build_eta.lua b/luaui/Widgets/gui_build_eta.lua index 7cde0bfaad5..0395ea882a0 100644 --- a/luaui/Widgets/gui_build_eta.lua +++ b/luaui/Widgets/gui_build_eta.lua @@ -36,8 +36,8 @@ local etaMaxDist = 750000 -- max dist at which to draw ETA local blinkTime = 20 -- Pre-cache I18N strings to avoid per-unit per-frame lookups -local i18n_buildTime = "\255\255\255\1" .. Spring.I18N('ui.buildEstimate.time') .. "\255\255\255\255 " -local i18n_cancelled = Spring.I18N('ui.buildEstimate.cancelled') .. " " +local i18n_buildTime = "\255\255\255\1" .. I18N('ui.buildEstimate.time') .. "\255\255\255\255 " +local i18n_cancelled = I18N('ui.buildEstimate.cancelled') .. " " local unitHeight = {} for udid, unitDef in pairs(UnitDefs) do @@ -85,8 +85,8 @@ function widget:Initialize() end function widget:LanguageChanged() - i18n_buildTime = "\255\255\255\1" .. Spring.I18N('ui.buildEstimate.time') .. "\255\255\255\255 " - i18n_cancelled = Spring.I18N('ui.buildEstimate.cancelled') .. " " + i18n_buildTime = "\255\255\255\1" .. I18N('ui.buildEstimate.time') .. "\255\255\255\255 " + i18n_cancelled = I18N('ui.buildEstimate.cancelled') .. " " end function widget:Update(dt) diff --git a/luaui/Widgets/gui_buildmenu.lua b/luaui/Widgets/gui_buildmenu.lua index 58d8f4c0551..65af2500e04 100644 --- a/luaui/Widgets/gui_buildmenu.lua +++ b/luaui/Widgets/gui_buildmenu.lua @@ -1018,13 +1018,13 @@ function widget:DrawScreen() local text local textColor = "\255\215\255\215" if units.unitRestricted[uDefID] then - text = Spring.I18N('ui.buildMenu.disabled', { unit = unitTranslatedHumanName[uDefID], textColor = textColor, warnColor = "\255\166\166\166" }) + text = I18N('ui.buildMenu.disabled', { unit = unitTranslatedHumanName[uDefID], textColor = textColor, warnColor = "\255\166\166\166" }) else text = UnitDefs[uDefID].translatedHumanName end local tooltip = unitTranslatedTooltip[uDefID] if unitMetal_extractor[uDefID] then - tooltip = tooltip .. "\n" .. Spring.I18N("ui.buildMenu.areamex_tooltip") + tooltip = tooltip .. "\n" .. I18N("ui.buildMenu.areamex_tooltip") end WG['tooltip'].ShowTooltip('buildmenu', "\255\240\240\240"..tooltip, nil, nil, text) end @@ -1066,7 +1066,7 @@ function widget:DrawScreen() end if paginatorHovered then if WG['tooltip'] then - local text = "\255\240\240\240" .. (paginatorHovered == 1 and Spring.I18N('ui.buildMenu.previousPage') or Spring.I18N('ui.buildMenu.nextPage')) + local text = "\255\240\240\240" .. (paginatorHovered == 1 and I18N('ui.buildMenu.previousPage') or I18N('ui.buildMenu.nextPage')) WG['tooltip'].ShowTooltip('buildmenu', text) end RectRound(paginatorRects[paginatorHovered][1] + cellPadding, paginatorRects[paginatorHovered][2] + cellPadding, paginatorRects[paginatorHovered][3] - cellPadding, paginatorRects[paginatorHovered][4] - cellPadding, cellSize * 0.03, 2, 2, 2, 2, { 1, 1, 1, 0 }, { 1, 1, 1, (b and 0.35 or 0.15) }) diff --git a/luaui/Widgets/gui_changelog_info.lua b/luaui/Widgets/gui_changelog_info.lua index 3f912049741..1de60cc3ab9 100644 --- a/luaui/Widgets/gui_changelog_info.lua +++ b/luaui/Widgets/gui_changelog_info.lua @@ -253,7 +253,7 @@ function DrawWindow() UiElement(screenX, screenY - screenHeight, screenX + screenWidth, screenY, 0, 1, 1, 1, 1,1,1,1, WG.FlowUI.clampedOpacity) -- title background - local title = Spring.I18N('ui.changelog.title') + local title = I18N('ui.changelog.title') local titleFontSize = 18 * widgetScale titleRect = { screenX, screenY, mathFloor(screenX + (font2:GetTextWidth(title) * titleFontSize) + (titleFontSize*1.5)), mathFloor(screenY + (titleFontSize*1.7)) } diff --git a/luaui/Widgets/gui_chat.lua b/luaui/Widgets/gui_chat.lua index f00b0706c85..8e4879530a1 100644 --- a/luaui/Widgets/gui_chat.lua +++ b/luaui/Widgets/gui_chat.lua @@ -39,7 +39,7 @@ local utf8 = VFS.Include('common/luaUtilities/utf8.lua') local badWords = VFS.Include('luaui/configs/badwords.lua') local L_DEPRECATED = LOG.DEPRECATED -local isDevSingle = (Spring.Utilities.IsDevMode() and Spring.Utilities.Gametype.IsSinglePlayer()) +local isDevSingle = (Utilities.IsDevMode() and Utilities.Gametype.IsSinglePlayer()) -- Configuration consolidated into table to reduce local variable count local vsx, vsy = gl.GetViewSizes() @@ -58,15 +58,15 @@ local config = { maxLinesScrollChatInput = 9, lineHeightMult = 1.36, lineTTL = 40, - consoleLineCleanupTarget = Spring.Utilities.IsDevMode() and 1200 or 400, - orgLineCleanupTarget = Spring.Utilities.IsDevMode() and 1400 or 600, + consoleLineCleanupTarget = Utilities.IsDevMode() and 1200 or 400, + orgLineCleanupTarget = Utilities.IsDevMode() and 1400 or 600, backgroundOpacity = 0.25, handleTextInput = true, maxTextInputChars = 127, inputButton = true, allowMultiAutocomplete = true, allowMultiAutocompleteMax = 10, - soundErrorsLimit = Spring.Utilities.IsDevMode() and 999 or 10, + soundErrorsLimit = Utilities.IsDevMode() and 999 or 10, ui_scale = Spring.GetConfigFloat("ui_scale", 1), ui_opacity = Spring.GetConfigFloat("ui_opacity", 0.7), widgetScale = 1, @@ -208,7 +208,7 @@ local string_lines, schar, slen, ssub, sfind = string.lines, string.char, string local math_isInRect, floor, clock = math.isInRect, mathFloor, os.clock local spGetTeamColor, spGetPlayerInfo, spPlaySoundFile = Spring.GetTeamColor, Spring.GetPlayerInfo, Spring.PlaySoundFile local spGetGameFrame, spGetTeamInfo = Spring.GetGameFrame, Spring.GetTeamInfo -local ColorString, ColorIsDark = Spring.Utilities and Spring.Utilities.Color and Spring.Utilities.Color.ToString, Spring.Utilities and Spring.Utilities.Color and Spring.Utilities.Color.ColorIsDark +local ColorString, ColorIsDark = Utilities and Utilities.Color and Utilities.Color.ToString, Utilities and Utilities.Color and Utilities.Color.ColorIsDark local soundErrors = {} local teamColorKeys = {} @@ -527,15 +527,15 @@ end function widget:LanguageChanged() I18N = { - energy = Spring.I18N('ui.topbar.resources.energy'):lower(), - metal = Spring.I18N('ui.topbar.resources.metal'):lower(), - everyone = Spring.I18N('ui.chat.everyone'), - allies = Spring.I18N('ui.chat.allies'), - spectators = Spring.I18N('ui.chat.spectators'), - cmd = Spring.I18N('ui.chat.cmd'), - shortcut = Spring.I18N('ui.chat.shortcut'), - nohistory = Spring.I18N('ui.chat.nohistory'), - scroll = Spring.I18N('ui.chat.scroll', { textColor = "\255\255\255\255", highlightColor = "\255\255\255\001" }), + energy = I18N('ui.topbar.resources.energy'):lower(), + metal = I18N('ui.topbar.resources.metal'):lower(), + everyone = I18N('ui.chat.everyone'), + allies = I18N('ui.chat.allies'), + spectators = I18N('ui.chat.spectators'), + cmd = I18N('ui.chat.cmd'), + shortcut = I18N('ui.chat.shortcut'), + nohistory = I18N('ui.chat.nohistory'), + scroll = I18N('ui.chat.scroll', { textColor = "\255\255\255\255", highlightColor = "\255\255\255\001" }), } refreshUnitDefs() -- Cache color strings after language change (optimization) @@ -560,11 +560,11 @@ local function getAIName(teamID) local niceName = Spring.GetGameRulesParam('ainame_' .. teamID) if niceName then name = niceName - if Spring.Utilities.ShowDevUI() and options.profile then + if Utilities.ShowDevUI() and options.profile then name = name .. " [" .. options.profile .. "]" end end - return Spring.I18N('ui.playersList.aiName', { name = name }) + return I18N('ui.playersList.aiName', { name = name }) end local lastMessage @@ -710,7 +710,7 @@ local function addChatLine(gameFrame, lineType, name, nameText, text, orgLineID, end end end - text = Spring.I18N(params[1], t) + text = I18N(params[1], t) -- Fix a widget crash that could occur with message "> ." if type(text) ~= "string" then text = text_orig end if text:lower():find(I18N.energy, nil, true) then @@ -873,7 +873,7 @@ local function formatSystemMessage(i18nKey, playername, gameFrame, lineColor, ex local params = extraParams or {} params.name = getPlayerColorString(playername, gameFrame) .. playername params.textColor = lineColor - return Spring.I18N(i18nKey, params) + return I18N(i18nKey, params) end local function processAddConsoleLine(gameFrame, line, orgLineID, reprocessID) @@ -984,7 +984,7 @@ local function processAddConsoleLine(gameFrame, line, orgLineID, reprocessID) -- shared 5 Wind Turbine to Player2 if newTeamName and newTeamName ~= '' and shareDesc and shareDesc ~= '' then local displayName = (playernames[newTeamName] and playernames[newTeamName][7]) or newTeamName - text = msgColor .. Spring.I18N('ui.unitShare.shared', { + text = msgColor .. I18N('ui.unitShare.shared', { units = msgHighlightColor .. shareDesc .. msgColor, name = getPlayerColorString(newTeamName, gameFrame) .. displayName }) @@ -1064,16 +1064,16 @@ local function processAddConsoleLine(gameFrame, line, orgLineID, reprocessID) lineColor = msgHighlightColor local startPos, endPos = sfind(line, 'Connection attempt from ', nil, true) local playername = ssub(line, endPos + 1) - local spectator = (playernames[playername] and playernames[playername][2]) and msgColor..' ('..Spring.I18N('ui.chat.spectator')..')' or '' + local spectator = (playernames[playername] and playernames[playername][2]) and msgColor..' ('..I18N('ui.chat.spectator')..')' or '' -- Format message and append spectator suffix if needed local params = { textColor = lineColor, textColor2 = msgColor } params.name = getPlayerColorString(playername, gameFrame) .. playername .. spectator - line = Spring.I18N('ui.chat.connectionattemptfrom', params) + line = I18N('ui.chat.connectionattemptfrom', params) elseif sfind(line,'left the game: normal quit', nil, true) then local isSpec = sfind(line,'Spectator', nil, true) local playername = ssub(line, isSpec and 11 or 8, sfind(line, ' left the game', nil, true)-1) lineColor = isSpec and msgHighlightColor or '\255\255\133\133' - local spectator = isSpec and msgColor..' ('..Spring.I18N('ui.chat.spectator')..')' or '' + local spectator = isSpec and msgColor..' ('..I18N('ui.chat.spectator')..')' or '' line = formatSystemMessage('ui.chat.leftthegamenormal', playername, gameFrame, lineColor, { textColor2 = isSpec and msgColor or lineColor }) if spectator ~= '' then -- Append spectator suffix @@ -1083,7 +1083,7 @@ local function processAddConsoleLine(gameFrame, line, orgLineID, reprocessID) local isSpec = sfind(line,'Spectator', nil, true) local playername = ssub(line, isSpec and 11 or 8, sfind(line, ' left the game', nil, true)-1) lineColor = isSpec and msgHighlightColor or '\255\255\133\133' - local spectator = isSpec and msgColor..' ('..Spring.I18N('ui.chat.spectator')..')' or '' + local spectator = isSpec and msgColor..' ('..I18N('ui.chat.spectator')..')' or '' line = formatSystemMessage('ui.chat.leftthegametimeout', playername, gameFrame, lineColor, { textColor2 = isSpec and msgColor or lineColor }) if spectator ~= '' then -- Append spectator suffix @@ -2154,8 +2154,8 @@ function widget:KeyPress(key) else local badWord = findBadWords(inputText) if badWord ~= nil and inputText ~= lastMessage then - addChatLine(Spring.GetGameFrame(), LineTypes.System, "Moderation", "\255\255\000\000" .. Spring.I18N('ui.chat.moderation.prefix'), - Spring.I18N('ui.chat.moderation.blocked', { badWord = badWord })) + addChatLine(Spring.GetGameFrame(), LineTypes.System, "Moderation", "\255\255\000\000" .. I18N('ui.chat.moderation.prefix'), + I18N('ui.chat.moderation.blocked', { badWord = badWord })) else Spring.SendCommands("say "..inputMode..inputText) end @@ -2682,9 +2682,9 @@ function widget:Initialize() Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! -- Ensure ColorString and ColorIsDark are initialized - if not ColorString and Spring.Utilities and Spring.Utilities.Color then - ColorString = Spring.Utilities.Color.ToString - ColorIsDark = Spring.Utilities.Color.ColorIsDark + if not ColorString and Utilities and Utilities.Color then + ColorString = Utilities.Color.ToString + ColorIsDark = Utilities.Color.ColorIsDark end if WG.ignoredAccounts then diff --git a/luaui/Widgets/gui_clearmapmarks.lua b/luaui/Widgets/gui_clearmapmarks.lua index 3226ded3480..cc882ec50bb 100644 --- a/luaui/Widgets/gui_clearmapmarks.lua +++ b/luaui/Widgets/gui_clearmapmarks.lua @@ -61,7 +61,7 @@ local function createList(size) gl.Texture(false) end) if WG['tooltip'] ~= nil then - WG['tooltip'].AddTooltip('clearmapmarks', {xPos-usedImgSize, yPos, xPos, yPos+usedImgSize}, Spring.I18N('ui.clearMapmarks.tooltipctrl'), nil, Spring.I18N('ui.clearMapmarks.tooltip')) + WG['tooltip'].AddTooltip('clearmapmarks', {xPos-usedImgSize, yPos, xPos, yPos+usedImgSize}, I18N('ui.clearMapmarks.tooltipctrl'), nil, I18N('ui.clearMapmarks.tooltip')) end end diff --git a/luaui/Widgets/gui_com_nametags.lua b/luaui/Widgets/gui_com_nametags.lua index b1bce758a7b..198fc979427 100644 --- a/luaui/Widgets/gui_com_nametags.lua +++ b/luaui/Widgets/gui_com_nametags.lua @@ -87,7 +87,7 @@ local playerRankImages = "luaui\\images\\advplayerslist\\ranks\\" -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -local ColorIsDark = Spring.Utilities.Color.ColorIsDark +local ColorIsDark = Utilities.Color.ColorIsDark local GL_GREATER = GL.GREATER local GL_SRC_ALPHA = GL.SRC_ALPHA @@ -115,7 +115,7 @@ if teamListLen - 1 == allyTeamListLen - 1 then singleTeams = true end -local isSinglePlayer = Spring.Utilities.Gametype.IsSinglePlayer() +local isSinglePlayer = Utilities.Gametype.IsSinglePlayer() local anonymousMode = spGetModOptions().teamcolors_anonymous_mode local anonymousName = '?????' @@ -184,22 +184,22 @@ local function GetCommAttributes(unitID, unitDefID) --name = "Scav Commander" -- todo: i18n this thing local unitDefCustomParams = UnitDefs[unitDefID].customParams if unitDefCustomParams.decoyfor then - name = Spring.I18N('units.scavDecoyCommanderNameTag') + name = I18N('units.scavDecoyCommanderNameTag') else - name = Spring.I18N('units.scavCommanderNameTag') + name = I18N('units.scavCommanderNameTag') end elseif spGetGameRulesParam('ainame_' .. team) then local unitDefCustomParams = UnitDefs[unitDefID].customParams if unitDefCustomParams.decoyfor then - name = Spring.I18N('units.decoyCommanderNameTag') + name = I18N('units.decoyCommanderNameTag') else - name = Spring.I18N('ui.playersList.aiName', { name = spGetGameRulesParam('ainame_' .. team) }) + name = I18N('ui.playersList.aiName', { name = spGetGameRulesParam('ainame_' .. team) }) end else local unitDefCustomParams = UnitDefs[unitDefID].customParams if unitDefCustomParams.decoyfor then - name = Spring.I18N('units.decoyCommanderNameTag') + name = I18N('units.decoyCommanderNameTag') else local players = spGetPlayerList(team) local playersLen = players and #players or 0 @@ -650,9 +650,9 @@ function widget:Initialize() local name = '' local luaAI = spGetTeamLuaAI(teamID) if luaAI and luaAI ~= "" and stringFind(luaAI, 'Scavengers') then - name = Spring.I18N('units.scavCommanderNameTag') + name = I18N('units.scavCommanderNameTag') elseif spGetGameRulesParam('ainame_' .. teamID) then - name = Spring.I18N('ui.playersList.aiName', { name = spGetGameRulesParam('ainame_' .. teamID) }) + name = I18N('ui.playersList.aiName', { name = spGetGameRulesParam('ainame_' .. teamID) }) else local players = spGetPlayerList(teamID) local playersLen = players and #players or 0 diff --git a/luaui/Widgets/gui_converter_usage.lua b/luaui/Widgets/gui_converter_usage.lua index ef664e6f2a4..f916ae78123 100644 --- a/luaui/Widgets/gui_converter_usage.lua +++ b/luaui/Widgets/gui_converter_usage.lua @@ -75,8 +75,8 @@ local function updateUI() local fontSize = (area[4] - area[2]) * 0.4 local color = "\255\255\255\255" - local tooltipTitle = Spring.I18N('ui.topbar.converter_usage.defaultTooltipTitle') - local tooltipText = Spring.I18N('ui.topbar.converter_usage.defaultTooltip') + local tooltipTitle = I18N('ui.topbar.converter_usage.defaultTooltipTitle') + local tooltipText = I18N('ui.topbar.converter_usage.defaultTooltip') if dlistCU ~= nil then glDeleteList(dlistCU) @@ -91,10 +91,10 @@ local function updateUI() --Some coloring and tooltip text if converterUse < 20 then color = "\255\255\000\000" --Red - tooltipText = tooltipText .. "\n\n\255\255\100\075"..Spring.I18N('ui.topbar.converter_usage.tooManyConverters1Tooltip').."\n\255\255\100\075"..Spring.I18N('ui.topbar.converter_usage.tooManyConverters2Tooltip') + tooltipText = tooltipText .. "\n\n\255\255\100\075"..I18N('ui.topbar.converter_usage.tooManyConverters1Tooltip').."\n\255\255\100\075"..I18N('ui.topbar.converter_usage.tooManyConverters2Tooltip') elseif converterUse < 40 then color = "\255\255\100\000" --Orange - tooltipText = tooltipText .. "\n\n\255\255\120\050"..Spring.I18N('ui.topbar.converter_usage.tooManyConverters1Tooltip').."\n\255\255\120\050"..Spring.I18N('ui.topbar.converter_usage.tooManyConverters2Tooltip') + tooltipText = tooltipText .. "\n\n\255\255\120\050"..I18N('ui.topbar.converter_usage.tooManyConverters1Tooltip').."\n\255\255\120\050"..I18N('ui.topbar.converter_usage.tooManyConverters2Tooltip') elseif converterUse < 50 then color = "\255\255\255\000" --Yellow elseif converterUse < 70 then diff --git a/luaui/Widgets/gui_ecostats.lua b/luaui/Widgets/gui_ecostats.lua index 17641ec6a88..0d7e75219d5 100644 --- a/luaui/Widgets/gui_ecostats.lua +++ b/luaui/Widgets/gui_ecostats.lua @@ -163,7 +163,7 @@ local widgetPosX, widgetPosY = xRelPos * vsx, yRelPos * vsy local teamListLen = #spGetTeamList() local allyTeamListLen2 = #spGetAllyTeamList() local singleTeams = (teamListLen - 1 == allyTeamListLen2 - 1) -local enableStartposbuttons = not Spring.Utilities.Gametype.IsFFA() -- spots wont match when ffa +local enableStartposbuttons = not Utilities.Gametype.IsFFA() -- spots wont match when ffa local myFullview = select(2, spGetSpectatingState()) local myTeamID = spGetMyTeamID() local myPlayerID = spGetMyPlayerID() @@ -1008,8 +1008,8 @@ local function DrawBackground(posY, allyID, teamWidth) if WG['tooltip'] ~= nil and (tooltipAreas[key] == nil or tooltipAreas[key] ~= areaKey or refreshCaptions) then refreshCaptions = false if not cachedTooltipText then - cachedTooltipText = Spring.I18N('ui.teamEconomy.tooltip') - cachedTooltipTitle = Spring.I18N('ui.teamEconomy.tooltipTitle') + cachedTooltipText = I18N('ui.teamEconomy.tooltip') + cachedTooltipTitle = I18N('ui.teamEconomy.tooltipTitle') end bgArea[1], bgArea[2], bgArea[3], bgArea[4] = areaX1, y1, widgetPosX + widgetWidth, y2 WG['tooltip'].AddTooltip(key, bgArea, cachedTooltipText, nil, cachedTooltipTitle) diff --git a/luaui/Widgets/gui_factionpicker.lua b/luaui/Widgets/gui_factionpicker.lua index 36524bdf866..ab65f9d2c54 100644 --- a/luaui/Widgets/gui_factionpicker.lua +++ b/luaui/Widgets/gui_factionpicker.lua @@ -99,7 +99,7 @@ local function drawFactionpicker() font2:Begin() font2:SetTextColor(1, 1, 1, 1) font2:SetOutlineColor(0, 0, 0, 0.66) - font2:Print(Spring.I18N('ui.factionPicker.pick'), backgroundRect[1] + contentPadding, backgroundRect[4] - contentPadding - (fontSize * 0.7), fontSize, "o") + font2:Print(I18N('ui.factionPicker.pick'), backgroundRect[1] + contentPadding, backgroundRect[4] - contentPadding - (fontSize * 0.7), fontSize, "o") local contentWidth = mathFloor(backgroundRect[3] - backgroundRect[1] - contentPadding) local contentHeight = mathFloor(backgroundRect[4] - backgroundRect[2] - (contentPadding * 1.33)) @@ -129,15 +129,15 @@ local function drawFactionpicker() '#' .. factions[i].startUnit ) -- faction name - font2:Print((disabled and "\255\170\170\170" or "\255\255\255\255") .. Spring.I18N('units.factions.' .. factions[i].faction), factionRect[i][1] + ((factionRect[i][3] - factionRect[i][1]) * 0.5), factionRect[i][2] + ((factionRect[i][4] - factionRect[i][2]) * 0.22) - (fontSize * 0.5), fontSize * 0.96, "co") + font2:Print((disabled and "\255\170\170\170" or "\255\255\255\255") .. I18N('units.factions.' .. factions[i].faction), factionRect[i][1] + ((factionRect[i][3] - factionRect[i][1]) * 0.5), factionRect[i][2] + ((factionRect[i][4] - factionRect[i][2]) * 0.22) - (fontSize * 0.5), fontSize * 0.96, "co") if WG['tooltip'] ~= nil then - local text = Spring.I18N('ui.factionPicker.factions.'..factions[i].faction) + local text = I18N('ui.factionPicker.factions.'..factions[i].faction) local tooltip = '' local maxWidth = WG['tooltip'].getFontsize() * 80 local textLines, numLines = font2:WrapText(text, maxWidth) tooltip = tooltip..string.gsub(textLines, '[\n]', '\n')..'\n' - WG['tooltip'].AddTooltip('factionpicker_'..i, { factionRect[i][1] + bgpadding, factionRect[i][2] + bgpadding, factionRect[i][3], factionRect[i][4] }, tooltip, nil, Spring.I18N('units.factions.' .. factions[i].faction)) + WG['tooltip'].AddTooltip('factionpicker_'..i, { factionRect[i][1] + bgpadding, factionRect[i][2] + bgpadding, factionRect[i][3], factionRect[i][4] }, tooltip, nil, I18N('units.factions.' .. factions[i].faction)) end end font2:End() @@ -350,7 +350,7 @@ function widget:DrawScreen() RectRound(factionRect[i][1] + bgpadding, factionRect[i][2] + bgpadding, factionRect[i][3], factionRect[i][4], bgpadding, 1, 1, 1, 1, { 0.3, 0.3, 0.3, (b and 0.5 or 0.25) }, { 1, 1, 1, (b and 0.3 or 0.15) }) glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) - font2:Print(Spring.I18N('units.factions.' .. factions[i].faction), factionRect[i][1] + ((factionRect[i][3] - factionRect[i][1]) * 0.5), factionRect[i][2] + ((factionRect[i][4] - factionRect[i][2]) * 0.22) - (fontSize * 0.5), fontSize * 0.96, "co") + font2:Print(I18N('units.factions.' .. factions[i].faction), factionRect[i][1] + ((factionRect[i][3] - factionRect[i][1]) * 0.5), factionRect[i][2] + ((factionRect[i][4] - factionRect[i][2]) * 0.22) - (fontSize * 0.5), fontSize * 0.96, "co") break end end diff --git a/luaui/Widgets/gui_game_type_info.lua b/luaui/Widgets/gui_game_type_info.lua index 6b6db1e9ceb..29536452989 100644 --- a/luaui/Widgets/gui_game_type_info.lua +++ b/luaui/Widgets/gui_game_type_info.lua @@ -92,16 +92,16 @@ function widget:LanguageChanged() key = 'killAllUnits' elseif deathmode == "builders" then key = 'killAllBuilders' - elseif deathmode == "territorial_domination" and not Spring.Utilities.Gametype.IsRaptors() and not Spring.Utilities.Gametype.IsScavengers() then + elseif deathmode == "territorial_domination" and not Utilities.Gametype.IsRaptors() and not Utilities.Gametype.IsScavengers() then key = 'territorialDomination' else key = 'killAllCommanders' end - messages[1].str = "\255\255\255\255" .. Spring.I18N('ui.gametypeInfo.victoryCondition') .. ": " .. Spring.I18N('ui.gametypeInfo.' .. key) + messages[1].str = "\255\255\255\255" .. I18N('ui.gametypeInfo.victoryCondition') .. ": " .. I18N('ui.gametypeInfo.' .. key) if deathmode == "own_com" then - messages[3].str = "\255\255\150\150" .. Spring.I18N('ui.gametypeInfo.owncomends') + messages[3].str = "\255\255\150\150" .. I18N('ui.gametypeInfo.owncomends') end end diff --git a/luaui/Widgets/gui_gameinfo.lua b/luaui/Widgets/gui_gameinfo.lua index cfed5c047a5..a7dacdce0f2 100644 --- a/luaui/Widgets/gui_gameinfo.lua +++ b/luaui/Widgets/gui_gameinfo.lua @@ -31,7 +31,7 @@ local font, font2, loadedFontSize, mainDList, titleRect, backgroundGuishader, sh local maxLines = 22 local math_isInRect = math.isInRect -local raptorsEnabled = Spring.Utilities.Gametype.IsRaptors() +local raptorsEnabled = Utilities.Gametype.IsRaptors() local content = '' @@ -60,7 +60,7 @@ for key, value in pairs(defaultModoptions) do modoptionsDefault[value.key] = {name = value.name, desc = value.desc, def = value.def} end -local modoptions = Spring.GetModOptionsCopy() +local modoptions = GetModOptionsCopy() local changedModoptions = {} local unchangedModoptions = {} local changedRaptorModoptions = {} @@ -112,11 +112,11 @@ for key, value in pairs(modoptions) do else if string.find(key, 'tweakdefs') then local decodeSuccess, postsFuncStr = pcall(string.base64Decode, value) - changedModoptions[key] = '\n' .. (decodeSuccess and postsFuncStr or '\255\255\100\100 - '..Spring.I18N('ui.gameInfo.decodefailed').. ' - ') + changedModoptions[key] = '\n' .. (decodeSuccess and postsFuncStr or '\255\255\100\100 - '..I18N('ui.gameInfo.decodefailed').. ' - ') else local dataRaw = string.gsub(value, '_', '=') local decodeSuccess, postsFuncStr = pcall(string.base64Decode, dataRaw) - local success, tweaks = pcall(Spring.Utilities.SafeLuaTableParser, postsFuncStr) + local success, tweaks = pcall(Utilities.SafeLuaTableParser, postsFuncStr) if success and type(tweaks) == "table" then local text = '' @@ -301,7 +301,7 @@ end function DrawWindow() -- title local titleFontSize = 18 * widgetScale - titleRect = { screenX, screenY, mathFloor(screenX + (font2:GetTextWidth(Spring.I18N('ui.gameInfo.title')) * titleFontSize) + (titleFontSize*1.5)), mathFloor(screenY + (titleFontSize*1.7)) } + titleRect = { screenX, screenY, mathFloor(screenX + (font2:GetTextWidth(I18N('ui.gameInfo.title')) * titleFontSize) + (titleFontSize*1.5)), mathFloor(screenY + (titleFontSize*1.7)) } UiElement(screenX, screenY - screenHeight, screenX + screenWidth, screenY, 0, 1, 1, 1, 1,1,1,1, WG.FlowUI.clampedOpacity) gl.Color(0, 0, 0, WG.FlowUI.clampedOpacity) @@ -310,7 +310,7 @@ function DrawWindow() font2:Begin() font2:SetTextColor(1, 1, 1, 1) font2:SetOutlineColor(0, 0, 0, 0.4) - font2:Print(Spring.I18N('ui.gameInfo.title'), screenX + (titleFontSize * 0.75), screenY + (8*widgetScale), titleFontSize, "on") + font2:Print(I18N('ui.gameInfo.title'), screenX + (titleFontSize * 0.75), screenY + (8*widgetScale), titleFontSize, "on") font2:End() -- textarea @@ -418,23 +418,23 @@ end local function refreshContent() content = '' content = content .. titlecolor .. Game.gameName .. valuegreycolor .. " (" .. Game.gameMutator .. ") " .. titlecolor .. Game.gameVersion .. "\n" - content = content .. keycolor .. Spring.I18N('ui.gameInfo.engine') .. separator .. valuegreycolor .. ((Game and Game.version) or (Engine and Engine.version) or Spring.I18N('ui.gameInfo.engineVersionError')) .. "\n" + content = content .. keycolor .. I18N('ui.gameInfo.engine') .. separator .. valuegreycolor .. ((Game and Game.version) or (Engine and Engine.version) or I18N('ui.gameInfo.engineVersionError')) .. "\n" content = content .. "\n" -- map info content = content .. titlecolor .. Game.mapName .. "\n" content = content .. valuegreycolor .. Game.mapDescription .. "\n" - content = content .. keycolor .. Spring.I18N('ui.gameInfo.size') .. separator .. valuegreycolor .. Game.mapX .. valuegreycolor .. " x " .. valuegreycolor .. Game.mapY .. "\n" - content = content .. keycolor .. Spring.I18N('ui.gameInfo.gravity') .. separator .. valuegreycolor .. Game.gravity .. "\n" - content = content .. keycolor .. Spring.I18N('ui.gameInfo.hardness') .. separator .. valuegreycolor .. Game.mapHardness .. keycolor .. "\n" - content = content .. keycolor .. Spring.I18N('ui.gameInfo.tidalStrength') .. separator .. valuegreycolor .. tidal .. keycolor .. "\n" - content = content .. keycolor .. Spring.I18N('ui.gameInfo.reclaimableMetal') .. separator .. valuegreycolor .. reclaimable_metal .. keycolor .. "\n" - content = content .. keycolor .. Spring.I18N('ui.gameInfo.reclaimableEnergy') .. separator .. valuegreycolor .. reclaimable_energy .. keycolor .. "\n" + content = content .. keycolor .. I18N('ui.gameInfo.size') .. separator .. valuegreycolor .. Game.mapX .. valuegreycolor .. " x " .. valuegreycolor .. Game.mapY .. "\n" + content = content .. keycolor .. I18N('ui.gameInfo.gravity') .. separator .. valuegreycolor .. Game.gravity .. "\n" + content = content .. keycolor .. I18N('ui.gameInfo.hardness') .. separator .. valuegreycolor .. Game.mapHardness .. keycolor .. "\n" + content = content .. keycolor .. I18N('ui.gameInfo.tidalStrength') .. separator .. valuegreycolor .. tidal .. keycolor .. "\n" + content = content .. keycolor .. I18N('ui.gameInfo.reclaimableMetal') .. separator .. valuegreycolor .. reclaimable_metal .. keycolor .. "\n" + content = content .. keycolor .. I18N('ui.gameInfo.reclaimableEnergy') .. separator .. valuegreycolor .. reclaimable_energy .. keycolor .. "\n" if Game.windMin == Game.windMax then - content = content .. keycolor .. Spring.I18N('ui.gameInfo.windStrength') .. separator .. valuegreycolor .. Game.windMin .. valuegreycolor .. "\n" + content = content .. keycolor .. I18N('ui.gameInfo.windStrength') .. separator .. valuegreycolor .. Game.windMin .. valuegreycolor .. "\n" else - content = content .. keycolor .. Spring.I18N('ui.gameInfo.windStrength') .. separator .. valuegreycolor .. Game.windMin .. valuegreycolor .. " - " .. valuegreycolor .. Game.windMax .. "\n" + content = content .. keycolor .. I18N('ui.gameInfo.windStrength') .. separator .. valuegreycolor .. Game.windMin .. valuegreycolor .. " - " .. valuegreycolor .. Game.windMax .. "\n" end local vcolor if Game.waterDamage == 0 then @@ -442,11 +442,11 @@ local function refreshContent() else vcolor = valuecolor end - content = content .. keycolor .. Spring.I18N('ui.gameInfo.waterDamage') .. separator .. vcolor .. Game.waterDamage .. keycolor .. "\n" + content = content .. keycolor .. I18N('ui.gameInfo.waterDamage') .. separator .. vcolor .. Game.waterDamage .. keycolor .. "\n" content = content .. "\n" if raptorsEnabled then -- filter raptor modoptions - content = content .. titlecolor .. Spring.I18N('ui.gameInfo.raptorOptions') .. "\n" + content = content .. titlecolor .. I18N('ui.gameInfo.raptorOptions') .. "\n" for key, params in pairs(changedRaptorModoptions) do content = content .. keycolor .. string.sub(params.key, 9) .. separator .. valuecolor .. params.value .. "\n" end @@ -455,7 +455,7 @@ local function refreshContent() end content = content .. "\n" end - content = content .. titlecolor .. Spring.I18N('ui.gameInfo.modOptions') .. "\n" + content = content .. titlecolor .. I18N('ui.gameInfo.modOptions') .. "\n" for key, params in pairs(changedModoptions) do local name = params.key --modoptionsDefault[params.key].name content = content .. keycolor .. name .. separator .. valuecolor .. params.value .. "\n" diff --git a/luaui/Widgets/gui_gridmenu.lua b/luaui/Widgets/gui_gridmenu.lua index db3f7d52a82..7ca9c5c58bd 100644 --- a/luaui/Widgets/gui_gridmenu.lua +++ b/luaui/Widgets/gui_gridmenu.lua @@ -56,15 +56,15 @@ local CMD_OPT_RIGHT = CMD.OPT_RIGHT --- STATIC VALUES ------------------------------------------------------------------------------- -local BUILDCAT_ECONOMY = Spring.I18N("ui.buildMenu.category_econ") -local BUILDCAT_COMBAT = Spring.I18N("ui.buildMenu.category_combat") -local BUILDCAT_UTILITY = Spring.I18N("ui.buildMenu.category_utility") -local BUILDCAT_PRODUCTION = Spring.I18N("ui.buildMenu.category_production") +local BUILDCAT_ECONOMY = I18N("ui.buildMenu.category_econ") +local BUILDCAT_COMBAT = I18N("ui.buildMenu.category_combat") +local BUILDCAT_UTILITY = I18N("ui.buildMenu.category_utility") +local BUILDCAT_PRODUCTION = I18N("ui.buildMenu.category_production") local categoryTooltips = { - [BUILDCAT_ECONOMY] = Spring.I18N("ui.buildMenu.category_econ_descr"), - [BUILDCAT_COMBAT] = Spring.I18N("ui.buildMenu.category_combat_descr"), - [BUILDCAT_UTILITY] = Spring.I18N("ui.buildMenu.category_utility_descr"), - [BUILDCAT_PRODUCTION] = Spring.I18N("ui.buildMenu.category_production_descr"), + [BUILDCAT_ECONOMY] = I18N("ui.buildMenu.category_econ_descr"), + [BUILDCAT_COMBAT] = I18N("ui.buildMenu.category_combat_descr"), + [BUILDCAT_UTILITY] = I18N("ui.buildMenu.category_utility_descr"), + [BUILDCAT_PRODUCTION] = I18N("ui.buildMenu.category_production_descr"), } local folder = "LuaUI/Images/groupicons/" @@ -408,7 +408,7 @@ local function updateHoverState() -- builder buttons if nextBuilderRect:contains(x, y) then - setHoveredRectTooltip(nextBuilderRect, "\255\240\240\240" .. Spring.I18N("ui.buildMenu.nextBuilder")) + setHoveredRectTooltip(nextBuilderRect, "\255\240\240\240" .. I18N("ui.buildMenu.nextBuilder")) return end @@ -462,7 +462,7 @@ local function updateHoverState() local text local textColor = "\255\215\255\215" if cellRect.opts.disabled then - text = Spring.I18N("ui.buildMenu.disabled", { + text = I18N("ui.buildMenu.disabled", { unit = unitTranslatedHumanName[uDefID], textColor = textColor, warnColor = "\255\166\166\166", @@ -472,7 +472,7 @@ local function updateHoverState() end local tooltip = unitTranslatedTooltip[uDefID] if unitMetal_extractor[uDefID] then - tooltip = tooltip .. "\n" .. Spring.I18N("ui.buildMenu.areamex_tooltip") + tooltip = tooltip .. "\n" .. I18N("ui.buildMenu.areamex_tooltip") end setHoveredRectTooltip(cellRect, "\255\240\240\240" .. tooltip, text, left or right) @@ -500,7 +500,7 @@ local function updateHoverState() -- build mode button if builderIsFactory and (useLabBuildMode and not labBuildModeActive) and labBuildModeRect:contains(x, y) then - setHoveredRectTooltip(labBuildModeRect, "\255\240\240\240" .. Spring.I18N("ui.buildMenu.buildmode_descr")) + setHoveredRectTooltip(labBuildModeRect, "\255\240\240\240" .. I18N("ui.buildMenu.buildmode_descr")) return end @@ -508,7 +508,7 @@ local function updateHoverState() if currentCategory or labBuildModeActive then -- back button if backRect and backRect:contains(x, y) then - setHoveredRectTooltip(backRect, "\255\240\240\240" .. Spring.I18N("ui.buildMenu.homePage")) + setHoveredRectTooltip(backRect, "\255\240\240\240" .. I18N("ui.buildMenu.homePage")) return end @@ -516,7 +516,7 @@ local function updateHoverState() -- paginator buttons if pages > 1 and nextPageRect and nextPageRect:contains(x, y) then - setHoveredRectTooltip(nextPageRect, "\255\240\240\240" .. Spring.I18N("ui.buildMenu.nextPage")) + setHoveredRectTooltip(nextPageRect, "\255\240\240\240" .. I18N("ui.buildMenu.nextPage")) return end diff --git a/luaui/Widgets/gui_ground_ao_plates_gl4.lua b/luaui/Widgets/gui_ground_ao_plates_gl4.lua index 454c65bd8d9..f40be6e9209 100644 --- a/luaui/Widgets/gui_ground_ao_plates_gl4.lua +++ b/luaui/Widgets/gui_ground_ao_plates_gl4.lua @@ -163,7 +163,7 @@ function widget:VisibleUnitsChanged(extVisibleUnits, extNumVisibleUnits) end function widget:VisibleUnitRemoved(unitID) -- remove the corresponding ground plate if it exists - if debugmode then Spring.Debug.TraceEcho("remove",unitID,reason) end + if debugmode then Debug.TraceEcho("remove",unitID,reason) end if groundPlateVBO.instanceIDtoIndex[unitID] then popElementInstance(groundPlateVBO, unitID) end diff --git a/luaui/Widgets/gui_healthbars_gl4.lua b/luaui/Widgets/gui_healthbars_gl4.lua index 357678dc832..421b0f5f1a2 100644 --- a/luaui/Widgets/gui_healthbars_gl4.lua +++ b/luaui/Widgets/gui_healthbars_gl4.lua @@ -577,7 +577,7 @@ end local function addBarForUnit(unitID, unitDefID, barname, reason) --Spring.Debug.TraceFullEcho() - if debugmode then Spring.Debug.TraceEcho(unitBars[unitID]) end + if debugmode then Debug.TraceEcho(unitBars[unitID]) end --spEcho("Caller1:", tostring()".name), "caller2:", tostring(debug.getinfo(3).name)) unitDefID = unitDefID or spGetUnitDefID(unitID) @@ -598,7 +598,7 @@ local function addBarForUnit(unitID, unitDefID, barname, reason) if unitDefID == nil or Spring.ValidUnitID(unitID) == false or Spring.GetUnitIsDead(unitID) == true then -- dead or invalid if debugmode then - Spring.Debug.TraceEcho("Tried to add a bar to dead/invalid/nounitdef unit", unitID, unitdefID, barname) + Debug.TraceEcho("Tried to add a bar to dead/invalid/nounitdef unit", unitID, unitdefID, barname) end return nil end @@ -606,7 +606,7 @@ local function addBarForUnit(unitID, unitDefID, barname, reason) if unitBars[unitID] == nil then if debugmode then spEcho("A unit has no bars yet", UnitDefs[unitDefID].name, spGetUnitPosition(unitID)) - Spring.Debug.TraceFullEcho() + Debug.TraceFullEcho() Spring.SendCommands({"pause 1"}) spEcho("No bars unit, last seen at", unitID) Spring.MarkerAddPoint(spGetUnitPosition(unitID) ) @@ -661,7 +661,7 @@ end local function removeBarFromUnit(unitID, barname, reason) -- this will bite me in the ass later, im sure, yes it did, we need to just update them :P local instanceKey = unitID .. "_" .. barname if healthBarVBO.instanceIDtoIndex[instanceKey] then - if debugmode then Spring.Debug.TraceEcho(reason) end + if debugmode then Debug.TraceEcho(reason) end unitBars[unitID] = unitBars[unitID] - 1 popElementInstance(healthBarVBO, instanceKey) end @@ -767,7 +767,7 @@ end local function addBarToFeature(featureID, barname) - if debugmode then Spring.Debug.TraceEcho() end + if debugmode then Debug.TraceEcho() end local featureDefID = Spring.GetFeatureDefID(featureID) local bt = barTypeMap[barname] @@ -1185,7 +1185,7 @@ function widget:GameFrame(n) if stockpileBuild and stockpileBuild ~= stockpilebuild then -- we somehow need to forward 3 vars, all 3 of the above. packed into a float, this is nasty --spEcho("Stockpiling", numStockpiled, numStockpileQued, stockpileBuild) - if numStockpiled == nil then Spring.Debug.TraceFullEcho(nil,nil,nil, 'nostockpile', unitID, spGetUnitPosition(unitID)) end + if numStockpiled == nil then Debug.TraceFullEcho(nil,nil,nil, 'nostockpile', unitID, spGetUnitPosition(unitID)) end uniformcache[1] = numStockpiled + stockpileBuild -- less hacky --uniformcache[1] = 128*numStockpileQued + numStockpiled + stockpileBuild -- the worlds nastiest hack diff --git a/luaui/Widgets/gui_idle_builders.lua b/luaui/Widgets/gui_idle_builders.lua index b24a6deb83b..6306c3ef546 100644 --- a/luaui/Widgets/gui_idle_builders.lua +++ b/luaui/Widgets/gui_idle_builders.lua @@ -188,12 +188,12 @@ local function drawContent() font2:SetOutlineColor(0, 0, 0, 0.2) font2:SetTextColor(0.45, 0.45, 0.45, 1) offset = (fontSize*0.6) - font2:Print(Spring.I18N('ui.idleBuilders.sleeping'), iconRect[1]+((iconRect[3]-iconRect[1])/2)-offset, iconRect[2]+((iconRect[4]-iconRect[2])/2)+offset+offsetY, fontSize, style) + font2:Print(I18N('ui.idleBuilders.sleeping'), iconRect[1]+((iconRect[3]-iconRect[1])/2)-offset, iconRect[2]+((iconRect[4]-iconRect[2])/2)+offset+offsetY, fontSize, style) fontSize = fontSize * 1.2 - font2:Print(Spring.I18N('ui.idleBuilders.sleeping'), iconRect[1]+((iconRect[3]-iconRect[1])/2), iconRect[2]+((iconRect[4]-iconRect[2])/2)+offsetY, fontSize, style) + font2:Print(I18N('ui.idleBuilders.sleeping'), iconRect[1]+((iconRect[3]-iconRect[1])/2), iconRect[2]+((iconRect[4]-iconRect[2])/2)+offsetY, fontSize, style) fontSize = fontSize * 1.2 offset = (fontSize*0.48) - font2:Print(Spring.I18N('ui.idleBuilders.sleeping'), iconRect[1]+((iconRect[3]-iconRect[1])/2)+offset, iconRect[2]+((iconRect[4]-iconRect[2])/2)-offset+offsetY, fontSize, style) + font2:Print(I18N('ui.idleBuilders.sleeping'), iconRect[1]+((iconRect[3]-iconRect[1])/2)+offset, iconRect[2]+((iconRect[4]-iconRect[2])/2)-offset+offsetY, fontSize, style) font2:End() end @@ -609,18 +609,18 @@ local function Update() if backgroundRect and math_isInRect(x, y, backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4]) then hovered = true - local tooltipTitle = Spring.I18N('ui.idleBuilders.name') + local tooltipTitle = I18N('ui.idleBuilders.name') local tooltipAddition = '' if backgroundRect and math_isInRect(x, y, backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4]) then for i,v in pairs(iconButtons) do if math_isInRect(x, y, iconButtons[i][1], iconButtons[i][2], iconButtons[i][3], iconButtons[i][4]) then local unitDefID = existingIcons[i] if unitDefID then - tooltipTitle = Spring.I18N('ui.idleBuilders.idle', { unit = unitHumanName[unitDefID], highlightColor = "\255\190\255\190" }) + tooltipTitle = I18N('ui.idleBuilders.idle', { unit = unitHumanName[unitDefID], highlightColor = "\255\190\255\190" }) if #idleList[unitDefID] > 1 then - tooltipAddition = Spring.I18N('ui.idleBuilders.controls').. '\n'..Spring.I18N('ui.idleBuilders.controls1') + tooltipAddition = I18N('ui.idleBuilders.controls').. '\n'..I18N('ui.idleBuilders.controls1') else - tooltipAddition = tooltipAddition ..Spring.I18N('ui.idleBuilders.controls1') + tooltipAddition = tooltipAddition ..I18N('ui.idleBuilders.controls1') end end break diff --git a/luaui/Widgets/gui_info.lua b/luaui/Widgets/gui_info.lua index 6780e29054d..50cb0f19aba 100644 --- a/luaui/Widgets/gui_info.lua +++ b/luaui/Widgets/gui_info.lua @@ -93,7 +93,7 @@ local spGetUnitResources = Spring.GetUnitResources local spGetUnitExperience = Spring.GetUnitExperience local spGetUnitWeaponState = Spring.GetUnitWeaponState local spGetUnitRulesParam = Spring.GetUnitRulesParam -local spColorString = Spring.Utilities.Color.ToString +local spColorString = Utilities.Color.ToString local math_floor = math.floor @@ -142,7 +142,7 @@ local isGeothermalUnit = {} local cachedTranslations = {} local function getCachedTranslation(key) if not cachedTranslations[key] then - cachedTranslations[key] = Spring.I18N(key) + cachedTranslations[key] = I18N(key) end return cachedTranslations[key] end @@ -1228,7 +1228,7 @@ local function GetAIName(teamID) -- name = name .. " [" .. options.profile .. "]" --end end - return Spring.I18N('ui.playersList.aiName', { name = name }) + return I18N('ui.playersList.aiName', { name = name }) end local function drawUnitInfo() @@ -1388,7 +1388,7 @@ local function drawUnitInfo() health, maxHealth = spGetUnitHealth(displayUnitID) if health then local color = bfcolormap[math.clamp(math_floor((health / maxHealth) * 100), 0, 100)] - valueY3 = Spring.Utilities.ConvertColor(color[1], color[2], color[3]) .. math_floor(health) + valueY3 = Utilities.ConvertColor(color[1], color[2], color[3]) .. math_floor(health) end -- display unit owner name @@ -1634,14 +1634,14 @@ local function drawUnitInfo() local reloadTimeSpeedup = 1.0 local currentReloadTime = unitDefInfo[displayUnitDefID].reloadTime if exp and exp > 0.009 then - addTextInfo(Spring.I18N('ui.info.xp'), round(exp, 2)) - addTextInfo(Spring.I18N('ui.info.maxhealth'), '+' .. round((maxHealth / unitDefInfo[displayUnitDefID].health - 1) * 100, 0) .. '%') + addTextInfo(I18N('ui.info.xp'), round(exp, 2)) + addTextInfo(I18N('ui.info.maxhealth'), '+' .. round((maxHealth / unitDefInfo[displayUnitDefID].health - 1) * 100, 0) .. '%') currentReloadTime = spGetUnitWeaponState(displayUnitID, unitDefInfo[displayUnitDefID].mainWeapon, 'reloadTimeXP') if unitDefInfo[displayUnitDefID].reloadTime then reloadTimeSpeedup = currentReloadTime / unitDefInfo[displayUnitDefID].reloadTime local reloadTimeSpeedupPercentage = tonumber(round((1 - reloadTimeSpeedup) * 100, 0)) if reloadTimeSpeedupPercentage > 0 then - addTextInfo(Spring.I18N('ui.info.reload'), '-' .. reloadTimeSpeedupPercentage .. '%') + addTextInfo(I18N('ui.info.reload'), '-' .. reloadTimeSpeedupPercentage .. '%') end end end @@ -1650,7 +1650,7 @@ local function drawUnitInfo() if mindps and mindps > 0 and mindps == maxdps then local dps = round(mindps/ reloadTimeSpeedup, 0) - addTextInfo(Spring.I18N('ui.info.dps'), dps) + addTextInfo(I18N('ui.info.dps'), dps) -- dps range elseif mindps ~= maxdps then @@ -1673,54 +1673,54 @@ local function drawUnitInfo() end if unitDefInfo[displayUnitDefID].maxCoverage then - addTextInfo(Spring.I18N('ui.info.coverrange'), unitDefInfo[displayUnitDefID].maxCoverage) + addTextInfo(I18N('ui.info.coverrange'), unitDefInfo[displayUnitDefID].maxCoverage) elseif maxRange and not unitDefInfo[displayUnitDefID].shieldOnly then - addTextInfo(Spring.I18N('ui.info.weaponrange'), math_floor(maxRange)) + addTextInfo(I18N('ui.info.weaponrange'), math_floor(maxRange)) end if currentReloadTime and currentReloadTime > 0 then - addTextInfo(Spring.I18N('ui.info.reloadtime'), round(currentReloadTime, 2)) + addTextInfo(I18N('ui.info.reloadtime'), round(currentReloadTime, 2)) end if unitDefInfo[displayUnitDefID].energyPerShot then - addTextInfo(Spring.I18N('ui.info.energyshot'), unitDefInfo[displayUnitDefID].energyPerShot) + addTextInfo(I18N('ui.info.energyshot'), unitDefInfo[displayUnitDefID].energyPerShot) end if unitDefInfo[displayUnitDefID].metalPerShot then - addTextInfo(Spring.I18N('ui.info.metalshot'), unitDefInfo[displayUnitDefID].metalPerShot) + addTextInfo(I18N('ui.info.metalshot'), unitDefInfo[displayUnitDefID].metalPerShot) end end -- shield display if unitDefInfo[displayUnitDefID].shieldCapacity then - addTextInfo(Spring.I18N('ui.info.shieldcapacity'), unitDefInfo[displayUnitDefID].shieldCapacity) - addTextInfo(Spring.I18N('ui.info.shieldrange'), unitDefInfo[displayUnitDefID].shieldRange) - addTextInfo(Spring.I18N('ui.info.shieldrechargerate'), unitDefInfo[displayUnitDefID].shieldRechargeRate) - addTextInfo(Spring.I18N('ui.info.shieldrechargecost'), unitDefInfo[displayUnitDefID].shieldRechargeCost) + addTextInfo(I18N('ui.info.shieldcapacity'), unitDefInfo[displayUnitDefID].shieldCapacity) + addTextInfo(I18N('ui.info.shieldrange'), unitDefInfo[displayUnitDefID].shieldRange) + addTextInfo(I18N('ui.info.shieldrechargerate'), unitDefInfo[displayUnitDefID].shieldRechargeRate) + addTextInfo(I18N('ui.info.shieldrechargecost'), unitDefInfo[displayUnitDefID].shieldRechargeCost) end if unitDefInfo[displayUnitDefID].stealth then - addTextInfo(Spring.I18N('ui.info.stealthy'), nil) + addTextInfo(I18N('ui.info.stealthy'), nil) end if unitDefInfo[displayUnitDefID].cloakCost then if unitDefInfo[displayUnitDefID].cloakCostMoving then - addTextInfo(Spring.I18N('ui.info.cloakcost'), unitDefInfo[displayUnitDefID].cloakCost .. "/" .. unitDefInfo[displayUnitDefID].cloakCostMoving) + addTextInfo(I18N('ui.info.cloakcost'), unitDefInfo[displayUnitDefID].cloakCost .. "/" .. unitDefInfo[displayUnitDefID].cloakCostMoving) else - addTextInfo(Spring.I18N('ui.info.cloakcost'), unitDefInfo[displayUnitDefID].cloakCost) + addTextInfo(I18N('ui.info.cloakcost'), unitDefInfo[displayUnitDefID].cloakCost) end end if unitDefInfo[displayUnitDefID].speed then - addTextInfo(Spring.I18N('ui.info.speed'), unitDefInfo[displayUnitDefID].speed) + addTextInfo(I18N('ui.info.speed'), unitDefInfo[displayUnitDefID].speed) elseif unitDefInfo[displayUnitDefID].speedMin then local min = unitDefInfo[displayUnitDefID].speedMin local max = unitDefInfo[displayUnitDefID].speedMax - addTextInfo(Spring.I18N('ui.info.speed'), min.."-"..max) + addTextInfo(I18N('ui.info.speed'), min.."-"..max) end if unitDefInfo[displayUnitDefID].reverseSpeed then - addTextInfo(Spring.I18N('ui.info.reversespeed'), unitDefInfo[displayUnitDefID].reverseSpeed) + addTextInfo(I18N('ui.info.reversespeed'), unitDefInfo[displayUnitDefID].reverseSpeed) end if unitDefInfo[displayUnitDefID].buildSpeed then - addTextInfo(Spring.I18N('ui.info.buildpower'), unitDefInfo[displayUnitDefID].buildSpeed) + addTextInfo(I18N('ui.info.buildpower'), unitDefInfo[displayUnitDefID].buildSpeed) end --if unitDefInfo[displayUnitDefID].armorType and unitDefInfo[displayUnitDefID].armorType ~= 'standard' then @@ -1728,51 +1728,51 @@ local function drawUnitInfo() --end if unitDefInfo[displayUnitDefID].sightDistance then - addTextInfo(Spring.I18N('ui.info.los'), round(unitDefInfo[displayUnitDefID].sightDistance, 0)) + addTextInfo(I18N('ui.info.los'), round(unitDefInfo[displayUnitDefID].sightDistance, 0)) end if unitDefInfo[displayUnitDefID].airSightDistance and (unitDefInfo[displayUnitDefID].airUnit or unitDefInfo[displayUnitDefID].isAaUnit) then - addTextInfo(Spring.I18N('ui.info.airlos'), round(unitDefInfo[displayUnitDefID].airSightDistance, 0)) + addTextInfo(I18N('ui.info.airlos'), round(unitDefInfo[displayUnitDefID].airSightDistance, 0)) end if unitDefInfo[displayUnitDefID].radarDistance then - addTextInfo(Spring.I18N('ui.info.radar'), round(unitDefInfo[displayUnitDefID].radarDistance, 0)) + addTextInfo(I18N('ui.info.radar'), round(unitDefInfo[displayUnitDefID].radarDistance, 0)) end if unitDefInfo[displayUnitDefID].sonarDistance then - addTextInfo(Spring.I18N('ui.info.sonar'), round(unitDefInfo[displayUnitDefID].sonarDistance, 0)) + addTextInfo(I18N('ui.info.sonar'), round(unitDefInfo[displayUnitDefID].sonarDistance, 0)) end if unitDefInfo[displayUnitDefID].radarDistanceJam then - addTextInfo(Spring.I18N('ui.info.jamrange'), round(unitDefInfo[displayUnitDefID].radarDistanceJam, 0)) + addTextInfo(I18N('ui.info.jamrange'), round(unitDefInfo[displayUnitDefID].radarDistanceJam, 0)) end if unitDefInfo[displayUnitDefID].sonarDistanceJam then - addTextInfo(Spring.I18N('ui.info.sonarjamrange'), round(unitDefInfo[displayUnitDefID].sonarDistanceJam, 0)) + addTextInfo(I18N('ui.info.sonarjamrange'), round(unitDefInfo[displayUnitDefID].sonarDistanceJam, 0)) end if unitDefInfo[displayUnitDefID].seismicDistance then - addTextInfo(Spring.I18N('ui.info.seismic'), unitDefInfo[displayUnitDefID].seismicDistance) + addTextInfo(I18N('ui.info.seismic'), unitDefInfo[displayUnitDefID].seismicDistance) end --addTextInfo('mass', round(Spring.GetUnitMass(displayUnitID),0)) --addTextInfo('radius', round(Spring.GetUnitRadius(displayUnitID),0)) --addTextInfo('height', round(Spring.GetUnitHeight(displayUnitID),0)) if unitDefInfo[displayUnitDefID].metalmaker then - addTextInfo(Spring.I18N('ui.info.eneededforconversion'), unitDefInfo[displayUnitDefID].metalmaker[1]) - addTextInfo(Spring.I18N('ui.info.convertedm'), round(unitDefInfo[displayUnitDefID].metalmaker[1] / (1 / unitDefInfo[displayUnitDefID].metalmaker[2]), 1)) + addTextInfo(I18N('ui.info.eneededforconversion'), unitDefInfo[displayUnitDefID].metalmaker[1]) + addTextInfo(I18N('ui.info.convertedm'), round(unitDefInfo[displayUnitDefID].metalmaker[1] / (1 / unitDefInfo[displayUnitDefID].metalmaker[2]), 1)) end if unitDefInfo[displayUnitDefID].energyStorage > 0 then - addTextInfo(Spring.I18N('ui.info.estorage'), unitDefInfo[displayUnitDefID].energyStorage) + addTextInfo(I18N('ui.info.estorage'), unitDefInfo[displayUnitDefID].energyStorage) end if unitDefInfo[displayUnitDefID].metalStorage > 0 then - addTextInfo(Spring.I18N('ui.info.mstorage'), unitDefInfo[displayUnitDefID].metalStorage) + addTextInfo(I18N('ui.info.mstorage'), unitDefInfo[displayUnitDefID].metalStorage) end if unitDefInfo[displayUnitDefID].transport then if unitDefInfo[displayUnitDefID].transport[1] < 5001 then - addTextInfo(Spring.I18N('ui.info.transport_light', { highlightColor = valueColor }), nil) + addTextInfo(I18N('ui.info.transport_light', { highlightColor = valueColor }), nil) end if unitDefInfo[displayUnitDefID].transport[1] > 5000 then - addTextInfo(Spring.I18N('ui.info.transport_heavy', { highlightColor = valueColor }), nil) + addTextInfo(I18N('ui.info.transport_heavy', { highlightColor = valueColor }), nil) end - addTextInfo(Spring.I18N('ui.info.transportcapacity'), unitDefInfo[displayUnitDefID].transport[3]) + addTextInfo(I18N('ui.info.transportcapacity'), unitDefInfo[displayUnitDefID].transport[3]) end -- Build final text from buffer @@ -1837,22 +1837,22 @@ local function drawEngineTooltip() if displayMapPosition then font:Print(tooltipValueColor..math.floor(hoverData[1])..',', backgroundRect[1] + contentPadding, backgroundRect[4] - contentPadding - (fontSize * 0.8) - height, fontSize, "o") font:Print(math.floor(hoverData[3]), backgroundRect[1] + contentPadding + (fontSize * 3.2), backgroundRect[4] - contentPadding - (fontSize * 0.8) - height, fontSize, "o") - font:Print(tooltipLabelTextColor..Spring.I18N('ui.info.elevation')..' '..tooltipValueColor..math.floor(Spring.GetGroundHeight(coords[1], coords[3])), backgroundRect[1] + contentPadding + (fontSize * 6.6), backgroundRect[4] - contentPadding - (fontSize * 0.8) - height, fontSize, "o") + font:Print(tooltipLabelTextColor..I18N('ui.info.elevation')..' '..tooltipValueColor..math.floor(Spring.GetGroundHeight(coords[1], coords[3])), backgroundRect[1] + contentPadding + (fontSize * 6.6), backgroundRect[4] - contentPadding - (fontSize * 0.8) - height, fontSize, "o") height = height + heightStep end if tankSpeed ~= 1 or botSpeed ~= 1 or hoverSpeed ~= 1 or (shipSpeed ~= 1 and coords[2] <= 0) then text = '' if tankSpeed ~= 1 then - text = text..(text~='' and ' ' or '')..tooltipLabelTextColor..Spring.I18N('ui.info.tank')..' '..tooltipValueColor..math.floor(tankSpeed*100).."%" + text = text..(text~='' and ' ' or '')..tooltipLabelTextColor..I18N('ui.info.tank')..' '..tooltipValueColor..math.floor(tankSpeed*100).."%" end if botSpeed ~= 1 then - text = text..(text~='' and ' ' or '')..tooltipLabelTextColor..Spring.I18N('ui.info.bot')..' '..tooltipValueColor..math.floor(botSpeed*100).."%" + text = text..(text~='' and ' ' or '')..tooltipLabelTextColor..I18N('ui.info.bot')..' '..tooltipValueColor..math.floor(botSpeed*100).."%" end if hoverSpeed ~= 1 then - text = text..(text~='' and ' ' or '')..tooltipLabelTextColor..Spring.I18N('ui.info.hover')..' '..tooltipValueColor..math.floor(hoverSpeed*100).."%" + text = text..(text~='' and ' ' or '')..tooltipLabelTextColor..I18N('ui.info.hover')..' '..tooltipValueColor..math.floor(hoverSpeed*100).."%" end if shipSpeed ~= 1 and coords[2] <= 0 then - text = text..(text~='' and ' ' or '')..tooltipLabelTextColor..Spring.I18N('ui.info.ship')..' '..tooltipValueColor..math.floor(shipSpeed*100).."%" + text = text..(text~='' and ' ' or '')..tooltipLabelTextColor..I18N('ui.info.ship')..' '..tooltipValueColor..math.floor(shipSpeed*100).."%" end if groundType2 and groundType2 ~= '' then font2:Begin(true) @@ -1862,7 +1862,7 @@ local function drawEngineTooltip() height = height + (fontSize * 0.25) height = height + heightStep end - font:Print(tooltipDarkTextColor..Spring.I18N('ui.info.speedmultipliers')..' '..text, backgroundRect[1] + contentPadding, backgroundRect[4] - contentPadding - (fontSize * 0.8) - height, fontSize, "o") + font:Print(tooltipDarkTextColor..I18N('ui.info.speedmultipliers')..' '..text, backgroundRect[1] + contentPadding, backgroundRect[4] - contentPadding - (fontSize * 0.8) - height, fontSize, "o") elseif not displayMapPosition then emptyInfo = true end @@ -1896,12 +1896,12 @@ local function drawEngineTooltip() local metal, _, energy, _ = Spring.GetFeatureResources(hoverData) if energy > 0 then height = height + heightStep - text = tooltipLabelTextColor..Spring.I18N('ui.info.energy').." \255\255\255\000"..string.formatSI(energy) + text = tooltipLabelTextColor..I18N('ui.info.energy').." \255\255\255\000"..string.formatSI(energy) font:Print(text, backgroundRect[1] + contentPadding, backgroundRect[4] - contentPadding - (fontSize * 0.8) - height, fontSize, "o") end if metal > 0 then height = height + heightStep - text = tooltipLabelTextColor..Spring.I18N('ui.info.metal').." "..tooltipValueColor..string.formatSI(metal) + text = tooltipLabelTextColor..I18N('ui.info.metal').." "..tooltipValueColor..string.formatSI(metal) font:Print(text, backgroundRect[1] + contentPadding, backgroundRect[4] - contentPadding - (fontSize * 0.8) - height, fontSize, "o") end font:End() @@ -2387,7 +2387,7 @@ function checkChanges() if featureDef.reclaimable then local metal, _, energy, _ = Spring.GetFeatureResources(featureID) - local reclaimText = Spring.I18N('ui.reclaimInfo.metal', { metal = string.formatSI(metal) }) .. "\255\255\255\128" .. " " .. Spring.I18N('ui.reclaimInfo.energy', { energy = string.formatSI(energy) }) + local reclaimText = I18N('ui.reclaimInfo.metal', { metal = string.formatSI(metal) }) .. "\255\255\255\128" .. " " .. I18N('ui.reclaimInfo.energy', { energy = string.formatSI(energy) }) newTooltip = newTooltip .. "\n\n" .. reclaimText end diff --git a/luaui/Widgets/gui_keybind_info.lua b/luaui/Widgets/gui_keybind_info.lua index 6d87fcd7e3b..f012d54d411 100644 --- a/luaui/Widgets/gui_keybind_info.lua +++ b/luaui/Widgets/gui_keybind_info.lua @@ -190,8 +190,8 @@ local function drawWindow(activetab) gl.Color(1, 1, 1, 1) font:Begin() - font:Print(Spring.I18N('ui.keybinds.disclaimer'), screenX + (12*widgetScale), screenY - screenHeight + (34*widgetScale), 12.5*widgetScale) - font:Print(Spring.I18N('ui.keybinds.howtochangekeybinds'), screenX + (12*widgetScale), screenY - screenHeight + (20*widgetScale), 12.5*widgetScale) + font:Print(I18N('ui.keybinds.disclaimer'), screenX + (12*widgetScale), screenY - screenHeight + (34*widgetScale), 12.5*widgetScale) + font:Print(I18N('ui.keybinds.howtochangekeybinds'), screenX + (12*widgetScale), screenY - screenHeight + (20*widgetScale), 12.5*widgetScale) font:End() end end @@ -201,106 +201,106 @@ local function refreshText() currentLayout = Spring.GetConfigString("KeyboardLayout", "qwerty") keybindsText = { - { type = lineType.title, text = Spring.I18N('ui.keybinds.chat.title') }, - { type = lineType.key, key = getActionHotkey('chat'), text = Spring.I18N('ui.keybinds.chat.send') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.chat.alliesKey'), text = Spring.I18N('ui.keybinds.chat.allies') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.chat.spectatorsKey'), text = Spring.I18N('ui.keybinds.chat.spectators') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.chat.ignoreKey'), text = Spring.I18N('ui.keybinds.chat.ignore') }, + { type = lineType.title, text = I18N('ui.keybinds.chat.title') }, + { type = lineType.key, key = getActionHotkey('chat'), text = I18N('ui.keybinds.chat.send') }, + { type = lineType.key, key = I18N('ui.keybinds.chat.alliesKey'), text = I18N('ui.keybinds.chat.allies') }, + { type = lineType.key, key = I18N('ui.keybinds.chat.spectatorsKey'), text = I18N('ui.keybinds.chat.spectators') }, + { type = lineType.key, key = I18N('ui.keybinds.chat.ignoreKey'), text = I18N('ui.keybinds.chat.ignore') }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.menus.title') }, - { type = lineType.key, key = getActionHotkey('options'), text = Spring.I18N('ui.keybinds.menus.settings') }, - { type = lineType.key, key = getActionHotkey('sharedialog'), text = Spring.I18N('ui.keybinds.menus.share') }, + { type = lineType.title, text = I18N('ui.keybinds.menus.title') }, + { type = lineType.key, key = getActionHotkey('options'), text = I18N('ui.keybinds.menus.settings') }, + { type = lineType.key, key = getActionHotkey('sharedialog'), text = I18N('ui.keybinds.menus.share') }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.camera.title') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.camera.zoomKey'), text = Spring.I18N('ui.keybinds.camera.zoom') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.camera.panKey'), text = Spring.I18N('ui.keybinds.camera.pan') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.camera.tiltKey'), text = Spring.I18N('ui.keybinds.camera.tilt') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.camera.dragKey'), text = Spring.I18N('ui.keybinds.camera.drag') }, - { type = lineType.key, key = getActionHotkey('cameraflip'), text = Spring.I18N('ui.keybinds.camera.flip') }, + { type = lineType.title, text = I18N('ui.keybinds.camera.title') }, + { type = lineType.key, key = I18N('ui.keybinds.camera.zoomKey'), text = I18N('ui.keybinds.camera.zoom') }, + { type = lineType.key, key = I18N('ui.keybinds.camera.panKey'), text = I18N('ui.keybinds.camera.pan') }, + { type = lineType.key, key = I18N('ui.keybinds.camera.tiltKey'), text = I18N('ui.keybinds.camera.tilt') }, + { type = lineType.key, key = I18N('ui.keybinds.camera.dragKey'), text = I18N('ui.keybinds.camera.drag') }, + { type = lineType.key, key = getActionHotkey('cameraflip'), text = I18N('ui.keybinds.camera.flip') }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.cameraModes.title') }, - { type = lineType.key, key = getActionHotkey('viewta') .. ', ' .. getActionHotkey('viewspring'), text = Spring.I18N('ui.keybinds.cameraModes.change') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.cameraModes.fullscreenKey'), text = Spring.I18N('ui.keybinds.cameraModes.fullscreen') }, - { type = lineType.key, key = getActionHotkey('toggleoverview'), text = Spring.I18N('ui.keybinds.cameraModes.overview') }, - { type = lineType.key, key = getActionHotkey('togglelos'), text = Spring.I18N('ui.keybinds.cameraModes.los') }, - { type = lineType.key, key = getActionHotkey('showelevation'), text = Spring.I18N('ui.keybinds.cameraModes.heightmap') }, - { type = lineType.key, key = getActionHotkey('showpathtraversability'), text = Spring.I18N('ui.keybinds.cameraModes.traversability')}, - { type = lineType.key, key = getActionHotkey('lastmsgpos'), text = Spring.I18N('ui.keybinds.cameraModes.mapmarks') }, - { type = lineType.key, key = getActionHotkey('showmetalmap'), text = Spring.I18N('ui.keybinds.cameraModes.resourceSpots') }, - { type = lineType.key, key = getActionHotkey('hideinterface'), text = Spring.I18N('ui.keybinds.cameraModes.interface') }, + { type = lineType.title, text = I18N('ui.keybinds.cameraModes.title') }, + { type = lineType.key, key = getActionHotkey('viewta') .. ', ' .. getActionHotkey('viewspring'), text = I18N('ui.keybinds.cameraModes.change') }, + { type = lineType.key, key = I18N('ui.keybinds.cameraModes.fullscreenKey'), text = I18N('ui.keybinds.cameraModes.fullscreen') }, + { type = lineType.key, key = getActionHotkey('toggleoverview'), text = I18N('ui.keybinds.cameraModes.overview') }, + { type = lineType.key, key = getActionHotkey('togglelos'), text = I18N('ui.keybinds.cameraModes.los') }, + { type = lineType.key, key = getActionHotkey('showelevation'), text = I18N('ui.keybinds.cameraModes.heightmap') }, + { type = lineType.key, key = getActionHotkey('showpathtraversability'), text = I18N('ui.keybinds.cameraModes.traversability')}, + { type = lineType.key, key = getActionHotkey('lastmsgpos'), text = I18N('ui.keybinds.cameraModes.mapmarks') }, + { type = lineType.key, key = getActionHotkey('showmetalmap'), text = I18N('ui.keybinds.cameraModes.resourceSpots') }, + { type = lineType.key, key = getActionHotkey('hideinterface'), text = I18N('ui.keybinds.cameraModes.interface') }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.sound.title') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.sound.volumeKey'), text = Spring.I18N('ui.keybinds.sound.volume') }, - { type = lineType.key, key = getActionHotkey('mutesound'), text = Spring.I18N('ui.keybinds.sound.mute') }, + { type = lineType.title, text = I18N('ui.keybinds.sound.title') }, + { type = lineType.key, key = I18N('ui.keybinds.sound.volumeKey'), text = I18N('ui.keybinds.sound.volume') }, + { type = lineType.key, key = getActionHotkey('mutesound'), text = I18N('ui.keybinds.sound.mute') }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.selection.title') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.selection.unitsKey'), text = Spring.I18N('ui.keybinds.selection.units') }, + { type = lineType.title, text = I18N('ui.keybinds.selection.title') }, + { type = lineType.key, key = I18N('ui.keybinds.selection.unitsKey'), text = I18N('ui.keybinds.selection.units') }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.issueContextOrders.title') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.issueContextOrders.orderKey'), text = Spring.I18N('ui.keybinds.issueContextOrders.order') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.issueContextOrders.formationOrderKey'), text = Spring.I18N('ui.keybinds.issueContextOrders.formationOrder') }, + { type = lineType.title, text = I18N('ui.keybinds.issueContextOrders.title') }, + { type = lineType.key, key = I18N('ui.keybinds.issueContextOrders.orderKey'), text = I18N('ui.keybinds.issueContextOrders.order') }, + { type = lineType.key, key = I18N('ui.keybinds.issueContextOrders.formationOrderKey'), text = I18N('ui.keybinds.issueContextOrders.formationOrder') }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.orders.title') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.orders.defaultKey'), text = Spring.I18N('ui.keybinds.orders.default') }, - { type = lineType.key, key = getActionHotkey('move'), text = Spring.I18N('ui.keybinds.orders.move') }, - { type = lineType.key, key = getActionHotkey('attack'), text = Spring.I18N('ui.keybinds.orders.attack') }, - { type = lineType.key, key = getActionHotkey('settarget'), text = Spring.I18N('ui.keybinds.orders.setTarget') }, - { type = lineType.key, key = getActionHotkey('repair'), text = Spring.I18N('ui.keybinds.orders.repair') }, - { type = lineType.key, key = getActionHotkey('reclaim'), text = Spring.I18N('ui.keybinds.orders.reclaim') }, - { type = lineType.key, key = getActionHotkey('resurrect'), text = Spring.I18N('ui.keybinds.orders.resurrect') }, - { type = lineType.key, key = getActionHotkey('fight'), text = Spring.I18N('ui.keybinds.orders.fight') }, - { type = lineType.key, key = getActionHotkey('patrol'), text = Spring.I18N('ui.keybinds.orders.patrol') }, - { type = lineType.key, key = getActionHotkey('wantcloak'), text = Spring.I18N('ui.keybinds.orders.cloak') }, + { type = lineType.title, text = I18N('ui.keybinds.orders.title') }, + { type = lineType.key, key = I18N('ui.keybinds.orders.defaultKey'), text = I18N('ui.keybinds.orders.default') }, + { type = lineType.key, key = getActionHotkey('move'), text = I18N('ui.keybinds.orders.move') }, + { type = lineType.key, key = getActionHotkey('attack'), text = I18N('ui.keybinds.orders.attack') }, + { type = lineType.key, key = getActionHotkey('settarget'), text = I18N('ui.keybinds.orders.setTarget') }, + { type = lineType.key, key = getActionHotkey('repair'), text = I18N('ui.keybinds.orders.repair') }, + { type = lineType.key, key = getActionHotkey('reclaim'), text = I18N('ui.keybinds.orders.reclaim') }, + { type = lineType.key, key = getActionHotkey('resurrect'), text = I18N('ui.keybinds.orders.resurrect') }, + { type = lineType.key, key = getActionHotkey('fight'), text = I18N('ui.keybinds.orders.fight') }, + { type = lineType.key, key = getActionHotkey('patrol'), text = I18N('ui.keybinds.orders.patrol') }, + { type = lineType.key, key = getActionHotkey('wantcloak'), text = I18N('ui.keybinds.orders.cloak') }, { type = lineType.blank }, - { type = lineType.key, key = getActionHotkey('stop'), text = Spring.I18N('ui.keybinds.orders.stop') }, - { type = lineType.key, key = getActionHotkey('wait'), text = Spring.I18N('ui.keybinds.orders.wait') }, - { type = lineType.key, key = getActionHotkey('canceltarget'), text = Spring.I18N('ui.keybinds.orders.cancelTarget') }, + { type = lineType.key, key = getActionHotkey('stop'), text = I18N('ui.keybinds.orders.stop') }, + { type = lineType.key, key = getActionHotkey('wait'), text = I18N('ui.keybinds.orders.wait') }, + { type = lineType.key, key = getActionHotkey('canceltarget'), text = I18N('ui.keybinds.orders.cancelTarget') }, { type = lineType.blank }, - { type = lineType.key, key = getActionHotkey('manualfire'), text = Spring.I18N('ui.keybinds.orders.dGun') }, - { type = lineType.key, key = getActionHotkey('selfd'), text = Spring.I18N('ui.keybinds.orders.selfDestruct') }, + { type = lineType.key, key = getActionHotkey('manualfire'), text = I18N('ui.keybinds.orders.dGun') }, + { type = lineType.key, key = getActionHotkey('selfd'), text = I18N('ui.keybinds.orders.selfDestruct') }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.issueOrders.title') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.issueOrders.orderKey'), text = Spring.I18N('ui.keybinds.issueOrders.order') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.issueOrders.revertKey'), text = Spring.I18N('ui.keybinds.issueOrders.revert') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.issueOrders.formationKey'), text = Spring.I18N('ui.keybinds.issueOrders.formation') }, + { type = lineType.title, text = I18N('ui.keybinds.issueOrders.title') }, + { type = lineType.key, key = I18N('ui.keybinds.issueOrders.orderKey'), text = I18N('ui.keybinds.issueOrders.order') }, + { type = lineType.key, key = I18N('ui.keybinds.issueOrders.revertKey'), text = I18N('ui.keybinds.issueOrders.revert') }, + { type = lineType.key, key = I18N('ui.keybinds.issueOrders.formationKey'), text = I18N('ui.keybinds.issueOrders.formation') }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.queues.title') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.queues.appendKey'), text = Spring.I18N('ui.keybinds.queues.append') }, - { type = lineType.key, key = getActionHotkey('commandinsert'), text = Spring.I18N('ui.keybinds.queues.prepend')}, + { type = lineType.title, text = I18N('ui.keybinds.queues.title') }, + { type = lineType.key, key = I18N('ui.keybinds.queues.appendKey'), text = I18N('ui.keybinds.queues.append') }, + { type = lineType.key, key = getActionHotkey('commandinsert'), text = I18N('ui.keybinds.queues.prepend')}, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.buildOrders.title') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.buildOrders.selectTileKey'), text = Spring.I18N('ui.keybinds.buildOrders.selectTile')}, - { type = lineType.key, key = Spring.I18N('ui.keybinds.buildOrders.metalKey'), text = Spring.I18N('ui.keybinds.buildOrders.metal') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.buildOrders.energyKey'), text = Spring.I18N('ui.keybinds.buildOrders.energy') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.buildOrders.intelKey'), text = Spring.I18N('ui.keybinds.buildOrders.intel') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.buildOrders.factoriesKey'), text = Spring.I18N('ui.keybinds.buildOrders.factories') }, - { type = lineType.key, key = getActionHotkey('buildfacing_inc') .." / ".. getActionHotkey('buildfacing_dec'), text = Spring.I18N('ui.keybinds.buildOrders.rotate') }, + { type = lineType.title, text = I18N('ui.keybinds.buildOrders.title') }, + { type = lineType.key, key = I18N('ui.keybinds.buildOrders.selectTileKey'), text = I18N('ui.keybinds.buildOrders.selectTile')}, + { type = lineType.key, key = I18N('ui.keybinds.buildOrders.metalKey'), text = I18N('ui.keybinds.buildOrders.metal') }, + { type = lineType.key, key = I18N('ui.keybinds.buildOrders.energyKey'), text = I18N('ui.keybinds.buildOrders.energy') }, + { type = lineType.key, key = I18N('ui.keybinds.buildOrders.intelKey'), text = I18N('ui.keybinds.buildOrders.intel') }, + { type = lineType.key, key = I18N('ui.keybinds.buildOrders.factoriesKey'), text = I18N('ui.keybinds.buildOrders.factories') }, + { type = lineType.key, key = getActionHotkey('buildfacing_inc') .." / ".. getActionHotkey('buildfacing_dec'), text = I18N('ui.keybinds.buildOrders.rotate') }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.issueBuildOrders.title') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.issueBuildOrders.orderKey'), text = Spring.I18N('ui.keybinds.issueBuildOrders.order') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.issueBuildOrders.deselect'), text = Spring.I18N('ui.keybinds.issueBuildOrders.deselect') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.issueBuildOrders.lineKey'), text = Spring.I18N('ui.keybinds.issueBuildOrders.line') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.issueBuildOrders.gridKey'), text = Spring.I18N('ui.keybinds.issueBuildOrders.grid') }, - { type = lineType.key, key = getActionHotkey('buildspacing_inc'), text = Spring.I18N('ui.keybinds.issueBuildOrders.spacingUp') }, - { type = lineType.key, key = getActionHotkey('buildspacing_dec'), text = Spring.I18N('ui.keybinds.issueBuildOrders.spacingDown') }, + { type = lineType.title, text = I18N('ui.keybinds.issueBuildOrders.title') }, + { type = lineType.key, key = I18N('ui.keybinds.issueBuildOrders.orderKey'), text = I18N('ui.keybinds.issueBuildOrders.order') }, + { type = lineType.key, key = I18N('ui.keybinds.issueBuildOrders.deselect'), text = I18N('ui.keybinds.issueBuildOrders.deselect') }, + { type = lineType.key, key = I18N('ui.keybinds.issueBuildOrders.lineKey'), text = I18N('ui.keybinds.issueBuildOrders.line') }, + { type = lineType.key, key = I18N('ui.keybinds.issueBuildOrders.gridKey'), text = I18N('ui.keybinds.issueBuildOrders.grid') }, + { type = lineType.key, key = getActionHotkey('buildspacing_inc'), text = I18N('ui.keybinds.issueBuildOrders.spacingUp') }, + { type = lineType.key, key = getActionHotkey('buildspacing_dec'), text = I18N('ui.keybinds.issueBuildOrders.spacingDown') }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.massSelect.title') }, - { type = lineType.key, key = getActionHotkey('select_AllMap++_ClearSelection_SelectAll+'), text = Spring.I18N('ui.keybinds.massSelect.all') }, - { type = lineType.key, key = getActionHotkey('select_AllMap+_Builder_Idle+_ClearSelection_SelectOne+'), text = Spring.I18N('ui.keybinds.massSelect.builders') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.massSelect.createGroupKey'), text = Spring.I18N('ui.keybinds.massSelect.createGroup')}, - { type = lineType.key, key = Spring.I18N('ui.keybinds.massSelect.createAutoGroupKey'), text = Spring.I18N('ui.keybinds.massSelect.createAutoGroup')}, - { type = lineType.key, key = getActionHotkey('remove_from_autogroup'), text = Spring.I18N('ui.keybinds.massSelect.removeAutoGroup')}, - { type = lineType.key, key = Spring.I18N('ui.keybinds.massSelect.groupKey'), text = Spring.I18N('ui.keybinds.massSelect.group') }, - { type = lineType.key, key = getActionHotkey('select_AllMap+_InPrevSel+_ClearSelection_SelectAll+'), text = Spring.I18N('ui.keybinds.massSelect.sameType') }, + { type = lineType.title, text = I18N('ui.keybinds.massSelect.title') }, + { type = lineType.key, key = getActionHotkey('select_AllMap++_ClearSelection_SelectAll+'), text = I18N('ui.keybinds.massSelect.all') }, + { type = lineType.key, key = getActionHotkey('select_AllMap+_Builder_Idle+_ClearSelection_SelectOne+'), text = I18N('ui.keybinds.massSelect.builders') }, + { type = lineType.key, key = I18N('ui.keybinds.massSelect.createGroupKey'), text = I18N('ui.keybinds.massSelect.createGroup')}, + { type = lineType.key, key = I18N('ui.keybinds.massSelect.createAutoGroupKey'), text = I18N('ui.keybinds.massSelect.createAutoGroup')}, + { type = lineType.key, key = getActionHotkey('remove_from_autogroup'), text = I18N('ui.keybinds.massSelect.removeAutoGroup')}, + { type = lineType.key, key = I18N('ui.keybinds.massSelect.groupKey'), text = I18N('ui.keybinds.massSelect.group') }, + { type = lineType.key, key = getActionHotkey('select_AllMap+_InPrevSel+_ClearSelection_SelectAll+'), text = I18N('ui.keybinds.massSelect.sameType') }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.drawing.title') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.drawing.mapmarkKey'), text = Spring.I18N('ui.keybinds.drawing.mapmark') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.drawing.drawKey'), text = Spring.I18N('ui.keybinds.drawing.draw') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.drawing.eraseKey'), text = Spring.I18N('ui.keybinds.drawing.erase') }, + { type = lineType.title, text = I18N('ui.keybinds.drawing.title') }, + { type = lineType.key, key = I18N('ui.keybinds.drawing.mapmarkKey'), text = I18N('ui.keybinds.drawing.mapmark') }, + { type = lineType.key, key = I18N('ui.keybinds.drawing.drawKey'), text = I18N('ui.keybinds.drawing.draw') }, + { type = lineType.key, key = I18N('ui.keybinds.drawing.eraseKey'), text = I18N('ui.keybinds.drawing.erase') }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.console.title') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.console.eraseKey'), text = Spring.I18N('ui.keybinds.console.erase') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.console.pauseKey'), text = Spring.I18N('ui.keybinds.console.pause') }, + { type = lineType.title, text = I18N('ui.keybinds.console.title') }, + { type = lineType.key, key = I18N('ui.keybinds.console.eraseKey'), text = I18N('ui.keybinds.console.erase') }, + { type = lineType.key, key = I18N('ui.keybinds.console.pauseKey'), text = I18N('ui.keybinds.console.pause') }, } end diff --git a/luaui/Widgets/gui_language.lua b/luaui/Widgets/gui_language.lua index 6490c77f06d..bdc7c467d59 100644 --- a/luaui/Widgets/gui_language.lua +++ b/luaui/Widgets/gui_language.lua @@ -18,9 +18,9 @@ local customMessageProxies = { local function getMessageProxy(messageKey, parameters) if customMessageProxies[messageKey] then - return Spring.I18N( messageKey, customMessageProxies[messageKey](parameters) ) + return I18N( messageKey, customMessageProxies[messageKey](parameters) ) else - return Spring.I18N(messageKey, parameters) + return I18N(messageKey, parameters) end end @@ -37,7 +37,7 @@ function widget:Initialize() WG['language'].setLanguage = function(language) Spring.SetConfigString('language', language) - Spring.I18N.setLanguage(language) + I18N.setLanguage(language) if Script.LuaUI('LanguageChanged') then Script.LuaUI.LanguageChanged() diff --git a/luaui/Widgets/gui_mapinfo.lua b/luaui/Widgets/gui_mapinfo.lua index 32119b9897c..c88f2295017 100644 --- a/luaui/Widgets/gui_mapinfo.lua +++ b/luaui/Widgets/gui_mapinfo.lua @@ -149,7 +149,7 @@ local function createMapinfoList(opacityMultiplier) usedTextOffsetY = usedTextOffsetY+textOffsetY text = Game.mapDescription font:SetTextColor(1,1,1,textOpacity*0.6*opacityMultiplier) - font:Print(Spring.I18N('ui.mapinfo.author')..': '..mapinfo.author, textOffsetX,-usedTextOffsetY+0.8,textSize,"n") + font:Print(I18N('ui.mapinfo.author')..': '..mapinfo.author, textOffsetX,-usedTextOffsetY+0.8,textSize,"n") end --map size diff --git a/luaui/Widgets/gui_options.lua b/luaui/Widgets/gui_options.lua index 1f86d08723d..064b1aacabd 100644 --- a/luaui/Widgets/gui_options.lua +++ b/luaui/Widgets/gui_options.lua @@ -33,7 +33,7 @@ languageCodes = table.merge(languageCodes, table.invert(languageCodes)) local languageNames = {} for key, code in ipairs(languageCodes) do - languageNames[key] = Spring.I18N.languages[code] + languageNames[key] = I18N.languages[code] end local devLanguageCodes = { 'en', 'fr', 'de', 'ru', 'zh', 'es', 'test_unicode', } @@ -41,7 +41,7 @@ devLanguageCodes = table.merge(devLanguageCodes, table.invert(devLanguageCodes)) local devLanguageNames = {} for key, code in ipairs(devLanguageCodes) do - devLanguageNames[key] = Spring.I18N.languages[code] + devLanguageNames[key] = I18N.languages[code] end -- detect potatos @@ -78,8 +78,8 @@ else isPotatoGpu = true end -local devMode = Spring.Utilities.IsDevMode() -local devUI = Spring.Utilities.ShowDevUI() +local devMode = Utilities.IsDevMode() +local devUI = Utilities.ShowDevUI() local advSettings = false local initialized = false @@ -169,7 +169,7 @@ local GL_ONE = GL.ONE local RectRound, elementCorner, elementMargin, elementPadding, UiElement, UiButton, UiSlider, UiSliderKnob, UiToggle, UiSelector, UiSelectHighlight, bgpadding -local isSinglePlayer = Spring.Utilities.Gametype.IsSinglePlayer() +local isSinglePlayer = Utilities.Gametype.IsSinglePlayer() local isReplay = Spring.IsReplay() local skipUnpauseOnHide = false @@ -226,25 +226,25 @@ local gameOver = false local presets = {} local reclaimFieldHighlightOptions = { - Spring.I18N('ui.settings.option.reclaimfieldhighlight_always'), - Spring.I18N('ui.settings.option.reclaimfieldhighlight_resource'), - Spring.I18N('ui.settings.option.reclaimfieldhighlight_reclaimer'), - Spring.I18N('ui.settings.option.reclaimfieldhighlight_resbot'), - Spring.I18N('ui.settings.option.reclaimfieldhighlight_order'), - Spring.I18N('ui.settings.option.reclaimfieldhighlight_disabled') + I18N('ui.settings.option.reclaimfieldhighlight_always'), + I18N('ui.settings.option.reclaimfieldhighlight_resource'), + I18N('ui.settings.option.reclaimfieldhighlight_reclaimer'), + I18N('ui.settings.option.reclaimfieldhighlight_resbot'), + I18N('ui.settings.option.reclaimfieldhighlight_order'), + I18N('ui.settings.option.reclaimfieldhighlight_disabled') } local spectatorHUDConfigOptions = { - Spring.I18N('ui.settings.option.spectator_hud_config_basic'), - Spring.I18N('ui.settings.option.spectator_hud_config_advanced'), - Spring.I18N('ui.settings.option.spectator_hud_config_expert'), - Spring.I18N('ui.settings.option.spectator_hud_config_custom'), + I18N('ui.settings.option.spectator_hud_config_basic'), + I18N('ui.settings.option.spectator_hud_config_advanced'), + I18N('ui.settings.option.spectator_hud_config_expert'), + I18N('ui.settings.option.spectator_hud_config_custom'), } local startScript = VFS.LoadFile("_script.txt") if not startScript then local modoptions = '' - for key, value in pairs(Spring.GetModOptionsCopy()) do + for key, value in pairs(GetModOptionsCopy()) do local v = value if type(v) == 'boolean' then v = (v and '1' or '0') @@ -488,7 +488,7 @@ function updateInputDlist() local leftOffset = floor(lineHeight*0.7) local distance = 0 --elementMargin local usedFont = font - local modeText = Spring.I18N('ui.settings.filter') + local modeText = I18N('ui.settings.filter') if inputMode ~= '' then modeText = inputMode end @@ -645,11 +645,11 @@ function DrawWindow() local color = '\255\255\255\255' local title = "" if devMode or devUI then - title = devOptionColor .. Spring.I18N('ui.settings.option.devmode') + title = devOptionColor .. I18N('ui.settings.option.devmode') elseif advSettings then - title = color2 .. Spring.I18N('ui.settings.basic') .. " / " .. color .. Spring.I18N('ui.settings.advanced') + title = color2 .. I18N('ui.settings.basic') .. " / " .. color .. I18N('ui.settings.advanced') else - title = color .. Spring.I18N('ui.settings.basic') .. color2 .. " / " .. Spring.I18N('ui.settings.advanced') + title = color .. I18N('ui.settings.basic') .. color2 .. " / " .. I18N('ui.settings.advanced') end local titleFontSize = 18 * widgetScale titleRect = { math.floor((screenX + screenWidth) - ((font2:GetTextWidth(title) * titleFontSize) + (titleFontSize * 1.5))), screenY, screenX + screenWidth, math.floor(screenY + (titleFontSize * 1.7)) } @@ -754,7 +754,7 @@ function DrawWindow() RectRound(screenX+bgpadding, screenY - screenHeight+bgpadding + (30 * widgetScale)-1, screenX + screenWidth-bgpadding, screenY-screenHeight + (30 * widgetScale), 0, 0, 0, 0, 0) font:SetTextColor(0.9, 0.3, 0.3, 1) font:SetOutlineColor(0, 0, 0, 0.4) - font:Print(Spring.I18N('ui.settings.madechanges'), screenX + math.floor(screenWidth*0.5), screenY - screenHeight + (12 * widgetScale), 15 * widgetScale, "cn") + font:Print(I18N('ui.settings.madechanges'), screenX + math.floor(screenWidth*0.5), screenY - screenHeight + (12 * widgetScale), 15 * widgetScale, "cn") end -- draw navigation... backward/forward @@ -1404,7 +1404,7 @@ function widget:DrawScreen() if WG.tooltip and options[i].description and options[i].description ~= '' and options[i].description ~= ' ' then local desc = options[i].description if options[i].restart then - desc = desc..'\n\n\255\255\120\120'..Spring.I18N('ui.settings.changesrequirerestart') + desc = desc..'\n\n\255\255\120\120'..I18N('ui.settings.changesrequirerestart') end local showTooltip = true if options[i].nametext and string.find(options[i].nametext, desc, nil, true) then @@ -1957,7 +1957,7 @@ function applyOptionValue(i, newValue, skipRedrawWindow, force) if options[i].id ~= 'preset' and presets.lowest[options[i].id] ~= nil and manualChange then if options[getOptionByID('preset')] then - options[getOptionByID('preset')].value = Spring.I18N('ui.settings.option.select_custom') + options[getOptionByID('preset')].value = I18N('ui.settings.option.select_custom') Spring.SetConfigString('graphicsPreset', 'custom') end end @@ -2461,41 +2461,41 @@ function init() if devMode or devUI then -- dev mode: show all presets so every quality level can be tested presetNames = { - Spring.I18N('ui.settings.option.select_lowest'), - Spring.I18N('ui.settings.option.select_low'), - Spring.I18N('ui.settings.option.select_medium'), - Spring.I18N('ui.settings.option.select_high'), - Spring.I18N('ui.settings.option.select_ultra'), - Spring.I18N('ui.settings.option.select_custom') + I18N('ui.settings.option.select_lowest'), + I18N('ui.settings.option.select_low'), + I18N('ui.settings.option.select_medium'), + I18N('ui.settings.option.select_high'), + I18N('ui.settings.option.select_ultra'), + I18N('ui.settings.option.select_custom') } elseif isPotatoGpu then presetNames = { - Spring.I18N('ui.settings.option.select_lowest'), - Spring.I18N('ui.settings.option.select_low'), - Spring.I18N('ui.settings.option.select_medium'), - Spring.I18N('ui.settings.option.select_custom') + I18N('ui.settings.option.select_lowest'), + I18N('ui.settings.option.select_low'), + I18N('ui.settings.option.select_medium'), + I18N('ui.settings.option.select_custom') } else presetNames = { - Spring.I18N('ui.settings.option.select_low'), - Spring.I18N('ui.settings.option.select_medium'), - Spring.I18N('ui.settings.option.select_high'), - Spring.I18N('ui.settings.option.select_ultra'), - Spring.I18N('ui.settings.option.select_custom') + I18N('ui.settings.option.select_low'), + I18N('ui.settings.option.select_medium'), + I18N('ui.settings.option.select_high'), + I18N('ui.settings.option.select_ultra'), + I18N('ui.settings.option.select_custom') } end -- if you want to add an option it should be added here, and in applyOptionValue(), if option needs shaders than see the code below the options definition optionGroups = { - { id = 'gfx', name = Spring.I18N('ui.settings.group.graphics'), numOptions = 0 }, - { id = 'ui', name = Spring.I18N('ui.settings.group.interface'), numOptions = 0 }, - { id = 'game', name = Spring.I18N('ui.settings.group.game'), numOptions = 0 }, - { id = 'control', name = Spring.I18N('ui.settings.group.control'), numOptions = 0 }, - { id = 'sound', name = Spring.I18N('ui.settings.group.audio'), numOptions = 0 }, - { id = 'notif', name = Spring.I18N('ui.settings.group.notifications'), numOptions = 0 }, - { id = 'accessibility', name = Spring.I18N('ui.settings.group.accessibility'), numOptions = 0 }, - { id = 'custom', name = Spring.I18N('ui.settings.group.custom'), numOptions = 0 }, - { id = 'dev', name = Spring.I18N('ui.settings.group.dev'), numOptions = 0 }, + { id = 'gfx', name = I18N('ui.settings.group.graphics'), numOptions = 0 }, + { id = 'ui', name = I18N('ui.settings.group.interface'), numOptions = 0 }, + { id = 'game', name = I18N('ui.settings.group.game'), numOptions = 0 }, + { id = 'control', name = I18N('ui.settings.group.control'), numOptions = 0 }, + { id = 'sound', name = I18N('ui.settings.group.audio'), numOptions = 0 }, + { id = 'notif', name = I18N('ui.settings.group.notifications'), numOptions = 0 }, + { id = 'accessibility', name = I18N('ui.settings.group.accessibility'), numOptions = 0 }, + { id = 'custom', name = I18N('ui.settings.group.custom'), numOptions = 0 }, + { id = 'dev', name = I18N('ui.settings.group.dev'), numOptions = 0 }, } if not currentGroupTab then @@ -2521,7 +2521,7 @@ function init() options = { --GFX - { id = "preset", group = "gfx", category = types.basic, name = Spring.I18N('ui.settings.option.preset'), type = "select", options = presetNames, + { id = "preset", group = "gfx", category = types.basic, name = I18N('ui.settings.option.preset'), type = "select", options = presetNames, onload = function(i) local preset = Spring.GetConfigString('graphicsPreset', 'custom') local configSettingValues = { 'lowest', 'low', 'medium', 'high', 'ultra', 'custom' } @@ -2555,9 +2555,9 @@ function init() manualChange = true end, }, - { id = "label_gfx_screen", group = "gfx", name = Spring.I18N('ui.settings.option.label_screen'), category = types.basic }, + { id = "label_gfx_screen", group = "gfx", name = I18N('ui.settings.option.label_screen'), category = types.basic }, { id = "label_gfx_screen_spacer", group = "gfx", category = types.basic }, - { id = "display", group = "gfx", category = types.basic, name = Spring.I18N('ui.settings.option.display'), type = "select", options = displayNames, value = currentDisplay, + { id = "display", group = "gfx", category = types.basic, name = I18N('ui.settings.option.display'), type = "select", options = displayNames, value = currentDisplay, onchange = function(i, value) --currentDisplay = value selectedDisplay = value @@ -2580,7 +2580,7 @@ function init() forceUpdate = true end, }, - { id = "resolution", group = "gfx", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.resolution'), type = "select", options = resolutionNames, value = Spring.GetConfigInt('SelectedScreenMode', 1), description = Spring.I18N('ui.settings.option.resolution_descr'), + { id = "resolution", group = "gfx", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.resolution'), type = "select", options = resolutionNames, value = Spring.GetConfigInt('SelectedScreenMode', 1), description = I18N('ui.settings.option.resolution_descr'), onload = function(i, value) -- FIXME: disabled for now due to "Now whenever i do fullscreen or borderless the game will go to monitor 2 regardless of the chosen option. (I want the game on monitor 1)." --if Spring.GetConfigInt('SelectedScreenMode', -1) >= 1 then -- chobby sets SelectedScreenMode to -1 when it changes game window mode @@ -2602,22 +2602,22 @@ function init() end end, }, - { id = "dualmode_enabled", group = "gfx", category = types.dev, name = Spring.I18N('ui.settings.option.dualmode'), type = "bool", value = Spring.GetConfigInt("DualScreenMode"), description = Spring.I18N('ui.settings.option.dualmode_enabled_descr'), + { id = "dualmode_enabled", group = "gfx", category = types.dev, name = I18N('ui.settings.option.dualmode'), type = "bool", value = Spring.GetConfigInt("DualScreenMode"), description = I18N('ui.settings.option.dualmode_enabled_descr'), onchange = function(_, value) Spring.SetConfigInt("DualScreenMode", value and 1 or 0) end, }, - { id = "dualmode_left", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.dualmode_left'), type = "bool", value = Spring.GetConfigInt("DualScreenMiniMapOnLeft"), description = Spring.I18N('ui.settings.option.dualmode_left_descr'), + { id = "dualmode_left", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.dualmode_left'), type = "bool", value = Spring.GetConfigInt("DualScreenMiniMapOnLeft"), description = I18N('ui.settings.option.dualmode_left_descr'), onchange = function(_, value) Spring.SetConfigInt("DualScreenMiniMapOnLeft", value and 1 or 0) end, }, - { id = "dualmode_minimap_aspectratio", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.dualmode_minimap_aspectratio'), type = "bool", value = Spring.GetConfigInt("DualScreenMiniMapAspectRatio"), description = Spring.I18N('ui.settings.option.dualmode_minimap_aspectratio_descr'), + { id = "dualmode_minimap_aspectratio", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.dualmode_minimap_aspectratio'), type = "bool", value = Spring.GetConfigInt("DualScreenMiniMapAspectRatio"), description = I18N('ui.settings.option.dualmode_minimap_aspectratio_descr'), onchange = function(_, value) Spring.SetConfigInt("DualScreenMiniMapAspectRatio", value and 1 or 0) end, }, - { id = "vsync", group = "gfx", category = types.basic, name = Spring.I18N('ui.settings.option.vsync'), type = "select", options = { Spring.I18N('ui.settings.option.select_off'), Spring.I18N('ui.settings.option.select_enabled'), Spring.I18N('ui.settings.option.select_adaptive')}, value = 2, description = Spring.I18N('ui.settings.option.vsync_descr'), + { id = "vsync", group = "gfx", category = types.basic, name = I18N('ui.settings.option.vsync'), type = "select", options = { I18N('ui.settings.option.select_off'), I18N('ui.settings.option.select_enabled'), I18N('ui.settings.option.select_adaptive')}, value = 2, description = I18N('ui.settings.option.vsync_descr'), onload = function(i) local vsync = Spring.GetConfigInt("VSyncGame", -1) if vsync > 0 then @@ -2639,7 +2639,7 @@ function init() Spring.SetConfigInt("VSyncGame", vsync) -- stored here as assurance cause lobby/game also changes vsync when idle and lobby could think game has set vsync 4 after a hard crash end, }, - { id = "vsync_fraction", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.vsync_fraction'), min = 1, max = 4, step = 1, type = "slider", value = Spring.GetConfigInt("VSyncFraction", 1), description = Spring.I18N('ui.settings.option.vsync_fraction_descr'), + { id = "vsync_fraction", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.vsync_fraction'), min = 1, max = 4, step = 1, type = "slider", value = Spring.GetConfigInt("VSyncFraction", 1), description = I18N('ui.settings.option.vsync_fraction_descr'), onchange = function(i, value) Spring.SetConfigInt("VSyncFraction", value) local vsync = Spring.GetConfigInt("VSyncGame", -1) @@ -2649,14 +2649,14 @@ function init() end, }, - { id = "limitoffscreenfps", group = "gfx", category = types.advanced, widget = "Limit idle FPS", name = Spring.I18N('ui.settings.option.limitoffscreenfps'), type = "bool", value = GetWidgetToggleValue("Limit idle FPS"), description = Spring.I18N('ui.settings.option.limitoffscreenfps_descr') }, - { id = "limitidlefps", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.limitidlefps'), type = "bool", value = (Spring.GetConfigInt("LimitIdleFps", 0) == 1), description = Spring.I18N('ui.settings.option.limitidlefps_descr'), + { id = "limitoffscreenfps", group = "gfx", category = types.advanced, widget = "Limit idle FPS", name = I18N('ui.settings.option.limitoffscreenfps'), type = "bool", value = GetWidgetToggleValue("Limit idle FPS"), description = I18N('ui.settings.option.limitoffscreenfps_descr') }, + { id = "limitidlefps", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.limitidlefps'), type = "bool", value = (Spring.GetConfigInt("LimitIdleFps", 0) == 1), description = I18N('ui.settings.option.limitidlefps_descr'), onchange = function(i, value) Spring.SetConfigInt("LimitIdleFps", (value and 1 or 0)) end, }, - { id = "msaa", group = "gfx", category = types.basic, name = Spring.I18N('ui.settings.option.msaa'), type = "select", options = { Spring.I18N('ui.settings.option.select_off'), 'x2', 'x4', 'x8'}, restart = true, value = tonumber(Spring.GetConfigInt("MSAALevel", 0) or 0), description = Spring.I18N('ui.settings.option.msaa_descr'), + { id = "msaa", group = "gfx", category = types.basic, name = I18N('ui.settings.option.msaa'), type = "select", options = { I18N('ui.settings.option.select_off'), 'x2', 'x4', 'x8'}, restart = true, value = tonumber(Spring.GetConfigInt("MSAALevel", 0) or 0), description = I18N('ui.settings.option.msaa_descr'), onload = function(i) local msaa = tonumber(Spring.GetConfigInt("MSAALevel", 0) or 0) if msaa <= 0 then @@ -2681,13 +2681,13 @@ function init() end, }, - { id = "supersampling", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.supersampling'), type = "bool", restart = false, value = (Spring.GetConfigFloat("MinSampleShadingRate", 0.0) == 1.0), description = Spring.I18N('ui.settings.option.supersampling_descr'), + { id = "supersampling", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.supersampling'), type = "bool", restart = false, value = (Spring.GetConfigFloat("MinSampleShadingRate", 0.0) == 1.0), description = I18N('ui.settings.option.supersampling_descr'), onchange = function(i, value) Spring.SetConfigFloat("MinSampleShadingRate", (value and 1.0 or 0.0)) end, }, - { id = "cas_sharpness", group = "gfx", category = types.advanced, name = Spring.I18N('ui.settings.option.cas_sharpness'), min = 0.5, max = 1.1, step = 0.01, type = "slider", value = 1.0, description = Spring.I18N('ui.settings.option.cas_sharpness_descr'), + { id = "cas_sharpness", group = "gfx", category = types.advanced, name = I18N('ui.settings.option.cas_sharpness'), min = 0.5, max = 1.1, step = 0.01, type = "slider", value = 1.0, description = I18N('ui.settings.option.cas_sharpness_descr'), onload = function(i) loadWidgetData("Contrast Adaptive Sharpen", "cas_sharpness", { 'SHARPNESS' }) end, @@ -2699,8 +2699,8 @@ function init() end, }, - { id = "sepiatone", group = "gfx", category = types.advanced, widget = "Sepia Tone", name = Spring.I18N('ui.settings.option.sepiatone'), type = "bool", value = GetWidgetToggleValue("Sepia Tone") }, - { id = "sepiatone_gamma", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sepiatone_gamma'), min = 0.1, max = 0.9, step = 0.02, type = "slider", value = 0.5, + { id = "sepiatone", group = "gfx", category = types.advanced, widget = "Sepia Tone", name = I18N('ui.settings.option.sepiatone'), type = "bool", value = GetWidgetToggleValue("Sepia Tone") }, + { id = "sepiatone_gamma", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.sepiatone_gamma'), min = 0.1, max = 0.9, step = 0.02, type = "slider", value = 0.5, onload = function(i) loadWidgetData("Sepia Tone", "sepiatone_gamma", { 'gamma' }) end, @@ -2708,7 +2708,7 @@ function init() saveOptionValue('Sepia Tone', 'sepia', 'setGamma', { 'gamma' }, value) end, }, - { id = "sepiatone_saturation", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sepiatone_saturation'), min = 0, max = 1, step = 0.02, type = "slider", value = 0.5, + { id = "sepiatone_saturation", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.sepiatone_saturation'), min = 0, max = 1, step = 0.02, type = "slider", value = 0.5, onload = function(i) loadWidgetData("Sepia Tone", "sepiatone_saturation", { 'saturation' }) end, @@ -2716,7 +2716,7 @@ function init() saveOptionValue('Sepia Tone', 'sepia', 'setSaturation', { 'saturation' }, value) end, }, - { id = "sepiatone_contrast", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sepiatone_contrast'), min = 0.1, max = 0.9, step = 0.02, type = "slider", value = 0.5, + { id = "sepiatone_contrast", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.sepiatone_contrast'), min = 0.1, max = 0.9, step = 0.02, type = "slider", value = 0.5, onload = function(i) loadWidgetData("Sepia Tone", "sepiatone_contrast", { 'contrast' }) end, @@ -2724,7 +2724,7 @@ function init() saveOptionValue('Sepia Tone', 'sepia', 'setContrast', { 'contrast' }, value) end, }, - { id = "sepiatone_sepia", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sepiatone_sepia'), min = 0, max = 0.5, step = 0.02, type = "slider", value = 0.5, description = Spring.I18N('ui.settings.option.sepiatone_sepia_descr'), + { id = "sepiatone_sepia", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.sepiatone_sepia'), min = 0, max = 0.5, step = 0.02, type = "slider", value = 0.5, description = I18N('ui.settings.option.sepiatone_sepia_descr'), onload = function(i) loadWidgetData("Sepia Tone", "sepiatone_sepia", { 'sepia' }) end, @@ -2732,7 +2732,7 @@ function init() saveOptionValue('Sepia Tone', 'sepia', 'setSepia', { 'sepia' }, value) end, }, - { id = "sepiatone_shadeui", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sepiatone_shadeui'), type = "bool", value = 0, + { id = "sepiatone_shadeui", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.sepiatone_shadeui'), type = "bool", value = 0, onload = function(i) loadWidgetData("Sepia Tone", "sepiatone_shadeui", { 'shadeUI' }) end, @@ -2742,18 +2742,18 @@ function init() }, - { id = "label_gfx_lighting", group = "gfx", name = Spring.I18N('ui.settings.option.label_lighting'), category = types.basic }, + { id = "label_gfx_lighting", group = "gfx", name = I18N('ui.settings.option.label_lighting'), category = types.basic }, { id = "label_gfx_lighting_spacer", group = "gfx", category = types.basic }, - { id = "advmapshading", group = "gfx", category = types.basic, name = Spring.I18N('ui.settings.option.advmapshading'), type = "bool", value = (Spring.GetConfigInt("AdvMapShading", 1) == 1), description = Spring.I18N('ui.settings.option.advmapshading_descr'), + { id = "advmapshading", group = "gfx", category = types.basic, name = I18N('ui.settings.option.advmapshading'), type = "bool", value = (Spring.GetConfigInt("AdvMapShading", 1) == 1), description = I18N('ui.settings.option.advmapshading_descr'), onchange = function(i, value) Spring.SetConfigInt("AdvMapShading", (value and 1 or 0)) Spring.SendCommands("advmapshading "..(value and '1' or '0')) end, }, - { id = "cusgl4", group = "gfx", name = Spring.I18N('ui.settings.option.cus'), category = types.basic, type = "bool", value = (Spring.GetConfigInt("cus2", 1) == 1), description = Spring.I18N('ui.settings.option.cus_descr'), + { id = "cusgl4", group = "gfx", name = I18N('ui.settings.option.cus'), category = types.basic, type = "bool", value = (Spring.GetConfigInt("cus2", 1) == 1), description = I18N('ui.settings.option.cus_descr'), onchange = function(i, value) if value == 0.5 then Spring.SendCommands("luarules disablecusgl4") @@ -2764,21 +2764,21 @@ function init() end, }, - { id = "shadowslider", group = "gfx", category = types.basic, name = Spring.I18N('ui.settings.option.shadowslider'), type = "select", options = { Spring.I18N('ui.settings.option.select_off'), Spring.I18N('ui.settings.option.select_lowest'), Spring.I18N('ui.settings.option.select_low'), Spring.I18N('ui.settings.option.select_medium'), Spring.I18N('ui.settings.option.select_high'), Spring.I18N('ui.settings.option.select_ultra')}, value = Spring.GetConfigInt("ShadowQuality", 3)+1, description = Spring.I18N('ui.settings.option.shadowslider_descr'), + { id = "shadowslider", group = "gfx", category = types.basic, name = I18N('ui.settings.option.shadowslider'), type = "select", options = { I18N('ui.settings.option.select_off'), I18N('ui.settings.option.select_lowest'), I18N('ui.settings.option.select_low'), I18N('ui.settings.option.select_medium'), I18N('ui.settings.option.select_high'), I18N('ui.settings.option.select_ultra')}, value = Spring.GetConfigInt("ShadowQuality", 3)+1, description = I18N('ui.settings.option.shadowslider_descr'), onchange = function(i, value) Spring.SetConfigInt("ShadowQuality", value - 1) adjustShadowQuality() end, }, - { id = "shadows_opacity", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.shadows_opacity'), type = "slider", min = 0.3, max = 1, step = 0.01, value = gl.GetSun("shadowDensity"), description = '', + { id = "shadows_opacity", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.shadows_opacity'), type = "slider", min = 0.3, max = 1, step = 0.01, value = gl.GetSun("shadowDensity"), description = '', onchange = function(i, value) Spring.SetSunLighting({ groundShadowDensity = value, modelShadowDensity = value }) end, }, - { id = "ssao", group = "gfx", category = types.basic, widget = "SSAO", name = Spring.I18N('ui.settings.option.ssao'), type = "bool", value = GetWidgetToggleValue("SSAO"), description = Spring.I18N('ui.settings.option.ssao_descr') }, - { id = "ssao_strength", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.ssao_strength'), type = "slider", min = 5, max = 11, step = 1, value = 8, description = '', + { id = "ssao", group = "gfx", category = types.basic, widget = "SSAO", name = I18N('ui.settings.option.ssao'), type = "bool", value = GetWidgetToggleValue("SSAO"), description = I18N('ui.settings.option.ssao_descr') }, + { id = "ssao_strength", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.ssao_strength'), type = "slider", min = 5, max = 11, step = 1, value = 8, description = '', onload = function(i) loadWidgetData("SSAO", "ssao_strength", { 'strength' }) end, @@ -2786,7 +2786,7 @@ function init() saveOptionValue('SSAO', 'ssao', 'setStrength', { 'strength' }, value) end, }, - { id = "ssao_quality", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.ssao_quality'), type = "select", options = { Spring.I18N('ui.settings.option.select_low'), Spring.I18N('ui.settings.option.select_medium'), Spring.I18N('ui.settings.option.select_high')}, value = (WG['ssao'] ~= nil and WG['ssao'].getPreset() or 2), description = Spring.I18N('ui.settings.option.ssao_quality_descr'), + { id = "ssao_quality", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.ssao_quality'), type = "select", options = { I18N('ui.settings.option.select_low'), I18N('ui.settings.option.select_medium'), I18N('ui.settings.option.select_high')}, value = (WG['ssao'] ~= nil and WG['ssao'].getPreset() or 2), description = I18N('ui.settings.option.ssao_quality_descr'), onload = function(i) if widgetHandler.configData["SSAO"] ~= nil and widgetHandler.configData["SSAO"].preset ~= nil then options[getOptionByID('ssao_quality')].value = widgetHandler.configData["SSAO"].preset @@ -2797,8 +2797,8 @@ function init() end, }, - { id = "bloomdeferred", group = "gfx", category = types.basic, widget = "Bloom Shader Deferred", name = Spring.I18N('ui.settings.option.bloomdeferred'), type = "bool", value = GetWidgetToggleValue("Bloom Shader Deferred"), description = Spring.I18N('ui.settings.option.bloomdeferred_descr') }, - { id = "bloomdeferredbrightness", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.bloomdeferredbrightness'), type = "slider", min = 0.4, max = 1.4, step = 0.05, value = 0.9, description = '', + { id = "bloomdeferred", group = "gfx", category = types.basic, widget = "Bloom Shader Deferred", name = I18N('ui.settings.option.bloomdeferred'), type = "bool", value = GetWidgetToggleValue("Bloom Shader Deferred"), description = I18N('ui.settings.option.bloomdeferred_descr') }, + { id = "bloomdeferredbrightness", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.bloomdeferredbrightness'), type = "slider", min = 0.4, max = 1.4, step = 0.05, value = 0.9, description = '', onload = function(i) loadWidgetData("Bloom Shader Deferred", "bloomdeferredbrightness", { 'glowAmplifier' }) end, @@ -2806,7 +2806,7 @@ function init() saveOptionValue('Bloom Shader Deferred', 'bloomdeferred', 'setBrightness', { 'glowAmplifier' }, value) end, }, - { id = "bloomdeferred_quality", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.bloomdeferred_quality'), type = "select", options = { Spring.I18N('ui.settings.option.select_low'), Spring.I18N('ui.settings.option.select_medium'), Spring.I18N('ui.settings.option.select_high')}, value = (WG['bloomdeferred'] ~= nil and WG['bloomdeferred'].getPreset() or 2), description = Spring.I18N('ui.settings.option.bloomdeferred_quality_descr'), + { id = "bloomdeferred_quality", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.bloomdeferred_quality'), type = "select", options = { I18N('ui.settings.option.select_low'), I18N('ui.settings.option.select_medium'), I18N('ui.settings.option.select_high')}, value = (WG['bloomdeferred'] ~= nil and WG['bloomdeferred'].getPreset() or 2), description = I18N('ui.settings.option.bloomdeferred_quality_descr'), onload = function(i) if widgetHandler.configData["Bloom Shader Deferred"] ~= nil and widgetHandler.configData["Bloom Shader Deferred"].preset ~= nil then options[getOptionByID('bloomdeferred_quality')].value = widgetHandler.configData["Bloom Shader Deferred"].preset @@ -2817,7 +2817,7 @@ function init() end, }, - { id = "lighteffects", group = "gfx", category = types.basic, name = Spring.I18N('ui.settings.option.lighteffects'), type = "bool", value = GetWidgetToggleValue("Deferred rendering GL4"), description = Spring.I18N('ui.settings.option.lighteffects_descr'), + { id = "lighteffects", group = "gfx", category = types.basic, name = I18N('ui.settings.option.lighteffects'), type = "bool", value = GetWidgetToggleValue("Deferred rendering GL4"), description = I18N('ui.settings.option.lighteffects_descr'), onload = function(i) end, onchange = function(i, value) @@ -2828,7 +2828,7 @@ function init() end end, }, - { id = "lighteffects_headlights", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.lighteffects_headlights'), type = "bool", value = Spring.GetConfigInt("headlights", 1) == 1, description = Spring.I18N('ui.settings.option.lighteffects_headlights_descr'), + { id = "lighteffects_headlights", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.lighteffects_headlights'), type = "bool", value = Spring.GetConfigInt("headlights", 1) == 1, description = I18N('ui.settings.option.lighteffects_headlights_descr'), onchange = function(i, value) Spring.SetConfigInt("headlights", value and 1 or 0) if widgetHandler.orderList["Deferred rendering GL4"] ~= nil then @@ -2837,7 +2837,7 @@ function init() end end, }, - { id = "lighteffects_buildlights", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.lighteffects_buildlights'), type = "bool", value = Spring.GetConfigInt("buildlights", 1) == 1, description = Spring.I18N('ui.settings.option.lighteffects_buildlights_descr'), + { id = "lighteffects_buildlights", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.lighteffects_buildlights'), type = "bool", value = Spring.GetConfigInt("buildlights", 1) == 1, description = I18N('ui.settings.option.lighteffects_buildlights_descr'), onchange = function(i, value) Spring.SetConfigInt("buildlights", value and 1 or 0) if widgetHandler.orderList["Deferred rendering GL4"] ~= nil then @@ -2846,7 +2846,7 @@ function init() end end, }, - { id = "lighteffects_brightness", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.lighteffects_brightness'), min = 0.4, max = 1.5, step = 0.05, type = "slider", value = 1, description = Spring.I18N('ui.settings.option.lighteffects_brightness_descr'), + { id = "lighteffects_brightness", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.lighteffects_brightness'), min = 0.4, max = 1.5, step = 0.05, type = "slider", value = 1, description = I18N('ui.settings.option.lighteffects_brightness_descr'), onload = function(i) loadWidgetData("Deferred rendering GL4", "lighteffects_brightness", { 'intensityMultiplier' }) end, @@ -2854,7 +2854,7 @@ function init() saveOptionValue('Deferred rendering GL4', 'lightsgl4', 'IntensityMultiplier', { 'intensityMultiplier' }, value) end, }, - { id = "lighteffects_radius", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.lighteffects_radius'), min = 0.4, max = 1.2, step = 0.05, type = "slider", value = 1, description = Spring.I18N('ui.settings.option.lighteffects_radius_descr'), + { id = "lighteffects_radius", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.lighteffects_radius'), min = 0.4, max = 1.2, step = 0.05, type = "slider", value = 1, description = I18N('ui.settings.option.lighteffects_radius_descr'), onload = function(i) loadWidgetData("Deferred rendering GL4", "lighteffects_radius", { 'radiusMultiplier' }) end, @@ -2863,7 +2863,7 @@ function init() end, }, - { id = "lighteffects_screenspaceshadows", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.lighteffects_screenspaceshadows'), min = 0, max = 4, step = 1, type = "slider", value = 2, description = Spring.I18N('ui.settings.option.lighteffects_screenspaceshadows_descr'), + { id = "lighteffects_screenspaceshadows", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.lighteffects_screenspaceshadows'), min = 0, max = 4, step = 1, type = "slider", value = 2, description = I18N('ui.settings.option.lighteffects_screenspaceshadows_descr'), onload = function(i) loadWidgetData("Deferred rendering GL4", "lighteffects_screenspaceshadows", { 'screenSpaceShadows' }) end, @@ -2872,9 +2872,9 @@ function init() end, }, - { id = "distortioneffects", group = "gfx", category = types.basic, widget = "Distortion GL4", name = Spring.I18N('ui.settings.option.distortioneffects'), type = "bool", value = GetWidgetToggleValue("Distortion GL4"), description = Spring.I18N('ui.settings.option.distortioneffects_descr') }, + { id = "distortioneffects", group = "gfx", category = types.basic, widget = "Distortion GL4", name = I18N('ui.settings.option.distortioneffects'), type = "bool", value = GetWidgetToggleValue("Distortion GL4"), description = I18N('ui.settings.option.distortioneffects_descr') }, - { id = "darkenmap", group = "gfx", category = types.advanced, name = Spring.I18N('ui.settings.option.darkenmap'), min = 0, max = 0.33, step = 0.01, type = "slider", value = 0, description = Spring.I18N('ui.settings.option.darkenmap_descr'), + { id = "darkenmap", group = "gfx", category = types.advanced, name = I18N('ui.settings.option.darkenmap'), min = 0, max = 0.33, step = 0.01, type = "slider", value = 0, description = I18N('ui.settings.option.darkenmap_descr'), onload = function(i) loadWidgetData("Darken map", "darkenmap", { 'darknessvalue' }) end, @@ -2883,17 +2883,17 @@ function init() end, }, - { id = "label_gfx_environment", group = "gfx", name = Spring.I18N('ui.settings.option.label_environment'), category = types.basic }, + { id = "label_gfx_environment", group = "gfx", name = I18N('ui.settings.option.label_environment'), category = types.basic }, { id = "label_gfx_environment_spacer", group = "gfx", category = types.basic }, - { id = "featuredrawdist", group = "gfx", category = types.advanced, name = Spring.I18N('ui.settings.option.featuredrawdist'), type = "slider", min = 2500, max = 40000, step = 500, value = tonumber(Spring.GetConfigInt("FeatureDrawDistance", 10000)), description = Spring.I18N('ui.settings.option.featuredrawdist_descr'), + { id = "featuredrawdist", group = "gfx", category = types.advanced, name = I18N('ui.settings.option.featuredrawdist'), type = "slider", min = 2500, max = 40000, step = 500, value = tonumber(Spring.GetConfigInt("FeatureDrawDistance", 10000)), description = I18N('ui.settings.option.featuredrawdist_descr'), onchange = function(i, value) Spring.SetConfigInt("FeatureFadeDistance", math.floor(value * 0.8)) Spring.SetConfigInt("FeatureDrawDistance", value) end, }, - { id = "losopacity", group = "gfx", category = types.advanced, name = Spring.I18N('ui.settings.option.lineofsight')..widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.losopacity'), type = "slider", min = 0.01, max = 1, step = 0.01, value = (WG['los'] ~= nil and WG['los'].getOpacity ~= nil and WG['los'].getOpacity()) or 1, description = '', + { id = "losopacity", group = "gfx", category = types.advanced, name = I18N('ui.settings.option.lineofsight')..widgetOptionColor .. " " .. I18N('ui.settings.option.losopacity'), type = "slider", min = 0.01, max = 1, step = 0.01, value = (WG['los'] ~= nil and WG['los'].getOpacity ~= nil and WG['los'].getOpacity()) or 1, description = '', onload = function(i) loadWidgetData("LOS colors", "losopacity", { 'opacity' }) end, @@ -2902,7 +2902,7 @@ function init() end, }, - { id = "water", group = "gfx", category = types.basic, name = Spring.I18N('ui.settings.option.water'), type = "select", options = { Spring.I18N('ui.settings.option.select_low'), Spring.I18N('ui.settings.option.select_high') }, value = desiredWaterValue == 4 and 2 or 1, + { id = "water", group = "gfx", category = types.basic, name = I18N('ui.settings.option.water'), type = "select", options = { I18N('ui.settings.option.select_low'), I18N('ui.settings.option.select_high') }, value = desiredWaterValue == 4 and 2 or 1, onload = function(i) end, onchange = function(i, value) @@ -2915,9 +2915,9 @@ function init() end, }, - { id = "mapedgeextension", group = "gfx", category = types.advanced, widget = "Map Edge Extension", name = Spring.I18N('ui.settings.option.mapedgeextension'), type = "bool", value = GetWidgetToggleValue("Map Edge Extension"), description = Spring.I18N('ui.settings.option.mapedgeextension_descr') }, + { id = "mapedgeextension", group = "gfx", category = types.advanced, widget = "Map Edge Extension", name = I18N('ui.settings.option.mapedgeextension'), type = "bool", value = GetWidgetToggleValue("Map Edge Extension"), description = I18N('ui.settings.option.mapedgeextension_descr') }, - { id = "mapedgeextension_brightness", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.mapedgeextension_brightness'), min = 0.2, max = 1, step = 0.01, type = "slider", value = 0.3, description = '', + { id = "mapedgeextension_brightness", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.mapedgeextension_brightness'), min = 0.2, max = 1, step = 0.01, type = "slider", value = 0.3, description = '', onload = function(i) loadWidgetData("Map Edge Extension", "mapedgeextension_brightness", { 'brightness' }) end, @@ -2925,7 +2925,7 @@ function init() saveOptionValue('Map Edge Extension', 'mapedgeextension', 'setBrightness', { 'brightness' }, value) end, }, - { id = "mapedgeextension_curvature", category = types.dev, group = "gfx", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.mapedgeextension_curvature'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.mapedgeextension_curvature_descr'), + { id = "mapedgeextension_curvature", category = types.dev, group = "gfx", name = widgetOptionColor .. " " .. I18N('ui.settings.option.mapedgeextension_curvature'), type = "bool", value = true, description = I18N('ui.settings.option.mapedgeextension_curvature_descr'), onload = function(i) loadWidgetData("Map Edge Extension", "mapedgeextension_curvature", { 'curvature' }) end, @@ -2934,8 +2934,8 @@ function init() end, }, - { id = "decalsgl4", group = "gfx", category = types.basic, widget = "Decals GL4", name = Spring.I18N('ui.settings.option.decalsgl4'), type = "bool", value = GetWidgetToggleValue("Decals GL4") }, - { id = "decalsgl4_lifetime", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.decalsgl4_lifetime'), min = 0.5, max = 8, step = 0.1, type = "slider", value = 1, description = Spring.I18N('ui.settings.option.decalsgl4_lifetime_descr'), + { id = "decalsgl4", group = "gfx", category = types.basic, widget = "Decals GL4", name = I18N('ui.settings.option.decalsgl4'), type = "bool", value = GetWidgetToggleValue("Decals GL4") }, + { id = "decalsgl4_lifetime", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.decalsgl4_lifetime'), min = 0.5, max = 8, step = 0.1, type = "slider", value = 1, description = I18N('ui.settings.option.decalsgl4_lifetime_descr'), onload = function(i) loadWidgetData("Decals GL4", "decalsgl4_lifetime", { 'lifeTimeMult' }) end, @@ -2943,15 +2943,15 @@ function init() saveOptionValue('Decals GL4', 'decalsgl4', 'SetLifeTimeMult', { 'lifeTimeMult' }, value) end, }, - { id = "decals", group = "gfx", category = types.basic, name = Spring.I18N('ui.settings.option.decals'), restart = true, min = 0, max = 3, step = 1, type = "slider", value = Spring.GetConfigInt("GroundDecals", 0), description = Spring.I18N('ui.settings.option.decals_descr'), + { id = "decals", group = "gfx", category = types.basic, name = I18N('ui.settings.option.decals'), restart = true, min = 0, max = 3, step = 1, type = "slider", value = Spring.GetConfigInt("GroundDecals", 0), description = I18N('ui.settings.option.decals_descr'), onchange = function(i, value) Spring.SetConfigInt("GroundDecals", value) Spring.SendCommands("GroundDecals " .. value) end, }, - { id = "grass", group = "gfx", category = types.basic, widget = "Map Grass GL4", name = Spring.I18N('ui.settings.option.grass'), type = "bool", value = GetWidgetToggleValue("Map Grass GL4"), description = Spring.I18N('ui.settings.option.grass_desc') }, - { id = "grassdistance", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.grassdistance'), type = "slider", min = 0.3, max = 1, step = 0.01, value = 1, description = Spring.I18N('ui.settings.option.grassdistance_desc'), + { id = "grass", group = "gfx", category = types.basic, widget = "Map Grass GL4", name = I18N('ui.settings.option.grass'), type = "bool", value = GetWidgetToggleValue("Map Grass GL4"), description = I18N('ui.settings.option.grass_desc') }, + { id = "grassdistance", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.grassdistance'), type = "slider", min = 0.3, max = 1, step = 0.01, value = 1, description = I18N('ui.settings.option.grassdistance_desc'), onload = function(i) loadWidgetData("Map Grass GL4", "grassdistance", { 'distanceMult' }) end, @@ -2960,7 +2960,7 @@ function init() end, }, - { id = "treewind", group = "gfx", category = types.dev, name = Spring.I18N('ui.settings.option.treewind'), type = "bool", value = tonumber(Spring.GetConfigInt("TreeWind", 1) or 1) == 1, description = Spring.I18N('ui.settings.option.treewind_descr'), + { id = "treewind", group = "gfx", category = types.dev, name = I18N('ui.settings.option.treewind'), type = "bool", value = tonumber(Spring.GetConfigInt("TreeWind", 1) or 1) == 1, description = I18N('ui.settings.option.treewind_descr'), onload = function(i) end, onchange = function(i, value) @@ -2969,8 +2969,8 @@ function init() end, }, - { id = "snow", group = "gfx", category = types.basic, widget = "Snow", name = Spring.I18N('ui.settings.option.snow'), type = "bool", value = GetWidgetToggleValue("Snow"), description = Spring.I18N('ui.settings.option.snow_descr') }, - { id = "snowmap", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.snowmap'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.snowmap_descr'), + { id = "snow", group = "gfx", category = types.basic, widget = "Snow", name = I18N('ui.settings.option.snow'), type = "bool", value = GetWidgetToggleValue("Snow"), description = I18N('ui.settings.option.snow_descr') }, + { id = "snowmap", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.snowmap'), type = "bool", value = true, description = I18N('ui.settings.option.snowmap_descr'), onload = function(i) loadWidgetData("Snow", "snowmap", { 'snowMaps', Game.mapName:lower() }) end, @@ -2978,7 +2978,7 @@ function init() saveOptionValue('Snow', 'snow', 'setSnowMap', { 'snowMaps', Game.mapName:lower() }, value) end, }, - { id = "snowautoreduce", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.snowautoreduce'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.snowautoreduce_descr'), + { id = "snowautoreduce", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.snowautoreduce'), type = "bool", value = true, description = I18N('ui.settings.option.snowautoreduce_descr'), onload = function(i) loadWidgetData("Snow", "snowautoreduce", { 'autoReduce' }) end, @@ -2986,7 +2986,7 @@ function init() saveOptionValue('Snow', 'snow', 'setAutoReduce', { 'autoReduce' }, value) end, }, - { id = "snowamount", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.snowamount'), type = "slider", min = 0.2, max = 3, step = 0.2, value = 1, description = Spring.I18N('ui.settings.option.snowamount_descr'), + { id = "snowamount", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.snowamount'), type = "slider", min = 0.2, max = 3, step = 0.2, value = 1, description = I18N('ui.settings.option.snowamount_descr'), onload = function(i) loadWidgetData("Snow", "snowamount", { 'customParticleMultiplier' }) end, @@ -2995,8 +2995,8 @@ function init() end, }, - { id = "clouds", group = "gfx", category = types.advanced, widget = "Volumetric Clouds", name = Spring.I18N('ui.settings.option.clouds'), type = "bool", value = GetWidgetToggleValue("Volumetric Clouds"), description = '' }, - { id = "clouds_opacity", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.clouds_opacity'), type = "slider", min = 0.2, max = 1.4, step = 0.05, value = 1, description = '', + { id = "clouds", group = "gfx", category = types.advanced, widget = "Volumetric Clouds", name = I18N('ui.settings.option.clouds'), type = "bool", value = GetWidgetToggleValue("Volumetric Clouds"), description = '' }, + { id = "clouds_opacity", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.clouds_opacity'), type = "slider", min = 0.2, max = 1.4, step = 0.05, value = 1, description = '', onload = function(i) loadWidgetData("Volumetric Clouds", "clouds_opacity", { 'opacityMult' }) end, @@ -3004,7 +3004,7 @@ function init() saveOptionValue('Volumetric Clouds', 'clouds', 'setOpacity', { 'opacityMult' }, value) end, }, - { id = "fogmult", group = "gfx", category = types.advanced, name = Spring.I18N('ui.settings.option.fog'), type = "slider", min = 0, max = 1, step = 0.01, value = Spring.GetConfigFloat("FogMult", 1), description = Spring.I18N('ui.settings.option.fogmult_descr'), + { id = "fogmult", group = "gfx", category = types.advanced, name = I18N('ui.settings.option.fog'), type = "slider", min = 0, max = 1, step = 0.01, value = Spring.GetConfigFloat("FogMult", 1), description = I18N('ui.settings.option.fogmult_descr'), onload = function(i) options[i].onchange(i, options[i].value) end, @@ -3018,10 +3018,10 @@ function init() end, }, - { id = "label_gfx_effects", group = "gfx", name = Spring.I18N('ui.settings.option.label_effects'), category = types.basic }, + { id = "label_gfx_effects", group = "gfx", name = I18N('ui.settings.option.label_effects'), category = types.basic }, { id = "label_gfx_effects_spacer", group = "gfx", category = types.basic }, - { id = "particles", group = "gfx", category = types.basic, name = Spring.I18N('ui.settings.option.particles'), type = "slider", min = 10000, max = 40000, step = 1000, value = tonumber(Spring.GetConfigInt("MaxParticles", 1) or 15000), description = Spring.I18N('ui.settings.option.particles_descr'), + { id = "particles", group = "gfx", category = types.basic, name = I18N('ui.settings.option.particles'), type = "slider", min = 10000, max = 40000, step = 1000, value = tonumber(Spring.GetConfigInt("MaxParticles", 1) or 15000), description = I18N('ui.settings.option.particles_descr'), onload = function(i) end, onchange = function(i, value) @@ -3030,8 +3030,8 @@ function init() end, }, - { id = "dof", group = "gfx", category = types.advanced, widget = "Depth of Field", name = Spring.I18N('ui.settings.option.dof'), type = "bool", value = GetWidgetToggleValue("Depth of Field"), description = Spring.I18N('ui.settings.option.dof_descr') }, - { id = "dof_autofocus", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.dof_autofocus'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.dof_autofocus_descr'), + { id = "dof", group = "gfx", category = types.advanced, widget = "Depth of Field", name = I18N('ui.settings.option.dof'), type = "bool", value = GetWidgetToggleValue("Depth of Field"), description = I18N('ui.settings.option.dof_descr') }, + { id = "dof_autofocus", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.dof_autofocus'), type = "bool", value = true, description = I18N('ui.settings.option.dof_autofocus_descr'), onload = function(i) loadWidgetData("Depth of Field", "dof_autofocus", { 'autofocus' }) end, @@ -3039,7 +3039,7 @@ function init() saveOptionValue('Depth of Field', 'dof', 'setAutofocus', { 'autofocus' }, value) end, }, - { id = "dof_fstop", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.dof_fstop'), type = "slider", min = 1, max = 6, step = 0.1, value = 2, description = Spring.I18N('ui.settings.option.dof_fstop_descr'), + { id = "dof_fstop", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.dof_fstop'), type = "slider", min = 1, max = 6, step = 0.1, value = 2, description = I18N('ui.settings.option.dof_fstop_descr'), onload = function(i) loadWidgetData("Depth of Field", "dof_fstop", { 'fStop' }) end, @@ -3048,13 +3048,13 @@ function init() end, }, - { id = "label_gfx_game", group = "gfx", name = Spring.I18N('ui.settings.option.label_game'), category = types.advanced }, + { id = "label_gfx_game", group = "gfx", name = I18N('ui.settings.option.label_game'), category = types.advanced }, { id = "label_gfx_game_spacer", group = "gfx", category = types.basic }, - { id = "resurrectionhalos", group = "gfx", category = types.advanced, widget = "Resurrection Halos GL4", name = Spring.I18N('ui.settings.option.resurrectionhalos'), type = "bool", value = GetWidgetToggleValue("Resurrection Halos GL4"), description = Spring.I18N('ui.settings.option.resurrectionhalos_descr') }, + { id = "resurrectionhalos", group = "gfx", category = types.advanced, widget = "Resurrection Halos GL4", name = I18N('ui.settings.option.resurrectionhalos'), type = "bool", value = GetWidgetToggleValue("Resurrection Halos GL4"), description = I18N('ui.settings.option.resurrectionhalos_descr') }, -- SOUND - { id = "snddevice", group = "sound", category = types.advanced, name = Spring.I18N('ui.settings.option.snddevice'), type = "select", restart = true, options = soundDevices, value = soundDevicesByName[Spring.GetConfigString("snd_device")], description = Spring.I18N('ui.settings.option.snddevice_descr'), + { id = "snddevice", group = "sound", category = types.advanced, name = I18N('ui.settings.option.snddevice'), type = "select", restart = true, options = soundDevices, value = soundDevicesByName[Spring.GetConfigString("snd_device")], description = I18N('ui.settings.option.snddevice_descr'), onchange = function(i, value) if options[i].options[options[i].value] == 'default' then Spring.SetConfigString("snd_device", '') @@ -3064,28 +3064,28 @@ function init() end, }, - { id = "sndvolmaster", group = "sound", category = types.basic, name = Spring.I18N('ui.settings.option.volume') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sndvolmaster'), type = "slider", min = 0, max = 80, step = 2, value = tonumber(Spring.GetConfigInt("snd_volmaster", 1) or 80), + { id = "sndvolmaster", group = "sound", category = types.basic, name = I18N('ui.settings.option.volume') .. widgetOptionColor .. " " .. I18N('ui.settings.option.sndvolmaster'), type = "slider", min = 0, max = 80, step = 2, value = tonumber(Spring.GetConfigInt("snd_volmaster", 1) or 80), onload = function(i) end, onchange = function(i, value) Spring.SetConfigInt("snd_volmaster", value) end, }, - { id = "sndvolgeneral", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sndvolgeneral'), type = "slider", min = 0, max = 100, step = 2, value = tonumber(Spring.GetConfigInt("snd_volgeneral", 1) or 100), + { id = "sndvolgeneral", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.sndvolgeneral'), type = "slider", min = 0, max = 100, step = 2, value = tonumber(Spring.GetConfigInt("snd_volgeneral", 1) or 100), onload = function(i) end, onchange = function(i, value) Spring.SetConfigInt("snd_volgeneral", value) end, }, - { id = "sndvolbattle", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sndvolbattle'), type = "slider", min = 0, max = 100, step = 2, value = tonumber(Spring.GetConfigInt("snd_volbattle_options", 100) or 100), + { id = "sndvolbattle", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.sndvolbattle'), type = "slider", min = 0, max = 100, step = 2, value = tonumber(Spring.GetConfigInt("snd_volbattle_options", 100) or 100), onload = function(i) end, onchange = function(i, value) Spring.SetConfigInt("snd_volbattle_options", value) end, }, - { id = "sndvolui", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sndvolui'), type = "slider", min = 0, max = 100, step = 2, value = tonumber(Spring.GetConfigInt("snd_volui", 1) or 100), + { id = "sndvolui", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.sndvolui'), type = "slider", min = 0, max = 100, step = 2, value = tonumber(Spring.GetConfigInt("snd_volui", 1) or 100), onload = function(i) end, onchange = function(i, value) @@ -3106,7 +3106,7 @@ function init() -- Spring.SetConfigInt("snd_volunitreply", value) -- end, --}, - { id = "console_chatvolume", group = "sound", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.console_chatvolume'), type = "slider", min = 0, max = 1, step = 0.01, value = (WG['chat'] ~= nil and WG['chat'].getChatVolume() or 0), description = Spring.I18N('ui.settings.option.console_chatvolume_descr'), + { id = "console_chatvolume", group = "sound", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.console_chatvolume'), type = "slider", min = 0, max = 1, step = 0.01, value = (WG['chat'] ~= nil and WG['chat'].getChatVolume() or 0), description = I18N('ui.settings.option.console_chatvolume_descr'), onload = function(i) loadWidgetData("Chat", "console_chatvolume", { 'sndChatFileVolume' }) end, @@ -3114,7 +3114,7 @@ function init() saveOptionValue('Chat', 'chat', 'setChatVolume', { 'sndChatFileVolume' }, value) end, }, - { id = "mapmarkvolume", group = "sound", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.console_mapmarkvolume'), type = "slider", min = 0, max = 1, step = 0.01, value = (WG['mapmarkping'] ~= nil and WG['mapmarkping'].getMapmarkVolume() or 0.6), description = Spring.I18N('ui.settings.option.console_mapmarkvolume_descr'), + { id = "mapmarkvolume", group = "sound", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.console_mapmarkvolume'), type = "slider", min = 0, max = 1, step = 0.01, value = (WG['mapmarkping'] ~= nil and WG['mapmarkping'].getMapmarkVolume() or 0.6), description = I18N('ui.settings.option.console_mapmarkvolume_descr'), onload = function(i) loadWidgetData("Chat", "mapmarkvolume", { 'volume' }) end, @@ -3122,7 +3122,7 @@ function init() saveOptionValue('Chat', 'mapmarkping', 'setMapmarkVolume', { 'volume' }, value) end, }, - { id = "sndvolmusic", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sndvolmusic'), type = "slider", min = 0, max = 99, step = 1, value = tonumber(Spring.GetConfigInt("snd_volmusic", 50) or 50), + { id = "sndvolmusic", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.sndvolmusic'), type = "slider", min = 0, max = 99, step = 1, value = tonumber(Spring.GetConfigInt("snd_volmusic", 50) or 50), onload = function(i) end, onchange = function(i, value) @@ -3134,13 +3134,13 @@ function init() end, }, - { id = "sndunitsound", group = "sound", category = types.advanced, name = Spring.I18N('ui.settings.option.sndunitsound'), type = "bool", value = (Spring.GetConfigInt("snd_unitsound", 1) == 1), description = Spring.I18N('ui.settings.option.sndunitsound_desc'), + { id = "sndunitsound", group = "sound", category = types.advanced, name = I18N('ui.settings.option.sndunitsound'), type = "bool", value = (Spring.GetConfigInt("snd_unitsound", 1) == 1), description = I18N('ui.settings.option.sndunitsound_desc'), onchange = function(i, value) Spring.SetConfigInt("snd_unitsound", (value and 1 or 0)) end, }, - { id = "sndairabsorption", group = "sound", category = types.advanced, name = Spring.I18N('ui.settings.option.sndairabsorption'), type = "slider", min = 0, max = 0.4, step = 0.01, value = tonumber(Spring.GetConfigFloat("snd_airAbsorption", .35) or .35), description = Spring.I18N('ui.settings.option.sndairabsorption_descr'), + { id = "sndairabsorption", group = "sound", category = types.advanced, name = I18N('ui.settings.option.sndairabsorption'), type = "slider", min = 0, max = 0.4, step = 0.01, value = tonumber(Spring.GetConfigFloat("snd_airAbsorption", .35) or .35), description = I18N('ui.settings.option.sndairabsorption_descr'), onload = function(i) end, onchange = function(i, value) @@ -3148,7 +3148,7 @@ function init() end, }, - { id = "sndzoomvolume", group = "sound", category = types.advanced, name = Spring.I18N('ui.settings.option.sndzoomvolume'), type = "slider", min = 0, max = 3, step = 0.01, value = tonumber(Spring.GetConfigFloat("snd_zoomVolume", 1.00) or 1.00), description = Spring.I18N('ui.settings.option.sndzoomvolume_descr'), + { id = "sndzoomvolume", group = "sound", category = types.advanced, name = I18N('ui.settings.option.sndzoomvolume'), type = "slider", min = 0, max = 3, step = 0.01, value = tonumber(Spring.GetConfigFloat("snd_zoomVolume", 1.00) or 1.00), description = I18N('ui.settings.option.sndzoomvolume_descr'), onload = function(i) end, onchange = function(i, value) @@ -3156,17 +3156,17 @@ function init() end, }, - { id = "muteoffscreen", group = "sound", category = types.advanced, name = Spring.I18N('ui.settings.option.muteoffscreen'), type = "bool", value = (Spring.GetConfigInt("muteOffscreen", 0) == 1), description = Spring.I18N('ui.settings.option.muteoffscreen_descr'), + { id = "muteoffscreen", group = "sound", category = types.advanced, name = I18N('ui.settings.option.muteoffscreen'), type = "bool", value = (Spring.GetConfigInt("muteOffscreen", 0) == 1), description = I18N('ui.settings.option.muteoffscreen_descr'), onchange = function(i, value) Spring.SetConfigInt("muteOffscreen", (value and 1 or 0)) end, }, - { id = "soundtrack", group = "sound", category = types.basic, name = Spring.I18N('ui.settings.option.label_soundtrack') }, + { id = "soundtrack", group = "sound", category = types.basic, name = I18N('ui.settings.option.label_soundtrack') }, { id = "soundtrack_spacer", group = "sound", category = types.basic }, - { id = "soundtrackNew", group = "sound", category = types.basic, name = Spring.I18N('ui.settings.option.soundtracknew'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackNew', 1) == 1, description = Spring.I18N('ui.settings.option.soundtracknew_descr'), + { id = "soundtrackNew", group = "sound", category = types.basic, name = I18N('ui.settings.option.soundtracknew'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackNew', 1) == 1, description = I18N('ui.settings.option.soundtracknew_descr'), onchange = function(i, value) Spring.SetConfigInt('UseSoundtrackNew', value and 1 or 0) if WG['music'] and WG['music'].RefreshTrackList then @@ -3175,7 +3175,7 @@ function init() end end }, - { id = "soundtrackRaptors", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.soundtrackraptors'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackRaptors', 0) == 1, description = Spring.I18N('ui.settings.option.soundtrackraptors_descr'), + { id = "soundtrackRaptors", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.soundtrackraptors'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackRaptors', 0) == 1, description = I18N('ui.settings.option.soundtrackraptors_descr'), onchange = function(i, value) Spring.SetConfigInt('UseSoundtrackRaptors', value and 1 or 0) if WG['music'] and WG['music'].RefreshTrackList then @@ -3184,7 +3184,7 @@ function init() end end }, - { id = "soundtrackScavengers", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.soundtrackscavengers'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackScavengers', 0) == 1, description = Spring.I18N('ui.settings.option.soundtrackscavengers_descr'), + { id = "soundtrackScavengers", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.soundtrackscavengers'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackScavengers', 0) == 1, description = I18N('ui.settings.option.soundtrackscavengers_descr'), onchange = function(i, value) Spring.SetConfigInt('UseSoundtrackScavengers', value and 1 or 0) if WG['music'] and WG['music'].RefreshTrackList then @@ -3193,7 +3193,7 @@ function init() end end }, - { id = "soundtrackAprilFools", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.soundtrackaprilfools'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackAprilFools', 1) == 1, description = Spring.I18N('ui.settings.option.soundtrackaprilfools_descr'), + { id = "soundtrackAprilFools", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.soundtrackaprilfools'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackAprilFools', 1) == 1, description = I18N('ui.settings.option.soundtrackaprilfools_descr'), onchange = function(i, value) Spring.SetConfigInt('UseSoundtrackAprilFools', value and 1 or 0) if WG['music'] and WG['music'].RefreshTrackList then @@ -3202,7 +3202,7 @@ function init() end end }, - { id = "soundtrackAprilFoolsPostEvent", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.soundtrackaprilfoolspostevent'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackAprilFoolsPostEvent', 0) == 1, description = Spring.I18N('ui.settings.option.soundtrackaprilfoolspostevent_descr'), + { id = "soundtrackAprilFoolsPostEvent", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.soundtrackaprilfoolspostevent'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackAprilFoolsPostEvent', 0) == 1, description = I18N('ui.settings.option.soundtrackaprilfoolspostevent_descr'), onchange = function(i, value) Spring.SetConfigInt('UseSoundtrackAprilFoolsPostEvent', value and 1 or 0) if WG['music'] and WG['music'].RefreshTrackList then @@ -3211,7 +3211,7 @@ function init() end end }, - { id = "soundtrackHalloween", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.soundtrackhalloween'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackHalloween', 1) == 1, description = Spring.I18N('ui.settings.option.soundtrackhalloween_descr'), + { id = "soundtrackHalloween", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.soundtrackhalloween'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackHalloween', 1) == 1, description = I18N('ui.settings.option.soundtrackhalloween_descr'), onchange = function(i, value) Spring.SetConfigInt('UseSoundtrackHalloween', value and 1 or 0) if WG['music'] and WG['music'].RefreshTrackList then @@ -3220,7 +3220,7 @@ function init() end end }, - { id = "soundtrackHalloweenPostEvent", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.soundtrackhalloweenpostevent'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackHalloweenPostEvent', 0) == 1, description = Spring.I18N('ui.settings.option.soundtrackhalloweenpostevent_descr'), + { id = "soundtrackHalloweenPostEvent", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.soundtrackhalloweenpostevent'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackHalloweenPostEvent', 0) == 1, description = I18N('ui.settings.option.soundtrackhalloweenpostevent_descr'), onchange = function(i, value) Spring.SetConfigInt('UseSoundtrackHalloweenPostEvent', value and 1 or 0) if WG['music'] and WG['music'].RefreshTrackList then @@ -3229,7 +3229,7 @@ function init() end end }, - { id = "soundtrackXmas", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.soundtrackxmas'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackXmas', 1) == 1, description = Spring.I18N('ui.settings.option.soundtrackxmas_descr'), + { id = "soundtrackXmas", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.soundtrackxmas'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackXmas', 1) == 1, description = I18N('ui.settings.option.soundtrackxmas_descr'), onchange = function(i, value) Spring.SetConfigInt('UseSoundtrackXmas', value and 1 or 0) if WG['music'] and WG['music'].RefreshTrackList then @@ -3238,7 +3238,7 @@ function init() end end }, - { id = "soundtrackXmasPostEvent", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.soundtrackxmaspostevent'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackXmasPostEvent', 0) == 1, description = Spring.I18N('ui.settings.option.soundtrackxmaspostevent_descr'), + { id = "soundtrackXmasPostEvent", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.soundtrackxmaspostevent'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackXmasPostEvent', 0) == 1, description = I18N('ui.settings.option.soundtrackxmaspostevent_descr'), onchange = function(i, value) Spring.SetConfigInt('UseSoundtrackXmasPostEvent', value and 1 or 0) if WG['music'] and WG['music'].RefreshTrackList then @@ -3247,7 +3247,7 @@ function init() end end }, - { id = "soundtrackCustom", group = "sound", category = types.advanced, name = Spring.I18N('ui.settings.option.soundtrackcustom'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackCustom', 1) == 1, description = Spring.I18N('ui.settings.option.soundtrackcustom_descr'), + { id = "soundtrackCustom", group = "sound", category = types.advanced, name = I18N('ui.settings.option.soundtrackcustom'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackCustom', 1) == 1, description = I18N('ui.settings.option.soundtrackcustom_descr'), onchange = function(i, value) Spring.SetConfigInt('UseSoundtrackCustom', value and 1 or 0) if WG['music'] and WG['music'].RefreshTrackList then @@ -3256,7 +3256,7 @@ function init() end end }, - { id = "soundtrackInterruption", group = "sound", category = types.basic, name = Spring.I18N('ui.settings.option.soundtrackinterruption'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackInterruption', 1) == 1, description = Spring.I18N('ui.settings.option.soundtrackinterruption_descr'), + { id = "soundtrackInterruption", group = "sound", category = types.basic, name = I18N('ui.settings.option.soundtrackinterruption'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackInterruption', 1) == 1, description = I18N('ui.settings.option.soundtrackinterruption_descr'), onchange = function(i, value) Spring.SetConfigInt('UseSoundtrackInterruption', value and 1 or 0) if WG['music'] and WG['music'].RefreshSettings then @@ -3264,7 +3264,7 @@ function init() end end }, - { id = "soundtrackFades", group = "sound", category = types.basic, name = Spring.I18N('ui.settings.option.soundtrackfades'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackFades', 1) == 1, description = Spring.I18N('ui.settings.option.soundtrackfades_descr'), + { id = "soundtrackFades", group = "sound", category = types.basic, name = I18N('ui.settings.option.soundtrackfades'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackFades', 1) == 1, description = I18N('ui.settings.option.soundtrackfades_descr'), onchange = function(i, value) Spring.SetConfigInt('UseSoundtrackFades', value and 1 or 0) if WG['music'] and WG['music'].RefreshSettings then @@ -3279,7 +3279,7 @@ function init() -- end, --}, - { id = "notifications_set", group = "notif", category = types.basic, name = Spring.I18N('ui.settings.option.notifications_set'), type = "select", options = {}, value = 1, + { id = "notifications_set", group = "notif", category = types.basic, name = I18N('ui.settings.option.notifications_set'), type = "select", options = {}, value = 1, onload = function(i) end, onchange = function(i, value) @@ -3300,7 +3300,7 @@ function init() -- saveOptionValue('Notifications', 'notifications', 'setTutorial', { 'tutorialMode' }, value) -- end, --}, - { id = "notifications_messages", group = "notif", name = Spring.I18N('ui.settings.option.notifications_messages'), category = types.basic, type = "bool", value = (WG['notifications'] ~= nil and WG['notifications'].getMessages()), description = Spring.I18N('ui.settings.option.notifications_messages_descr'), + { id = "notifications_messages", group = "notif", name = I18N('ui.settings.option.notifications_messages'), category = types.basic, type = "bool", value = (WG['notifications'] ~= nil and WG['notifications'].getMessages()), description = I18N('ui.settings.option.notifications_messages_descr'), onload = function(i) loadWidgetData("Notifications", "notifications_messages", { 'displayMessages' }) end, @@ -3308,7 +3308,7 @@ function init() saveOptionValue('Notifications', 'notifications', 'setMessages', { 'displayMessages' }, value) end, }, - { id = "notifications_spoken", group = "notif", name = Spring.I18N('ui.settings.option.notifications_spoken'), category = types.basic, type = "bool", value = (WG['notifications'] ~= nil and WG['notifications'].getSpoken()), description = Spring.I18N('ui.settings.option.notifications_spoken_descr'), + { id = "notifications_spoken", group = "notif", name = I18N('ui.settings.option.notifications_spoken'), category = types.basic, type = "bool", value = (WG['notifications'] ~= nil and WG['notifications'].getSpoken()), description = I18N('ui.settings.option.notifications_spoken_descr'), onload = function(i) loadWidgetData("Notifications", "notifications_spoken", { 'spoken' }) end, @@ -3316,7 +3316,7 @@ function init() saveOptionValue('Notifications', 'notifications', 'setSpoken', { 'spoken' }, value) end, }, - { id = "notifications_volume", group = "notif", category = types.basic, name = Spring.I18N('ui.settings.option.notifications_volume'), type = "slider", min = 0.05, max = 1, step = 0.05, value = 0.7, description = Spring.I18N('ui.settings.option.notifications_volume_descr'), + { id = "notifications_volume", group = "notif", category = types.basic, name = I18N('ui.settings.option.notifications_volume'), type = "slider", min = 0.05, max = 1, step = 0.05, value = 0.7, description = I18N('ui.settings.option.notifications_volume_descr'), onload = function(i) loadWidgetData("Notifications", "notifications_volume", { 'globalVolume' }) end, @@ -3324,7 +3324,7 @@ function init() saveOptionValue('Notifications', 'notifications', 'setVolume', { 'globalVolume' }, value) end, }, - { id = "notifications_substitute", group = "notif", category = types.advanced, name = Spring.I18N('ui.settings.option.notifications_substitute'), type = "bool", value = Spring.GetConfigInt('NotificationsSubstitute', 0) == 1, description = Spring.I18N('ui.settings.option.notifications_substitute_descr'), + { id = "notifications_substitute", group = "notif", category = types.advanced, name = I18N('ui.settings.option.notifications_substitute'), type = "bool", value = Spring.GetConfigInt('NotificationsSubstitute', 0) == 1, description = I18N('ui.settings.option.notifications_substitute_descr'), onchange = function(i, value) Spring.SetConfigInt('NotificationsSubstitute', value and 1 or 0) widgetHandler:DisableWidget("Notifications") @@ -3332,7 +3332,7 @@ function init() init() end }, - { id = "notifications_refresh", group = "notif", category = types.advanced, name = Spring.I18N('ui.settings.option.notifications_refresh'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.notifications_refresh_descr'), + { id = "notifications_refresh", group = "notif", category = types.advanced, name = I18N('ui.settings.option.notifications_refresh'), type = "bool", value = false, description = I18N('ui.settings.option.notifications_refresh_descr'), onchange = function(i, value) widgetHandler:DisableWidget("Notifications") widgetHandler:EnableWidget("Notifications") @@ -3341,14 +3341,14 @@ function init() }, - { id = "label_notif_messages", group = "notif", name = Spring.I18N('ui.settings.option.label_messages'), category = types.basic }, + { id = "label_notif_messages", group = "notif", name = I18N('ui.settings.option.label_messages'), category = types.basic }, { id = "label_notif_messages_spacer", group = "notif", category = types.basic }, -- CONTROL - { id = "label_ui_hotkeys", group = "control", name = Spring.I18N('ui.settings.option.label_hotkeys'), category = types.basic }, + { id = "label_ui_hotkeys", group = "control", name = I18N('ui.settings.option.label_hotkeys'), category = types.basic }, { id = "label_ui_hotkeys_spacer", group = "control", category = types.basic }, - { id = "keylayout", group = "control", category = types.basic, name = Spring.I18N('ui.settings.option.keylayout'), type = "select", options = keyLayouts.layouts, value = 1, description = Spring.I18N('ui.settings.option.keylayout_descr'), + { id = "keylayout", group = "control", category = types.basic, name = I18N('ui.settings.option.keylayout'), type = "select", options = keyLayouts.layouts, value = 1, description = I18N('ui.settings.option.keylayout_descr'), onload = function() local keyLayout = Spring.GetConfigString("KeyboardLayout") @@ -3375,7 +3375,7 @@ function init() end, }, - { id = "keybindings", group = "control", category = types.basic, name = Spring.I18N('ui.settings.option.keybindings'), type = "select", options = keyLayouts.keybindingLayouts, value = 1, description = Spring.I18N('ui.settings.option.keybindings_descr'), + { id = "keybindings", group = "control", category = types.basic, name = I18N('ui.settings.option.keybindings'), type = "select", options = keyLayouts.keybindingLayouts, value = 1, description = I18N('ui.settings.option.keybindings_descr'), onload = function() local keyFile = Spring.GetConfigString("KeybindingFile") local value = 1 @@ -3431,7 +3431,7 @@ function init() end, }, - { id = "gridmenu", group = "control", category = types.basic, name = Spring.I18N('ui.settings.option.gridmenu'), type = "bool", value = GetWidgetToggleValue("Grid menu"), description = Spring.I18N('ui.settings.option.gridmenu_descr'), + { id = "gridmenu", group = "control", category = types.basic, name = I18N('ui.settings.option.gridmenu'), type = "bool", value = GetWidgetToggleValue("Grid menu"), description = I18N('ui.settings.option.gridmenu_descr'), onchange = function(i, value) if value then widgetHandler:DisableWidget('Build menu') @@ -3443,21 +3443,21 @@ function init() init() end, }, - { id = "gridmenu_alwaysreturn", group = "control", category = types.advanced, name = Spring.I18N('ui.settings.option.gridmenu_alwaysreturn'), type = "bool", value = (WG['gridmenu'] ~= nil and WG['gridmenu'].getAlwaysReturn ~= nil and WG['gridmenu'].getAlwaysReturn()), description = Spring.I18N('ui.settings.option.gridmenu_alwaysreturn_descr'), + { id = "gridmenu_alwaysreturn", group = "control", category = types.advanced, name = I18N('ui.settings.option.gridmenu_alwaysreturn'), type = "bool", value = (WG['gridmenu'] ~= nil and WG['gridmenu'].getAlwaysReturn ~= nil and WG['gridmenu'].getAlwaysReturn()), description = I18N('ui.settings.option.gridmenu_alwaysreturn_descr'), onload = function() end, onchange = function(_, value) saveOptionValue('Grid menu', 'gridmenu', 'setAlwaysReturn', { 'alwaysReturn' }, value) end, }, - { id = "gridmenu_autoselectfirst", group = "control", category = types.advanced, name = Spring.I18N('ui.settings.option.gridmenu_autoselectfirst'), type = "bool", value = (WG['gridmenu'] ~= nil and WG['gridmenu'].getAutoSelectFirst ~= nil and WG['gridmenu'].getAutoSelectFirst()), description = Spring.I18N('ui.settings.option.gridmenu_autoselectfirst_descr'), + { id = "gridmenu_autoselectfirst", group = "control", category = types.advanced, name = I18N('ui.settings.option.gridmenu_autoselectfirst'), type = "bool", value = (WG['gridmenu'] ~= nil and WG['gridmenu'].getAutoSelectFirst ~= nil and WG['gridmenu'].getAutoSelectFirst()), description = I18N('ui.settings.option.gridmenu_autoselectfirst_descr'), onload = function() end, onchange = function(_, value) saveOptionValue('Grid menu', 'gridmenu', 'setAutoSelectFirst', { 'autoSelectFirst' }, value) end, }, - { id = "gridmenu_labbuildmode", group = "control", category = types.advanced, name = Spring.I18N('ui.settings.option.gridmenu_labbuildmode'), type = "bool", value = (WG['gridmenu'] ~= nil and WG['gridmenu'].getUseLabBuildMode ~= nil and WG['gridmenu'].getUseLabBuildMode()), description = Spring.I18N('ui.settings.option.gridmenu_labbuildmode_descr'), + { id = "gridmenu_labbuildmode", group = "control", category = types.advanced, name = I18N('ui.settings.option.gridmenu_labbuildmode'), type = "bool", value = (WG['gridmenu'] ~= nil and WG['gridmenu'].getUseLabBuildMode ~= nil and WG['gridmenu'].getUseLabBuildMode()), description = I18N('ui.settings.option.gridmenu_labbuildmode_descr'), onload = function() end, onchange = function(_, value) @@ -3465,14 +3465,14 @@ function init() end, }, - { id = "gridmenu_ctrlkeymodifier", group = "control", category = types.advanced, name = Spring.I18N('ui.settings.option.gridmenu_ctrlkeymodifier'), type = "slider", min = -20, max = 100, step = 1, value = (WG['gridmenu'] ~= nil and WG['gridmenu'].getCtrlKeyModifier ~= nil and WG['gridmenu'].getCtrlKeyModifier()), description = Spring.I18N('ui.settings.option.gridmenu_ctrlkeymodifier_descr'), + { id = "gridmenu_ctrlkeymodifier", group = "control", category = types.advanced, name = I18N('ui.settings.option.gridmenu_ctrlkeymodifier'), type = "slider", min = -20, max = 100, step = 1, value = (WG['gridmenu'] ~= nil and WG['gridmenu'].getCtrlKeyModifier ~= nil and WG['gridmenu'].getCtrlKeyModifier()), description = I18N('ui.settings.option.gridmenu_ctrlkeymodifier_descr'), onload = function() end, onchange = function(_, value) saveOptionValue('Grid menu', 'gridmenu', 'setCtrlKeyModifier', { 'ctrlKeyModifier' }, value) end, }, - { id = "gridmenu_shiftkeymodifier", group = "control", category = types.advanced, name = Spring.I18N('ui.settings.option.gridmenu_shiftkeymodifier'), type = "slider", min = -20, max = 100, step = 1, value = (WG['gridmenu'] ~= nil and WG['gridmenu'].getShiftKeyModifier ~= nil and WG['gridmenu'].getShiftKeyModifier()), description = Spring.I18N('ui.settings.option.gridmenu_shiftkeymodifier_descr'), + { id = "gridmenu_shiftkeymodifier", group = "control", category = types.advanced, name = I18N('ui.settings.option.gridmenu_shiftkeymodifier'), type = "slider", min = -20, max = 100, step = 1, value = (WG['gridmenu'] ~= nil and WG['gridmenu'].getShiftKeyModifier ~= nil and WG['gridmenu'].getShiftKeyModifier()), description = I18N('ui.settings.option.gridmenu_shiftkeymodifier_descr'), onload = function() end, onchange = function(_, value) @@ -3480,10 +3480,10 @@ function init() end, }, - { id = "label_ui_cursor", group = "control", name = Spring.I18N('ui.settings.option.label_cursor'), category = types.basic }, + { id = "label_ui_cursor", group = "control", name = I18N('ui.settings.option.label_cursor'), category = types.basic }, { id = "label_ui_cursor_spacer", group = "control", category = types.basic }, - { id = "hwcursor", group = "control", category = types.basic, name = Spring.I18N('ui.settings.option.hwcursor'), type = "bool", value = tonumber(Spring.GetConfigInt("HardwareCursor", 0) or 0) == 1, description = Spring.I18N('ui.settings.option.hwcursor_descr'), + { id = "hwcursor", group = "control", category = types.basic, name = I18N('ui.settings.option.hwcursor'), type = "bool", value = tonumber(Spring.GetConfigInt("HardwareCursor", 0) or 0) == 1, description = I18N('ui.settings.option.hwcursor_descr'), onload = function(i) end, onchange = function(i, value) @@ -3491,7 +3491,7 @@ function init() Spring.SetConfigInt("HardwareCursor", (value and 1 or 0)) end, }, - { id = "setcamera_bugfix", group = "control", category = types.advanced, name = Spring.I18N('ui.settings.option.setcamera_bugfix'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.setcamera_bugfix_descr'), + { id = "setcamera_bugfix", group = "control", category = types.advanced, name = I18N('ui.settings.option.setcamera_bugfix'), type = "bool", value = true, description = I18N('ui.settings.option.setcamera_bugfix_descr'), onload = function(i) WG['setcamera_bugfix'] = true end, @@ -3499,7 +3499,7 @@ function init() WG['setcamera_bugfix'] = value end, }, - { id = "cursorsize", group = "control", category = types.basic, name = Spring.I18N('ui.settings.option.cursorsize'), type = "slider", min = 0.3, max = 1.7, step = 0.1, value = 1, description = Spring.I18N('ui.settings.option.cursorsize_descr'), + { id = "cursorsize", group = "control", category = types.basic, name = I18N('ui.settings.option.cursorsize'), type = "slider", min = 0.3, max = 1.7, step = 0.1, value = 1, description = I18N('ui.settings.option.cursorsize_descr'), onload = function(i) end, onchange = function(i, value) @@ -3509,7 +3509,7 @@ function init() end, }, - { id = "containmouse", group = "control", category = types.basic, name = Spring.I18N('ui.settings.option.containmouse'), type = "bool", value = Spring.GetConfigInt('grabinput', 1) == 1, description = Spring.I18N('ui.settings.option.containmouse_descr'), + { id = "containmouse", group = "control", category = types.basic, name = I18N('ui.settings.option.containmouse'), type = "bool", value = Spring.GetConfigInt('grabinput', 1) == 1, description = I18N('ui.settings.option.containmouse_descr'), onload = function(i) end, onchange = function(i, value) @@ -3518,7 +3518,7 @@ function init() end, }, - { id = "doubleclicktime", group = "control", category = types.advanced, restart = true, name = Spring.I18N('ui.settings.option.doubleclicktime'), type = "slider", min = 150, max = 400, step = 10, value = Spring.GetConfigInt("DoubleClickTime", 200), description = Spring.I18N('ui.settings.option.doubleclicktime_descr'), + { id = "doubleclicktime", group = "control", category = types.advanced, restart = true, name = I18N('ui.settings.option.doubleclicktime'), type = "slider", min = 150, max = 400, step = 10, value = Spring.GetConfigInt("DoubleClickTime", 200), description = I18N('ui.settings.option.doubleclicktime_descr'), onload = function(i) end, onchange = function(i, value) @@ -3526,7 +3526,7 @@ function init() end, }, - { id = "dragthreshold", group = "control", category = types.advanced, restart = false, name = Spring.I18N('ui.settings.option.dragthreshold'), type = "slider", min = 4, max = 50, step = 1, value = Spring.GetConfigInt("MouseDragSelectionThreshold", 4), description = Spring.I18N('ui.settings.option.dragthreshold_descr'), + { id = "dragthreshold", group = "control", category = types.advanced, restart = false, name = I18N('ui.settings.option.dragthreshold'), type = "slider", min = 4, max = 50, step = 1, value = Spring.GetConfigInt("MouseDragSelectionThreshold", 4), description = I18N('ui.settings.option.dragthreshold_descr'), onload = function(i) end, onchange = function(i, value) @@ -3539,10 +3539,10 @@ function init() - { id = "label_ui_camera", group = "control", name = Spring.I18N('ui.settings.option.label_camera'), category = types.basic }, + { id = "label_ui_camera", group = "control", name = I18N('ui.settings.option.label_camera'), category = types.basic }, { id = "label_ui_camera_spacer", group = "control", category = types.basic }, - { id = "middleclicktoggle", group = "control", category = types.basic, name = Spring.I18N('ui.settings.option.middleclicktoggle'), type = "bool", value = (Spring.GetConfigFloat("MouseDragScrollThreshold", 0.3) ~= 0), description = Spring.I18N('ui.settings.option.middleclicktoggle_descr'), + { id = "middleclicktoggle", group = "control", category = types.basic, name = I18N('ui.settings.option.middleclicktoggle'), type = "bool", value = (Spring.GetConfigFloat("MouseDragScrollThreshold", 0.3) ~= 0), description = I18N('ui.settings.option.middleclicktoggle_descr'), onload = function(i) end, onchange = function(i, value) @@ -3550,7 +3550,7 @@ function init() end, }, - { id = "screenedgemove", group = "control", category = types.basic, name = Spring.I18N('ui.settings.option.screenedgemove'), type = "bool", restart = true, value = tonumber(Spring.GetConfigInt("FullscreenEdgeMove", 1) or 1) == 1, description = Spring.I18N('ui.settings.option.screenedgemove_descr'), + { id = "screenedgemove", group = "control", category = types.basic, name = I18N('ui.settings.option.screenedgemove'), type = "bool", restart = true, value = tonumber(Spring.GetConfigInt("FullscreenEdgeMove", 1) or 1) == 1, description = I18N('ui.settings.option.screenedgemove_descr'), onchange = function(i, value) Spring.SetConfigInt("FullscreenEdgeMove", (value and 1 or 0)) Spring.SetConfigInt("WindowedEdgeMove", (value and 1 or 0)) @@ -3561,19 +3561,19 @@ function init() end end, }, - { id = "screenedgemovewidth", group = "control", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.screenedgemovewidth'), type = "slider", min = 0, max = 0.1, step = 0.01, value = edgeMoveWidth, description = Spring.I18N('ui.settings.option.screenedgemovewidth_descr'), + { id = "screenedgemovewidth", group = "control", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.screenedgemovewidth'), type = "slider", min = 0, max = 0.1, step = 0.01, value = edgeMoveWidth, description = I18N('ui.settings.option.screenedgemovewidth_descr'), onchange = function(i, value) edgeMoveWidth = value Spring.SetConfigFloat("EdgeMoveWidth", value) end, }, - { id = "screenedgemovedynamic", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.screenedgemovedynamic'), type = "bool", restart = true, value = tonumber(Spring.GetConfigInt("EdgeMoveDynamic", 1) or 1) == 1, description = Spring.I18N('ui.settings.option.screenedgemovedynamic_descr'), + { id = "screenedgemovedynamic", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.screenedgemovedynamic'), type = "bool", restart = true, value = tonumber(Spring.GetConfigInt("EdgeMoveDynamic", 1) or 1) == 1, description = I18N('ui.settings.option.screenedgemovedynamic_descr'), onchange = function(i, value) Spring.SetConfigInt("EdgeMoveDynamic", (value and 1 or 0)) end, }, - { id = "camera", group = "control", category = types.basic, name = Spring.I18N('ui.settings.option.camera'), type = "select", options = { Spring.I18N('ui.settings.option.select_firstperson'), Spring.I18N('ui.settings.option.select_overhead'), Spring.I18N('ui.settings.option.select_springcam'), Spring.I18N('ui.settings.option.select_rotoverhead'), Spring.I18N('ui.settings.option.select_free') }, value = (tonumber((Spring.GetConfigInt("CamMode", 1) + 1) or 2)), + { id = "camera", group = "control", category = types.basic, name = I18N('ui.settings.option.camera'), type = "select", options = { I18N('ui.settings.option.select_firstperson'), I18N('ui.settings.option.select_overhead'), I18N('ui.settings.option.select_springcam'), I18N('ui.settings.option.select_rotoverhead'), I18N('ui.settings.option.select_free') }, value = (tonumber((Spring.GetConfigInt("CamMode", 1) + 1) or 2)), onchange = function(i, value) Spring.SetConfigInt("CamMode", (value - 1)) if value == 1 then @@ -3590,18 +3590,18 @@ function init() init() end, }, - { id = "springcamheightmode", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.springcamheightmode'), type = "select", options = { Spring.I18N('ui.settings.option.select_constant'), Spring.I18N('ui.settings.option.select_terrain'), Spring.I18N('ui.settings.option.select_smooth')}, value = Spring.GetConfigInt("CamSpringTrackMapHeightMode", 0) + 1, description = Spring.I18N('ui.settings.option.springcamheightmode_descr'), + { id = "springcamheightmode", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.springcamheightmode'), type = "select", options = { I18N('ui.settings.option.select_constant'), I18N('ui.settings.option.select_terrain'), I18N('ui.settings.option.select_smooth')}, value = Spring.GetConfigInt("CamSpringTrackMapHeightMode", 0) + 1, description = I18N('ui.settings.option.springcamheightmode_descr'), onchange = function(i, value) Spring.SetConfigInt("CamSpringTrackMapHeightMode", value - 1) end, }, - { id = "mincamheight", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.mincamheight'), type = "slider", min = 0, max = 1500, step = 1, value = Spring.GetConfigInt("CamSpringMinZoomDistance", 0), description = Spring.I18N('ui.settings.option.mincamheight_descr'), + { id = "mincamheight", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.mincamheight'), type = "slider", min = 0, max = 1500, step = 1, value = Spring.GetConfigInt("CamSpringMinZoomDistance", 0), description = I18N('ui.settings.option.mincamheight_descr'), onchange = function(i, value) Spring.SetConfigInt("CamSpringMinZoomDistance", value) Spring.SetConfigInt("OverheadMinZoomDistance", value) end, }, - { id = "camerashake", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.camerashake'), type = "slider", min = 0, max = 200, step = 10, value = 80, description = Spring.I18N('ui.settings.option.camerashake_descr'), + { id = "camerashake", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.camerashake'), type = "slider", min = 0, max = 200, step = 10, value = 80, description = I18N('ui.settings.option.camerashake_descr'), onload = function(i) loadWidgetData("CameraShake", "camerashake", { 'powerScale' }) if options[i].value > 0 then @@ -3629,12 +3629,12 @@ function init() -- end -- end, --}, - { id = "smoothingmode", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.smoothingmode'), type = "select", options = { Spring.I18N('ui.settings.option.smoothing_exponential'), Spring.I18N('ui.settings.option.smoothing_spring')}, value = (Spring.GetConfigInt("CamTransitionMode", 1) + 1), + { id = "smoothingmode", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.smoothingmode'), type = "select", options = { I18N('ui.settings.option.smoothing_exponential'), I18N('ui.settings.option.smoothing_spring')}, value = (Spring.GetConfigInt("CamTransitionMode", 1) + 1), onchange = function(i, value) Spring.SetConfigInt("CamTransitionMode", (value - 1)) end, }, - { id = "camerasmoothness", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.camerasmoothness'), type = "slider", min = 0.04, max = 2, step = 0.01, value = cameraTransitionTime, description = Spring.I18N('ui.settings.option.camerasmoothness_descr'), + { id = "camerasmoothness", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.camerasmoothness'), type = "slider", min = 0.04, max = 2, step = 0.01, value = cameraTransitionTime, description = I18N('ui.settings.option.camerasmoothness_descr'), onload = function(i) end, onchange = function(i, value) @@ -3648,14 +3648,14 @@ function init() Spring.SetConfigFloat("CamSpringHalflife", halfLife) end, }, - { id = "camerapanspeed", group = "control", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.camerapanspeed'), type = "slider", min = -0.01, max = -0.00195, step = 0.0001, value = Spring.GetConfigFloat("MiddleClickScrollSpeed", 0.0035), description = Spring.I18N('ui.settings.option.camerapanspeed_descr'), + { id = "camerapanspeed", group = "control", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.camerapanspeed'), type = "slider", min = -0.01, max = -0.00195, step = 0.0001, value = Spring.GetConfigFloat("MiddleClickScrollSpeed", 0.0035), description = I18N('ui.settings.option.camerapanspeed_descr'), onload = function(i) end, onchange = function(i, value) Spring.SetConfigFloat("MiddleClickScrollSpeed", value) end, }, - { id = "cameramovespeed", group = "control", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.cameramovespeed'), type = "slider", min = 0, max = 100, step = 1, value = Spring.GetConfigInt("CamSpringScrollSpeed", 10), description = Spring.I18N('ui.settings.option.cameramovespeed_descr'), + { id = "cameramovespeed", group = "control", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.cameramovespeed'), type = "slider", min = 0, max = 100, step = 1, value = Spring.GetConfigInt("CamSpringScrollSpeed", 10), description = I18N('ui.settings.option.cameramovespeed_descr'), onload = function(i) end, onchange = function(i, value) @@ -3667,7 +3667,7 @@ function init() Spring.SetConfigInt("CamSpringScrollSpeed", value) -- spring default: 10 end, }, - { id = "scrollspeed", group = "control", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.scrollspeed'), type = "slider", min = 1, max = 50, step = 1, value = math.abs(tonumber(Spring.GetConfigInt("ScrollWheelSpeed", 1) or 25)), description = '', + { id = "scrollspeed", group = "control", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.scrollspeed'), type = "slider", min = 1, max = 50, step = 1, value = math.abs(tonumber(Spring.GetConfigInt("ScrollWheelSpeed", 1) or 25)), description = '', onload = function(i) end, onchange = function(i, value) @@ -3678,7 +3678,7 @@ function init() end end, }, - { id = "scrollinverse", group = "control", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.scrollinverse'), type = "bool", value = (tonumber(Spring.GetConfigInt("ScrollWheelSpeed", 1) or 25) < 0), description = "", + { id = "scrollinverse", group = "control", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.scrollinverse'), type = "bool", value = (tonumber(Spring.GetConfigInt("ScrollWheelSpeed", 1) or 25) < 0), description = "", onload = function(i) end, onchange = function(i, value) @@ -3691,18 +3691,18 @@ function init() end end, }, - { id = "invertmouse", group = "control", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.invertmouse'), type = "bool", value = tonumber(Spring.GetConfigInt("InvertMouse", 0)) == 1, description = "", + { id = "invertmouse", group = "control", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.invertmouse'), type = "bool", value = tonumber(Spring.GetConfigInt("InvertMouse", 0)) == 1, description = "", onload = function(i) end, onchange = function(i, value) Spring.SetConfigInt("InvertMouse", value and 1 or 0) end, }, - { id = "scrolltoggleoverview", group = "control", category = types.advanced, widget = "Scrolldown Toggleoverview", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.scrolltoggleoverview'), type = "bool", value = GetWidgetToggleValue("Scrolldown Toggleoverview"), description = Spring.I18N('ui.settings.option.scrolltoggleoverview_descr') }, + { id = "scrolltoggleoverview", group = "control", category = types.advanced, widget = "Scrolldown Toggleoverview", name = widgetOptionColor .. " " .. I18N('ui.settings.option.scrolltoggleoverview'), type = "bool", value = GetWidgetToggleValue("Scrolldown Toggleoverview"), description = I18N('ui.settings.option.scrolltoggleoverview_descr') }, - { id = "camoverviewrestore", group = "control", category = types.advanced, widget = "Overview Camera Keep Position", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.camoverviewrestore'), type = "bool", value = GetWidgetToggleValue("Overview Camera Keep Position"), description = Spring.I18N('ui.settings.option.camoverviewrestore_descr') }, + { id = "camoverviewrestore", group = "control", category = types.advanced, widget = "Overview Camera Keep Position", name = widgetOptionColor .. " " .. I18N('ui.settings.option.camoverviewrestore'), type = "bool", value = GetWidgetToggleValue("Overview Camera Keep Position"), description = I18N('ui.settings.option.camoverviewrestore_descr') }, - { id = "lockcamera_transitiontime", group = "control", category = types.advanced, name = Spring.I18N('ui.settings.option.lockcamera')..widgetOptionColor .. " " ..Spring.I18N('ui.settings.option.lockcamera_transitiontime'), type = "slider", min = 0.5, max = 1.7, step = 0.01, value = (WG.lockcamera and WG.lockcamera.GetTransitionTime ~= nil and WG.lockcamera.GetTransitionTime()), description = Spring.I18N('ui.settings.option.lockcamera_transitiontime_descr'), + { id = "lockcamera_transitiontime", group = "control", category = types.advanced, name = I18N('ui.settings.option.lockcamera')..widgetOptionColor .. " " ..I18N('ui.settings.option.lockcamera_transitiontime'), type = "slider", min = 0.5, max = 1.7, step = 0.01, value = (WG.lockcamera and WG.lockcamera.GetTransitionTime ~= nil and WG.lockcamera.GetTransitionTime()), description = I18N('ui.settings.option.lockcamera_transitiontime_descr'), onload = function(i) loadWidgetData("Lockcamera", "lockcamera_transitiontime", { 'transitionTime' }) end, @@ -3711,7 +3711,7 @@ function init() end, }, - { id = "allyselunits_select", group = "control", category = types.advanced, name = widgetOptionColor .. " " ..Spring.I18N('ui.settings.option.allyselunits_select'), type = "bool", value = (WG['allyselectedunits'] ~= nil and WG['allyselectedunits'].getSelectPlayerUnits()), description = Spring.I18N('ui.settings.option.allyselunits_select_descr'), + { id = "allyselunits_select", group = "control", category = types.advanced, name = widgetOptionColor .. " " ..I18N('ui.settings.option.allyselunits_select'), type = "bool", value = (WG['allyselectedunits'] ~= nil and WG['allyselectedunits'].getSelectPlayerUnits()), description = I18N('ui.settings.option.allyselunits_select_descr'), onload = function(i) loadWidgetData("Ally Selected Units", "allyselunits_select", { 'selectPlayerUnits' }) end, @@ -3719,7 +3719,7 @@ function init() saveOptionValue('Ally Selected Units', 'allyselectedunits', 'setSelectPlayerUnits', { 'selectPlayerUnits' }, value) end, }, - { id = "lockcamera_hideenemies", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.lockcamera_hideenemies'), type = "bool", value = (WG.lockcamera and WG.lockcamera.GetHideEnemies()), description = Spring.I18N('ui.settings.option.lockcamera_hideenemies_descr'), + { id = "lockcamera_hideenemies", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.lockcamera_hideenemies'), type = "bool", value = (WG.lockcamera and WG.lockcamera.GetHideEnemies()), description = I18N('ui.settings.option.lockcamera_hideenemies_descr'), onload = function(i) loadWidgetData("Lockcamera", "lockcamera_hideenemies", { 'lockcameraHideEnemies' }) end, @@ -3727,7 +3727,7 @@ function init() saveOptionValue('Lockcamera', 'lockcamera', 'SetHideEnemies', { 'lockcameraHideEnemies' }, value) end, }, - { id = "lockcamera_los", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.lockcamera_los'), type = "bool", value = (WG.lockcamera and WG.lockcamera.GetLos()), description = Spring.I18N('ui.settings.option.lockcamera_los_descr'), + { id = "lockcamera_los", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.lockcamera_los'), type = "bool", value = (WG.lockcamera and WG.lockcamera.GetLos()), description = I18N('ui.settings.option.lockcamera_los_descr'), onload = function(i) loadWidgetData("Lockcamera", "lockcamera_los", { 'lockcameraLos' }) end, @@ -3736,9 +3736,9 @@ function init() end, }, - { id = "label_ui_command", group = "control", name = Spring.I18N('ui.settings.option.label_commands'), category = types.advanced }, + { id = "label_ui_command", group = "control", name = I18N('ui.settings.option.label_commands'), category = types.advanced }, { id = "label_ui_command_spacer", group = "control", category = types.basic }, - { id = "drag_multicommand_shift", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.drag_multicommand_shift'), type = "bool", value = (WG.customformations ~= nil and WG.customformations.getRepeatForSingleUnit()), description = Spring.I18N('ui.settings.option.drag_multicommand_shift_descr'), + { id = "drag_multicommand_shift", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.drag_multicommand_shift'), type = "bool", value = (WG.customformations ~= nil and WG.customformations.getRepeatForSingleUnit()), description = I18N('ui.settings.option.drag_multicommand_shift_descr'), onload = function(i) end, onchange = function(i, value) @@ -3747,9 +3747,9 @@ function init() }, -- INTERFACE - { id = "label_ui_interface", group = "ui", name = Spring.I18N('ui.settings.option.label_interface'), category = types.basic }, + { id = "label_ui_interface", group = "ui", name = I18N('ui.settings.option.label_interface'), category = types.basic }, { id = "label_ui_interface_spacer", group = "ui", category = types.basic }, - { id = "language", group = "ui", category = types.basic, name = Spring.I18N('ui.settings.option.language'), type = "select", options = languageNames, value = languageCodes[Spring.I18N.getLocale()], + { id = "language", group = "ui", category = types.basic, name = I18N('ui.settings.option.language'), type = "select", options = languageNames, value = languageCodes[I18N.getLocale()], onchange = function(i, value) local language = languageCodes[value] WG['language'].setLanguage(language) @@ -3760,12 +3760,12 @@ function init() end end }, - { id = "language_english_unit_names", group = "ui", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.language_english_unit_names'), type = "bool", value = Spring.GetConfigInt("language_english_unit_names", 0) == 1, + { id = "language_english_unit_names", group = "ui", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.language_english_unit_names'), type = "bool", value = Spring.GetConfigInt("language_english_unit_names", 0) == 1, onchange = function(i, value) WG['language'].setEnglishUnitNames(value) end, }, - { id = "uiscale", group = "ui", category = types.basic, name = Spring.I18N('ui.settings.option.interface') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.uiscale'), type = "slider", min = 0.8, max = 1.3, step = 0.01, value = Spring.GetConfigFloat("ui_scale", 1), description = '', + { id = "uiscale", group = "ui", category = types.basic, name = I18N('ui.settings.option.interface') .. widgetOptionColor .. " " .. I18N('ui.settings.option.uiscale'), type = "slider", min = 0.8, max = 1.3, step = 0.01, value = Spring.GetConfigFloat("ui_scale", 1), description = '', onload = function(i) end, onchange = function(i, value, force) @@ -3777,7 +3777,7 @@ function init() end end, }, - { id = "guiopacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.guiopacity'), type = "slider", min = 0.3, max = 1, step = 0.01, value = Spring.GetConfigFloat("ui_opacity", 0.7), description = '', + { id = "guiopacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.guiopacity'), type = "slider", min = 0.3, max = 1, step = 0.01, value = Spring.GetConfigFloat("ui_opacity", 0.7), description = '', onload = function(i) end, onchange = function(i, value, force) @@ -3793,7 +3793,7 @@ function init() end end, }, - { id = "guitilescale", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.guitilescale'), type = "slider", min = 4, max = 40, step = 1, value = Spring.GetConfigFloat("ui_tilescale", 7), description = '', + { id = "guitilescale", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.guitilescale'), type = "slider", min = 4, max = 40, step = 1, value = Spring.GetConfigFloat("ui_tilescale", 7), description = '', onload = function(i) end, onchange = function(i, value, force) @@ -3805,7 +3805,7 @@ function init() end end, }, - { id = "guitileopacity", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.guitileopacity'), type = "slider", min = 0, max = 0.03, step = 0.001, value = Spring.GetConfigFloat("ui_tileopacity", 0.014), description = '', + { id = "guitileopacity", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.guitileopacity'), type = "slider", min = 0, max = 0.03, step = 0.001, value = Spring.GetConfigFloat("ui_tileopacity", 0.014), description = '', onload = function(i) end, onchange = function(i, value, force) @@ -3818,15 +3818,15 @@ function init() end, }, - { id = "guishader", group = "ui", category = types.basic, widget = "GUI Shader", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.guishader'), type = "bool", value = GetWidgetToggleValue("GUI Shader") }, + { id = "guishader", group = "ui", category = types.basic, widget = "GUI Shader", name = widgetOptionColor .. " " .. I18N('ui.settings.option.guishader'), type = "bool", value = GetWidgetToggleValue("GUI Shader") }, - { id = "minimap_maxheight", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.minimap') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.minimap_maxheight'), type = "slider", min = 0.2, max = 0.4, step = 0.01, value = Spring.GetConfigFloat("MinimapMaxHeight", 0.32), description = Spring.I18N('ui.settings.option.minimap_maxheight_descr'), + { id = "minimap_maxheight", group = "ui", category = types.advanced, name = I18N('ui.settings.option.minimap') .. widgetOptionColor .. " " .. I18N('ui.settings.option.minimap_maxheight'), type = "slider", min = 0.2, max = 0.4, step = 0.01, value = Spring.GetConfigFloat("MinimapMaxHeight", 0.32), description = I18N('ui.settings.option.minimap_maxheight_descr'), onchange = function(i, value) Spring.SetConfigFloat("MinimapMaxHeight", value) end, }, - { id = "minimapleftclick", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.minimapleftclick'), type = "bool", value = Spring.GetConfigInt("MinimapLeftClickMove", 1) == 1, description = Spring.I18N('ui.settings.option.minimapleftclick_descr'), + { id = "minimapleftclick", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.minimapleftclick'), type = "bool", value = Spring.GetConfigInt("MinimapLeftClickMove", 1) == 1, description = I18N('ui.settings.option.minimapleftclick_descr'), onchange = function(i, value) Spring.SetConfigInt("MinimapLeftClickMove", value and 1 or 0) if WG['minimap'] and WG['minimap'].setLeftClickMove then @@ -3834,7 +3834,7 @@ function init() end end, }, - { id = "minimapiconsize", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.minimapiconsize'), type = "slider", min = 2, max = 5, step = 0.25, value = tonumber(Spring.GetConfigFloat("MinimapIconScale", 3.5) or 1), description = '', + { id = "minimapiconsize", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.minimapiconsize'), type = "slider", min = 2, max = 5, step = 0.25, value = tonumber(Spring.GetConfigFloat("MinimapIconScale", 3.5) or 1), description = '', onload = function(i) end, onchange = function(i, value) @@ -3845,13 +3845,13 @@ function init() end end, }, - { id = "minimap_minimized", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.minimapminimized'), type = "bool", value = Spring.GetConfigInt("MinimapMinimize", 0) == 1, description = Spring.I18N('ui.settings.option.minimapminimized_descr'), + { id = "minimap_minimized", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.minimapminimized'), type = "bool", value = Spring.GetConfigInt("MinimapMinimize", 0) == 1, description = I18N('ui.settings.option.minimapminimized_descr'), onchange = function(i, value) Spring.SendCommands("minimap minimize "..(value and '1' or '0')) Spring.SetConfigInt("MinimapMinimize", (value and '1' or '0')) end, }, - { id = "minimaprotation", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.minimaprotation'), type = "select", options = { Spring.I18N('ui.settings.option.minimaprotation_none'), Spring.I18N('ui.settings.option.minimaprotation_autoflip'), Spring.I18N('ui.settings.option.minimaprotation_autorotate'), Spring.I18N('ui.settings.option.minimaprotation_autolandscape')}, description = Spring.I18N('ui.settings.option.minimaprotation_descr'), + { id = "minimaprotation", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.minimaprotation'), type = "select", options = { I18N('ui.settings.option.minimaprotation_none'), I18N('ui.settings.option.minimaprotation_autoflip'), I18N('ui.settings.option.minimaprotation_autorotate'), I18N('ui.settings.option.minimaprotation_autolandscape')}, description = I18N('ui.settings.option.minimaprotation_descr'), onload = function(i) loadWidgetData("Minimap Rotation Manager", "minimaprotation", { 'mode' }) if options[i].value == nil then -- first load to migrate from old behavior smoothly, might wanna remove it later @@ -3866,8 +3866,8 @@ function init() end end, }, - { id = "minimappip", group = "ui", category = types.advanced, widget = "Picture-in-Picture Minimap", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.minimappip'), type = "bool", value = GetWidgetToggleValue("Picture-in-Picture Minimap"), description = Spring.I18N('ui.settings.option.minimappip_descr') }, - { id = "pip_altkeyzoom", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.pip_altkeyzoom'), type = "bool", value = Spring.GetConfigInt("PipAltKeyRequiredForZoom", 1) == 1, description = Spring.I18N('ui.settings.option.pip_altkeyzoom_descr'), + { id = "minimappip", group = "ui", category = types.advanced, widget = "Picture-in-Picture Minimap", name = widgetOptionColor .. " " .. I18N('ui.settings.option.minimappip'), type = "bool", value = GetWidgetToggleValue("Picture-in-Picture Minimap"), description = I18N('ui.settings.option.minimappip_descr') }, + { id = "pip_altkeyzoom", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.pip_altkeyzoom'), type = "bool", value = Spring.GetConfigInt("PipAltKeyRequiredForZoom", 1) == 1, description = I18N('ui.settings.option.pip_altkeyzoom_descr'), onchange = function(i, value) Spring.SetConfigInt("PipAltKeyRequiredForZoom", value and 1 or 0) for _, n in ipairs({0, 1, 2, 3, 4}) do @@ -3878,7 +3878,7 @@ function init() end, }, - { id = "pip_commandfx", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.pip_commandfx'), type = "bool", value = Spring.GetConfigInt("PipDrawCommandFX", 1) == 1, description = Spring.I18N('ui.settings.option.pip_commandfx_descr'), + { id = "pip_commandfx", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.pip_commandfx'), type = "bool", value = Spring.GetConfigInt("PipDrawCommandFX", 1) == 1, description = I18N('ui.settings.option.pip_commandfx_descr'), onchange = function(i, value) Spring.SetConfigInt("PipDrawCommandFX", value and 1 or 0) for _, n in ipairs({0, 1, 2, 3, 4}) do @@ -3900,7 +3900,7 @@ function init() -- end -- end, -- }, - { id = "pip_engine_fallback_threshold", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.pip_engine_fallback_threshold'), type = "slider", min = 1500, max = 5000, step = 100, value = 4000, description = Spring.I18N('ui.settings.option.pip_engine_fallback_threshold_descr'), + { id = "pip_engine_fallback_threshold", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.pip_engine_fallback_threshold'), type = "slider", min = 1500, max = 5000, step = 100, value = 4000, description = I18N('ui.settings.option.pip_engine_fallback_threshold_descr'), onload = function(i) if WG['minimap'] and WG['minimap'].getEngineMinimapFallbackThreshold then options[getOptionByID('pip_engine_fallback_threshold')].value = WG['minimap'].getEngineMinimapFallbackThreshold() @@ -3914,10 +3914,10 @@ function init() }, - { id = "pip", group = "ui", category = types.advanced, widget = "Picture-in-Picture", name = Spring.I18N('ui.settings.option.pip'), type = "bool", value = GetWidgetToggleValue("Picture-in-Picture"), description = Spring.I18N('ui.settings.option.pip_descr') }, - { id = "pip2", group = "ui", category = types.advanced, widget = "Picture-in-Picture 2", name = Spring.I18N('ui.settings.option.pip2'), type = "bool", value = GetWidgetToggleValue("Picture-in-Picture 2"), description = Spring.I18N('ui.settings.option.pip2_descr') }, + { id = "pip", group = "ui", category = types.advanced, widget = "Picture-in-Picture", name = I18N('ui.settings.option.pip'), type = "bool", value = GetWidgetToggleValue("Picture-in-Picture"), description = I18N('ui.settings.option.pip_descr') }, + { id = "pip2", group = "ui", category = types.advanced, widget = "Picture-in-Picture 2", name = I18N('ui.settings.option.pip2'), type = "bool", value = GetWidgetToggleValue("Picture-in-Picture 2"), description = I18N('ui.settings.option.pip2_descr') }, - { id = "buildmenu_bottom", group = "ui", category = types.basic, name = Spring.I18N('ui.settings.option.buildmenu') ..widgetOptionColor.. " " .. Spring.I18N('ui.settings.option.buildmenu_bottom'), type = "bool", value = (WG['buildmenu'] ~= nil and WG['buildmenu'].getBottomPosition ~= nil and WG['buildmenu'].getBottomPosition()), description = Spring.I18N('ui.settings.option.buildmenu_bottom_descr'), + { id = "buildmenu_bottom", group = "ui", category = types.basic, name = I18N('ui.settings.option.buildmenu') ..widgetOptionColor.. " " .. I18N('ui.settings.option.buildmenu_bottom'), type = "bool", value = (WG['buildmenu'] ~= nil and WG['buildmenu'].getBottomPosition ~= nil and WG['buildmenu'].getBottomPosition()), description = I18N('ui.settings.option.buildmenu_bottom_descr'), onload = function(i) end, onchange = function(i, value) @@ -3925,7 +3925,7 @@ function init() saveOptionValue('Grid menu', 'buildmenu', 'setBottomPosition', { 'stickToBottom' }, value) end, }, - { id = "buildmenu_maxposy", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.buildmenu_maxposy'), type = "slider", min = 0.66, max = 0.88, step = 0.01, value = 0.74, description = Spring.I18N('ui.settings.option.buildmenu_maxposy_descr'), + { id = "buildmenu_maxposy", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.buildmenu_maxposy'), type = "slider", min = 0.66, max = 0.88, step = 0.01, value = 0.74, description = I18N('ui.settings.option.buildmenu_maxposy_descr'), onload = function(i) loadWidgetData("Build menu", "buildmenu_maxposy", { 'maxPosY' }) end, @@ -3933,7 +3933,7 @@ function init() saveOptionValue('Build menu', 'buildmenu', 'setMaxPosY', { 'maxPosY' }, value) end, }, - { id = "buildmenu_alwaysshow", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.buildmenu_alwaysshow'), type = "bool", value = (WG['buildmenu'] ~= nil and WG['buildmenu'].getAlwaysShow ~= nil and WG['buildmenu'].getAlwaysShow()), description = Spring.I18N('ui.settings.option.buildmenu_alwaysshow_descr'), + { id = "buildmenu_alwaysshow", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.buildmenu_alwaysshow'), type = "bool", value = (WG['buildmenu'] ~= nil and WG['buildmenu'].getAlwaysShow ~= nil and WG['buildmenu'].getAlwaysShow()), description = I18N('ui.settings.option.buildmenu_alwaysshow_descr'), onload = function(i) end, onchange = function(i, value) @@ -3941,7 +3941,7 @@ function init() saveOptionValue('Grid menu', 'buildmenu', 'setAlwaysShow', { 'alwaysShow' }, value) end, }, - { id = "buildmenu_prices", group = "ui", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.buildmenu_prices'), type = "bool", value = (WG['buildmenu'] ~= nil and WG['buildmenu'].getShowPrice ~= nil and WG['buildmenu'].getShowPrice()), description = Spring.I18N('ui.settings.option.buildmenu_prices_descr'), + { id = "buildmenu_prices", group = "ui", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.buildmenu_prices'), type = "bool", value = (WG['buildmenu'] ~= nil and WG['buildmenu'].getShowPrice ~= nil and WG['buildmenu'].getShowPrice()), description = I18N('ui.settings.option.buildmenu_prices_descr'), onload = function(i) end, onchange = function(i, value) @@ -3949,7 +3949,7 @@ function init() saveOptionValue('Grid menu', 'buildmenu', 'setShowPrice', { 'showPrice' }, value) end, }, - { id = "buildmenu_groupicon", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.buildmenu_groupicon'), type = "bool", value = (WG['buildmenu'] ~= nil and WG['buildmenu'].getShowGroupIcon ~= nil and WG['buildmenu'].getShowGroupIcon()), description = Spring.I18N('ui.settings.option.buildmenu_groupicon_descr'), + { id = "buildmenu_groupicon", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.buildmenu_groupicon'), type = "bool", value = (WG['buildmenu'] ~= nil and WG['buildmenu'].getShowGroupIcon ~= nil and WG['buildmenu'].getShowGroupIcon()), description = I18N('ui.settings.option.buildmenu_groupicon_descr'), onload = function(i) end, onchange = function(i, value) @@ -3957,7 +3957,7 @@ function init() saveOptionValue('Grid menu', 'buildmenu', 'setShowGroupIcon', { 'showGroupIcon' }, value) end, }, - { id = "buildmenu_radaricon", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.buildmenu_radaricon'), type = "bool", value = (WG['buildmenu'] ~= nil and WG['buildmenu'].getShowRadarIcon ~= nil and WG['buildmenu'].getShowRadarIcon()), description = Spring.I18N('ui.settings.option.buildmenu_radaricon_descr'), + { id = "buildmenu_radaricon", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.buildmenu_radaricon'), type = "bool", value = (WG['buildmenu'] ~= nil and WG['buildmenu'].getShowRadarIcon ~= nil and WG['buildmenu'].getShowRadarIcon()), description = I18N('ui.settings.option.buildmenu_radaricon_descr'), onload = function(i) end, onchange = function(i, value) @@ -3966,14 +3966,14 @@ function init() end, }, - { id = "ordermenu_bottompos", group = "ui", category = types.basic, name = Spring.I18N('ui.settings.option.ordermenu')..widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.ordermenu_bottompos'), type = "bool", value = (WG['ordermenu'] ~= nil and WG['ordermenu'].getBottomPosition ~= nil and WG['ordermenu'].getBottomPosition()), description = Spring.I18N('ui.settings.option.ordermenu_bottompos_descr'), + { id = "ordermenu_bottompos", group = "ui", category = types.basic, name = I18N('ui.settings.option.ordermenu')..widgetOptionColor .. " " .. I18N('ui.settings.option.ordermenu_bottompos'), type = "bool", value = (WG['ordermenu'] ~= nil and WG['ordermenu'].getBottomPosition ~= nil and WG['ordermenu'].getBottomPosition()), description = I18N('ui.settings.option.ordermenu_bottompos_descr'), onload = function(i) end, onchange = function(i, value) saveOptionValue('Order menu', 'ordermenu', 'setBottomPosition', { 'stickToBottom' }, value) end, }, - { id = "ordermenu_colorize", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.ordermenu_colorize'), type = "slider", min = 0, max = 1, step = 0.1, value = 0.5, description = '', + { id = "ordermenu_colorize", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.ordermenu_colorize'), type = "slider", min = 0, max = 1, step = 0.1, value = 0.5, description = '', onload = function(i) loadWidgetData("Order menu", "ordermenu_colorize", { 'colorize' }) end, @@ -3981,14 +3981,14 @@ function init() saveOptionValue('Order menu', 'ordermenu', 'setColorize', { 'colorize' }, value) end, }, - { id = "ordermenu_alwaysshow", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.ordermenu_alwaysshow'), type = "bool", value = (WG['ordermenu'] ~= nil and WG['ordermenu'].getAlwaysShow ~= nil and WG['ordermenu'].getAlwaysShow()), description = Spring.I18N('ui.settings.option.ordermenu_alwaysshow_descr'), + { id = "ordermenu_alwaysshow", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.ordermenu_alwaysshow'), type = "bool", value = (WG['ordermenu'] ~= nil and WG['ordermenu'].getAlwaysShow ~= nil and WG['ordermenu'].getAlwaysShow()), description = I18N('ui.settings.option.ordermenu_alwaysshow_descr'), onload = function(i) end, onchange = function(i, value) saveOptionValue('Order menu', 'ordermenu', 'setAlwaysShow', { 'alwaysShow' }, value) end, }, - { id = "ordermenu_hideset", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.ordermenu_hideset'), type = "bool", value = (WG['ordermenu'] ~= nil and WG['ordermenu'].getDisabledCmd ~= nil and WG['ordermenu'].getDisabledCmd('Move')), description = Spring.I18N('ui.settings.option.ordermenu_hideset_descr'), + { id = "ordermenu_hideset", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.ordermenu_hideset'), type = "bool", value = (WG['ordermenu'] ~= nil and WG['ordermenu'].getDisabledCmd ~= nil and WG['ordermenu'].getDisabledCmd('Move')), description = I18N('ui.settings.option.ordermenu_hideset_descr'), onload = function(i) end, onchange = function(i, value) @@ -3999,21 +3999,21 @@ function init() end, }, - { id = "info_buildlist", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.info') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.info_buildlist'), type = "bool", value = (WG['info'] and WG['info'].getShowBuilderBuildlist ~= nil and WG['info'].getShowBuilderBuildlist()), description = Spring.I18N('ui.settings.option.info_buildlist_descr'), + { id = "info_buildlist", group = "ui", category = types.advanced, name = I18N('ui.settings.option.info') .. widgetOptionColor .. " " .. I18N('ui.settings.option.info_buildlist'), type = "bool", value = (WG['info'] and WG['info'].getShowBuilderBuildlist ~= nil and WG['info'].getShowBuilderBuildlist()), description = I18N('ui.settings.option.info_buildlist_descr'), onload = function(i) end, onchange = function(i, value) saveOptionValue('Info', 'info', 'setShowBuilderBuildlist', { 'showBuilderBuildlist' }, value) end, }, - { id = "info_mappos", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.info_mappos'), type = "bool", value = (WG['info'] and WG['info'].getDisplayMapPosition ~= nil and WG['info'].getDisplayMapPosition()), description = Spring.I18N('ui.settings.option.info_mappos_descr'), + { id = "info_mappos", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.info_mappos'), type = "bool", value = (WG['info'] and WG['info'].getDisplayMapPosition ~= nil and WG['info'].getDisplayMapPosition()), description = I18N('ui.settings.option.info_mappos_descr'), onload = function(i) end, onchange = function(i, value) saveOptionValue('Info', 'info', 'setDisplayMapPosition', { 'displayMapPosition' }, value) end, }, - { id = "info_alwaysshow", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.info_alwaysshow'), type = "bool", value = (WG['info'] ~= nil and WG['info'].getAlwaysShow ~= nil and WG['info'].getAlwaysShow()), + { id = "info_alwaysshow", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.info_alwaysshow'), type = "bool", value = (WG['info'] ~= nil and WG['info'].getAlwaysShow ~= nil and WG['info'].getAlwaysShow()), onload = function(i) end, onchange = function(i, value) @@ -4021,7 +4021,7 @@ function init() end, }, - { id = "advplayerlist_country", group = "ui", category = types.basic, name = Spring.I18N('ui.settings.option.advplayerlist') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_country'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.advplayerlist_country_descr'), + { id = "advplayerlist_country", group = "ui", category = types.basic, name = I18N('ui.settings.option.advplayerlist') .. widgetOptionColor .. " " .. I18N('ui.settings.option.advplayerlist_country'), type = "bool", value = true, description = I18N('ui.settings.option.advplayerlist_country_descr'), onload = function(i) loadWidgetData("AdvPlayersList", "advplayerlist_country", { 'm_active_Table', 'country' }) end, @@ -4029,7 +4029,7 @@ function init() saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetModuleActive', { 'm_active_Table', 'country' }, value, { 'country', value }) end, }, - { id = "advplayerlist_scale", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_scale'), min = 0.85, max = 1.2, step = 0.01, type = "slider", value = 1, description = Spring.I18N('ui.settings.option.advplayerlist_scale_descr'), + { id = "advplayerlist_scale", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.advplayerlist_scale'), min = 0.85, max = 1.2, step = 0.01, type = "slider", value = 1, description = I18N('ui.settings.option.advplayerlist_scale_descr'), onload = function(i) loadWidgetData("AdvPlayersList", "advplayerlist_scale", { 'customScale' }) end, @@ -4037,7 +4037,7 @@ function init() saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetScale', { 'customScale' }, value) end, }, - { id = "advplayerlist_showallyid", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_showallyid'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.advplayerlist_showallyid_descr'), + { id = "advplayerlist_showallyid", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.advplayerlist_showallyid'), type = "bool", value = false, description = I18N('ui.settings.option.advplayerlist_showallyid_descr'), onload = function(i) loadWidgetData("AdvPlayersList", "advplayerlist_showallyid", { 'm_active_Table', 'allyid' }) end, @@ -4045,7 +4045,7 @@ function init() saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetModuleActive', { 'm_active_Table', 'allyid' }, value, { 'allyid', value }) end, }, - { id = "advplayerlist_showid", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_showid'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.advplayerlist_showid_descr'), + { id = "advplayerlist_showid", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.advplayerlist_showid'), type = "bool", value = false, description = I18N('ui.settings.option.advplayerlist_showid_descr'), onload = function(i) loadWidgetData("AdvPlayersList", "advplayerlist_showid", { 'm_active_Table', 'id' }) end, @@ -4053,7 +4053,7 @@ function init() saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetModuleActive', { 'm_active_Table', 'id' }, value, { 'id', value }) end, }, - { id = "advplayerlist_showplayerid", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_showplayerid'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.advplayerlist_showplayerid_descr'), + { id = "advplayerlist_showplayerid", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.advplayerlist_showplayerid'), type = "bool", value = false, description = I18N('ui.settings.option.advplayerlist_showplayerid_descr'), onload = function(i) loadWidgetData("AdvPlayersList", "advplayerlist_showplayerid", { 'm_active_Table', 'playerid' }) end, @@ -4061,7 +4061,7 @@ function init() saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetModuleActive', { 'm_active_Table', 'playerid' }, value, { 'playerid', value }) end, }, - { id = "advplayerlist_rank", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_rank'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.advplayerlist_rank_descr'), + { id = "advplayerlist_rank", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.advplayerlist_rank'), type = "bool", value = true, description = I18N('ui.settings.option.advplayerlist_rank_descr'), onload = function(i) loadWidgetData("AdvPlayersList", "advplayerlist_rank", { 'm_active_Table', 'rank' }) end, @@ -4077,7 +4077,7 @@ function init() -- saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetModuleActive', { 'm_active_Table', 'side' }, value, { 'side', value }) -- end, --}, - { id = "advplayerlist_skill", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_skill'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.advplayerlist_skill_descr'), + { id = "advplayerlist_skill", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.advplayerlist_skill'), type = "bool", value = true, description = I18N('ui.settings.option.advplayerlist_skill_descr'), onload = function(i) loadWidgetData("AdvPlayersList", "advplayerlist_skill", { 'm_active_Table', 'skill' }) end, @@ -4085,7 +4085,7 @@ function init() saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetModuleActive', { 'm_active_Table', 'skill' }, value, { 'skill', value }) end, }, - { id = "advplayerlist_cpuping", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_cpuping'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.advplayerlist_cpuping_descr'), + { id = "advplayerlist_cpuping", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.advplayerlist_cpuping'), type = "bool", value = true, description = I18N('ui.settings.option.advplayerlist_cpuping_descr'), onload = function(i) loadWidgetData("AdvPlayersList", "advplayerlist_cpuping", { 'm_active_Table', 'cpuping' }) end, @@ -4093,7 +4093,7 @@ function init() saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetModuleActive', { 'm_active_Table', 'cpuping' }, value, { 'cpuping', value }) end, }, - { id = "advplayerlist_resources", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_resources'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.advplayerlist_resources_descr'), + { id = "advplayerlist_resources", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.advplayerlist_resources'), type = "bool", value = true, description = I18N('ui.settings.option.advplayerlist_resources_descr'), onload = function(i) loadWidgetData("AdvPlayersList", "advplayerlist_resources", { 'm_active_Table', 'resources' }) end, @@ -4101,7 +4101,7 @@ function init() saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetModuleActive', { 'm_active_Table', 'resources' }, value, { 'resources', value }) end, }, - { id = "advplayerlist_income", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_income'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.advplayerlist_income_descr'), + { id = "advplayerlist_income", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.advplayerlist_income'), type = "bool", value = true, description = I18N('ui.settings.option.advplayerlist_income_descr'), onload = function(i) loadWidgetData("AdvPlayersList", "advplayerlist_income", { 'm_active_Table', 'income' }) end, @@ -4109,7 +4109,7 @@ function init() saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetModuleActive', { 'm_active_Table', 'income' }, value, { 'income', value }) end, }, - { id = "advplayerlist_absresbars", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_absresbars'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.advplayerlist_absresbars_descr'), + { id = "advplayerlist_absresbars", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.advplayerlist_absresbars'), type = "bool", value = false, description = I18N('ui.settings.option.advplayerlist_absresbars_descr'), onload = function(i) loadWidgetData("AdvPlayersList", "advplayerlist_absresbars", { 'absoluteResbarValues' }) end, @@ -4117,7 +4117,7 @@ function init() saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetAbsoluteResbars', { 'absoluteResbarValues' }, value) end, }, - { id = "advplayerlist_share", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_share'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.advplayerlist_share_descr'), + { id = "advplayerlist_share", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.advplayerlist_share'), type = "bool", value = true, description = I18N('ui.settings.option.advplayerlist_share_descr'), onload = function(i) loadWidgetData("AdvPlayersList", "advplayerlist_share", { 'm_active_Table', 'share' }) end, @@ -4125,7 +4125,7 @@ function init() saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetModuleActive', { 'm_active_Table', 'share' }, value, { 'share', value }) end, }, - { id = "advplayerlist_hidespecs", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_hidespecs'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.advplayerlist_hidespecs_descr'), + { id = "advplayerlist_hidespecs", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.advplayerlist_hidespecs'), type = "bool", value = true, description = I18N('ui.settings.option.advplayerlist_hidespecs_descr'), onload = function(i) loadWidgetData("AdvPlayersList", "advplayerlist_hidespecs", { 'alwaysHideSpecs' }) end, @@ -4133,8 +4133,8 @@ function init() saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetAlwaysHideSpecs', { 'alwaysHideSpecs' }, value) end, }, - { id = "unittotals", group = "ui", category = types.advanced, widget = "AdvPlayersList Unit Totals", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.unittotals'), type = "bool", value = GetWidgetToggleValue("AdvPlayersList Unit Totals"), description = Spring.I18N('ui.settings.option.unittotals_descr') }, - { id = "musicplayer", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. widgetOptionColor .. Spring.I18N('ui.settings.option.musicplayer'), type = "bool", value = (WG['music'] ~= nil and WG['music'].GetShowGui() or false), description = Spring.I18N('ui.settings.option.musicplayer_descr'), + { id = "unittotals", group = "ui", category = types.advanced, widget = "AdvPlayersList Unit Totals", name = widgetOptionColor .. " " .. I18N('ui.settings.option.unittotals'), type = "bool", value = GetWidgetToggleValue("AdvPlayersList Unit Totals"), description = I18N('ui.settings.option.unittotals_descr') }, + { id = "musicplayer", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. widgetOptionColor .. I18N('ui.settings.option.musicplayer'), type = "bool", value = (WG['music'] ~= nil and WG['music'].GetShowGui() or false), description = I18N('ui.settings.option.musicplayer_descr'), onload = function(i) loadWidgetData("AdvPlayersList Music Player New", "musicplayer", { 'showGUI' }) end, @@ -4142,9 +4142,9 @@ function init() saveOptionValue('AdvPlayersList Music Player New', 'music', 'SetShowGui', { 'showGUI' }, value) end, }, - { id = "mascot", group = "ui", category = types.advanced, widget = "AdvPlayersList Mascot", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.mascot'), type = "bool", value = GetWidgetToggleValue("AdvPlayersList Mascot"), description = Spring.I18N('ui.settings.option.mascot_descr') }, + { id = "mascot", group = "ui", category = types.advanced, widget = "AdvPlayersList Mascot", name = widgetOptionColor .. " " .. I18N('ui.settings.option.mascot'), type = "bool", value = GetWidgetToggleValue("AdvPlayersList Mascot"), description = I18N('ui.settings.option.mascot_descr') }, - { id = "displayselectedname", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.displayselectedname'), type = "bool", value = (WG['playertv'] ~= nil and WG['playertv'].GetAlwaysDisplayName() or false), description = Spring.I18N('ui.settings.option.displayselectedname_descr'), + { id = "displayselectedname", group = "ui", category = types.advanced, name = I18N('ui.settings.option.displayselectedname'), type = "bool", value = (WG['playertv'] ~= nil and WG['playertv'].GetAlwaysDisplayName() or false), description = I18N('ui.settings.option.displayselectedname_descr'), onload = function(i) loadWidgetData("Player-TV", "displayselectedname", { 'alwaysDisplayName' }) end, @@ -4153,7 +4153,7 @@ function init() end, }, - { id = "console_fontsize", group = "ui", category = types.basic, name = Spring.I18N('ui.settings.option.console') .. " " .. widgetOptionColor .. Spring.I18N('ui.settings.option.console_fontsize'), type = "slider", min = 0.92, max = 1.12, step = 0.02, value = (WG['chat'] ~= nil and WG['chat'].getFontsize() or 1), description = '', + { id = "console_fontsize", group = "ui", category = types.basic, name = I18N('ui.settings.option.console') .. " " .. widgetOptionColor .. I18N('ui.settings.option.console_fontsize'), type = "slider", min = 0.92, max = 1.12, step = 0.02, value = (WG['chat'] ~= nil and WG['chat'].getFontsize() or 1), description = '', onload = function(i) loadWidgetData("Chat", "console_fontsize", { 'fontsizeMult' }) end, @@ -4161,7 +4161,7 @@ function init() saveOptionValue('Chat', 'chat', 'setFontsize', { 'fontsizeMult' }, value) end, }, - { id = "console_backgroundopacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.console_backgroundopacity'), type = "slider", min = 0, max = 0.45, step = 0.01, value = (WG['chat'] ~= nil and WG['chat'].getBackgroundOpacity() or 0), description = Spring.I18N('ui.settings.option.console_backgroundopacity_descr'), + { id = "console_backgroundopacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.console_backgroundopacity'), type = "slider", min = 0, max = 0.45, step = 0.01, value = (WG['chat'] ~= nil and WG['chat'].getBackgroundOpacity() or 0), description = I18N('ui.settings.option.console_backgroundopacity_descr'), onload = function(i) loadWidgetData("Chat", "console_backgroundopacity", { 'chatBackgroundOpacity' }) end, @@ -4169,21 +4169,21 @@ function init() saveOptionValue('Chat', 'chat', 'setBackgroundOpacity', { 'chatBackgroundOpacity' }, value) end, }, - { id = "console_hidespecchat", group = "ui", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.console_hidespecchat'), type = "bool", value = (Spring.GetConfigInt("HideSpecChat", 0) == 1), description = Spring.I18N('ui.settings.option.console_hidespecchat_descr'), + { id = "console_hidespecchat", group = "ui", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.console_hidespecchat'), type = "bool", value = (Spring.GetConfigInt("HideSpecChat", 0) == 1), description = I18N('ui.settings.option.console_hidespecchat_descr'), onload = function(i) end, onchange = function(i, value) Spring.SetConfigInt("HideSpecChat", value and 1 or 0) end, }, - { id = "console_hidespecchatplayer", group = "ui", category = types.basic, name = widgetOptionColor .. " " .. widgetOptionColor .. Spring.I18N('ui.settings.option.console_hidespecchatplayer'), type = "bool", value = (Spring.GetConfigInt("HideSpecChatPlayer", 1) == 1), description = Spring.I18N('ui.settings.option.console_hidespecchatplayer_descr'), + { id = "console_hidespecchatplayer", group = "ui", category = types.basic, name = widgetOptionColor .. " " .. widgetOptionColor .. I18N('ui.settings.option.console_hidespecchatplayer'), type = "bool", value = (Spring.GetConfigInt("HideSpecChatPlayer", 1) == 1), description = I18N('ui.settings.option.console_hidespecchatplayer_descr'), onload = function(i) end, onchange = function(i, value) Spring.SetConfigInt("HideSpecChatPlayer", value and 1 or 0) end, }, - { id = "console_hide", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.console_hide'), type = "bool", value = (WG['chat'] ~= nil and WG['chat'].getHide() or false), description = Spring.I18N('ui.settings.option.console_hide_descr'), + { id = "console_hide", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.console_hide'), type = "bool", value = (WG['chat'] ~= nil and WG['chat'].getHide() or false), description = I18N('ui.settings.option.console_hide_descr'), onload = function(i) loadWidgetData("Chat", "console_hide", { 'hide' }) end, @@ -4191,7 +4191,7 @@ function init() saveOptionValue('Chat', 'chat', 'setHide', { 'hide' }, value) end, }, - { id = "console_maxlines", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.console_maxlines'), type = "slider", min = 3, max = 7, step = 1, value = (WG['chat'] ~= nil and WG['chat'].getMaxLines() or 5), description = '', + { id = "console_maxlines", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.console_maxlines'), type = "slider", min = 3, max = 7, step = 1, value = (WG['chat'] ~= nil and WG['chat'].getMaxLines() or 5), description = '', onload = function(i) loadWidgetData("Chat", "console_maxlines", { 'maxLines' }) end, @@ -4199,7 +4199,7 @@ function init() saveOptionValue('Chat', 'chat', 'setMaxLines', { 'maxLines' }, value) end, }, - { id = "console_maxconsolelines", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.console_maxconsolelines'), type = "slider", min = 2, max = 12, step = 1, value = (WG['chat'] ~= nil and WG['chat'].getMaxConsoleLines() or 2), description = '', + { id = "console_maxconsolelines", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.console_maxconsolelines'), type = "slider", min = 2, max = 12, step = 1, value = (WG['chat'] ~= nil and WG['chat'].getMaxConsoleLines() or 2), description = '', onload = function(i) loadWidgetData("Chat", "console_maxconsolelines", { 'maxConsoleLines' }) end, @@ -4223,8 +4223,8 @@ function init() -- saveOptionValue('Chat', 'chat', 'setInputButton', { 'inputButton' }, value) -- end, --}, - { id = "autoeraser", group = "ui", category = types.basic, widget = "Auto mapmark eraser", name = Spring.I18N('ui.settings.option.autoeraser'), type = "bool", value = GetWidgetToggleValue("Auto mapmark eraser"), description = Spring.I18N('ui.settings.option.autoeraser_descr') }, - { id = "autoeraser_erasetime", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.autoeraser_erasetime'), type = "slider", min = 10, max = 200, step = 1, value = 60, description = Spring.I18N('ui.settings.option.autoeraser_erasetime_descr'), + { id = "autoeraser", group = "ui", category = types.basic, widget = "Auto mapmark eraser", name = I18N('ui.settings.option.autoeraser'), type = "bool", value = GetWidgetToggleValue("Auto mapmark eraser"), description = I18N('ui.settings.option.autoeraser_descr') }, + { id = "autoeraser_erasetime", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.autoeraser_erasetime'), type = "slider", min = 10, max = 200, step = 1, value = 60, description = I18N('ui.settings.option.autoeraser_erasetime_descr'), onload = function(i) loadWidgetData("Auto mapmark eraser", "autoeraser_erasetime", { 'eraseTime' }) end, @@ -4233,7 +4233,7 @@ function init() end, }, - { id = "topbar_hidebuttons", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.topbar')..widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.topbar_hidebuttons'), type = "bool", value = (WG['topbar'] ~= nil and WG['topbar'].getAutoHideButtons() or 0), + { id = "topbar_hidebuttons", group = "ui", category = types.advanced, name = I18N('ui.settings.option.topbar')..widgetOptionColor .. " " .. I18N('ui.settings.option.topbar_hidebuttons'), type = "bool", value = (WG['topbar'] ~= nil and WG['topbar'].getAutoHideButtons() or 0), onload = function(i) loadWidgetData("Top Bar", "topbar_hidebuttons", { 'autoHideButtons' }) end, @@ -4242,7 +4242,7 @@ function init() end, }, - { id = "continuouslyclearmapmarks", group = "ui", category = types.dev, name = Spring.I18N('ui.settings.option.continuouslyclearmapmarks'), type = "bool", value = Spring.GetConfigInt("ContinuouslyClearMapmarks", 0) == 1, description = Spring.I18N('ui.settings.option.continuouslyclearmapmarks_descr'), + { id = "continuouslyclearmapmarks", group = "ui", category = types.dev, name = I18N('ui.settings.option.continuouslyclearmapmarks'), type = "bool", value = Spring.GetConfigInt("ContinuouslyClearMapmarks", 0) == 1, description = I18N('ui.settings.option.continuouslyclearmapmarks_descr'), onchange = function(i, value) Spring.SetConfigInt("ContinuouslyClearMapmarks", (value and 1 or 0)) if value then @@ -4251,29 +4251,29 @@ function init() end, }, - { id = "unitgroups", group = "ui", category = types.basic, widget = "Unit Groups", name = Spring.I18N('ui.settings.option.unitgroups'), type = "bool", value = GetWidgetToggleValue("Unit Groups"), description = Spring.I18N('ui.settings.option.unitgroups_descr') }, - { id = "idlebuilders", group = "ui", category = types.basic, widget = "Idle Builders", name = Spring.I18N('ui.settings.option.idlebuilders'), type = "bool", value = GetWidgetToggleValue("Idle Builders"), description = Spring.I18N('ui.settings.option.idlebuilders_descr') }, - { id = "buildbar", group = "ui", category = types.basic, widget = "BuildBar", name = Spring.I18N('ui.settings.option.buildbar'), type = "bool", value = GetWidgetToggleValue("BuildBar"), description = Spring.I18N('ui.settings.option.buildbar_descr') }, + { id = "unitgroups", group = "ui", category = types.basic, widget = "Unit Groups", name = I18N('ui.settings.option.unitgroups'), type = "bool", value = GetWidgetToggleValue("Unit Groups"), description = I18N('ui.settings.option.unitgroups_descr') }, + { id = "idlebuilders", group = "ui", category = types.basic, widget = "Idle Builders", name = I18N('ui.settings.option.idlebuilders'), type = "bool", value = GetWidgetToggleValue("Idle Builders"), description = I18N('ui.settings.option.idlebuilders_descr') }, + { id = "buildbar", group = "ui", category = types.basic, widget = "BuildBar", name = I18N('ui.settings.option.buildbar'), type = "bool", value = GetWidgetToggleValue("BuildBar"), description = I18N('ui.settings.option.buildbar_descr') }, - { id = "converterusage", group = "ui", category = types.advanced, widget = "Converter Usage", name = Spring.I18N('ui.settings.option.converterusage'), type = "bool", value = GetWidgetToggleValue("Converter Usage"), description = Spring.I18N('ui.settings.option.converterusage_descr') }, + { id = "converterusage", group = "ui", category = types.advanced, widget = "Converter Usage", name = I18N('ui.settings.option.converterusage'), type = "bool", value = GetWidgetToggleValue("Converter Usage"), description = I18N('ui.settings.option.converterusage_descr') }, - { id = "widgetselector", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.widgetselector'), type = "bool", value = Spring.GetConfigInt("widgetselector", 0) == 1, description = Spring.I18N('ui.settings.option.widgetselector_descr'), + { id = "widgetselector", group = "ui", category = types.advanced, name = I18N('ui.settings.option.widgetselector'), type = "bool", value = Spring.GetConfigInt("widgetselector", 0) == 1, description = I18N('ui.settings.option.widgetselector_descr'), onchange = function(i, value) Spring.SetConfigInt("widgetselector", (value and 1 or 0)) end, }, - { id = "label_ui_visuals", group = "ui", name = Spring.I18N('ui.settings.option.label_visuals'), category = types.basic }, + { id = "label_ui_visuals", group = "ui", name = I18N('ui.settings.option.label_visuals'), category = types.basic }, { id = "label_ui_visuals_spacer", group = "ui", category = types.basic }, - { id = "uniticon_scaleui", group = "ui", category = types.basic, name = Spring.I18N('ui.settings.option.uniticonscaleui'), type = "slider", min = 0.85, max = 3, step = 0.05, value = tonumber(Spring.GetConfigFloat("UnitIconScaleUI", 1) or 1), description = Spring.I18N('ui.settings.option.uniticonscaleui_descr'), + { id = "uniticon_scaleui", group = "ui", category = types.basic, name = I18N('ui.settings.option.uniticonscaleui'), type = "slider", min = 0.85, max = 3, step = 0.05, value = tonumber(Spring.GetConfigFloat("UnitIconScaleUI", 1) or 1), description = I18N('ui.settings.option.uniticonscaleui_descr'), onchange = function(i, value) Spring.SendCommands("iconscaleui " .. value) Spring.SetConfigFloat("UnitIconScaleUI", value) end, }, - { id = "uniticon_distance", group = "ui", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.uniticondistance'), type = "slider", min = 1, max = 12000, step = 50, value = tonumber(Spring.GetConfigInt("UnitIconFadeVanish", 2700) or 1), description = Spring.I18N('ui.settings.option.uniticondistance_descr'), + { id = "uniticon_distance", group = "ui", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.uniticondistance'), type = "slider", min = 1, max = 12000, step = 50, value = tonumber(Spring.GetConfigInt("UnitIconFadeVanish", 2700) or 1), description = I18N('ui.settings.option.uniticondistance_descr'), onchange = function(i, value) Spring.SendCommands("iconfadestart " .. value) Spring.SetConfigInt("UnitIconFadeStart", value) @@ -4282,7 +4282,7 @@ function init() Spring.SetConfigInt("UnitIconFadeVanish", value) end, }, - { id = "uniticon_hidewithui", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.uniticonhidewithui'), type = "bool", value = (Spring.GetConfigInt("UnitIconsHideWithUI", 0) == 1), description = Spring.I18N('ui.settings.option.uniticonhidewithui_descr'), + { id = "uniticon_hidewithui", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.uniticonhidewithui'), type = "bool", value = (Spring.GetConfigInt("UnitIconsHideWithUI", 0) == 1), description = I18N('ui.settings.option.uniticonhidewithui_descr'), onchange = function(i, value) Spring.SendCommands("iconshidewithui " .. (value and 1 or 0)) Spring.SetConfigInt("UnitIconsHideWithUI", (value and 1 or 0)) @@ -4297,8 +4297,8 @@ function init() -- }, - { id = "teamplatter", group = "ui", category = types.basic, widget = "TeamPlatter", name = Spring.I18N('ui.settings.option.teamplatter'), type = "bool", value = GetWidgetToggleValue("TeamPlatter"), description = Spring.I18N('ui.settings.option.teamplatter_descr') }, - { id = "teamplatter_opacity", category = types.advanced, group = "ui", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.teamplatter_opacity'), min = 0.05, max = 0.4, step = 0.01, type = "slider", value = 0.25, description = Spring.I18N('ui.settings.option.teamplatter_opacity_descr'), + { id = "teamplatter", group = "ui", category = types.basic, widget = "TeamPlatter", name = I18N('ui.settings.option.teamplatter'), type = "bool", value = GetWidgetToggleValue("TeamPlatter"), description = I18N('ui.settings.option.teamplatter_descr') }, + { id = "teamplatter_opacity", category = types.advanced, group = "ui", name = widgetOptionColor .. " " .. I18N('ui.settings.option.teamplatter_opacity'), min = 0.05, max = 0.4, step = 0.01, type = "slider", value = 0.25, description = I18N('ui.settings.option.teamplatter_opacity_descr'), onload = function(i) loadWidgetData("TeamPlatter", "teamplatter_opacity", { 'opacity' }) end, @@ -4306,7 +4306,7 @@ function init() saveOptionValue('TeamPlatter', 'teamplatter', 'setOpacity', { 'opacity' }, value) end, }, - { id = "teamplatter_skipownteam", category = types.advanced, group = "ui", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.teamplatter_skipownteam'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.teamplatter_skipownteam_descr'), + { id = "teamplatter_skipownteam", category = types.advanced, group = "ui", name = widgetOptionColor .. " " .. I18N('ui.settings.option.teamplatter_skipownteam'), type = "bool", value = false, description = I18N('ui.settings.option.teamplatter_skipownteam_descr'), onload = function(i) loadWidgetData("TeamPlatter", "teamplatter_skipownteam", { 'skipOwnTeam' }) end, @@ -4315,8 +4315,8 @@ function init() end, }, - { id = "enemyspotter", group = "ui", category = types.basic, widget = "EnemySpotter", name = Spring.I18N('ui.settings.option.enemyspotter'), type = "bool", value = GetWidgetToggleValue("EnemySpotter"), description = Spring.I18N('ui.settings.option.enemyspotter_descr') }, - { id = "enemyspotter_opacity", category = types.advanced, group = "ui", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.enemyspotter_opacity'), min = 0.12, max = 0.4, step = 0.01, type = "slider", value = 0.15, description = Spring.I18N('ui.settings.option.enemyspotter_opacity_descr'), + { id = "enemyspotter", group = "ui", category = types.basic, widget = "EnemySpotter", name = I18N('ui.settings.option.enemyspotter'), type = "bool", value = GetWidgetToggleValue("EnemySpotter"), description = I18N('ui.settings.option.enemyspotter_descr') }, + { id = "enemyspotter_opacity", category = types.advanced, group = "ui", name = widgetOptionColor .. " " .. I18N('ui.settings.option.enemyspotter_opacity'), min = 0.12, max = 0.4, step = 0.01, type = "slider", value = 0.15, description = I18N('ui.settings.option.enemyspotter_opacity_descr'), onload = function(i) loadWidgetData("EnemySpotter", "enemyspotter_opacity", { 'opacity' }) end, @@ -4326,7 +4326,7 @@ function init() }, --{ id = "selectedunits", group = "ui", category = types.basic, widget = "Selected Units GL4", name = "Selection", type = "bool", value = GetWidgetToggleValue("Selected Units GL4"), description = Spring.I18N('ui.settings.option.selectedunits_descr') }, - { id = "selectedunits_opacity", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.selectedunits')..widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.selectedunits_opacity'), min = 0, max = 0.5, step = 0.01, type = "slider", value = 0.19, description = Spring.I18N('ui.settings.option.selectedunits_opacity_descr'), + { id = "selectedunits_opacity", group = "ui", category = types.advanced, name = I18N('ui.settings.option.selectedunits')..widgetOptionColor .. " " .. I18N('ui.settings.option.selectedunits_opacity'), min = 0, max = 0.5, step = 0.01, type = "slider", value = 0.19, description = I18N('ui.settings.option.selectedunits_opacity_descr'), onload = function(i) loadWidgetData("Selected Units GL4", "selectedunits_opacity", { 'opacity' }) end, @@ -4334,7 +4334,7 @@ function init() saveOptionValue('Selected Units GL4', 'selectedunits', 'setOpacity', { 'opacity' }, value) end, }, - { id = "selectedunits_teamcoloropacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.selectedunits_teamcoloropacity'), min = 0, max = 1, step = 0.01, type = "slider", value = 0.6, description = Spring.I18N('ui.settings.option.selectedunits_teamcoloropacity_descr'), + { id = "selectedunits_teamcoloropacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.selectedunits_teamcoloropacity'), min = 0, max = 1, step = 0.01, type = "slider", value = 0.6, description = I18N('ui.settings.option.selectedunits_teamcoloropacity_descr'), onload = function(i) loadWidgetData("Selected Units GL4", "selectedunits_teamcoloropacity", { 'teamcolorOpacity' }) end, @@ -4345,7 +4345,7 @@ function init() --{ id = "highlightselunits", group = "ui", category = types.basic, widget = "Highlight Selected Units GL4", name = Spring.I18N('ui.settings.option.highlightselunits'), type = "bool", value = GetWidgetToggleValue("Highlight Selected Units GL4"), description = Spring.I18N('ui.settings.option.highlightselunits_descr') }, - { id = "highlightselunits", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.highlightselunits'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.selectedunits_teamcoloropacity_descr'), + { id = "highlightselunits", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.highlightselunits'), type = "bool", value = true, description = I18N('ui.settings.option.selectedunits_teamcoloropacity_descr'), onload = function(i) loadWidgetData("Selected Units GL4", "highlightselunits", { 'selectionHighlight' }) end, @@ -4372,7 +4372,7 @@ function init() -- { id = "highlightunit", group = "ui", category = types.advanced, widget = "Highlight Unit GL4", name = Spring.I18N('ui.settings.option.highlightunit'), type = "bool", value = GetWidgetToggleValue("Highlight Unit GL4"), description = Spring.I18N('ui.settings.option.highlightunit_descr') }, - { id = "highlightunit", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.highlightunit'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.highlightunit_descr'), + { id = "highlightunit", group = "ui", category = types.advanced, name = I18N('ui.settings.option.highlightunit'), type = "bool", value = true, description = I18N('ui.settings.option.highlightunit_descr'), onload = function(i) loadWidgetData("Selected Units GL4", "highlightunit", { 'mouseoverHighlight' }) end, @@ -4381,13 +4381,13 @@ function init() end, }, - { id = "ghosticons_brightness", group = "ui", category = types.dev, name = Spring.I18N('ui.settings.option.ghosticons') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.ghosticons_brightness'), min = 0, max = 1.0, step = 0.15, type = "slider", value = Spring.GetConfigFloat("UnitGhostIconsDimming", 0.8), description = Spring.I18N('ui.settings.option.ghosticons_brightness_descr'), + { id = "ghosticons_brightness", group = "ui", category = types.dev, name = I18N('ui.settings.option.ghosticons') .. widgetOptionColor .. " " .. I18N('ui.settings.option.ghosticons_brightness'), min = 0, max = 1.0, step = 0.15, type = "slider", value = Spring.GetConfigFloat("UnitGhostIconsDimming", 0.8), description = I18N('ui.settings.option.ghosticons_brightness_descr'), onchange = function(i, value) Spring.SetConfigFloat("UnitGhostIconsDimming", value) end, }, - { id = "cursorlight", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.cursorlight'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.cursorlight_descr'), + { id = "cursorlight", group = "ui", category = types.advanced, name = I18N('ui.settings.option.cursorlight'), type = "bool", value = false, description = I18N('ui.settings.option.cursorlight_descr'), onload = function(i) loadWidgetData("Deferred rendering GL4", "cursorlight", { 'showPlayerCursorLight' }) end, @@ -4395,7 +4395,7 @@ function init() saveOptionValue('Deferred rendering GL4', 'lightsgl4', 'ShowPlayerCursorLight', { 'showPlayerCursorLight' }, value) end, }, - { id = "cursorlight_lightradius", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.cursorlight_lightradius'), type = "slider", min = 0.3, max = 2, step = 0.05, value = 1, description = '', + { id = "cursorlight_lightradius", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.cursorlight_lightradius'), type = "slider", min = 0.3, max = 2, step = 0.05, value = 1, description = '', onload = function(i) loadWidgetData("Deferred rendering GL4", "cursorlight_lightradius", { 'playerCursorLightRadius' }) end, @@ -4403,7 +4403,7 @@ function init() saveOptionValue('Deferred rendering GL4', 'lightsgl4', 'PlayerCursorLightRadius', { 'playerCursorLightRadius' }, value) end, }, - { id = "cursorlight_lightstrength", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.cursorlight_lightstrength'), type = "slider", min = 0.3, max = 2, step = 0.05, value = 1, description = '', + { id = "cursorlight_lightstrength", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.cursorlight_lightstrength'), type = "slider", min = 0.3, max = 2, step = 0.05, value = 1, description = '', onload = function(i) loadWidgetData("Cursor Light", "cursorlight_lightstrength", { 'playerCursorLightBrightness' }) end, @@ -4413,10 +4413,10 @@ function init() }, - { id = "label_ui_info", group = "ui", name = Spring.I18N('ui.settings.option.label_info'), category = types.basic }, + { id = "label_ui_info", group = "ui", name = I18N('ui.settings.option.label_info'), category = types.basic }, { id = "label_ui_info_spacer", group = "ui", category = types.basic }, - { id = "metalspots_values", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.metalspots')..widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.metalspots_values'), type = "bool", value = (WG['metalspots'] ~= nil and WG['metalspots'].getShowValue()), description = Spring.I18N('ui.settings.option.metalspots_values_descr'), + { id = "metalspots_values", group = "ui", category = types.advanced, name = I18N('ui.settings.option.metalspots')..widgetOptionColor .. " " .. I18N('ui.settings.option.metalspots_values'), type = "bool", value = (WG['metalspots'] ~= nil and WG['metalspots'].getShowValue()), description = I18N('ui.settings.option.metalspots_values_descr'), onload = function(i) loadWidgetData("Metalspots", "metalspots_values", { 'showValues' }) end, @@ -4427,7 +4427,7 @@ function init() saveOptionValue('Metalspots', 'metalspots', 'setShowValue', { 'showValue' }, options[getOptionByID('metalspots_values')].value) end, }, - { id = "metalspots_metalviewonly", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.metalspots_metalviewonly'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.metalspots_metalviewonly_descr'), + { id = "metalspots_metalviewonly", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.metalspots_metalviewonly'), type = "bool", value = false, description = I18N('ui.settings.option.metalspots_metalviewonly_descr'), onload = function(i) loadWidgetData("Metalspots", "metalspots_metalviewonly", { 'metalViewOnly' }) end, @@ -4436,9 +4436,9 @@ function init() end, }, - { id = "geospots", group = "ui", category = types.dev, widget = "Geothermalspots", name = Spring.I18N('ui.settings.option.geospots'), type = "bool", value = GetWidgetToggleValue("Metalspots"), description = Spring.I18N('ui.settings.option.geospots_descr') }, + { id = "geospots", group = "ui", category = types.dev, widget = "Geothermalspots", name = I18N('ui.settings.option.geospots'), type = "bool", value = GetWidgetToggleValue("Metalspots"), description = I18N('ui.settings.option.geospots_descr') }, - { id = "healthbarsscale", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.healthbars') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.healthbarsscale'), type = "slider", min = 0.6, max = 2.0, step = 0.1, value = 1, description = '', + { id = "healthbarsscale", group = "ui", category = types.advanced, name = I18N('ui.settings.option.healthbars') .. widgetOptionColor .. " " .. I18N('ui.settings.option.healthbarsscale'), type = "slider", min = 0.6, max = 2.0, step = 0.1, value = 1, description = '', onload = function(i) loadWidgetData("Health Bars GL4", "healthbarsscale", { 'barScale' }) end, @@ -4446,7 +4446,7 @@ function init() saveOptionValue('Health Bars GL4', 'healthbars', 'setScale', { 'barScale' }, value) end, }, - { id = "healthbarsheight", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.healthbarsheight'), type = "slider", min = 0.7, max = 2, step = 0.1, value = (WG['healthbar'] ~= nil and WG['healthbar'].getHeight() or 0.9), description = '', + { id = "healthbarsheight", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.healthbarsheight'), type = "slider", min = 0.7, max = 2, step = 0.1, value = (WG['healthbar'] ~= nil and WG['healthbar'].getHeight() or 0.9), description = '', onload = function(i) loadWidgetData("Health Bars GL4", "healthbarsheight", { 'barHeight' }) end, @@ -4456,7 +4456,7 @@ function init() widgetHandler:EnableWidget("Health Bars GL4") end, }, - { id = "healthbarsvariable", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.healthbarsvariable'), type = "bool", value = (WG['healthbar'] ~= nil and WG['healthbar'].getVariableSizes()), description = Spring.I18N('ui.settings.option.healthbarsvariable_descr'), + { id = "healthbarsvariable", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.healthbarsvariable'), type = "bool", value = (WG['healthbar'] ~= nil and WG['healthbar'].getVariableSizes()), description = I18N('ui.settings.option.healthbarsvariable_descr'), onload = function(i) loadWidgetData("Health Bars GL4", "healthbarsvariable", { "variableBarSizes" }) end, @@ -4464,7 +4464,7 @@ function init() saveOptionValue("Health Bars GL4", "healthbars", "setVariableSizes", { "variableBarSizes" }, value) end, }, - { id = "healthbarswhenguihidden", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.healthbarswhenguihidden'), type = "bool", value = (WG['healthbar'] ~= nil and WG['healthbar'].getDrawWhenGuiHidden()), description = Spring.I18N('ui.settings.option.healthbarswhenguihidden_descr'), + { id = "healthbarswhenguihidden", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.healthbarswhenguihidden'), type = "bool", value = (WG['healthbar'] ~= nil and WG['healthbar'].getDrawWhenGuiHidden()), description = I18N('ui.settings.option.healthbarswhenguihidden_descr'), onload = function(i) loadWidgetData("Health Bars GL4", "healthbarswhenguihidden", { "drawWhenGuiHidden" }) end, @@ -4472,15 +4472,15 @@ function init() saveOptionValue("Health Bars GL4", "healthbars", "setDrawWhenGuiHidden", { "drawWhenGuiHidden" }, value) end, }, - { id = "rankicons", group = "ui", category = types.advanced, widget = "Rank Icons GL4", name = Spring.I18N('ui.settings.option.rankicons'), type = "bool", value = GetWidgetToggleValue("Rank Icons GL4"), description = Spring.I18N('ui.settings.option.rankicons_descr') }, - { id = "rankicons_distance", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.rankicons_distance'), type = "slider", min = 0.1, max = 1.5, step = 0.05, value = (WG['rankicons'] ~= nil and WG['rankicons'].getDrawDistance ~= nil and WG['rankicons'].getDrawDistance()), description = '', + { id = "rankicons", group = "ui", category = types.advanced, widget = "Rank Icons GL4", name = I18N('ui.settings.option.rankicons'), type = "bool", value = GetWidgetToggleValue("Rank Icons GL4"), description = I18N('ui.settings.option.rankicons_descr') }, + { id = "rankicons_distance", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.rankicons_distance'), type = "slider", min = 0.1, max = 1.5, step = 0.05, value = (WG['rankicons'] ~= nil and WG['rankicons'].getDrawDistance ~= nil and WG['rankicons'].getDrawDistance()), description = '', onload = function(i) end, onchange = function(i, value) saveOptionValue('Rank Icons', 'rankicons', 'setDrawDistance', { 'distanceMult' }, value) end, }, - { id = "rankicons_scale", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.rankicons_scale'), type = "slider", min = 0.5, max = 2, step = 0.1, value = (WG['rankicons'] ~= nil and WG['rankicons'].getScale ~= nil and WG['rankicons'].getScale()), description = '', + { id = "rankicons_scale", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.rankicons_scale'), type = "slider", min = 0.5, max = 2, step = 0.1, value = (WG['rankicons'] ~= nil and WG['rankicons'].getScale ~= nil and WG['rankicons'].getScale()), description = '', onload = function(i) end, onchange = function(i, value) @@ -4488,8 +4488,8 @@ function init() end, }, - { id = "allycursors", group = "ui", category = types.basic, widget = "AllyCursors", name = Spring.I18N('ui.settings.option.allycursors'), type = "bool", value = GetWidgetToggleValue("AllyCursors"), description = Spring.I18N('ui.settings.option.allycursors_descr') }, - { id = "allycursors_playername", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.allycursors_playername'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.allycursors_playername_descr'), + { id = "allycursors", group = "ui", category = types.basic, widget = "AllyCursors", name = I18N('ui.settings.option.allycursors'), type = "bool", value = GetWidgetToggleValue("AllyCursors"), description = I18N('ui.settings.option.allycursors_descr') }, + { id = "allycursors_playername", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.allycursors_playername'), type = "bool", value = true, description = I18N('ui.settings.option.allycursors_playername_descr'), onload = function(i) loadWidgetData("AllyCursors", "allycursors_playername", { 'showPlayerName' }) end, @@ -4497,7 +4497,7 @@ function init() saveOptionValue('AllyCursors', 'allycursors', 'setPlayerNames', { 'showPlayerName' }, value) end, }, - { id = "allycursors_showdot", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.allycursors_showdot'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.allycursors_showdot_descr'), + { id = "allycursors_showdot", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.allycursors_showdot'), type = "bool", value = true, description = I18N('ui.settings.option.allycursors_showdot_descr'), onload = function(i) loadWidgetData("AllyCursors", "allycursors_showdot", { 'showCursorDot' }) end, @@ -4505,7 +4505,7 @@ function init() saveOptionValue('AllyCursors', 'allycursors', 'setCursorDot', { 'showCursorDot' }, value) end, }, - { id = "allycursors_spectatorname", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.allycursors_spectatorname'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.allycursors_spectatorname_descr'), + { id = "allycursors_spectatorname", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.allycursors_spectatorname'), type = "bool", value = true, description = I18N('ui.settings.option.allycursors_spectatorname_descr'), onload = function(i) loadWidgetData("AllyCursors", "allycursors_spectatorname", { 'showSpectatorName' }) end, @@ -4513,7 +4513,7 @@ function init() saveOptionValue('AllyCursors', 'allycursors', 'setSpectatorNames', { 'showSpectatorName' }, value) end, }, - { id = "allycursors_lights", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.allycursors_lights'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.allycursors_lights_descr'), + { id = "allycursors_lights", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.allycursors_lights'), type = "bool", value = true, description = I18N('ui.settings.option.allycursors_lights_descr'), onload = function(i) loadWidgetData("AllyCursors", "allycursors_lights", { 'addLights' }) end, @@ -4521,7 +4521,7 @@ function init() saveOptionValue('AllyCursors', 'allycursors', 'setLights', { 'addLights' }, options[getOptionByID('allycursors_lights')].value) end, }, - { id = "allycursors_lightradius", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.allycursors_lightradius'), type = "slider", min = 0.15, max = 1, step = 0.05, value = 0.5, description = '', + { id = "allycursors_lightradius", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.allycursors_lightradius'), type = "slider", min = 0.15, max = 1, step = 0.05, value = 0.5, description = '', onload = function(i) loadWidgetData("AllyCursors", "allycursors_lightradius", { 'lightRadiusMult' }) end, @@ -4529,7 +4529,7 @@ function init() saveOptionValue('AllyCursors', 'allycursors', 'setLightRadius', { 'lightRadiusMult' }, value) end, }, - { id = "allycursors_lightstrength", group = "ui", category = types.dev , name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.allycursors_lightstrength'), type = "slider", min = 0.1, max = 1.2, step = 0.05, value = 0.85, description = '', + { id = "allycursors_lightstrength", group = "ui", category = types.dev , name = widgetOptionColor .. " " .. I18N('ui.settings.option.allycursors_lightstrength'), type = "slider", min = 0.1, max = 1.2, step = 0.05, value = 0.85, description = '', onload = function(i) loadWidgetData("AllyCursors", "allycursors_lightstrength", { 'lightStrengthMult' }) end, @@ -4537,7 +4537,7 @@ function init() saveOptionValue('AllyCursors', 'allycursors', 'setLightStrength', { 'lightStrengthMult' }, value) end, }, - { id = "allycursors_selfshadowing", group = "ui", category = types.dev , name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.allycursors_selfshadowing'), type = "bool", value = false, description = '', + { id = "allycursors_selfshadowing", group = "ui", category = types.dev , name = widgetOptionColor .. " " .. I18N('ui.settings.option.allycursors_selfshadowing'), type = "bool", value = false, description = '', onload = function(i) loadWidgetData("AllyCursors", "allycursors_selfshadowing", { 'lightSelfShadowing' }) end, @@ -4546,13 +4546,13 @@ function init() end, }, - { id = "showbuilderqueue", group = "ui", category = types.advanced, widget = "Show Builder Queue", name = Spring.I18N('ui.settings.option.showbuilderqueue'), type = "bool", value = GetWidgetToggleValue("Show Builder Queue"), description = Spring.I18N('ui.settings.option.showbuilderqueue_descr') }, + { id = "showbuilderqueue", group = "ui", category = types.advanced, widget = "Show Builder Queue", name = I18N('ui.settings.option.showbuilderqueue'), type = "bool", value = GetWidgetToggleValue("Show Builder Queue"), description = I18N('ui.settings.option.showbuilderqueue_descr') }, - { id = "unitenergyicons", group = "ui", category = types.advanced, widget = "Unit Energy Icons", name = Spring.I18N('ui.settings.option.unitenergyicons'), type = "bool", value = GetWidgetToggleValue("Unit Energy Icons"), description = Spring.I18N('ui.settings.option.unitenergyicons_descr') }, + { id = "unitenergyicons", group = "ui", category = types.advanced, widget = "Unit Energy Icons", name = I18N('ui.settings.option.unitenergyicons'), type = "bool", value = GetWidgetToggleValue("Unit Energy Icons"), description = I18N('ui.settings.option.unitenergyicons_descr') }, - { id = "unitidlebuildericons", group = "ui", category = types.advanced, widget = "Unit Idle Builder Icons", name = Spring.I18N('ui.settings.option.unitidlebuildericons'), type = "bool", value = GetWidgetToggleValue("Unit Idle Builder Icons"), description = Spring.I18N('ui.settings.option.unitidlebuildericons_descr') }, + { id = "unitidlebuildericons", group = "ui", category = types.advanced, widget = "Unit Idle Builder Icons", name = I18N('ui.settings.option.unitidlebuildericons'), type = "bool", value = GetWidgetToggleValue("Unit Idle Builder Icons"), description = I18N('ui.settings.option.unitidlebuildericons_descr') }, - { id = "nametags_rank", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.nametags_rank'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.nametags_rank_descr'), + { id = "nametags_rank", group = "ui", category = types.advanced, name = I18N('ui.settings.option.nametags_rank'), type = "bool", value = true, description = I18N('ui.settings.option.nametags_rank_descr'), onload = function(i) loadWidgetData("Commander Name Tags", "nametags_rank", { 'showPlayerRank' }) end, @@ -4561,9 +4561,9 @@ function init() end, }, - { id = "commandsfx", group = "ui", category = types.basic, widget = "Commands FX", name = Spring.I18N('ui.settings.option.commandsfx'), type = "bool", value = GetWidgetToggleValue("Commands FX"), description = Spring.I18N('ui.settings.option.commandsfx_descr') }, + { id = "commandsfx", group = "ui", category = types.basic, widget = "Commands FX", name = I18N('ui.settings.option.commandsfx'), type = "bool", value = GetWidgetToggleValue("Commands FX"), description = I18N('ui.settings.option.commandsfx_descr') }, - { id = "commandsfxopacity", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.commandsfxopacity'), type = "slider", min = 0.25, max = 1, step = 0.1, value = 1, description = '', + { id = "commandsfxopacity", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.commandsfxopacity'), type = "slider", min = 0.25, max = 1, step = 0.1, value = 1, description = '', onload = function(i) loadWidgetData("Commands FX", "commandsfxopacity", { 'opacity' }) end, @@ -4571,7 +4571,7 @@ function init() saveOptionValue('Commands FX', 'commandsfx', 'setOpacity', { 'opacity' }, value) end, }, - { id = "commandsfxduration", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.commandsfxduration'), type = "slider", min = 0.5, max = 2, step = 0.01, value = 1, description = '', + { id = "commandsfxduration", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.commandsfxduration'), type = "slider", min = 0.5, max = 2, step = 0.01, value = 1, description = '', onload = function(i) loadWidgetData("Commands FX", "commandsfxduration", { 'duration' }) end, @@ -4579,7 +4579,7 @@ function init() saveOptionValue('Commands FX', 'commandsfx', 'setDuration', { 'duration' }, value) end, }, - { id = "commandsfxfilterai", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.commandsfxfilterai'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.commandsfxfilterai_descr'), + { id = "commandsfxfilterai", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.commandsfxfilterai'), type = "bool", value = true, description = I18N('ui.settings.option.commandsfxfilterai_descr'), onload = function(i) loadWidgetData("Commands FX", "commandsfxfilterai", { 'filterAIteams' }) end, @@ -4587,7 +4587,7 @@ function init() saveOptionValue('Commands FX', 'commandsfx', 'setFilterAI', { 'filterAIteams' }, value) end, }, - { id = "commandsfxuseteamcolors", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.commandsfxuseteamcolors'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.commandsfxuseteamcolors_descr'), + { id = "commandsfxuseteamcolors", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.commandsfxuseteamcolors'), type = "bool", value = false, description = I18N('ui.settings.option.commandsfxuseteamcolors_descr'), onload = function(i) loadWidgetData("Commands FX", "commandsfxuseteamcolors", { 'useTeamColors' }) end, @@ -4595,7 +4595,7 @@ function init() saveOptionValue('Commands FX', 'commandsfx', 'setUseTeamColors', { 'useTeamColors' }, value) end, }, - { id = "commandsfxuseteamcolorswhenspec", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.commandsfxuseteamcolorswhenspec'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.commandsfxuseteamcolorswhenspec_descr'), + { id = "commandsfxuseteamcolorswhenspec", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.commandsfxuseteamcolorswhenspec'), type = "bool", value = false, description = I18N('ui.settings.option.commandsfxuseteamcolorswhenspec_descr'), onload = function(i) loadWidgetData("Commands FX", "commandsfxuseteamcolorswhenspec", { 'useTeamColorsWhenSpec' }) end, @@ -4605,9 +4605,9 @@ function init() }, - { id = "flankingicons", group = "ui", category = types.advanced, widget = "Flanking Icons GL4", name = Spring.I18N('ui.settings.option.flankingicons'), type = "bool", value = GetWidgetToggleValue("Flanking Icons GL4"), description = Spring.I18N('ui.settings.option.flankingicons_descr') }, + { id = "flankingicons", group = "ui", category = types.advanced, widget = "Flanking Icons GL4", name = I18N('ui.settings.option.flankingicons'), type = "bool", value = GetWidgetToggleValue("Flanking Icons GL4"), description = I18N('ui.settings.option.flankingicons_descr') }, - { id = "displaydps", group = "ui", category = types.basic, name = Spring.I18N('ui.settings.option.displaydps'), type = "bool", value = tonumber(Spring.GetConfigInt("DisplayDPS", 0) or 0) == 1, description = Spring.I18N('ui.settings.option.displaydps_descr'), + { id = "displaydps", group = "ui", category = types.basic, name = I18N('ui.settings.option.displaydps'), type = "bool", value = tonumber(Spring.GetConfigInt("DisplayDPS", 0) or 0) == 1, description = I18N('ui.settings.option.displaydps_descr'), onload = function(i) end, onchange = function(i, value) @@ -4615,11 +4615,11 @@ function init() end, }, - { id = "givenunits", group = "ui", category = types.advanced, widget = "Given Units", name = Spring.I18N('ui.settings.option.givenunits'), type = "bool", value = GetWidgetToggleValue("Given Units"), description = Spring.I18N('ui.settings.option.givenunits_descr') }, + { id = "givenunits", group = "ui", category = types.advanced, widget = "Given Units", name = I18N('ui.settings.option.givenunits'), type = "bool", value = GetWidgetToggleValue("Given Units"), description = I18N('ui.settings.option.givenunits_descr') }, - { id = "reclaimfieldhighlight", group = "ui", category = types.advanced, widget = "Reclaim Field Highlight", name = Spring.I18N('ui.settings.option.reclaimfieldhighlight'), type = "bool", description = Spring.I18N('ui.settings.option.reclaimfieldhighlight_descr') }, + { id = "reclaimfieldhighlight", group = "ui", category = types.advanced, widget = "Reclaim Field Highlight", name = I18N('ui.settings.option.reclaimfieldhighlight'), type = "bool", description = I18N('ui.settings.option.reclaimfieldhighlight_descr') }, - { id = "reclaimfieldhighlight_metal", group = "ui", category = types.advanced, widget = "Reclaim Field Highlight", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.reclaimfieldhighlight_metal'), type = "select", options = reclaimFieldHighlightOptions, value = 3, description = Spring.I18N('ui.settings.option.reclaimfieldhighlight_metal_descr'), + { id = "reclaimfieldhighlight_metal", group = "ui", category = types.advanced, widget = "Reclaim Field Highlight", name = widgetOptionColor .. " " .. I18N('ui.settings.option.reclaimfieldhighlight_metal'), type = "select", options = reclaimFieldHighlightOptions, value = 3, description = I18N('ui.settings.option.reclaimfieldhighlight_metal_descr'), onload = function(i) loadWidgetData("Reclaim Field Highlight", "reclaimfieldhighlight_metal", { 'showOption' }) end, @@ -4628,7 +4628,7 @@ function init() end, }, - { id = "reclaimfieldhighlight_energy", group = "ui", category = types.advanced, widget = "Reclaim Field Highlight", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.reclaimfieldhighlight_energy'), type = "select", options = reclaimFieldHighlightOptions, value = 3, description = Spring.I18N('ui.settings.option.reclaimfieldhighlight_energy_descr'), + { id = "reclaimfieldhighlight_energy", group = "ui", category = types.advanced, widget = "Reclaim Field Highlight", name = widgetOptionColor .. " " .. I18N('ui.settings.option.reclaimfieldhighlight_energy'), type = "select", options = reclaimFieldHighlightOptions, value = 3, description = I18N('ui.settings.option.reclaimfieldhighlight_energy_descr'), onload = function(i) loadWidgetData("Reclaim Field Highlight", "reclaimfieldhighlight_energy", { 'showEnergyOption' }) end, @@ -4637,8 +4637,8 @@ function init() end, }, - { id = "highlightcomwrecks", group = "ui", category = types.advanced, widget = "Highlight Commander Wrecks", name = Spring.I18N('ui.settings.option.highlightcomwrecks'), type = "bool", value = GetWidgetToggleValue("Highlight Commander Wrecks"), description = Spring.I18N('ui.settings.option.highlightcomwrecks_descr') }, - { id = "highlightcomwrecks_teamcolor", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.highlightcomwrecks_teamcolor'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.highlightcomwrecks_teamcolor_descr'), + { id = "highlightcomwrecks", group = "ui", category = types.advanced, widget = "Highlight Commander Wrecks", name = I18N('ui.settings.option.highlightcomwrecks'), type = "bool", value = GetWidgetToggleValue("Highlight Commander Wrecks"), description = I18N('ui.settings.option.highlightcomwrecks_descr') }, + { id = "highlightcomwrecks_teamcolor", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.highlightcomwrecks_teamcolor'), type = "bool", value = true, description = I18N('ui.settings.option.highlightcomwrecks_teamcolor_descr'), onload = function(i) loadWidgetData("Highlight Commander Wrecks", "highlightcomwrecks_teamcolor", { 'useTeamColor' }) end, @@ -4647,8 +4647,8 @@ function init() end, }, - { id = "buildinggrid", group = "ui", category = types.basic, widget = "Building Grid GL4", name = Spring.I18N('ui.settings.option.buildinggrid'), type = "bool", value = GetWidgetToggleValue("Building Grid GL4"), description = Spring.I18N('ui.settings.option.buildinggrid_descr') }, - { id = "buildinggridopacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.buildinggridopacity'), type = "slider", min = 0.3, max = 1, step = 0.05, value = (WG['buildinggrid'] ~= nil and WG['buildinggrid'].getOpacity ~= nil and WG['buildinggrid'].getOpacity()) or 1, description = '', + { id = "buildinggrid", group = "ui", category = types.basic, widget = "Building Grid GL4", name = I18N('ui.settings.option.buildinggrid'), type = "bool", value = GetWidgetToggleValue("Building Grid GL4"), description = I18N('ui.settings.option.buildinggrid_descr') }, + { id = "buildinggridopacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.buildinggridopacity'), type = "slider", min = 0.3, max = 1, step = 0.05, value = (WG['buildinggrid'] ~= nil and WG['buildinggrid'].getOpacity ~= nil and WG['buildinggrid'].getOpacity()) or 1, description = '', onload = function(i) loadWidgetData("Building Grid GL4", "buildinggridopacity", { 'opacity' }) end, @@ -4662,16 +4662,16 @@ function init() end end, }, - { id = "startpositionsuggestions", group = "ui", category = types.basic, widget = "Start Position Suggestions", name = Spring.I18N('ui.settings.option.startpositionsuggestions'), type = "bool", value = GetWidgetToggleValue("Start Position Suggestions"), description = Spring.I18N('ui.settings.option.startpositionsuggestions_descr') }, + { id = "startpositionsuggestions", group = "ui", category = types.basic, widget = "Start Position Suggestions", name = I18N('ui.settings.option.startpositionsuggestions'), type = "bool", value = GetWidgetToggleValue("Start Position Suggestions"), description = I18N('ui.settings.option.startpositionsuggestions_descr') }, - { id = "label_ui_ranges", group = "ui", name = Spring.I18N('ui.settings.option.label_ranges'), category = types.basic }, + { id = "label_ui_ranges", group = "ui", name = I18N('ui.settings.option.label_ranges'), category = types.basic }, { id = "label_ui_ranges_spacer", group = "ui", category = types.basic }, -- Radar range rings: - { id = "radarrange", group = "ui", category = types.advanced, widget = "Sensor Ranges Radar", name = Spring.I18N('ui.settings.option.radarrange'), type = "bool", value = GetWidgetToggleValue("Sensor Ranges Radar"), description = Spring.I18N('ui.settings.option.radarrange_descr') }, + { id = "radarrange", group = "ui", category = types.advanced, widget = "Sensor Ranges Radar", name = I18N('ui.settings.option.radarrange'), type = "bool", value = GetWidgetToggleValue("Sensor Ranges Radar"), description = I18N('ui.settings.option.radarrange_descr') }, - { id = "radarrangeopacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.radarrangeopacity'), type = "slider", min = 0.01, max = 0.33, step = 0.01, value = (WG['radarrange'] ~= nil and WG['radarrange'].getOpacity ~= nil and WG['radarrange'].getOpacity()) or 0.08, description = '', + { id = "radarrangeopacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.radarrangeopacity'), type = "slider", min = 0.01, max = 0.33, step = 0.01, value = (WG['radarrange'] ~= nil and WG['radarrange'].getOpacity ~= nil and WG['radarrange'].getOpacity()) or 0.08, description = '', onload = function(i) loadWidgetData("Sensor Ranges Radar", "radarrangeopacity", { 'opacity' }) end, @@ -4680,9 +4680,9 @@ function init() end, }, -- Sonar range - { id = "sonarrange", group = "ui", category = types.advanced, widget = "Sensor Ranges Sonar", name = Spring.I18N('ui.settings.option.sonarrange'), type = "bool", value = GetWidgetToggleValue("Sensor Ranges Sonar"), description = Spring.I18N('ui.settings.option.sonarrange_descr') }, + { id = "sonarrange", group = "ui", category = types.advanced, widget = "Sensor Ranges Sonar", name = I18N('ui.settings.option.sonarrange'), type = "bool", value = GetWidgetToggleValue("Sensor Ranges Sonar"), description = I18N('ui.settings.option.sonarrange_descr') }, - { id = "sonarrangeopacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sonarrangeopacity'), type = "slider", min = 0.01, max = 0.33, step = 0.01, value = (WG['sonarrange'] ~= nil and WG['sonarrange'].getOpacity ~= nil and WG['sonarrange'].getOpacity()) or 0.08, description = '', + { id = "sonarrangeopacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.sonarrangeopacity'), type = "slider", min = 0.01, max = 0.33, step = 0.01, value = (WG['sonarrange'] ~= nil and WG['sonarrange'].getOpacity ~= nil and WG['sonarrange'].getOpacity()) or 0.08, description = '', onload = function(i) loadWidgetData("Sensor Ranges Sonar", "sonarrangeopacity", { 'opacity' }) end, @@ -4691,9 +4691,9 @@ function init() end, }, -- Jammer range - { id = "jammerrange", group = "ui", category = types.advanced, widget = "Sensor Ranges Jammer", name = Spring.I18N('ui.settings.option.jammerrange'), type = "bool", value = GetWidgetToggleValue("Sensor Ranges Jammer"), description = Spring.I18N('ui.settings.option.jammerrange_descr') }, + { id = "jammerrange", group = "ui", category = types.advanced, widget = "Sensor Ranges Jammer", name = I18N('ui.settings.option.jammerrange'), type = "bool", value = GetWidgetToggleValue("Sensor Ranges Jammer"), description = I18N('ui.settings.option.jammerrange_descr') }, - { id = "jammerrangeopacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.jammerrangeopacity'), type = "slider", min = 0.01, max = 0.66, step = 0.01, value = (WG['jammerrange'] ~= nil and WG['jammerrange'].getOpacity ~= nil and WG['jammerrange'].getOpacity()) or 0.08, description = '', + { id = "jammerrangeopacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.jammerrangeopacity'), type = "slider", min = 0.01, max = 0.66, step = 0.01, value = (WG['jammerrange'] ~= nil and WG['jammerrange'].getOpacity ~= nil and WG['jammerrange'].getOpacity()) or 0.08, description = '', onload = function(i) loadWidgetData("Sensor Ranges Jammer", "jammerrangeopacity", { 'opacity' }) end, @@ -4702,9 +4702,9 @@ function init() end, }, -- LOS Range: - { id = "losrange", group = "ui", category = types.advanced, widget = "Sensor Ranges LOS", name = Spring.I18N('ui.settings.option.losrange'), type = "bool", value = GetWidgetToggleValue("Sensor Ranges LOS"), description = Spring.I18N('ui.settings.option.losrange_descr') }, + { id = "losrange", group = "ui", category = types.advanced, widget = "Sensor Ranges LOS", name = I18N('ui.settings.option.losrange'), type = "bool", value = GetWidgetToggleValue("Sensor Ranges LOS"), description = I18N('ui.settings.option.losrange_descr') }, - { id = "losrangeopacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.losrangeopacity'), type = "slider", min = 0.01, max = 0.33, step = 0.01, value = (WG['losrange'] ~= nil and WG['losrange'].getOpacity ~= nil and WG['losrange'].getOpacity()) or 0.08, description = '', + { id = "losrangeopacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.losrangeopacity'), type = "slider", min = 0.01, max = 0.33, step = 0.01, value = (WG['losrange'] ~= nil and WG['losrange'].getOpacity ~= nil and WG['losrange'].getOpacity()) or 0.08, description = '', onload = function(i) loadWidgetData("Sensor Ranges LOS", "losrangeopacity", { 'opacity' }) end, @@ -4712,7 +4712,7 @@ function init() saveOptionValue('Sensor Ranges LOS', 'losrange', 'setOpacity', { 'opacity' }, value) end, }, - { id = "losrangeteamcolors", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.losrangeteamcolors'), type = "bool", value = (WG['losrange'] ~= nil and WG['losrange'].getUseTeamColors ~= nil and WG['losrange'].getUseTeamColors()), description = '', + { id = "losrangeteamcolors", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.losrangeteamcolors'), type = "bool", value = (WG['losrange'] ~= nil and WG['losrange'].getUseTeamColors ~= nil and WG['losrange'].getUseTeamColors()), description = '', onload = function(i) loadWidgetData("Sensor Ranges LOS", "losrangeteamcolors", { 'useteamcolors' }) end, @@ -4721,8 +4721,8 @@ function init() end, }, - { id = "attackrange", group = "ui", category = types.basic, widget = "Attack Range GL4", name = Spring.I18N('ui.settings.option.attackrange'), type = "bool", value = GetWidgetToggleValue("Attack Range GL4"), description = Spring.I18N('ui.settings.option.attackrange_descr') }, - { id = "attackrange_shiftonly", category = types.dev, group = "ui", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.attackrange_shiftonly'), type = "bool", value = (WG['attackrange'] ~= nil and WG['attackrange'].getShiftOnly ~= nil and WG['attackrange'].getShiftOnly()), description = Spring.I18N('ui.settings.option.attackrange_shiftonly_descr'), + { id = "attackrange", group = "ui", category = types.basic, widget = "Attack Range GL4", name = I18N('ui.settings.option.attackrange'), type = "bool", value = GetWidgetToggleValue("Attack Range GL4"), description = I18N('ui.settings.option.attackrange_descr') }, + { id = "attackrange_shiftonly", category = types.dev, group = "ui", name = widgetOptionColor .. " " .. I18N('ui.settings.option.attackrange_shiftonly'), type = "bool", value = (WG['attackrange'] ~= nil and WG['attackrange'].getShiftOnly ~= nil and WG['attackrange'].getShiftOnly()), description = I18N('ui.settings.option.attackrange_shiftonly_descr'), onload = function(i) loadWidgetData("Attack Range GL4", "attackrange_shiftonly", { 'shift_only' }) end, @@ -4730,7 +4730,7 @@ function init() saveOptionValue('Attack Range GL4', 'attackrange', 'setShiftOnly', { 'shift_only' }, value) end, }, - { id = "attackrange_cursorunitrange", category = types.dev, group = "ui", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.attackrange_cursorunitrange'), type = "bool", value = (WG['attackrange'] ~= nil and WG['attackrange'].getCursorUnitRange ~= nil and WG['attackrange'].getCursorUnitRange()), description = Spring.I18N('ui.settings.option.attackrange_cursorunitrange_descr'), + { id = "attackrange_cursorunitrange", category = types.dev, group = "ui", name = widgetOptionColor .. " " .. I18N('ui.settings.option.attackrange_cursorunitrange'), type = "bool", value = (WG['attackrange'] ~= nil and WG['attackrange'].getCursorUnitRange ~= nil and WG['attackrange'].getCursorUnitRange()), description = I18N('ui.settings.option.attackrange_cursorunitrange_descr'), onload = function(i) loadWidgetData("Attack Range GL4", "attackrange_cursorunitrange", { 'cursor_unit_range' }) end, @@ -4738,7 +4738,7 @@ function init() saveOptionValue('Attack Range GL4', 'attackrange', 'setCursorUnitRange', { 'cursor_unit_range' }, value) end, }, - { id = "attackrange_numrangesmult", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.attackrange_numrangesmult'), type = "slider", min = 0.3, max = 1, step = 0.1, value = (WG['attackrange'] ~= nil and WG['attackrange'].getOpacity ~= nil and WG['attackrange'].getNumRangesMult()) or 1, description = Spring.I18N('ui.settings.option.attackrange_numrangesmult_descr'), + { id = "attackrange_numrangesmult", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.attackrange_numrangesmult'), type = "slider", min = 0.3, max = 1, step = 0.1, value = (WG['attackrange'] ~= nil and WG['attackrange'].getOpacity ~= nil and WG['attackrange'].getNumRangesMult()) or 1, description = I18N('ui.settings.option.attackrange_numrangesmult_descr'), onload = function(i) loadWidgetData("Attack Range GL4", "attackrange_numrangesmult", { 'selectionDisableThresholdMult' }) end, @@ -4747,9 +4747,9 @@ function init() end, }, - { id = "defrange", group = "ui", category = types.basic, widget = "Defense Range GL4", name = Spring.I18N('ui.settings.option.defrange'), type = "bool", value = GetWidgetToggleValue("Defense Range GL4"), description = Spring.I18N('ui.settings.option.defrange_descr') }, + { id = "defrange", group = "ui", category = types.basic, widget = "Defense Range GL4", name = I18N('ui.settings.option.defrange'), type = "bool", value = GetWidgetToggleValue("Defense Range GL4"), description = I18N('ui.settings.option.defrange_descr') }, - { id = "defrange_allyair", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.defrange_allyair'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getAllyAir ~= nil and WG['defrange'].getAllyAir()), description = Spring.I18N('ui.settings.option.defrange_allyair_descr'), + { id = "defrange_allyair", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.defrange_allyair'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getAllyAir ~= nil and WG['defrange'].getAllyAir()), description = I18N('ui.settings.option.defrange_allyair_descr'), onload = function(i) loadWidgetData("Defense Range GL4", "defrange_allyair", { 'enabled', 'ally', 'air' }) end, @@ -4758,7 +4758,7 @@ function init() saveOptionValue('Defense Range GL4', 'defrange', 'setAllyAir', { 'enabled', 'ally', 'air' }, value) end, }, - { id = "defrange_allyground", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.defrange_allyground'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getAllyGround ~= nil and WG['defrange'].getAllyGround()), description = Spring.I18N('ui.settings.option.defrange_allyground_descr'), + { id = "defrange_allyground", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.defrange_allyground'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getAllyGround ~= nil and WG['defrange'].getAllyGround()), description = I18N('ui.settings.option.defrange_allyground_descr'), onload = function(i) loadWidgetData("Defense Range GL4", "defrange_allyground", { 'enabled', 'ally', 'ground' }) loadWidgetData("Defense Range GL4", "defrange_allycannon", { 'enabled', 'ally', 'cannon' }) @@ -4769,7 +4769,7 @@ function init() saveOptionValue('Defense Range GL4', 'defrange', 'setAllyGround', { 'enabled', 'ally', 'cannon' }, value) end, }, - { id = "defrange_allynuke", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.defrange_allynuke'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getAllyNuke ~= nil and WG['defrange'].getAllyNuke()), description = Spring.I18N('ui.settings.option.defrange_allynuke_descr'), + { id = "defrange_allynuke", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.defrange_allynuke'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getAllyNuke ~= nil and WG['defrange'].getAllyNuke()), description = I18N('ui.settings.option.defrange_allynuke_descr'), onload = function(i) loadWidgetData("Defense Range GL4", "defrange_allynuke", { 'enabled', 'ally', 'nuke' }) end, @@ -4778,7 +4778,7 @@ function init() saveOptionValue('Defense Range GL4', 'defrange', 'setAllyNuke', { 'enabled', 'ally', 'nuke' }, value) end, }, - { id = "defrange_allylrpc", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.defrange_allylrpc'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getAllyLRPC ~= nil and WG['defrange'].getAllyLRPC()), description = Spring.I18N('ui.settings.option.defrange_allylrpc_descr'), + { id = "defrange_allylrpc", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.defrange_allylrpc'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getAllyLRPC ~= nil and WG['defrange'].getAllyLRPC()), description = I18N('ui.settings.option.defrange_allylrpc_descr'), onload = function(i) loadWidgetData("Defense Range GL4", "defrange_allylrpc", { 'enabled', 'ally', 'lrpc' }) end, @@ -4787,7 +4787,7 @@ function init() saveOptionValue('Defense Range GL4', 'defrange', 'setAllyLRPC', { 'enabled', 'ally', 'lrpc' }, value) end, }, - { id = "defrange_enemyair", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.defrange_enemyair'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getEnemyAir ~= nil and WG['defrange'].getEnemyAir()), description = Spring.I18N('ui.settings.option.defrange_enemyair_descr'), + { id = "defrange_enemyair", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.defrange_enemyair'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getEnemyAir ~= nil and WG['defrange'].getEnemyAir()), description = I18N('ui.settings.option.defrange_enemyair_descr'), onload = function(i) loadWidgetData("Defense Range GL4", "defrange_enemyair", { 'enabled', 'enemy', 'air' }) end, @@ -4796,7 +4796,7 @@ function init() saveOptionValue('Defense Range GL4', 'defrange', 'setEnemyAir', { 'enabled', 'enemy', 'air' }, value) end, }, - { id = "defrange_enemyground", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.defrange_enemyground'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getEnemyGround ~= nil and WG['defrange'].getEnemyGround()), description = Spring.I18N('ui.settings.option.defrange_enemyground_descr'), + { id = "defrange_enemyground", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.defrange_enemyground'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getEnemyGround ~= nil and WG['defrange'].getEnemyGround()), description = I18N('ui.settings.option.defrange_enemyground_descr'), onload = function(i) loadWidgetData("Defense Range GL4", "defrange_enemyground", { 'enabled', 'enemy', 'ground' }) loadWidgetData("Defense Range GL4", "defrange_enemyground", { 'enabled', 'enemy', 'cannon' }) @@ -4807,7 +4807,7 @@ function init() saveOptionValue('Defense Range GL4', 'defrange', 'setEnemyGround', { 'enabled', 'enemy', 'cannon' }, value) end, }, - { id = "defrange_enemynuke", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.defrange_enemynuke'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getEnemyNuke ~= nil and WG['defrange'].getEnemyNuke()), description = Spring.I18N('ui.settings.option.defrange_enemynuke_descr'), + { id = "defrange_enemynuke", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.defrange_enemynuke'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getEnemyNuke ~= nil and WG['defrange'].getEnemyNuke()), description = I18N('ui.settings.option.defrange_enemynuke_descr'), onload = function(i) loadWidgetData("Defense Range GL4", "defrange_enemynuke", { 'enabled', 'enemy', 'nuke' }) end, @@ -4816,7 +4816,7 @@ function init() saveOptionValue('Defense Range GL4', 'defrange', 'setEnemyNuke', { 'enabled', 'enemy', 'nuke' }, value) end, }, - { id = "defrange_enemylrpc", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.defrange_enemylrpc'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getEnemyLRPC ~= nil and WG['defrange'].getEnemyLRPC()), description = Spring.I18N('ui.settings.option.defrange_enemylrpc_descr'), + { id = "defrange_enemylrpc", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.defrange_enemylrpc'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getEnemyLRPC ~= nil and WG['defrange'].getEnemyLRPC()), description = I18N('ui.settings.option.defrange_enemylrpc_descr'), onload = function(i) loadWidgetData("Defense Range GL4", "defrange_enemylrpc", { 'enabled', 'enemy', 'lrpc' }) end, @@ -4826,13 +4826,13 @@ function init() end, }, - { id = "antiranges", group = "ui", category = types.advanced, widget = "Anti Ranges", name = Spring.I18N('ui.settings.option.antiranges'), type = "bool", value = GetWidgetToggleValue("Anti Ranges"), description = Spring.I18N('ui.settings.option.antiranges_descr') }, + { id = "antiranges", group = "ui", category = types.advanced, widget = "Anti Ranges", name = I18N('ui.settings.option.antiranges'), type = "bool", value = GetWidgetToggleValue("Anti Ranges"), description = I18N('ui.settings.option.antiranges_descr') }, - { id = "label_ui_spectator", group = "ui", name = Spring.I18N('ui.settings.option.label_spectator'), category = types.basic }, + { id = "label_ui_spectator", group = "ui", name = I18N('ui.settings.option.label_spectator'), category = types.basic }, { id = "label_ui_spectator_spacer", group = "ui", category = types.basic }, - { id = "spectator_hud", group = "ui", category = types.basic, widget = "Spectator HUD", name = Spring.I18N('ui.settings.option.spectator_hud'), type = "bool", value = GetWidgetToggleValue("Spectator HUD"), description = Spring.I18N('ui.settings.option.spectator_hud_descr') }, - { id = "spectator_hud_size", group = "ui", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.spectator_hud_size'), type = "slider", min = 0.1, max = 2, step = 0.1, value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getWidgetSize ~= nil and WG['spectator_hud'].getWidgetSize()) or 0.8, description = '', + { id = "spectator_hud", group = "ui", category = types.basic, widget = "Spectator HUD", name = I18N('ui.settings.option.spectator_hud'), type = "bool", value = GetWidgetToggleValue("Spectator HUD"), description = I18N('ui.settings.option.spectator_hud_descr') }, + { id = "spectator_hud_size", group = "ui", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.spectator_hud_size'), type = "slider", min = 0.1, max = 2, step = 0.1, value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getWidgetSize ~= nil and WG['spectator_hud'].getWidgetSize()) or 0.8, description = '', onload = function(i) loadWidgetData("Spectator HUD", "spectator_hud_size", { 'widgetScale' }) end, @@ -4841,7 +4841,7 @@ function init() end, }, - { id = "spectator_hud_config", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.spectator_hud_config'), type = "select", options = spectatorHUDConfigOptions, value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getConfig ~= nil and WG['spectator_hud'].getConfig()) or 1, description = Spring.I18N('ui.settings.option.spectator_hud_config_descr'), + { id = "spectator_hud_config", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.settings.option.spectator_hud_config'), type = "select", options = spectatorHUDConfigOptions, value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getConfig ~= nil and WG['spectator_hud'].getConfig()) or 1, description = I18N('ui.settings.option.spectator_hud_config_descr'), onload = function(i) loadWidgetData("Spectator HUD", "spectator_hud_config", { 'config' }) end, @@ -4851,7 +4851,7 @@ function init() end, }, - { id = "spectator_hud_metric_metalIncome", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.metalIncome_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('metalIncome')) or 1, description = Spring.I18N('ui.spectator_hud.metalIncome_tooltip'), + { id = "spectator_hud_metric_metalIncome", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.spectator_hud.metalIncome_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('metalIncome')) or 1, description = I18N('ui.spectator_hud.metalIncome_tooltip'), onload = function(i) loadWidgetData("Spectator HUD", "spectator_hud_metric_metalIncome", { 'metricsEnabled', 'metalIncome' }) end, @@ -4859,7 +4859,7 @@ function init() saveOptionValue('Spectator HUD', 'spectator_hud', 'setMetricEnabled', { 'metricsEnabled', 'metalIncome' }, value, { 'metalIncome', value }) end, }, - { id = "spectator_hud_metric_energyIncome", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.energyIncome_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('energyIncome')) or 1, description = Spring.I18N('ui.spectator_hud.energyIncome_tooltip'), + { id = "spectator_hud_metric_energyIncome", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.spectator_hud.energyIncome_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('energyIncome')) or 1, description = I18N('ui.spectator_hud.energyIncome_tooltip'), onload = function(i) loadWidgetData("Spectator HUD", "spectator_hud_metric_energyIncome", { 'metricsEnabled', 'energyIncome' }) end, @@ -4867,7 +4867,7 @@ function init() saveOptionValue('Spectator HUD', 'spectator_hud', 'setMetricEnabled', { 'metricsEnabled', 'energyIncome' }, value, { 'energyIncome', value }) end, }, - { id = "spectator_hud_metric_buildPower", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.buildPower_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('buildPower')) or 1, description = Spring.I18N('ui.spectator_hud.buildPower_tooltip'), + { id = "spectator_hud_metric_buildPower", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.spectator_hud.buildPower_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('buildPower')) or 1, description = I18N('ui.spectator_hud.buildPower_tooltip'), onload = function(i) loadWidgetData("Spectator HUD", "spectator_hud_metric_buildPower", { 'metricsEnabled', 'buildPower' }) end, @@ -4875,7 +4875,7 @@ function init() saveOptionValue('Spectator HUD', 'spectator_hud', 'setMetricEnabled', { 'metricsEnabled', 'buildPower' }, value, { 'buildPower', value }) end, }, - { id = "spectator_hud_metric_metalProduced", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.metalProduced_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('metalProduced')) or 1, description = Spring.I18N('ui.spectator_hud.metalProduced_tooltip'), + { id = "spectator_hud_metric_metalProduced", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.spectator_hud.metalProduced_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('metalProduced')) or 1, description = I18N('ui.spectator_hud.metalProduced_tooltip'), onload = function(i) loadWidgetData("Spectator HUD", "spectator_hud_metric_metalProduced", { 'metricsEnabled', 'metalProduced' }) end, @@ -4883,7 +4883,7 @@ function init() saveOptionValue('Spectator HUD', 'spectator_hud', 'setMetricEnabled', { 'metricsEnabled', 'metalProduced' }, value, { 'metalProduced', value }) end, }, - { id = "spectator_hud_metric_energyProduced", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.energyProduced_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('energyProduced')) or 1, description = Spring.I18N('ui.spectator_hud.energyProduced_tooltip'), + { id = "spectator_hud_metric_energyProduced", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.spectator_hud.energyProduced_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('energyProduced')) or 1, description = I18N('ui.spectator_hud.energyProduced_tooltip'), onload = function(i) loadWidgetData("Spectator HUD", "spectator_hud_metric_energyProduced", { 'metricsEnabled', 'energyProduced' }) end, @@ -4891,7 +4891,7 @@ function init() saveOptionValue('Spectator HUD', 'spectator_hud', 'setMetricEnabled', { 'metricsEnabled', 'energyProduced' }, value, { 'energyProduced', value }) end, }, - { id = "spectator_hud_metric_metalExcess", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.metalExcess_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('metalExcess')) or 1, description = Spring.I18N('ui.spectator_hud.metalExcess_tooltip'), + { id = "spectator_hud_metric_metalExcess", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.spectator_hud.metalExcess_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('metalExcess')) or 1, description = I18N('ui.spectator_hud.metalExcess_tooltip'), onload = function(i) loadWidgetData("Spectator HUD", "spectator_hud_metric_metalExcess", { 'metricsEnabled', 'metalExcess' }) end, @@ -4899,7 +4899,7 @@ function init() saveOptionValue('Spectator HUD', 'spectator_hud', 'setMetricEnabled', { 'metricsEnabled', 'metalExcess' }, value, { 'metalExcess', value }) end, }, - { id = "spectator_hud_metric_energyExcess", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.energyExcess_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('energyExcess')) or 1, description = Spring.I18N('ui.spectator_hud.energyExcess_tooltip'), + { id = "spectator_hud_metric_energyExcess", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.spectator_hud.energyExcess_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('energyExcess')) or 1, description = I18N('ui.spectator_hud.energyExcess_tooltip'), onload = function(i) loadWidgetData("Spectator HUD", "spectator_hud_metric_energyExcess", { 'metricsEnabled', 'energyExcess' }) end, @@ -4907,7 +4907,7 @@ function init() saveOptionValue('Spectator HUD', 'spectator_hud', 'setMetricEnabled', { 'metricsEnabled', 'energyExcess' }, value, { 'energyExcess', value }) end, }, - { id = "spectator_hud_metric_armyValue", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.armyValue_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('armyValue')) or 1, description = Spring.I18N('ui.spectator_hud.armyValue_tooltip'), + { id = "spectator_hud_metric_armyValue", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.spectator_hud.armyValue_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('armyValue')) or 1, description = I18N('ui.spectator_hud.armyValue_tooltip'), onload = function(i) loadWidgetData("Spectator HUD", "spectator_hud_metric_armyValue", { 'metricsEnabled', 'armyValue' }) end, @@ -4915,7 +4915,7 @@ function init() saveOptionValue('Spectator HUD', 'spectator_hud', 'setMetricEnabled', { 'metricsEnabled', 'armyValue' }, value, { 'armyValue', value }) end, }, - { id = "spectator_hud_metric_defenseValue", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.defenseValue_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('defenseValue')) or 1, description = Spring.I18N('ui.spectator_hud.defenseValue_tooltip'), + { id = "spectator_hud_metric_defenseValue", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.spectator_hud.defenseValue_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('defenseValue')) or 1, description = I18N('ui.spectator_hud.defenseValue_tooltip'), onload = function(i) loadWidgetData("Spectator HUD", "spectator_hud_metric_defenseValue", { 'metricsEnabled', 'defenseValue' }) end, @@ -4923,7 +4923,7 @@ function init() saveOptionValue('Spectator HUD', 'spectator_hud', 'setMetricEnabled', { 'metricsEnabled', 'defenseValue' }, value, { 'defenseValue', value }) end, }, - { id = "spectator_hud_metric_utilityValue", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.utilityValue_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('utilityValue')) or 1, description = Spring.I18N('ui.spectator_hud.utilityValue_tooltip'), + { id = "spectator_hud_metric_utilityValue", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.spectator_hud.utilityValue_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('utilityValue')) or 1, description = I18N('ui.spectator_hud.utilityValue_tooltip'), onload = function(i) loadWidgetData("Spectator HUD", "spectator_hud_metric_utilityValue", { 'metricsEnabled', 'utilityValue' }) end, @@ -4931,7 +4931,7 @@ function init() saveOptionValue('Spectator HUD', 'spectator_hud', 'setMetricEnabled', { 'metricsEnabled', 'utilityValue' }, value, { 'utilityValue', value }) end, }, - { id = "spectator_hud_metric_economyValue", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.economyValue_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('economyValue')) or 1, description = Spring.I18N('ui.spectator_hud.economyValue_tooltip'), + { id = "spectator_hud_metric_economyValue", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.spectator_hud.economyValue_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('economyValue')) or 1, description = I18N('ui.spectator_hud.economyValue_tooltip'), onload = function(i) loadWidgetData("Spectator HUD", "spectator_hud_metric_economyValue", { 'metricsEnabled', 'economyValue' }) end, @@ -4939,7 +4939,7 @@ function init() saveOptionValue('Spectator HUD', 'spectator_hud', 'setMetricEnabled', { 'metricsEnabled', 'economyValue' }, value, { 'economyValue', value }) end, }, - { id = "spectator_hud_metric_damageDealt", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.damageDealt_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('damageDealt')) or 1, description = Spring.I18N('ui.spectator_hud.damageDealt_tooltip'), + { id = "spectator_hud_metric_damageDealt", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. I18N('ui.spectator_hud.damageDealt_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('damageDealt')) or 1, description = I18N('ui.spectator_hud.damageDealt_tooltip'), onload = function(i) loadWidgetData("Spectator HUD", "spectator_hud_metric_damageDealt", { 'metricsEnabled', 'damageDealt' }) end, @@ -4948,10 +4948,10 @@ function init() end, }, - { id = "label_ui_developer", group = "ui", name = Spring.I18N('ui.settings.option.label_developer'), category = types.advanced }, + { id = "label_ui_developer", group = "ui", name = I18N('ui.settings.option.label_developer'), category = types.advanced }, { id = "label_ui_developer_spacer", group = "ui", category = types.advanced }, - { id = "devmode", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.devmode'), type = "bool", value = devUI, description = Spring.I18N('ui.settings.option.devmode_descr'), + { id = "devmode", group = "ui", category = types.advanced, name = I18N('ui.settings.option.devmode'), type = "bool", value = devUI, description = I18N('ui.settings.option.devmode_descr'), onchange = function(i, value) devUI = value Spring.SetConfigInt("DevUI", value and 1 or 0) @@ -4960,7 +4960,7 @@ function init() }, -- GAME - { id = "networksmoothing", restart = true, category = types.basic, group = "game", name = Spring.I18N('ui.settings.option.networksmoothing'), type = "bool", value = useNetworkSmoothing, description = Spring.I18N('ui.settings.option.networksmoothing_descr'), + { id = "networksmoothing", restart = true, category = types.basic, group = "game", name = I18N('ui.settings.option.networksmoothing'), type = "bool", value = useNetworkSmoothing, description = I18N('ui.settings.option.networksmoothing_descr'), onload = function(i) options[i].onchange(i, options[i].value) end, @@ -4983,9 +4983,9 @@ function init() end end, }, - { id = "autoquit", group = "game", category = types.basic, widget = "Autoquit", name = Spring.I18N('ui.settings.option.autoquit'), type = "bool", value = GetWidgetToggleValue("Autoquit"), description = Spring.I18N('ui.settings.option.autoquit_descr') }, + { id = "autoquit", group = "game", category = types.basic, widget = "Autoquit", name = I18N('ui.settings.option.autoquit'), type = "bool", value = GetWidgetToggleValue("Autoquit"), description = I18N('ui.settings.option.autoquit_descr') }, - { id = "singleplayerpause", group = "game", category = types.advanced, name = Spring.I18N('ui.settings.option.singleplayerpause'), type = "bool", value = pauseGameWhenSingleplayer, description = Spring.I18N('ui.settings.option.singleplayerpause_descr'), + { id = "singleplayerpause", group = "game", category = types.advanced, name = I18N('ui.settings.option.singleplayerpause'), type = "bool", value = pauseGameWhenSingleplayer, description = I18N('ui.settings.option.singleplayerpause_descr'), onchange = function(i, value) pauseGameWhenSingleplayer = value if (isSinglePlayer or isReplay) and show then @@ -5000,50 +5000,50 @@ function init() end, }, - { id = "catchupsmoothness", group = "game", category = types.dev, name = Spring.I18N('ui.settings.option.catchupsmoothness'), restart = true, type = "slider", min = 0.05, max = 0.3, step = 0.01, value = Spring.GetConfigFloat("MinSimDrawBalance", 0.15), description = Spring.I18N('ui.settings.option.catchupsmoothness_descr'), + { id = "catchupsmoothness", group = "game", category = types.dev, name = I18N('ui.settings.option.catchupsmoothness'), restart = true, type = "slider", min = 0.05, max = 0.3, step = 0.01, value = Spring.GetConfigFloat("MinSimDrawBalance", 0.15), description = I18N('ui.settings.option.catchupsmoothness_descr'), onchange = function(i, value) Spring.SetConfigFloat("MinSimDrawBalance", value) end, }, - { id = "catchupminfps", group = "game", category = types.dev, name = Spring.I18N('ui.settings.option.catchupminfps'), restart = true, type = "slider", min = 2, max = 15, step = 1, value = Spring.GetConfigInt("MinDrawFPS", 2), description = Spring.I18N('ui.settings.option.catchupminfps_descr'), + { id = "catchupminfps", group = "game", category = types.dev, name = I18N('ui.settings.option.catchupminfps'), restart = true, type = "slider", min = 2, max = 15, step = 1, value = Spring.GetConfigInt("MinDrawFPS", 2), description = I18N('ui.settings.option.catchupminfps_descr'), onchange = function(i, value) Spring.SetConfigInt("MinDrawFPS", value) end, }, - { id = "label_ui_behavior", group = "game", name = Spring.I18N('ui.settings.option.label_behavior'), category = types.basic }, + { id = "label_ui_behavior", group = "game", name = I18N('ui.settings.option.label_behavior'), category = types.basic }, { id = "label_ui_behavior_spacer", group = "game", category = types.basic }, - { id = "smartselect_includebuildings", group = "game", category = types.basic, name = Spring.I18N('ui.settings.option.smartselect_includebuildings'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.smartselect_includebuildings_descr'), + { id = "smartselect_includebuildings", group = "game", category = types.basic, name = I18N('ui.settings.option.smartselect_includebuildings'), type = "bool", value = false, description = I18N('ui.settings.option.smartselect_includebuildings_descr'), onload = function(i) end, onchange = function(i, value) saveOptionValue('SmartSelect', 'smartselect', 'setIncludeBuildings', { 'selectBuildingsWithMobile' }, value) end, }, - { id = "smartselect_includebuilders", group = "game", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.smartselect_includebuilders'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.smartselect_includebuilders_descr'), + { id = "smartselect_includebuilders", group = "game", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.smartselect_includebuilders'), type = "bool", value = false, description = I18N('ui.settings.option.smartselect_includebuilders_descr'), onload = function(i) end, onchange = function(i, value) saveOptionValue('SmartSelect', 'smartselect', 'setIncludeBuilders', { 'includeBuilders' }, value) end, }, - { id = "smartselect_includeantinuke", group = "game", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.smartselect_includeantinuke'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.smartselect_includeantinuke_descr'), + { id = "smartselect_includeantinuke", group = "game", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.smartselect_includeantinuke'), type = "bool", value = false, description = I18N('ui.settings.option.smartselect_includeantinuke_descr'), onload = function(i) end, onchange = function(i, value) saveOptionValue('SmartSelect', 'smartselect', 'setIncludeAntinuke', { 'includeAntinuke' }, value) end, }, - { id = "smartselect_includeradar", group = "game", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.smartselect_includeradar'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.smartselect_includeradar_descr'), + { id = "smartselect_includeradar", group = "game", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.smartselect_includeradar'), type = "bool", value = false, description = I18N('ui.settings.option.smartselect_includeradar_descr'), onload = function(i) end, onchange = function(i, value) saveOptionValue('SmartSelect', 'smartselect', 'setIncludeRadar', { 'includeRadar' }, value) end, }, - { id = "smartselect_includejammer", group = "game", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.smartselect_includejammer'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.smartselect_includejammer_descr'), + { id = "smartselect_includejammer", group = "game", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.smartselect_includejammer'), type = "bool", value = false, description = I18N('ui.settings.option.smartselect_includejammer_descr'), onload = function(i) end, onchange = function(i, value) @@ -5051,31 +5051,31 @@ function init() end, }, - { id = "prioconturrets", group = "game", category = types.basic, widget = "Priority Construction Turrets", name = Spring.I18N('ui.settings.option.prioconturrets'), type = "bool", value = GetWidgetToggleValue("Priority Construction Turrets"), description = Spring.I18N('ui.settings.option.prioconturrets_descr') }, + { id = "prioconturrets", group = "game", category = types.basic, widget = "Priority Construction Turrets", name = I18N('ui.settings.option.prioconturrets'), type = "bool", value = GetWidgetToggleValue("Priority Construction Turrets"), description = I18N('ui.settings.option.prioconturrets_descr') }, { id = "builderpriority", group = "game", category = types.basic, widget = "Builder Priority", - name = Spring.I18N('ui.settings.option.builderpriority'), + name = I18N('ui.settings.option.builderpriority'), type = "bool", value = GetWidgetToggleValue("Builder Priority"), - description = Spring.I18N('ui.settings.option.builderpriority_descr'), + description = I18N('ui.settings.option.builderpriority_descr'), }, { id = "builderpriority_nanos", group = "game", category = types.advanced, - name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.builderpriority_nanos'), + name = widgetOptionColor .. " " .. I18N('ui.settings.option.builderpriority_nanos'), type = "bool", value = ( WG['builderpriority'] ~= nil and WG['builderpriority'].getLowPriorityNanos ~= nil and WG['builderpriority'].getLowPriorityNanos() ), - description = Spring.I18N('ui.settings.option.builderpriority_nanos_descr'), + description = I18N('ui.settings.option.builderpriority_nanos_descr'), onload = function(i) loadWidgetData("Builder Priority", "builderpriority_nanos", { 'lowpriorityNanos' }) end, @@ -5088,14 +5088,14 @@ function init() id = "builderpriority_cons", group = "game", category = types.advanced, - name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.builderpriority_cons'), + name = widgetOptionColor .. " " .. I18N('ui.settings.option.builderpriority_cons'), type = "bool", value = ( WG['builderpriority'] ~= nil and WG['builderpriority'].getLowPriorityCons ~= nil and WG['builderpriority'].getLowPriorityCons() ), - description = Spring.I18N('ui.settings.option.builderpriority_cons_descr'), + description = I18N('ui.settings.option.builderpriority_cons_descr'), onload = function(i) loadWidgetData("Builder Priority", "builderpriority_cons", { 'lowpriorityCons' }) end, @@ -5108,14 +5108,14 @@ function init() id = "builderpriority_labs", group = "game", category = types.advanced, - name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.builderpriority_labs'), + name = widgetOptionColor .. " " .. I18N('ui.settings.option.builderpriority_labs'), type = "bool", value = ( WG['builderpriority'] ~= nil and WG['builderpriority'].getLowPriorityLabs ~= nil and WG['builderpriority'].getLowPriorityLabs() ), - description = Spring.I18N('ui.settings.option.builderpriority_labs_descr'), + description = I18N('ui.settings.option.builderpriority_labs_descr'), onload = function(i) loadWidgetData("Builder Priority", "builderpriority_labs", { 'lowpriorityLabs' }) end, @@ -5124,9 +5124,9 @@ function init() end, }, - { id = "factoryguard", group = "game", category = types.basic, widget = "Factory Guard Default On", name = Spring.I18N('ui.settings.option.factory') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.factoryguard'), type = "bool", value = GetWidgetToggleValue("Factory Guard Default On"), description = Spring.I18N('ui.settings.option.factoryguard_descr') }, - { id = "factoryholdpos", group = "game", category = types.basic, widget = "Factory hold position", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.factoryholdpos'), type = "bool", value = GetWidgetToggleValue("Factory hold position"), description = Spring.I18N('ui.settings.option.factoryholdpos_descr') }, - { id = "factoryrepeat", group = "game", category = types.basic, widget = "Factory Auto-Repeat", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.factoryrepeat'), type = "bool", value = GetWidgetToggleValue("Factory Auto-Repeat"), description = Spring.I18N('ui.settings.option.factoryrepeat_descr') }, + { id = "factoryguard", group = "game", category = types.basic, widget = "Factory Guard Default On", name = I18N('ui.settings.option.factory') .. widgetOptionColor .. " " .. I18N('ui.settings.option.factoryguard'), type = "bool", value = GetWidgetToggleValue("Factory Guard Default On"), description = I18N('ui.settings.option.factoryguard_descr') }, + { id = "factoryholdpos", group = "game", category = types.basic, widget = "Factory hold position", name = widgetOptionColor .. " " .. I18N('ui.settings.option.factoryholdpos'), type = "bool", value = GetWidgetToggleValue("Factory hold position"), description = I18N('ui.settings.option.factoryholdpos_descr') }, + { id = "factoryrepeat", group = "game", category = types.basic, widget = "Factory Auto-Repeat", name = widgetOptionColor .. " " .. I18N('ui.settings.option.factoryrepeat'), type = "bool", value = GetWidgetToggleValue("Factory Auto-Repeat"), description = I18N('ui.settings.option.factoryrepeat_descr') }, { id = "transportOrderedUnits", group = "game", @@ -5150,16 +5150,16 @@ function init() end, }, - { id = "onlyfighterspatrol", group = "game", category = types.basic, widget = "OnlyFightersPatrol", name = Spring.I18N('ui.settings.option.onlyfighterspatrol'), type = "bool", value = GetWidgetToggleValue("Autoquit"), description = Spring.I18N('ui.settings.option.onlyfighterspatrol_descr') }, - { id = "fightersfly", group = "game", category = types.basic, widget = "Set fighters on Fly mode", name = Spring.I18N('ui.settings.option.fightersfly'), type = "bool", value = GetWidgetToggleValue("Set fighters on Fly mode"), description = Spring.I18N('ui.settings.option.fightersfly_descr') }, + { id = "onlyfighterspatrol", group = "game", category = types.basic, widget = "OnlyFightersPatrol", name = I18N('ui.settings.option.onlyfighterspatrol'), type = "bool", value = GetWidgetToggleValue("Autoquit"), description = I18N('ui.settings.option.onlyfighterspatrol_descr') }, + { id = "fightersfly", group = "game", category = types.basic, widget = "Set fighters on Fly mode", name = I18N('ui.settings.option.fightersfly'), type = "bool", value = GetWidgetToggleValue("Set fighters on Fly mode"), description = I18N('ui.settings.option.fightersfly_descr') }, - { id = "settargetdefault", group = "game", category = types.basic, widget = "Set target default", name = Spring.I18N('ui.settings.option.settargetdefault'), type = "bool", value = GetWidgetToggleValue("Set target default"), description = Spring.I18N('ui.settings.option.settargetdefault_descr') }, - { id = "dgunnogroundenemies", group = "game", category = types.advanced, widget = "DGun no ground enemies", name = Spring.I18N('ui.settings.option.dgunnogroundenemies'), type = "bool", value = GetWidgetToggleValue("DGun no ground enemies"), description = Spring.I18N('ui.settings.option.dgunnogroundenemies_descr') }, - { id = "dgunstallassist", group = "game", category = types.advanced, widget = "DGun Stall Assist", name = Spring.I18N('ui.settings.option.dgunstallassist'), type = "bool", value = GetWidgetToggleValue("DGun Stall Assist"), description = Spring.I18N('ui.settings.option.dgunstallassist_descr') }, + { id = "settargetdefault", group = "game", category = types.basic, widget = "Set target default", name = I18N('ui.settings.option.settargetdefault'), type = "bool", value = GetWidgetToggleValue("Set target default"), description = I18N('ui.settings.option.settargetdefault_descr') }, + { id = "dgunnogroundenemies", group = "game", category = types.advanced, widget = "DGun no ground enemies", name = I18N('ui.settings.option.dgunnogroundenemies'), type = "bool", value = GetWidgetToggleValue("DGun no ground enemies"), description = I18N('ui.settings.option.dgunnogroundenemies_descr') }, + { id = "dgunstallassist", group = "game", category = types.advanced, widget = "DGun Stall Assist", name = I18N('ui.settings.option.dgunstallassist'), type = "bool", value = GetWidgetToggleValue("DGun Stall Assist"), description = I18N('ui.settings.option.dgunstallassist_descr') }, - { id = "unitreclaimer", group = "game", category = types.basic, widget = "Specific Unit Reclaimer", name = Spring.I18N('ui.settings.option.unitreclaimer'), type = "bool", value = GetWidgetToggleValue("Specific Unit Reclaimer"), description = Spring.I18N('ui.settings.option.unitreclaimer_descr') }, + { id = "unitreclaimer", group = "game", category = types.basic, widget = "Specific Unit Reclaimer", name = I18N('ui.settings.option.unitreclaimer'), type = "bool", value = GetWidgetToggleValue("Specific Unit Reclaimer"), description = I18N('ui.settings.option.unitreclaimer_descr') }, - { id = "autogroup_immediate", group = "game", category = types.basic, name = Spring.I18N('ui.settings.option.autogroup_immediate'), type = "bool", value = (WG['autogroup'] ~= nil and WG['autogroup'].getImmediate ~= nil and WG['autogroup'].getImmediate()), description = Spring.I18N('ui.settings.option.autogroup_immediate_descr'), + { id = "autogroup_immediate", group = "game", category = types.basic, name = I18N('ui.settings.option.autogroup_immediate'), type = "bool", value = (WG['autogroup'] ~= nil and WG['autogroup'].getImmediate ~= nil and WG['autogroup'].getImmediate()), description = I18N('ui.settings.option.autogroup_immediate_descr'), onload = function(i) loadWidgetData("Auto Group", "autogroup_immediate", { 'immediate' }) end, @@ -5172,7 +5172,7 @@ function init() end, }, - { id = "autogroup_persist", group = "game", category = types.basic, name = Spring.I18N('ui.settings.option.autogroup_persist'), type = "bool", value = (WG['autogroup'] ~= nil and WG['autogroup'].getPersist ~= nil and WG['autogroup'].getPersist()), description = Spring.I18N('ui.settings.option.autogroup_persist_descr'), + { id = "autogroup_persist", group = "game", category = types.basic, name = I18N('ui.settings.option.autogroup_persist'), type = "bool", value = (WG['autogroup'] ~= nil and WG['autogroup'].getPersist ~= nil and WG['autogroup'].getPersist()), description = I18N('ui.settings.option.autogroup_persist_descr'), onload = function(i) loadWidgetData("Auto Group", "autogroup_persist", { 'persist' }) end, @@ -5185,17 +5185,17 @@ function init() end, }, - { id = "label_ui_cloak", group = "game", name = Spring.I18N('ui.settings.option.label_cloak'), category = types.basic }, + { id = "label_ui_cloak", group = "game", name = I18N('ui.settings.option.label_cloak'), category = types.basic }, { id = "label_ui_cloak_spacer", group = "game", category = types.basic }, - { id = "autocloak", group = "game", category = types.basic, widget = "Auto Cloak Units", name = Spring.I18N('ui.settings.option.autocloak'), type = "bool", value = GetWidgetToggleValue("Auto Cloak Units") }, + { id = "autocloak", group = "game", category = types.basic, widget = "Auto Cloak Units", name = I18N('ui.settings.option.autocloak'), type = "bool", value = GetWidgetToggleValue("Auto Cloak Units") }, -- ACCESSIBILITY - { id = "label_teamcolors", group = "accessibility", name = Spring.I18N('ui.settings.option.label_teamcolors'), category = types.basic }, + { id = "label_teamcolors", group = "accessibility", name = I18N('ui.settings.option.label_teamcolors'), category = types.basic }, { id = "label_teamcolors_spacer", group = "accessibility", category = types.basic }, - { id = "anonymous_r", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.anonymous_r'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("anonymousColorR", 255)), description = Spring.I18N('ui.settings.option.anonymous_descr'), + { id = "anonymous_r", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.anonymous_r'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("anonymousColorR", 255)), description = I18N('ui.settings.option.anonymous_descr'), onchange = function(i, value, force) if force then Spring.SetConfigInt("anonymousColorR", value) @@ -5206,7 +5206,7 @@ function init() end, }, - { id = "anonymous_g", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.anonymous_g'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("anonymousColorG", 0)), description = Spring.I18N('ui.settings.option.anonymous_descr'), + { id = "anonymous_g", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.anonymous_g'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("anonymousColorG", 0)), description = I18N('ui.settings.option.anonymous_descr'), onchange = function(i, value, force) if force then Spring.SetConfigInt("anonymousColorG", value) @@ -5217,7 +5217,7 @@ function init() end, }, - { id = "anonymous_b", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.anonymous_b'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("anonymousColorB", 0)), description = Spring.I18N('ui.settings.option.anonymous_descr'), + { id = "anonymous_b", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.anonymous_b'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("anonymousColorB", 0)), description = I18N('ui.settings.option.anonymous_descr'), onchange = function(i, value, force) if force then Spring.SetConfigInt("anonymousColorB", value) @@ -5228,14 +5228,14 @@ function init() end, }, - { id = "simpleteamcolors", group = "accessibility", category = types.basic, name = Spring.I18N('ui.settings.option.playercolors'), type = "bool", value = tonumber(Spring.GetConfigInt("SimpleTeamColors", 0) or 0) == 1, description = Spring.I18N('ui.settings.option.simpleteamcolors_descr'), + { id = "simpleteamcolors", group = "accessibility", category = types.basic, name = I18N('ui.settings.option.playercolors'), type = "bool", value = tonumber(Spring.GetConfigInt("SimpleTeamColors", 0) or 0) == 1, description = I18N('ui.settings.option.simpleteamcolors_descr'), onchange = function(i, value) Spring.SetConfigInt("SimpleTeamColors", (value and 1 or 0)) Spring.SetConfigInt("UpdateTeamColors", 1) end, }, - { id = "simpleteamcolors_reset", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolors_reset'), type = "bool", value = tonumber(Spring.GetConfigInt("SimpleTeamColors_Reset", 0) or 0) == 1, + { id = "simpleteamcolors_reset", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.simpleteamcolors_reset'), type = "bool", value = tonumber(Spring.GetConfigInt("SimpleTeamColors_Reset", 0) or 0) == 1, onchange = function(i, value) Spring.SetConfigInt("SimpleTeamColorsUseGradient", 0) Spring.SetConfigInt("SimpleTeamColorsPlayerR", 0) @@ -5250,69 +5250,69 @@ function init() Spring.SetConfigInt("UpdateTeamColors", 1) end, }, - { id = "simpleteamcolors_use_gradient", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolors_use_gradient'), type = "bool", value = tonumber(Spring.GetConfigInt("SimpleTeamColorsUseGradient", 0) or 0) == 1, + { id = "simpleteamcolors_use_gradient", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.simpleteamcolors_use_gradient'), type = "bool", value = tonumber(Spring.GetConfigInt("SimpleTeamColorsUseGradient", 0) or 0) == 1, onchange = function(i, value) Spring.SetConfigInt("SimpleTeamColorsUseGradient", (value and 1 or 0)) Spring.SetConfigInt("UpdateTeamColors", 1) end, }, - { id = "simpleteamcolorsfactionspecific", group = "accessibility", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolorsfactionspecific'), type = "bool", value = tonumber(Spring.GetConfigInt("SimpleTeamColorsFactionSpecific", 0) or 0) == 1, description = Spring.I18N('ui.settings.option.simpleteamcolorsfactionspecific_descr'), + { id = "simpleteamcolorsfactionspecific", group = "accessibility", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.simpleteamcolorsfactionspecific'), type = "bool", value = tonumber(Spring.GetConfigInt("SimpleTeamColorsFactionSpecific", 0) or 0) == 1, description = I18N('ui.settings.option.simpleteamcolorsfactionspecific_descr'), onchange = function(i, value) Spring.SetConfigInt("SimpleTeamColorsFactionSpecific", (value and 1 or 0)) Spring.SetConfigInt("UpdateTeamColors", 1) end, }, - { id = "simpleteamcolors_player_r", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolors_player_r'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsPlayerR", 0)), + { id = "simpleteamcolors_player_r", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.simpleteamcolors_player_r'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsPlayerR", 0)), onchange = function(i, value) Spring.SetConfigInt("SimpleTeamColorsPlayerR", value) Spring.SetConfigInt("UpdateTeamColors", 1) end, }, - { id = "simpleteamcolors_player_g", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolors_player_g'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsPlayerG", 77)), + { id = "simpleteamcolors_player_g", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.simpleteamcolors_player_g'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsPlayerG", 77)), onchange = function(i, value) Spring.SetConfigInt("SimpleTeamColorsPlayerG", value) Spring.SetConfigInt("UpdateTeamColors", 1) end, }, - { id = "simpleteamcolors_player_b", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolors_player_b'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsPlayerB", 255)), + { id = "simpleteamcolors_player_b", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.simpleteamcolors_player_b'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsPlayerB", 255)), onchange = function(i, value) Spring.SetConfigInt("SimpleTeamColorsPlayerB", value) Spring.SetConfigInt("UpdateTeamColors", 1) end, }, - { id = "simpleteamcolors_ally_r", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolors_ally_r'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsAllyR", 0)), + { id = "simpleteamcolors_ally_r", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.simpleteamcolors_ally_r'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsAllyR", 0)), onchange = function(i, value) Spring.SetConfigInt("SimpleTeamColorsAllyR", value) Spring.SetConfigInt("UpdateTeamColors", 1) end, }, - { id = "simpleteamcolors_ally_g", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolors_ally_g'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsAllyG", 255)), + { id = "simpleteamcolors_ally_g", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.simpleteamcolors_ally_g'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsAllyG", 255)), onchange = function(i, value) Spring.SetConfigInt("SimpleTeamColorsAllyG", value) Spring.SetConfigInt("UpdateTeamColors", 1) end, }, - { id = "simpleteamcolors_ally_b", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolors_ally_b'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsAllyB", 0)), + { id = "simpleteamcolors_ally_b", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.simpleteamcolors_ally_b'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsAllyB", 0)), onchange = function(i, value) Spring.SetConfigInt("SimpleTeamColorsAllyB", value) Spring.SetConfigInt("UpdateTeamColors", 1) end, }, - { id = "simpleteamcolors_enemy_r", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolors_enemy_r'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsEnemyR", 255)), + { id = "simpleteamcolors_enemy_r", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.simpleteamcolors_enemy_r'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsEnemyR", 255)), onchange = function(i, value) Spring.SetConfigInt("SimpleTeamColorsEnemyR", value) Spring.SetConfigInt("UpdateTeamColors", 1) end, }, - { id = "simpleteamcolors_enemy_g", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolors_enemy_g'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsEnemyG", 16)), + { id = "simpleteamcolors_enemy_g", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.simpleteamcolors_enemy_g'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsEnemyG", 16)), onchange = function(i, value) Spring.SetConfigInt("SimpleTeamColorsEnemyG", value) Spring.SetConfigInt("UpdateTeamColors", 1) end, }, - { id = "simpleteamcolors_enemy_b", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolors_enemy_b'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsEnemyB", 5)), + { id = "simpleteamcolors_enemy_b", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. I18N('ui.settings.option.simpleteamcolors_enemy_b'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsEnemyB", 5)), onchange = function(i, value) Spring.SetConfigInt("SimpleTeamColorsEnemyB", value) Spring.SetConfigInt("UpdateTeamColors", 1) @@ -5320,48 +5320,48 @@ function init() }, -- DEV - { id = "customwidgets", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.customwidgets'), type = "bool", value = widgetHandler.allowUserWidgets, description = Spring.I18N('ui.settings.option.customwidgets_descr'), + { id = "customwidgets", group = "dev", category = types.dev, name = I18N('ui.settings.option.customwidgets'), type = "bool", value = widgetHandler.allowUserWidgets, description = I18N('ui.settings.option.customwidgets_descr'), onchange = function(i, value) widgetHandler.__allowUserWidgets = value Spring.SendCommands("luarules reloadluaui") end, }, - { id = "autocheat", group = "dev", category = types.dev, widget = "Dev Auto cheat", name = Spring.I18N('ui.settings.option.autocheat'), type = "bool", value = GetWidgetToggleValue("Dev Auto cheat"), description = Spring.I18N('ui.settings.option.autocheat_descr') }, - { id = "restart", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.restart'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.restart_descr'), + { id = "autocheat", group = "dev", category = types.dev, widget = "Dev Auto cheat", name = I18N('ui.settings.option.autocheat'), type = "bool", value = GetWidgetToggleValue("Dev Auto cheat"), description = I18N('ui.settings.option.autocheat_descr') }, + { id = "restart", group = "dev", category = types.dev, name = I18N('ui.settings.option.restart'), type = "bool", value = false, description = I18N('ui.settings.option.restart_descr'), onchange = function(i, value) options[getOptionByID('restart')].value = false Spring.Restart("", startScript) end, }, - { id = "label_dev_debug", group = "dev", name = Spring.I18N('ui.settings.option.label_debug'), category = types.dev }, + { id = "label_dev_debug", group = "dev", name = I18N('ui.settings.option.label_debug'), category = types.dev }, { id = "label_dev_debug_spacer", group = "dev", category = types.dev }, - { id = "profiler_widget", group = "dev", category = types.dev, widget = "Widget Profiler", name = Spring.I18N('ui.settings.option.profiler') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.profiler_widget'), type = "bool", value = GetWidgetToggleValue("Widget Profiler") }, - { id = "profiler_gadget", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.profiler_gadget'), type = "bool", value = false, + { id = "profiler_widget", group = "dev", category = types.dev, widget = "Widget Profiler", name = I18N('ui.settings.option.profiler') .. widgetOptionColor .. " " .. I18N('ui.settings.option.profiler_widget'), type = "bool", value = GetWidgetToggleValue("Widget Profiler") }, + { id = "profiler_gadget", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.profiler_gadget'), type = "bool", value = false, onchange = function(i, value) Spring.SendCommands("luarules profile") end, }, - { id = "profiler_sort_by_load", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.profiler_sort_by_load'), type = "bool", value = Spring.GetConfigInt("profiler_sort_by_load", 1), description = Spring.I18N('ui.settings.option.profiler_sort_by_load_descr'), + { id = "profiler_sort_by_load", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.profiler_sort_by_load'), type = "bool", value = Spring.GetConfigInt("profiler_sort_by_load", 1), description = I18N('ui.settings.option.profiler_sort_by_load_descr'), onchange = function(i, value) Spring.SetConfigInt("profiler_sort_by_load", (value and '1' or '0')) end, }, - { id = "profiler_averagetime", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.profiler_averagetime'), type = "slider", min = 0.1, max = 10, step = 0.1, value = Spring.GetConfigFloat("profiler_averagetime", 2), description = Spring.I18N('ui.settings.option.profiler_averagetime_descr'), + { id = "profiler_averagetime", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.profiler_averagetime'), type = "slider", min = 0.1, max = 10, step = 0.1, value = Spring.GetConfigFloat("profiler_averagetime", 2), description = I18N('ui.settings.option.profiler_averagetime_descr'), onchange = function(i, value) Spring.SetConfigFloat("profiler_averagetime", value) end, }, - { id = "framegrapher", group = "dev", category = types.dev, widget = "Frame Grapher", name = Spring.I18N('ui.settings.option.framegrapher'), type = "bool", value = GetWidgetToggleValue("Frame Grapher"), description = "" }, + { id = "framegrapher", group = "dev", category = types.dev, widget = "Frame Grapher", name = I18N('ui.settings.option.framegrapher'), type = "bool", value = GetWidgetToggleValue("Frame Grapher"), description = "" }, - { id = "debugcolvol", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.debugcolvol'), type = "bool", value = false, description = "", + { id = "debugcolvol", group = "dev", category = types.dev, name = I18N('ui.settings.option.debugcolvol'), type = "bool", value = false, description = "", onchange = function(i, value) Spring.SendCommands("DebugColVol " .. (value and '1' or '0')) end, }, - { id = "echocamerastate", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.echocamerastate'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.echocamerastate_descr'), + { id = "echocamerastate", group = "dev", category = types.dev, name = I18N('ui.settings.option.echocamerastate'), type = "bool", value = false, description = I18N('ui.settings.option.echocamerastate_descr'), onchange = function(i, value) options[getOptionByID('echocamerastate')].value = false Spring.Echo(Spring.GetCameraState()) @@ -5369,24 +5369,24 @@ function init() }, - { id = "label_dev_other", group = "dev", name = Spring.I18N('ui.settings.option.label_other'), category = types.dev }, + { id = "label_dev_other", group = "dev", name = I18N('ui.settings.option.label_other'), category = types.dev }, { id = "label_dev_other_spacer", group = "dev", category = types.dev }, - { id = "storedefaultsettings", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.storedefaultsettings'), type = "bool", value = tonumber(Spring.GetConfigInt("StoreDefaultSettings", 0) or 0) == 1, description = Spring.I18N('ui.settings.option.storedefaultsettings_descr'), + { id = "storedefaultsettings", group = "dev", category = types.dev, name = I18N('ui.settings.option.storedefaultsettings'), type = "bool", value = tonumber(Spring.GetConfigInt("StoreDefaultSettings", 0) or 0) == 1, description = I18N('ui.settings.option.storedefaultsettings_descr'), onchange = function(i, value) Spring.SetConfigInt("StoreDefaultSettings", (value and 1 or 0)) end, }, - { id = "startboxeditor", group = "dev", category = types.dev, widget = "Startbox Editor", name = Spring.I18N('ui.settings.option.startboxeditor'), type = "bool", value = GetWidgetToggleValue("Startbox Editor"), description = Spring.I18N('ui.settings.option.startboxeditor_descr') }, + { id = "startboxeditor", group = "dev", category = types.dev, widget = "Startbox Editor", name = I18N('ui.settings.option.startboxeditor'), type = "bool", value = GetWidgetToggleValue("Startbox Editor"), description = I18N('ui.settings.option.startboxeditor_descr') }, - { id = "language_dev", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.language'), type = "select", options = devLanguageNames, value = devLanguageCodes[Spring.I18N.getLocale()], + { id = "language_dev", group = "dev", category = types.dev, name = I18N('ui.settings.option.language'), type = "select", options = devLanguageNames, value = devLanguageCodes[I18N.getLocale()], onchange = function(i, value) local devLanguage = devLanguageCodes[value] WG['language'].setLanguage(devLanguage) end }, - { id = "font", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.font'), type = "select", options = {}, value = 1, description = Spring.I18N('ui.settings.option.font_descr'), + { id = "font", group = "dev", category = types.dev, name = I18N('ui.settings.option.font'), type = "select", options = {}, value = 1, description = I18N('ui.settings.option.font_descr'), onload = function(i) end, onchange = function(i, value) @@ -5396,7 +5396,7 @@ function init() end end, }, - { id = "font2", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.font2'), type = "select", options = {}, value = 1, description = Spring.I18N('ui.settings.option.font2_descr'), + { id = "font2", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.font2'), type = "select", options = {}, value = 1, description = I18N('ui.settings.option.font2_descr'), onload = function(i) end, onchange = function(i, value) @@ -5499,10 +5499,10 @@ function init() -- end, --}, - { id = "label_dev_map", group = "dev", name = Spring.I18N('ui.settings.option.label_map'), category = types.dev }, + { id = "label_dev_map", group = "dev", name = I18N('ui.settings.option.label_map'), category = types.dev }, { id = "label_dev_map_spacer", group = "dev", category = types.dev }, - { id = "sun_y", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.sun') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sun_y'), type = "slider", min = 0.05, max = 0.9999, step = 0.0001, value = select(2, gl.GetSun("pos")), + { id = "sun_y", group = "dev", category = types.dev, name = I18N('ui.settings.option.sun') .. widgetOptionColor .. " " .. I18N('ui.settings.option.sun_y'), type = "slider", min = 0.05, max = 0.9999, step = 0.0001, value = select(2, gl.GetSun("pos")), onchange = function(i, value) local sunX, sunY, sunZ = gl.GetSun("pos") sunY = value @@ -5519,7 +5519,7 @@ function init() Spring.Echo(gl.GetSun()) end, }, - { id = "sun_x", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sun_x'), type = "slider", min = -0.9999, max = 0.9999, step = 0.0001, value = select(1, gl.GetSun("pos")), + { id = "sun_x", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.sun_x'), type = "slider", min = -0.9999, max = 0.9999, step = 0.0001, value = select(1, gl.GetSun("pos")), onchange = function(i, value) local sunX, sunY, sunZ = gl.GetSun("pos") sunX = value @@ -5536,7 +5536,7 @@ function init() Spring.Echo(gl.GetSun()) end, }, - { id = "sun_z", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sun_z'), type = "slider", min = -0.9999, max = 0.9999, step = 0.0001, value = select(3, gl.GetSun("pos")), + { id = "sun_z", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.sun_z'), type = "slider", min = -0.9999, max = 0.9999, step = 0.0001, value = select(3, gl.GetSun("pos")), onload = function(i) end, onchange = function(i, value) @@ -5555,7 +5555,7 @@ function init() Spring.Echo(gl.GetSun()) end, }, - { id = "sun_reset", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sun_reset'), type = "bool", value = false, + { id = "sun_reset", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.sun_reset'), type = "bool", value = false, onload = function(i) end, onchange = function(i, value) @@ -5570,7 +5570,7 @@ function init() end, }, - { id = "fog_start", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.fog') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.fog_start'), type = "slider", min = 0, max = 1.99, step = 0.01, value = gl.GetAtmosphere("fogStart"), + { id = "fog_start", group = "dev", category = types.dev, name = I18N('ui.settings.option.fog') .. widgetOptionColor .. " " .. I18N('ui.settings.option.fog_start'), type = "slider", min = 0, max = 1.99, step = 0.01, value = gl.GetAtmosphere("fogStart"), onload = function(i) end, onchange = function(i, value) @@ -5580,7 +5580,7 @@ function init() Spring.SetAtmosphere({ fogStart = value }) end, }, - { id = "fog_end", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.fog_end'), type = "slider", min = 0.5, max = 2, step = 0.01, value = gl.GetAtmosphere("fogEnd"), + { id = "fog_end", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.fog_end'), type = "slider", min = 0.5, max = 2, step = 0.01, value = gl.GetAtmosphere("fogEnd"), onload = function(i) end, onchange = function(i, value) @@ -5590,7 +5590,7 @@ function init() Spring.SetAtmosphere({ fogEnd = value }) end, }, - { id = "fog_reset", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.fog_reset'), type = "bool", value = false, description = '', + { id = "fog_reset", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.fog_reset'), type = "bool", value = false, description = '', onload = function(i) end, onchange = function(i, value) @@ -5603,7 +5603,7 @@ function init() end, }, - { id = "fog_r", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.fog') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.red'), type = "slider", min = 0, max = 1, step = 0.01, value = select(1, gl.GetAtmosphere("fogColor")), description = '', + { id = "fog_r", group = "dev", category = types.dev, name = I18N('ui.settings.option.fog') .. widgetOptionColor .. " " .. I18N('ui.settings.option.red'), type = "slider", min = 0, max = 1, step = 0.01, value = select(1, gl.GetAtmosphere("fogColor")), description = '', onload = function(i) end, onchange = function(i, value) @@ -5611,7 +5611,7 @@ function init() Spring.SetAtmosphere({ fogColor = { value, fogColor[2], fogColor[3], fogColor[4] } }) end, }, - { id = "fog_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.green'), type = "slider", min = 0, max = 1, step = 0.01, value = select(2, gl.GetAtmosphere("fogColor")), description = '', + { id = "fog_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.green'), type = "slider", min = 0, max = 1, step = 0.01, value = select(2, gl.GetAtmosphere("fogColor")), description = '', onload = function(i) end, onchange = function(i, value) @@ -5619,7 +5619,7 @@ function init() Spring.SetAtmosphere({ fogColor = { fogColor[1], value, fogColor[3], fogColor[4] } }) end, }, - { id = "fog_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 1, step = 0.01, value = select(3, gl.GetAtmosphere("fogColor")), description = '', + { id = "fog_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 1, step = 0.01, value = select(3, gl.GetAtmosphere("fogColor")), description = '', onload = function(i) end, onchange = function(i, value) @@ -5627,7 +5627,7 @@ function init() Spring.SetAtmosphere({ fogColor = { fogColor[1], fogColor[2], value, fogColor[4] } }) end, }, - { id = "fog_color_reset", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.fog_color_reset'), type = "bool", value = false, description = '', + { id = "fog_color_reset", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.fog_color_reset'), type = "bool", value = false, description = '', onload = function(i) end, onchange = function(i, value) @@ -5640,7 +5640,7 @@ function init() end, }, - { id = "map_voidwater", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.map_voidwater'), type = "bool", value = false, description = "", + { id = "map_voidwater", group = "dev", category = types.dev, name = I18N('ui.settings.option.map_voidwater'), type = "bool", value = false, description = "", onload = function(i) options[i].value = gl.GetMapRendering("voidWater") end, @@ -5648,7 +5648,7 @@ function init() Spring.SetMapRenderingParams({ voidWater = value }) end, }, - { id = "map_voidground", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.map_voidground'), type = "bool", value = false, description = "", + { id = "map_voidground", group = "dev", category = types.dev, name = I18N('ui.settings.option.map_voidground'), type = "bool", value = false, description = "", onload = function(i) options[i].value = gl.GetMapRendering("voidGround") end, @@ -5657,7 +5657,7 @@ function init() end, }, - { id = "map_splatdetailnormaldiffusealpha", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.map_splatdetailnormaldiffusealpha'), type = "bool", value = false, description = "", + { id = "map_splatdetailnormaldiffusealpha", group = "dev", category = types.dev, name = I18N('ui.settings.option.map_splatdetailnormaldiffusealpha'), type = "bool", value = false, description = "", onload = function(i) options[i].value = gl.GetMapRendering("splatDetailNormalDiffuseAlpha") end, @@ -5666,7 +5666,7 @@ function init() end, }, - { id = "map_splattexmults_r", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.map_splattexmults') .. widgetOptionColor .. " 0", type = "slider", min = 0, max = 1.5, step = 0.001, value = 0, description = "", + { id = "map_splattexmults_r", group = "dev", category = types.dev, name = I18N('ui.settings.option.map_splattexmults') .. widgetOptionColor .. " 0", type = "slider", min = 0, max = 1.5, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b, a = gl.GetMapRendering("splatTexMults") options[i].value = r @@ -5707,7 +5707,7 @@ function init() end, }, - { id = "map_splattexacales_r", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.map_splattexacales') .. widgetOptionColor .. " 0", type = "slider", min = 0, max = 0.02, step = 0.0001, value = 0, description = "", + { id = "map_splattexacales_r", group = "dev", category = types.dev, name = I18N('ui.settings.option.map_splattexacales') .. widgetOptionColor .. " 0", type = "slider", min = 0, max = 0.02, step = 0.0001, value = 0, description = "", onload = function(i) local r, g, b, a = gl.GetMapRendering("splatTexScales") options[i].value = r @@ -5748,7 +5748,7 @@ function init() end, }, - { id = "GroundShadowDensity", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.GroundShadowDensity') .. widgetOptionColor .. " ", type = "slider", min = 0, max = 1.5, step = 0.001, value = 0, description = "", + { id = "GroundShadowDensity", group = "dev", category = types.dev, name = I18N('ui.settings.option.GroundShadowDensity') .. widgetOptionColor .. " ", type = "slider", min = 0, max = 1.5, step = 0.001, value = 0, description = "", onload = function(i) local groundshadowDensity = gl.GetSun("shadowDensity", "ground") options[i].value = groundshadowDensity @@ -5759,7 +5759,7 @@ function init() end, }, - { id = "UnitShadowDensity", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.UnitShadowDensity') .. widgetOptionColor .. " ", type = "slider", min = 0, max = 1.5, step = 0.001, value = 0, description = "", + { id = "UnitShadowDensity", group = "dev", category = types.dev, name = I18N('ui.settings.option.UnitShadowDensity') .. widgetOptionColor .. " ", type = "slider", min = 0, max = 1.5, step = 0.001, value = 0, description = "", onload = function(i) local groundshadowDensity = gl.GetSun("shadowDensity", "unit") options[i].value = groundshadowDensity @@ -5770,7 +5770,7 @@ function init() end, }, - { id = "color_groundambient_r", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.color_groundambient') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.red'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", + { id = "color_groundambient_r", group = "dev", category = types.dev, name = I18N('ui.settings.option.color_groundambient') .. widgetOptionColor .. " " .. I18N('ui.settings.option.red'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetSun("ambient") options[i].value = r @@ -5781,7 +5781,7 @@ function init() Spring.SendCommands("luarules updatesun") end, }, - { id = "color_groundambient_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.green'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", + { id = "color_groundambient_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.green'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetSun("ambient") options[i].value = g @@ -5792,7 +5792,7 @@ function init() Spring.SendCommands("luarules updatesun") end, }, - { id = "color_groundambient_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", + { id = "color_groundambient_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetSun("ambient") options[i].value = b @@ -5804,7 +5804,7 @@ function init() end, }, - { id = "color_grounddiffuse_r", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.color_grounddiffuse') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.red'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", + { id = "color_grounddiffuse_r", group = "dev", category = types.dev, name = I18N('ui.settings.option.color_grounddiffuse') .. widgetOptionColor .. " " .. I18N('ui.settings.option.red'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetSun("diffuse") options[i].value = r @@ -5815,7 +5815,7 @@ function init() Spring.SendCommands("luarules updatesun") end, }, - { id = "color_grounddiffuse_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.green'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", + { id = "color_grounddiffuse_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.green'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetSun("diffuse") options[i].value = g @@ -5826,7 +5826,7 @@ function init() Spring.SendCommands("luarules updatesun") end, }, - { id = "color_grounddiffuse_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", + { id = "color_grounddiffuse_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetSun("diffuse") options[i].value = b @@ -5838,7 +5838,7 @@ function init() end, }, - { id = "color_groundspecular_r", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.color_groundspecular') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.red'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", + { id = "color_groundspecular_r", group = "dev", category = types.dev, name = I18N('ui.settings.option.color_groundspecular') .. widgetOptionColor .. " " .. I18N('ui.settings.option.red'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetSun("specular") options[i].value = r @@ -5849,7 +5849,7 @@ function init() Spring.SendCommands("luarules updatesun") end, }, - { id = "color_groundspecular_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.green'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", + { id = "color_groundspecular_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.green'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetSun("specular") options[i].value = g @@ -5860,7 +5860,7 @@ function init() Spring.SendCommands("luarules updatesun") end, }, - { id = "color_groundspecular_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", + { id = "color_groundspecular_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetSun("specular") options[i].value = b @@ -5873,7 +5873,7 @@ function init() }, - { id = "color_unitambient_r", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.color_unitambient') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.red'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", + { id = "color_unitambient_r", group = "dev", category = types.dev, name = I18N('ui.settings.option.color_unitambient') .. widgetOptionColor .. " " .. I18N('ui.settings.option.red'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetSun("ambient", "unit") options[i].value = r @@ -5884,7 +5884,7 @@ function init() Spring.SendCommands("luarules updatesun") end, }, - { id = "color_unitambient_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.green'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", + { id = "color_unitambient_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.green'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetSun("ambient", "unit") options[i].value = g @@ -5895,7 +5895,7 @@ function init() Spring.SendCommands("luarules updatesun") end, }, - { id = "color_unitambient_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", + { id = "color_unitambient_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetSun("ambient", "unit") options[i].value = b @@ -5907,7 +5907,7 @@ function init() end, }, - { id = "color_unitdiffuse_r", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.color_unitdiffuse') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.red'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", + { id = "color_unitdiffuse_r", group = "dev", category = types.dev, name = I18N('ui.settings.option.color_unitdiffuse') .. widgetOptionColor .. " " .. I18N('ui.settings.option.red'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetSun("diffuse", "unit") options[i].value = r @@ -5918,7 +5918,7 @@ function init() Spring.SendCommands("luarules updatesun") end, }, - { id = "color_unitdiffuse_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.green'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", + { id = "color_unitdiffuse_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.green'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetSun("diffuse", "unit") options[i].value = g @@ -5929,7 +5929,7 @@ function init() Spring.SendCommands("luarules updatesun") end, }, - { id = "color_unitdiffuse_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", + { id = "color_unitdiffuse_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetSun("diffuse", "unit") options[i].value = b @@ -5941,7 +5941,7 @@ function init() end, }, - { id = "color_unitspecular_r", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.color_unitspecular') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.red'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", + { id = "color_unitspecular_r", group = "dev", category = types.dev, name = I18N('ui.settings.option.color_unitspecular') .. widgetOptionColor .. " " .. I18N('ui.settings.option.red'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetSun("specular", "unit") options[i].value = r @@ -5952,7 +5952,7 @@ function init() Spring.SendCommands("luarules updatesun") end, }, - { id = "color_unitspecular_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.green'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", + { id = "color_unitspecular_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.green'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetSun("specular", "unit") options[i].value = g @@ -5963,7 +5963,7 @@ function init() Spring.SendCommands("luarules updatesun") end, }, - { id = "color_unitspecular_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", + { id = "color_unitspecular_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetSun("specular", "unit") options[i].value = b @@ -5975,7 +5975,7 @@ function init() end, }, - { id = "suncolor_r", group = "dev", category = types.dev, name = "Sun" .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.red'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", + { id = "suncolor_r", group = "dev", category = types.dev, name = "Sun" .. widgetOptionColor .. " " .. I18N('ui.settings.option.red'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetAtmosphere("sunColor") options[i].value = r @@ -5986,7 +5986,7 @@ function init() Spring.SendCommands("luarules updatesun") end, }, - { id = "suncolor_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.green'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", + { id = "suncolor_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.green'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetAtmosphere("sunColor") options[i].value = g @@ -5997,7 +5997,7 @@ function init() Spring.SendCommands("luarules updatesun") end, }, - { id = "suncolor_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", + { id = "suncolor_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetAtmosphere("sunColor") options[i].value = b @@ -6009,7 +6009,7 @@ function init() end, }, - { id = "skycolor_r", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.skycolor') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.red'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", + { id = "skycolor_r", group = "dev", category = types.dev, name = I18N('ui.settings.option.skycolor') .. widgetOptionColor .. " " .. I18N('ui.settings.option.red'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetAtmosphere("skyColor") options[i].value = r @@ -6020,7 +6020,7 @@ function init() Spring.SendCommands("luarules updatesun") end, }, - { id = "skycolor_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.green'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", + { id = "skycolor_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.green'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetAtmosphere("skyColor") options[i].value = g @@ -6031,7 +6031,7 @@ function init() Spring.SendCommands("luarules updatesun") end, }, - { id = "skycolor_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", + { id = "skycolor_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", onload = function(i) local r, g, b = gl.GetAtmosphere("skyColor") options[i].value = b @@ -6043,7 +6043,7 @@ function init() end, }, - { id = "sunlighting_reset", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.sunlighting_reset'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.sunlighting_reset_descr'), + { id = "sunlighting_reset", group = "dev", category = types.dev, name = I18N('ui.settings.option.sunlighting_reset'), type = "bool", value = false, description = I18N('ui.settings.option.sunlighting_reset_descr'), onload = function(i) end, onchange = function(i, value) @@ -6055,7 +6055,7 @@ function init() end, }, - { id = "skyaxisangle_angle", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.skybox') .. widgetOptionColor .. " "..Spring.I18N('ui.settings.option.angle'), type = "slider", min = -3.14, max = 3.14, step = 0.01, value = 0, description = "", + { id = "skyaxisangle_angle", group = "dev", category = types.dev, name = I18N('ui.settings.option.skybox') .. widgetOptionColor .. " "..I18N('ui.settings.option.angle'), type = "slider", min = -3.14, max = 3.14, step = 0.01, value = 0, description = "", onload = function(i) local x, y, z, angle = gl.GetAtmosphere("skyAxisAngle") options[i].value = angle @@ -6100,7 +6100,7 @@ function init() end, }, - { id = "skyaxisangle_reset", group = "dev", category = types.dev, name = widgetOptionColor .. " "..Spring.I18N('ui.settings.option.reset'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.sunlighting_reset_descr'), + { id = "skyaxisangle_reset", group = "dev", category = types.dev, name = widgetOptionColor .. " "..I18N('ui.settings.option.reset'), type = "bool", value = false, description = I18N('ui.settings.option.sunlighting_reset_descr'), onload = function(i) end, onchange = function(i, value) @@ -6110,7 +6110,7 @@ function init() init() end, }, - { id = "label_dev_water", group = "dev", name = Spring.I18N('ui.settings.option.label_water'), category = types.dev }, + { id = "label_dev_water", group = "dev", name = I18N('ui.settings.option.label_water'), category = types.dev }, { id = "label_dev_water_spacer", group = "dev", category = types.dev }, -- springsettings water params @@ -6450,7 +6450,7 @@ function init() options[getOptionByID('gridmenu_shiftkeymodifier')] = nil end - if spectatorHUDConfigOptions[options[getOptionByID('spectator_hud_config')].value] ~= Spring.I18N('ui.settings.option.spectator_hud_config_custom') then + if spectatorHUDConfigOptions[options[getOptionByID('spectator_hud_config')].value] ~= I18N('ui.settings.option.spectator_hud_config_custom') then options[getOptionByID('spectator_hud_metric_metalIncome')] = nil options[getOptionByID('spectator_hud_metric_energyIncome')] = nil options[getOptionByID('spectator_hud_metric_buildPower')] = nil @@ -6465,21 +6465,21 @@ function init() options[getOptionByID('spectator_hud_metric_damageDealt')] = nil end - if not Spring.Utilities.Gametype.GetCurrentHolidays()["aprilfools"] then + if not Utilities.Gametype.GetCurrentHolidays()["aprilfools"] then options[getOptionByID('soundtrackAprilFools')] = nil Spring.SetConfigInt("UseSoundtrackAprilFools", 1) else options[getOptionByID('soundtrackAprilFoolsPostEvent')] = nil end - if not Spring.Utilities.Gametype.GetCurrentHolidays()["halloween"] then + if not Utilities.Gametype.GetCurrentHolidays()["halloween"] then options[getOptionByID('soundtrackHalloween')] = nil Spring.SetConfigInt("UseSoundtrackHalloween", 1) else options[getOptionByID('soundtrackHalloweenPostEvent')] = nil end - if not Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"] then + if not Utilities.Gametype.GetCurrentHolidays()["xmas"] then options[getOptionByID('soundtrackXmas')] = nil Spring.SetConfigInt("UseSoundtrackXmas", 1) else @@ -6487,7 +6487,7 @@ function init() end -- hide English unit names toggle if using English - if Spring.I18N.getLocale() == 'en' then + if I18N.getLocale() == 'en' then options[getOptionByID('language_english_unit_names')] = nil end @@ -6558,7 +6558,7 @@ function init() if #displayNames <= 1 then options[getOptionByID('display')] = nil - options[getOptionByID('resolution')].name = Spring.I18N('ui.settings.option.resolution') + options[getOptionByID('resolution')].name = I18N('ui.settings.option.resolution') end -- only allow dualscreen-mode on single displays when super ultrawide screen or Multi Display option shows @@ -6712,7 +6712,7 @@ function init() newOptions[count] = option if option.id == 'soundtrackFades' then count = count + 1 - newOptions[count] = { id = "label_sound_music", group = "sound", name = Spring.I18N('ui.settings.option.label_playlist'), category = types.basic } + newOptions[count] = { id = "label_sound_music", group = "sound", name = I18N('ui.settings.option.label_playlist'), category = types.basic } count = count + 1 newOptions[count] = { id = "label_sound_music_spacer", group = "sound", category = types.basic } @@ -6792,7 +6792,7 @@ function init() count = count + 1 local color = widgetOptionColor if v[4] and v[4] == 0 then color ='\255\100\100\100' end - newOptions[count] = { id = "notifications_notif_" .. v[1], group = "notif", category = types.basic, name = color .. " " .. Spring.I18N(v[3]), type = "bool", value = v[2], --description = v[3] and Spring.I18N(v[3]) or "", + newOptions[count] = { id = "notifications_notif_" .. v[1], group = "notif", category = types.basic, name = color .. " " .. I18N(v[3]), type = "bool", value = v[2], --description = v[3] and Spring.I18N(v[3]) or "", onchange = function(i, value) saveOptionValue('Notifications', 'notifications', 'setNotification' .. v[1], { 'notificationList' }, value) end, @@ -6848,7 +6848,7 @@ function init() if option.id == 'autocloak' then for k, v in pairs(unitdefConfig) do if UnitDefs[k] then - local faction = Spring.I18N('units.factions.' .. string.sub(UnitDefs[k].name,1,3)) + local faction = I18N('units.factions.' .. string.sub(UnitDefs[k].name,1,3)) if faction then count = count + 1 newOptions[count] = { id = "autocloak_" .. k, group = "game", category = types.basic, name = widgetOptionColor .. " " .. UnitDefs[k].translatedHumanName..' ('..faction..')', type = "bool", value = v, description = UnitDefs[k].translatedTooltip, @@ -6961,7 +6961,7 @@ function init() if not data.fromZip then if not userwidgetsDetected then userwidgetsDetected = true - options[#options+1] = { id = "label_custom_widgets", group = "custom", name = Spring.I18N('ui.settings.option.label_widgets'), category = types.basic } + options[#options+1] = { id = "label_custom_widgets", group = "custom", name = I18N('ui.settings.option.label_widgets'), category = types.basic } options[#options+1] = { id = "label_custom_widgets_spacer", group = "custom", category = types.basic } end local desc = data.desc or '' @@ -6971,7 +6971,7 @@ function init() desc = string.gsub(textLines, '[\n]', '\n') end if data.author and data.author ~= '' then - desc = desc .. (desc ~= '' and '\n' or '')..widgetOptionColor..Spring.I18N('ui.settings.option.author')..': '.. data.author + desc = desc .. (desc ~= '' and '\n' or '')..widgetOptionColor..I18N('ui.settings.option.author')..': '.. data.author end options[#options+1] = { id = "widget_"..string.gsub(data.basename, ".lua", ""), group = "custom", category = types.basic, widget = name, name = name, type = "bool", value = GetWidgetToggleValue(name), description = desc } if userwidgetOptions[name] then @@ -6989,7 +6989,7 @@ function init() -- add custom added options (done via WG.options.addOption) if customOptionsCount > 0 then - options[#options+1] = { id = "label_custom_options", group = "custom", name = Spring.I18N('ui.settings.option.label_options'), category = types.basic } + options[#options+1] = { id = "label_custom_options", group = "custom", name = I18N('ui.settings.option.label_options'), category = types.basic } options[#options+1] = { id = "label_custom_options_spacer", group = "custom", category = types.basic } for k, option in pairs(customOptions) do if not getOptionByID(option.name) and not usedCustomOptions[k] then -- prevent adding duplicate diff --git a/luaui/Widgets/gui_ordermenu.lua b/luaui/Widgets/gui_ordermenu.lua index 8587fbdf7cd..3d2fa39d0ee 100644 --- a/luaui/Widgets/gui_ordermenu.lua +++ b/luaui/Widgets/gui_ordermenu.lua @@ -104,10 +104,10 @@ local translationCache = {} local function getCachedTranslation(key, params) if params then -- Don't cache when params are provided since they can vary - return Spring.I18N(key, params) + return I18N(key, params) end if not translationCache[key] then - translationCache[key] = Spring.I18N(key) + translationCache[key] = I18N(key) end return translationCache[key] end @@ -798,7 +798,7 @@ local function drawCell(cell, zoom) local info = commandInfo[cmd.action] local part = (1 / colorize) local grey = (0.93 * (part - 1)) - colorStrCache[cmd.action] = Spring.Utilities.ConvertColor((grey + info.red) / part, (grey + info.green) / part, (grey + info.blue) / part) + colorStrCache[cmd.action] = Utilities.ConvertColor((grey + info.red) / part, (grey + info.green) / part, (grey + info.blue) / part) end textColor = colorStrCache[cmd.action] else diff --git a/luaui/Widgets/gui_pausescreen.lua b/luaui/Widgets/gui_pausescreen.lua index 874ccbb6e00..aabe290b7ee 100644 --- a/luaui/Widgets/gui_pausescreen.lua +++ b/luaui/Widgets/gui_pausescreen.lua @@ -232,7 +232,7 @@ local function drawPause(now) --draw text if not gameover then if not cachedPauseText then - cachedPauseText = Spring.I18N('ui.pauseScreen.paused') + cachedPauseText = I18N('ui.pauseScreen.paused') end font:Begin() font:SetOutlineColor(outlineColor) diff --git a/luaui/Widgets/gui_pip.lua b/luaui/Widgets/gui_pip.lua index 889fbc13940..e6a011b73e2 100644 --- a/luaui/Widgets/gui_pip.lua +++ b/luaui/Widgets/gui_pip.lua @@ -1,5 +1,5 @@ -local devUI = Spring.Utilities.ShowDevUI() -local isSinglePlayer = Spring.Utilities.Gametype.IsSinglePlayer() +local devUI = Utilities.ShowDevUI() +local isSinglePlayer = Utilities.Gametype.IsSinglePlayer() local isSpectator = Spring.GetSpectatingState() pipNumber = pipNumber or 1 @@ -1820,7 +1820,7 @@ do } mapInfo.minGroundHeight, mapInfo.maxGroundHeight = Spring.GetGroundExtremes() local waterIsLava = Spring.GetModOptions().map_waterislava - mapInfo.isLava = Spring.Lava.isLavaMap or (waterIsLava and waterIsLava ~= 0 and waterIsLava ~= "0") + mapInfo.isLava = Lava.isLavaMap or (waterIsLava and waterIsLava ~= 0 and waterIsLava ~= "0") end mapInfo.hasWater = mapInfo.minGroundHeight < 0 or mapInfo.isLava mapInfo.dynamicWaterLevel = nil -- current water/lava level (nil = static sea level = 0) @@ -1836,15 +1836,15 @@ mapInfo.lavaSwirlAmp = 0.003 mapInfo.mapRatio = Game.mapSizeZ / Game.mapSizeX -- Y/X aspect ratio for square-texel tiling mapInfo.lavaColorCorrection = {1.0, 1.0, 1.0} -- default: no color correction if mapInfo.isLava then - mapInfo.lavaCoastWidth = Spring.Lava.coastWidth or 25.0 - mapInfo.lavaUvScale = Spring.Lava.uvScale or 2.0 - mapInfo.lavaSwirlFreq = Spring.Lava.swirlFreq or 0.025 - mapInfo.lavaSwirlAmp = Spring.Lava.swirlAmp or 0.003 - mapInfo.lavaDiffuseEmitTex = Spring.Lava.diffuseEmitTex -- e.g. "LuaUI/images/lava/lava2_diffuseemit.dds" + mapInfo.lavaCoastWidth = Lava.coastWidth or 25.0 + mapInfo.lavaUvScale = Lava.uvScale or 2.0 + mapInfo.lavaSwirlFreq = Lava.swirlFreq or 0.025 + mapInfo.lavaSwirlAmp = Lava.swirlAmp or 0.003 + mapInfo.lavaDiffuseEmitTex = Lava.diffuseEmitTex -- e.g. "LuaUI/images/lava/lava2_diffuseemit.dds" mapInfo.lavaDistortionTex = "LuaUI/images/lavadistortion.png" -- big flowing distortion texture - mapInfo.lavaTideAmplitude = Spring.Lava.tideAmplitude or 2 - mapInfo.lavaTidePeriod = Spring.Lava.tidePeriod or 200 - local cc = Spring.Lava.coastColor + mapInfo.lavaTideAmplitude = Lava.tideAmplitude or 2 + mapInfo.lavaTidePeriod = Lava.tidePeriod or 200 + local cc = Lava.coastColor if cc and type(cc) == "string" then local cr, cg, cb = cc:match("vec3%s*%((.-),%s*(.-),%s*(.-)%)") if cr then @@ -1854,7 +1854,7 @@ if mapInfo.isLava then -- Parse colorCorrection: a final color multiplier applied to ALL lava output. -- Acid/green lava maps use e.g. vec3(0.15, 1.0, 0.45) while red lava uses (1,1,1). mapInfo.lavaColorCorrection = {1.0, 1.0, 1.0} - local ccStr = Spring.Lava.colorCorrection + local ccStr = Lava.colorCorrection if ccStr and type(ccStr) == "string" then local cr2, cg2, cb2 = ccStr:match("vec3%s*%((.-),%s*(.-),%s*(.-)%)") if cr2 then @@ -11433,12 +11433,12 @@ local function DrawUnitsAndFeatures(cachedSelectedUnits) local displayName if cache.isDecoyCommander[dID] then if cache.isScavCommander[dID] then - displayName = Spring.I18N('units.scavDecoyCommanderNameTag') + displayName = I18N('units.scavDecoyCommanderNameTag') else - displayName = Spring.I18N('units.decoyCommanderNameTag') + displayName = I18N('units.decoyCommanderNameTag') end elseif cache.isScavCommander[dID] then - displayName = Spring.I18N('units.scavCommanderNameTag') + displayName = I18N('units.scavCommanderNameTag') elseif entry then displayName = entry.name end @@ -15271,10 +15271,10 @@ local function DrawInteractiveOverlays(mx, my, usedButtonSize) end end -- Generate tooltip with shortcut key on new line if available - local tooltipText = Spring.I18N(tooltipKey) + local tooltipText = I18N(tooltipKey) -- For help button: append left-click hint only when leftButtonPansCamera is enabled if visibleButtons[i].command == 'pip_help' and config.leftButtonPansCamera then - tooltipText = tooltipText .. Spring.I18N('ui.pip.help_leftclick') + tooltipText = tooltipText .. I18N('ui.pip.help_leftclick') end -- Use button's shortcut field first, fall back to getActionHotkey -- In minimap mode, don't show shorcut for track units button @@ -15379,7 +15379,7 @@ function widget:DrawScreen() -- Hover highlight if mx >= btnL and mx <= btnR and my >= btnB and my <= btnT then if WG['tooltip'] then - WG['tooltip'].ShowTooltip('pip'..pipNumber, Spring.I18N('ui.pip.minimap_maximize'), nil, nil, nil) + WG['tooltip'].ShowTooltip('pip'..pipNumber, I18N('ui.pip.minimap_maximize'), nil, nil, nil) end glFunc.Color(1,1,1,0.12) glFunc.Texture(false) @@ -15458,7 +15458,7 @@ function widget:DrawScreen() if mx >= uiState.minModeL - render.elementPadding and mx <= uiState.minModeL + buttonSize + render.elementPadding and my >= uiState.minModeB - render.elementPadding and my <= uiState.minModeB + buttonSize + render.elementPadding then if WG['tooltip'] then - WG['tooltip'].ShowTooltip('pip'..pipNumber, Spring.I18N('ui.pip.tooltip'), nil, nil, nil) + WG['tooltip'].ShowTooltip('pip'..pipNumber, I18N('ui.pip.tooltip'), nil, nil, nil) end glFunc.Color(1,1,1,0.12) glFunc.Texture(false) @@ -15959,7 +15959,7 @@ function widget:DrawScreen() if (render.dim.r-mx + my-render.dim.b <= render.usedButtonSize) then hover = true if WG['tooltip'] then - WG['tooltip'].ShowTooltip('pip'..pipNumber, Spring.I18N('ui.pip.resize'), nil, nil, nil) + WG['tooltip'].ShowTooltip('pip'..pipNumber, I18N('ui.pip.resize'), nil, nil, nil) end end end @@ -15999,7 +15999,7 @@ function widget:DrawScreen() my >= render.dim.t - render.usedButtonSize - render.elementPadding and my <= render.dim.t - render.elementPadding then hover = true if WG['tooltip'] then - WG['tooltip'].ShowTooltip('pip'..pipNumber, Spring.I18N(isMinimapMode and 'ui.pip.minimap_minimize' or 'ui.pip.minimize'), nil, nil, nil) + WG['tooltip'].ShowTooltip('pip'..pipNumber, I18N(isMinimapMode and 'ui.pip.minimap_minimize' or 'ui.pip.minimize'), nil, nil, nil) end glFunc.Color(1,1,1,0.12) glFunc.Texture(false) diff --git a/luaui/Widgets/gui_pregameui.lua b/luaui/Widgets/gui_pregameui.lua index 28ad89f141b..54e24eeb877 100644 --- a/luaui/Widgets/gui_pregameui.lua +++ b/luaui/Widgets/gui_pregameui.lua @@ -30,7 +30,7 @@ local uiScale = (0.7 + (vsx * vsy / 6500000)) local myPlayerID = Spring.GetMyPlayerID() local myPlayerName, _, mySpec, myTeamID = Spring.GetPlayerInfo(myPlayerID, false) myPlayerName = ((WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(myPlayerID)) or myPlayerName -local isFFA = Spring.Utilities.Gametype.IsFFA() +local isFFA = Utilities.Gametype.IsFFA() local isReplay = Spring.IsReplay() local readyButtonColor = {0.05, 0.28, 0} @@ -48,7 +48,7 @@ local gameStarting = false local timer = 0 local timer2 = 0 local auto_ready_timer = 120 -local auto_ready = not Spring.Utilities.Gametype.IsSinglePlayer() +local auto_ready = not Utilities.Gametype.IsSinglePlayer() local buttonPosX = 0.8 local buttonPosY = 0.76 @@ -79,7 +79,7 @@ local function updateReadyTooltip() if cachedTooltipText ~= "" then cachedTooltipText = cachedTooltipText .. "\n" end - cachedTooltipText = cachedTooltipText .. Spring.I18N(description) + cachedTooltipText = cachedTooltipText .. I18N(description) end end else @@ -95,7 +95,7 @@ local offeredAsSub = false --local allowUnready = false -- not enabled cause unreadying doesnt work, have to do workaroud local showLockButton = true -local numPlayers = Spring.Utilities.GetPlayerCount() +local numPlayers = Utilities.GetPlayerCount() local shapeOpacity = 0.6 local unitshapes = {} @@ -141,19 +141,19 @@ end function widget:ViewResize(viewSizeX, viewSizeY) if mySpec then if not offeredAsSub then - buttonText = Spring.I18N('ui.substitutePlayers.offer') + buttonText = I18N('ui.substitutePlayers.offer') else - buttonText = Spring.I18N('ui.substitutePlayers.withdraw') + buttonText = I18N('ui.substitutePlayers.withdraw') end else if readied then if locked then - buttonText = Spring.I18N('ui.initialSpawn.unlock') + buttonText = I18N('ui.initialSpawn.unlock') else - buttonText = Spring.I18N('ui.initialSpawn.lock') + buttonText = I18N('ui.initialSpawn.lock') end else - buttonText = Spring.I18N('ui.initialSpawn.ready') + buttonText = I18N('ui.initialSpawn.ready') end end @@ -249,7 +249,7 @@ function widget:MousePress(sx, sy) locked = true Spring.SendLuaRulesMsg("locking_in_place") else - spEcho(Spring.I18N('ui.initialSpawn.choosePoint')) + spEcho(I18N('ui.initialSpawn.choosePoint')) end end @@ -258,9 +258,9 @@ function widget:MousePress(sx, sy) elseif eligibleAsSub then offeredAsSub = not offeredAsSub if offeredAsSub then - spEcho(Spring.I18N('ui.substitutePlayers.substitutionMessage')) + spEcho(I18N('ui.substitutePlayers.substitutionMessage')) else - spEcho(Spring.I18N('ui.substitutePlayers.offerWithdrawn')) + spEcho(I18N('ui.substitutePlayers.offerWithdrawn')) end Spring.SendLuaRulesMsg(offeredAsSub and '\144' or '\145') end @@ -370,7 +370,7 @@ function widget:DrawScreen() -- display autoready timer if Spring.GetGameRulesParam("all_players_joined") == 1 and not gameStarting and auto_ready then local colorString = auto_ready_timer % 0.75 <= 0.375 and "\255\233\233\233" or "\255\255\255\255" - local text = colorString .. Spring.I18N('ui.initialSpawn.startCountdown', { time = mathMax(1, mathFloor(auto_ready_timer)) }) + local text = colorString .. I18N('ui.initialSpawn.startCountdown', { time = mathMax(1, mathFloor(auto_ready_timer)) }) font:Begin() font:Print(text, vsx * 0.5, vsy * 0.67, 18.5 * uiScale, "co") font:End() @@ -393,7 +393,7 @@ function widget:DrawScreen() if gameStarting then timer = timer + Spring.GetLastUpdateSeconds() local colorString = timer % 0.75 <= 0.375 and "\255\233\233\233" or "\255\255\255\255" - local text = colorString .. Spring.I18N('ui.initialSpawn.startCountdown', { time = mathMax(1, 3 - mathFloor(timer)) }) + local text = colorString .. I18N('ui.initialSpawn.startCountdown', { time = mathMax(1, 3 - mathFloor(timer)) }) font:Begin() font:Print(text, vsx * 0.5, vsy * 0.67, 18.5 * uiScale, "co") font:End() diff --git a/luaui/Widgets/gui_pregameui_draft.lua b/luaui/Widgets/gui_pregameui_draft.lua index cc1aaf99d75..48c411ff268 100644 --- a/luaui/Widgets/gui_pregameui_draft.lua +++ b/luaui/Widgets/gui_pregameui_draft.lua @@ -36,7 +36,7 @@ local uiScale = (0.7 + (vsx * vsy / 6500000)) local myPlayerID = Spring.GetMyPlayerID() local myAllyTeamID = Spring.GetMyAllyTeamID() local _, _, mySpec, myTeamID = Spring.GetPlayerInfo(myPlayerID, false) -local isFFA = Spring.Utilities.Gametype.IsFFA() +local isFFA = Utilities.Gametype.IsFFA() local isReplay = Spring.IsReplay() local readyButtonColor = {0.05, 0.28, 0} @@ -55,7 +55,7 @@ local gameStarting = false local timer = 0 local timer2 = 0 local auto_ready_timer = 120 -local auto_ready = not Spring.Utilities.Gametype.IsSinglePlayer() +local auto_ready = not Utilities.Gametype.IsSinglePlayer() local buttonPosX = 0.8 local buttonPosY = 0.76 @@ -105,7 +105,7 @@ local function updateTooltip() if cachedTooltipText ~= "" then cachedTooltipText = cachedTooltipText .. "\n" end - cachedTooltipText = cachedTooltipText .. Spring.I18N(description) + cachedTooltipText = cachedTooltipText .. I18N(description) end end else @@ -125,7 +125,7 @@ local eligibleAsSub = false local offeredAsSub = false --local allowUnready = false -- not enabled cause unreadying doesnt work, have to do workaroud -local numPlayers = Spring.Utilities.GetPlayerCount() +local numPlayers = Utilities.GetPlayerCount() local shapeOpacity = 0.6 local unitshapes = {} @@ -299,7 +299,7 @@ local function colourNames(teamID, blink) if anonymousMode ~= "disabled" and teamID ~= myTeamID then nameColourR, nameColourG, nameColourB = anonymousTeamColor[1], anonymousTeamColor[2], anonymousTeamColor[3] end - return Spring.Utilities.Color.ToString(nameColourR * mult, nameColourG * mult, nameColourB * mult) + return Utilities.Color.ToString(nameColourR * mult, nameColourG * mult, nameColourB * mult) end local function canPlayerPlaceNow(playerID) @@ -352,7 +352,7 @@ local function draftModeInited() -- We want to ensure the player's UI is loaded if draftModeLoaded then return end local mode = draftMode:gsub("^%l", string.upper) -- Random/Captain/Skill/Fair - spEcho(Spring.I18N('ui.draftOrderMod.mode' .. mode)..".") + spEcho(I18N('ui.draftOrderMod.mode' .. mode)..".") draftModeLoaded = true if mode == "Fair" then fairTimeout = os.clock() + 2 @@ -375,9 +375,9 @@ local function buttonTextRefresh() if eligibleAsSub then showLockButton = true if not offeredAsSub then - buttonText = Spring.I18N('ui.substitutePlayers.offer') + buttonText = I18N('ui.substitutePlayers.offer') else - buttonText = Spring.I18N('ui.substitutePlayers.withdraw') + buttonText = I18N('ui.substitutePlayers.withdraw') end else showLockButton = false @@ -387,18 +387,18 @@ local function buttonTextRefresh() showLockButton = true if readied then if locked then - buttonText = Spring.I18N('ui.initialSpawn.unlock') + buttonText = I18N('ui.initialSpawn.unlock') else - buttonText = Spring.I18N('ui.initialSpawn.lock') + buttonText = I18N('ui.initialSpawn.lock') end else - buttonText = Spring.I18N('ui.initialSpawn.ready') + buttonText = I18N('ui.initialSpawn.ready') end else -- modded checkStartPointChosen() if not myAllyTeamJoined then -- all draftModes showLockButton = true - local text = Spring.I18N('ui.draftOrderMod.waitingForPlayers') + local text = I18N('ui.draftOrderMod.waitingForPlayers') if (voteConTimeout) then vcttimer = mathFloor(voteConTimeout-os.clock())+1 if (vcttimer > 0) then @@ -410,9 +410,9 @@ local function buttonTextRefresh() if startPointChosen then showLockButton = true if locked then - buttonText = Spring.I18N('ui.initialSpawn.unlock') + buttonText = I18N('ui.initialSpawn.unlock') else - buttonText = Spring.I18N('ui.initialSpawn.lock') + buttonText = I18N('ui.initialSpawn.lock') end else showLockButton = false @@ -420,7 +420,7 @@ local function buttonTextRefresh() end elseif myAllyTeamJoined then -- allyTeamJoined and draftMode is random/skill showLockButton = true - buttonText = Spring.I18N('ui.draftOrderMod.waitingForTurn') + buttonText = I18N('ui.draftOrderMod.waitingForTurn') else showLockButton = false end -- how did we get here? end end @@ -477,16 +477,16 @@ local function DrawTeamPlacement() local tname = findPlayerName(current_playerID) local tTeamID = select(4, Spring.GetPlayerInfo(current_playerID, false)) local text = colourNames(tTeamID, false)..tname - font:Print(DMDefaultColorString .. Spring.I18N('ui.draftOrderMod.waitingFor', { name = text}), vsx * 0.5, vsy * 0.23, 22.0 * uiScale, "co") + font:Print(DMDefaultColorString .. I18N('ui.draftOrderMod.waitingFor', { name = text}), vsx * 0.5, vsy * 0.23, 22.0 * uiScale, "co") end elseif not startPointChosen then - font:Print(DMWarnColor .. Spring.I18N('ui.draftOrderMod.placeYourCom'), vsx * 0.5, vsy * 0.23, 22.0 * uiScale, "co") + font:Print(DMWarnColor .. I18N('ui.draftOrderMod.placeYourCom'), vsx * 0.5, vsy * 0.23, 22.0 * uiScale, "co") end if (current_playerID > -1 and next_playerID > -1) then local tname = findPlayerName(next_playerID) local tTeamID = select(4, Spring.GetPlayerInfo(next_playerID, false)) local text = colourNames(tTeamID, false)..tname - font:Print(DMDefaultColorString .. Spring.I18N('ui.draftOrderMod.nextIsPlayer', { name = text}), vsx * 0.5, vsy * 0.205, 15.0 * uiScale, "co") + font:Print(DMDefaultColorString .. I18N('ui.draftOrderMod.nextIsPlayer', { name = text}), vsx * 0.5, vsy * 0.205, 15.0 * uiScale, "co") end -- Team Placement UI @@ -523,7 +523,7 @@ local function DrawTeamPlacement() font:SetOutlineColor(0, 0, 0, 0.5) UiElement(x, y - max_height, x + max_width, y, 1, 1, 1, 1, 1, 1, 1, 1, nil) gl_Color(1, 1, 1, 1) - font:Print(DMWarnColor .. Spring.I18N('ui.draftOrderMod.teamPlacement'), x + max_width/2, y - 32, player_name_font_size * uiScale, "co") + font:Print(DMWarnColor .. I18N('ui.draftOrderMod.teamPlacement'), x + max_width/2, y - 32, player_name_font_size * uiScale, "co") local y_shift for i, data in ipairs(myTeamPlayersOrder) do y_shift = y - (i * 26 * uiScale) - 40 @@ -904,7 +904,7 @@ function widget:MousePress(sx, sy) locked = true Spring.SendLuaRulesMsg("locking_in_place") else - spEcho(Spring.I18N('ui.initialSpawn.choosePoint')) + spEcho(I18N('ui.initialSpawn.choosePoint')) end end @@ -913,9 +913,9 @@ function widget:MousePress(sx, sy) elseif eligibleAsSub then offeredAsSub = not offeredAsSub if offeredAsSub then - spEcho(Spring.I18N('ui.substitutePlayers.substitutionMessage')) + spEcho(I18N('ui.substitutePlayers.substitutionMessage')) else - spEcho(Spring.I18N('ui.substitutePlayers.offerWithdrawn')) + spEcho(I18N('ui.substitutePlayers.offerWithdrawn')) end Spring.SendLuaRulesMsg(offeredAsSub and '\144' or '\145') end @@ -1040,7 +1040,7 @@ function widget:DrawScreen() -- display autoready timer if Spring.GetGameRulesParam("all_players_joined") == 1 and not gameStarting and auto_ready and not auto_ready_disable then local colorString = auto_ready_timer % 0.75 <= 0.375 and "\255\233\233\233" or "\255\255\255\255" - local text = colorString .. Spring.I18N('ui.initialSpawn.startCountdown', { time = mathMax(1, mathFloor(auto_ready_timer)) }) + local text = colorString .. I18N('ui.initialSpawn.startCountdown', { time = mathMax(1, mathFloor(auto_ready_timer)) }) font:Begin() font:Print(text, vsx * 0.5, vsy * 0.67, 18.5 * uiScale, "co") font:End() @@ -1060,8 +1060,8 @@ function widget:DrawScreen() end if draftMode == "fair" or myAllyTeamJoined then if hasStartbox then - local infotext = Spring.I18N('ui.startSpot.anywhere') - local infotextBoxes = Spring.I18N('ui.startSpot.startbox') + local infotext = I18N('ui.startSpot.anywhere') + local infotextBoxes = I18N('ui.startSpot.startbox') font:Begin() font:Print(DMDefaultColorString .. infotextBoxes or infotext, vsx * 0.5, vsy * 0.20315, 15.0 * uiScale, "co") font:End() @@ -1095,7 +1095,7 @@ function widget:DrawScreen() if not mySpec and draftMode ~= "disabled" then if not myAllyTeamJoined then - local text = DMWarnColor .. Spring.I18N('ui.draftOrderMod.waitingForTeamToLoad') + local text = DMWarnColor .. I18N('ui.draftOrderMod.waitingForTeamToLoad') if (voteConTimeout) then vcttimer = mathFloor(voteConTimeout-os.clock())+1 if (vcttimer > 0) then @@ -1128,7 +1128,7 @@ function widget:DrawScreen() if gameStarting then timer = timer + Spring.GetLastUpdateSeconds() local colorString = timer % 0.75 <= 0.375 and "\255\233\233\233" or "\255\255\255\255" - local text = colorString .. Spring.I18N('ui.initialSpawn.startCountdown', { time = mathMax(1, 3 - mathFloor(timer)) }) + local text = colorString .. I18N('ui.initialSpawn.startCountdown', { time = mathMax(1, 3 - mathFloor(timer)) }) font:Begin() font:Print(text, vsx * 0.5, vsy * 0.67, 18.5 * uiScale, "co") font:End() diff --git a/luaui/Widgets/gui_prospector.lua b/luaui/Widgets/gui_prospector.lua index 62bc2f53ed9..fed973bce9e 100644 --- a/luaui/Widgets/gui_prospector.lua +++ b/luaui/Widgets/gui_prospector.lua @@ -237,7 +237,7 @@ function widget:DrawScreen() coords[3] = pos.z end IntegrateMetal(mexDefInfo, coords[1], coords[3], forceUpdate) - DrawTextWithBackground(Spring.I18N('ui.prospector.metalExtraction', { amount = strFormat("%.2f", extraction) }), mx, my, textSize, "do") + DrawTextWithBackground(I18N('ui.prospector.metalExtraction', { amount = strFormat("%.2f", extraction) }), mx, my, textSize, "do") glColor(1, 1, 1, 1) end diff --git a/luaui/Widgets/gui_rank_icons_gl4.lua b/luaui/Widgets/gui_rank_icons_gl4.lua index e21d8177d97..a317af5c5b1 100644 --- a/luaui/Widgets/gui_rank_icons_gl4.lua +++ b/luaui/Widgets/gui_rank_icons_gl4.lua @@ -135,7 +135,7 @@ local vbocachetable = {} for i = 1, 18 do vbocachetable[i] = 0 end -- init this caching table to preserve mem allocs local function AddPrimitiveAtUnit(unitID, unitDefID, noUpload, reason, rank, flash) - if debugmode then Spring.Debug.TraceEcho("add",unitID,reason) end + if debugmode then Debug.TraceEcho("add",unitID,reason) end if Spring.ValidUnitID(unitID) ~= true or Spring.GetUnitIsDead(unitID) == true then if debugmode then spEcho("Warning: Rank Icons GL4 attempted to add an invalid unitID:", unitID) end return nil @@ -180,7 +180,7 @@ local function AddPrimitiveAtUnit(unitID, unitDefID, noUpload, reason, rank, fla end local function RemovePrimitive(unitID,reason) - if debugmode then Spring.Debug.TraceEcho("remove",unitID,reason) end + if debugmode then Debug.TraceEcho("remove",unitID,reason) end if rankVBO.instanceIDtoIndex[unitID] then popElementInstance(rankVBO, unitID) end diff --git a/luaui/Widgets/gui_raptorStatsPanel.lua b/luaui/Widgets/gui_raptorStatsPanel.lua index 185fd45b1c1..996d54049bf 100644 --- a/luaui/Widgets/gui_raptorStatsPanel.lua +++ b/luaui/Widgets/gui_raptorStatsPanel.lua @@ -1,4 +1,4 @@ -if not (Spring.Utilities.Gametype.IsRaptors() and not Spring.Utilities.Gametype.IsScavengers()) then +if not (Utilities.Gametype.IsRaptors() and not Utilities.Gametype.IsScavengers()) then return false end @@ -35,7 +35,7 @@ local messageArgs, marqueeMessage local refreshMarqueeMessage = false local showMarqueeMessage = false -if not Spring.Utilities.Gametype.IsRaptors() then +if not Utilities.Gametype.IsRaptors() then return false end @@ -188,47 +188,47 @@ local function CreatePanelDisplayList() local gain = 0 if Spring.GetGameRulesParam("RaptorQueenAngerGain_Base") then - font:Print(textColor .. Spring.I18N('ui.raptors.queenAngerBase', { value = math.round(Spring.GetGameRulesParam("RaptorQueenAngerGain_Base"), 3) }), panelMarginX+5, PanelRow(3), panelFontSize, "") - font:Print(textColor .. Spring.I18N('ui.raptors.queenAngerAggression', { value = math.round(Spring.GetGameRulesParam("RaptorQueenAngerGain_Aggression"), 3) }), panelMarginX+5, PanelRow(4), panelFontSize, "") + font:Print(textColor .. I18N('ui.raptors.queenAngerBase', { value = math.round(Spring.GetGameRulesParam("RaptorQueenAngerGain_Base"), 3) }), panelMarginX+5, PanelRow(3), panelFontSize, "") + font:Print(textColor .. I18N('ui.raptors.queenAngerAggression', { value = math.round(Spring.GetGameRulesParam("RaptorQueenAngerGain_Aggression"), 3) }), panelMarginX+5, PanelRow(4), panelFontSize, "") --font:Print(textColor .. Spring.I18N('ui.raptors.queenAngerEco', { value = math.round(Spring.GetGameRulesParam("RaptorQueenAngerGain_Eco"), 3) }), panelMarginX+5, PanelRow(5), panelFontSize, "") gain = math.round(Spring.GetGameRulesParam("RaptorQueenAngerGain_Base"), 3) + math.round(Spring.GetGameRulesParam("RaptorQueenAngerGain_Aggression"), 3) + math.round(Spring.GetGameRulesParam("RaptorQueenAngerGain_Eco"), 3) end --font:Print(textColor .. Spring.I18N('ui.raptors.queenAngerWithGain', { anger = gameInfo.raptorQueenAnger, gain = math.round(gain, 3) }), panelMarginX, PanelRow(1), panelFontSize, "") - font:Print(textColor .. Spring.I18N('ui.raptors.queenAngerWithTech', { anger = mathFloor(0.5+gameInfo.raptorQueenAnger), techAnger = gameInfo.raptorTechAnger}), panelMarginX, PanelRow(1), panelFontSize, "") + font:Print(textColor .. I18N('ui.raptors.queenAngerWithTech', { anger = mathFloor(0.5+gameInfo.raptorQueenAnger), techAnger = gameInfo.raptorTechAnger}), panelMarginX, PanelRow(1), panelFontSize, "") local totalSeconds = (100 - gameInfo.raptorQueenAnger) / gain time = string.formatTime(totalSeconds) if totalSeconds < 1800 or revealedQueenEta then if not revealedQueenEta then revealedQueenEta = true end - font:Print(textColor .. Spring.I18N('ui.raptors.queenETA', { count = nBosses, time = time }), panelMarginX+5, PanelRow(2), panelFontSize, "") + font:Print(textColor .. I18N('ui.raptors.queenETA', { count = nBosses, time = time }), panelMarginX+5, PanelRow(2), panelFontSize, "") end if #currentlyResistantToNames > 0 then currentlyResistantToNames = {} currentlyResistantTo = {} end else - font:Print(textColor .. Spring.I18N('ui.raptors.queenHealth', {count = nBosses, health = gameInfo.raptorQueenHealth }), panelMarginX, PanelRow(1), panelFontSize, "") + font:Print(textColor .. I18N('ui.raptors.queenHealth', {count = nBosses, health = gameInfo.raptorQueenHealth }), panelMarginX, PanelRow(1), panelFontSize, "") if nBosses > 1 then - font:Print(textColor .. Spring.I18N('ui.raptors.queensKilled', { nKilled = gameInfo.raptorQueensKilled, nTotal = nBosses }), panelMarginX, PanelRow(2), panelFontSize, "") + font:Print(textColor .. I18N('ui.raptors.queensKilled', { nKilled = gameInfo.raptorQueensKilled, nTotal = nBosses }), panelMarginX, PanelRow(2), panelFontSize, "") end for i = 1,#currentlyResistantToNames do if i == 1 then - font:Print(textColor .. Spring.I18N('ui.raptors.queenResistantToList', {count = nBosses}), panelMarginX, PanelRow(11), panelFontSize, "") + font:Print(textColor .. I18N('ui.raptors.queenResistantToList', {count = nBosses}), panelMarginX, PanelRow(11), panelFontSize, "") end font:Print(textColor .. currentlyResistantToNames[i], panelMarginX+20, PanelRow(11+i), panelFontSize, "") end end else - font:Print(textColor .. Spring.I18N('ui.raptors.gracePeriod', { time = string.formatTime(mathCeil(((currentTime - gameInfo.raptorGracePeriod) * -1) - 0.5)) }), panelMarginX, PanelRow(1), panelFontSize, "") + font:Print(textColor .. I18N('ui.raptors.gracePeriod', { time = string.formatTime(mathCeil(((currentTime - gameInfo.raptorGracePeriod) * -1) - 0.5)) }), panelMarginX, PanelRow(1), panelFontSize, "") end - font:Print(textColor .. Spring.I18N('ui.raptors.raptorKillCount', { count = gameInfo.raptorKills }), panelMarginX, PanelRow(6), panelFontSize, "") + font:Print(textColor .. I18N('ui.raptors.raptorKillCount', { count = gameInfo.raptorKills }), panelMarginX, PanelRow(6), panelFontSize, "") local endless = "" if Spring.GetModOptions().raptor_endless then - endless = ' (' .. Spring.I18N('ui.raptors.difficulty.endless') .. ')' + endless = ' (' .. I18N('ui.raptors.difficulty.endless') .. ')' end - local difficultyCaption = Spring.I18N('ui.raptors.difficulty.' .. difficultyOption) - font:Print(textColor .. Spring.I18N('ui.raptors.mode', { mode = difficultyCaption }) .. endless, 80, h - 170, panelFontSize, "") + local difficultyCaption = I18N('ui.raptors.difficulty.' .. difficultyOption) + font:Print(textColor .. I18N('ui.raptors.mode', { mode = difficultyCaption }) .. endless, 80, h - 170, panelFontSize, "") font:End() gl.Texture(false) @@ -238,18 +238,18 @@ end local function getMarqueeMessage(raptorEventArgs) local messages = {} if raptorEventArgs.type == "firstWave" then - messages[1] = textColor .. Spring.I18N('ui.raptors.firstWave1') - messages[2] = textColor .. Spring.I18N('ui.raptors.firstWave2') + messages[1] = textColor .. I18N('ui.raptors.firstWave1') + messages[2] = textColor .. I18N('ui.raptors.firstWave2') elseif raptorEventArgs.type == "queen" then - messages[1] = textColor .. Spring.I18N('ui.raptors.queenIsAngry1', {count = nBosses}) - messages[2] = textColor .. Spring.I18N('ui.raptors.queenIsAngry2') + messages[1] = textColor .. I18N('ui.raptors.queenIsAngry1', {count = nBosses}) + messages[2] = textColor .. I18N('ui.raptors.queenIsAngry2') elseif raptorEventArgs.type == "airWave" then - messages[1] = textColor .. Spring.I18N('ui.raptors.wave1', {waveNumber = raptorEventArgs.waveCount}) - messages[2] = textColor .. Spring.I18N('ui.raptors.airWave1') - messages[3] = textColor .. Spring.I18N('ui.raptors.airWave2', {unitCount = raptorEventArgs.number}) + messages[1] = textColor .. I18N('ui.raptors.wave1', {waveNumber = raptorEventArgs.waveCount}) + messages[2] = textColor .. I18N('ui.raptors.airWave1') + messages[3] = textColor .. I18N('ui.raptors.airWave2', {unitCount = raptorEventArgs.number}) elseif raptorEventArgs.type == "wave" then - messages[1] = textColor .. Spring.I18N('ui.raptors.wave1', {waveNumber = raptorEventArgs.waveCount}) - messages[2] = textColor .. Spring.I18N('ui.raptors.wave2', {unitCount = raptorEventArgs.number}) + messages[1] = textColor .. I18N('ui.raptors.wave1', {waveNumber = raptorEventArgs.waveCount}) + messages[2] = textColor .. I18N('ui.raptors.wave2', {unitCount = raptorEventArgs.number}) end refreshMarqueeMessage = false @@ -259,14 +259,14 @@ end local function getResistancesMessage() local messages = {} - messages[1] = textColor .. Spring.I18N('ui.raptors.resistanceUnits', {count = nBosses}) + messages[1] = textColor .. I18N('ui.raptors.resistanceUnits', {count = nBosses}) for i = 1,#resistancesTable do local attackerName = UnitDefs[resistancesTable[i]].name if UnitDefNames[attackerName].customParams.i18nfromunit then attackerName = UnitDefNames[attackerName].customParams.i18nfromunit end - messages[i+1] = textColor .. Spring.I18N('units.names.' .. attackerName) - currentlyResistantToNames[#currentlyResistantToNames+1] = Spring.I18N('units.names.' .. attackerName) + messages[i+1] = textColor .. I18N('units.names.' .. attackerName) + currentlyResistantToNames[#currentlyResistantToNames+1] = I18N('units.names.' .. attackerName) end resistancesTable = {} @@ -381,7 +381,7 @@ function widget:Initialize() local y = mathAbs(mathFloor(viewSizeY - 300)) -- reposition if scavengers panel is shown as well - if Spring.Utilities.Gametype.IsScavengers() then + if Utilities.Gametype.IsScavengers() then x = x - 315 end diff --git a/luaui/Widgets/gui_reclaiminfo.lua b/luaui/Widgets/gui_reclaiminfo.lua index 3517f1c4ea6..941529c5dc2 100644 --- a/luaui/Widgets/gui_reclaiminfo.lua +++ b/luaui/Widgets/gui_reclaiminfo.lua @@ -42,7 +42,7 @@ local spGetUnitHealth = Spring.GetUnitHealth local spGetUnitIsBeingBuilt = Spring.GetUnitIsBeingBuilt local spGetMiniMapGeometry = Spring.GetMiniMapGeometry local spGetGroundHeight = Spring.GetGroundHeight -local spI18N = Spring.I18N +local spI18N = I18N local start = false --reclaim area cylinder drawing has been started local metal = 0 --metal count from features in cylinder diff --git a/luaui/Widgets/gui_rejoinprogress.lua b/luaui/Widgets/gui_rejoinprogress.lua index e97aa4ae0de..459f2b6ddab 100644 --- a/luaui/Widgets/gui_rejoinprogress.lua +++ b/luaui/Widgets/gui_rejoinprogress.lua @@ -138,7 +138,7 @@ local function updateRejoin() font2:Begin() font2:SetTextColor(0.92, 0.92, 0.92, 1) font2:SetOutlineColor(0, 0, 0, 1) - font2:Print('\255\225\255\225' .. Spring.I18N('ui.rejoin.catchingUp') .. ' \255\166\166\166'..gametime, area[1] + ((area[3] - area[1]) / 2), area[2] + barHeight * 2 + (fontsize*0.89), fontsize, 'cor') + font2:Print('\255\225\255\225' .. I18N('ui.rejoin.catchingUp') .. ' \255\166\166\166'..gametime, area[1] + ((area[3] - area[1]) / 2), area[2] + barHeight * 2 + (fontsize*0.89), fontsize, 'cor') font2:End() end) end diff --git a/luaui/Widgets/gui_scavStatsPanel.lua b/luaui/Widgets/gui_scavStatsPanel.lua index 35c5a0aeb20..498ae57e016 100644 --- a/luaui/Widgets/gui_scavStatsPanel.lua +++ b/luaui/Widgets/gui_scavStatsPanel.lua @@ -1,4 +1,4 @@ -if not (Spring.Utilities.Gametype.IsScavengers() and not Spring.Utilities.Gametype.IsRaptors()) then +if not (Utilities.Gametype.IsScavengers() and not Utilities.Gametype.IsRaptors()) then return false end @@ -35,7 +35,7 @@ local messageArgs, marqueeMessage local refreshMarqueeMessage = false local showMarqueeMessage = false -if not Spring.Utilities.Gametype.IsScavengers() then +if not Utilities.Gametype.IsScavengers() then return false end @@ -145,13 +145,13 @@ local function CreatePanelDisplayList() local gain = 0 if Spring.GetGameRulesParam("ScavBossAngerGain_Base") then - font:Print(textColor .. Spring.I18N('ui.scavs.bossAngerBase', { value = math.round(Spring.GetGameRulesParam("ScavBossAngerGain_Base"), 3) }), panelMarginX+5, PanelRow(3), panelFontSize, "") - font:Print(textColor .. Spring.I18N('ui.scavs.bossAngerAggression', { value = math.round(Spring.GetGameRulesParam("ScavBossAngerGain_Aggression"), 3) }), panelMarginX+5, PanelRow(4), panelFontSize, "") + font:Print(textColor .. I18N('ui.scavs.bossAngerBase', { value = math.round(Spring.GetGameRulesParam("ScavBossAngerGain_Base"), 3) }), panelMarginX+5, PanelRow(3), panelFontSize, "") + font:Print(textColor .. I18N('ui.scavs.bossAngerAggression', { value = math.round(Spring.GetGameRulesParam("ScavBossAngerGain_Aggression"), 3) }), panelMarginX+5, PanelRow(4), panelFontSize, "") --font:Print(textColor .. Spring.I18N('ui.scavs.bossAngerEco', { value = math.round(Spring.GetGameRulesParam("ScavBossAngerGain_Eco"), 3) }), panelMarginX+5, PanelRow(5), panelFontSize, "") gain = math.round(Spring.GetGameRulesParam("ScavBossAngerGain_Base"), 3) + math.round(Spring.GetGameRulesParam("ScavBossAngerGain_Aggression"), 3) + math.round(Spring.GetGameRulesParam("ScavBossAngerGain_Eco"), 3) end --font:Print(textColor .. Spring.I18N('ui.scavs.bossAngerWithGain', { anger = gameInfo.scavBossAnger, gain = math.round(gain, 3) }), panelMarginX, PanelRow(1), panelFontSize, "") - font:Print(textColor .. Spring.I18N('ui.scavs.bossAngerWithTech', { anger = mathFloor(0.5+gameInfo.scavBossAnger), techAnger = gameInfo.scavTechAnger}), panelMarginX, PanelRow(1), panelFontSize, "") + font:Print(textColor .. I18N('ui.scavs.bossAngerWithTech', { anger = mathFloor(0.5+gameInfo.scavBossAnger), techAnger = gameInfo.scavTechAnger}), panelMarginX, PanelRow(1), panelFontSize, "") local totalSeconds = ((100 - gameInfo.scavBossAnger) / gain) if currentTime <= gameInfo.scavGracePeriod then @@ -160,35 +160,35 @@ local function CreatePanelDisplayList() time = string.formatTime(totalSeconds) if totalSeconds < 1800 or revealedBossEta then if not revealedBossEta then revealedBossEta = true end - font:Print(textColor .. Spring.I18N('ui.scavs.bossETA', { count = nBosses, time = time }), panelMarginX+5, PanelRow(2), panelFontSize, "") + font:Print(textColor .. I18N('ui.scavs.bossETA', { count = nBosses, time = time }), panelMarginX+5, PanelRow(2), panelFontSize, "") end if #currentlyResistantToNames > 0 then currentlyResistantToNames = {} currentlyResistantTo = {} end else - font:Print(textColor .. Spring.I18N('ui.scavs.bossHealth', { count = nBosses, health = gameInfo.scavBossHealth }), panelMarginX, PanelRow(1), panelFontSize, "") + font:Print(textColor .. I18N('ui.scavs.bossHealth', { count = nBosses, health = gameInfo.scavBossHealth }), panelMarginX, PanelRow(1), panelFontSize, "") if nBosses > 1 then - font:Print(textColor .. Spring.I18N('ui.scavs.bossesKilled', { nKilled = gameInfo.scavBossesKilled, nTotal = nBosses }), panelMarginX, PanelRow(2), panelFontSize, "") + font:Print(textColor .. I18N('ui.scavs.bossesKilled', { nKilled = gameInfo.scavBossesKilled, nTotal = nBosses }), panelMarginX, PanelRow(2), panelFontSize, "") end for i = 1,#currentlyResistantToNames do if i == 1 then - font:Print(textColor .. Spring.I18N('ui.scavs.bossResistantToList', { count = nBosses}), panelMarginX, PanelRow(12), panelFontSize, "") + font:Print(textColor .. I18N('ui.scavs.bossResistantToList', { count = nBosses}), panelMarginX, PanelRow(12), panelFontSize, "") end font:Print(textColor .. currentlyResistantToNames[i], panelMarginX+20, PanelRow(12+i), panelFontSize, "") end end else - font:Print(textColor .. Spring.I18N('ui.scavs.gracePeriod', { time = string.formatTime(mathCeil(((currentTime - gameInfo.scavGracePeriod) * -1) - 0.5)) }), panelMarginX, PanelRow(1), panelFontSize, "") + font:Print(textColor .. I18N('ui.scavs.gracePeriod', { time = string.formatTime(mathCeil(((currentTime - gameInfo.scavGracePeriod) * -1) - 0.5)) }), panelMarginX, PanelRow(1), panelFontSize, "") end -- font:Print(textColor .. Spring.I18N('ui.scavs.scavKillCount', { count = gameInfo.scavKills }), panelMarginX, PanelRow(6), panelFontSize, "") local endless = "" if Spring.GetModOptions().scav_endless then - endless = ' (' .. Spring.I18N('ui.scavs.difficulty.endless') .. ')' + endless = ' (' .. I18N('ui.scavs.difficulty.endless') .. ')' end - local difficultyCaption = Spring.I18N('ui.scavs.difficulty.' .. difficultyOption) - font:Print(textColor .. Spring.I18N('ui.scavs.mode', { mode = difficultyCaption }) .. endless, panelMarginX, h - 195, panelFontSize, "") + local difficultyCaption = I18N('ui.scavs.difficulty.' .. difficultyOption) + font:Print(textColor .. I18N('ui.scavs.mode', { mode = difficultyCaption }) .. endless, panelMarginX, h - 195, panelFontSize, "") font:End() gl.Texture(false) @@ -198,18 +198,18 @@ end local function getMarqueeMessage(scavEventArgs) local messages = {} if scavEventArgs.type == "firstWave" then - messages[1] = textColor .. Spring.I18N('ui.scavs.firstWave1') - messages[2] = textColor .. Spring.I18N('ui.scavs.firstWave2') + messages[1] = textColor .. I18N('ui.scavs.firstWave1') + messages[2] = textColor .. I18N('ui.scavs.firstWave2') elseif scavEventArgs.type == "boss" then - messages[1] = textColor .. Spring.I18N('ui.scavs.bossIsAngry1', { count = nBosses }) - messages[2] = textColor .. Spring.I18N('ui.scavs.bossIsAngry2') + messages[1] = textColor .. I18N('ui.scavs.bossIsAngry1', { count = nBosses }) + messages[2] = textColor .. I18N('ui.scavs.bossIsAngry2') elseif scavEventArgs.type == "airWave" then - messages[1] = textColor .. Spring.I18N('ui.scavs.wave1', {waveNumber = scavEventArgs.waveCount}) - messages[2] = textColor .. Spring.I18N('ui.scavs.airWave1') - messages[3] = textColor .. Spring.I18N('ui.scavs.airWave2', {unitCount = scavEventArgs.number}) + messages[1] = textColor .. I18N('ui.scavs.wave1', {waveNumber = scavEventArgs.waveCount}) + messages[2] = textColor .. I18N('ui.scavs.airWave1') + messages[3] = textColor .. I18N('ui.scavs.airWave2', {unitCount = scavEventArgs.number}) elseif scavEventArgs.type == "wave" then - messages[1] = textColor .. Spring.I18N('ui.scavs.wave1', {waveNumber = scavEventArgs.waveCount}) - messages[2] = textColor .. Spring.I18N('ui.scavs.wave2', {unitCount = scavEventArgs.number}) + messages[1] = textColor .. I18N('ui.scavs.wave1', {waveNumber = scavEventArgs.waveCount}) + messages[2] = textColor .. I18N('ui.scavs.wave2', {unitCount = scavEventArgs.number}) end refreshMarqueeMessage = false @@ -219,7 +219,7 @@ end local function getResistancesMessage() local messages = {} - messages[1] = textColor .. (Spring.I18N('ui.scavs.resistanceUnits', { count = nBosses })) + messages[1] = textColor .. (I18N('ui.scavs.resistanceUnits', { count = nBosses })) for i = 1,#resistancesTable do local attackerName = UnitDefs[resistancesTable[i]].name if string.sub(attackerName, -5,-1) == "_scav" then @@ -227,14 +227,14 @@ local function getResistancesMessage() if UnitDefNames[attackerNameNonScav].customParams.i18nfromunit then attackerNameNonScav = UnitDefNames[attackerNameNonScav].customParams.i18nfromunit end - messages[i+1] = textColor .. "Scav " .. Spring.I18N('units.names.' .. attackerNameNonScav) - currentlyResistantToNames[#currentlyResistantToNames+1] = "Scav " .. Spring.I18N('units.names.' .. attackerNameNonScav) + messages[i+1] = textColor .. "Scav " .. I18N('units.names.' .. attackerNameNonScav) + currentlyResistantToNames[#currentlyResistantToNames+1] = "Scav " .. I18N('units.names.' .. attackerNameNonScav) else if UnitDefNames[attackerName].customParams.i18nfromunit then attackerName = UnitDefNames[attackerName].customParams.i18nfromunit end - messages[i+1] = textColor .. Spring.I18N('units.names.' .. attackerName) - currentlyResistantToNames[#currentlyResistantToNames+1] = Spring.I18N('units.names.' .. attackerName) + messages[i+1] = textColor .. I18N('units.names.' .. attackerName) + currentlyResistantToNames[#currentlyResistantToNames+1] = I18N('units.names.' .. attackerName) end end resistancesTable = {} diff --git a/luaui/Widgets/gui_scavenger_info.lua b/luaui/Widgets/gui_scavenger_info.lua index 531f23441d2..4f6f897b0d2 100644 --- a/luaui/Widgets/gui_scavenger_info.lua +++ b/luaui/Widgets/gui_scavenger_info.lua @@ -1,4 +1,4 @@ -local scavengersAIEnabled = Spring.Utilities.Gametype.IsScavengers() +local scavengersAIEnabled = Utilities.Gametype.IsScavengers() if not scavengersAIEnabled then return @@ -165,7 +165,7 @@ function DrawWindow() UiElement(screenX, screenY - screenHeight, screenX + screenWidth, screenY, 0, 1, 1, 1, 1,1,1,1, WG.FlowUI.clampedOpacity) -- title background - local title = Spring.I18N('ui.topbar.button.scavengers') + local title = I18N('ui.topbar.button.scavengers') local titleFontSize = 18 * widgetScale titleRect = { screenX, screenY, mathFloor(screenX + (font2:GetTextWidth(title) * titleFontSize) + (titleFontSize*1.5)), mathFloor(screenY + (titleFontSize*1.7)) } diff --git a/luaui/Widgets/gui_screen_mode_info.lua b/luaui/Widgets/gui_screen_mode_info.lua index cd68a5579fb..c2460be44a8 100644 --- a/luaui/Widgets/gui_screen_mode_info.lua +++ b/luaui/Widgets/gui_screen_mode_info.lua @@ -19,7 +19,7 @@ local spGetCameraState = Spring.GetCameraState local spGetMapDrawMode = Spring.GetMapDrawMode local spGetConfigString = Spring.GetConfigString local spGetViewGeometry = Spring.GetViewGeometry -local i18n = Spring.I18N +local i18n = I18N local glPopMatrix = gl.PopMatrix local glPushMatrix = gl.PushMatrix diff --git a/luaui/Widgets/gui_spectatingstats.lua b/luaui/Widgets/gui_spectatingstats.lua index 1e6e0cb2a3c..980530e400a 100644 --- a/luaui/Widgets/gui_spectatingstats.lua +++ b/luaui/Widgets/gui_spectatingstats.lua @@ -19,9 +19,9 @@ local allyTeamName = {} local textcolor = "\255\200\200\200" local spGetUnitDefID = Spring.GetUnitDefID -local isSinglePlayer = Spring.Utilities.Gametype.IsSinglePlayer() +local isSinglePlayer = Utilities.Gametype.IsSinglePlayer() -local ColorString = Spring.Utilities.Color.ToString +local ColorString = Utilities.Color.ToString local unitdefMobileDps = {} local unitdefStaticDps = {} diff --git a/luaui/Widgets/gui_spectator_hud.lua b/luaui/Widgets/gui_spectator_hud.lua index 311a9bf9753..3d76f02b2e5 100644 --- a/luaui/Widgets/gui_spectator_hud.lua +++ b/luaui/Widgets/gui_spectator_hud.lua @@ -708,9 +708,9 @@ local function buildMetricsEnabled() metricEnabled.id = index metricsEnabled[index] = metricEnabled local i18nTitleKey = "ui.spectator_hud." .. metricEnabled.key .. "_title" - metricEnabled.title = Spring.I18N(i18nTitleKey) + metricEnabled.title = I18N(i18nTitleKey) local i18nTooltipKey = "ui.spectator_hud." .. metricEnabled.key .. "_tooltip" - metricEnabled.tooltip = Spring.I18N(i18nTooltipKey) + metricEnabled.tooltip = I18N(i18nTooltipKey) index = index + 1 end end diff --git a/luaui/Widgets/gui_teamstats.lua b/luaui/Widgets/gui_teamstats.lua index 72374e31da8..6107a39ea93 100644 --- a/luaui/Widgets/gui_teamstats.lua +++ b/luaui/Widgets/gui_teamstats.lua @@ -47,7 +47,7 @@ local buttonclick = 'LuaUI/Sounds/buildbar_waypoint.wav' local lineHeight = fontSize -local isFFA = Spring.Utilities.Gametype.IsFFA() +local isFFA = Utilities.Gametype.IsFFA() local header = { "frame", @@ -226,19 +226,19 @@ end local function refreshHeaders() headerRemap = { - frame = {" ", Spring.I18N('ui.teamStats.player')}, - metalProduced = {Spring.I18N('ui.teamStats.metal'), Spring.I18N('ui.teamStats.resourceProduced')}, - metalExcess = {Spring.I18N('ui.teamStats.metal'), Spring.I18N('ui.teamStats.resourceExcess')}, - energyProduced = {Spring.I18N('ui.teamStats.energy'), Spring.I18N('ui.teamStats.resourceProduced')}, - energyExcess = {Spring.I18N('ui.teamStats.energy'), Spring.I18N('ui.teamStats.resourceExcess')}, - damageDealt = {Spring.I18N('ui.teamStats.damage'), Spring.I18N('ui.teamStats.damageDealt')}, - damageReceived = {Spring.I18N('ui.teamStats.damage'), Spring.I18N('ui.teamStats.damageReceived')}, - damageEfficiency = {Spring.I18N('ui.teamStats.damage'), Spring.I18N('ui.teamStats.damageEfficiency')}, - unitsProduced = {Spring.I18N('ui.teamStats.units'), Spring.I18N('ui.teamStats.unitsProduced')}, - unitsDied = {Spring.I18N('ui.teamStats.units'), Spring.I18N('ui.teamStats.unitsDied')}, - unitsKilled = {Spring.I18N('ui.teamStats.units'), Spring.I18N('ui.teamStats.unitsKilled')}, - aggressionLevel = {Spring.I18N('ui.teamStats.aggression'), Spring.I18N('ui.teamStats.aggressionLevel')}, - actionsPerMinute = {Spring.I18N('ui.teamStats.actionsPerMinute1'), Spring.I18N('ui.teamStats.actionsPerMinute2')}, + frame = {" ", I18N('ui.teamStats.player')}, + metalProduced = {I18N('ui.teamStats.metal'), I18N('ui.teamStats.resourceProduced')}, + metalExcess = {I18N('ui.teamStats.metal'), I18N('ui.teamStats.resourceExcess')}, + energyProduced = {I18N('ui.teamStats.energy'), I18N('ui.teamStats.resourceProduced')}, + energyExcess = {I18N('ui.teamStats.energy'), I18N('ui.teamStats.resourceExcess')}, + damageDealt = {I18N('ui.teamStats.damage'), I18N('ui.teamStats.damageDealt')}, + damageReceived = {I18N('ui.teamStats.damage'), I18N('ui.teamStats.damageReceived')}, + damageEfficiency = {I18N('ui.teamStats.damage'), I18N('ui.teamStats.damageEfficiency')}, + unitsProduced = {I18N('ui.teamStats.units'), I18N('ui.teamStats.unitsProduced')}, + unitsDied = {I18N('ui.teamStats.units'), I18N('ui.teamStats.unitsDied')}, + unitsKilled = {I18N('ui.teamStats.units'), I18N('ui.teamStats.unitsKilled')}, + aggressionLevel = {I18N('ui.teamStats.aggression'), I18N('ui.teamStats.aggressionLevel')}, + actionsPerMinute = {I18N('ui.teamStats.actionsPerMinute1'), I18N('ui.teamStats.actionsPerMinute2')}, } end @@ -358,14 +358,14 @@ function widget:GameFrame(n,forceupdate) end if gameStarted ~= nil then if not playerName then - playerName = teamControllers[teamID] or Spring.I18N('ui.teamStats.gone', { player = '' }) + playerName = teamControllers[teamID] or I18N('ui.teamStats.gone', { player = '' }) else teamControllers[teamID] = playerName end if isDead then - playerName = Spring.I18N('ui.teamStats.dead', { player = playerName }) + playerName = I18N('ui.teamStats.dead', { player = playerName }) elseif not isActive then - playerName = Spring.I18N('ui.teamStats.gone', { player = playerName }) + playerName = I18N('ui.teamStats.gone', { player = playerName }) end end if history.damageReceived ~= 0 then @@ -387,7 +387,7 @@ function widget:GameFrame(n,forceupdate) playerName = playerName or '' - history.frame = Spring.Utilities.ConvertColor(teamColor[1], teamColor[2], teamColor[3]) .. playerName..' ' + history.frame = Utilities.ConvertColor(teamColor[1], teamColor[2], teamColor[3]) .. playerName..' ' allyVec[teamInsertCount] = history totalNumLines = totalNumLines + 1 diff --git a/luaui/Widgets/gui_top_bar.lua b/luaui/Widgets/gui_top_bar.lua index aa324717756..92f2e38b2ba 100644 --- a/luaui/Widgets/gui_top_bar.lua +++ b/luaui/Widgets/gui_top_bar.lua @@ -62,8 +62,8 @@ local myAllyTeamList = sp.GetTeamList(myAllyTeamID) local numTeamsInAllyTeam = #myAllyTeamList -- Game mode / state -local numPlayers = Spring.Utilities.GetPlayerCount() -local isSinglePlayer = Spring.Utilities.Gametype.IsSinglePlayer() +local numPlayers = Utilities.GetPlayerCount() +local isSinglePlayer = Utilities.Gametype.IsSinglePlayer() local chobbyLoaded = false local isSingle = false local gameStarted = (sp.GetGameFrame() > 0) @@ -85,7 +85,7 @@ local isMetalmap = false -- Wind + tide local avgWindValue, riskWindValue local currentWind = 0 -local displayTidalSpeed = not Spring.Lava.isLavaMap +local displayTidalSpeed = not Lava.isLavaMap local tidalSpeed = Spring.GetTidal() -- for now assumed that it is not dynamically changed local tidalWaveAnimationHeight = 10 local windRotation = 0 @@ -342,21 +342,21 @@ local function updateButtons() end if not gameIsOver and chobbyLoaded then - addButton('quit', Spring.I18N('ui.topbar.button.lobby')) + addButton('quit', I18N('ui.topbar.button.lobby')) else - addButton('quit', Spring.I18N('ui.topbar.button.quit')) + addButton('quit', I18N('ui.topbar.button.quit')) end if not gameIsOver and not spec and gameStarted and not isSinglePlayer then - addButton('resign', Spring.I18N('ui.topbar.button.resign')) + addButton('resign', I18N('ui.topbar.button.resign')) end - if WG['options'] then addButton('options', Spring.I18N('ui.topbar.button.settings')) end - if WG['keybinds'] then addButton('keybinds', Spring.I18N('ui.topbar.button.keys')) end - if WG['changelog'] then addButton('changelog', Spring.I18N('ui.topbar.button.changes')) end - if WG['teamstats'] then addButton('stats', Spring.I18N('ui.topbar.button.stats')) end - if gameIsOver then addButton('graphs', Spring.I18N('ui.topbar.button.graphs')) end - if WG['scavengerinfo'] then addButton('scavengers', Spring.I18N('ui.topbar.button.scavengers')) end - if isSinglePlayer and cfg.allowSavegame and WG['savegame'] then addButton('save', Spring.I18N('ui.topbar.button.save')) end + if WG['options'] then addButton('options', I18N('ui.topbar.button.settings')) end + if WG['keybinds'] then addButton('keybinds', I18N('ui.topbar.button.keys')) end + if WG['changelog'] then addButton('changelog', I18N('ui.topbar.button.changes')) end + if WG['teamstats'] then addButton('stats', I18N('ui.topbar.button.stats')) end + if gameIsOver then addButton('graphs', I18N('ui.topbar.button.graphs')) end + if WG['scavengerinfo'] then addButton('scavengers', I18N('ui.topbar.button.scavengers')) end + if isSinglePlayer and cfg.allowSavegame and WG['savegame'] then addButton('save', I18N('ui.topbar.button.save')) end buttonsArea['buttons'][lastbutton][1] = buttonsArea['buttons'][lastbutton][1] - sidePadding offset = offset + sidePadding @@ -421,7 +421,7 @@ local function updateComs(forceText) comcountChanged = nil if WG['tooltip'] and refreshUi then - WG['tooltip'].AddTooltip('coms', area, Spring.I18N('ui.topbar.commanderCountTooltip'), nil, Spring.I18N('ui.topbar.commanderCount')) + WG['tooltip'].AddTooltip('coms', area, I18N('ui.topbar.commanderCountTooltip'), nil, I18N('ui.topbar.commanderCount')) end end @@ -463,8 +463,8 @@ local function updateWind() end) if WG['tooltip'] and refreshUi then - local avgWindValueForTooltip = windFunctions.isNoWind() and Spring.I18N('ui.topbar.wind.nowind1') or avgWindValue - WG['tooltip'].AddTooltip('wind', area, Spring.I18N('ui.topbar.windspeedTooltip', { avgWindValue = avgWindValueForTooltip, riskWindValue = riskWindValue, warnColor = textWarnColor }), nil, Spring.I18N('ui.topbar.windspeed')) + local avgWindValueForTooltip = windFunctions.isNoWind() and I18N('ui.topbar.wind.nowind1') or avgWindValue + WG['tooltip'].AddTooltip('wind', area, I18N('ui.topbar.windspeedTooltip', { avgWindValue = avgWindValueForTooltip, riskWindValue = riskWindValue, warnColor = textWarnColor }), nil, I18N('ui.topbar.windspeed')) end end @@ -504,7 +504,7 @@ local function updateTidal() end) if WG['tooltip'] and refreshUi then - WG['tooltip'].AddTooltip('tidal', area, Spring.I18N('ui.topbar.tidalspeedTooltip'), nil, Spring.I18N('ui.topbar.tidalspeed')) + WG['tooltip'].AddTooltip('tidal', area, I18N('ui.topbar.tidalspeedTooltip'), nil, I18N('ui.topbar.tidalspeed')) end end @@ -575,7 +575,7 @@ local function updateResbarText(res, force) local text = '' if res == 'metal' then - text = (allyteamOverflowingMetal and ' ' .. Spring.I18N('ui.topbar.resources.wastingMetal') .. ' ' or ' ' .. Spring.I18N('ui.topbar.resources.overflowing') .. ' ') + text = (allyteamOverflowingMetal and ' ' .. I18N('ui.topbar.resources.wastingMetal') .. ' ' or ' ' .. I18N('ui.topbar.resources.overflowing') .. ' ') if not supressOverflowNotifs and WG['notifications'] and not isMetalmap and (not WG.sharedMetalFrame or WG.sharedMetalFrame+60 < gameFrame) then if allyteamOverflowingMetal then if numTeamsInAllyTeam > 1 then @@ -588,7 +588,7 @@ local function updateResbarText(res, force) end end else - text = (allyteamOverflowingEnergy and ' ' .. Spring.I18N('ui.topbar.resources.wastingEnergy') .. ' ' or ' ' .. Spring.I18N('ui.topbar.resources.overflowing') .. ' ') + text = (allyteamOverflowingEnergy and ' ' .. I18N('ui.topbar.resources.wastingEnergy') .. ' ' or ' ' .. I18N('ui.topbar.resources.overflowing') .. ' ') if not supressOverflowNotifs and WG['notifications'] and (not WG.sharedEnergyFrame or WG.sharedEnergyFrame+60 < gameFrame) then if allyteamOverflowingEnergy then if numTeamsInAllyTeam > 1 then @@ -847,8 +847,8 @@ local function updateResbar(res) end) local resourceTranslations = { - metal = Spring.I18N('ui.topbar.resources.metal'), - energy = Spring.I18N('ui.topbar.resources.energy') + metal = I18N('ui.topbar.resources.metal'), + energy = I18N('ui.topbar.resources.energy') } local resourceName = resourceTranslations[res] @@ -858,18 +858,18 @@ local function updateResbar(res) -- always update for now if res == 'energy' then - WG['tooltip'].AddTooltip(res .. '_share_slider', { resbarDrawinfo[res].barArea[1], shareIndicatorArea[res][2], conversionIndicatorArea[1], shareIndicatorArea[res][4] }, Spring.I18N('ui.topbar.resources.shareEnergyTooltip'), nil, Spring.I18N('ui.topbar.resources.shareEnergyTooltipTitle')) - WG['tooltip'].AddTooltip(res .. '_share_slider2', { conversionIndicatorArea[3], shareIndicatorArea[res][2], resbarDrawinfo[res].barArea[3], shareIndicatorArea[res][4] }, Spring.I18N('ui.topbar.resources.shareEnergyTooltip'), nil, Spring.I18N('ui.topbar.resources.shareEnergyTooltipTitle')) - WG['tooltip'].AddTooltip(res .. '_metalmaker_slider', conversionIndicatorArea, Spring.I18N('ui.topbar.resources.conversionTooltip'), nil, Spring.I18N('ui.topbar.resources.conversionTooltipTitle')) + WG['tooltip'].AddTooltip(res .. '_share_slider', { resbarDrawinfo[res].barArea[1], shareIndicatorArea[res][2], conversionIndicatorArea[1], shareIndicatorArea[res][4] }, I18N('ui.topbar.resources.shareEnergyTooltip'), nil, I18N('ui.topbar.resources.shareEnergyTooltipTitle')) + WG['tooltip'].AddTooltip(res .. '_share_slider2', { conversionIndicatorArea[3], shareIndicatorArea[res][2], resbarDrawinfo[res].barArea[3], shareIndicatorArea[res][4] }, I18N('ui.topbar.resources.shareEnergyTooltip'), nil, I18N('ui.topbar.resources.shareEnergyTooltipTitle')) + WG['tooltip'].AddTooltip(res .. '_metalmaker_slider', conversionIndicatorArea, I18N('ui.topbar.resources.conversionTooltip'), nil, I18N('ui.topbar.resources.conversionTooltipTitle')) else - WG['tooltip'].AddTooltip(res .. '_share_slider', { resbarDrawinfo[res].barArea[1], shareIndicatorArea[res][2], resbarDrawinfo[res].barArea[3], shareIndicatorArea[res][4] }, Spring.I18N('ui.topbar.resources.shareMetalTooltip'), nil, Spring.I18N('ui.topbar.resources.shareMetalTooltipTitle')) + WG['tooltip'].AddTooltip(res .. '_share_slider', { resbarDrawinfo[res].barArea[1], shareIndicatorArea[res][2], resbarDrawinfo[res].barArea[3], shareIndicatorArea[res][4] }, I18N('ui.topbar.resources.shareMetalTooltip'), nil, I18N('ui.topbar.resources.shareMetalTooltipTitle')) end if refreshUi then - WG['tooltip'].AddTooltip(res .. '_pull', { resbarDrawinfo[res].textPull[2] - (resbarDrawinfo[res].textPull[4] * 2.5), resbarDrawinfo[res].textPull[3], resbarDrawinfo[res].textPull[2] + (resbarDrawinfo[res].textPull[4] * 0.5), resbarDrawinfo[res].textPull[3] + resbarDrawinfo[res].textPull[4] }, Spring.I18N('ui.topbar.resources.pullTooltip', { resource = resourceName })) - WG['tooltip'].AddTooltip(res .. '_income', { resbarDrawinfo[res].textIncome[2] - (resbarDrawinfo[res].textIncome[4] * 2.5), resbarDrawinfo[res].textIncome[3], resbarDrawinfo[res].textIncome[2] + (resbarDrawinfo[res].textIncome[4] * 0.5), resbarDrawinfo[res].textIncome[3] + resbarDrawinfo[res].textIncome[4] }, Spring.I18N('ui.topbar.resources.incomeTooltip', { resource = resourceName })) + WG['tooltip'].AddTooltip(res .. '_pull', { resbarDrawinfo[res].textPull[2] - (resbarDrawinfo[res].textPull[4] * 2.5), resbarDrawinfo[res].textPull[3], resbarDrawinfo[res].textPull[2] + (resbarDrawinfo[res].textPull[4] * 0.5), resbarDrawinfo[res].textPull[3] + resbarDrawinfo[res].textPull[4] }, I18N('ui.topbar.resources.pullTooltip', { resource = resourceName })) + WG['tooltip'].AddTooltip(res .. '_income', { resbarDrawinfo[res].textIncome[2] - (resbarDrawinfo[res].textIncome[4] * 2.5), resbarDrawinfo[res].textIncome[3], resbarDrawinfo[res].textIncome[2] + (resbarDrawinfo[res].textIncome[4] * 0.5), resbarDrawinfo[res].textIncome[3] + resbarDrawinfo[res].textIncome[4] }, I18N('ui.topbar.resources.incomeTooltip', { resource = resourceName })) --WG['tooltip'].AddTooltip(res .. '_expense', { resbarDrawinfo[res].textExpense[2] - (4 * widgetScale), resbarDrawinfo[res].textExpense[3], resbarDrawinfo[res].textExpense[2] + (30 * widgetScale), resbarDrawinfo[res].textExpense[3] + resbarDrawinfo[res].textExpense[4] }, Spring.I18N('ui.topbar.resources.expenseTooltip', { resource = resourceName })) - WG['tooltip'].AddTooltip(res .. '_storage', { resbarDrawinfo[res].textStorage[2] - (resbarDrawinfo[res].textStorage[4] * 2.75), resbarDrawinfo[res].textStorage[3], resbarDrawinfo[res].textStorage[2], resbarDrawinfo[res].textStorage[3] + resbarDrawinfo[res].textStorage[4] }, Spring.I18N('ui.topbar.resources.storageTooltip', { resource = resourceName })) + WG['tooltip'].AddTooltip(res .. '_storage', { resbarDrawinfo[res].textStorage[2] - (resbarDrawinfo[res].textStorage[4] * 2.75), resbarDrawinfo[res].textStorage[3], resbarDrawinfo[res].textStorage[2], resbarDrawinfo[res].textStorage[3] + resbarDrawinfo[res].textStorage[4] }, I18N('ui.topbar.resources.storageTooltip', { resource = resourceName })) end end end @@ -1500,19 +1500,19 @@ local function drawQuitScreen() local h = mathFloor(w / 3.5) local fontSize = h / 6 - local text = Spring.I18N('ui.topbar.quit.reallyQuit') + local text = I18N('ui.topbar.quit.reallyQuit') teamResign = false if not spec then - text = Spring.I18N('ui.topbar.quit.reallyQuitResign') + text = I18N('ui.topbar.quit.reallyQuitResign') if not gameIsOver and chobbyLoaded then if numPlayers < 3 then - text = Spring.I18N('ui.topbar.quit.reallyResign') + text = I18N('ui.topbar.quit.reallyResign') else if getPlayerLiveAllyCount() >= 1 then teamResign = true end - text = Spring.I18N('ui.topbar.quit.reallyResignSpectate') + text = I18N('ui.topbar.quit.reallyResignSpectate') end end end @@ -1569,7 +1569,7 @@ local function drawQuitScreen() color2 = { 0, 0.5, 0, 0.35 + (0.5 * fadeProgress) } end UiButton(quitscreenStayArea[1], quitscreenStayArea[2], quitscreenStayArea[3], quitscreenStayArea[4], 1,1,1,1, 1,1,1,1, nil, color1, color2, padding * 0.5) - font2:Print(Spring.I18N('ui.topbar.quit.stay'), quitscreenStayArea[1] + ((quitscreenStayArea[3] - quitscreenStayArea[1]) / 2), quitscreenStayArea[2] + ((quitscreenStayArea[4] - quitscreenStayArea[2]) / 2) - (fontSize / 3), fontSize, "con") + font2:Print(I18N('ui.topbar.quit.stay'), quitscreenStayArea[1] + ((quitscreenStayArea[3] - quitscreenStayArea[1]) / 2), quitscreenStayArea[2] + ((quitscreenStayArea[4] - quitscreenStayArea[2]) / 2) - (fontSize / 3), fontSize, "con") end -- resign button @@ -1584,7 +1584,7 @@ local function drawQuitScreen() color2 = { 0.5, 0, 0, 0.35 + (0.5 * fadeProgress) } end UiButton(quitscreenResignArea[1], quitscreenResignArea[2], quitscreenResignArea[3], quitscreenResignArea[4], 1,1,1,1, 1,1,1,1, nil, color1, color2, padding * 0.5) - font2:Print(Spring.I18N('ui.topbar.quit.resign'), quitscreenResignArea[1] + ((quitscreenResignArea[3] - quitscreenResignArea[1]) / 2), quitscreenResignArea[2] + ((quitscreenResignArea[4] - quitscreenResignArea[2]) / 2) - (fontSize / 3), fontSize, "con") + font2:Print(I18N('ui.topbar.quit.resign'), quitscreenResignArea[1] + ((quitscreenResignArea[3] - quitscreenResignArea[1]) / 2), quitscreenResignArea[2] + ((quitscreenResignArea[4] - quitscreenResignArea[2]) / 2) - (fontSize / 3), fontSize, "con") if teamResign then if mathIsInRect(mx, my, quitscreenTeamResignArea[1], quitscreenTeamResignArea[2], quitscreenTeamResignArea[3], quitscreenTeamResignArea[4]) then @@ -1596,10 +1596,10 @@ local function drawQuitScreen() color2 = { 0.33, 0.33, 0.33, 0.4 + (0.5 * fadeProgress) } end UiButton(quitscreenTeamResignArea[1], quitscreenTeamResignArea[2], quitscreenTeamResignArea[3], quitscreenTeamResignArea[4], 1,1,1,1, 1,1,1,1, nil, color1, color2, padding * 0.5) - font2:Print(Spring.I18N('ui.topbar.quit.teamResign'), quitscreenTeamResignArea[1] + ((quitscreenTeamResignArea[3] - quitscreenTeamResignArea[1]) / 2), quitscreenTeamResignArea[2] + ((quitscreenTeamResignArea[4] - quitscreenTeamResignArea[2]) / 2) - (fontSize / 3), fontSize, "con") + font2:Print(I18N('ui.topbar.quit.teamResign'), quitscreenTeamResignArea[1] + ((quitscreenTeamResignArea[3] - quitscreenTeamResignArea[1]) / 2), quitscreenTeamResignArea[2] + ((quitscreenTeamResignArea[4] - quitscreenTeamResignArea[2]) / 2) - (fontSize / 3), fontSize, "con") end if mouseOver and teamResign then - font:Print(Spring.I18N('ui.topbar.hint.'..mouseOver), quitscreenTeamResignArea[1] - buttonMargin , quitscreenArea[2] + (2.5*fontSize / 3), fontSize*0.9, "cn") + font:Print(I18N('ui.topbar.hint.'..mouseOver), quitscreenTeamResignArea[1] - buttonMargin , quitscreenArea[2] + (2.5*fontSize / 3), fontSize*0.9, "cn") end end @@ -1613,7 +1613,7 @@ local function drawQuitScreen() color2 = { 0.5, 0, 0, 0.35 + (0.5 * fadeProgress) } end UiButton(quitscreenQuitArea[1], quitscreenQuitArea[2], quitscreenQuitArea[3], quitscreenQuitArea[4], 1,1,1,1, 1,1,1,1, nil, color1, color2, padding * 0.5) - font2:Print(Spring.I18N('ui.topbar.quit.quit'), quitscreenQuitArea[1] + ((quitscreenQuitArea[3] - quitscreenQuitArea[1]) / 2), quitscreenQuitArea[2] + ((quitscreenQuitArea[4] - quitscreenQuitArea[2]) / 2) - (fontSize / 3), fontSize, "con") + font2:Print(I18N('ui.topbar.quit.quit'), quitscreenQuitArea[1] + ((quitscreenQuitArea[3] - quitscreenQuitArea[1]) / 2), quitscreenQuitArea[2] + ((quitscreenQuitArea[4] - quitscreenQuitArea[2]) / 2) - (fontSize / 3), fontSize, "con") end font2:End() @@ -1673,8 +1673,8 @@ local function drawUi() else font2:Begin(true) --font2:Print("\255\200\200\200no wind", windArea[1] + ((windArea[3] - windArea[1]) / 2), windArea[2] + ((windArea[4] - windArea[2]) / 2.05) - (fontsize / 5), fontsize, 'oc') -- Wind speed text - font2:Print("\255\200\200\200" .. Spring.I18N('ui.topbar.wind.nowind1'), windArea[1] + ((windArea[3] - windArea[1]) / 2), windArea[2] + ((windArea[4] - windArea[2]) / 1.5) - (fontsize / 5), fontsize*1.06, 'oc') -- Wind speed text - font2:Print("\255\200\200\200" .. Spring.I18N('ui.topbar.wind.nowind2'), windArea[1] + ((windArea[3] - windArea[1]) / 2), windArea[2] + ((windArea[4] - windArea[2]) / 2.8) - (fontsize / 5), fontsize*1.06, 'oc') -- Wind speed text + font2:Print("\255\200\200\200" .. I18N('ui.topbar.wind.nowind1'), windArea[1] + ((windArea[3] - windArea[1]) / 2), windArea[2] + ((windArea[4] - windArea[2]) / 1.5) - (fontsize / 5), fontsize*1.06, 'oc') -- Wind speed text + font2:Print("\255\200\200\200" .. I18N('ui.topbar.wind.nowind2'), windArea[1] + ((windArea[3] - windArea[1]) / 2), windArea[2] + ((windArea[4] - windArea[2]) / 2.8) - (fontsize / 5), fontsize*1.06, 'oc') -- Wind speed text font2:End() end diff --git a/luaui/Widgets/gui_unit_stats.lua b/luaui/Widgets/gui_unit_stats.lua index 97c640aa671..2f0f76f7363 100644 --- a/luaui/Widgets/gui_unit_stats.lua +++ b/luaui/Widgets/gui_unit_stats.lua @@ -335,7 +335,7 @@ local function GetTeamColorCode(teamID) if not teamID then return "\255\255\255\255" end local R, G, B = spGetTeamColor(teamID) if not R then return "\255\255\255\255" end - return Spring.Utilities.ConvertColor(R, G, B) + return Utilities.ConvertColor(R, G, B) end local function GetTeamName(teamID) @@ -402,7 +402,7 @@ local function disableStats() end function widget:Initialize() - texts = Spring.I18N('ui.unitstats') + texts = I18N('ui.unitstats') widget:ViewResize(vsx,vsy) diff --git a/luaui/Widgets/gui_unitgroups.lua b/luaui/Widgets/gui_unitgroups.lua index 3e1570b3206..7991a65b212 100644 --- a/luaui/Widgets/gui_unitgroups.lua +++ b/luaui/Widgets/gui_unitgroups.lua @@ -533,14 +533,14 @@ function widget:Update(dt) hovered = true local tooltipAddition = '' if numGroups >= 1 then - tooltipAddition = tooltipAddition .. Spring.I18N('ui.unitGroups.shiftclick')..'\n'..Spring.I18N('ui.unitGroups.ctrlclick')..'\n'..Spring.I18N('ui.unitGroups.rightclick') + tooltipAddition = tooltipAddition .. I18N('ui.unitGroups.shiftclick')..'\n'..I18N('ui.unitGroups.ctrlclick')..'\n'..I18N('ui.unitGroups.rightclick') end - tooltipAddition = tooltipAddition .. (tooltipAddition~='' and '\n' or '') .. Spring.I18N('ui.unitGroups.tooltip') + tooltipAddition = tooltipAddition .. (tooltipAddition~='' and '\n' or '') .. I18N('ui.unitGroups.tooltip') if WG['autogroup'] ~= nil then - tooltipAddition = tooltipAddition .. (tooltipAddition~='' and '\n\n' or '') .. "\255\200\255\200" .. Spring.I18N('ui.unitGroups.autogroupTooltip') + tooltipAddition = tooltipAddition .. (tooltipAddition~='' and '\n\n' or '') .. "\255\200\255\200" .. I18N('ui.unitGroups.autogroupTooltip') end if WG['tooltip'] then - WG['tooltip'].ShowTooltip('unitgroups', tooltipAddition, nil, nil, Spring.I18N('ui.unitGroups.name')) + WG['tooltip'].ShowTooltip('unitgroups', tooltipAddition, nil, nil, I18N('ui.unitGroups.name')) end Spring.SetMouseCursor('cursornormal') if b then diff --git a/luaui/Widgets/gui_vote_interface.lua b/luaui/Widgets/gui_vote_interface.lua index 837f687029e..0f0b6a37a83 100644 --- a/luaui/Widgets/gui_vote_interface.lua +++ b/luaui/Widgets/gui_vote_interface.lua @@ -43,7 +43,7 @@ local myPlayerName, _, mySpec, myTeamID, myAllyTeamID = Spring.GetPlayerInfo(myP local isreplay = Spring.IsReplay() -local ColorString = Spring.Utilities.Color.ToString +local ColorString = Utilities.Color.ToString local math_isInRect = math.isInRect local sfind = string.find local ssub = string.sub @@ -250,7 +250,7 @@ local function StartVote(name) -- when called without params its just to refresh fontSize = fontSize * 0.85 font2:SetOutlineColor(0, 0, 0, 0.4) font2:SetTextColor(1, 1, 1, 1) - font2:Print((weAreVoteOwner and Spring.I18N('ui.voting.endVote') or Spring.I18N('ui.voting.no')), noButtonArea[1] + ((noButtonArea[3] - noButtonArea[1]) / 2), noButtonArea[2] + ((noButtonArea[4] - noButtonArea[2]) / 2) - (fontSize / 3), fontSize, "con") + font2:Print((weAreVoteOwner and I18N('ui.voting.endVote') or I18N('ui.voting.no')), noButtonArea[1] + ((noButtonArea[3] - noButtonArea[1]) / 2), noButtonArea[2] + ((noButtonArea[4] - noButtonArea[2]) / 2) - (fontSize / 3), fontSize, "con") -- YES if not weAreVoteOwner then @@ -265,7 +265,7 @@ local function StartVote(name) -- when called without params its just to refresh mult = 1 end UiButton(yesButtonArea[1], yesButtonArea[2], yesButtonArea[3], yesButtonArea[4], 1,1,1,1, 1,1,1,1, nil, color1, color2, elementCorner*0.4) - font2:Print(Spring.I18N('ui.voting.yes'), yesButtonArea[1] + ((yesButtonArea[3] - yesButtonArea[1]) / 2), yesButtonArea[2] + ((yesButtonArea[4] - yesButtonArea[2]) / 2) - (fontSize / 3), fontSize, "con") + font2:Print(I18N('ui.voting.yes'), yesButtonArea[1] + ((yesButtonArea[3] - yesButtonArea[1]) / 2), yesButtonArea[2] + ((yesButtonArea[4] - yesButtonArea[2]) / 2) - (fontSize / 3), fontSize, "con") end font2:End() end @@ -469,9 +469,9 @@ function widget:AddConsoleLine(lines, priority) if sfind(line, "* Vote for command", nil, true) then voteEndTime = os.clock() + voteEndDelay if sfind(line, " passed", nil, true) then - voteEndText = Spring.I18N('ui.voting.votepassed') + voteEndText = I18N('ui.voting.votepassed') elseif sfind(line, " failed", nil, true) then - voteEndText = Spring.I18N('ui.voting.votefailed') + voteEndText = I18N('ui.voting.votefailed') end MinimizeVote() end @@ -480,7 +480,7 @@ function widget:AddConsoleLine(lines, priority) -- > [teh]cluster2[00] * Cancelling "gKick Raiser" vote (command executed directly by Flaka) if sfind(line, "* Vote cancelled", nil, true) or sfind(line, "* Game starting, cancelling ", nil, true) or sfind(line, " vote (command executed directly by ", nil, true) then voteEndTime = os.clock() + voteEndDelay - voteEndText = Spring.I18N('ui.voting.votecancelled') + voteEndText = I18N('ui.voting.votecancelled') MinimizeVote() end -- > [teh]cluster2[00] * [Z]kynet, you cannot vote currently, there is no vote in progress. diff --git a/luaui/Widgets/map_draw_blocker.lua b/luaui/Widgets/map_draw_blocker.lua index 16ad6086a02..de322c25111 100644 --- a/luaui/Widgets/map_draw_blocker.lua +++ b/luaui/Widgets/map_draw_blocker.lua @@ -60,12 +60,12 @@ local function CheckTresholds() local wasBlocked = data.blocked data.blocked = timerCmd if not wasBlocked then - Echo( Spring.I18N('ui.mapDrawBlocker.block', { player = (WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(player) or GetPlayerInfo(player,false) }) ) + Echo( I18N('ui.mapDrawBlocker.block', { player = (WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(player) or GetPlayerInfo(player,false) }) ) end end if sum < unblocklimit and data.blocked and (currentCounter-data.blocked > unblocklimit ) then data.blocked = false - Echo( Spring.I18N('ui.mapDrawBlocker.unblock', { player = (WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(player) or GetPlayerInfo(player,false) }) ) + Echo( I18N('ui.mapDrawBlocker.unblock', { player = (WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(player) or GetPlayerInfo(player,false) }) ) end end end diff --git a/luaui/Widgets/map_edge_extension2.lua b/luaui/Widgets/map_edge_extension2.lua index 0fc58a48fb7..bd63dbf6909 100644 --- a/luaui/Widgets/map_edge_extension2.lua +++ b/luaui/Widgets/map_edge_extension2.lua @@ -525,7 +525,7 @@ function widget:Initialize() widgetHandler:RemoveWidget() return end - if Spring.Lava.isLavaMap == true then + if Lava.isLavaMap == true then widgetHandler:RemoveWidget(self) end diff --git a/luaui/Widgets/map_grass_gl4.lua b/luaui/Widgets/map_grass_gl4.lua index 73fffd14f4f..1ab144809c3 100644 --- a/luaui/Widgets/map_grass_gl4.lua +++ b/luaui/Widgets/map_grass_gl4.lua @@ -682,7 +682,7 @@ local function defineUploadGrassInstanceVBOData() end local function LoadGrassTGA(filename) - local texture, loadfailed = Spring.Utilities.LoadTGA(filename) + local texture, loadfailed = Utilities.LoadTGA(filename) if loadfailed then spEcho("Grass: Failed to load image for grass:",filename, loadfailed) return nil @@ -841,7 +841,7 @@ local function savegrassCmd(_, _, params) end spEcho("Savegrass: ", filename) - texture = Spring.Utilities.NewTGA( + texture = Utilities.NewTGA( mathFloor(mapSizeX / grassConfig.patchResolution), mathFloor(mapSizeZ / grassConfig.patchResolution), 1) @@ -852,7 +852,7 @@ local function savegrassCmd(_, _, params) offset = offset + 1 end end - local success = Spring.Utilities.SaveTGA(texture, filename) + local success = Utilities.SaveTGA(texture, filename) if success then spEcho("Saving grass map image failed",filename,success) end end diff --git a/luaui/Widgets/map_start_position_suggestions.lua b/luaui/Widgets/map_start_position_suggestions.lua index ac6097053af..ce6e2f42105 100644 --- a/luaui/Widgets/map_start_position_suggestions.lua +++ b/luaui/Widgets/map_start_position_suggestions.lua @@ -498,16 +498,16 @@ local function getCaptions(role) local roles = role:split("/") if #roles == 1 then - title = Spring.I18N("ui.startPositionSuggestions.roles." .. roles[1] .. ".title") - description = Spring.I18N("ui.startPositionSuggestions.roles." .. roles[1] .. ".description") + title = I18N("ui.startPositionSuggestions.roles." .. roles[1] .. ".title") + description = I18N("ui.startPositionSuggestions.roles." .. roles[1] .. ".description") elseif #roles > 1 then - local title1 = Spring.I18N("ui.startPositionSuggestions.roles." .. roles[1] .. ".title") - local title2 = Spring.I18N("ui.startPositionSuggestions.roles." .. roles[2] .. ".title") - title = Spring.I18N("ui.startPositionSuggestions.multiRole.title", { role1 = title1, role2 = title2}) + local title1 = I18N("ui.startPositionSuggestions.roles." .. roles[1] .. ".title") + local title2 = I18N("ui.startPositionSuggestions.roles." .. roles[2] .. ".title") + title = I18N("ui.startPositionSuggestions.multiRole.title", { role1 = title1, role2 = title2}) - local description1 = Spring.I18N("ui.startPositionSuggestions.roles." .. roles[1] .. ".description") - local description2 = Spring.I18N("ui.startPositionSuggestions.roles." .. roles[2] .. ".description") - description = Spring.I18N("ui.startPositionSuggestions.multiRole.description", { role1 = description1, role2 = description2}) + local description1 = I18N("ui.startPositionSuggestions.roles." .. roles[1] .. ".description") + local description2 = I18N("ui.startPositionSuggestions.roles." .. roles[2] .. ".description") + description = I18N("ui.startPositionSuggestions.multiRole.description", { role1 = description1, role2 = description2}) end captionsCache[role] = { title = title, description = description } @@ -656,7 +656,7 @@ local function drawTutorial() if not cachedTutorialText then cachedTutorialText = wrapText( - Spring.I18N("ui.startPositionSuggestions.tutorial"), + I18N("ui.startPositionSuggestions.tutorial"), config.tutorialMaxWidthChars ) end diff --git a/luaui/Widgets/map_startbox.lua b/luaui/Widgets/map_startbox.lua index edd2ce56110..d6243790ad0 100644 --- a/luaui/Widgets/map_startbox.lua +++ b/luaui/Widgets/map_startbox.lua @@ -99,7 +99,7 @@ local infotextList local GetTeamColor = Spring.GetTeamColor -local ColorIsDark = Spring.Utilities.Color.ColorIsDark +local ColorIsDark = Utilities.Color.ColorIsDark local glTranslate = gl.Translate local glCallList = gl.CallList @@ -165,7 +165,7 @@ local function getAIName(teamID, includeLock) aiName = niceName end aiNameI18NTable.name = aiName - baseName = Spring.I18N('ui.playersList.aiName', aiNameI18NTable) + baseName = I18N('ui.playersList.aiName', aiNameI18NTable) else local name = spGetPlayerInfo(playerID, false) baseName = WG.playernames and WG.playernames.getPlayername(playerID) or name @@ -268,8 +268,8 @@ local function drawName(x, y, name, teamID) end local function createInfotextList() - local infotext = Spring.I18N('ui.startSpot.anywhere') - local infotextBoxes = Spring.I18N('ui.startSpot.startbox') + local infotext = I18N('ui.startSpot.anywhere') + local infotextBoxes = I18N('ui.startSpot.startbox') if infotextList then gl.DeleteList(infotextList) @@ -433,8 +433,8 @@ local scavengerStartBoxTexture = "LuaUI/Images/scav-tileable_v002_small.tga" local raptorStartBoxTexture = "LuaUI/Images/rapt-tileable_v002_small.tga" -local scavengerAIAllyTeamID = Spring.Utilities.GetScavAllyTeamID() -local raptorsAIAllyTeamID = Spring.Utilities.GetRaptorAllyTeamID() +local scavengerAIAllyTeamID = Utilities.GetScavAllyTeamID() +local raptorsAIAllyTeamID = Utilities.GetRaptorAllyTeamID() ---- Config stuff ------------------ local autoReload = false -- refresh shader code every second (disable in production!) @@ -1352,14 +1352,14 @@ function widget:RecvLuaMsg(msg) invalidatePosCacheEntry(teamID) aiLocationI18NTable.playerName = spGetPlayerInfo(Spring.GetMyPlayerID(), false) aiLocationI18NTable.aiName = getAIName(teamID) - Spring.SendMessage(Spring.I18N('ui.startbox.aiStartLocationRemoved', aiLocationI18NTable)) + Spring.SendMessage(I18N('ui.startbox.aiStartLocationRemoved', aiLocationI18NTable)) else aiPlacedPositions[teamID] = {x = x, z = z} aiPlacementStatus[teamID] = true invalidatePosCacheEntry(teamID) aiLocationI18NTable.playerName = spGetPlayerInfo(Spring.GetMyPlayerID(), false) aiLocationI18NTable.aiName = getAIName(teamID) - Spring.SendMessage(Spring.I18N('ui.startbox.aiStartLocationChanged', aiLocationI18NTable)) + Spring.SendMessage(I18N('ui.startbox.aiStartLocationChanged', aiLocationI18NTable)) end invalidateMinimapIcons() diff --git a/luaui/Widgets/map_startpolygon_gl4.lua b/luaui/Widgets/map_startpolygon_gl4.lua index 38e291e8d01..c37e6f9508b 100644 --- a/luaui/Widgets/map_startpolygon_gl4.lua +++ b/luaui/Widgets/map_startpolygon_gl4.lua @@ -41,8 +41,8 @@ local raptorStartBoxTexture = "LuaUI/Images/rapt-tileable_v002_small.tga" local getCurrentMiniMapRotationOption = VFS.Include("luaui/Include/minimap_utils.lua").getCurrentMiniMapRotationOption local ROTATION = VFS.Include("luaui/Include/minimap_utils.lua").ROTATION -local scavengerAIAllyTeamID = Spring.Utilities.GetScavAllyTeamID() -local raptorsAIAllyTeamID = Spring.Utilities.GetRaptorAllyTeamID() +local scavengerAIAllyTeamID = Utilities.GetScavAllyTeamID() +local raptorsAIAllyTeamID = Utilities.GetRaptorAllyTeamID() ---- Config stuff ------------------ local autoReload = false -- refresh shader code every second (disable in production!) diff --git a/luaui/Widgets/snd_notifications.lua b/luaui/Widgets/snd_notifications.lua index 32ed820fa41..f81650ae1eb 100644 --- a/luaui/Widgets/snd_notifications.lua +++ b/luaui/Widgets/snd_notifications.lua @@ -522,8 +522,8 @@ function widget:Initialize() end tableSort(soundInfo, function(a, b) - local nameA = Spring.I18N(a[3]) or "" - local nameB = Spring.I18N(b[3]) or "" + local nameA = I18N(a[3]) or "" + local nameB = I18N(b[3]) or "" return string.lower(nameA) < string.lower(nameB) end) @@ -583,7 +583,7 @@ function widget:Initialize() end if displayMessages and WG['messages'] and notification[event].textID and not notification[event].notext then if not notification[event].customText then - WG['messages'].addMessage(Spring.I18N(notification[event].textID)) + WG['messages'].addMessage(I18N(notification[event].textID)) else WG['messages'].addMessage(notification[event].textID) end @@ -627,7 +627,7 @@ function widget:Initialize() end - if Spring.Utilities.Gametype.IsRaptors() and Spring.Utilities.Gametype.IsScavengers() then + if Utilities.Gametype.IsRaptors() and Utilities.Gametype.IsScavengers() then queueNotification('RaptorsAndScavsMixed') end end @@ -648,7 +648,7 @@ function widget:GameFrame(gf) m_currentLevel, m_storage, m_pull, m_income, m_expense, m_share, m_sent, m_received = spGetTeamResources(myTeamID, 'metal') -- raptors and scavs mixed check - if Spring.Utilities.Gametype.IsRaptors() and Spring.Utilities.Gametype.IsScavengers() then + if Utilities.Gametype.IsRaptors() and Utilities.Gametype.IsScavengers() then queueNotification('RaptorsAndScavsMixed') end @@ -904,7 +904,7 @@ local function playNextSound() Spring.PlaySoundFile(soundEffectsFolder .. notification[event].soundEffect .. ".wav", globalVolume, 'ui') end if displayMessages and WG['messages'] and notification[event].textID and (not notification[event].notext) then - WG['messages'].addMessage(Spring.I18N(notification[event].textID)) + WG['messages'].addMessage(I18N(notification[event].textID)) end end diff --git a/luaui/Widgets/snd_notifications_addon_scavraptorstatus.lua b/luaui/Widgets/snd_notifications_addon_scavraptorstatus.lua index 389611d287c..1e3909820d1 100644 --- a/luaui/Widgets/snd_notifications_addon_scavraptorstatus.lua +++ b/luaui/Widgets/snd_notifications_addon_scavraptorstatus.lua @@ -9,7 +9,7 @@ function widget:GetInfo() } end -if not (Spring.Utilities.Gametype.IsRaptors() and not Spring.Utilities.Gametype.IsScavengers()) then +if not (Utilities.Gametype.IsRaptors() and not Utilities.Gametype.IsScavengers()) then return false end @@ -21,7 +21,7 @@ function widget:Update(dt) if UpdateTimer >= 1 then UpdateTimer = UpdateTimer - 1 - if Spring.Utilities.Gametype.IsRaptors() then + if Utilities.Gametype.IsRaptors() then FinalBossProgress = Spring.GetGameRulesParam("raptorQueenAnger") FinalBossHealth = Spring.GetGameRulesParam("raptorQueenHealth") TechProgress = Spring.GetGameRulesParam("raptorTechAnger") @@ -98,7 +98,7 @@ function widget:Update(dt) - elseif Spring.Utilities.Gametype.IsScavengers() then + elseif Utilities.Gametype.IsScavengers() then FinalBossProgress = Spring.GetGameRulesParam("scavBossAnger") FinalBossHealth = Spring.GetGameRulesParam("scavBossHealth") TechProgress = Spring.GetGameRulesParam("scavTechAnger") diff --git a/luaui/Widgets/stats_damage.lua b/luaui/Widgets/stats_damage.lua index 711b64ab9ca..a4550d333f4 100644 --- a/luaui/Widgets/stats_damage.lua +++ b/luaui/Widgets/stats_damage.lua @@ -93,7 +93,7 @@ end function widget:GameOver() if not info or Spring.IsReplay() then return end - if Spring.Utilities.IsDevMode() then return end + if Utilities.IsDevMode() then return end table.save(stats, STATS_FILE, '-- Damage Stats') end diff --git a/luaui/Widgets/tweakdefs_unit_translations.lua b/luaui/Widgets/tweakdefs_unit_translations.lua index 6ef85b5351a..304f57ff64a 100644 --- a/luaui/Widgets/tweakdefs_unit_translations.lua +++ b/luaui/Widgets/tweakdefs_unit_translations.lua @@ -24,11 +24,11 @@ local function updateTranslations() local customTooltip = unitDef.customParams[tooltipKey] if customHumanName then - Spring.I18N.set(currentLanguage .. '.units.names.' .. unitDefName, customHumanName) + I18N.set(currentLanguage .. '.units.names.' .. unitDefName, customHumanName) end if customTooltip then - Spring.I18N.set(currentLanguage .. '.units.descriptions.' .. unitDefName, customTooltip) + I18N.set(currentLanguage .. '.units.descriptions.' .. unitDefName, customTooltip) end end end diff --git a/luaui/Widgets/unit_attackMoveNotification.lua b/luaui/Widgets/unit_attackMoveNotification.lua index e89bc257434..b180a3fd9e0 100644 --- a/luaui/Widgets/unit_attackMoveNotification.lua +++ b/luaui/Widgets/unit_attackMoveNotification.lua @@ -97,7 +97,7 @@ function widget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer) end if unitHumanName[unitDefID] then lastAlarmTime = now - spEcho( Spring.I18N('ui.moveAttackNotify.underAttack', { unit = unitHumanName[unitDefID] }) ) + spEcho( I18N('ui.moveAttackNotify.underAttack', { unit = unitHumanName[unitDefID] }) ) if unitUnderattackSounds[unitDefID] then local id = random(1, #unitUnderattackSounds[unitDefID]) --pick a sound from the table by random --(id 138, name warning2, volume 1) @@ -115,7 +115,7 @@ function widget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer) end function widget:UnitMoveFailed(unitID, unitDefID, unitTeam) - spEcho( Spring.I18N('ui.moveAttackNotify.cantMove', { unit = unitHumanName[unitDefID] }) ) + spEcho( I18N('ui.moveAttackNotify.cantMove', { unit = unitHumanName[unitDefID] }) ) end function widget:LanguageChanged() diff --git a/luaui/Widgets/unit_auto_group.lua b/luaui/Widgets/unit_auto_group.lua index ed7d284ea63..bd73af4c495 100644 --- a/luaui/Widgets/unit_auto_group.lua +++ b/luaui/Widgets/unit_auto_group.lua @@ -153,9 +153,9 @@ local function changeUnitTypeAutogroup(gr, removeAll) for udid, _ in pairs(selUnitDefIDs) do if verbose then if gr then - Echo( Spring.I18N('ui.autogroups.unitAdded', { unit = UnitDefs[udid].translatedHumanName, groupNumber = gr }) ) + Echo( I18N('ui.autogroups.unitAdded', { unit = UnitDefs[udid].translatedHumanName, groupNumber = gr }) ) else - Echo( Spring.I18N('ui.autogroups.unitRemoved', { unit = UnitDefs[udid].translatedHumanName }) ) + Echo( I18N('ui.autogroups.unitRemoved', { unit = UnitDefs[udid].translatedHumanName }) ) end end end @@ -222,7 +222,7 @@ local function loadAutogroupPreset(newPreset) currPreset = newPreset - Echo(Spring.I18N("ui.autogroups.presetSelected", {presetNum = currPreset})) + Echo(I18N("ui.autogroups.presetSelected", {presetNum = currPreset})) unit2group = presets[currPreset] if not unit2group then diff --git a/luaui/Widgets/unit_share_tracker.lua b/luaui/Widgets/unit_share_tracker.lua index fa9edcf16be..1cefc97a227 100644 --- a/luaui/Widgets/unit_share_tracker.lua +++ b/luaui/Widgets/unit_share_tracker.lua @@ -26,7 +26,7 @@ local spGetUnitHealth = Spring.GetUnitHealth local spGetUnitRulesParam = Spring.GetUnitRulesParam local spEcho = Spring.Echo local spPlaySoundFile = Spring.PlaySoundFile -local spI18N = Spring.I18N +local spI18N = I18N local spWorldToScreenCoords = Spring.WorldToScreenCoords -- Localized GL functions diff --git a/luaui/Widgets/widget_selector.lua b/luaui/Widgets/widget_selector.lua index 68e7d54edc3..727cd76dfcd 100644 --- a/luaui/Widgets/widget_selector.lua +++ b/luaui/Widgets/widget_selector.lua @@ -224,7 +224,7 @@ function drawChatInput() local leftOffset = floor(lineHeight*0.7) local distance = 0 --elementMargin local usedFont = inputMode == '' and font3 or font - local modeText = Spring.I18N('ui.settings.filter') + local modeText = I18N('ui.settings.filter') if inputMode ~= '' then modeText = inputMode end @@ -346,19 +346,19 @@ end function widget:Initialize() buttons = { --see MouseRelease for which functions are called by which buttons - [1] = Spring.I18N('ui.widgetselector.button_reloadluaui'), - [2] = Spring.I18N('ui.widgetselector.button_unloadallwidgets'), - [3] = Spring.I18N('ui.widgetselector.button_disallowuserwidgets'), - [4] = Spring.I18N('ui.widgetselector.button_resetluaui'), - [5] = Spring.I18N('ui.widgetselector.button_factoryresetluaui'), + [1] = I18N('ui.widgetselector.button_reloadluaui'), + [2] = I18N('ui.widgetselector.button_unloadallwidgets'), + [3] = I18N('ui.widgetselector.button_disallowuserwidgets'), + [4] = I18N('ui.widgetselector.button_resetluaui'), + [5] = I18N('ui.widgetselector.button_factoryresetluaui'), } if not allowuserwidgets then buttons[3] = '' else if widgetHandler.allowUserWidgets then - buttons[3] = Spring.I18N('ui.widgetselector.button_disallowuserwidgets') + buttons[3] = I18N('ui.widgetselector.button_disallowuserwidgets') else - buttons[3] = Spring.I18N('ui.widgetselector.button_allowuserwidgets') + buttons[3] = I18N('ui.widgetselector.button_allowuserwidgets') end end @@ -675,7 +675,7 @@ function widget:KeyPress(key, mods, isRepeat) WG['topbar'].hideWindows() end show = newShow - if show and not (Spring.Utilities.IsDevMode() or Spring.Utilities.ShowDevUI() or Spring.GetConfigInt("widgetselector", 0) == 1 or localWidgetCount > 0) then + if show and not (Utilities.IsDevMode() or Utilities.ShowDevUI() or Spring.GetConfigInt("widgetselector", 0) == 1 or localWidgetCount > 0) then show = false end if show then @@ -801,7 +801,7 @@ function widget:DrawScreen() if updateUi then updateTextInputDlist = true - local title = Spring.I18N('ui.widgetselector.title') + local title = I18N('ui.widgetselector.title') local titleFontSize = 18 * widgetScale titleRect = { backgroundRect[1], backgroundRect[4], mathFloor(backgroundRect[1] + (font2:GetTextWidth(title) * titleFontSize) + (titleFontSize*1.5)), mathFloor(backgroundRect[4] + (titleFontSize*1.7)) } dlistGuishader = gl.DeleteList(dlistGuishader) @@ -870,7 +870,7 @@ function widget:DrawScreen() if prevFromZip ~= data.fromZip then customWidgetPosy = posy font2:SetTextColor(0.5, 0.5, 0.5, 0.4) - font2:Print(Spring.I18N('ui.widgetselector.islocal'), minx + fontSize * sizeMultiplier * 0.25, posy + (fontSize * sizeMultiplier) * 0.33, fontSize * sizeMultiplier, "") + font2:Print(I18N('ui.widgetselector.islocal'), minx + fontSize * sizeMultiplier * 0.25, posy + (fontSize * sizeMultiplier) * 0.33, fontSize * sizeMultiplier, "") end local color = '' @@ -1016,9 +1016,9 @@ function widget:DrawScreen() end if d.author and d.author ~= '' then local textLines, numLines = font:WrapText(d.author, maxWidth) - tooltip = tooltip.."\255\175\175\175" .. Spring.I18N('ui.widgetselector.author')..': ' ..string.gsub(textLines, '[\n]', "\n\255\175\175\175")..'\n' + tooltip = tooltip.."\255\175\175\175" .. I18N('ui.widgetselector.author')..': ' ..string.gsub(textLines, '[\n]', "\n\255\175\175\175")..'\n' end - tooltip = tooltip .."\255\175\175\175".. Spring.I18N('ui.widgetselector.file')..': ' ..d.basename .. (not d.fromZip and ' ('..Spring.I18N('ui.widgetselector.islocal')..')' or '') + tooltip = tooltip .."\255\175\175\175".. I18N('ui.widgetselector.file')..': ' ..d.basename .. (not d.fromZip and ' ('..I18N('ui.widgetselector.islocal')..')' or '') if WG['tooltip'] then WG['tooltip'].ShowTooltip('info', tooltip, nil, nil, tooltipTitle) end diff --git a/luaui/configs/DeferredLightsGL4config.lua b/luaui/configs/DeferredLightsGL4config.lua index b2446ec8788..00ed19a39bb 100644 --- a/luaui/configs/DeferredLightsGL4config.lua +++ b/luaui/configs/DeferredLightsGL4config.lua @@ -40312,7 +40312,7 @@ local xmaslightbase = { -- White Fire Remake 1.3 -- Ice Scream v2.5.1 -- add colorful xmas lights to a percentage of certain snowy trees -if Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"] then --and os.date("%d") <= "26" +if Utilities.Gametype.GetCurrentHolidays()["xmas"] then --and os.date("%d") <= "26" local snowy_tree_keys = {allpinesb_ad0 = 60, __tree_fir_tall_3 = 60, __tree_fir_ = 60} local xmasColors = { [1] = {234,13,13}, -- red diff --git a/luaui/configs/gridmenu_config.lua b/luaui/configs/gridmenu_config.lua index 79d395ab0c6..92a002d78de 100644 --- a/luaui/configs/gridmenu_config.lua +++ b/luaui/configs/gridmenu_config.lua @@ -11,10 +11,10 @@ local homeGridPos = { } local unitCategories = {} -local BUILDCAT_ECONOMY = Spring.I18N("ui.buildMenu.category_econ") -local BUILDCAT_COMBAT = Spring.I18N("ui.buildMenu.category_combat") -local BUILDCAT_UTILITY = Spring.I18N("ui.buildMenu.category_utility") -local BUILDCAT_PRODUCTION = Spring.I18N("ui.buildMenu.category_production") +local BUILDCAT_ECONOMY = I18N("ui.buildMenu.category_econ") +local BUILDCAT_COMBAT = I18N("ui.buildMenu.category_combat") +local BUILDCAT_UTILITY = I18N("ui.buildMenu.category_utility") +local BUILDCAT_PRODUCTION = I18N("ui.buildMenu.category_production") local categories = { BUILDCAT_ECONOMY, diff --git a/luaui/configs/gridmenu_layouts.lua b/luaui/configs/gridmenu_layouts.lua index 6fd940cb8ea..43dc386db24 100644 --- a/luaui/configs/gridmenu_layouts.lua +++ b/luaui/configs/gridmenu_layouts.lua @@ -2535,7 +2535,7 @@ if Spring.GetModOptions().experimentalextraunits or Spring.GetModOptions().scavu end -if Spring.Utilities.Gametype.IsScavengers() or Spring.GetModOptions().forceallunits then +if Utilities.Gametype.IsScavengers() or Spring.GetModOptions().forceallunits then local scavLabGrids = {} local scavUnitGrids = {} for unitName, content in pairs(labGrids) do diff --git a/luaui/i18nhelpers.lua b/luaui/i18nhelpers.lua index 0e00bd26d96..0d78f8c6620 100644 --- a/luaui/i18nhelpers.lua +++ b/luaui/i18nhelpers.lua @@ -12,18 +12,18 @@ local function refreshUnitDefs() local proxyUnitDef = UnitDefNames[proxyUnitDefName] proxyUnitDefName = proxyUnitDef and proxyUnitDef.customParams.i18nfromunit or proxyUnitDefName - local fromUnitHumanName = Spring.I18N('units.names.' .. proxyUnitDefName) - humanName = Spring.I18N('units.scavenger', { name = fromUnitHumanName }) + local fromUnitHumanName = I18N('units.names.' .. proxyUnitDefName) + humanName = I18N('units.scavenger', { name = fromUnitHumanName }) if (i18nDescriptionEntries[unitDefName]) then - tooltip = Spring.I18N('units.descriptions.' .. unitDefName) + tooltip = I18N('units.descriptions.' .. unitDefName) else - tooltip = Spring.I18N('units.descriptions.' .. proxyUnitDefName) + tooltip = I18N('units.descriptions.' .. proxyUnitDefName) end else local proxyUnitDefName = unitDef.customParams.i18nfromunit or unitDefName - humanName = Spring.I18N('units.names.' .. proxyUnitDefName) - tooltip = Spring.I18N('units.descriptions.' .. proxyUnitDefName) + humanName = I18N('units.names.' .. proxyUnitDefName) + tooltip = I18N('units.descriptions.' .. proxyUnitDefName) end unitDef.translatedHumanName = humanName @@ -33,9 +33,9 @@ end local function setCorpseDescription(unitHumanName, featureDef) if featureDef.customParams.category == 'corpses' then - featureDef.translatedDescription = Spring.I18N('units.dead', { name = unitHumanName }) + featureDef.translatedDescription = I18N('units.dead', { name = unitHumanName }) elseif featureDef.customParams.category == 'heaps' then - featureDef.translatedDescription = Spring.I18N('units.heap', { name = unitHumanName }) + featureDef.translatedDescription = I18N('units.heap', { name = unitHumanName }) end end @@ -55,7 +55,7 @@ local function refreshFeatureDefs() for name, featureDef in pairs(FeatureDefNames) do if not processedFeatureDefs[featureDef.id] then local proxyName = featureDef.customParams.i18nfrom or name - featureDef.translatedDescription = Spring.I18N('features.names.' .. proxyName) + featureDef.translatedDescription = I18N('features.names.' .. proxyName) end end end diff --git a/luaui/main.lua b/luaui/main.lua index 2ef5ec6f1c3..333ee826004 100644 --- a/luaui/main.lua +++ b/luaui/main.lua @@ -20,7 +20,7 @@ spSendCommands("ctrlpanel " .. LUAUI_DIRNAME .. "ctrlpanel.txt") VFS.Include("init.lua", nil, VFS.ZIP) VFS.Include(LUAUI_DIRNAME .. "rml_setup.lua", nil, VFS.ZIP) -Spring.I18N.setLanguage( Spring.GetConfigString('language', 'en') ) +I18N.setLanguage( Spring.GetConfigString('language', 'en') ) VFS.Include(LUAUI_DIRNAME .. "utils.lua", nil, VFS.ZIP) VFS.Include(LUAUI_DIRNAME .. "setupdefs.lua", nil, VFS.ZIP) diff --git a/modules/graphics/instancevboidtable.lua b/modules/graphics/instancevboidtable.lua index 95837adc9ab..d2afa1249a5 100644 --- a/modules/graphics/instancevboidtable.lua +++ b/modules/graphics/instancevboidtable.lua @@ -379,7 +379,7 @@ local function popElementInstance(iT, instanceID, noUpload) --Spring.SendCommands({"pause 1"}) end Spring.Echo(s) - Spring.Debug.TraceFullEcho(nil,nil, nil, dbgt(iT.indextoUnitID), dbgt(iT.indextoInstanceID)) + Debug.TraceFullEcho(nil,nil, nil, dbgt(iT.indextoUnitID), dbgt(iT.indextoInstanceID)) iT.zombies = {} iT.numZombies = 0 end @@ -432,7 +432,7 @@ local function popElementInstance(iT, instanceID, noUpload) end else Spring.Echo("Tried to pop back an invalid unitID ", myunitID, "from", iT.myName, "while removing instance", instanceID,". Ensure that you remove invalid units from your instance tables") - Spring.Debug.TraceFullEcho() + Debug.TraceFullEcho() end end elseif objecttype == "unitDefID" then diff --git a/modules/graphics/instancevbotable.lua b/modules/graphics/instancevbotable.lua index 21539b5f58a..b18b8f43186 100644 --- a/modules/graphics/instancevbotable.lua +++ b/modules/graphics/instancevbotable.lua @@ -441,7 +441,7 @@ local function pushElementInstance(iT,thisInstance, instanceID, updateExisting, -- returns: the index of the instanceID in the table on success, else nil if #thisInstance ~= iT.instanceStep then Spring.Echo("Trying to upload an oddly sized instance into",iT.myName, #thisInstance, "instead of ",iT.instanceStep) - Spring.Debug.TraceFullEcho(20,20,20, "pushElementInstance Failure:"..iT.myName ) + Debug.TraceFullEcho(20,20,20, "pushElementInstance Failure:"..iT.myName ) end local iTusedElements = iT.usedElements local iTStep = iT.instanceStep @@ -480,7 +480,7 @@ local function pushElementInstance(iT,thisInstance, instanceID, updateExisting, if isvalidid == false then Spring.Echo("Error: Attempted to push an invalid unit/featureID",unitID, "into", iT.myName) noUpload = true - Spring.Debug.TraceFullEcho(20,20,20,"invalid unit/featureID in " ..iT.myName) + Debug.TraceFullEcho(20,20,20,"invalid unit/featureID in " ..iT.myName) end iT.indextoUnitID[thisInstanceIndex] = unitID end @@ -515,7 +515,7 @@ local function popElementInstance(iT, instanceID, noUpload) if iT.instanceIDtoIndex[instanceID] == nil then -- if key is instanceID yet does not exist, then warn and bail Spring.Echo("Tried to remove element ",instanceID,'From instanceTable', iT.myName, 'but it does not exist in it') - Spring.Debug.TraceFullEcho(10,10,3, iT.myName) + Debug.TraceFullEcho(10,10,3, iT.myName) return nil end if iT.usedElements == 0 then -- Dont remove the last element @@ -598,7 +598,7 @@ local function popElementInstance(iT, instanceID, noUpload) s = s .. " " .. tostring(zombie) ..'/'..tostring(gf) Spring.Echo("ZOMBIE instanceID", zombie, 'gf',gf) --Spring.SendCommands({"pause 1"}) - Spring.Debug.TraceFullEcho(nil,nil,nil, iT.myName) + Debug.TraceFullEcho(nil,nil,nil, iT.myName) end Spring.Echo(s) iT.zombies = {} diff --git a/units/Scavengers/Boss/scavengerbossv4.lua b/units/Scavengers/Boss/scavengerbossv4.lua index f93c7baade3..2ca94fdecb3 100644 --- a/units/Scavengers/Boss/scavengerbossv4.lua +++ b/units/Scavengers/Boss/scavengerbossv4.lua @@ -1,5 +1,5 @@ local playerCountScale = 1 -if Spring.Utilities.Gametype.IsScavengers() then +if Utilities.Gametype.IsScavengers() then playerCountScale = math.min(1, (#Spring.GetTeamList() - 2) / 8) -- -2 because scavs and gaia shouldn't count, divided by 8 because we use 8 player games as a baseline end diff --git a/units/other/raptors/Queens/raptor_queen_easy.lua b/units/other/raptors/Queens/raptor_queen_easy.lua index f5cf04061ce..fe10bf3fa56 100644 --- a/units/other/raptors/Queens/raptor_queen_easy.lua +++ b/units/other/raptors/Queens/raptor_queen_easy.lua @@ -1,5 +1,5 @@ local playerCountScale = 1 -if Spring.Utilities.Gametype.IsRaptors() then +if Utilities.Gametype.IsRaptors() then playerCountScale = (#Spring.GetTeamList() - 2)/8 -- -2 because scavs and gaia shouldn't count, divided by 8 because we use 8 player games as a baseline end diff --git a/units/other/raptors/Queens/raptor_queen_epic.lua b/units/other/raptors/Queens/raptor_queen_epic.lua index 9872bd0abbe..63d8a0f27eb 100644 --- a/units/other/raptors/Queens/raptor_queen_epic.lua +++ b/units/other/raptors/Queens/raptor_queen_epic.lua @@ -1,5 +1,5 @@ local playerCountScale = 1 -if Spring.Utilities.Gametype.IsRaptors() then +if Utilities.Gametype.IsRaptors() then playerCountScale = (#Spring.GetTeamList() - 2)/8 -- -2 because scavs and gaia shouldn't count, divided by 8 because we use 8 player games as a baseline end diff --git a/units/other/raptors/Queens/raptor_queen_hard.lua b/units/other/raptors/Queens/raptor_queen_hard.lua index 088d6a89718..cd0e82b52ba 100644 --- a/units/other/raptors/Queens/raptor_queen_hard.lua +++ b/units/other/raptors/Queens/raptor_queen_hard.lua @@ -1,5 +1,5 @@ local playerCountScale = 1 -if Spring.Utilities.Gametype.IsRaptors() then +if Utilities.Gametype.IsRaptors() then playerCountScale = (#Spring.GetTeamList() - 2)/8 -- -2 because scavs and gaia shouldn't count, divided by 8 because we use 8 player games as a baseline end diff --git a/units/other/raptors/Queens/raptor_queen_normal.lua b/units/other/raptors/Queens/raptor_queen_normal.lua index a9295746c78..d331198da26 100644 --- a/units/other/raptors/Queens/raptor_queen_normal.lua +++ b/units/other/raptors/Queens/raptor_queen_normal.lua @@ -1,5 +1,5 @@ local playerCountScale = 1 -if Spring.Utilities.Gametype.IsRaptors() then +if Utilities.Gametype.IsRaptors() then playerCountScale = (#Spring.GetTeamList() - 2)/8 -- -2 because scavs and gaia shouldn't count, divided by 8 because we use 8 player games as a baseline end diff --git a/units/other/raptors/Queens/raptor_queen_veryeasy.lua b/units/other/raptors/Queens/raptor_queen_veryeasy.lua index 686bfe91197..9baa8d05f3d 100644 --- a/units/other/raptors/Queens/raptor_queen_veryeasy.lua +++ b/units/other/raptors/Queens/raptor_queen_veryeasy.lua @@ -1,5 +1,5 @@ local playerCountScale = 1 -if Spring.Utilities.Gametype.IsRaptors() then +if Utilities.Gametype.IsRaptors() then playerCountScale = (#Spring.GetTeamList() - 2)/8 -- -2 because scavs and gaia shouldn't count, divided by 8 because we use 8 player games as a baseline end diff --git a/units/other/raptors/Queens/raptor_queen_veryhard.lua b/units/other/raptors/Queens/raptor_queen_veryhard.lua index 98f29b66751..a2cf4e83ad0 100644 --- a/units/other/raptors/Queens/raptor_queen_veryhard.lua +++ b/units/other/raptors/Queens/raptor_queen_veryhard.lua @@ -1,5 +1,5 @@ local playerCountScale = 1 -if Spring.Utilities.Gametype.IsRaptors() then +if Utilities.Gametype.IsRaptors() then playerCountScale = (#Spring.GetTeamList() - 2)/8 -- -2 because scavs and gaia shouldn't count, divided by 8 because we use 8 player games as a baseline end