1
0
mirror of https://github.com/Oarcinae/FactorioScenarioMultiplayerSpawn.git synced 2025-01-05 22:53:48 +02:00

Cleanup and fix swapped names on player list and tags.

This commit is contained in:
Oarcinae 2019-07-31 22:53:31 -05:00
parent ff0badceb8
commit cace3a4112
2 changed files with 30 additions and 25 deletions

View File

@ -175,28 +175,7 @@ script.on_event(defines.events.on_player_created, function(event)
SeparateSpawnsPlayerCreated(event.player_index)
CreateOarcGuiButton(player)
-- Add general info tab
AddOarcGuiTab(player, OARC_GAME_OPTS_GUI_TAB_NAME, CreateGameOptionsTab)
SetOarcGuiTabEnabled(player, OARC_GAME_OPTS_GUI_TAB_NAME, true)
-- Spawn control tab, disabled by default
AddOarcGuiTab(player, OARC_SPAWN_CTRL_GUI_NAME, CreateSpawnCtrlGuiTab)
-- If player list is enabled, create that
if global.ocfg.enable_player_list then
AddOarcGuiTab(player, OARC_PLAYER_LIST_GUI_TAB_NAME, CreatePlayerListGuiTab)
SetOarcGuiTabEnabled(player, OARC_PLAYER_LIST_GUI_TAB_NAME, true)
end
-- Player tags
if global.ocfg.enable_tags then
AddOarcGuiTab(player, OARC_TAGS_GUI_TAB_NAME, CreateTagGuiTab)
SetOarcGuiTabEnabled(player, OARC_TAGS_GUI_TAB_NAME, true)
end
AddOarcGuiTab(player, OARC_ROCKETS_GUI_TAB_NAME, CreateRocketGuiTab)
InitOarcGuiTabs(player)
end)
script.on_event(defines.events.on_player_respawned, function(event)

View File

@ -10,16 +10,42 @@ local OARC_GUI = "oarc_gui"
-- LIST of all implemented tabs and their content Functions
OARC_GAME_OPTS_GUI_TAB_NAME = "Server Info"
OARC_SPAWN_CTRL_GUI_NAME = "Spawn Controls"
OARC_TAGS_GUI_TAB_NAME = "Name Tags"
OARC_PLAYER_LIST_GUI_TAB_NAME = "Players"
OARC_TAGS_GUI_TAB_NAME = "Name Tags"
OARC_ROCKETS_GUI_TAB_NAME = "Rockets"
local OARC_GUI_TAB_CONTENT_FUNCTIONS = {}
OARC_GUI_TAB_CONTENT_FUNCTIONS["Server Info"] = CreateGameOptionsTab
OARC_GUI_TAB_CONTENT_FUNCTIONS["Spawn Controls"] = CreateSpawnCtrlGuiTab
OARC_GUI_TAB_CONTENT_FUNCTIONS["Name Tags"] = CreatePlayerListGuiTab
OARC_GUI_TAB_CONTENT_FUNCTIONS["Players"] = CreateTagGuiTab
OARC_GUI_TAB_CONTENT_FUNCTIONS["Players"] = CreatePlayerListGuiTab
OARC_GUI_TAB_CONTENT_FUNCTIONS["Name Tags"] = CreateTagGuiTab
OARC_GUI_TAB_CONTENT_FUNCTIONS["Rockets"] = CreateRocketGuiTab
function InitOarcGuiTabs(player)
CreateOarcGuiButton(player)
-- Add general info tab
AddOarcGuiTab(player, OARC_GAME_OPTS_GUI_TAB_NAME)
SetOarcGuiTabEnabled(player, OARC_GAME_OPTS_GUI_TAB_NAME, true)
-- Spawn control tab, disabled by default
AddOarcGuiTab(player, OARC_SPAWN_CTRL_GUI_NAME)
-- If player list is enabled, create that
if global.ocfg.enable_player_list then
AddOarcGuiTab(player, OARC_PLAYER_LIST_GUI_TAB_NAME)
SetOarcGuiTabEnabled(player, OARC_PLAYER_LIST_GUI_TAB_NAME, true)
end
-- Player tags
if global.ocfg.enable_tags then
AddOarcGuiTab(player, OARC_TAGS_GUI_TAB_NAME)
SetOarcGuiTabEnabled(player, OARC_TAGS_GUI_TAB_NAME, true)
end
AddOarcGuiTab(player, OARC_ROCKETS_GUI_TAB_NAME)
end
function CreateOarcGuiButton(player)
if (mod_gui.get_button_flow(player).oarc_button == nil) then
local b = mod_gui.get_button_flow(player).add{name="oarc_button",