From a375b591a7fdf2c76d113414b2b940df5c374442 Mon Sep 17 00:00:00 2001 From: Daniel Harvey Date: Tue, 7 Jul 2026 01:31:41 -0600 Subject: [PATCH] gen(bar_codemod): rename-aliases --- luarules/gadgets/api_build_blocking.lua | 8 +-- luarules/gadgets/api_enemyunitdestroyed.lua | 4 +- luarules/gadgets/api_widget_events.lua | 10 +-- luarules/gadgets/camera_lockcamera.lua | 2 +- luarules/gadgets/cmd_dev_helpers.lua | 38 +++++------ .../gadgets/cmd_factory_stop_production.lua | 2 +- luarules/gadgets/cmd_get_player_data.lua | 2 +- luarules/gadgets/cmd_give.lua | 2 +- luarules/gadgets/cmd_idle_players.lua | 6 +- luarules/gadgets/cmd_luaui_reload.lua | 2 +- luarules/gadgets/cmd_mouse_pos_broadcast.lua | 2 +- luarules/gadgets/cmd_selected_units.lua | 2 +- luarules/gadgets/cmd_sendcommand.lua | 4 +- luarules/gadgets/cus_gl4.lua | 14 ++-- luarules/gadgets/dbg_benchmark.lua | 2 +- luarules/gadgets/dbg_gadget_profiler.lua | 2 +- luarules/gadgets/dbg_synctest.lua | 2 +- luarules/gadgets/dbg_unitposition_logger.lua | 4 +- .../gadgets/feature_eta_widget_forwarding.lua | 6 +- luarules/gadgets/game_autocolors.lua | 10 +-- luarules/gadgets/game_end.lua | 2 +- luarules/gadgets/game_logger.lua | 6 +- luarules/gadgets/game_message.lua | 4 +- luarules/gadgets/game_replace_afk_players.lua | 2 +- luarules/gadgets/game_selfd_resign.lua | 4 +- luarules/gadgets/gfx_beam_laser_gl4.lua | 2 +- .../gfx_energy_explosion_particles_gl4.lua | 2 +- .../gfx_environmental_lightning_gl4.lua | 2 +- luarules/gadgets/gfx_explosion_lights.lua | 8 +-- luarules/gadgets/gfx_flamethrower_gl4.lua | 2 +- luarules/gadgets/gfx_lightning_cannon_gl4.lua | 2 +- luarules/gadgets/gfx_missile_thruster_gl4.lua | 2 +- luarules/gadgets/gfx_nano_particles_gl4.lua | 4 +- luarules/gadgets/gfx_plasma_cannon_gl4.lua | 2 +- luarules/gadgets/gfx_reclaim_fx.lua | 2 +- luarules/gadgets/gfx_unit_glass.lua | 8 +-- luarules/gadgets/gfx_unit_script_decals.lua | 6 +- luarules/gadgets/gfx_unit_script_lights.lua | 6 +- luarules/gadgets/gfx_unit_shield_effects.lua | 2 +- .../graphics_territorial_domination.lua | 6 +- luarules/gadgets/gui_display_dps.lua | 4 +- luarules/gadgets/gui_soundeffects.lua | 12 ++-- luarules/gadgets/map_lava.lua | 2 +- luarules/gadgets/map_waterlevel.lua | 2 +- luarules/gadgets/sfx_notifications.lua | 12 ++-- .../gadgets/sfx_notifications_broadcaster.lua | 2 +- luarules/gadgets/system_info.lua | 2 +- luarules/gadgets/unit_crashing_aircraft.lua | 2 +- .../unit_healthbars_widget_forwarding.lua | 8 +-- luarules/gadgets/unit_objectify.lua | 4 +- luarules/gadgets/unit_seismic_ping.lua | 2 +- luarules/gadgets/unit_target_on_the_move.lua | 4 +- luaui/Include/select_api.lua | 4 +- luaui/Include/unitBlocking.lua | 2 +- .../gui_quick_start/gui_quick_start.lua | 2 +- .../gui_territorial_domination.lua | 8 +-- .../test_cmd_blueprint_filter.lua | 2 +- .../cmd_blueprint/test_cmd_blueprint_line.lua | 2 +- .../test_cmd_blueprint_single.lua | 2 +- .../cmd_stop_selfd/test_cmd_stop_selfd.lua | 2 +- luaui/Tests/selftests/test_callins.lua | 2 +- luaui/Widgets/api_analytics.lua | 2 +- luaui/Widgets/api_blueprint.lua | 2 +- luaui/Widgets/api_builder_queue.lua | 2 +- luaui/Widgets/api_los_combiner_gl4.lua | 4 +- luaui/Widgets/api_resource_spot_builder.lua | 2 +- luaui/Widgets/api_shared_state.lua | 6 +- luaui/Widgets/api_unit_tracker_gl4.lua | 18 ++--- luaui/Widgets/camera_lockcamera.lua | 2 +- luaui/Widgets/camera_player_tv.lua | 2 +- luaui/Widgets/camera_startup.lua | 2 +- luaui/Widgets/cmd_area_commands_filter.lua | 2 +- luaui/Widgets/cmd_comselect.lua | 2 +- luaui/Widgets/cmd_context_build.lua | 2 +- luaui/Widgets/cmd_fac_holdposition.lua | 2 +- luaui/Widgets/cmd_holdfire_fix.lua | 2 +- .../cmd_nanoturrets_assist_priority.lua | 2 +- luaui/Widgets/cmd_no_duplicate_orders.lua | 2 +- luaui/Widgets/cmd_share_unit.lua | 2 +- luaui/Widgets/cmd_skip_allied_upgrade.lua | 2 +- luaui/Widgets/cmd_stop_selfd.lua | 2 +- luaui/Widgets/cmd_unit_mover.lua | 2 +- luaui/Widgets/dbg_ffa_startpoints_picker.lua | 4 +- luaui/Widgets/gfx_airjets_gl4.lua | 4 +- luaui/Widgets/gfx_glass.lua | 2 +- luaui/Widgets/gfx_los_view.lua | 4 +- luaui/Widgets/gfx_paralyze_effect.lua | 2 +- luaui/Widgets/gfx_showbuilderqueue.lua | 2 +- luaui/Widgets/gui_advplayerslist.lua | 6 +- luaui/Widgets/gui_advplayerslist_mascot.lua | 2 +- .../Widgets/gui_advplayerslist_unittotals.lua | 2 +- luaui/Widgets/gui_allySelectedUnits.lua | 6 +- luaui/Widgets/gui_ally_cursors.lua | 4 +- luaui/Widgets/gui_attack_aoe.lua | 2 +- luaui/Widgets/gui_attackrange_gl4.lua | 6 +- luaui/Widgets/gui_build_eta.lua | 6 +- luaui/Widgets/gui_buildbar.lua | 2 +- luaui/Widgets/gui_buildmenu.lua | 2 +- luaui/Widgets/gui_center_n_select.lua | 4 +- luaui/Widgets/gui_chat.lua | 10 +-- luaui/Widgets/gui_com_nametags.lua | 2 +- luaui/Widgets/gui_commanderhurt.lua | 2 +- luaui/Widgets/gui_commands_fx.lua | 2 +- luaui/Widgets/gui_converter_usage.lua | 2 +- luaui/Widgets/gui_defenserange_gl4.lua | 8 +-- luaui/Widgets/gui_ecostats.lua | 6 +- luaui/Widgets/gui_emp_decloak_range.lua | 2 +- luaui/Widgets/gui_enemy_spotter.lua | 4 +- luaui/Widgets/gui_factionpicker.lua | 2 +- luaui/Widgets/gui_flanking_icons.lua | 4 +- luaui/Widgets/gui_geothermalspots.lua | 4 +- luaui/Widgets/gui_gridmenu.lua | 4 +- .../gui_ground_ao_plates_features_gl4.lua | 4 +- luaui/Widgets/gui_healthbars_gl4.lua | 10 +-- luaui/Widgets/gui_idle_builders.lua | 4 +- luaui/Widgets/gui_info.lua | 4 +- luaui/Widgets/gui_infolos.lua | 4 +- luaui/Widgets/gui_los_view_gl4.lua | 2 +- luaui/Widgets/gui_mapmarks_fx.lua | 2 +- luaui/Widgets/gui_metalspots.lua | 6 +- luaui/Widgets/gui_options.lua | 4 +- luaui/Widgets/gui_pip.lua | 66 +++++++++---------- luaui/Widgets/gui_point_tracker.lua | 2 +- luaui/Widgets/gui_pregame_build.lua | 4 +- luaui/Widgets/gui_pregameui.lua | 4 +- luaui/Widgets/gui_pregameui_draft.lua | 6 +- luaui/Widgets/gui_projectile_target_aoe.lua | 4 +- luaui/Widgets/gui_savegame.lua | 2 +- luaui/Widgets/gui_sensor_ranges_jammer.lua | 4 +- luaui/Widgets/gui_sensor_ranges_los.lua | 4 +- luaui/Widgets/gui_sensor_ranges_radar.lua | 4 +- luaui/Widgets/gui_sensor_ranges_sonar.lua | 4 +- luaui/Widgets/gui_show_orders.lua | 2 +- luaui/Widgets/gui_spec_next_alive_player.lua | 4 +- luaui/Widgets/gui_spectate_selected.lua | 2 +- luaui/Widgets/gui_team_platter.lua | 2 +- luaui/Widgets/gui_top_bar.lua | 8 +-- luaui/Widgets/gui_unit_energy_icons.lua | 2 +- luaui/Widgets/gui_unit_firestate_icons.lua | 4 +- luaui/Widgets/gui_unit_idlebuilder_icons.lua | 2 +- luaui/Widgets/gui_unit_stats.lua | 4 +- luaui/Widgets/gui_unit_wait_icons.lua | 2 +- luaui/Widgets/gui_vote_interface.lua | 4 +- luaui/Widgets/logo_adjuster.lua | 2 +- luaui/Widgets/map_startbox.lua | 10 +-- luaui/Widgets/map_startpolygon_gl4.lua | 2 +- luaui/Widgets/snd_notifications.lua | 12 ++-- luaui/Widgets/unit_alt_set_target_type.lua | 2 +- luaui/Widgets/unit_area_reclaim_enemy.lua | 4 +- luaui/Widgets/unit_auto_cloak.lua | 2 +- luaui/Widgets/unit_auto_group.lua | 2 +- .../unit_auto_repair_idle_builders.lua | 2 +- luaui/Widgets/unit_autofirstbuildfacing.lua | 2 +- .../unit_bombers_default_hold_fire.lua | 2 +- luaui/Widgets/unit_builder_priority.lua | 2 +- luaui/Widgets/unit_clean_builder_queue.lua | 2 +- luaui/Widgets/unit_cloak_firestate.lua | 2 +- .../unit_debug_alt_set_target_type.lua | 2 +- .../Widgets/unit_default_spy_move_cloaked.lua | 2 +- luaui/Widgets/unit_dgun_stall_assist.lua | 2 +- luaui/Widgets/unit_factory_assist_fix.lua | 2 +- luaui/Widgets/unit_factory_quota.lua | 2 +- luaui/Widgets/unit_hold_position.lua | 2 +- luaui/Widgets/unit_idle_guard.lua | 2 +- luaui/Widgets/unit_immobile_builder.lua | 2 +- luaui/Widgets/unit_load_own_moving.lua | 2 +- luaui/Widgets/unit_loop_select.lua | 2 +- luaui/Widgets/unit_only_fighters_patrol.lua | 2 +- luaui/Widgets/unit_set_fighters_fly.lua | 2 +- luaui/Widgets/unit_share_tracker.lua | 4 +- luaui/Widgets/unit_smart_select.lua | 2 +- luaui/Widgets/unit_stateprefs.lua | 4 +- luaui/barwidgets.lua | 2 +- luaui/debug.lua | 8 +-- 174 files changed, 364 insertions(+), 364 deletions(-) diff --git a/luarules/gadgets/api_build_blocking.lua b/luarules/gadgets/api_build_blocking.lua index 1fa9ff23cab..99310a9b2b9 100644 --- a/luarules/gadgets/api_build_blocking.lua +++ b/luarules/gadgets/api_build_blocking.lua @@ -349,8 +349,8 @@ if gadgetHandler:IsSyncedCode() then -------------------------------------------------------------------------------- Unsynced Code -------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------- elseif not gadgetHandler:IsSyncedCode() then --elseif for readability - local myPlayerID = Spring.GetMyPlayerID() - local myTeamID = Spring.GetMyTeamID() + local myPlayerID = Spring.GetLocalPlayerID() + local myTeamID = Spring.GetLocalTeamID() local function HandleBuildBlocked(_, unitDefID, reasonsStr) if Script.LuaUI.UnitBlocked then @@ -367,8 +367,8 @@ elseif not gadgetHandler:IsSyncedCode() then --elseif for readability gadgetHandler:RemoveSyncAction("BuildBlocked_" .. myTeamID) end - myPlayerID = Spring.GetMyPlayerID() - myTeamID = Spring.GetMyTeamID() + myPlayerID = Spring.GetLocalPlayerID() + myTeamID = Spring.GetLocalTeamID() if myTeamID then gadgetHandler:AddSyncAction("BuildBlocked_" .. myTeamID, HandleBuildBlocked) diff --git a/luarules/gadgets/api_enemyunitdestroyed.lua b/luarules/gadgets/api_enemyunitdestroyed.lua index ebbe78d892e..380ce327272 100644 --- a/luarules/gadgets/api_enemyunitdestroyed.lua +++ b/luarules/gadgets/api_enemyunitdestroyed.lua @@ -14,11 +14,11 @@ end if not gadgetHandler:IsSyncedCode() then local spGetUnitAllyTeam = Spring.GetUnitAllyTeam - local myAllyTeamID = Spring.GetMyAllyTeamID() + local myAllyTeamID = Spring.GetLocalAllyTeamID() local spec, fullView = Spring.GetSpectatingState() function gadget:Initialize() - myAllyTeamID = Spring.GetMyAllyTeamID() + myAllyTeamID = Spring.GetLocalAllyTeamID() spec, fullView = Spring.GetSpectatingState() end diff --git a/luarules/gadgets/api_widget_events.lua b/luarules/gadgets/api_widget_events.lua index bb4971d3669..f2d8357e08d 100644 --- a/luarules/gadgets/api_widget_events.lua +++ b/luarules/gadgets/api_widget_events.lua @@ -17,21 +17,21 @@ function gadget:GetInfo() end local spAreTeamsAllied = Spring.AreTeamsAllied -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetMyAllyTeamID = Spring.GetLocalAllyTeamID local spGetSpectatingState = Spring.GetSpectatingState local spGetUnitLosState = Spring.GetUnitLosState local myAllyTeamID, myTeamID, spec, specFullView function gadget:Initialize() - myTeamID = Spring.GetMyTeamID() - myAllyTeamID = Spring.GetMyAllyTeamID() + myTeamID = Spring.GetLocalTeamID() + myAllyTeamID = Spring.GetLocalAllyTeamID() spec, specFullView = spGetSpectatingState() end function gadget:PlayerChanged() - myTeamID = Spring.GetMyTeamID() - myAllyTeamID = Spring.GetMyAllyTeamID() + myTeamID = Spring.GetLocalTeamID() + myAllyTeamID = Spring.GetLocalAllyTeamID() spec, specFullView = spGetSpectatingState() end diff --git a/luarules/gadgets/camera_lockcamera.lua b/luarules/gadgets/camera_lockcamera.lua index e1d49592c84..17acd2b36ed 100644 --- a/luarules/gadgets/camera_lockcamera.lua +++ b/luarules/gadgets/camera_lockcamera.lua @@ -45,7 +45,7 @@ else -- UNSYNCED local GetCameraState = Spring.GetCameraState local SetCameraState = Spring.SetCameraState local GetLastUpdateSeconds = Spring.GetLastUpdateSeconds - local GetMyAllyTeamID = Spring.GetMyAllyTeamID + local GetMyAllyTeamID = Spring.GetLocalAllyTeamID local GetSpectatingState = Spring.GetSpectatingState local GetPlayerInfo = Spring.GetPlayerInfo local SendLuaRulesMsg = Spring.SendLuaRulesMsg diff --git a/luarules/gadgets/cmd_dev_helpers.lua b/luarules/gadgets/cmd_dev_helpers.lua index 2bc15cc1f82..a70e4a26eee 100644 --- a/luarules/gadgets/cmd_dev_helpers.lua +++ b/luarules/gadgets/cmd_dev_helpers.lua @@ -843,7 +843,7 @@ else -- UNSYNCED end function removeUnitDef(_, line, words, playerID) - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end if not isAuthorized(playerID, "units") then @@ -859,7 +859,7 @@ else -- UNSYNCED end function clearWrecks(_, line, words, playerID) - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end if not isAuthorized(playerID, "terrain") then @@ -869,7 +869,7 @@ else -- UNSYNCED end function reduceWrecks(_, line, words, playerID) - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end if not isAuthorized(playerID, "terrain") then @@ -879,7 +879,7 @@ else -- UNSYNCED end function processUnits(_, line, words, playerID, action) - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end if not isAuthorized(playerID, "units") then @@ -915,7 +915,7 @@ else -- UNSYNCED end function dumpFeatures(_, line, words, playerID) - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end if not isAuthorized(playerID, "units") then @@ -938,7 +938,7 @@ else -- UNSYNCED end function dumpUnits(_, line, words, playerID) - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end if not isAuthorized(playerID, "units") then @@ -959,7 +959,7 @@ else -- UNSYNCED --- Dumps all units and features in the loadout.lua format used by UnitLoadout / FeatureLoadout in missions. --- Usage: /luarules dumploadout function dumpLoadout(_, line, words, playerID) - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end if not isAuthorized(playerID, "units") then @@ -1128,7 +1128,7 @@ else -- UNSYNCED end function fightertest(_, line, words, playerID, action) - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end Spring.Echo("Fightertest", line, words, playerID, action) @@ -1244,7 +1244,7 @@ else -- UNSYNCED end function globallos(_, line, words, playerID, action) - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end if not isAuthorized(playerID, "terrain") then @@ -1258,7 +1258,7 @@ else -- UNSYNCED end function playertoteam(_, line, words, playerID, action) - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end if not isAuthorized(playerID, "teams") then @@ -1278,7 +1278,7 @@ else -- UNSYNCED end if not words[2] then words[2] = words[1] - words[1] = Spring.GetMyPlayerID() + words[1] = Spring.GetLocalPlayerID() end if tonumber(words[2]) < (#Spring.GetTeamList()) - 1 then Spring.SendLuaRulesMsg(PACKET_HEADER .. ":playertoteam:" .. words[1] .. ":" .. words[2]) @@ -1286,7 +1286,7 @@ else -- UNSYNCED end function killteam(_, line, words, playerID, action) - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end if not isAuthorized(playerID, "teams") then @@ -1299,7 +1299,7 @@ else -- UNSYNCED end function desync(_, line, words, playerID) - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end if not isAuthorized(playerID, "test") then @@ -1313,7 +1313,7 @@ else -- UNSYNCED --spawnceg usage: --/luarules spawnceg newnuke --spawns at cursor --/luarules spawnceg newnuke [int] -- spawns at cursor at height - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end if not isAuthorized(playerID, "units") then @@ -1339,7 +1339,7 @@ else -- UNSYNCED function modmarker(_, line, words, playerID) -- /luarules modmarker -- places broadcast marker at cursor with no label -- /luarules modmarker My text -- places broadcast marker at cursor with label - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end if not isAuthorized(playerID, "modmarker") then @@ -1358,7 +1358,7 @@ else -- UNSYNCED function spawnunitexplosion(_, line, words, playerID) --/luarules spawnunitexplosion armbull --spawns at cursor - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end if not isAuthorized(playerID, "units") then @@ -1375,7 +1375,7 @@ else -- UNSYNCED end function GiveCat(_, line, words, playerID) - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end if not isAuthorized(playerID, "units") then @@ -1407,7 +1407,7 @@ else -- UNSYNCED if #result == 0 then return end - local _, _, _, teamID = Spring.GetPlayerInfo(Spring.GetMyPlayerID(), false) + local _, _, _, teamID = Spring.GetPlayerInfo(Spring.GetLocalPlayerID(), false) if words[2] and tonumber(words[2]) then teamID = tonumber(words[2]) end @@ -1585,7 +1585,7 @@ else -- UNSYNCED end -- team - local _, _, _, teamID = Spring.GetPlayerInfo(Spring.GetMyPlayerID(), false) + local _, _, _, teamID = Spring.GetPlayerInfo(Spring.GetLocalPlayerID(), false) if string.match(line, " ([0-9].*)") then teamID = string.match(line, " ([0-9].*)") end diff --git a/luarules/gadgets/cmd_factory_stop_production.lua b/luarules/gadgets/cmd_factory_stop_production.lua index f9ecaa53579..ac41570f761 100644 --- a/luarules/gadgets/cmd_factory_stop_production.lua +++ b/luarules/gadgets/cmd_factory_stop_production.lua @@ -133,7 +133,7 @@ else end function gadget:PlayerChanged() - myTeamID = Spring.GetMyTeamID() + myTeamID = Spring.GetLocalTeamID() isSpec = Spring.GetSpectatingState() end diff --git a/luarules/gadgets/cmd_get_player_data.lua b/luarules/gadgets/cmd_get_player_data.lua index a03b685c53d..4eb52e89d4f 100644 --- a/luarules/gadgets/cmd_get_player_data.lua +++ b/luarules/gadgets/cmd_get_player_data.lua @@ -86,7 +86,7 @@ else local fontfileOutlineSize = 9 local fontfileOutlineStrength = 1.7 - local myPlayerID = Spring.GetMyPlayerID() + local myPlayerID = Spring.GetLocalPlayerID() local myPlayerName = Spring.GetPlayerInfo(myPlayerID) local function isAuthorized() local acID = Spring.Utilities.GetAccountID(myPlayerID) diff --git a/luarules/gadgets/cmd_give.lua b/luarules/gadgets/cmd_give.lua index a52725ea369..5e2f97980fe 100644 --- a/luarules/gadgets/cmd_give.lua +++ b/luarules/gadgets/cmd_give.lua @@ -117,7 +117,7 @@ if gadgetHandler:IsSyncedCode() then return true end else -- UNSYNCED - local myPlayerID = Spring.GetMyPlayerID() + local myPlayerID = Spring.GetLocalPlayerID() local myPlayerName = Spring.GetPlayerInfo(myPlayerID) local function isAuthorized() local acID = Spring.Utilities.GetAccountID(myPlayerID) diff --git a/luarules/gadgets/cmd_idle_players.lua b/luarules/gadgets/cmd_idle_players.lua index e173eb75e29..06e45412c13 100644 --- a/luarules/gadgets/cmd_idle_players.lua +++ b/luarules/gadgets/cmd_idle_players.lua @@ -261,8 +261,8 @@ else -- UNSYNCED local mx, my = GetMouseState() local validation = SYNCED.validationIdle local warningGiven = false - local myTeamID = Spring.GetMyTeamID() - local myAllyTeamID = Spring.GetMyAllyTeamID() + local myTeamID = Spring.GetLocalTeamID() + local myAllyTeamID = Spring.GetLocalAllyTeamID() local gaiaTeamID = Spring.GetGaiaTeamID() local isBuilder = {} @@ -367,7 +367,7 @@ else -- UNSYNCED updateTimer = 0 if checkQueueTime and GetGameSeconds() > checkQueueTime then - local teamID = Spring.GetMyTeamID() + local teamID = Spring.GetLocalTeamID() local myUnits = Spring.GetTeamUnits(teamID) local queueTime = 0 for i = 1, #myUnits do diff --git a/luarules/gadgets/cmd_luaui_reload.lua b/luarules/gadgets/cmd_luaui_reload.lua index 68a557a68fd..4d4c33af3fd 100644 --- a/luarules/gadgets/cmd_luaui_reload.lua +++ b/luarules/gadgets/cmd_luaui_reload.lua @@ -17,7 +17,7 @@ if gadgetHandler:IsSyncedCode() then end function LuaUIReload(cmd, line, words, playerID) - if playerID and playerID == Spring.GetMyPlayerID() then + if playerID and playerID == Spring.GetLocalPlayerID() then Spring.SendCommands("luaui reload") end end diff --git a/luarules/gadgets/cmd_mouse_pos_broadcast.lua b/luarules/gadgets/cmd_mouse_pos_broadcast.lua index f40ebdc5197..86828fd548a 100644 --- a/luarules/gadgets/cmd_mouse_pos_broadcast.lua +++ b/luarules/gadgets/cmd_mouse_pos_broadcast.lua @@ -83,7 +83,7 @@ else local validation = SYNCED.validationMouse local msgPrefix = "£" .. validation - local myPlayerID = Spring.GetMyPlayerID() + local myPlayerID = Spring.GetLocalPlayerID() local spec, _ = GetSpectatingState() local myAllyTeamID = select(5, GetPlayerInfo(myPlayerID, false)) diff --git a/luarules/gadgets/cmd_selected_units.lua b/luarules/gadgets/cmd_selected_units.lua index 99e06364be5..8018971b768 100644 --- a/luarules/gadgets/cmd_selected_units.lua +++ b/luarules/gadgets/cmd_selected_units.lua @@ -61,7 +61,7 @@ else local LuaUICallIn = Script.LuaUI local LuaUI = Script.LuaUI - local myPlayerID = Spring.GetMyPlayerID() + local myPlayerID = Spring.GetLocalPlayerID() local myAllyTeamID = select(5, GetPlayerInfo(myPlayerID, false)) local PACK_FFFF = PackU16(0xffff) local CLEAR_ALL_MSG = PACK_FFFF .. PACK_FFFF diff --git a/luarules/gadgets/cmd_sendcommand.lua b/luarules/gadgets/cmd_sendcommand.lua index 0168819e126..fe02d8701a2 100644 --- a/luarules/gadgets/cmd_sendcommand.lua +++ b/luarules/gadgets/cmd_sendcommand.lua @@ -61,7 +61,7 @@ if gadgetHandler:IsSyncedCode() then return true end else -- UNSYNCED - local myPlayerID = Spring.GetMyPlayerID() + local myPlayerID = Spring.GetLocalPlayerID() local myPlayerName = Spring.GetPlayerInfo(myPlayerID) local function isAuthorized() local acID = Spring.Utilities.GetAccountID(myPlayerID) @@ -70,7 +70,7 @@ else -- UNSYNCED end local function execCmd(_, playername, cmd) - if playername == select(1, Spring.GetPlayerInfo(Spring.GetMyPlayerID())) or playername == "*" then + if playername == select(1, Spring.GetPlayerInfo(Spring.GetLocalPlayerID())) or playername == "*" then Spring.SendCommands(cmd) end end diff --git a/luarules/gadgets/cus_gl4.lua b/luarules/gadgets/cus_gl4.lua index 212092f3ba5..e55119b965f 100644 --- a/luarules/gadgets/cus_gl4.lua +++ b/luarules/gadgets/cus_gl4.lua @@ -1889,7 +1889,7 @@ local function ReloadCUSGL4(optName, line, words, playerID) return end manualReload = true - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end Spring.Echo("[CustomUnitShadersGL4] Reloading") @@ -1899,7 +1899,7 @@ local function ReloadCUSGL4(optName, line, words, playerID) end local function DisableCUSGL4(optName, _, _, playerID) - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end Spring.Echo("[CustomUnitShadersGL4] Disabling") @@ -1910,7 +1910,7 @@ function gadget:GameFrame(n) if not itsXmas and SYNCED.itsXmas then itsXmas = true initiated = false - ReloadCUSGL4(nil, nil, nil, Spring.GetMyPlayerID()) + ReloadCUSGL4(nil, nil, nil, Spring.GetLocalPlayerID()) end for unitID, buildProgress in pairs(buildProgresses) do local health, maxHealth, paralyzeDamage, capture, build = spGetUnitHealth(unitID) @@ -1928,7 +1928,7 @@ end local updaterate = 1 local function CUSGL4updaterate(optName, line, words, playerID) - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end if updaterate == 1 then @@ -1940,7 +1940,7 @@ local function CUSGL4updaterate(optName, line, words, playerID) end local function DebugCUSGL4(optName, line, words, playerID) - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end debugmode = not debugmode @@ -1948,7 +1948,7 @@ local function DebugCUSGL4(optName, line, words, playerID) end local function DumpCUSGL4(optName, line, words, playerID) - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end Spring.Echo("[CustomUnitShadersGL4] Dumping unit bins:", debugmode) @@ -1998,7 +1998,7 @@ local function DumpCUSGL4(optName, line, words, playerID) end local function MarkBinCUSGL4(optName, line, words, playerID) - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end Spring.Echo("[CustomUnitShadersGL4] Marking Bins", optName, line, words, playerID) diff --git a/luarules/gadgets/dbg_benchmark.lua b/luarules/gadgets/dbg_benchmark.lua index 62357b84a4e..78c911ce75b 100644 --- a/luarules/gadgets/dbg_benchmark.lua +++ b/luarules/gadgets/dbg_benchmark.lua @@ -499,7 +499,7 @@ else -- UNSYNCED end function benchmark(_, line, words, playerID, action) - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end Spring.Echo("Benchmark", line, words, playerID, action) diff --git a/luarules/gadgets/dbg_gadget_profiler.lua b/luarules/gadgets/dbg_gadget_profiler.lua index 6a10260d2aa..e4fb7b9d1f6 100644 --- a/luarules/gadgets/dbg_gadget_profiler.lua +++ b/luarules/gadgets/dbg_gadget_profiler.lua @@ -429,7 +429,7 @@ else local function Start(optName, line, words, pID, _) if running then Kill(nil, nil, nil, pID, nil) - elseif pID == Spring.GetMyPlayerID() then + elseif pID == Spring.GetLocalPlayerID() then running = true tick = (words and words[1] and tonumber(words[1])) or tick diff --git a/luarules/gadgets/dbg_synctest.lua b/luarules/gadgets/dbg_synctest.lua index 8269395fbbe..eb55f602ff0 100644 --- a/luarules/gadgets/dbg_synctest.lua +++ b/luarules/gadgets/dbg_synctest.lua @@ -570,7 +570,7 @@ else -- UNSYNCED -------------------------------------------------------------------- local function synctest(_, line, words, playerID, action) - if playerID ~= Spring.GetMyPlayerID() then + if playerID ~= Spring.GetLocalPlayerID() then return end Spring.Echo("[synctest]", line, playerID, action) diff --git a/luarules/gadgets/dbg_unitposition_logger.lua b/luarules/gadgets/dbg_unitposition_logger.lua index 3af7f53b475..d4f2644b7e9 100644 --- a/luarules/gadgets/dbg_unitposition_logger.lua +++ b/luarules/gadgets/dbg_unitposition_logger.lua @@ -27,7 +27,7 @@ if not gadgetHandler:IsSyncedCode() then return end - local DEBUG = select(1, Spring.GetPlayerInfo(Spring.GetMyPlayerID())) == "[teh]Flow" + local DEBUG = select(1, Spring.GetPlayerInfo(Spring.GetLocalPlayerID())) == "[teh]Flow" local gameFramesPerSecond = 30 -- engine constant local pingCutoff = 1500 -- players with higher ping wont participate in sending unit positions log @@ -51,7 +51,7 @@ if not gadgetHandler:IsSyncedCode() then local math_floor = math.floor local math_ceil = math.ceil - local myPlayerID = Spring.GetMyPlayerID() + local myPlayerID = Spring.GetLocalPlayerID() local isSinglePlayer = Spring.Utilities.Gametype.IsSinglePlayer() local logRate = minLogRate diff --git a/luarules/gadgets/feature_eta_widget_forwarding.lua b/luarules/gadgets/feature_eta_widget_forwarding.lua index b752feebc8a..14da2826b36 100644 --- a/luarules/gadgets/feature_eta_widget_forwarding.lua +++ b/luarules/gadgets/feature_eta_widget_forwarding.lua @@ -83,8 +83,8 @@ if gadgetHandler:IsSyncedCode() then end end else - local myPlayerID = Spring.GetMyPlayerID() - local myAllyTeamID = Spring.GetMyAllyTeamID() + local myPlayerID = Spring.GetLocalPlayerID() + local myAllyTeamID = Spring.GetLocalAllyTeamID() local _, fullview = Spring.GetSpectatingState() --Map of allyTeamID to set of featureIDs. Used to resend ETAs when player changes ally team @@ -92,7 +92,7 @@ else function gadget:PlayerChanged(playerID) if playerID == myPlayerID then - myAllyTeamID = Spring.GetMyAllyTeamID() + myAllyTeamID = Spring.GetLocalAllyTeamID() _, fullview = Spring.GetSpectatingState() --Resend feature ETAs when team changes so that we can see active ETAs of new team and stop seeing ETAs of old team diff --git a/luarules/gadgets/game_autocolors.lua b/luarules/gadgets/game_autocolors.lua index 3755feea89a..8a9f2c802a9 100644 --- a/luarules/gadgets/game_autocolors.lua +++ b/luarules/gadgets/game_autocolors.lua @@ -26,8 +26,8 @@ local teamSizes = {} local myAllyTeamID, myTeamID if not gadgetHandler:IsSyncedCode() then - myAllyTeamID = Spring.GetMyAllyTeamID() - myTeamID = Spring.GetMyTeamID() + myAllyTeamID = Spring.GetLocalAllyTeamID() + myTeamID = Spring.GetLocalTeamID() end -- Special colors @@ -685,7 +685,7 @@ else -- UNSYNCED local function updateTeamColors() if isDiscoEnabled() then - discoShuffle(Spring.GetMyTeamID()) + discoShuffle(Spring.GetLocalTeamID()) end for teamID, color in pairs(teamColorsTable) do Spring.SetTeamColor(teamID, color.r / 255, color.g / 255, color.b / 255) @@ -716,9 +716,9 @@ else -- UNSYNCED if playerID ~= myPlayerID then return end - myAllyTeamID = Spring.GetMyAllyTeamID() + myAllyTeamID = Spring.GetLocalAllyTeamID() local prevMyTeamID = myTeamID - myTeamID = Spring.GetMyTeamID() + myTeamID = Spring.GetLocalTeamID() if mySpecState and prevMyTeamID ~= myTeamID and Spring.GetConfigInt("SimpleTeamColors", 0) == 1 then Spring.SetConfigInt("UpdateTeamColors", 1) end diff --git a/luarules/gadgets/game_end.lua b/luarules/gadgets/game_end.lua index 37c3078b962..af58d3e8c93 100644 --- a/luarules/gadgets/game_end.lua +++ b/luarules/gadgets/game_end.lua @@ -544,7 +544,7 @@ else -- Unsynced if Spring.IsReplay() then return end - local myTeamID = Spring.GetMyAllyTeamID() + local myTeamID = Spring.GetLocalAllyTeamID() local cur_max = Spring.GetTeamStatsHistory(myTeamID) local stats = Spring.GetTeamStatsHistory(myTeamID, cur_max, cur_max) stats = stats[1] diff --git a/luarules/gadgets/game_logger.lua b/luarules/gadgets/game_logger.lua index e4f3eb2e07b..79d36127f52 100644 --- a/luarules/gadgets/game_logger.lua +++ b/luarules/gadgets/game_logger.lua @@ -48,13 +48,13 @@ else end end - local myTeamID = Spring.GetMyTeamID() - local myPlayerID = Spring.GetMyPlayerID() + local myTeamID = Spring.GetLocalTeamID() + local myPlayerID = Spring.GetLocalPlayerID() local mySpec, fullview = Spring.GetSpectatingState() function gadget:PlayerChanged(playerID) if playerID == myPlayerID then - myTeamID = Spring.GetMyTeamID() + myTeamID = Spring.GetLocalTeamID() mySpec, fullview = Spring.GetSpectatingState() end end diff --git a/luarules/gadgets/game_message.lua b/luarules/gadgets/game_message.lua index 3f38d098098..e116b506e79 100644 --- a/luarules/gadgets/game_message.lua +++ b/luarules/gadgets/game_message.lua @@ -30,8 +30,8 @@ else -- UNSYNCED local function sendMsg(_, playerID, msg) local name, _, spec, _, playerAllyTeamID = Spring.GetPlayerInfo(playerID, false) local mySpec = Spring.GetSpectatingState() - if not spec and (playerAllyTeamID == Spring.GetMyAllyTeamID() or mySpec) then - Spring.SendMessageToPlayer(Spring.GetMyPlayerID(), "<" .. name .. "> Allies: > " .. msg) + if not spec and (playerAllyTeamID == Spring.GetLocalAllyTeamID() or mySpec) then + Spring.SendMessageToPlayer(Spring.GetLocalPlayerID(), "<" .. name .. "> Allies: > " .. msg) end end diff --git a/luarules/gadgets/game_replace_afk_players.lua b/luarules/gadgets/game_replace_afk_players.lua index e9d06d02411..274c725cb11 100644 --- a/luarules/gadgets/game_replace_afk_players.lua +++ b/luarules/gadgets/game_replace_afk_players.lua @@ -241,7 +241,7 @@ else -- UNSYNCED ----------------------------- - local myPlayerID = Spring.GetMyPlayerID() + local myPlayerID = Spring.GetLocalPlayerID() local spec, _ = Spring.GetSpectatingState() local isReplay = Spring.IsReplay() local ColorString = Spring.Utilities.Color.ToString diff --git a/luarules/gadgets/game_selfd_resign.lua b/luarules/gadgets/game_selfd_resign.lua index 54ed48cc2b5..0727866e254 100644 --- a/luarules/gadgets/game_selfd_resign.lua +++ b/luarules/gadgets/game_selfd_resign.lua @@ -147,8 +147,8 @@ if gadgetHandler:IsSyncedCode() then return true end else -- UNSYNCED - local myPlayerID = Spring.GetMyPlayerID() - local myTeamID = Spring.GetMyTeamID() + local myPlayerID = Spring.GetLocalPlayerID() + local myTeamID = Spring.GetLocalTeamID() local function showForceResignNotification(playerID, messageKey) if playerID ~= myPlayerID or Spring.GetSpectatingState() then diff --git a/luarules/gadgets/gfx_beam_laser_gl4.lua b/luarules/gadgets/gfx_beam_laser_gl4.lua index 89cc96a81cf..00347a5cd40 100644 --- a/luarules/gadgets/gfx_beam_laser_gl4.lua +++ b/luarules/gadgets/gfx_beam_laser_gl4.lua @@ -32,7 +32,7 @@ local spGetProjectileTeamID = Spring.GetProjectileTeamID local spGetTeamAllyTeamID = Spring.GetTeamAllyTeamID local spIsPosInLos = Spring.IsPosInLos local spIsPosInAirLos = Spring.IsPosInAirLos -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetMyAllyTeamID = Spring.GetLocalAllyTeamID local spGetSpectatingState = Spring.GetSpectatingState local spGetGameFrame = Spring.GetGameFrame local spGetFrameTimeOffset = Spring.GetFrameTimeOffset diff --git a/luarules/gadgets/gfx_energy_explosion_particles_gl4.lua b/luarules/gadgets/gfx_energy_explosion_particles_gl4.lua index ffebffd2c53..f6d5b7d4276 100644 --- a/luarules/gadgets/gfx_energy_explosion_particles_gl4.lua +++ b/luarules/gadgets/gfx_energy_explosion_particles_gl4.lua @@ -195,7 +195,7 @@ local CONFIG = { local spEcho = Spring.Echo local spGetUnitPosition = Spring.GetUnitPosition local spGetUnitRadius = Spring.GetUnitRadius -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetMyAllyTeamID = Spring.GetLocalAllyTeamID local spGetSpectatingState = Spring.GetSpectatingState local spIsPosInLos = Spring.IsPosInLos local spIsSphereInView = Spring.IsSphereInView diff --git a/luarules/gadgets/gfx_environmental_lightning_gl4.lua b/luarules/gadgets/gfx_environmental_lightning_gl4.lua index 1dd0456a6d9..229bf224c2b 100644 --- a/luarules/gadgets/gfx_environmental_lightning_gl4.lua +++ b/luarules/gadgets/gfx_environmental_lightning_gl4.lua @@ -389,7 +389,7 @@ local spGetGameFrame = Spring.GetGameFrame local spIsAABBInView = Spring.IsAABBInView local spGetCameraPosition = Spring.GetCameraPosition local spIsPosInLos = Spring.IsPosInLos -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetMyAllyTeamID = Spring.GetLocalAllyTeamID local spGetSpectatingState = Spring.GetSpectatingState local glBlending = gl.Blending diff --git a/luarules/gadgets/gfx_explosion_lights.lua b/luarules/gadgets/gfx_explosion_lights.lua index 28e2dff71be..7792ffaca0e 100644 --- a/luarules/gadgets/gfx_explosion_lights.lua +++ b/luarules/gadgets/gfx_explosion_lights.lua @@ -70,16 +70,16 @@ if gadgetHandler:IsSyncedCode() then end end else -- Unsynced - local myPlayerID = Spring.GetMyPlayerID() - local myAllyID = Spring.GetMyAllyTeamID() + local myPlayerID = Spring.GetLocalPlayerID() + local myAllyID = Spring.GetLocalAllyTeamID() local fullView = select(2, Spring.GetSpectatingState()) local spGetUnitAllyTeam = Spring.GetUnitAllyTeam local spIsPosInLos = Spring.IsPosInLos function gadget:PlayerChanged(playerID) if playerID == myPlayerID then - myPlayerID = Spring.GetMyPlayerID() - myAllyID = Spring.GetMyAllyTeamID() + myPlayerID = Spring.GetLocalPlayerID() + myAllyID = Spring.GetLocalAllyTeamID() fullView = select(2, Spring.GetSpectatingState()) end end diff --git a/luarules/gadgets/gfx_flamethrower_gl4.lua b/luarules/gadgets/gfx_flamethrower_gl4.lua index 3fbed0f1b16..87728eb3737 100644 --- a/luarules/gadgets/gfx_flamethrower_gl4.lua +++ b/luarules/gadgets/gfx_flamethrower_gl4.lua @@ -51,7 +51,7 @@ local spGetProjectileOwnerID = Spring.GetProjectileOwnerID local spGetUnitDefID = Spring.GetUnitDefID local spGetUnitPosition = Spring.GetUnitPosition local spGetTeamAllyTeamID = Spring.GetTeamAllyTeamID -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetMyAllyTeamID = Spring.GetLocalAllyTeamID local spGetSpectatingState = Spring.GetSpectatingState local spIsPosInLos = Spring.IsPosInLos local spIsSphereInView = Spring.IsSphereInView diff --git a/luarules/gadgets/gfx_lightning_cannon_gl4.lua b/luarules/gadgets/gfx_lightning_cannon_gl4.lua index 27d563d0b95..0d6f621873a 100644 --- a/luarules/gadgets/gfx_lightning_cannon_gl4.lua +++ b/luarules/gadgets/gfx_lightning_cannon_gl4.lua @@ -32,7 +32,7 @@ local spGetProjectileTeamID = Spring.GetProjectileTeamID local spGetTeamAllyTeamID = Spring.GetTeamAllyTeamID local spIsPosInLos = Spring.IsPosInLos local spIsPosInAirLos = Spring.IsPosInAirLos -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetMyAllyTeamID = Spring.GetLocalAllyTeamID local spGetSpectatingState = Spring.GetSpectatingState local spGetGameFrame = Spring.GetGameFrame local spGetGameSpeed = Spring.GetGameSpeed diff --git a/luarules/gadgets/gfx_missile_thruster_gl4.lua b/luarules/gadgets/gfx_missile_thruster_gl4.lua index 0f7fa2c7a24..3af5d4df5bd 100644 --- a/luarules/gadgets/gfx_missile_thruster_gl4.lua +++ b/luarules/gadgets/gfx_missile_thruster_gl4.lua @@ -32,7 +32,7 @@ local spGetProjectileTeamID = Spring.GetProjectileTeamID local spGetProjectileTimeToLive = Spring.GetProjectileTimeToLive local spGetTeamAllyTeamID = Spring.GetTeamAllyTeamID local spIsPosInAirLos = Spring.IsPosInAirLos -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetMyAllyTeamID = Spring.GetLocalAllyTeamID local spGetSpectatingState = Spring.GetSpectatingState local spGetFrameTimeOffset = Spring.GetFrameTimeOffset local spGetGameSpeed = Spring.GetGameSpeed diff --git a/luarules/gadgets/gfx_nano_particles_gl4.lua b/luarules/gadgets/gfx_nano_particles_gl4.lua index c014b042b79..ebcf43f310b 100644 --- a/luarules/gadgets/gfx_nano_particles_gl4.lua +++ b/luarules/gadgets/gfx_nano_particles_gl4.lua @@ -613,7 +613,7 @@ local trackedBuildersList = {} -- arrayIndex -> unitID local trackUnit -- Cached visibility state -local cachedAllyTeamID = Spring.GetMyAllyTeamID() +local cachedAllyTeamID = Spring.GetLocalAllyTeamID() local cachedSpecFullView = false -- Debug instrumentation: timers + per-30f Echo. Toggle to true to profile. @@ -631,7 +631,7 @@ local _dbgDraws = 0 local function refreshSpec() local spec, fullView = Spring.GetSpectatingState() cachedSpecFullView = spec and fullView - cachedAllyTeamID = Spring.GetMyAllyTeamID() + cachedAllyTeamID = Spring.GetLocalAllyTeamID() end -- High gamespeed throttle. When the engine runs faster than 1x (catchup after diff --git a/luarules/gadgets/gfx_plasma_cannon_gl4.lua b/luarules/gadgets/gfx_plasma_cannon_gl4.lua index b4bdbb581c6..3c72d14af5d 100644 --- a/luarules/gadgets/gfx_plasma_cannon_gl4.lua +++ b/luarules/gadgets/gfx_plasma_cannon_gl4.lua @@ -32,7 +32,7 @@ local spGetProjectileDefID = Spring.GetProjectileDefID local spGetProjectileTeamID = Spring.GetProjectileTeamID local spGetTeamAllyTeamID = Spring.GetTeamAllyTeamID local spIsPosInAirLos = Spring.IsPosInAirLos -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetMyAllyTeamID = Spring.GetLocalAllyTeamID local spGetSpectatingState = Spring.GetSpectatingState local spGetGameFrame = Spring.GetGameFrame local spGetFrameTimeOffset = Spring.GetFrameTimeOffset diff --git a/luarules/gadgets/gfx_reclaim_fx.lua b/luarules/gadgets/gfx_reclaim_fx.lua index 417414dbf67..2e8da12bdfe 100644 --- a/luarules/gadgets/gfx_reclaim_fx.lua +++ b/luarules/gadgets/gfx_reclaim_fx.lua @@ -147,7 +147,7 @@ if gadgetHandler:IsSyncedCode() then else -- UNSYNCED local function reclaimfx(_, fx, fy, fz) local mySpec, fullview = Spring.GetSpectatingState() - if fullview or Spring.IsPosInLos(fx, fy, fz, Spring.GetMyAllyTeamID()) then + if fullview or Spring.IsPosInLos(fx, fy, fz, Spring.GetLocalAllyTeamID()) then Spring.PlaySoundFile("reclaimate", 1, fx, fy, fz, "sfx") end end diff --git a/luarules/gadgets/gfx_unit_glass.lua b/luarules/gadgets/gfx_unit_glass.lua index ef1087d56e9..1cd624b8429 100644 --- a/luarules/gadgets/gfx_unit_glass.lua +++ b/luarules/gadgets/gfx_unit_glass.lua @@ -278,8 +278,8 @@ void main(void){ local glassShader local isSpec, fullview = Spring.GetSpectatingState() - local myAllyTeamID = Spring.GetMyAllyTeamID() - local myTeamID = Spring.GetMyTeamID() + local myAllyTeamID = Spring.GetLocalAllyTeamID() + local myTeamID = Spring.GetLocalTeamID() local unitTextureFilesArray = VFS.DirList("unittextures/") local unitTextureFiles = {} @@ -301,8 +301,8 @@ void main(void){ local prevFullview = fullview local prevMyAllyTeamID = myAllyTeamID isSpec, fullview = Spring.GetSpectatingState() - myAllyTeamID = Spring.GetMyAllyTeamID() - myTeamID = Spring.GetMyTeamID() + myAllyTeamID = Spring.GetLocalAllyTeamID() + myTeamID = Spring.GetLocalTeamID() if fullview ~= prevFullview or myAllyTeamID ~= prevMyAllyTeamID then UpdateAllGlassUnits() end diff --git a/luarules/gadgets/gfx_unit_script_decals.lua b/luarules/gadgets/gfx_unit_script_decals.lua index dd313955d31..9e85ef1b989 100644 --- a/luarules/gadgets/gfx_unit_script_decals.lua +++ b/luarules/gadgets/gfx_unit_script_decals.lua @@ -28,14 +28,14 @@ if gadgetHandler:IsSyncedCode() then gadgetHandler:DeregisterGlobal("UnitScriptDecal") end else -- UNSYNCED - local myAllyTeamID = Spring.GetMyAllyTeamID() - local myPlayerID = Spring.GetMyPlayerID() + local myAllyTeamID = Spring.GetLocalAllyTeamID() + local myPlayerID = Spring.GetLocalPlayerID() local mySpec, fullview = Spring.GetSpectatingState() local spIsUnitInLos = Spring.IsUnitInLos function gadget:PlayerChanged(playerID) if playerID == myPlayerID then - myAllyTeamID = Spring.GetMyAllyTeamID() + myAllyTeamID = Spring.GetLocalAllyTeamID() mySpec, fullview = Spring.GetSpectatingState() end end diff --git a/luarules/gadgets/gfx_unit_script_lights.lua b/luarules/gadgets/gfx_unit_script_lights.lua index c39edff8b85..32ca22203fe 100644 --- a/luarules/gadgets/gfx_unit_script_lights.lua +++ b/luarules/gadgets/gfx_unit_script_lights.lua @@ -35,14 +35,14 @@ if gadgetHandler:IsSyncedCode() then gadgetHandler:DeregisterGlobal("UnitScriptDistortion") end else -- UNSYNCED - local myAllyTeamID = Spring.GetMyAllyTeamID() - local myPlayerID = Spring.GetMyPlayerID() + local myAllyTeamID = Spring.GetLocalAllyTeamID() + local myPlayerID = Spring.GetLocalPlayerID() local mySpec, fullview = Spring.GetSpectatingState() local spIsUnitInLos = Spring.IsUnitInLos function gadget:PlayerChanged(playerID) if playerID == myPlayerID then - myAllyTeamID = Spring.GetMyAllyTeamID() + myAllyTeamID = Spring.GetLocalAllyTeamID() mySpec, fullview = Spring.GetSpectatingState() end end diff --git a/luarules/gadgets/gfx_unit_shield_effects.lua b/luarules/gadgets/gfx_unit_shield_effects.lua index bf45bd10624..e35f9be63a9 100644 --- a/luarules/gadgets/gfx_unit_shield_effects.lua +++ b/luarules/gadgets/gfx_unit_shield_effects.lua @@ -144,7 +144,7 @@ end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetMyAllyTeamID = Spring.GetLocalAllyTeamID local spGetSpectatingState = Spring.GetSpectatingState local spGetUnitPosition = Spring.GetUnitPosition local spIsSphereInView = Spring.IsSphereInView diff --git a/luarules/gadgets/graphics_territorial_domination.lua b/luarules/gadgets/graphics_territorial_domination.lua index c68a103cc4d..13836baa727 100644 --- a/luarules/gadgets/graphics_territorial_domination.lua +++ b/luarules/gadgets/graphics_territorial_domination.lua @@ -60,7 +60,7 @@ local notifyFrames = {} local currentFrame = 0 local lastMoveFrame = 0 -local myAllyID = Spring.GetMyAllyTeamID() +local myAllyID = Spring.GetLocalAllyTeamID() local gaiaAllyTeamID = select(6, Spring.GetTeamInfo(Spring.GetGaiaTeamID())) local allTeams = Spring.GetTeamList() local amSpectating = Spring.GetSpectatingState() @@ -462,7 +462,7 @@ function gadget:Initialize() end amSpectating = Spring.GetSpectatingState() - myAllyID = Spring.GetMyAllyTeamID() + myAllyID = Spring.GetLocalAllyTeamID() initializeAllyColors() cameraHeightUpdateNeeded = true @@ -507,7 +507,7 @@ end local function processSpectatorModeChange() local currentSpectating = Spring.GetSpectatingState() - local currentAllyID = Spring.GetMyAllyTeamID() + local currentAllyID = Spring.GetLocalAllyTeamID() if currentSpectating ~= amSpectating or (previousAllyID and currentAllyID ~= previousAllyID) then amSpectating = currentSpectating diff --git a/luarules/gadgets/gui_display_dps.lua b/luarules/gadgets/gui_display_dps.lua index 9b0c69cddf2..fd9feca6876 100644 --- a/luarules/gadgets/gui_display_dps.lua +++ b/luarules/gadgets/gui_display_dps.lua @@ -88,7 +88,7 @@ local heightList = {} local drawTextLists = {} local drawTextListsDeath = {} local drawTextListsEmp = {} -local myTeamID = Spring.GetMyTeamID() +local myTeamID = Spring.GetLocalTeamID() local _, fullview = Spring.GetSpectatingState() local chobbyInterface local ignoreDamageTypes = {} @@ -317,7 +317,7 @@ local function DrawUnitFunc(yshift, xshift, damage, textSize, alpha, paralyze) end function gadget:PlayerChanged(playerID) - myTeamID = Spring.GetMyTeamID() + myTeamID = Spring.GetLocalTeamID() _, fullview = Spring.GetSpectatingState() end diff --git a/luarules/gadgets/gui_soundeffects.lua b/luarules/gadgets/gui_soundeffects.lua index 1577c89f981..b7f2274ddd0 100644 --- a/luarules/gadgets/gui_soundeffects.lua +++ b/luarules/gadgets/gui_soundeffects.lua @@ -109,8 +109,8 @@ GUIUnitSoundEffects = newGUIUnitSoundEffects newGUIUnitSoundEffects = nil local CurrentGameFrame = Spring.GetGameFrame() -local myTeamID = Spring.GetMyTeamID() -local myAllyTeamID = Spring.GetMyAllyTeamID() +local myTeamID = Spring.GetLocalTeamID() +local myAllyTeamID = Spring.GetLocalAllyTeamID() local spectator, fullview = Spring.GetSpectatingState() local spGetUnitIsActive = Spring.GetUnitIsActive @@ -124,8 +124,8 @@ local spIsUnitSelected = Spring.IsUnitSelected local spGetSelectedUnitsCount = Spring.GetSelectedUnitsCount local spGetSelectedUnits = Spring.GetSelectedUnits local spGetMouseState = Spring.GetMouseState -local spGetMyPlayerID = Spring.GetMyPlayerID -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyPlayerID = Spring.GetLocalPlayerID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetGameFrame = Spring.GetGameFrame local spPlaySoundFile = Spring.PlaySoundFile @@ -263,8 +263,8 @@ function gadget:Update() slowTimer = slowTimer + dt if slowTimer > 0.5 then slowTimer = 0 - myTeamID = Spring.GetMyTeamID() - myAllyTeamID = Spring.GetMyAllyTeamID() + myTeamID = Spring.GetLocalTeamID() + myAllyTeamID = Spring.GetLocalAllyTeamID() spectator, fullview = Spring.GetSpectatingState() enabled = ((Spring.GetConfigInt("snd_unitsound", 1) or 1) ~= 0 and (Spring.GetConfigInt("snd_volmaster", 1) or 100) > 0 and ((Spring.GetConfigInt("snd_volui", 1) or 100) > 0 or (Spring.GetConfigInt("snd_volbattle", 1) or 100) > 0)) end diff --git a/luarules/gadgets/map_lava.lua b/luarules/gadgets/map_lava.lua index 8e01ee2f989..e655ba678fc 100644 --- a/luarules/gadgets/map_lava.lua +++ b/luarules/gadgets/map_lava.lua @@ -476,7 +476,7 @@ else -- UNSYCNED shaderConfig = unifiedShaderConfig, } - local myPlayerID = tostring(Spring.GetMyPlayerID()) + local myPlayerID = tostring(Spring.GetLocalPlayerID()) function gadget:GameFrame(f) if SYNCED.lavaLevel then lavatidelevel = math.sin(Spring.GetGameFrame() / tideperiod) * tideamplitude + SYNCED.lavaLevel diff --git a/luarules/gadgets/map_waterlevel.lua b/luarules/gadgets/map_waterlevel.lua index a1893839ec9..9b77d10866d 100644 --- a/luarules/gadgets/map_waterlevel.lua +++ b/luarules/gadgets/map_waterlevel.lua @@ -87,7 +87,7 @@ if gadgetHandler:IsSyncedCode() then Spring.Echo("Changed waterlevel: " .. waterlevel) end else -- UNSYNCED - local myPlayerID = Spring.GetMyPlayerID() + local myPlayerID = Spring.GetLocalPlayerID() local myPlayerName = Spring.GetPlayerInfo(myPlayerID) local function isAuthorized() local acID = Spring.Utilities.GetAccountID(myPlayerID) diff --git a/luarules/gadgets/sfx_notifications.lua b/luarules/gadgets/sfx_notifications.lua index dd7141c2dca..f5b44e59398 100644 --- a/luarules/gadgets/sfx_notifications.lua +++ b/luarules/gadgets/sfx_notifications.lua @@ -183,14 +183,14 @@ else end local isSpec = Spring.GetSpectatingState() - local myTeamID = Spring.GetMyTeamID() - local myPlayerID = Spring.GetMyPlayerID() - local myAllyTeamID = Spring.GetMyAllyTeamID() + local myTeamID = Spring.GetLocalTeamID() + local myPlayerID = Spring.GetLocalPlayerID() + local myAllyTeamID = Spring.GetLocalAllyTeamID() function gadget:PlayerChanged(playerID) isSpec = Spring.GetSpectatingState() - myTeamID = Spring.GetMyTeamID() - myPlayerID = Spring.GetMyPlayerID() - myAllyTeamID = Spring.GetMyAllyTeamID() + myTeamID = Spring.GetLocalTeamID() + myPlayerID = Spring.GetLocalPlayerID() + myAllyTeamID = Spring.GetLocalAllyTeamID() end local numTeams = 0 diff --git a/luarules/gadgets/sfx_notifications_broadcaster.lua b/luarules/gadgets/sfx_notifications_broadcaster.lua index f3da5a94215..44a568639f5 100644 --- a/luarules/gadgets/sfx_notifications_broadcaster.lua +++ b/luarules/gadgets/sfx_notifications_broadcaster.lua @@ -18,7 +18,7 @@ if not gadgetHandler:IsSyncedCode() then end function BroadcastEvent(_, event, player, forceplay) - if Script.LuaUI("NotificationEvent") and (forceplay or (tonumber(player) and ((tonumber(player) == Spring.GetMyPlayerID()) or Spring.GetSpectatingState()))) then + if Script.LuaUI("NotificationEvent") and (forceplay or (tonumber(player) and ((tonumber(player) == Spring.GetLocalPlayerID()) or Spring.GetSpectatingState()))) then if forceplay then forceplay = " y" else diff --git a/luarules/gadgets/system_info.lua b/luarules/gadgets/system_info.lua index edf261223c8..1ef2a297fb3 100644 --- a/luarules/gadgets/system_info.lua +++ b/luarules/gadgets/system_info.lua @@ -38,7 +38,7 @@ else local systems = {} local validation = SYNCED.validationSys - local myPlayerID = Spring.GetMyPlayerID() + local myPlayerID = Spring.GetLocalPlayerID() local myPlayerName = Spring.GetPlayerInfo(myPlayerID) local function isAuthorized() local acID = Spring.Utilities.GetAccountID(myPlayerID) diff --git a/luarules/gadgets/unit_crashing_aircraft.lua b/luarules/gadgets/unit_crashing_aircraft.lua index d9d2aeae2fa..3f3b26206e9 100644 --- a/luarules/gadgets/unit_crashing_aircraft.lua +++ b/luarules/gadgets/unit_crashing_aircraft.lua @@ -149,7 +149,7 @@ if gadgetHandler:IsSyncedCode() then else -- UNSYNCED local GetSpectatingState = Spring.GetSpectatingState local GetUnitLosState = Spring.GetUnitLosState - local GetMyAllyTeamID = Spring.GetMyAllyTeamID + local GetMyAllyTeamID = Spring.GetLocalAllyTeamID local function notifyCrashingAircraft(unitID, unitDefID, unitTeam) if GG.FireSmoke and GG.FireSmoke.CrashingAircraft then diff --git a/luarules/gadgets/unit_healthbars_widget_forwarding.lua b/luarules/gadgets/unit_healthbars_widget_forwarding.lua index aab3bfe6f7e..1cd5f14e4ee 100644 --- a/luarules/gadgets/unit_healthbars_widget_forwarding.lua +++ b/luarules/gadgets/unit_healthbars_widget_forwarding.lua @@ -106,16 +106,16 @@ else local rezreclaim = { 0.0, 1.0 } -- this is just a small table cache, so we dont allocate a new table for every update local forwardedFeatureIDsResurrect = {} -- so we only forward the start event once local forwardedFeatureIDsReclaim = {} -- so we only forward the start event once - local myTeamID = Spring.GetMyTeamID() - local myAllyTeamID = Spring.GetMyAllyTeamID() + local myTeamID = Spring.GetLocalTeamID() + local myAllyTeamID = Spring.GetLocalAllyTeamID() local _, fullview = Spring.GetSpectatingState() local IsUnitInLos = Spring.IsUnitInLos local GetFeatureHealth = Spring.GetFeatureHealth local headless = false function gadget:PlayerChanged(playerID) - myTeamID = Spring.GetMyTeamID() - myAllyTeamID = Spring.GetMyAllyTeamID() + myTeamID = Spring.GetLocalTeamID() + myAllyTeamID = Spring.GetLocalAllyTeamID() _, fullview = Spring.GetSpectatingState() end diff --git a/luarules/gadgets/unit_objectify.lua b/luarules/gadgets/unit_objectify.lua index 23102b04d2b..7e6c54eeb6c 100644 --- a/luarules/gadgets/unit_objectify.lua +++ b/luarules/gadgets/unit_objectify.lua @@ -182,10 +182,10 @@ if gadgetHandler:IsSyncedCode() then return true end else -- UNSYNCED - local myAllyTeam = Spring.GetMyAllyTeamID() + local myAllyTeam = Spring.GetLocalAllyTeamID() local spectating = Spring.GetSpectatingState() function gadget:PlayerChanged(playerID) - myAllyTeam = Spring.GetMyAllyTeamID() + myAllyTeam = Spring.GetLocalAllyTeamID() spectating = Spring.GetSpectatingState() end diff --git a/luarules/gadgets/unit_seismic_ping.lua b/luarules/gadgets/unit_seismic_ping.lua index 0c40c0c398b..99f5b07fd4f 100644 --- a/luarules/gadgets/unit_seismic_ping.lua +++ b/luarules/gadgets/unit_seismic_ping.lua @@ -19,7 +19,7 @@ end -- Speedups -------------------------------------------------------------------------------- local spGetSpectatingState = Spring.GetSpectatingState -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetMyAllyTeamID = Spring.GetLocalAllyTeamID local spGetGroundHeight = Spring.GetGroundHeight local spGetViewGeometry = Spring.GetViewGeometry diff --git a/luarules/gadgets/unit_target_on_the_move.lua b/luarules/gadgets/unit_target_on_the_move.lua index c4b714f2e98..b9ca97ed47e 100644 --- a/luarules/gadgets/unit_target_on_the_move.lua +++ b/luarules/gadgets/unit_target_on_the_move.lua @@ -916,8 +916,8 @@ else -- UNSYNCED local spGetUnitPosition = Spring.GetUnitPosition local spValidUnitID = Spring.ValidUnitID - local spGetMyAllyTeamID = Spring.GetMyAllyTeamID - local spGetMyTeamID = Spring.GetMyTeamID + local spGetMyAllyTeamID = Spring.GetLocalAllyTeamID + local spGetMyTeamID = Spring.GetLocalTeamID local spIsUnitSelected = Spring.IsUnitSelected local spGetSpectatingState = Spring.GetSpectatingState local spGetUnitAllyTeam = Spring.GetUnitAllyTeam diff --git a/luaui/Include/select_api.lua b/luaui/Include/select_api.lua index b3c2d794fae..7e4a43ce84f 100644 --- a/luaui/Include/select_api.lua +++ b/luaui/Include/select_api.lua @@ -565,12 +565,12 @@ local function parseSource(sourceDef) if sourceDefLower == "allmap" then return function() - local myTeamId = Spring.GetMyTeamID() + local myTeamId = Spring.GetLocalTeamID() return Spring.GetTeamUnits(myTeamId) end elseif sourceDefLower == "visible" then return function() - local myTeamId = Spring.GetMyTeamID() + local myTeamId = Spring.GetLocalTeamID() return Spring.GetVisibleUnits(myTeamId) end elseif sourceDefLower == "prevselection" or sourceDefLower == "previousselection" then diff --git a/luaui/Include/unitBlocking.lua b/luaui/Include/unitBlocking.lua index 626b4737b8b..95984099daf 100644 --- a/luaui/Include/unitBlocking.lua +++ b/luaui/Include/unitBlocking.lua @@ -11,7 +11,7 @@ local unitBlocking = {} --- -- Get specific units' blocking status --- local specificBlocked = unitBlocking.getBlockedUnitDefs({123, 456}) function unitBlocking.getBlockedUnitDefs(unitDefIDs) - local myTeamID = Spring.GetMyTeamID() + local myTeamID = Spring.GetLocalTeamID() if not myTeamID then return {} end diff --git a/luaui/RmlWidgets/gui_quick_start/gui_quick_start.lua b/luaui/RmlWidgets/gui_quick_start/gui_quick_start.lua index 6e24af73563..ab651c88eea 100644 --- a/luaui/RmlWidgets/gui_quick_start/gui_quick_start.lua +++ b/luaui/RmlWidgets/gui_quick_start/gui_quick_start.lua @@ -33,7 +33,7 @@ end local shouldApplyFactoryDiscount = modOptions.quick_start == "factory_discount" or (modOptions.quick_start == "default" and (modOptions.temp_enable_territorial_domination or modOptions.deathmode == "territorial_domination")) local spGetGameRulesParam = Spring.GetGameRulesParam -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spI18N = Spring.I18N local wgBuildMenu, wgGridMenu, wgTopbar, wgPregameBuild, wgPregameUI, wgPregameUIDraft, wgGetBuildQueueFunc, wgGetBuildPositionsFunc, wgGetPregameUnitSelectedFunc diff --git a/luaui/RmlWidgets/gui_territorial_domination/gui_territorial_domination.lua b/luaui/RmlWidgets/gui_territorial_domination/gui_territorial_domination.lua index a0506c8a5a1..34acd13c36a 100644 --- a/luaui/RmlWidgets/gui_territorial_domination/gui_territorial_domination.lua +++ b/luaui/RmlWidgets/gui_territorial_domination/gui_territorial_domination.lua @@ -176,7 +176,7 @@ local function fetchAllyTeamPlayerNames(allyTeamID) local playerNames = {} local seenPlayerIDs = {} - local myTeamID = Spring.GetMyTeamID() + local myTeamID = Spring.GetLocalTeamID() local mySpecStatus = spGetSpectatingState() local anonymousMode = Spring.GetModOptions().teamcolors_anonymous_mode @@ -283,12 +283,12 @@ local function getAllyTeamColor(allyTeamID) end local function isPlayerInFirstPlace() - local myTeamID = Spring.GetMyTeamID() + local myTeamID = Spring.GetLocalTeamID() if myTeamID == nil then return false end - local myAllyTeamID = Spring.GetMyAllyTeamID() + local myAllyTeamID = Spring.GetLocalAllyTeamID() if myAllyTeamID == nil then return false end @@ -692,7 +692,7 @@ local function hideRoundEndPopup() end local function getSelectedPlayerTeam() - local myAllyTeamID = Spring.GetMyAllyTeamID() + local myAllyTeamID = Spring.GetLocalAllyTeamID() if not myAllyTeamID then return nil end diff --git a/luaui/Tests/cmd_blueprint/test_cmd_blueprint_filter.lua b/luaui/Tests/cmd_blueprint/test_cmd_blueprint_filter.lua index 6d2a2ecf8a2..6dfc0bd2ee4 100644 --- a/luaui/Tests/cmd_blueprint/test_cmd_blueprint_filter.lua +++ b/luaui/Tests/cmd_blueprint/test_cmd_blueprint_filter.lua @@ -40,7 +40,7 @@ function test() local builderUnitDefName = "armck" - local myTeamID = Spring.GetMyTeamID() + local myTeamID = Spring.GetLocalTeamID() local x, z = Game.mapSizeX / 2, Game.mapSizeZ / 2 local y = Spring.GetGroundHeight(x, z) local facing = 1 diff --git a/luaui/Tests/cmd_blueprint/test_cmd_blueprint_line.lua b/luaui/Tests/cmd_blueprint/test_cmd_blueprint_line.lua index 96da9d02704..35329a6afb4 100644 --- a/luaui/Tests/cmd_blueprint/test_cmd_blueprint_line.lua +++ b/luaui/Tests/cmd_blueprint/test_cmd_blueprint_line.lua @@ -40,7 +40,7 @@ function test() local blueprintUnitDefID = UnitDefNames[blueprintUnitDefName].id - local myTeamID = Spring.GetMyTeamID() + local myTeamID = Spring.GetLocalTeamID() local x, z = Game.mapSizeX / 2, Game.mapSizeZ / 2 local y = Spring.GetGroundHeight(x, z) local facing = 1 diff --git a/luaui/Tests/cmd_blueprint/test_cmd_blueprint_single.lua b/luaui/Tests/cmd_blueprint/test_cmd_blueprint_single.lua index f107d10afb6..c13038d85b0 100644 --- a/luaui/Tests/cmd_blueprint/test_cmd_blueprint_single.lua +++ b/luaui/Tests/cmd_blueprint/test_cmd_blueprint_single.lua @@ -35,7 +35,7 @@ function test() local blueprintUnitDefID = UnitDefNames[blueprintUnitDefName].id - local myTeamID = Spring.GetMyTeamID() + local myTeamID = Spring.GetLocalTeamID() local x, z = Game.mapSizeX / 2, Game.mapSizeZ / 2 local y = Spring.GetGroundHeight(x, z) local facing = 1 diff --git a/luaui/Tests/cmd_stop_selfd/test_cmd_stop_selfd.lua b/luaui/Tests/cmd_stop_selfd/test_cmd_stop_selfd.lua index 1d31c4067af..a3dd75e9060 100644 --- a/luaui/Tests/cmd_stop_selfd/test_cmd_stop_selfd.lua +++ b/luaui/Tests/cmd_stop_selfd/test_cmd_stop_selfd.lua @@ -16,7 +16,7 @@ function test() widget = widgetHandler:FindWidget("Stop means Stop") assert(widget, "Stop means Stop widget not found via FindWidget") - local myTeamID = Spring.GetMyTeamID() + local myTeamID = Spring.GetLocalTeamID() unitID = SyncedRun(function(locals) local x, z = Game.mapSizeX / 2, Game.mapSizeZ / 2 diff --git a/luaui/Tests/selftests/test_callins.lua b/luaui/Tests/selftests/test_callins.lua index 2bb532bac7b..30f7be387b7 100644 --- a/luaui/Tests/selftests/test_callins.lua +++ b/luaui/Tests/selftests/test_callins.lua @@ -41,7 +41,7 @@ end function runWaitUntil(countOnly, reallyCountOnly, wait, expect, clear) -- test waitUntilCallinArgs with and without expectCallin preregister - local myTeamID = Spring.GetMyTeamID() + local myTeamID = Spring.GetLocalTeamID() if expect then Test.expectCallin("UnitCommand", reallyCountOnly) end diff --git a/luaui/Widgets/api_analytics.lua b/luaui/Widgets/api_analytics.lua index a6b1eb1e466..22fd32d0fe5 100644 --- a/luaui/Widgets/api_analytics.lua +++ b/luaui/Widgets/api_analytics.lua @@ -13,7 +13,7 @@ function widget:GetInfo() end local spGetPlayerInfo = Spring.GetPlayerInfo -local spGetMyPlayerID = Spring.GetMyPlayerID +local spGetMyPlayerID = Spring.GetLocalPlayerID local spGetGameFrame = Spring.GetGameFrame local spLog = Spring.Log local spSendLuaUIMsg = Spring.SendLuaUIMsg diff --git a/luaui/Widgets/api_blueprint.lua b/luaui/Widgets/api_blueprint.lua index ef3924e1a5b..e96ada9a070 100644 --- a/luaui/Widgets/api_blueprint.lua +++ b/luaui/Widgets/api_blueprint.lua @@ -61,7 +61,7 @@ local SpringGetUnitPosition = Spring.GetUnitPosition local SpringGetGroundHeight = Spring.GetGroundHeight local SpringPos2BuildPos = Spring.Pos2BuildPos local SpringTestBuildOrder = Spring.TestBuildOrder -local SpringGetMyTeamID = Spring.GetMyTeamID +local SpringGetMyTeamID = Spring.GetLocalTeamID local isHeadless = not Platform.gl -- util diff --git a/luaui/Widgets/api_builder_queue.lua b/luaui/Widgets/api_builder_queue.lua index 23f4715bbc1..a10f98c26ce 100644 --- a/luaui/Widgets/api_builder_queue.lua +++ b/luaui/Widgets/api_builder_queue.lua @@ -518,7 +518,7 @@ end function widget:PlayerChanged(playerId) -- Clear all data when player changes (spectating state changes) - local myPlayerId = Spring.GetMyPlayerID() + local myPlayerId = Spring.GetLocalPlayerID() if playerId == myPlayerId then resetStateAndReinitialize() end diff --git a/luaui/Widgets/api_los_combiner_gl4.lua b/luaui/Widgets/api_los_combiner_gl4.lua index e18bf655019..724294e5379 100644 --- a/luaui/Widgets/api_los_combiner_gl4.lua +++ b/luaui/Widgets/api_los_combiner_gl4.lua @@ -164,7 +164,7 @@ local function UpdateInfoLOSTexture(count) end function widget:PlayerChanged(playerID) - local newAllyTeam = Spring.GetMyAllyTeamID() + local newAllyTeam = Spring.GetLocalAllyTeamID() if currentAllyTeam ~= newAllyTeam then -- do a few quick renders currentAllyTeam = newAllyTeam updateInfoLOSTexture = numFastUpdates @@ -186,7 +186,7 @@ function widget:Initialize() shaderConfig[name .. "XSIZE"] = texInfo.xsize shaderConfig[name .. "YSIZE"] = texInfo.ysize end - currentAllyTeam = Spring.GetMyAllyTeamID() + currentAllyTeam = Spring.GetLocalAllyTeamID() for _, a in ipairs(Spring.GetAllyTeamList()) do infoTextures[a] = CreateLosTexture() diff --git a/luaui/Widgets/api_resource_spot_builder.lua b/luaui/Widgets/api_resource_spot_builder.lua index 451456e9d5a..80719b56fda 100644 --- a/luaui/Widgets/api_resource_spot_builder.lua +++ b/luaui/Widgets/api_resource_spot_builder.lua @@ -31,7 +31,7 @@ local spGetGroundHeight = Spring.GetGroundHeight local spGiveOrderToUnit = Spring.GiveOrderToUnit local spPos2BuildPos = Spring.Pos2BuildPos local spGetTeamUnits = Spring.GetTeamUnits -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetUnitPosition = Spring.GetUnitPosition local spGetUnitIsBeingBuilt = Spring.GetUnitIsBeingBuilt local spGetUnitDefID = Spring.GetUnitDefID diff --git a/luaui/Widgets/api_shared_state.lua b/luaui/Widgets/api_shared_state.lua index b8bac12bfed..59cd7046c0a 100644 --- a/luaui/Widgets/api_shared_state.lua +++ b/luaui/Widgets/api_shared_state.lua @@ -14,9 +14,9 @@ function widget:GetInfo() end -- Local references to Spring API calls -local spGetMyTeamID = Spring.GetMyTeamID -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID -local spGetMyPlayerID = Spring.GetMyPlayerID +local spGetMyTeamID = Spring.GetLocalTeamID +local spGetMyAllyTeamID = Spring.GetLocalAllyTeamID +local spGetMyPlayerID = Spring.GetLocalPlayerID local spGetSpectatingState = Spring.GetSpectatingState local spGetGameFrame = Spring.GetGameFrame local spIsGUIHidden = Spring.IsGUIHidden diff --git a/luaui/Widgets/api_unit_tracker_gl4.lua b/luaui/Widgets/api_unit_tracker_gl4.lua index 0254cdd073f..0f392913b25 100644 --- a/luaui/Widgets/api_unit_tracker_gl4.lua +++ b/luaui/Widgets/api_unit_tracker_gl4.lua @@ -16,7 +16,7 @@ end -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spEcho = Spring.Echo local spGetAllUnits = Spring.GetAllUnits local spGetSpectatingState = Spring.GetSpectatingState @@ -326,8 +326,8 @@ end local spec, fullview = spGetSpectatingState() local myTeamID = spGetMyTeamID() -local myAllyTeamID = Spring.GetMyAllyTeamID() -local myPlayerID = Spring.GetMyPlayerID() +local myAllyTeamID = Spring.GetLocalAllyTeamID() +local myPlayerID = Spring.GetLocalPlayerID() local function isValidLivingSeenUnit(unitID, unitDefID, verbose) --[[ @@ -409,7 +409,7 @@ function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID, reason, sile -- if gameFrame <= 0 and not fullview then - local currentAllyTeamID = Spring.GetMyAllyTeamID() + local currentAllyTeamID = Spring.GetLocalAllyTeamID() if myAllyTeamID ~= currentAllyTeamID then widget:PlayerChanged() end @@ -730,9 +730,9 @@ function widget:PlayerChanged(playerID) -- the fullview variable is not changed, however local currentspec, currentfullview = spGetSpectatingState() - local currentAllyTeamID = Spring.GetMyAllyTeamID() + local currentAllyTeamID = Spring.GetLocalAllyTeamID() local currentTeamID = spGetMyTeamID() - local currentPlayerID = Spring.GetMyPlayerID() + local currentPlayerID = Spring.GetLocalPlayerID() local reinit = false @@ -816,8 +816,8 @@ function widget:Initialize() gameFrame = spGetGameFrame() spec, fullview = spGetSpectatingState() myTeamID = spGetMyTeamID() - myAllyTeamID = Spring.GetMyAllyTeamID() - myPlayerID = Spring.GetMyPlayerID() + myAllyTeamID = Spring.GetLocalAllyTeamID() + myPlayerID = Spring.GetLocalPlayerID() scriptLuauiVisibleUnitAdded = Script.LuaUI.VisibleUnitAdded scriptLuauiVisibleUnitRemoved = Script.LuaUI.VisibleUnitRemoved @@ -855,7 +855,7 @@ function widget:AddConsoleLine(lines, priority) end local username, frameNumber, gotChecksum, correctChecksum = lines:match(syncerrorpattern) if username and frameNumber and gotChecksum and correctChecksum then - local myPlayerName = Spring.GetPlayerInfo(Spring.GetMyPlayerID()) + local myPlayerName = Spring.GetPlayerInfo(Spring.GetLocalPlayerID()) if myPlayerName == username then -- Yes, we have desynced, time to send a LuaUIMsg to notify the server -- desyncee, gameID, frame, gameversion, engine version, map, chobby version? diff --git a/luaui/Widgets/camera_lockcamera.lua b/luaui/Widgets/camera_lockcamera.lua index 24c0c433ab7..6bd59c92eb3 100644 --- a/luaui/Widgets/camera_lockcamera.lua +++ b/luaui/Widgets/camera_lockcamera.lua @@ -33,7 +33,7 @@ local spGetPlayerInfo = Spring.GetPlayerInfo local spSendCommands = Spring.SendCommands local spGetSpectatingState = Spring.GetSpectatingState local spGetMapDrawMode = Spring.GetMapDrawMode -local spGetMyPlayerID = Spring.GetMyPlayerID +local spGetMyPlayerID = Spring.GetLocalPlayerID local spGetLocalAllyTeamID = Spring.GetLocalAllyTeamID local spGetLocalTeamID = Spring.GetLocalTeamID local spGetTeamInfo = Spring.GetTeamInfo diff --git a/luaui/Widgets/camera_player_tv.lua b/luaui/Widgets/camera_player_tv.lua index 396c0de379a..bcbcd9d41e8 100644 --- a/luaui/Widgets/camera_player_tv.lua +++ b/luaui/Widgets/camera_player_tv.lua @@ -18,7 +18,7 @@ local mathRandom = math.random -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetMouseState = Spring.GetMouseState local spGetViewGeometry = Spring.GetViewGeometry local spGetSpectatingState = Spring.GetSpectatingState diff --git a/luaui/Widgets/camera_startup.lua b/luaui/Widgets/camera_startup.lua index 8c83277fcac..69f3fb16801 100644 --- a/luaui/Widgets/camera_startup.lua +++ b/luaui/Widgets/camera_startup.lua @@ -40,7 +40,7 @@ function widget:Initialize() xMax = Game.mapSizeX zMax = Game.mapSizeZ else - xMin, zMin, xMax, zMax = Spring.GetAllyTeamStartBox(Spring.GetMyAllyTeamID()) + xMin, zMin, xMax, zMax = Spring.GetAllyTeamStartBox(Spring.GetLocalAllyTeamID()) end if not xMin or not zMin or not xMax or not zMax then diff --git a/luaui/Widgets/cmd_area_commands_filter.lua b/luaui/Widgets/cmd_area_commands_filter.lua index 1dd3a0029b4..817c3e86ae1 100644 --- a/luaui/Widgets/cmd_area_commands_filter.lua +++ b/luaui/Widgets/cmd_area_commands_filter.lua @@ -35,7 +35,7 @@ local spGetUnitTeam = Spring.GetUnitTeam local spGetFeatureDefID = Spring.GetFeatureDefID local spGetFeaturesInCylinder = Spring.GetFeaturesInCylinder local spGetSpectatingState = Spring.GetSpectatingState -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetMyAllyTeamID = Spring.GetLocalAllyTeamID local spGetUnitIsTransporting = Spring.GetUnitIsTransporting local spGetUnitPosition = Spring.GetUnitPosition local spGetFeaturePosition = Spring.GetFeaturePosition diff --git a/luaui/Widgets/cmd_comselect.lua b/luaui/Widgets/cmd_comselect.lua index 2c595ce0b72..204ca84cacf 100644 --- a/luaui/Widgets/cmd_comselect.lua +++ b/luaui/Widgets/cmd_comselect.lua @@ -16,7 +16,7 @@ end local tableInsert = table.insert -- Localized Spring API for performance -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local myTeamID diff --git a/luaui/Widgets/cmd_context_build.lua b/luaui/Widgets/cmd_context_build.lua index a34358d608f..0cf9a518294 100644 --- a/luaui/Widgets/cmd_context_build.lua +++ b/luaui/Widgets/cmd_context_build.lua @@ -145,7 +145,7 @@ end -- returns true if the given unitDefID can be built by the pregame start unit local function canSelectPreGameDef(uDefID) - local myTeamID = Spring.GetMyTeamID() + local myTeamID = Spring.GetLocalTeamID() local startDefID = Spring.GetTeamRulesParam(myTeamID, "startUnit") if not startDefID or not UnitDefs[startDefID] or not UnitDefs[startDefID].buildOptions then return false diff --git a/luaui/Widgets/cmd_fac_holdposition.lua b/luaui/Widgets/cmd_fac_holdposition.lua index 62060328c0b..924900e605c 100644 --- a/luaui/Widgets/cmd_fac_holdposition.lua +++ b/luaui/Widgets/cmd_fac_holdposition.lua @@ -13,7 +13,7 @@ function widget:GetInfo() end -- Localized Spring API for performance -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local myTeamID = spGetMyTeamID() diff --git a/luaui/Widgets/cmd_holdfire_fix.lua b/luaui/Widgets/cmd_holdfire_fix.lua index b34c0ff35ad..818c1798ecf 100644 --- a/luaui/Widgets/cmd_holdfire_fix.lua +++ b/luaui/Widgets/cmd_holdfire_fix.lua @@ -14,7 +14,7 @@ end -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local CMD_FIRE_STATE = CMD.FIRE_STATE local CMD_INSERT = CMD.INSERT diff --git a/luaui/Widgets/cmd_nanoturrets_assist_priority.lua b/luaui/Widgets/cmd_nanoturrets_assist_priority.lua index 9c396c294fb..0aa79e091ec 100644 --- a/luaui/Widgets/cmd_nanoturrets_assist_priority.lua +++ b/luaui/Widgets/cmd_nanoturrets_assist_priority.lua @@ -19,7 +19,7 @@ local GetUnitDefID = Spring.GetUnitDefID local UnitDefs = UnitDefs local CMD_REPAIR = CMD.REPAIR local CMD_FIGHT = CMD.FIGHT -local myTeam = Spring.GetMyTeamID() +local myTeam = Spring.GetLocalTeamID() local nanoDefs = {} diff --git a/luaui/Widgets/cmd_no_duplicate_orders.lua b/luaui/Widgets/cmd_no_duplicate_orders.lua index d6e57d2136a..ac48419d3f8 100644 --- a/luaui/Widgets/cmd_no_duplicate_orders.lua +++ b/luaui/Widgets/cmd_no_duplicate_orders.lua @@ -50,7 +50,7 @@ function widget:Initialize() if Spring.IsReplay() or Spring.GetGameFrame() > 0 then widget:PlayerChanged() end - for _, unitID in ipairs(Spring.GetTeamUnits(Spring.GetMyTeamID())) do + for _, unitID in ipairs(Spring.GetTeamUnits(Spring.GetLocalTeamID())) do if GetUnitIsBeingBuilt(unitID) then widget:UnitCreated(unitID) end diff --git a/luaui/Widgets/cmd_share_unit.lua b/luaui/Widgets/cmd_share_unit.lua index e540b10354d..1162085a2e9 100644 --- a/luaui/Widgets/cmd_share_unit.lua +++ b/luaui/Widgets/cmd_share_unit.lua @@ -29,7 +29,7 @@ local range = 200 --speedups -------------------------------------------------------------------------------- local GetUnitsInCylinder = Spring.GetUnitsInCylinder -local GetMyTeamID = Spring.GetMyTeamID +local GetMyTeamID = Spring.GetLocalTeamID local GetUnitTeam = Spring.GetUnitTeam local GetSelectedUnits = Spring.GetSelectedUnits local GetTeamAllyTeamID = Spring.GetTeamAllyTeamID diff --git a/luaui/Widgets/cmd_skip_allied_upgrade.lua b/luaui/Widgets/cmd_skip_allied_upgrade.lua index 94756414eba..05ee2527da1 100644 --- a/luaui/Widgets/cmd_skip_allied_upgrade.lua +++ b/luaui/Widgets/cmd_skip_allied_upgrade.lua @@ -27,7 +27,7 @@ function SkipAlliedUpgradeWidget.filterOutAlliedSpots(spots, unitDefIdsToCheck) end local filteredSpots = {} local nextFilteredSpotIndex = 1 -- to avoid recalculating table length in case of large 'spots' table - local myTeamID = Spring.GetMyTeamID() + local myTeamID = Spring.GetLocalTeamID() for i = 1, #spots do local spot = spots[i] diff --git a/luaui/Widgets/cmd_stop_selfd.lua b/luaui/Widgets/cmd_stop_selfd.lua index 75f58691e80..13e81f8f639 100644 --- a/luaui/Widgets/cmd_stop_selfd.lua +++ b/luaui/Widgets/cmd_stop_selfd.lua @@ -13,7 +13,7 @@ function widget:GetInfo() end -- Localized Spring API for performance -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local CMD_STOP = CMD.STOP local myTeamID = spGetMyTeamID() diff --git a/luaui/Widgets/cmd_unit_mover.lua b/luaui/Widgets/cmd_unit_mover.lua index c3cb0e4ebdd..cdcaa96e755 100644 --- a/luaui/Widgets/cmd_unit_mover.lua +++ b/luaui/Widgets/cmd_unit_mover.lua @@ -31,7 +31,7 @@ local spGetGameFrame = Spring.GetGameFrame local GiveOrderToUnit = Spring.GiveOrderToUnit local GetUnitPosition = Spring.GetUnitPosition local GetUnitDirection = Spring.GetUnitDirection -local GetMyTeamID = Spring.GetMyTeamID +local GetMyTeamID = Spring.GetLocalTeamID local GetUnitDefID = Spring.GetUnitDefID local CMD_MOVE = CMD.MOVE diff --git a/luaui/Widgets/dbg_ffa_startpoints_picker.lua b/luaui/Widgets/dbg_ffa_startpoints_picker.lua index 8ad14442be1..8cb440acc9d 100644 --- a/luaui/Widgets/dbg_ffa_startpoints_picker.lua +++ b/luaui/Widgets/dbg_ffa_startpoints_picker.lua @@ -32,7 +32,7 @@ local tableRemove = table.remove -- Localized Spring API for performance local spGetUnitDefID = Spring.GetUnitDefID local spGetSelectedUnits = Spring.GetSelectedUnits -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetTeamUnits = Spring.GetTeamUnits -------------------------------------------------------------------------------- @@ -808,7 +808,7 @@ local function isSoloDevMode() allyTeamCount = allyTeamCount + 1 end end - local teamList = Spring.GetTeamList(Spring.GetMyAllyTeamID()) + local teamList = Spring.GetTeamList(Spring.GetLocalAllyTeamID()) local teamCount = table.count(teamList) local isSolo = allyTeamCount == 1 and teamCount == 1 diff --git a/luaui/Widgets/gfx_airjets_gl4.lua b/luaui/Widgets/gfx_airjets_gl4.lua index 07e0eb5de52..2ef1d617c3b 100644 --- a/luaui/Widgets/gfx_airjets_gl4.lua +++ b/luaui/Widgets/gfx_airjets_gl4.lua @@ -154,7 +154,7 @@ local lastGameFrame = Spring.GetGameFrame() local updateSec = 0 local spec, fullview = spGetSpectatingState() -local myAllyTeamID = Spring.GetMyAllyTeamID() +local myAllyTeamID = Spring.GetLocalAllyTeamID() local enabled = true local lighteffectsEnabled = false -- TODO (enableLights and WG['lighteffects'] ~= nil and WG['lighteffects'].enableThrusters) @@ -760,7 +760,7 @@ end function widget:PlayerChanged(playerID) local currentspec, currentfullview = spGetSpectatingState() - local currentAllyTeamID = Spring.GetMyAllyTeamID() + local currentAllyTeamID = Spring.GetLocalAllyTeamID() local reinit = false if (currentspec ~= spec) diff --git a/luaui/Widgets/gfx_glass.lua b/luaui/Widgets/gfx_glass.lua index aafe45a83e0..f6c78a54635 100644 --- a/luaui/Widgets/gfx_glass.lua +++ b/luaui/Widgets/gfx_glass.lua @@ -292,7 +292,7 @@ function widget:PlayerChanged() end local gaiaTeamID = Spring.GetGaiaTeamID() -local myteamid = Spring.GetMyTeamID() +local myteamid = Spring.GetLocalTeamID() local effectOn = false local effectStart = 0 diff --git a/luaui/Widgets/gfx_los_view.lua b/luaui/Widgets/gfx_los_view.lua index eb69223e00d..21667db91f2 100644 --- a/luaui/Widgets/gfx_los_view.lua +++ b/luaui/Widgets/gfx_los_view.lua @@ -16,7 +16,7 @@ end local spGetGameFrame = Spring.GetGameFrame local spGetSpectatingState = Spring.GetSpectatingState -local myPlayerID = Spring.GetMyPlayerID() +local myPlayerID = Spring.GetLocalPlayerID() local lastMapDrawMode = Spring.GetMapDrawMode() local function TurnOnLOS() @@ -43,7 +43,7 @@ local gamestarted = false function widget:GameFrame(frame) -- somehow widget:GameStart() didnt work if frame == 1 and not gamestarted then gamestarted = true - myPlayerID = Spring.GetMyPlayerID() + myPlayerID = Spring.GetLocalPlayerID() if spGetSpectatingState() then TurnOffLOS() else diff --git a/luaui/Widgets/gfx_paralyze_effect.lua b/luaui/Widgets/gfx_paralyze_effect.lua index 87f15003669..a6838875c35 100644 --- a/luaui/Widgets/gfx_paralyze_effect.lua +++ b/luaui/Widgets/gfx_paralyze_effect.lua @@ -442,7 +442,7 @@ end function widget:PlayerChanged(playerID) spec, fullview = Spring.GetSpectatingState() local prevMyTeamID = myTeamID - myTeamID = Spring.GetMyTeamID() + myTeamID = Spring.GetLocalTeamID() if myTeamID ~= prevMyTeamID then -- TODO only really needed if onlyShowOwnTeam, or if allyteam changed? --spEcho("Initializing Paralyze Effect") init() diff --git a/luaui/Widgets/gfx_showbuilderqueue.lua b/luaui/Widgets/gfx_showbuilderqueue.lua index 4593d9ebd45..eb5f0235f85 100644 --- a/luaui/Widgets/gfx_showbuilderqueue.lua +++ b/luaui/Widgets/gfx_showbuilderqueue.lua @@ -33,7 +33,7 @@ local maxUnitShapes = 4096 -- v8 Floris - GL4 unit shape rendering -- v9 SuperKitowiec - Extract builder queue related code to api_builder_queue.lua. -local myPlayerId = Spring.GetMyPlayerID() +local myPlayerId = Spring.GetLocalPlayerID() local _, fullView, _ = spGetSpectatingState() local spGetGroundHeight = Spring.GetGroundHeight diff --git a/luaui/Widgets/gui_advplayerslist.lua b/luaui/Widgets/gui_advplayerslist.lua index fd0bc2d7bc5..d5639ab2772 100644 --- a/luaui/Widgets/gui_advplayerslist.lua +++ b/luaui/Widgets/gui_advplayerslist.lua @@ -119,7 +119,7 @@ local sp = { GetMouseState = spGetMouseState, GetAIInfo = Spring.GetAIInfo, GetTeamRulesParam = Spring.GetTeamRulesParam, - GetMyTeamID = Spring.GetMyTeamID, + GetMyTeamID = Spring.GetLocalTeamID, AreTeamsAllied = Spring.AreTeamsAllied, GetTeamStatsHistory = Spring.GetTeamStatsHistory, } @@ -290,7 +290,7 @@ local accountIDLookup = {} -- accountID -> playerID for fast duplicate detection -------------------------------------------------------------------------------- -- local player info -local myPlayerID = Spring.GetMyPlayerID() +local myPlayerID = Spring.GetLocalPlayerID() local myAllyTeamID = Spring.GetLocalAllyTeamID() local myTeamID = Spring.GetLocalTeamID() local myTeamPlayerID = select(2, Spring.GetTeamInfo(myTeamID)) @@ -852,7 +852,7 @@ function widget:PlayerChanged(playerID) lastKnownTeamNames[p.team] = p.name end end - myPlayerID = Spring.GetMyPlayerID() + myPlayerID = Spring.GetLocalPlayerID() myAllyTeamID = Spring.GetLocalAllyTeamID() myTeamID = Spring.GetLocalTeamID() myTeamPlayerID = select(2, Spring.GetTeamInfo(myTeamID)) diff --git a/luaui/Widgets/gui_advplayerslist_mascot.lua b/luaui/Widgets/gui_advplayerslist_mascot.lua index fa5c390584f..96f245d9ae8 100644 --- a/luaui/Widgets/gui_advplayerslist_mascot.lua +++ b/luaui/Widgets/gui_advplayerslist_mascot.lua @@ -276,7 +276,7 @@ OPTIONS_original.defaults = nil -- Declarations --------------------------------------------------------------------------------------------------- -local myPlayerID = Spring.GetMyPlayerID() +local myPlayerID = Spring.GetLocalPlayerID() local glRotate = gl.Rotate local glTranslate = gl.Translate diff --git a/luaui/Widgets/gui_advplayerslist_unittotals.lua b/luaui/Widgets/gui_advplayerslist_unittotals.lua index 910aa93e3c7..54528007f77 100644 --- a/luaui/Widgets/gui_advplayerslist_unittotals.lua +++ b/luaui/Widgets/gui_advplayerslist_unittotals.lua @@ -16,7 +16,7 @@ end local mathFloor = math.floor -- Localized Spring API for performance -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetViewGeometry = Spring.GetViewGeometry local displayFeatureCount = false diff --git a/luaui/Widgets/gui_allySelectedUnits.lua b/luaui/Widgets/gui_allySelectedUnits.lua index fedc9eb6d03..c787b20a343 100644 --- a/luaui/Widgets/gui_allySelectedUnits.lua +++ b/luaui/Widgets/gui_allySelectedUnits.lua @@ -17,7 +17,7 @@ end -- Localized Spring API for performance local spGetUnitDefID = Spring.GetUnitDefID local spGetGameFrame = Spring.GetGameFrame -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetUnitPosition = Spring.GetUnitPosition local spGetGroundHeight = Spring.GetGroundHeight @@ -67,8 +67,8 @@ local spGetUnitDefID = spGetUnitDefID local spGetPlayerInfo = Spring.GetPlayerInfo local spGetSpectatingState = Spring.GetSpectatingState local spGetTeamInfo = Spring.GetTeamInfo -local spGetMyPlayerID = Spring.GetMyPlayerID -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetMyPlayerID = Spring.GetLocalPlayerID +local spGetMyAllyTeamID = Spring.GetLocalAllyTeamID local spSelectUnitArray = Spring.SelectUnitArray local spValidUnitID = Spring.ValidUnitID local spGetUnitIsDead = Spring.GetUnitIsDead diff --git a/luaui/Widgets/gui_ally_cursors.lua b/luaui/Widgets/gui_ally_cursors.lua index a2b9720198d..655c5f6a02a 100644 --- a/luaui/Widgets/gui_ally_cursors.lua +++ b/luaui/Widgets/gui_ally_cursors.lua @@ -16,7 +16,7 @@ end local mathAtan2 = math.atan2 -- Localized Spring API for performance -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetSpectatingState = Spring.GetSpectatingState local cursorSize = 11 @@ -101,7 +101,7 @@ local alliedCursorsTime = {} -- for API purpose local usedCursorSize = cursorSize local allycursorDrawList = {} local playerTeamIDs = {} -local myPlayerID = Spring.GetMyPlayerID() +local myPlayerID = Spring.GetLocalPlayerID() local _, fullview = spGetSpectatingState() local myTeamID = spGetMyTeamID() local isReplay = Spring.IsReplay() diff --git a/luaui/Widgets/gui_attack_aoe.lua b/luaui/Widgets/gui_attack_aoe.lua index 745ed828607..a47bcd6a3d0 100644 --- a/luaui/Widgets/gui_attack_aoe.lua +++ b/luaui/Widgets/gui_attack_aoe.lua @@ -36,7 +36,7 @@ local rad = math.rad local osClock = os.clock -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetGroundHeight = Spring.GetGroundHeight local spGetActiveCommand = Spring.GetActiveCommand local spGetCameraPosition = Spring.GetCameraPosition diff --git a/luaui/Widgets/gui_attackrange_gl4.lua b/luaui/Widgets/gui_attackrange_gl4.lua index 4605237b97b..04c4090fb3e 100644 --- a/luaui/Widgets/gui_attackrange_gl4.lua +++ b/luaui/Widgets/gui_attackrange_gl4.lua @@ -24,7 +24,7 @@ local mathMax = math.max local mathPi = math.pi -- Localized Spring API for performance -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spEcho = Spring.Echo --------------------------- @@ -443,7 +443,7 @@ end --Button display configuration --position only relevant if no saved config data found -local myAllyTeam = Spring.GetMyAllyTeamID() +local myAllyTeam = Spring.GetLocalAllyTeamID() local myTeamID = spGetMyTeamID() -------------------------------------------------------------------------------- @@ -997,7 +997,7 @@ function widget:Initialize() widgetHandler:AddAction("attack_range_inc", cycleUnitDisplayHandler, { direction = 1 }, "p") widgetHandler:AddAction("attack_range_dec", cycleUnitDisplayHandler, { direction = -1 }, "p") - myAllyTeam = Spring.GetMyAllyTeamID() + myAllyTeam = Spring.GetLocalAllyTeamID() myTeamID = spGetMyTeamID() updateSelection = true diff --git a/luaui/Widgets/gui_build_eta.lua b/luaui/Widgets/gui_build_eta.lua index 7df2af0b914..a369c65a6c1 100644 --- a/luaui/Widgets/gui_build_eta.lua +++ b/luaui/Widgets/gui_build_eta.lua @@ -28,7 +28,7 @@ local spGetFeatureHealth = Spring.GetFeatureHealth local spGetFeatureDefID = Spring.GetFeatureDefID local spGetFeaturePosition = Spring.GetFeaturePosition local spec, fullview = spGetSpectatingState() -local myAllyTeam = Spring.GetMyAllyTeamID() +local myAllyTeam = Spring.GetLocalAllyTeamID() local glColor = gl.Color local glPushMatrix = gl.PushMatrix @@ -229,8 +229,8 @@ function widget:Update(dt) end function widget:PlayerChanged() - if myAllyTeam ~= Spring.GetMyAllyTeamID() or fullview ~= select(2, spGetSpectatingState()) then - myAllyTeam = Spring.GetMyAllyTeamID() + if myAllyTeam ~= Spring.GetLocalAllyTeamID() or fullview ~= select(2, spGetSpectatingState()) then + myAllyTeam = Spring.GetLocalAllyTeamID() spec, fullview = spGetSpectatingState() init() end diff --git a/luaui/Widgets/gui_buildbar.lua b/luaui/Widgets/gui_buildbar.lua index 74e42b4ea1c..af8b3944768 100644 --- a/luaui/Widgets/gui_buildbar.lua +++ b/luaui/Widgets/gui_buildbar.lua @@ -18,7 +18,7 @@ local mathFloor = math.floor -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGiveOrderToUnit = Spring.GiveOrderToUnit local spGetViewGeometry = Spring.GetViewGeometry local spGetSpectatingState = Spring.GetSpectatingState diff --git a/luaui/Widgets/gui_buildmenu.lua b/luaui/Widgets/gui_buildmenu.lua index 3a47dcd0be3..82d6ed36fc1 100644 --- a/luaui/Widgets/gui_buildmenu.lua +++ b/luaui/Widgets/gui_buildmenu.lua @@ -20,7 +20,7 @@ local mathMax = math.max -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame local spGetGameSeconds = Spring.GetGameSeconds -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetViewGeometry = Spring.GetViewGeometry local spGetSpectatingState = Spring.GetSpectatingState diff --git a/luaui/Widgets/gui_center_n_select.lua b/luaui/Widgets/gui_center_n_select.lua index f5f8125e232..c4bea44073b 100644 --- a/luaui/Widgets/gui_center_n_select.lua +++ b/luaui/Widgets/gui_center_n_select.lua @@ -22,13 +22,13 @@ local go = true function widget:Update() local t = Spring.GetGameSeconds() - local isSpec = select(3, Spring.GetPlayerInfo(Spring.GetMyPlayerID(), false)) + local isSpec = select(3, Spring.GetPlayerInfo(Spring.GetLocalPlayerID(), false)) if isSpec or t > 10 then widgetHandler:RemoveWidget() return end if t > 0 then - local unitArray = Spring.GetTeamUnits(Spring.GetMyTeamID()) + local unitArray = Spring.GetTeamUnits(Spring.GetLocalTeamID()) if go and unitArray[1] then local x, y, z = Spring.GetUnitPosition(unitArray[1]) Spring.SetCameraTarget(x, y, z) diff --git a/luaui/Widgets/gui_chat.lua b/luaui/Widgets/gui_chat.lua index d165679bf27..67d8107982a 100644 --- a/luaui/Widgets/gui_chat.lua +++ b/luaui/Widgets/gui_chat.lua @@ -21,7 +21,7 @@ local mathFloor = math.floor local mathMin = math.min -- Localized Spring API for performance -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetMouseState = Spring.GetMouseState local spEcho = Spring.Echo local spGetSpectatingState = Spring.GetSpectatingState @@ -144,10 +144,10 @@ local state = { lastUnitShare = nil, lastLineUnitShare = nil, lastDrawUiUpdate = os.clock(), - myName = Spring.GetPlayerInfo(Spring.GetMyPlayerID(), false), + myName = Spring.GetPlayerInfo(Spring.GetLocalPlayerID(), false), mySpec = spGetSpectatingState(), myTeamID = spGetMyTeamID(), - myAllyTeamID = Spring.GetMyAllyTeamID(), + myAllyTeamID = Spring.GetLocalAllyTeamID(), font = nil, font2 = nil, font3 = nil, @@ -2649,7 +2649,7 @@ end function widget:PlayerChanged(playerID) mySpec = spGetSpectatingState() myTeamID = spGetMyTeamID() - myAllyTeamID = Spring.GetMyAllyTeamID() + myAllyTeamID = Spring.GetLocalAllyTeamID() if mySpec and inputMode == "a:" then inputMode = "s:" end @@ -2783,7 +2783,7 @@ function widget:Initialize() end widget:ViewResize() - widget:PlayerChanged(Spring.GetMyPlayerID()) + widget:PlayerChanged(Spring.GetLocalPlayerID()) Spring.SendCommands("console 0") diff --git a/luaui/Widgets/gui_com_nametags.lua b/luaui/Widgets/gui_com_nametags.lua index 5bb6c51dc38..2071aea1911 100644 --- a/luaui/Widgets/gui_com_nametags.lua +++ b/luaui/Widgets/gui_com_nametags.lua @@ -14,7 +14,7 @@ end -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetViewGeometry = Spring.GetViewGeometry local spWorldToScreenCoords = Spring.WorldToScreenCoords local spGetSpectatingState = Spring.GetSpectatingState diff --git a/luaui/Widgets/gui_commanderhurt.lua b/luaui/Widgets/gui_commanderhurt.lua index 34986e30e3f..5dab0e7af05 100644 --- a/luaui/Widgets/gui_commanderhurt.lua +++ b/luaui/Widgets/gui_commanderhurt.lua @@ -14,7 +14,7 @@ end -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetSpectatingState = Spring.GetSpectatingState --------------------------------------------------------------------------------------------------- diff --git a/luaui/Widgets/gui_commands_fx.lua b/luaui/Widgets/gui_commands_fx.lua index ed2a6557f7c..b74ef135d55 100644 --- a/luaui/Widgets/gui_commands_fx.lua +++ b/luaui/Widgets/gui_commands_fx.lua @@ -16,7 +16,7 @@ end local mathMax = math.max -- Localized Spring API for performance -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetSpectatingState = Spring.GetSpectatingState -- future: hotkey to show all current cmds? (like current shift+space) diff --git a/luaui/Widgets/gui_converter_usage.lua b/luaui/Widgets/gui_converter_usage.lua index da08bf0012f..c965e3dab83 100644 --- a/luaui/Widgets/gui_converter_usage.lua +++ b/luaui/Widgets/gui_converter_usage.lua @@ -24,7 +24,7 @@ local RectRound, UiElement local dlistGuishader, dlistCU local area = { 0, 0, 0, 0 } -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetTeamRulesParam = Spring.GetTeamRulesParam local glCreateList = gl.CreateList diff --git a/luaui/Widgets/gui_defenserange_gl4.lua b/luaui/Widgets/gui_defenserange_gl4.lua index 14f6b484e0b..3ddce71dee6 100644 --- a/luaui/Widgets/gui_defenserange_gl4.lua +++ b/luaui/Widgets/gui_defenserange_gl4.lua @@ -404,7 +404,7 @@ end local spGetSpectatingState = Spring.GetSpectatingState local spec, fullview = spGetSpectatingState() -local myAllyTeam = Spring.GetMyAllyTeamID() +local myAllyTeam = Spring.GetLocalAllyTeamID() local numallyteams = 2 local defenses = {} -- table of unitID keys to info tables: @@ -595,7 +595,7 @@ function widget:Initialize() end end end - myAllyTeam = Spring.GetMyAllyTeamID() + myAllyTeam = Spring.GetLocalAllyTeamID() local allyteamlist = Spring.GetAllyTeamList() --spEcho("# of allyteams = ", #allyteamlist) numallyteams = #allyteamlist @@ -790,7 +790,7 @@ function widget:PlayerChanged(playerID) ]] -- local nowspec, nowfullview = spGetSpectatingState() - local nowmyAllyTeam = Spring.GetMyAllyTeamID() + local nowmyAllyTeam = Spring.GetLocalAllyTeamID() -- When we start, check if there are >2 allyteams local reinit = false -- check spec transition @@ -841,7 +841,7 @@ function widget:Update(dt) --end -- detect if our “myAllyTeam” has changed (e.g. a spec following a different player) - local currentAllyTeam = Spring.GetMyAllyTeamID() + local currentAllyTeam = Spring.GetLocalAllyTeamID() if currentAllyTeam ~= myAllyTeam then myAllyTeam = currentAllyTeam -- clear out all the old rings diff --git a/luaui/Widgets/gui_ecostats.lua b/luaui/Widgets/gui_ecostats.lua index d2b1739c42e..deaf0a83722 100644 --- a/luaui/Widgets/gui_ecostats.lua +++ b/luaui/Widgets/gui_ecostats.lua @@ -33,21 +33,21 @@ local osClock = os.clock -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spEcho = Spring.Echo local spGetSpectatingState = Spring.GetSpectatingState local spGetTeamUnitsByDefs = Spring.GetTeamUnitsByDefs local spGetGameSeconds = Spring.GetGameSeconds local spGetGameSpeed = Spring.GetGameSpeed local spGetTeamUnitCount = Spring.GetTeamUnitCount -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetMyAllyTeamID = Spring.GetLocalAllyTeamID local spGetTeamList = Spring.GetTeamList local spGetTeamInfo = Spring.GetTeamInfo local spGetPlayerInfo = Spring.GetPlayerInfo local spGetTeamColor = Spring.GetTeamColor local spGetTeamResources = Spring.GetTeamResources local spGetUnitResources = Spring.GetUnitResources -local spGetMyPlayerID = Spring.GetMyPlayerID +local spGetMyPlayerID = Spring.GetLocalPlayerID local spGetGaiaTeamID = Spring.GetGaiaTeamID local spGetAllyTeamList = Spring.GetAllyTeamList local spIsReplay = Spring.IsReplay diff --git a/luaui/Widgets/gui_emp_decloak_range.lua b/luaui/Widgets/gui_emp_decloak_range.lua index e0fa14683de..912bd54a7c6 100644 --- a/luaui/Widgets/gui_emp_decloak_range.lua +++ b/luaui/Widgets/gui_emp_decloak_range.lua @@ -200,7 +200,7 @@ function widget:RecvLuaMsg(msg) end function widget:PlayerChanged(playerID) - local prevTeam, prevFull = Spring.GetMyTeamID(), fullview + local prevTeam, prevFull = Spring.GetLocalTeamID(), fullview spec, fullview = spGetSpectatingState() if fullview ~= prevFull then widget:Initialize() diff --git a/luaui/Widgets/gui_enemy_spotter.lua b/luaui/Widgets/gui_enemy_spotter.lua index 863d34e7beb..27a84e26884 100644 --- a/luaui/Widgets/gui_enemy_spotter.lua +++ b/luaui/Widgets/gui_enemy_spotter.lua @@ -36,7 +36,7 @@ local GL_POINTS = GL.POINTS local spGetUnitAllyTeam = Spring.GetUnitAllyTeam -local myAllyTeamID = Spring.GetMyAllyTeamID() +local myAllyTeamID = Spring.GetLocalAllyTeamID() local gaiaTeamID = Spring.GetGaiaTeamID() local unitScale = {} @@ -175,7 +175,7 @@ local function init() end function widget:PlayerChanged(playerID) - myAllyTeamID = Spring.GetMyAllyTeamID() + myAllyTeamID = Spring.GetLocalAllyTeamID() widget:VisibleUnitsChanged(WG["unittrackerapi"].visibleUnits, nil) end diff --git a/luaui/Widgets/gui_factionpicker.lua b/luaui/Widgets/gui_factionpicker.lua index 7bff8809771..c394ebfbe25 100644 --- a/luaui/Widgets/gui_factionpicker.lua +++ b/luaui/Widgets/gui_factionpicker.lua @@ -30,7 +30,7 @@ local height = 0 local bgBorderOrg = 0.003 local bgBorder = bgBorderOrg -local myTeamID = Spring.GetMyTeamID() +local myTeamID = Spring.GetLocalTeamID() local stickToBottom = true local startDefID = Spring.GetTeamRulesParam(myTeamID, "startUnit") diff --git a/luaui/Widgets/gui_flanking_icons.lua b/luaui/Widgets/gui_flanking_icons.lua index bf59594fec8..383804b8ba4 100644 --- a/luaui/Widgets/gui_flanking_icons.lua +++ b/luaui/Widgets/gui_flanking_icons.lua @@ -37,7 +37,7 @@ for unitDefID, unitDef in pairs(UnitDefs) do end local spec, fullview = spGetSpectatingState() -local allyTeamID = Spring.GetMyAllyTeamID() +local allyTeamID = Spring.GetLocalAllyTeamID() local spGetUnitTeam = Spring.GetUnitTeam local spGetUnitRadius = Spring.GetUnitRadius @@ -171,7 +171,7 @@ function widget:PlayerChanged() local prevFullview = fullview local myPrevAllyTeamID = allyTeamID spec, fullview = spGetSpectatingState() - allyTeamID = Spring.GetMyAllyTeamID() + allyTeamID = Spring.GetLocalAllyTeamID() if fullview ~= prevFullview or allyTeamID ~= myPrevAllyTeamID then InstanceVBOTable.clearInstanceTable(flankingVBO) init() diff --git a/luaui/Widgets/gui_geothermalspots.lua b/luaui/Widgets/gui_geothermalspots.lua index 87aa1908982..645ff7a3083 100644 --- a/luaui/Widgets/gui_geothermalspots.lua +++ b/luaui/Widgets/gui_geothermalspots.lua @@ -42,7 +42,7 @@ local checkspots = true local sceduledCheckedSpotsFrame = spGetGameFrame() local isSpec, fullview = spGetSpectatingState() -local myAllyTeamID = Spring.GetMyAllyTeamID() +local myAllyTeamID = Spring.GetLocalAllyTeamID() local chobbyInterface @@ -467,7 +467,7 @@ function widget:PlayerChanged(playerID) local prevFullview = fullview local prevMyAllyTeamID = myAllyTeamID isSpec, fullview = spGetSpectatingState() - myAllyTeamID = Spring.GetMyAllyTeamID() + myAllyTeamID = Spring.GetLocalAllyTeamID() if fullview ~= prevFullview or myAllyTeamID ~= prevMyAllyTeamID then checkGeothermalspots() end diff --git a/luaui/Widgets/gui_gridmenu.lua b/luaui/Widgets/gui_gridmenu.lua index 334a0c163fc..9f2a05ce83a 100644 --- a/luaui/Widgets/gui_gridmenu.lua +++ b/luaui/Widgets/gui_gridmenu.lua @@ -1265,7 +1265,7 @@ function widget:Initialize() widgetHandler:DisableWidgetRaw("Build menu") end - myTeamID = Spring.GetMyTeamID() + myTeamID = Spring.GetLocalTeamID() isSpec = Spring.GetSpectatingState() isPregame = Spring.GetGameFrame() == 0 and not isSpec @@ -2721,7 +2721,7 @@ end function widget:PlayerChanged() isSpec = Spring.GetSpectatingState() - myTeamID = Spring.GetMyTeamID() + myTeamID = Spring.GetLocalTeamID() end function widget:GetConfigData() diff --git a/luaui/Widgets/gui_ground_ao_plates_features_gl4.lua b/luaui/Widgets/gui_ground_ao_plates_features_gl4.lua index 8e95f5001c3..1e369ce27e2 100644 --- a/luaui/Widgets/gui_ground_ao_plates_features_gl4.lua +++ b/luaui/Widgets/gui_ground_ao_plates_features_gl4.lua @@ -268,13 +268,13 @@ function widget:Initialize() end local spec, fullview = spGetSpectatingState() -local allyTeamID = Spring.GetMyAllyTeamID() +local allyTeamID = Spring.GetLocalAllyTeamID() function widget:PlayerChanged() local prevFullview = fullview local myPrevAllyTeamID = allyTeamID spec, fullview = spGetSpectatingState() - allyTeamID = Spring.GetMyAllyTeamID() + allyTeamID = Spring.GetLocalAllyTeamID() end local commandqueue = {} diff --git a/luaui/Widgets/gui_healthbars_gl4.lua b/luaui/Widgets/gui_healthbars_gl4.lua index 2e1c0900bd8..d99d80766f7 100644 --- a/luaui/Widgets/gui_healthbars_gl4.lua +++ b/luaui/Widgets/gui_healthbars_gl4.lua @@ -359,7 +359,7 @@ end -------------------------------------------------------------------------------- local spec, fullview = spGetSpectatingState() -local myAllyTeamID = Spring.GetMyAllyTeamID() +local myAllyTeamID = Spring.GetLocalAllyTeamID() local GetUnitWeaponState = Spring.GetUnitWeaponState local chobbyInterface @@ -1139,7 +1139,7 @@ function widget:VisibleUnitsChanged(extVisibleUnits, extNumVisibleUnits) unitStockPileWatch = {} unitReloadWatch = {} spec, fullview = spGetSpectatingState() - myAllyTeamID = Spring.GetMyAllyTeamID() + myAllyTeamID = Spring.GetLocalAllyTeamID() InstanceVBOTable.clearInstanceTable(healthBarVBO) -- clear all instances for unitID, unitDefID in pairs(extVisibleUnits) do @@ -1150,9 +1150,9 @@ end function widget:PlayerChanged(playerID) local currentspec, currentfullview = spGetSpectatingState() - local currentTeamID = Spring.GetMyTeamID() - local currentAllyTeamID = Spring.GetMyAllyTeamID() - local currentPlayerID = Spring.GetMyPlayerID() + local currentTeamID = Spring.GetLocalTeamID() + local currentAllyTeamID = Spring.GetLocalAllyTeamID() + local currentPlayerID = Spring.GetLocalPlayerID() local reinit = false if debugmode then diff --git a/luaui/Widgets/gui_idle_builders.lua b/luaui/Widgets/gui_idle_builders.lua index 434c362a016..7008b83759c 100644 --- a/luaui/Widgets/gui_idle_builders.lua +++ b/luaui/Widgets/gui_idle_builders.lua @@ -18,7 +18,7 @@ local mathMax = math.max -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetViewGeometry = Spring.GetViewGeometry local spGetSpectatingState = Spring.GetSpectatingState @@ -50,7 +50,7 @@ local spGetUnitIsBeingBuilt = Spring.GetUnitIsBeingBuilt local spGetMouseState = Spring.GetMouseState local spGetUnitCommandCount = Spring.GetUnitCommandCount local spGetFactoryCommandCount = Spring.GetFactoryCommandCount -local myTeamID = Spring.GetMyTeamID() +local myTeamID = Spring.GetLocalTeamID() local floor = mathFloor local ceil = math.ceil diff --git a/luaui/Widgets/gui_info.lua b/luaui/Widgets/gui_info.lua index b13dfd98d22..8410d5f2a48 100644 --- a/luaui/Widgets/gui_info.lua +++ b/luaui/Widgets/gui_info.lua @@ -104,7 +104,7 @@ local string_lines = string.lines local os_clock = os.clock -local myTeamID = Spring.GetMyTeamID() +local myTeamID = Spring.GetLocalTeamID() local mySpec = Spring.GetSpectatingState() local GL_QUADS = GL.QUADS @@ -637,7 +637,7 @@ local function checkGuishader(force) end function widget:PlayerChanged(playerID) - myTeamID = Spring.GetMyTeamID() + myTeamID = Spring.GetLocalTeamID() mySpec = Spring.GetSpectatingState() end diff --git a/luaui/Widgets/gui_infolos.lua b/luaui/Widgets/gui_infolos.lua index 0a847ff0257..e1d0f5e085d 100644 --- a/luaui/Widgets/gui_infolos.lua +++ b/luaui/Widgets/gui_infolos.lua @@ -163,7 +163,7 @@ local function UpdateInfoLOSTexture(count) end function widget:PlayerChanged(playerID) - local newAllyTeam = Spring.GetMyAllyTeamID() + local newAllyTeam = Spring.GetLocalAllyTeamID() if currentAllyTeam ~= newAllyTeam then -- do a few quick renders currentAllyTeam = newAllyTeam updateInfoLOSTexture = numFastUpdates @@ -188,7 +188,7 @@ function widget:Initialize() shaderConfig[name .. "XSIZE"] = texInfo.xsize shaderConfig[name .. "YSIZE"] = texInfo.ysize end - currentAllyTeam = Spring.GetMyAllyTeamID() + currentAllyTeam = Spring.GetLocalAllyTeamID() for _, a in ipairs(Spring.GetAllyTeamList()) do infoTextures[a] = CreateLosTexture() diff --git a/luaui/Widgets/gui_los_view_gl4.lua b/luaui/Widgets/gui_los_view_gl4.lua index 3e5ee62e40f..5b21bca8d08 100644 --- a/luaui/Widgets/gui_los_view_gl4.lua +++ b/luaui/Widgets/gui_los_view_gl4.lua @@ -61,7 +61,7 @@ local losViewShaderSourceCache = { } function widget:PlayerChanged(playerID) - currentAllyTeam = Spring.GetMyAllyTeamID() + currentAllyTeam = Spring.GetLocalAllyTeamID() end function widget:ViewResize() diff --git a/luaui/Widgets/gui_mapmarks_fx.lua b/luaui/Widgets/gui_mapmarks_fx.lua index ed4725b639b..8e5e599a586 100644 --- a/luaui/Widgets/gui_mapmarks_fx.lua +++ b/luaui/Widgets/gui_mapmarks_fx.lua @@ -39,7 +39,7 @@ local commands = {} local mapDrawNicknameTime = {} local mapEraseNicknameTime = {} -local ownPlayerID = Spring.GetMyPlayerID() +local ownPlayerID = Spring.GetLocalPlayerID() local vsx, vsy = spGetViewGeometry() local commandCount = 0 diff --git a/luaui/Widgets/gui_metalspots.lua b/luaui/Widgets/gui_metalspots.lua index a4fe79cb224..7706ffa72dd 100644 --- a/luaui/Widgets/gui_metalspots.lua +++ b/luaui/Widgets/gui_metalspots.lua @@ -24,7 +24,7 @@ local stringFind = string.find -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spEcho = Spring.Echo local spGetSpectatingState = Spring.GetSpectatingState @@ -86,7 +86,7 @@ local checkspots = true local sceduledCheckedSpotsFrame = spGetGameFrame() local isSpec, fullview = spGetSpectatingState() -local myAllyTeamID = Spring.GetMyAllyTeamID() +local myAllyTeamID = Spring.GetLocalAllyTeamID() local incomeMultiplier = select(7, Spring.GetTeamInfo(spGetMyTeamID(), false)) local fontfile = "fonts/" .. Spring.GetConfigString("bar_font2", "Exo2-SemiBold.otf") @@ -605,7 +605,7 @@ function widget:PlayerChanged(playerID) local prevFullview = fullview local prevMyAllyTeamID = myAllyTeamID isSpec, fullview = spGetSpectatingState() - myAllyTeamID = Spring.GetMyAllyTeamID() + myAllyTeamID = Spring.GetLocalAllyTeamID() local oldIncomeMultiplier = incomeMultiplier incomeMultiplier = select(7, Spring.GetTeamInfo(spGetMyTeamID(), false)) if incomeMultiplier ~= oldIncomeMultiplier then diff --git a/luaui/Widgets/gui_options.lua b/luaui/Widgets/gui_options.lua index 67ffe9f5a21..83a5334f1d1 100644 --- a/luaui/Widgets/gui_options.lua +++ b/luaui/Widgets/gui_options.lua @@ -289,10 +289,10 @@ if not startScript then [player0] { team=0; - name=]] .. select(1, Spring.GetPlayerInfo(Spring.GetMyPlayerID())) .. [[; + name=]] .. select(1, Spring.GetPlayerInfo(Spring.GetLocalPlayerID())) .. [[; } mapname=]] .. Game.mapName .. [[; - myplayername=]] .. select(1, Spring.GetPlayerInfo(Spring.GetMyPlayerID())) .. [[; + myplayername=]] .. select(1, Spring.GetPlayerInfo(Spring.GetLocalPlayerID())) .. [[; ishost=1; gametype=]] .. Game.gameName .. " " .. Game.gameVersion .. [[; nohelperais=0; diff --git a/luaui/Widgets/gui_pip.lua b/luaui/Widgets/gui_pip.lua index 2b5db43c374..ad31c32f25c 100644 --- a/luaui/Widgets/gui_pip.lua +++ b/luaui/Widgets/gui_pip.lua @@ -2345,7 +2345,7 @@ local buttons = { state.losViewEnabled = not state.losViewEnabled if state.losViewEnabled then -- Store the current allyteam when enabling LOS view - state.losViewAllyTeam = Spring.GetMyAllyTeamID() + state.losViewAllyTeam = Spring.GetLocalAllyTeamID() -- Immediately scan enemy buildings the viewed allyteam knows about -- Only include buildings the allyteam has seen (LOS_INLOS or LOS_PREVLOS) if cameraState.mySpecState then @@ -2399,11 +2399,11 @@ local buttons = { interactionState.trackingPlayerID = nil pipR2T.frameNeedsUpdate = true else - local _, _, isSpec = spFunc.GetPlayerInfo(Spring.GetMyPlayerID(), false) + local _, _, isSpec = spFunc.GetPlayerInfo(Spring.GetLocalPlayerID(), false) if isSpec then -- Spectator: Track team leader (keep existing behavior) - local myTeamID = Spring.GetMyTeamID() + local myTeamID = Spring.GetLocalTeamID() local targetPlayerID = nil -- Get the team leader's player ID from team info @@ -2411,7 +2411,7 @@ local buttons = { -- Verify this player is active and not self if leaderPlayerID then - local myPlayerID = Spring.GetMyPlayerID() + local myPlayerID = Spring.GetLocalPlayerID() if leaderPlayerID ~= myPlayerID then local name, active = spFunc.GetPlayerInfo(leaderPlayerID, false) if name and active then @@ -2445,7 +2445,7 @@ local buttons = { local targetPlayerID = teammates[currentIndex] -- Double-check we're not tracking ourselves - if targetPlayerID ~= Spring.GetMyPlayerID() then + if targetPlayerID ~= Spring.GetLocalPlayerID() then interactionState.trackingPlayerID = targetPlayerID interactionState.lastTrackedTeammate = targetPlayerID -- Clear unit tracking when starting player tracking @@ -5021,7 +5021,7 @@ local function GetAliveTeammates(out) out[i] = nil end - local myPlayerID = Spring.GetMyPlayerID() + local myPlayerID = Spring.GetLocalPlayerID() local _, _, _, myTeamID = spFunc.GetPlayerInfo(myPlayerID, false) if not myTeamID then return out @@ -7388,7 +7388,7 @@ end local function FindMyCommander() -- Find the player's starting commander unit - local myTeamID = Spring.GetMyTeamID() + local myTeamID = Spring.GetLocalTeamID() if not myTeamID then return nil end @@ -8377,7 +8377,7 @@ function widget:Initialize() end gameHasStarted = (Spring.GetGameFrame() > 0) - miscState.startX, _, miscState.startZ = Spring.GetTeamStartPosition(Spring.GetMyTeamID()) + miscState.startX, _, miscState.startZ = Spring.GetTeamStartPosition(Spring.GetLocalTeamID()) -- Initialize GL4 instanced icon rendering (after cache is built so unitIcon data is available) InitGL4Icons() @@ -8422,12 +8422,12 @@ function widget:Initialize() local initScanAllyTeam = nil local initScanIsSpec, initScanFullview = Spring.GetSpectatingState() if not initScanIsSpec then - initScanAllyTeam = Spring.GetMyAllyTeamID() + initScanAllyTeam = Spring.GetLocalAllyTeamID() elseif state.losViewEnabled and state.losViewAllyTeam then initScanAllyTeam = state.losViewAllyTeam elseif initScanIsSpec and not initScanFullview then -- Spectator without fullview: scan ghosts from their allyteam's perspective - initScanAllyTeam = Spring.GetMyAllyTeamID() + initScanAllyTeam = Spring.GetLocalAllyTeamID() end if initScanAllyTeam then local allUnits = Spring.GetAllUnits() @@ -8557,7 +8557,7 @@ function widget:Initialize() WG["pip" .. pipNumber].TrackPlayer = function(playerID) if playerID and type(playerID) == "number" then -- Prevent tracking yourself - local myPlayerID = Spring.GetMyPlayerID() + local myPlayerID = Spring.GetLocalPlayerID() if playerID == myPlayerID then return false end @@ -9776,7 +9776,7 @@ local function DrawCommandFXOverlay() elseif not cameraState.mySpecState then useCommandColors = true -- player viewing own ally commands end - local myTeamID = not useCommandColors and Spring.GetMyTeamID() or nil + local myTeamID = not useCommandColors and Spring.GetLocalTeamID() or nil if useGL4 then gl4Prim.normLines.count = 0 @@ -12131,7 +12131,7 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) -- Draw start unit icon before game starts (when commander is not yet placed) if not gameHasStarted and not isMinimapMode and miscState.startX and miscState.startX >= 0 then - local myTeamID = Spring.GetMyTeamID() + local myTeamID = Spring.GetLocalTeamID() local startDefID = Spring.GetTeamRulesParam(myTeamID, "startUnit") if startDefID and cacheUnitIcon[startDefID] then local iconData = cacheUnitIcon[startDefID] @@ -12212,7 +12212,7 @@ local function DrawUnitsAndFeatures(cachedSelectedUnits) -- Pre-compute per-frame visibility context (avoids redundant API calls per unit) local checkAllyTeamID = nil local _, fullview = Spring.GetSpectatingState() - local myAllyTeam = Spring.GetMyAllyTeamID() + local myAllyTeam = Spring.GetLocalAllyTeamID() if interactionState.trackingPlayerID and cameraState.mySpecState then local _, _, _, playerTeamID = spFunc.GetPlayerInfo(interactionState.trackingPlayerID, false) if playerTeamID then @@ -12226,7 +12226,7 @@ local function DrawUnitsAndFeatures(cachedSelectedUnits) elseif state.losViewEnabled and state.losViewAllyTeam then checkAllyTeamID = state.losViewAllyTeam elseif not cameraState.mySpecState then - local myTeamID = Spring.GetMyTeamID() + local myTeamID = Spring.GetLocalTeamID() checkAllyTeamID = teamAllyTeamCache[myTeamID] or Spring.GetTeamAllyTeamID(myTeamID) elseif cameraState.mySpecState then if not fullview then @@ -13202,7 +13202,7 @@ end -- Helper function to render PIP contents (units, features, ground, command queues) -- Helper function to determine if LOS overlay should be shown and which allyteam to use local function ShouldShowLOS() - local myAllyTeam = Spring.GetMyAllyTeamID() + local myAllyTeam = Spring.GetLocalAllyTeamID() local mySpec, fullview = Spring.GetSpectatingState() -- If tracking a player's camera, use their allyteam (priority over LOS view) @@ -14608,7 +14608,7 @@ local function RenderPipContents() -- Blit map ruler AFTER rotation pop so marks stay at screen edges -- The ruler texture already maps world coordinates for the current rotation angle if uiState.drawingGround and config.showMapRuler then - local _, _, spec = spFunc.GetPlayerInfo(Spring.GetMyPlayerID(), false) + local _, _, spec = spFunc.GetPlayerInfo(Spring.GetLocalPlayerID(), false) if not spec then BlitMapRuler() end @@ -15222,7 +15222,7 @@ local function DrawTrackedPlayerMinimap() playerName, active, isSpec, teamID = spFunc.GetPlayerInfo(interactionState.trackingPlayerID, false) else -- Use local player's team - teamID = Spring.GetMyTeamID() + teamID = Spring.GetLocalTeamID() end if not teamID then interactionState.pipMinimapBounds = nil @@ -16287,7 +16287,7 @@ local function UpdateLOSTexture(currentTime) return end - local myAllyTeam = Spring.GetMyAllyTeamID() + local myAllyTeam = Spring.GetLocalAllyTeamID() -- Can only use engine LOS if: -- 1. Same allyteam as us -- 2. If tracking a player, must have fullview enabled (engine LOS requires fullview for enemy teams) @@ -16662,13 +16662,13 @@ local function DrawInteractiveOverlays(mx, my, usedButtonSize) visibleButtons[#visibleButtons + 1] = btn end elseif btn.command == "pip_trackplayer" then - local _, _, spec = spFunc.GetPlayerInfo(Spring.GetMyPlayerID(), false) + local _, _, spec = spFunc.GetPlayerInfo(Spring.GetLocalPlayerID(), false) local aliveTeammates = GetAliveTeammates(pools.aliveTeammates) if (interactionState.trackingPlayerID or spec or (#aliveTeammates > 0)) and not miscState.tvEnabled then visibleButtons[#visibleButtons + 1] = btn end elseif btn.command == "pip_view" then - local _, _, spec = spFunc.GetPlayerInfo(Spring.GetMyPlayerID(), false) + local _, _, spec = spFunc.GetPlayerInfo(Spring.GetLocalPlayerID(), false) if spec then visibleButtons[#visibleButtons + 1] = btn end @@ -17234,7 +17234,7 @@ function widget:DrawScreen() -- Blit map ruler directly to screen (not in oversized texture — rulers are edge-fixed) if uiState.drawingGround and config.showMapRuler then - local _, _, spec = spFunc.GetPlayerInfo(Spring.GetMyPlayerID(), false) + local _, _, spec = spFunc.GetPlayerInfo(Spring.GetLocalPlayerID(), false) if not spec then UpdateMapRulerTexture() if pipR2T.rulerTex then @@ -17834,7 +17834,7 @@ function widget:Update(dt) -- my base, no enemies in victory screen"). local cleanupAllyTeam if not cameraState.mySpecState then - cleanupAllyTeam = Spring.GetMyAllyTeamID() + cleanupAllyTeam = Spring.GetLocalAllyTeamID() elseif state.losViewEnabled and state.losViewAllyTeam then cleanupAllyTeam = state.losViewAllyTeam end @@ -18161,7 +18161,7 @@ function widget:Update(dt) if now - miscState.specGhostScanTime >= 2.0 then miscState.specGhostScanTime = now -- Use losViewAllyTeam when LOS view is active, otherwise GetMyAllyTeamID() - local scanAllyTeam = (state.losViewEnabled and state.losViewAllyTeam) or Spring.GetMyAllyTeamID() + local scanAllyTeam = (state.losViewEnabled and state.losViewAllyTeam) or Spring.GetLocalAllyTeamID() -- Mark all existing ghosts for sweep local stale = {} for gID in pairs(ghostBuildings) do @@ -18930,7 +18930,7 @@ function widget:Update(dt) -- Don't do this in minimap mode - the minimap should show the full map local isSpec = Spring.GetSpectatingState() if not isSpec and not interactionState.trackingPlayerID then - local newX, _, newZ = Spring.GetTeamStartPosition(Spring.GetMyTeamID()) + local newX, _, newZ = Spring.GetTeamStartPosition(Spring.GetLocalTeamID()) if newX ~= miscState.startX then miscState.startX, miscState.startZ = newX, newZ -- Apply map margin limits to start position @@ -19017,7 +19017,7 @@ function widget:UnitSeismicPing(x, y, z, strength, allyTeam, unitID, unitDefID) return end - local myAllyTeam = Spring.GetMyAllyTeamID() + local myAllyTeam = Spring.GetLocalAllyTeamID() local spec, fullview = Spring.GetSpectatingState() local unitAllyTeam = unitID and Spring.GetUnitAllyTeam(unitID) or allyTeam @@ -19436,14 +19436,14 @@ function widget:UnitCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOp else local _, fullview = Spring.GetSpectatingState() if not fullview then - viewAllyTeam = Spring.GetMyAllyTeamID() + viewAllyTeam = Spring.GetLocalAllyTeamID() end end if viewAllyTeam and unitAllyTeam ~= viewAllyTeam then return end else - local myAllyTeam = Spring.GetMyAllyTeamID() + local myAllyTeam = Spring.GetLocalAllyTeamID() if unitAllyTeam ~= myAllyTeam then return end @@ -19551,7 +19551,7 @@ function widget:UnitFinished(unitID, unitDefID, unitTeam) -- Catches buildings built outside the PIP viewport while fullview is ON -- Only ghost buildings the viewed allyteam has actually seen (PREVLOS or INLOS) if cameraState.mySpecState and cache.isBuilding[unitDefID] then - local myAllyTeam = Spring.GetMyAllyTeamID() + local myAllyTeam = Spring.GetLocalAllyTeamID() local uAllyTeam = Spring.GetTeamAllyTeamID(unitTeam) if uAllyTeam ~= myAllyTeam then local losBits = Spring.GetUnitLosState(unitID, myAllyTeam, true) @@ -19888,7 +19888,7 @@ function widget:MapDrawCmd(playerID, cmdType, mx, my, mz, a, b, c) if triggerFocus and config.activityFocusHideForSpectators and cameraState.mySpecState then triggerFocus = false end - if triggerFocus and playerID == Spring.GetMyPlayerID() then + if triggerFocus and playerID == Spring.GetLocalPlayerID() then triggerFocus = false end if triggerFocus and isSpec and config.activityFocusIgnoreSpectators then @@ -19978,7 +19978,7 @@ function widget:MapDrawCmd(playerID, cmdType, mx, my, mz, a, b, c) end -- Only process our own mapmarks for placement logic (not from other players) - local myPlayerID = Spring.GetMyPlayerID() + local myPlayerID = Spring.GetLocalPlayerID() if playerID ~= myPlayerID then return false end @@ -20594,7 +20594,7 @@ function widget:MousePress(mx, my, mButton) -- Show player tracking button when tracking, when spectating, or when having alive teammates local showPlayerTrackButton = isTrackingPlayer if not showPlayerTrackButton then - local _, _, spec = spFunc.GetPlayerInfo(Spring.GetMyPlayerID(), false) + local _, _, spec = spFunc.GetPlayerInfo(Spring.GetLocalPlayerID(), false) local aliveTeammates = GetAliveTeammates() showPlayerTrackButton = spec or (#aliveTeammates > 0) end @@ -20634,7 +20634,7 @@ function widget:MousePress(mx, my, mButton) end -- Show pip_view button only for spectators elseif btn.command == "pip_view" then - local _, _, spec = spFunc.GetPlayerInfo(Spring.GetMyPlayerID(), false) + local _, _, spec = spFunc.GetPlayerInfo(Spring.GetLocalPlayerID(), false) if spec then visibleButtons[#visibleButtons + 1] = btn end diff --git a/luaui/Widgets/gui_point_tracker.lua b/luaui/Widgets/gui_point_tracker.lua index 522bb639bcf..2253f026560 100644 --- a/luaui/Widgets/gui_point_tracker.lua +++ b/luaui/Widgets/gui_point_tracker.lua @@ -329,7 +329,7 @@ function widget:Initialize() return end initGL4() - myPlayerID = Spring.GetMyPlayerID() + myPlayerID = Spring.GetLocalPlayerID() WG.PointTracker = { ClearPoints = ClearPoints, } diff --git a/luaui/Widgets/gui_pregame_build.lua b/luaui/Widgets/gui_pregame_build.lua index f4657ab2e46..9786435b142 100644 --- a/luaui/Widgets/gui_pregame_build.lua +++ b/luaui/Widgets/gui_pregame_build.lua @@ -25,7 +25,7 @@ local tableRemove = table.remove -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetMouseState = Spring.GetMouseState local spTraceScreenRay = Spring.TraceScreenRay local spGetGroundHeight = Spring.GetGroundHeight @@ -1406,7 +1406,7 @@ function widget:GameFrame(n) local uID = units[u] if GetUnitCanCompleteQueue(uID) then tasker = uID - if Spring.GetUnitRulesParam(uID, "startingOwner") == Spring.GetMyPlayerID() then + if Spring.GetUnitRulesParam(uID, "startingOwner") == Spring.GetLocalPlayerID() then -- we found our com even if cooping, assigning queue to this particular unit break end diff --git a/luaui/Widgets/gui_pregameui.lua b/luaui/Widgets/gui_pregameui.lua index ce7913eb93c..3a1d82ecf75 100644 --- a/luaui/Widgets/gui_pregameui.lua +++ b/luaui/Widgets/gui_pregameui.lua @@ -26,7 +26,7 @@ local draftMode = Spring.GetModOptions().draft_mode local vsx, vsy = spGetViewGeometry() local uiScale = (0.7 + (vsx * vsy / 6500000)) -local myPlayerID = Spring.GetMyPlayerID() +local myPlayerID = Spring.GetLocalPlayerID() 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() @@ -180,7 +180,7 @@ function widget:GameSetup(state, ready, playerStates) local spec, fullview = Spring.GetSpectatingState() -- sends a "I arrived" message -- NOTE: Spring.GetGameRulesParam("player_" .. Spring.GetMyPlayerID() .. "_joined") seems to be always nil! - if not spec and not ihavejoined and Spring.GetGameRulesParam("player_" .. Spring.GetMyPlayerID() .. "_joined") == nil then + if not spec and not ihavejoined and Spring.GetGameRulesParam("player_" .. Spring.GetLocalPlayerID() .. "_joined") == nil then Spring.SendLuaRulesMsg("joined_game") ihavejoined = true end diff --git a/luaui/Widgets/gui_pregameui_draft.lua b/luaui/Widgets/gui_pregameui_draft.lua index 02ba63dc646..91acca5c2d0 100644 --- a/luaui/Widgets/gui_pregameui_draft.lua +++ b/luaui/Widgets/gui_pregameui_draft.lua @@ -32,8 +32,8 @@ local fontfileOutlineStrength = 1.4 local font = gl.LoadFont(fontfile, fontfileSize * fontfileScale, fontfileOutlineSize * fontfileScale, fontfileOutlineStrength) local uiScale = (0.7 + (vsx * vsy / 6500000)) -local myPlayerID = Spring.GetMyPlayerID() -local myAllyTeamID = Spring.GetMyAllyTeamID() +local myPlayerID = Spring.GetLocalPlayerID() +local myAllyTeamID = Spring.GetLocalAllyTeamID() local _, _, mySpec, myTeamID = Spring.GetPlayerInfo(myPlayerID, false) local isFFA = Spring.Utilities.Gametype.IsFFA() local isReplay = Spring.IsReplay() @@ -827,7 +827,7 @@ function widget:GameSetup(state, ready, playerStates) local spec, fullview = Spring.GetSpectatingState() -- sends a "I arrived" message -- NOTE: Spring.GetGameRulesParam("player_" .. Spring.GetMyPlayerID() .. "_joined") seems to be always nil! - if not spec and not ihavejoined and Spring.GetGameRulesParam("player_" .. Spring.GetMyPlayerID() .. "_joined") == nil then + if not spec and not ihavejoined and Spring.GetGameRulesParam("player_" .. Spring.GetLocalPlayerID() .. "_joined") == nil then Spring.SendLuaRulesMsg("joined_game") ihavejoined = true end diff --git a/luaui/Widgets/gui_projectile_target_aoe.lua b/luaui/Widgets/gui_projectile_target_aoe.lua index a4abb5aa5fe..7928ceeccfa 100644 --- a/luaui/Widgets/gui_projectile_target_aoe.lua +++ b/luaui/Widgets/gui_projectile_target_aoe.lua @@ -32,14 +32,14 @@ local spGetProjectileDefID = Spring.GetProjectileDefID local spGetProjectileTarget = Spring.GetProjectileTarget local spGetProjectilePosition = Spring.GetProjectilePosition local spGetGroundHeight = Spring.GetGroundHeight -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetMyAllyTeamID = Spring.GetLocalAllyTeamID local spGetProjectileTeamID = Spring.GetProjectileTeamID local spGetTeamInfo = Spring.GetTeamInfo local spGetUnitPosition = Spring.GetUnitPosition local spGetViewGeometry = Spring.GetViewGeometry local spIsGUIHidden = Spring.IsGUIHidden local spGetSpectatingState = Spring.GetSpectatingState -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spIsSphereInView = Spring.IsSphereInView local spGetCameraPosition = Spring.GetCameraPosition diff --git a/luaui/Widgets/gui_savegame.lua b/luaui/Widgets/gui_savegame.lua index b641be29ad8..a2466b2a360 100644 --- a/luaui/Widgets/gui_savegame.lua +++ b/luaui/Widgets/gui_savegame.lua @@ -137,7 +137,7 @@ local function SaveGame(filename, description, requireOverwrite) saveData.gameID = (Spring.GetGameRulesParam("save_gameID") or (Game.gameID and Game.gameID or Spring.GetGameRulesParam("GameID"))) saveData.gameframe = spGetGameFrame() saveData.totalGameframe = spGetGameFrame() + (Spring.GetGameRulesParam("totalSaveGameFrame") or 0) - saveData.playerName = Spring.GetPlayerInfo(Spring.GetMyPlayerID(), false) + saveData.playerName = Spring.GetPlayerInfo(Spring.GetLocalPlayerID(), false) table.save(saveData, path) -- TODO: back up existing save? diff --git a/luaui/Widgets/gui_sensor_ranges_jammer.lua b/luaui/Widgets/gui_sensor_ranges_jammer.lua index 866377c3de5..4cd39503fc3 100644 --- a/luaui/Widgets/gui_sensor_ranges_jammer.lua +++ b/luaui/Widgets/gui_sensor_ranges_jammer.lua @@ -180,7 +180,7 @@ local GL_REPLACE = GL.REPLACE -- Globals local spec, fullview = spGetSpectatingState() -local allyTeamID = Spring.GetMyAllyTeamID() +local allyTeamID = Spring.GetLocalAllyTeamID() -- find all unit types with radar in the game and place ranges into unitRange table local unitRange = {} -- table of unit types with their radar ranges @@ -216,7 +216,7 @@ function widget:PlayerChanged() local prevFullview = fullview local myPrevAllyTeamID = allyTeamID spec, fullview = spGetSpectatingState() - allyTeamID = Spring.GetMyAllyTeamID() + allyTeamID = Spring.GetLocalAllyTeamID() if fullview ~= prevFullview or allyTeamID ~= myPrevAllyTeamID then InitializeUnits() end diff --git a/luaui/Widgets/gui_sensor_ranges_los.lua b/luaui/Widgets/gui_sensor_ranges_los.lua index dd52081e62f..281f8f723df 100644 --- a/luaui/Widgets/gui_sensor_ranges_los.lua +++ b/luaui/Widgets/gui_sensor_ranges_los.lua @@ -199,7 +199,7 @@ local GL_REPLACE = GL.REPLACE -- Globals local spec, fullview = spGetSpectatingState() -local allyTeamID = Spring.GetMyAllyTeamID() +local allyTeamID = Spring.GetLocalAllyTeamID() -- find all unit types with radar in the game and place ranges into unitRange table local unitRange = {} -- table of unit types with their radar ranges @@ -234,7 +234,7 @@ function widget:PlayerChanged() local prevFullview = fullview local myPrevAllyTeamID = allyTeamID spec, fullview = spGetSpectatingState() - allyTeamID = Spring.GetMyAllyTeamID() + allyTeamID = Spring.GetLocalAllyTeamID() if fullview ~= prevFullview or allyTeamID ~= myPrevAllyTeamID then InitializeUnits() end diff --git a/luaui/Widgets/gui_sensor_ranges_radar.lua b/luaui/Widgets/gui_sensor_ranges_radar.lua index 01158907866..60feaa2b45d 100644 --- a/luaui/Widgets/gui_sensor_ranges_radar.lua +++ b/luaui/Widgets/gui_sensor_ranges_radar.lua @@ -180,7 +180,7 @@ local GL_REPLACE = GL.REPLACE -- Globals local spec, fullview = spGetSpectatingState() -local allyTeamID = Spring.GetMyAllyTeamID() +local allyTeamID = Spring.GetLocalAllyTeamID() -- find all unit types with radar in the game and place ranges into unitRange table local unitRange = {} -- table of unit types with their radar ranges @@ -216,7 +216,7 @@ function widget:PlayerChanged() local prevFullview = fullview local myPrevAllyTeamID = allyTeamID spec, fullview = spGetSpectatingState() - allyTeamID = Spring.GetMyAllyTeamID() + allyTeamID = Spring.GetLocalAllyTeamID() if fullview ~= prevFullview or allyTeamID ~= myPrevAllyTeamID then InitializeUnits() end diff --git a/luaui/Widgets/gui_sensor_ranges_sonar.lua b/luaui/Widgets/gui_sensor_ranges_sonar.lua index 3acc5e35174..6d9d44f967e 100644 --- a/luaui/Widgets/gui_sensor_ranges_sonar.lua +++ b/luaui/Widgets/gui_sensor_ranges_sonar.lua @@ -182,7 +182,7 @@ local GL_REPLACE = GL.REPLACE -- Globals local spec, fullview = spGetSpectatingState() -local allyTeamID = Spring.GetMyAllyTeamID() +local allyTeamID = Spring.GetLocalAllyTeamID() -- find all unit types with sonar in the game and place ranges into unitRange table local unitRange = {} -- table of unit types with their sonar ranges @@ -222,7 +222,7 @@ function widget:PlayerChanged() local prevFullview = fullview local myPrevAllyTeamID = allyTeamID spec, fullview = spGetSpectatingState() - allyTeamID = Spring.GetMyAllyTeamID() + allyTeamID = Spring.GetLocalAllyTeamID() if fullview ~= prevFullview or allyTeamID ~= myPrevAllyTeamID then InitializeUnits() end diff --git a/luaui/Widgets/gui_show_orders.lua b/luaui/Widgets/gui_show_orders.lua index 678fbb720d7..726f058d261 100644 --- a/luaui/Widgets/gui_show_orders.lua +++ b/luaui/Widgets/gui_show_orders.lua @@ -146,7 +146,7 @@ local spGetFactoryCommands = Spring.GetFactoryCommands local spGetSpecState = Spring.GetSpectatingState local spGetTeamList = Spring.GetTeamList local spGetTeamUnits = Spring.GetTeamUnits -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetMyAllyTeamID = Spring.GetLocalAllyTeamID local spGetUnitDefID = Spring.GetUnitDefID local spGetUnitPosition = Spring.GetUnitPosition local spWorldToScreenCoords = Spring.WorldToScreenCoords diff --git a/luaui/Widgets/gui_spec_next_alive_player.lua b/luaui/Widgets/gui_spec_next_alive_player.lua index 4ad3e220b33..4137bc502c8 100644 --- a/luaui/Widgets/gui_spec_next_alive_player.lua +++ b/luaui/Widgets/gui_spec_next_alive_player.lua @@ -14,7 +14,7 @@ end -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetSpectatingState = Spring.GetSpectatingState local processTeamDiedFrame, processTeamDiedTeamID @@ -32,7 +32,7 @@ end local function processTeamDied(teamID) local _, _, isDead = Spring.GetTeamInfo(teamID, false) if isDead and spGetMyTeamID() == teamID then - local myAllyTeamID = Spring.GetMyAllyTeamID() + local myAllyTeamID = Spring.GetLocalAllyTeamID() -- first try alive team mates local teamList = Spring.GetTeamList(myAllyTeamID) for _, teamListID in ipairs(teamList) do diff --git a/luaui/Widgets/gui_spectate_selected.lua b/luaui/Widgets/gui_spectate_selected.lua index f7dcd7dfaa4..35f5ea5ee17 100644 --- a/luaui/Widgets/gui_spectate_selected.lua +++ b/luaui/Widgets/gui_spectate_selected.lua @@ -14,7 +14,7 @@ function widget:GetInfo() end -- Localized Spring API for performance -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetSpectatingState = Spring.GetSpectatingState local spGetUnitTeam = Spring.GetUnitTeam diff --git a/luaui/Widgets/gui_team_platter.lua b/luaui/Widgets/gui_team_platter.lua index a33e51821be..27669a1fa49 100644 --- a/luaui/Widgets/gui_team_platter.lua +++ b/luaui/Widgets/gui_team_platter.lua @@ -45,7 +45,7 @@ local hasBadCulling = ((Platform.gpuVendor == "AMD" and Platform.osFamily == "Li local spGetUnitTeam = Spring.GetUnitTeam -local myTeamID = Spring.GetMyTeamID() +local myTeamID = Spring.GetLocalTeamID() local gaiaTeamID = Spring.GetGaiaTeamID() local unitScale = {} diff --git a/luaui/Widgets/gui_top_bar.lua b/luaui/Widgets/gui_top_bar.lua index 95afc9d1e80..0e40cbeaa89 100644 --- a/luaui/Widgets/gui_top_bar.lua +++ b/luaui/Widgets/gui_top_bar.lua @@ -31,11 +31,11 @@ local sp = { GetTeamRulesParam = Spring.GetTeamRulesParam, GetTeamList = Spring.GetTeamList, SetMouseCursor = Spring.SetMouseCursor, - GetMyAllyTeamID = Spring.GetMyAllyTeamID, + GetMyAllyTeamID = Spring.GetLocalAllyTeamID, GetTeamUnitDefCount = Spring.GetTeamUnitDefCount, GetSpectatingState = Spring.GetSpectatingState, GetTeamResources = Spring.GetTeamResources, - GetMyTeamID = Spring.GetMyTeamID, + GetMyTeamID = Spring.GetLocalTeamID, GetMouseState = Spring.GetMouseState, GetWind = Spring.GetWind, GetGameSpeed = Spring.GetGameSpeed, @@ -2388,8 +2388,8 @@ function widget:Initialize() displayComCounter = true end - if UnitDefs[Spring.GetTeamRulesParam(Spring.GetMyTeamID(), "startUnit")] then - textures.com = ":n:Icons/" .. UnitDefs[Spring.GetTeamRulesParam(Spring.GetMyTeamID(), "startUnit")].name .. ".png" + if UnitDefs[Spring.GetTeamRulesParam(Spring.GetLocalTeamID(), "startUnit")] then + textures.com = ":n:Icons/" .. UnitDefs[Spring.GetTeamRulesParam(Spring.GetLocalTeamID(), "startUnit")].name .. ".png" end for _, teamID in ipairs(myAllyTeamList) do diff --git a/luaui/Widgets/gui_unit_energy_icons.lua b/luaui/Widgets/gui_unit_energy_icons.lua index eb278e70518..eb6978dd8bd 100644 --- a/luaui/Widgets/gui_unit_energy_icons.lua +++ b/luaui/Widgets/gui_unit_energy_icons.lua @@ -141,7 +141,7 @@ function widget:VisibleUnitsChanged(extVisibleUnits, extNumVisibleUnits) fullview = select(2, spGetSpectatingState()) end if not fullview then - teamList = Spring.GetTeamList(Spring.GetMyAllyTeamID()) + teamList = Spring.GetTeamList(Spring.GetLocalAllyTeamID()) else teamList = Spring.GetTeamList() end diff --git a/luaui/Widgets/gui_unit_firestate_icons.lua b/luaui/Widgets/gui_unit_firestate_icons.lua index 2c8367f12e1..ffe0e45c0b2 100644 --- a/luaui/Widgets/gui_unit_firestate_icons.lua +++ b/luaui/Widgets/gui_unit_firestate_icons.lua @@ -23,8 +23,8 @@ local spGetUnitRulesParam = Spring.GetUnitRulesParam local spValidUnitID = Spring.ValidUnitID local spGetUnitIsDead = Spring.GetUnitIsDead local spGetSelectedUnits = Spring.GetSelectedUnits -local spGetMyPlayerID = Spring.GetMyPlayerID -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyPlayerID = Spring.GetLocalPlayerID +local spGetMyTeamID = Spring.GetLocalTeamID local gaiaTeamID = Spring.GetGaiaTeamID() diff --git a/luaui/Widgets/gui_unit_idlebuilder_icons.lua b/luaui/Widgets/gui_unit_idlebuilder_icons.lua index 80717d9d1bf..18747e2958f 100644 --- a/luaui/Widgets/gui_unit_idlebuilder_icons.lua +++ b/luaui/Widgets/gui_unit_idlebuilder_icons.lua @@ -31,7 +31,7 @@ local spGetUnitCommandCount = Spring.GetUnitCommandCount local spGetFactoryCommandCount = Spring.GetFactoryCommandCount local spGetUnitTeam = Spring.GetUnitTeam local spec = Spring.GetSpectatingState() -local myTeamID = Spring.GetMyTeamID() +local myTeamID = Spring.GetLocalTeamID() local spValidUnitID = Spring.ValidUnitID local spGetUnitIsDead = Spring.GetUnitIsDead local spGetUnitIsBeingBuilt = Spring.GetUnitIsBeingBuilt diff --git a/luaui/Widgets/gui_unit_stats.lua b/luaui/Widgets/gui_unit_stats.lua index 1dcc5f512c5..706b0335acc 100644 --- a/luaui/Widgets/gui_unit_stats.lua +++ b/luaui/Widgets/gui_unit_stats.lua @@ -142,7 +142,7 @@ local char = string.char local glColor = gl.Color -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetTeamResources = Spring.GetTeamResources local spGetTeamInfo = Spring.GetTeamInfo local spGetPlayerInfo = Spring.GetPlayerInfo @@ -486,7 +486,7 @@ local function computeContent(uDefID, uID, shiftBool) local uDef = uDefs[uDefID] local maxHP = uDef.health - local uTeam = Spring.GetMyTeamID() + local uTeam = Spring.GetLocalTeamID() local losRadius = uDef.sightDistance local airLosRadius = uDef.airSightDistance local radarRadius = uDef.radarDistance diff --git a/luaui/Widgets/gui_unit_wait_icons.lua b/luaui/Widgets/gui_unit_wait_icons.lua index a9238153531..59bfaa79290 100644 --- a/luaui/Widgets/gui_unit_wait_icons.lua +++ b/luaui/Widgets/gui_unit_wait_icons.lua @@ -30,7 +30,7 @@ local spGetUnitCommands = Spring.GetUnitCommands local spGetUnitCommandCount = Spring.GetUnitCommandCount local spGetFactoryCommands = Spring.GetFactoryCommands local spec = Spring.GetSpectatingState() -local myTeamID = Spring.GetMyTeamID() +local myTeamID = Spring.GetLocalTeamID() local spValidUnitID = Spring.ValidUnitID local spIsGUIHidden = Spring.IsGUIHidden diff --git a/luaui/Widgets/gui_vote_interface.lua b/luaui/Widgets/gui_vote_interface.lua index f6bcbac1213..12e0dc7733a 100644 --- a/luaui/Widgets/gui_vote_interface.lua +++ b/luaui/Widgets/gui_vote_interface.lua @@ -37,7 +37,7 @@ local vsx, vsy = spGetViewGeometry() local ui_scale = tonumber(Spring.GetConfigFloat("ui_scale", 1) or 1) -local myPlayerID = Spring.GetMyPlayerID() +local myPlayerID = Spring.GetLocalPlayerID() local myPlayerName, _, mySpec, myTeamID, myAllyTeamID = Spring.GetPlayerInfo(myPlayerID, false) local isreplay = Spring.IsReplay() @@ -365,7 +365,7 @@ end function widget:GameFrame(n) if n > 0 and not gameStarted then gameStarted = true - myPlayerID = Spring.GetMyPlayerID() + myPlayerID = Spring.GetLocalPlayerID() myPlayerName, _, mySpec, myTeamID, myAllyTeamID = Spring.GetPlayerInfo(myPlayerID, false) end widgetHandler:RemoveCallIn("GameFrame") diff --git a/luaui/Widgets/logo_adjuster.lua b/luaui/Widgets/logo_adjuster.lua index 034b6608d75..10f801e18b3 100644 --- a/luaui/Widgets/logo_adjuster.lua +++ b/luaui/Widgets/logo_adjuster.lua @@ -14,7 +14,7 @@ end -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetMouseState = Spring.GetMouseState local doNotify = true diff --git a/luaui/Widgets/map_startbox.lua b/luaui/Widgets/map_startbox.lua index 82169a4e347..7ad9bc6ba0f 100644 --- a/luaui/Widgets/map_startbox.lua +++ b/luaui/Widgets/map_startbox.lua @@ -21,7 +21,7 @@ local mathRandom = math.random local mathAbs = math.abs local spGetGameFrame = Spring.GetGameFrame -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spEcho = Spring.Echo local spGetSpectatingState = Spring.GetSpectatingState local spGetTeamList = Spring.GetTeamList @@ -129,7 +129,7 @@ local draggingTeamID = nil local dragOffsetX = 0 local dragOffsetZ = 0 -local myAllyTeamID = Spring.GetMyAllyTeamID() +local myAllyTeamID = Spring.GetLocalAllyTeamID() local gameFrame = 0 local CONE_CLICK_RADIUS = 75 @@ -1271,7 +1271,7 @@ local lastKnownPlacements = {} local currentPlacements = {} local startPointTable = {} function widget:Update(delta) - myAllyTeamID = Spring.GetMyAllyTeamID() + myAllyTeamID = Spring.GetLocalAllyTeamID() gameFrame = spGetGameFrame() local currRot = getCurrentMiniMapRotationOption() if lastRot ~= currRot then @@ -1481,14 +1481,14 @@ function widget:RecvLuaMsg(msg) aiPlacedPositions[teamID] = nil aiPlacementStatus[teamID] = false invalidatePosCacheEntry(teamID) - aiLocationI18NTable.playerName = spGetPlayerInfo(Spring.GetMyPlayerID(), false) + aiLocationI18NTable.playerName = spGetPlayerInfo(Spring.GetLocalPlayerID(), false) aiLocationI18NTable.aiName = getAIName(teamID) Spring.SendMessage(Spring.I18N("ui.startbox.aiStartLocationRemoved", aiLocationI18NTable)) else aiPlacedPositions[teamID] = { x = x, z = z } aiPlacementStatus[teamID] = true invalidatePosCacheEntry(teamID) - aiLocationI18NTable.playerName = spGetPlayerInfo(Spring.GetMyPlayerID(), false) + aiLocationI18NTable.playerName = spGetPlayerInfo(Spring.GetLocalPlayerID(), false) aiLocationI18NTable.aiName = getAIName(teamID) Spring.SendMessage(Spring.I18N("ui.startbox.aiStartLocationChanged", aiLocationI18NTable)) end diff --git a/luaui/Widgets/map_startpolygon_gl4.lua b/luaui/Widgets/map_startpolygon_gl4.lua index 10c0b60e568..b71af2b1fca 100644 --- a/luaui/Widgets/map_startpolygon_gl4.lua +++ b/luaui/Widgets/map_startpolygon_gl4.lua @@ -116,7 +116,7 @@ local function DrawStartPolygons(inminimap) startPolygonShader:SetUniform("noRushTimer", noRushTime) startPolygonShader:SetUniformInt("isMiniMap", inminimap and 1 or 0) startPolygonShader:SetUniformInt("rotationMiniMap", getCurrentMiniMapRotationOption() or ROTATION.DEG_0) - startPolygonShader:SetUniformInt("myAllyTeamID", Spring.GetMyAllyTeamID() or -1) + startPolygonShader:SetUniformInt("myAllyTeamID", Spring.GetLocalAllyTeamID() or -1) fullScreenRectVAO:DrawArrays(GL.TRIANGLES) startPolygonShader:Deactivate() diff --git a/luaui/Widgets/snd_notifications.lua b/luaui/Widgets/snd_notifications.lua index 14eeb05ea56..58d7d8bcb43 100644 --- a/luaui/Widgets/snd_notifications.lua +++ b/luaui/Widgets/snd_notifications.lua @@ -19,7 +19,7 @@ local tableSort = table.sort -- Localized Spring API for performance local spGetUnitPosition = Spring.GetUnitPosition -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetMouseState = Spring.GetMouseState local spEcho = Spring.Echo local spGetSpectatingState = Spring.GetSpectatingState @@ -271,8 +271,8 @@ local lastMouseX, lastMouseY = spGetMouseState() local isSpec = spGetSpectatingState() local isReplay = Spring.IsReplay() local myTeamID = spGetMyTeamID() -local myPlayerID = Spring.GetMyPlayerID() -local myAllyTeamID = Spring.GetMyAllyTeamID() +local myPlayerID = Spring.GetLocalPlayerID() +local myAllyTeamID = Spring.GetLocalAllyTeamID() local myRank = select(9, Spring.GetPlayerInfo(myPlayerID)) local spGetTeamResources = Spring.GetTeamResources @@ -474,8 +474,8 @@ end function widget:PlayerChanged(playerID) isSpec = spGetSpectatingState() myTeamID = spGetMyTeamID() - myPlayerID = Spring.GetMyPlayerID() - myAllyTeamID = Spring.GetMyAllyTeamID() + myPlayerID = Spring.GetLocalPlayerID() + myAllyTeamID = Spring.GetLocalAllyTeamID() doTutorialMode = (not isReplay and not isSpec and tutorialMode) updateCommanders() end @@ -490,7 +490,7 @@ local function gadgetNotificationEvent(msg) if not isSpec or (isSpec and lockPlayerID ~= nil) or forceplay then local event = string.sub(msg, 1, string.find(msg, " ", nil, true) - 1) local player = string.sub(msg, string.find(msg, " ", nil, true) + 1, string.len(msg)) - if forceplay or (tonumber(player) and (tonumber(player) == Spring.GetMyPlayerID())) or (isSpec and tonumber(player) == lockPlayerID) then + if forceplay or (tonumber(player) and (tonumber(player) == Spring.GetLocalPlayerID())) or (isSpec and tonumber(player) == lockPlayerID) then queueNotification(event, forceplay) end end diff --git a/luaui/Widgets/unit_alt_set_target_type.lua b/luaui/Widgets/unit_alt_set_target_type.lua index 8f002fdeb44..f5cdd0dd0e1 100644 --- a/luaui/Widgets/unit_alt_set_target_type.lua +++ b/luaui/Widgets/unit_alt_set_target_type.lua @@ -23,7 +23,7 @@ local spAreTeamsAllied = Spring.AreTeamsAllied local spGetUnitTeam = Spring.GetUnitTeam local spGiveOrderArrayToUnit = Spring.GiveOrderArrayToUnit local spGetSelectedUnits = Spring.GetSelectedUnits -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetActiveCommand = Spring.GetActiveCommand local spGetMouseState = Spring.GetMouseState local spTraceScreenRay = Spring.TraceScreenRay diff --git a/luaui/Widgets/unit_area_reclaim_enemy.lua b/luaui/Widgets/unit_area_reclaim_enemy.lua index d8402e88ea9..02c3d072107 100644 --- a/luaui/Widgets/unit_area_reclaim_enemy.lua +++ b/luaui/Widgets/unit_area_reclaim_enemy.lua @@ -11,7 +11,7 @@ function widget:GetInfo() } end -local allyTeam = Spring.GetMyAllyTeamID() +local allyTeam = Spring.GetLocalAllyTeamID() -- Speedups @@ -71,7 +71,7 @@ function widget:CommandNotify(id, params, options) -- get all enemy units in the area for i = 1, #areaUnits do local unitID = areaUnits[i] - local enemyUnit = not Spring.AreTeamsAllied(Spring.GetUnitTeam(unitID), Spring.GetMyTeamID()) + local enemyUnit = not Spring.AreTeamsAllied(Spring.GetUnitTeam(unitID), Spring.GetLocalTeamID()) if enemyUnit then table.insert(enemyUnits, unitID) end diff --git a/luaui/Widgets/unit_auto_cloak.lua b/luaui/Widgets/unit_auto_cloak.lua index acbc4ab83d5..0f8a6a0eed1 100644 --- a/luaui/Widgets/unit_auto_cloak.lua +++ b/luaui/Widgets/unit_auto_cloak.lua @@ -43,7 +43,7 @@ local CMD_CLOAK = 37382 local cloak = CMD_CLOAK --just simplified Var local cloakunits = {} -- get UnitID for initial local function local giveOrderToUnit = Spring.GiveOrderToUnit --optimization -local spUnitTeam = Spring.GetMyTeamID --optimization +local spUnitTeam = Spring.GetLocalTeamID --optimization local function cloakDeActive(unitID, unitDefID) --DeActivator of Cloak for all units with clock if unitdefConfig[unitDefID] then diff --git a/luaui/Widgets/unit_auto_group.lua b/luaui/Widgets/unit_auto_group.lua index acff3a8c176..0fdcd89d7e9 100644 --- a/luaui/Widgets/unit_auto_group.lua +++ b/luaui/Widgets/unit_auto_group.lua @@ -20,7 +20,7 @@ local tableInsert = table.insert -- Localized Spring API for performance local spGetUnitDefID = Spring.GetUnitDefID local spGetGameFrame = Spring.GetGameFrame -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetTeamUnits = Spring.GetTeamUnits include("keysym.h.lua") diff --git a/luaui/Widgets/unit_auto_repair_idle_builders.lua b/luaui/Widgets/unit_auto_repair_idle_builders.lua index 86a0296a29b..3a40566f0f5 100644 --- a/luaui/Widgets/unit_auto_repair_idle_builders.lua +++ b/luaui/Widgets/unit_auto_repair_idle_builders.lua @@ -15,7 +15,7 @@ end ---------------------------------------------------------------- -- Speedups ---------------------------------------------------------------- -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetTeamUnits = Spring.GetTeamUnits local spGetUnitDefID = Spring.GetUnitDefID local spGetUnitPosition = Spring.GetUnitPosition diff --git a/luaui/Widgets/unit_autofirstbuildfacing.lua b/luaui/Widgets/unit_autofirstbuildfacing.lua index dc0d0db0e41..cc707f04855 100644 --- a/luaui/Widgets/unit_autofirstbuildfacing.lua +++ b/luaui/Widgets/unit_autofirstbuildfacing.lua @@ -16,7 +16,7 @@ end local mathAbs = math.abs -- Localized Spring API for performance -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local facing = 0 local x = 0 diff --git a/luaui/Widgets/unit_bombers_default_hold_fire.lua b/luaui/Widgets/unit_bombers_default_hold_fire.lua index ae02a6541c6..fb70664a7fd 100644 --- a/luaui/Widgets/unit_bombers_default_hold_fire.lua +++ b/luaui/Widgets/unit_bombers_default_hold_fire.lua @@ -18,7 +18,7 @@ local gameStarted = false local isBomber = {} local spGetGameFrame = Spring.GetGameFrame -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGiveOrder = Spring.GiveOrderToUnit local myTeamID = spGetMyTeamID() diff --git a/luaui/Widgets/unit_builder_priority.lua b/luaui/Widgets/unit_builder_priority.lua index f4c70870198..b16b464f5bc 100644 --- a/luaui/Widgets/unit_builder_priority.lua +++ b/luaui/Widgets/unit_builder_priority.lua @@ -15,7 +15,7 @@ function widget:GetInfo() end -- Localized Spring API for performance -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spEcho = Spring.Echo local CMD_PRIORITY = GameCMD.PRIORITY diff --git a/luaui/Widgets/unit_clean_builder_queue.lua b/luaui/Widgets/unit_clean_builder_queue.lua index 6e55f243c0b..47ec47a35f9 100644 --- a/luaui/Widgets/unit_clean_builder_queue.lua +++ b/luaui/Widgets/unit_clean_builder_queue.lua @@ -17,7 +17,7 @@ local GiveOrderToUnit = Spring.GiveOrderToUnit local GetUnitPosition = Spring.GetUnitPosition local GetUnitDefID = Spring.GetUnitDefID local GetTeamUnits = Spring.GetTeamUnits -local GetMyTeamID = Spring.GetMyTeamID +local GetMyTeamID = Spring.GetLocalTeamID local GetSpectatingState = Spring.GetSpectatingState local GetUnitsInCylinder = Spring.GetUnitsInCylinder local select = select diff --git a/luaui/Widgets/unit_cloak_firestate.lua b/luaui/Widgets/unit_cloak_firestate.lua index ba1dc7ae916..6825f316137 100644 --- a/luaui/Widgets/unit_cloak_firestate.lua +++ b/luaui/Widgets/unit_cloak_firestate.lua @@ -16,7 +16,7 @@ function widget:GetInfo() end -- Localized Spring API for performance -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- diff --git a/luaui/Widgets/unit_debug_alt_set_target_type.lua b/luaui/Widgets/unit_debug_alt_set_target_type.lua index d19dfe40ba5..cec7945cf8b 100644 --- a/luaui/Widgets/unit_debug_alt_set_target_type.lua +++ b/luaui/Widgets/unit_debug_alt_set_target_type.lua @@ -26,7 +26,7 @@ local spGetSelectedUnits = Spring.GetSelectedUnits local trackedUnitsToUnitDefID = {} local unitRanges = {} -local myAllyTeam = Spring.GetMyAllyTeamID() +local myAllyTeam = Spring.GetLocalAllyTeamID() local POLLING_RATE = 15 local CMD_STOP = CMD.STOP diff --git a/luaui/Widgets/unit_default_spy_move_cloaked.lua b/luaui/Widgets/unit_default_spy_move_cloaked.lua index 0f63e945a10..8d01195dfc3 100644 --- a/luaui/Widgets/unit_default_spy_move_cloaked.lua +++ b/luaui/Widgets/unit_default_spy_move_cloaked.lua @@ -17,7 +17,7 @@ local spGetSelectedUnitsCount = Spring.GetSelectedUnitsCount local spGetGameFrame = Spring.GetGameFrame local spGetSelectedUnitsSorted = Spring.GetSelectedUnitsSorted -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetUnitStates = Spring.GetUnitStates local idCanBuildCloakMove = {} diff --git a/luaui/Widgets/unit_dgun_stall_assist.lua b/luaui/Widgets/unit_dgun_stall_assist.lua index 9a1e8e774ac..06c47e27779 100644 --- a/luaui/Widgets/unit_dgun_stall_assist.lua +++ b/luaui/Widgets/unit_dgun_stall_assist.lua @@ -35,7 +35,7 @@ local spGetActiveCommand = Spring.GetActiveCommand local spGiveOrderToUnitArray = Spring.GiveOrderToUnitArray local spGetUnitCurrentCommand = Spring.GetUnitCurrentCommand local spGetFactoryCommands = Spring.GetFactoryCommands -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetTeamResources = Spring.GetTeamResources local spGetTeamUnits = Spring.GetTeamUnits local spGetUnitDefID = Spring.GetUnitDefID diff --git a/luaui/Widgets/unit_factory_assist_fix.lua b/luaui/Widgets/unit_factory_assist_fix.lua index 57d21ccc1fc..3e5d0e7a8b3 100644 --- a/luaui/Widgets/unit_factory_assist_fix.lua +++ b/luaui/Widgets/unit_factory_assist_fix.lua @@ -13,7 +13,7 @@ function widget:GetInfo() end -- Localized Spring API for performance -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetTeamUnits = Spring.GetTeamUnits ---------------------------------------------------------------- diff --git a/luaui/Widgets/unit_factory_quota.lua b/luaui/Widgets/unit_factory_quota.lua index 14c5b341a88..6e520f8097b 100644 --- a/luaui/Widgets/unit_factory_quota.lua +++ b/luaui/Widgets/unit_factory_quota.lua @@ -13,7 +13,7 @@ function widget:GetInfo() end -- Localized Spring API for performance -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local maxBuildProg = 0.075 -- maximum build progress that gets replaced in a repeat queue local maxMetal = 500 -- maximum metal cost that gets replaced in a repeat queue(7.5% of a juggernaut is still over 2k metal) diff --git a/luaui/Widgets/unit_hold_position.lua b/luaui/Widgets/unit_hold_position.lua index 4a0edf4dd3c..e2efb5e38b1 100644 --- a/luaui/Widgets/unit_hold_position.lua +++ b/luaui/Widgets/unit_hold_position.lua @@ -13,7 +13,7 @@ function widget:GetInfo() end -- Localized Spring API for performance -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local myTeamID = spGetMyTeamID() diff --git a/luaui/Widgets/unit_idle_guard.lua b/luaui/Widgets/unit_idle_guard.lua index 7d800b8d10e..cfe6d643ef4 100644 --- a/luaui/Widgets/unit_idle_guard.lua +++ b/luaui/Widgets/unit_idle_guard.lua @@ -14,7 +14,7 @@ end local CMD_GUARD = CMD.GUARD local OPT_SHIFT = CMD.OPT_SHIFT -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGiveOrderToUnit = Spring.GiveOrderToUnit local spGetUnitsInSphere = Spring.GetUnitsInSphere local spGetUnitDefID = Spring.GetUnitDefID diff --git a/luaui/Widgets/unit_immobile_builder.lua b/luaui/Widgets/unit_immobile_builder.lua index 27a6578e415..c395715cf8c 100644 --- a/luaui/Widgets/unit_immobile_builder.lua +++ b/luaui/Widgets/unit_immobile_builder.lua @@ -17,7 +17,7 @@ local spGetGameFrame = Spring.GetGameFrame local CMD_MOVE_STATE = CMD.MOVE_STATE local CMD_FIGHT = CMD.FIGHT -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetTeamUnits = Spring.GetTeamUnits local spGetUnitDefID = Spring.GetUnitDefID local spGetUnitPosition = Spring.GetUnitPosition diff --git a/luaui/Widgets/unit_load_own_moving.lua b/luaui/Widgets/unit_load_own_moving.lua index ec8dfa10f52..aaffb618438 100644 --- a/luaui/Widgets/unit_load_own_moving.lua +++ b/luaui/Widgets/unit_load_own_moving.lua @@ -31,7 +31,7 @@ end ------------------------------------------------------------------- -- Speedups ------------------------------------------------------------------- -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetUnitTeam = Spring.GetUnitTeam local spGetUnitCurrentCommand = Spring.GetUnitCurrentCommand local spGiveOrderToUnit = Spring.GiveOrderToUnit diff --git a/luaui/Widgets/unit_loop_select.lua b/luaui/Widgets/unit_loop_select.lua index 570fdb5a856..82f101e7fcb 100644 --- a/luaui/Widgets/unit_loop_select.lua +++ b/luaui/Widgets/unit_loop_select.lua @@ -47,7 +47,7 @@ local glBeginEnd = gl.BeginEnd local spGetMouseState = Spring.GetMouseState local spGetActiveCommand = Spring.GetActiveCommand local spGetSpecState = Spring.GetSpectatingState -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetVisibleUnits = Spring.GetVisibleUnits local spGetUnitPos = Spring.GetUnitPosition local spTraceScreenRay = Spring.TraceScreenRay diff --git a/luaui/Widgets/unit_only_fighters_patrol.lua b/luaui/Widgets/unit_only_fighters_patrol.lua index 8c0d9a49af5..258354cd457 100644 --- a/luaui/Widgets/unit_only_fighters_patrol.lua +++ b/luaui/Widgets/unit_only_fighters_patrol.lua @@ -28,7 +28,7 @@ end -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local stop_builders = true -- Whever to stop builders or not. Set to true if you dont use factory guard widget. diff --git a/luaui/Widgets/unit_set_fighters_fly.lua b/luaui/Widgets/unit_set_fighters_fly.lua index 466de1cb281..bc566bd77b3 100644 --- a/luaui/Widgets/unit_set_fighters_fly.lua +++ b/luaui/Widgets/unit_set_fighters_fly.lua @@ -16,7 +16,7 @@ function widget:GetInfo() end -- Localized Spring API for performance -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID -- this widget is a variant of unit_air_allways_fly: project page on github: https://github.com/jamerlan/unit_air_allways_fly diff --git a/luaui/Widgets/unit_share_tracker.lua b/luaui/Widgets/unit_share_tracker.lua index 34c79f278a9..b75c5c3f15f 100644 --- a/luaui/Widgets/unit_share_tracker.lua +++ b/luaui/Widgets/unit_share_tracker.lua @@ -19,8 +19,8 @@ local spGetUnitPosition = Spring.GetUnitPosition local spGetViewGeometry = Spring.GetViewGeometry local spGetPlayerInfo = Spring.GetPlayerInfo local spGetTeamColor = Spring.GetTeamColor -local spGetMyTeamID = Spring.GetMyTeamID -local spGetMyPlayerID = Spring.GetMyPlayerID +local spGetMyTeamID = Spring.GetLocalTeamID +local spGetMyPlayerID = Spring.GetLocalPlayerID local spGetUnitHealth = Spring.GetUnitHealth local spGetUnitRulesParam = Spring.GetUnitRulesParam local spEcho = Spring.Echo diff --git a/luaui/Widgets/unit_smart_select.lua b/luaui/Widgets/unit_smart_select.lua index e907b16233d..fced2b13833 100644 --- a/luaui/Widgets/unit_smart_select.lua +++ b/luaui/Widgets/unit_smart_select.lua @@ -14,7 +14,7 @@ end -- Localized Spring API for performance local spGetSelectedUnits = Spring.GetSelectedUnits -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetLocalTeamID local spGetViewGeometry = Spring.GetViewGeometry local spGetSpectatingState = Spring.GetSpectatingState diff --git a/luaui/Widgets/unit_stateprefs.lua b/luaui/Widgets/unit_stateprefs.lua index 0c5114ee359..d39e4a6cede 100644 --- a/luaui/Widgets/unit_stateprefs.lua +++ b/luaui/Widgets/unit_stateprefs.lua @@ -209,7 +209,7 @@ function widget:UnitFinished(unitID, unitDefID, unitTeam) local name = unitName[unitDefID] local prefs = unitSet[name] - if unitTeam == Spring.GetMyTeamID() then + if unitTeam == Spring.GetLocalTeamID() then for cmdID, cmdParam in pairs(prefs or {}) do if cmdID == 115 then return @@ -220,7 +220,7 @@ function widget:UnitFinished(unitID, unitDefID, unitTeam) end local function ApplyUnitStates() - local teamID = (not spectatingState) and Spring.GetMyTeamID() + local teamID = (not spectatingState) and Spring.GetLocalTeamID() local units = (teamID and Spring.GetTeamUnits(teamID)) or Spring.GetAllUnits() if units then for i = 1, #units do diff --git a/luaui/barwidgets.lua b/luaui/barwidgets.lua index 00d41d80e5b..4fd0972688a 100644 --- a/luaui/barwidgets.lua +++ b/luaui/barwidgets.lua @@ -460,7 +460,7 @@ function widgetHandler:AddSpadsMessage(contents) -- Must contain, with triangle bracket literals [space][space] -- will get parsed by barmanager, and forwarded to autohostmonitor as: -- match-event <35> - local myPlayerID = Spring.GetMyPlayerID() + local myPlayerID = Spring.GetLocalPlayerID() local myPlayerName = Spring.GetPlayerInfo(myPlayerID, false) local gameSeconds = math.max(0, math.round(Spring.GetGameFrame() / 30)) if type(contents) == "table" then diff --git a/luaui/debug.lua b/luaui/debug.lua index 6ec156f023b..4cb5df5232f 100644 --- a/luaui/debug.lua +++ b/luaui/debug.lua @@ -121,7 +121,7 @@ function PrintTeamUnitsCounts(team) end function PrintAlliedUnits() - local teamTable = Spring.GetTeamList(Spring.GetMyAllyTeamID()) + local teamTable = Spring.GetTeamList(Spring.GetLocalAllyTeamID()) -- print("AlliedUnits: " .. teamTable.n .. " teams") teamTable.n = nil for n, tid in pairs(teamTable) do @@ -310,11 +310,11 @@ function Debug() print("Shadows = " .. Spring.GetConfigString("Shadows", 0)) print("ReflectiveWater = " .. Spring.GetConfigString("ReflectiveWater", 1)) - PrintTeamUnits(Spring.GetMyTeamID()) + PrintTeamUnits(Spring.GetLocalTeamID()) print("My Player Info:") - local myPlayerID = Spring.GetMyPlayerID() + local myPlayerID = Spring.GetLocalPlayerID() PrintPlayerInfo(myPlayerID) - PrintTeamUnitsCounts(Spring.GetMyTeamID()) + PrintTeamUnitsCounts(Spring.GetLocalTeamID()) end