1
0
mirror of https://github.com/Oarcinae/FactorioScenarioMultiplayerSpawn.git synced 2024-12-04 09:43:00 +02:00

Fix surface name for platforms in player list. Caught some more print statements that weren't wrapped in CompatSend. Add special sound for join request.

This commit is contained in:
Oarcinae 2024-12-03 20:03:39 -05:00
parent 73aa900e35
commit 7755ae9d73
4 changed files with 15 additions and 7 deletions

View File

@ -124,9 +124,12 @@ function CreatePlayerGPSButton(container, player_name)
end
if game.planets[surface_name] ~= nil then
AddLabel(flow, nil, {"", "[planet=", surface_name, "] ", {"space-location-name."..surface_name}}, my_label_style)
AddLabel(flow, nil, {"", "[planet=", surface_name, "] ", {"space-location-name."..surface_name}}, my_player_list_surface_max_width_style)
elseif game.surfaces[surface_name].platform ~= nil then
AddLabel(flow, nil, {"", "[entity=space-platform-hub] ", game.surfaces[surface_name].platform.name}, my_player_list_surface_max_width_style)
else
AddLabel(flow, nil, game.surfaces[surface_name].localised_name or game.surfaces[surface_name].name, my_label_style)
AddLabel(flow, nil, game.surfaces[surface_name].localised_name or game.surfaces[surface_name].name, my_player_list_surface_max_width_style)
end
end

View File

@ -163,6 +163,11 @@ my_notepad_fixed_width_style = {
top_margin = 5,
bottom_margin = 5
}
---@type LuaStyle
---@diagnostic disable-next-line: missing-fields
my_player_list_surface_max_width_style = {
maximal_width = 200
}
--------------------------------------------------------------------------------
-- GUI Functions

View File

@ -1155,7 +1155,7 @@ function TransferOwnershipOfAllSpawns(primary_spawn, new_host_name)
end
end
game.players[new_host_name].print({ "oarc-new-owner-msg" })
CompatSend(game.players[new_host_name], { "oarc-new-owner-msg" })
end
--[[
@ -1428,7 +1428,7 @@ function QueuePlayerForSpawn(player_name, delayed_spawn)
SetPlayerRespawn(player_name, delayed_spawn.surface_name, delayed_spawn.position, true)
game.players[player_name].print({ "oarc-generating-spawn-please-wait" })
CompatSend(game.players[player_name], { "oarc-generating-spawn-please-wait" }, { volume_modifier = 0})
local ticks_remaining = delayed_spawn.delayed_tick - game.tick
local seconds_remaining = math.ceil(ticks_remaining / TICKS_PER_SECOND)

View File

@ -756,8 +756,8 @@ function RequestToJoinSharedSpawn(player)
-- Display wait menu with cancel button.
DisplaySharedSpawnJoinWaitMenu(player)
-- Tell other player they are requesting a response.
game.players[host_name].print({ "oarc-player-requesting-join-you", player.name })
-- Tell other player they are requesting a response. Print it with color orange
CompatSend(game.players[host_name], { "oarc-player-requesting-join-you", player.name }, { color = { r = 1, g = 0.5, b = 0 }, sound_path = "utility/scenario_message" })
OarcGuiRefreshContent(game.players[host_name])
else
SendErrorMsg(player, { "oarc-invalid-host-shared-spawn" })
@ -774,7 +774,7 @@ function CancelSharedSpawnRequest(player)
local host_name = storage.spawn_choices[player.name].host_name
if (host_name ~= nil) and (game.players[host_name] ~= nil) then
game.players[host_name].print({ "oarc-player-cancel-join-request", player.name })
CompatSend(game.players[host_name], { "oarc-player-cancel-join-request", player.name })
end
--- Destroy the waiting menu and display the spawn options again.