mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-03-31 21:55:10 +02:00
luacheck
This commit is contained in:
parent
84bcafa167
commit
71aa65cfd2
@ -1,14 +1,14 @@
|
|||||||
-- This file is part of thesixthroc's Pirate Ship softmod, licensed under GPLv3 and stored at https://github.com/ComfyFactory/ComfyFactorio and https://github.com/danielmartin0/ComfyFactorio-Pirates.
|
-- This file is part of thesixthroc's Pirate Ship softmod, licensed under GPLv3 and stored at https://github.com/ComfyFactory/ComfyFactorio and https://github.com/danielmartin0/ComfyFactorio-Pirates.
|
||||||
|
|
||||||
local Common = require('maps.pirates.common')
|
local Common = require('maps.pirates.common')
|
||||||
local Memory = require('maps.pirates.memory')
|
-- local Memory = require('maps.pirates.memory')
|
||||||
local Math = require('maps.pirates.math')
|
local Math = require('maps.pirates.math')
|
||||||
local _inspect = require('utils.inspect')
|
local _inspect = require('utils.inspect')
|
||||||
local Token = require('utils.token')
|
local Token = require('utils.token')
|
||||||
|
|
||||||
local Public = {}
|
local Public = {}
|
||||||
|
|
||||||
function Public.pick_up_treasure_tick(tick_interval)
|
function Public.pick_up_treasure_tick()
|
||||||
if Common.activecrewcount() == 0 then
|
if Common.activecrewcount() == 0 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -29,7 +29,6 @@ function Public.pick_up_treasure_tick(tick_interval)
|
|||||||
|
|
||||||
local maps = dynamic_data.treasure_maps or {}
|
local maps = dynamic_data.treasure_maps or {}
|
||||||
local buried_treasure = dynamic_data.buried_treasure or {}
|
local buried_treasure = dynamic_data.buried_treasure or {}
|
||||||
local ghosts = dynamic_data.ghosts or {}
|
|
||||||
|
|
||||||
for i = 1, #maps do
|
for i = 1, #maps do
|
||||||
local map = maps[i]
|
local map = maps[i]
|
||||||
@ -80,7 +79,7 @@ function Public.pick_up_treasure_tick(tick_interval)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Public.buried_treasure_tick(tick_interval)
|
function Public.buried_treasure_tick()
|
||||||
if Common.activecrewcount() == 0 then
|
if Common.activecrewcount() == 0 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -166,15 +165,16 @@ function Public.buried_treasure_tick(tick_interval)
|
|||||||
if destination.dynamic_data.treasure_remaining == 0 then
|
if destination.dynamic_data.treasure_remaining == 0 then
|
||||||
-- destroy all
|
-- destroy all
|
||||||
local buried_treasure = destination.dynamic_data.buried_treasure
|
local buried_treasure = destination.dynamic_data.buried_treasure
|
||||||
for _, t2 in pairs(buried_treasure) do
|
for k, _ in pairs(buried_treasure) do
|
||||||
t2 = nil
|
buried_treasure[k] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
local maps = destination.dynamic_data.treasure_maps
|
local maps = destination.dynamic_data.treasure_maps
|
||||||
for _, m in pairs(maps) do
|
for k, m in pairs(maps) do
|
||||||
if m.state == 'on_ground' then
|
if m.state == 'on_ground' then
|
||||||
m.mapobject_rendering.destroy()
|
m.mapobject_rendering.destroy()
|
||||||
end
|
end
|
||||||
m = nil
|
maps[k] = nil
|
||||||
end
|
end
|
||||||
elseif t.count <= 0 then
|
elseif t.count <= 0 then
|
||||||
treasure.treasure = nil
|
treasure.treasure = nil
|
||||||
|
@ -115,7 +115,7 @@ function Public.toggle_window(player)
|
|||||||
if gui_memory and gui_memory[window_name] and gui_memory[window_name].position then
|
if gui_memory and gui_memory[window_name] and gui_memory[window_name].position then
|
||||||
flow.location = gui_memory[window_name].position
|
flow.location = gui_memory[window_name].position
|
||||||
else
|
else
|
||||||
flow.location = GuiCommon.default_window_positions[window_name] or {x = 300, y = 76}
|
flow.location = GuiCommon.default_window_positions[window_name] or { x = 300, y = 76 }
|
||||||
end
|
end
|
||||||
|
|
||||||
flow.style.maximal_width = 500
|
flow.style.maximal_width = 500
|
||||||
|
@ -1039,7 +1039,8 @@ function Public.update_gui(player)
|
|||||||
flow1 = pirates_flow.treasure_piratebutton_frame
|
flow1 = pirates_flow.treasure_piratebutton_frame
|
||||||
local maps = BuriedTreasure.get_picked_up_treasure_maps()
|
local maps = BuriedTreasure.get_picked_up_treasure_maps()
|
||||||
flow1.visible = #maps > 0
|
flow1.visible = #maps > 0
|
||||||
local flow2 = flow1.treasure_piratebutton
|
|
||||||
|
flow2 = flow1.treasure_piratebutton
|
||||||
flow2.tooltip = { 'pirates.gui_treasure_tooltip', #maps }
|
flow2.tooltip = { 'pirates.gui_treasure_tooltip', #maps }
|
||||||
flow2.number = #maps
|
flow2.number = #maps
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ local _inspect = require('utils.inspect').inspect
|
|||||||
local GuiCommon = require('maps.pirates.gui.common')
|
local GuiCommon = require('maps.pirates.gui.common')
|
||||||
local BuriedTreasure = require('maps.pirates.buried_treasure')
|
local BuriedTreasure = require('maps.pirates.buried_treasure')
|
||||||
local Common = require('maps.pirates.common')
|
local Common = require('maps.pirates.common')
|
||||||
local Memory = require('maps.pirates.memory')
|
-- local Memory = require('maps.pirates.memory')
|
||||||
local Surfaces = require('maps.pirates.surfaces.surfaces')
|
local Surfaces = require('maps.pirates.surfaces.surfaces')
|
||||||
|
|
||||||
local Public = {}
|
local Public = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user