mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-02-07 13:31:54 +02:00
updates and bug fixes
This commit is contained in:
parent
a9351d184a
commit
f1567097c0
@ -41,7 +41,8 @@ end
|
|||||||
local function get_stack_size(name)
|
local function get_stack_size(name)
|
||||||
local proto = game.item_prototypes[name]
|
local proto = game.item_prototypes[name]
|
||||||
if not proto then
|
if not proto then
|
||||||
game.print('item prototype not found')
|
log('item prototype ' .. name .. ' not found')
|
||||||
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
return proto.stack_size
|
return proto.stack_size
|
||||||
@ -80,18 +81,16 @@ local function do_item(name, count, inv, storage)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function tick()
|
local function tick()
|
||||||
local current = chests_data.next
|
local chest
|
||||||
chests_data.next = next(chests, current)
|
chests_data.next, chest = next(chests, chests_data.next)
|
||||||
|
|
||||||
if not current then
|
if not chest then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local chest = chests[current]
|
|
||||||
|
|
||||||
local entity = chest.entity
|
local entity = chest.entity
|
||||||
if not entity or not entity.valid then
|
if not entity or not entity.valid then
|
||||||
chests[current] = nil
|
chests[chests_data.next] = nil
|
||||||
else
|
else
|
||||||
local storage = chest.storage
|
local storage = chest.storage
|
||||||
local inv = entity.get_inventory(1) --defines.inventory.chest
|
local inv = entity.get_inventory(1) --defines.inventory.chest
|
||||||
@ -122,7 +121,8 @@ local function create_chest_gui_content(frame, player, chest)
|
|||||||
sprite = 'item/' .. name,
|
sprite = 'item/' .. name,
|
||||||
number = number,
|
number = number,
|
||||||
tooltip = name,
|
tooltip = name,
|
||||||
style = 'slot_button'
|
--style = 'slot_button'
|
||||||
|
enabled = false
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -133,7 +133,8 @@ local function create_chest_gui_content(frame, player, chest)
|
|||||||
sprite = 'item/' .. name,
|
sprite = 'item/' .. name,
|
||||||
number = count,
|
number = count,
|
||||||
tooltip = name,
|
tooltip = name,
|
||||||
style = 'slot_button'
|
--style = 'slot_button'
|
||||||
|
enabled = false
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -202,7 +203,7 @@ Event.add(defines.events.on_built_entity, built_entity)
|
|||||||
Event.add(defines.events.on_robot_built_entity, built_entity)
|
Event.add(defines.events.on_robot_built_entity, built_entity)
|
||||||
Event.add(defines.events.on_player_mined_entity, mined_entity)
|
Event.add(defines.events.on_player_mined_entity, mined_entity)
|
||||||
Event.add(defines.events.on_robot_mined_entity, mined_entity)
|
Event.add(defines.events.on_robot_mined_entity, mined_entity)
|
||||||
Event.on_nth_tick(1, tick)
|
Event.add(defines.events.on_tick, tick)
|
||||||
Event.add(defines.events.on_gui_opened, gui_opened)
|
Event.add(defines.events.on_gui_opened, gui_opened)
|
||||||
|
|
||||||
Gui.on_custom_close(
|
Gui.on_custom_close(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user