mirror of
https://github.com/Oarcinae/FactorioScenarioMultiplayerSpawn.git
synced 2025-01-18 02:58:37 +02:00
Added loaders as a config option.
MOVED TO MOD GUI - WAY NICER!
This commit is contained in:
parent
eb63dd6e64
commit
b634435faf
@ -309,7 +309,7 @@ script.on_event(defines.events.on_research_finished, function(event)
|
||||
RemoveRecipe(event.research.force, "speed-module-3")
|
||||
end
|
||||
|
||||
if ENABLE_LOADERS then
|
||||
if global.ocfg.enable_loaders then
|
||||
EnableLoaders(event)
|
||||
end
|
||||
end)
|
||||
|
@ -62,6 +62,9 @@ ENABLE_LONGREACH = true
|
||||
-- Enable Autofill
|
||||
ENABLE_AUTOFILL = true
|
||||
|
||||
-- Enable vanilla loaders
|
||||
ENABLE_LOADERS = true
|
||||
|
||||
-- Enable Playerlist
|
||||
ENABLE_PLAYER_LIST = true
|
||||
PLAYER_LIST_OFFLINE_PLAYERS = true -- List offline players as well.
|
||||
@ -321,10 +324,10 @@ OARC_CFG = {
|
||||
["crude-oil"] =
|
||||
{
|
||||
num_patches = 2,
|
||||
amount = 300000,
|
||||
x_offset_start = 0,
|
||||
amount = 3000000,
|
||||
x_offset_start = -3,
|
||||
y_offset_start = 48,
|
||||
x_offset_next = 4,
|
||||
x_offset_next = 6,
|
||||
y_offset_next = 0
|
||||
}
|
||||
},
|
||||
|
@ -9,17 +9,17 @@ require("lib/separate_spawns")
|
||||
|
||||
function CreateGameOptionsGui(event)
|
||||
local player = game.players[event.player_index]
|
||||
if player.gui.top.game_options == nil then
|
||||
player.gui.top.add{name="game_options", type="button", caption="Info"}
|
||||
if mod_gui.get_button_flow(player).game_options == nil then
|
||||
mod_gui.get_button_flow(player).add{name="game_options", type="button", caption="Info", style=mod_gui.button_style}
|
||||
end
|
||||
end
|
||||
|
||||
local function ExpandGameOptionsGui(player)
|
||||
local frame = player.gui.left["game_options_panel"]
|
||||
local frame = mod_gui.get_frame_flow(player)["game_options_panel"]
|
||||
if (frame) then
|
||||
frame.destroy()
|
||||
else
|
||||
local frame = player.gui.left.add{type="frame",
|
||||
local frame = mod_gui.get_frame_flow(player).add{type="frame",
|
||||
name="game_options_panel",
|
||||
caption="Server Info:",
|
||||
direction="vertical"}
|
||||
|
@ -38,6 +38,7 @@ function InitOarcConfig()
|
||||
global.ocfg.enable_tags = ENABLE_TAGS
|
||||
global.ocfg.enable_long_reach = ENABLE_LONGREACH
|
||||
global.ocfg.enable_autofill = ENABLE_AUTOFILL
|
||||
global.ocfg.enable_loaders = ENABLE_LOADERS
|
||||
global.ocfg.enable_player_list = ENABLE_PLAYER_LIST
|
||||
global.ocfg.list_offline_players = PLAYER_LIST_OFFLINE_PLAYERS
|
||||
global.ocfg.enable_shared_team_vision = ENABLE_SHARED_TEAM_VISION
|
||||
@ -81,6 +82,7 @@ function InitOarcConfig()
|
||||
global.ocfg.enable_tags = settings.global["oarc-enable-tags"].value
|
||||
global.ocfg.enable_long_reach = settings.global["oarc-enable-long-reach"].value
|
||||
global.ocfg.enable_autofill = settings.global["oarc-enable-autofill"].value
|
||||
global.ocfg.enable_loaders = false
|
||||
global.ocfg.enable_player_list = settings.global["oarc-enable-player-list"].value
|
||||
global.ocfg.list_offline_players = settings.global["oarc-list-offline-players"].value
|
||||
global.ocfg.enable_shared_team_vision = settings.global["oarc-enable-shared-team-vision"].value
|
||||
|
@ -5,6 +5,7 @@
|
||||
-- Also contains some constants and gui styles
|
||||
|
||||
require("lib/oarc_gui_utils")
|
||||
require("mod-gui")
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Useful constants
|
||||
|
@ -6,17 +6,17 @@
|
||||
--------------------------------------------------------------------------------
|
||||
function CreatePlayerListGui(event)
|
||||
local player = game.players[event.player_index]
|
||||
if player.gui.top.playerList == nil then
|
||||
player.gui.top.add{name="playerList", type="button", caption="Player List"}
|
||||
if mod_gui.get_button_flow(player).playerList == nil then
|
||||
mod_gui.get_button_flow(player).add{name="playerList", type="button", caption="Player List", style=mod_gui.button_style}
|
||||
end
|
||||
end
|
||||
|
||||
local function ExpandPlayerListGui(player)
|
||||
local frame = player.gui.left["playerList-panel"]
|
||||
local frame = mod_gui.get_frame_flow(player)["playerList-panel"]
|
||||
if (frame) then
|
||||
frame.destroy()
|
||||
else
|
||||
local frame = player.gui.left.add{type="frame",
|
||||
local frame = mod_gui.get_frame_flow(player).add{type="frame",
|
||||
name="playerList-panel",
|
||||
caption="Online:"}
|
||||
local scrollFrame = frame.add{type="scroll-pane",
|
||||
|
@ -36,16 +36,14 @@ function RocketLaunchEvent(event)
|
||||
|
||||
-- First sat launch for this force.
|
||||
else
|
||||
game.set_game_state{game_finished=true, player_won=true, can_continue=true}
|
||||
-- game.set_game_state{game_finished=true, player_won=true, can_continue=true}
|
||||
global.satellite_sent[force.name] = 1
|
||||
|
||||
-- Unlock research
|
||||
if LOCK_GOODIES_UNTIL_ROCKET_LAUNCH then
|
||||
for _,f in pairs(game.forces) do
|
||||
EnableTech(f, "atomic-bomb")
|
||||
EnableTech(f, "power-armor-mk2")
|
||||
EnableTech(f, "artillery")
|
||||
end
|
||||
EnableTech(force, "atomic-bomb")
|
||||
EnableTech(force, "power-armor-mk2")
|
||||
EnableTech(force, "artillery")
|
||||
|
||||
if (force.technologies["speed-module-3"].researched) then
|
||||
AddRecipe(force, "speed-module-3")
|
||||
@ -59,8 +57,8 @@ end
|
||||
|
||||
|
||||
function CreateRocketGui(player)
|
||||
if player.gui.top["rocket-score"] == nil then
|
||||
player.gui.top.add{name="rocket-score", type="button", caption="Rockets"}
|
||||
if mod_gui.get_button_flow(player)["rocket-score"] == nil then
|
||||
mod_gui.get_button_flow(player).add{name="rocket-score", type="button", caption="Rockets", style=mod_gui.button_style}
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -537,8 +537,8 @@ end
|
||||
|
||||
|
||||
function CreateSpawnCtrlGui(player)
|
||||
if player and (player.gui.top.spwn_ctrls == nil) then
|
||||
player.gui.top.add{name="spwn_ctrls", type="button", caption={"oarc-spawn-ctrl"}}
|
||||
if player and (mod_gui.get_button_flow(player).spwn_ctrls == nil) then
|
||||
mod_gui.get_button_flow(player).add{name="spwn_ctrls", type="button", caption={"oarc-spawn-ctrl"}, style=mod_gui.button_style}
|
||||
end
|
||||
end
|
||||
|
||||
@ -573,11 +573,11 @@ end
|
||||
|
||||
-- This is a toggle function, it either shows or hides the spawn controls
|
||||
function ExpandSpawnCtrlGui(player, tick)
|
||||
local spwnCtrlPanel = player.gui.left["spwn_ctrl_panel"]
|
||||
local spwnCtrlPanel = mod_gui.get_frame_flow(player)["spwn_ctrl_panel"]
|
||||
if (spwnCtrlPanel) then
|
||||
spwnCtrlPanel.destroy()
|
||||
else
|
||||
local spwnCtrlPanel = player.gui.left.add{type="frame",
|
||||
local spwnCtrlPanel = mod_gui.get_frame_flow(player).add{type="frame",
|
||||
name="spwn_ctrl_panel", caption={"oarc-spawn-controls"}}
|
||||
local spwnCtrls = spwnCtrlPanel.add{type="scroll-pane",
|
||||
name="spwn_ctrl_panel", caption=""}
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
function CreateTagGui(event)
|
||||
local player = game.players[event.player_index]
|
||||
if player.gui.top.tag == nil then
|
||||
player.gui.top.add{name="tag", type="button", caption="Tag"}
|
||||
if mod_gui.get_button_flow(player).tag == nil then
|
||||
mod_gui.get_button_flow(player).add{name="tag", type="button", caption="Tag", style=mod_gui.button_style}
|
||||
end
|
||||
end
|
||||
|
||||
@ -27,11 +27,11 @@ local roles = {
|
||||
{display_name = "[AFK]"}}
|
||||
|
||||
local function ExpandTagGui(player)
|
||||
local frame = player.gui.left["tag-panel"]
|
||||
local frame = mod_gui.get_frame_flow(player)["tag-panel"]
|
||||
if (frame) then
|
||||
frame.destroy()
|
||||
else
|
||||
local frame = player.gui.left.add{type="frame", name="tag-panel", caption="What are you doing:", direction = "vertical"}
|
||||
local frame = mod_gui.get_frame_flow(player).add{type="frame", name="tag-panel", caption="What are you doing:", direction = "vertical"}
|
||||
for _, role in pairs(roles) do
|
||||
frame.add{type="button", caption=role.display_name, name=role.display_name}
|
||||
end
|
||||
|
@ -54,7 +54,7 @@ oarc-spawn-ctrl=Spawn Ctrl
|
||||
oarc-spawn-controls=Spawn Controls:
|
||||
oarc-spawn-allow-joiners=Allow others to join your base.
|
||||
|
||||
oarc-set-respawn-loc=Set New Respawn Location (1 hour cooldown)
|
||||
oarc-set-respawn-loc=Set New Respawn Location (has a cooldown)
|
||||
oarc-set-respawn-loc-cooldown=Set Respawn Cooldown Remaining: __1__
|
||||
oarc-set-respawn-note=This will set your respawn point to your current location.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user