mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2024-12-30 23:17:53 +02:00
commands - buttons need to be activated to be able to use them
This commit is contained in:
parent
c8eee553ca
commit
ac5b568add
@ -7,7 +7,8 @@ local Global = require 'utils.global'
|
||||
local Gui = require 'utils.gui'
|
||||
|
||||
local this = {
|
||||
players = {}
|
||||
players = {},
|
||||
activate_custom_buttons = false
|
||||
}
|
||||
|
||||
Global.register(
|
||||
@ -554,11 +555,19 @@ local function set_location(player)
|
||||
local scale = player.display_scale
|
||||
|
||||
frame.location = {
|
||||
x = (resolution.width / 2) - ((54 + 258) * scale),
|
||||
x = (resolution.width / 2) - ((54 + -528) * scale),
|
||||
y = (resolution.height - (96 * scale))
|
||||
}
|
||||
end
|
||||
|
||||
function Public.activate_custom_buttons(value)
|
||||
if value then
|
||||
this.activate_custom_buttons = value
|
||||
else
|
||||
this.activate_custom_buttons = false
|
||||
end
|
||||
end
|
||||
|
||||
Gui.on_click(
|
||||
clear_corpse_button_name,
|
||||
function(event)
|
||||
@ -572,7 +581,9 @@ Event.add(
|
||||
local player = game.players[event.player_index]
|
||||
on_player_joined_game(player)
|
||||
|
||||
set_location(player)
|
||||
if this.activate_custom_buttons then
|
||||
set_location(player)
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
@ -580,7 +591,9 @@ Event.add(
|
||||
defines.events.on_player_display_resolution_changed,
|
||||
function(event)
|
||||
local player = game.get_player(event.player_index)
|
||||
set_location(player)
|
||||
if this.activate_custom_buttons then
|
||||
set_location(player)
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
@ -588,7 +601,9 @@ Event.add(
|
||||
defines.events.on_player_display_scale_changed,
|
||||
function(event)
|
||||
local player = game.get_player(event.player_index)
|
||||
set_location(player)
|
||||
if this.activate_custom_buttons then
|
||||
set_location(player)
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
|
@ -106,6 +106,7 @@ function Public.reset_map()
|
||||
Autostash.bottom_button(true)
|
||||
BuriedEnemies.reset()
|
||||
Commands.reset()
|
||||
Commands.activate_custom_buttons(true)
|
||||
|
||||
Poll.reset()
|
||||
ICW.reset()
|
||||
|
Loading…
Reference in New Issue
Block a user