mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-01-14 02:34:09 +02:00
fixes for
new blueprint library permissions offline player crafting queues
This commit is contained in:
parent
e5bb7ee1af
commit
7af65b9baf
@ -71,13 +71,11 @@ local functions = {
|
|||||||
end,
|
end,
|
||||||
["comfy_panel_blueprint_toggle"] = function(event)
|
["comfy_panel_blueprint_toggle"] = function(event)
|
||||||
if event.element.switch_state == "left" then
|
if event.element.switch_state == "left" then
|
||||||
game.permissions.get_group("Default").set_allows_action(defines.input_action.grab_blueprint_record, true)
|
game.permissions.get_group("Default").set_allows_action(defines.input_action.open_blueprint_library_gui, true)
|
||||||
game.permissions.get_group("Default").set_allows_action(defines.input_action.import_blueprint_string, true)
|
game.permissions.get_group("Default").set_allows_action(defines.input_action.import_blueprint_string, true)
|
||||||
game.permissions.get_group("Default").set_allows_action(defines.input_action.import_blueprint, true)
|
|
||||||
else
|
else
|
||||||
game.permissions.get_group("Default").set_allows_action(defines.input_action.grab_blueprint_record, false)
|
game.permissions.get_group("Default").set_allows_action(defines.input_action.open_blueprint_library_gui, false)
|
||||||
game.permissions.get_group("Default").set_allows_action(defines.input_action.import_blueprint_string, false)
|
game.permissions.get_group("Default").set_allows_action(defines.input_action.import_blueprint_string, false)
|
||||||
game.permissions.get_group("Default").set_allows_action(defines.input_action.import_blueprint, false)
|
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
["comfy_panel_spaghett_toggle"] = function(event)
|
["comfy_panel_spaghett_toggle"] = function(event)
|
||||||
@ -189,7 +187,7 @@ local build_config_gui = (function (player, frame)
|
|||||||
frame.add({type = "line"})
|
frame.add({type = "line"})
|
||||||
|
|
||||||
local switch_state = "right"
|
local switch_state = "right"
|
||||||
if game.permissions.get_group("Default").allows_action(defines.input_action.import_blueprint) then switch_state = "left" end
|
if game.permissions.get_group("Default").allows_action(defines.input_action.open_blueprint_library_gui) then switch_state = "left" end
|
||||||
local switch = add_switch(frame, switch_state, "comfy_panel_blueprint_toggle", "Blueprint Library", "Toggles the usage of blueprint strings and the library.")
|
local switch = add_switch(frame, switch_state, "comfy_panel_blueprint_toggle", "Blueprint Library", "Toggles the usage of blueprint strings and the library.")
|
||||||
if not admin then switch.ignored_by_interaction = true end
|
if not admin then switch.ignored_by_interaction = true end
|
||||||
|
|
||||||
|
@ -421,7 +421,7 @@ Public.raise_evo = function()
|
|||||||
if global.freeze_players then return end
|
if global.freeze_players then return end
|
||||||
if not global.training_mode and (#game.forces.north.connected_players == 0 or #game.forces.south.connected_players == 0) then return end
|
if not global.training_mode and (#game.forces.north.connected_players == 0 or #game.forces.south.connected_players == 0) then return end
|
||||||
if not global.total_passive_feed_redpotion then global.total_passive_feed_redpotion = 0 end
|
if not global.total_passive_feed_redpotion then global.total_passive_feed_redpotion = 0 end
|
||||||
local amount = math.ceil(global.difficulty_vote_value * global.evo_raise_counter)
|
local amount = math.ceil(global.difficulty_vote_value * global.evo_raise_counter * 0.75)
|
||||||
global.total_passive_feed_redpotion = global.total_passive_feed_redpotion + amount
|
global.total_passive_feed_redpotion = global.total_passive_feed_redpotion + amount
|
||||||
local biter_teams = {["north_biters"] = "north", ["south_biters"] = "south"}
|
local biter_teams = {["north_biters"] = "north", ["south_biters"] = "south"}
|
||||||
local a_team_has_players = false
|
local a_team_has_players = false
|
||||||
|
@ -288,10 +288,13 @@ function Public.server_restart()
|
|||||||
game.print("Map is restarting!", {r=0.22, g=0.88, b=0.22})
|
game.print("Map is restarting!", {r=0.22, g=0.88, b=0.22})
|
||||||
local message = 'Map is restarting! '
|
local message = 'Map is restarting! '
|
||||||
Server.to_discord_bold(table.concat{'*** ', message, ' ***'})
|
Server.to_discord_bold(table.concat{'*** ', message, ' ***'})
|
||||||
--Server.start_scenario('Biter_Battles')
|
--Server.start_scenario('Biter_Battles')
|
||||||
|
|
||||||
|
game.remove_offline_players()
|
||||||
|
|
||||||
Init.tables()
|
Init.tables()
|
||||||
Init.forces()
|
Init.forces()
|
||||||
Init.load_spawn()
|
Init.load_spawn()
|
||||||
for _, player in pairs(game.players) do
|
for _, player in pairs(game.players) do
|
||||||
Functions.init_player(player)
|
Functions.init_player(player)
|
||||||
for _, e in pairs(player.gui.left.children) do e.destroy() end
|
for _, e in pairs(player.gui.left.children) do e.destroy() end
|
||||||
|
@ -17,9 +17,8 @@ function Public.initial_setup()
|
|||||||
game.create_force("south_biters")
|
game.create_force("south_biters")
|
||||||
game.create_force("spectator")
|
game.create_force("spectator")
|
||||||
|
|
||||||
game.permissions.get_group("Default").set_allows_action(defines.input_action.grab_blueprint_record, false)
|
game.permissions.get_group("Default").set_allows_action(defines.input_action.open_blueprint_library_gui, false)
|
||||||
game.permissions.get_group("Default").set_allows_action(defines.input_action.import_blueprint_string, false)
|
game.permissions.get_group("Default").set_allows_action(defines.input_action.import_blueprint_string, false)
|
||||||
game.permissions.get_group("Default").set_allows_action(defines.input_action.import_blueprint, false)
|
|
||||||
|
|
||||||
local p = game.permissions.create_group("spectator")
|
local p = game.permissions.create_group("spectator")
|
||||||
for action_name, _ in pairs(defines.input_action) do
|
for action_name, _ in pairs(defines.input_action) do
|
||||||
@ -121,7 +120,7 @@ function Public.source_surface()
|
|||||||
Terrain.generate_additional_spawn_ore(surface)
|
Terrain.generate_additional_spawn_ore(surface)
|
||||||
Terrain.generate_silo(surface)
|
Terrain.generate_silo(surface)
|
||||||
Terrain.draw_spawn_circle(surface)
|
Terrain.draw_spawn_circle(surface)
|
||||||
Terrain.generate_spawn_goodies(surface)
|
--Terrain.generate_spawn_goodies(surface)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Public.tables()
|
function Public.tables()
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
local Public = {}
|
local Public = {}
|
||||||
local LootRaffle = require "functions.loot_raffle"
|
--local LootRaffle = require "functions.loot_raffle"
|
||||||
local BiterRaffle = require "functions.biter_raffle"
|
local BiterRaffle = require "functions.biter_raffle"
|
||||||
local bb_config = require "maps.biter_battles_v2.config"
|
local bb_config = require "maps.biter_battles_v2.config"
|
||||||
|
|
||||||
@ -552,7 +552,7 @@ function Public.generate_silo(surface)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
--[[
|
||||||
function Public.generate_spawn_goodies(surface)
|
function Public.generate_spawn_goodies(surface)
|
||||||
local tiles = surface.find_tiles_filtered({name = "stone-path"})
|
local tiles = surface.find_tiles_filtered({name = "stone-path"})
|
||||||
table.shuffle_table(tiles)
|
table.shuffle_table(tiles)
|
||||||
@ -583,7 +583,7 @@ function Public.generate_spawn_goodies(surface)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
]]
|
||||||
--Landfill Restriction
|
--Landfill Restriction
|
||||||
function Public.restrict_landfill(surface, inventory, tiles)
|
function Public.restrict_landfill(surface, inventory, tiles)
|
||||||
for _, t in pairs(tiles) do
|
for _, t in pairs(tiles) do
|
||||||
|
Loading…
Reference in New Issue
Block a user