1
0
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:
MewMew 2020-08-20 03:08:11 +02:00
parent e5bb7ee1af
commit 7af65b9baf
5 changed files with 17 additions and 17 deletions

View File

@ -71,13 +71,11 @@ local functions = {
end,
["comfy_panel_blueprint_toggle"] = function(event)
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.import_blueprint_string, true)
game.permissions.get_group("Default").set_allows_action(defines.input_action.import_blueprint, 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)
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.import_blueprint_string, false)
game.permissions.get_group("Default").set_allows_action(defines.input_action.import_blueprint, 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)
end
end,
["comfy_panel_spaghett_toggle"] = function(event)
@ -189,7 +187,7 @@ local build_config_gui = (function (player, frame)
frame.add({type = "line"})
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.")
if not admin then switch.ignored_by_interaction = true end

View File

@ -421,7 +421,7 @@ Public.raise_evo = function()
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.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
local biter_teams = {["north_biters"] = "north", ["south_biters"] = "south"}
local a_team_has_players = false

View File

@ -288,10 +288,13 @@ function Public.server_restart()
game.print("Map is restarting!", {r=0.22, g=0.88, b=0.22})
local message = 'Map is restarting! '
Server.to_discord_bold(table.concat{'*** ', message, ' ***'})
--Server.start_scenario('Biter_Battles')
--Server.start_scenario('Biter_Battles')
game.remove_offline_players()
Init.tables()
Init.forces()
Init.load_spawn()
Init.load_spawn()
for _, player in pairs(game.players) do
Functions.init_player(player)
for _, e in pairs(player.gui.left.children) do e.destroy() end

View File

@ -17,9 +17,8 @@ function Public.initial_setup()
game.create_force("south_biters")
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.import_blueprint_string, false)
game.permissions.get_group("Default").set_allows_action(defines.input_action.import_blueprint, 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)
local p = game.permissions.create_group("spectator")
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_silo(surface)
Terrain.draw_spawn_circle(surface)
Terrain.generate_spawn_goodies(surface)
--Terrain.generate_spawn_goodies(surface)
end
function Public.tables()

View File

@ -1,5 +1,5 @@
local Public = {}
local LootRaffle = require "functions.loot_raffle"
--local LootRaffle = require "functions.loot_raffle"
local BiterRaffle = require "functions.biter_raffle"
local bb_config = require "maps.biter_battles_v2.config"
@ -552,7 +552,7 @@ function Public.generate_silo(surface)
end
end
end
--[[
function Public.generate_spawn_goodies(surface)
local tiles = surface.find_tiles_filtered({name = "stone-path"})
table.shuffle_table(tiles)
@ -583,7 +583,7 @@ function Public.generate_spawn_goodies(surface)
end
end
end
]]
--Landfill Restriction
function Public.restrict_landfill(surface, inventory, tiles)
for _, t in pairs(tiles) do