@ -36,7 +36,7 @@ local function place_entity_on_surface(entity, surface, replace, player)
|
||||
end
|
||||
|
||||
Event.add(defines.events.on_chunk_generated, function(event)
|
||||
if event.surface.name == "antigrief" then
|
||||
if event.surface.name == "antigrief" then
|
||||
local tiles = {}
|
||||
for x = event.area.left_top.x, event.area.right_bottom.x - 1 do
|
||||
for y = event.area.left_top.y, event.area.right_bottom.y - 1 do
|
||||
@ -51,7 +51,7 @@ local function get_position_str(pos)
|
||||
return string.format("%d|%d", pos.x, pos.y)
|
||||
end
|
||||
|
||||
local function on_entity_changed(event)
|
||||
local function on_entity_changed(event)
|
||||
local entity = event.entity or event.destination
|
||||
local player = game.players[event.player_index]
|
||||
if player.admin or not entity.valid then return end --Freebees for admins
|
||||
@ -63,7 +63,7 @@ local function on_entity_changed(event)
|
||||
end
|
||||
end
|
||||
|
||||
Event.add(defines.events.on_robot_pre_mined, function(event)
|
||||
Event.add(defines.events.on_robot_pre_mined, function(event)
|
||||
--The bot isnt the culprit! The last user is! They marked it for deconstruction!
|
||||
if event.entity.valid and event.entity.last_user then
|
||||
event.player_index = event.entity.last_user.index
|
||||
@ -79,7 +79,7 @@ local function get_pre_rotate_direction(entity)
|
||||
return direction
|
||||
end
|
||||
|
||||
Event.add(defines.events.on_player_rotated_entity, function(event)
|
||||
Event.add(defines.events.on_player_rotated_entity, function(event)
|
||||
local entity = event.entity
|
||||
|
||||
if not entity.valid then return end
|
||||
@ -99,7 +99,7 @@ Event.add(defines.events.on_player_rotated_entity, function(event)
|
||||
end)
|
||||
Event.add(defines.events.on_pre_entity_settings_pasted, on_entity_changed)
|
||||
|
||||
Event.add(defines.events.on_entity_died, function(event)
|
||||
Event.add(defines.events.on_entity_died, function(event)
|
||||
--is a player on the same force as the destroyed object
|
||||
if event.entity and event.entity.valid and event.entity.force.name == "player" and event.cause and
|
||||
event.cause.force == event.entity.force and event.cause.type == "player" then
|
||||
@ -146,7 +146,7 @@ Module.undo = function(player)
|
||||
--Place removed entity IF no collision is detected
|
||||
local last_user = global.original_last_users_by_ent_pos[get_position_str(e.position)]
|
||||
local new_entity = place_entity_on_surface(e, game.surfaces.nauvis, false, last_user)
|
||||
--Transfere items
|
||||
--Transfer items
|
||||
if new_entity then
|
||||
|
||||
local player = Utils.ternary(new_entity.last_user, new_entity.last_user, game.player)
|
||||
|
3
band.lua
@ -1,6 +1,7 @@
|
||||
local Event = require 'utils.event'
|
||||
local Gui = require 'utils.gui'
|
||||
local Token = require 'utils.global_token'
|
||||
local UserGroups = require 'user_groups'
|
||||
|
||||
local band_roles = require 'resources.band_roles'
|
||||
local band_roles_token = Token.register_global(band_roles)
|
||||
@ -200,7 +201,7 @@ local function draw_main_frame(player)
|
||||
flow.add {type = 'button', name = main_button_name, caption = 'Close'}
|
||||
flow.add {type = 'button', name = clear_button_name, caption = 'Clear Tag'}
|
||||
|
||||
if player.admin or is_regular(player.name) then
|
||||
if player.admin or UserGroups.is_regular(player.name) then
|
||||
flow.add {type = 'button', name = create_tag_button_name, caption = 'Create Tag'}
|
||||
end
|
||||
end
|
||||
|
@ -320,7 +320,8 @@ local function toggle(event)
|
||||
player_filters[event.player_index] = p_filters
|
||||
end
|
||||
|
||||
local left = event.player.gui.left
|
||||
local player = event.player
|
||||
local left = player.gui.left
|
||||
local main_frame = left[main_frame_name]
|
||||
|
||||
if main_frame and main_frame.valid then
|
||||
@ -333,6 +334,14 @@ local function toggle(event)
|
||||
|
||||
Gui.remove_data_recursivly(main_frame)
|
||||
main_frame.destroy()
|
||||
|
||||
if player.opened_gui_type == defines.gui_type.custom then
|
||||
local opened = player.opened
|
||||
if opened and opened.valid and opened.name == filters_table_name then
|
||||
Gui.remove_data_recursivly(opened)
|
||||
opened.destroy()
|
||||
end
|
||||
end
|
||||
else
|
||||
main_frame =
|
||||
left.add {
|
||||
@ -352,8 +361,9 @@ local function toggle(event)
|
||||
local label =
|
||||
flipper_frame.add {
|
||||
type = 'label',
|
||||
caption = 'Place blueprint on buttons below to flip blueprint.\n' ..
|
||||
'Obviously this wont work correctly with refineries or chemical plants.'
|
||||
caption = [[
|
||||
Place blueprint on buttons below to flip blueprint.
|
||||
Obviously this wont work correctly with refineries or chemical plants.]]
|
||||
}
|
||||
label.style.single_line = false
|
||||
|
||||
@ -479,8 +489,10 @@ Gui.on_click(
|
||||
local frame = Gui.get_data(element)
|
||||
local filter_button = Gui.get_data(frame)
|
||||
|
||||
filter_button.sprite = element.sprite
|
||||
filter_button.tooltip = element.tooltip
|
||||
if filter_button and filter_button.valid then
|
||||
filter_button.sprite = element.sprite
|
||||
filter_button.tooltip = element.tooltip
|
||||
end
|
||||
|
||||
Gui.remove_data_recursivly(frame)
|
||||
frame.destroy()
|
||||
@ -536,6 +548,7 @@ Gui.on_click(
|
||||
local cursor = getBlueprintCursorStack(player)
|
||||
if not cursor then
|
||||
player.print('Click the button with a blueprint or blueprint book.')
|
||||
return
|
||||
end
|
||||
|
||||
local data = Gui.get_data(event.element)
|
||||
|
17
control.lua
@ -10,6 +10,7 @@ require 'walk_distance'
|
||||
require 'follow'
|
||||
require 'autodeconstruct'
|
||||
require 'corpse_util'
|
||||
require 'infinite_storage_chest'
|
||||
require 'fish_market'
|
||||
require 'reactor_meltdown'
|
||||
require 'map_layout'
|
||||
@ -140,9 +141,23 @@ Event.add(defines.events.on_console_chat, hodor)
|
||||
Event.add(
|
||||
defines.events.on_player_joined_game,
|
||||
function(event)
|
||||
local gui = game.players[event.player_index].gui
|
||||
local player = game.players[event.player_index]
|
||||
if not player or not player.valid then
|
||||
return
|
||||
end
|
||||
|
||||
if player.name == 'grilledham' then
|
||||
-- pink
|
||||
player.color = {r = 0.9290000202716064, g = 0.3860000739097595, b = 0.51399999856948853, a = 0.5}
|
||||
player.chat_color = {r = 1, g = 0.51999998092651367, b = 0.63300001621246338, a = 0.5}
|
||||
end
|
||||
|
||||
local gui = player.gui
|
||||
gui.top.style = 'slot_table_spacing_horizontal_flow'
|
||||
gui.left.style = 'slot_table_spacing_vertical_flow'
|
||||
|
||||
--[[ player.insert {name = 'infinity-chest', count = 10}
|
||||
player.insert {name = 'electric-energy-interface', count = 10}
|
||||
player.cheat_mode = true ]]
|
||||
end
|
||||
)
|
||||
|
@ -72,16 +72,24 @@ global.walking = {}
|
||||
local custom_commands_return_player =
|
||||
Token.register(
|
||||
function(args)
|
||||
global.walking[args.player.name:lower()] = false
|
||||
args.player.character.destroy()
|
||||
local character = args.player.surface.find_entity('player', args.position)
|
||||
if character ~= nil and character.valid then
|
||||
args.player.character = character
|
||||
else
|
||||
args.player.create_character()
|
||||
local player = args.player
|
||||
if not player.valid then
|
||||
return
|
||||
end
|
||||
args.player.force = args.force
|
||||
args.player.teleport(args.position)
|
||||
|
||||
global.walking[player.index] = false
|
||||
player.character.destroy()
|
||||
|
||||
local character = args.character
|
||||
if character ~= nil and character.valid then
|
||||
player.character = character
|
||||
else
|
||||
player.create_character()
|
||||
player.teleport(args.position)
|
||||
end
|
||||
|
||||
player.force = args.force
|
||||
|
||||
game.print(args.player.name .. ' came back from his walkabout.')
|
||||
end
|
||||
)
|
||||
@ -93,7 +101,7 @@ local function walkabout(cmd)
|
||||
end
|
||||
local params = {}
|
||||
if cmd.parameter == nil then
|
||||
player_print('Walkabout failed.')
|
||||
player_print('Walkabout failed, check /help walkabout.')
|
||||
return
|
||||
end
|
||||
for param in string.gmatch(cmd.parameter, '%S+') do
|
||||
@ -115,7 +123,7 @@ local function walkabout(cmd)
|
||||
end
|
||||
|
||||
local player = game.players[player_name]
|
||||
if type(player) ~= 'table' or global.walking[player_name:lower()] then
|
||||
if player == nil or not player.valid or global.walking[player.index] then
|
||||
player_print(player_name .. ' could not go on a walkabout.')
|
||||
return
|
||||
end
|
||||
@ -124,25 +132,28 @@ local function walkabout(cmd)
|
||||
table.insert(chunks, chunk)
|
||||
end
|
||||
|
||||
local chunk = chunks[math.random(#chunks)]
|
||||
if not chunk then
|
||||
return
|
||||
end
|
||||
local surface = player.surface
|
||||
local chunk = surface.get_random_chunk()
|
||||
local pos = {x = chunk.x * 32, y = chunk.y * 32}
|
||||
local non_colliding_pos = player.surface.find_non_colliding_position('player', pos, 100, 1)
|
||||
local non_colliding_pos = surface.find_non_colliding_position('player', pos, 100, 1)
|
||||
|
||||
if non_colliding_pos then
|
||||
game.print(player_name .. ' went on a walkabout, to find himself.')
|
||||
Task.set_timeout(
|
||||
duration,
|
||||
custom_commands_return_player,
|
||||
{player = player, force = player.force, position = {x = player.position.x, y = player.position.y}}
|
||||
{
|
||||
player = player,
|
||||
force = player.force,
|
||||
position = {x = player.position.x, y = player.position.y},
|
||||
character = player.character
|
||||
}
|
||||
)
|
||||
player.character = nil
|
||||
player.create_character()
|
||||
player.teleport(non_colliding_pos)
|
||||
player.force = 'enemy'
|
||||
global.walking[player_name:lower()] = true
|
||||
player.force = 'neutral'
|
||||
global.walking[player.index] = true
|
||||
else
|
||||
player_print('Walkabout failed: count find non colliding position')
|
||||
end
|
||||
@ -475,35 +486,67 @@ end
|
||||
|
||||
global.undo_warned_players = {}
|
||||
local function undo(cmd)
|
||||
if (not game.player) or not game.player.admin then
|
||||
cant_run(cmd.name)
|
||||
return
|
||||
end
|
||||
if cmd.parameter and game.players[cmd.parameter] then
|
||||
if not global.undo_warned_players[game.player.index] or global.undo_warned_players[game.player.index] ~= game.players[cmd.parameter].index then
|
||||
global.undo_warned_players[game.player.index] = game.players[cmd.parameter].index
|
||||
game.player.print(
|
||||
string.format("Warning! You are about to remove %s entities and restore %s entities.",
|
||||
#Utils.find_entities_by_last_user(game.players[cmd.parameter], game.surfaces.nauvis),
|
||||
Antigrief.count_removed_entities(game.players[cmd.parameter]))
|
||||
)
|
||||
game.player.print("To execute the command please run it again.")
|
||||
return
|
||||
if (not game.player) or not game.player.admin then
|
||||
cant_run(cmd.name)
|
||||
return
|
||||
end
|
||||
if cmd.parameter and game.players[cmd.parameter] then
|
||||
if
|
||||
not global.undo_warned_players[game.player.index] or
|
||||
global.undo_warned_players[game.player.index] ~= game.players[cmd.parameter].index
|
||||
then
|
||||
global.undo_warned_players[game.player.index] = game.players[cmd.parameter].index
|
||||
game.player.print(
|
||||
string.format(
|
||||
'Warning! You are about to remove %s entities and restore %s entities.',
|
||||
#Utils.find_entities_by_last_user(game.players[cmd.parameter], game.surfaces.nauvis),
|
||||
Antigrief.count_removed_entities(game.players[cmd.parameter])
|
||||
)
|
||||
)
|
||||
game.player.print('To execute the command please run it again.')
|
||||
return
|
||||
end
|
||||
Antigrief.undo(game.players[cmd.parameter])
|
||||
game.print(string.format('Undoing everything %s did...', cmd.parameter))
|
||||
global.undo_warned_players[game.player.index] = nil
|
||||
else
|
||||
player_print('Usage: /undo <player>')
|
||||
end
|
||||
Antigrief.undo(game.players[cmd.parameter])
|
||||
game.print(string.format("Undoing everything %s did...", cmd.parameter))
|
||||
global.undo_warned_players[game.player.index] = nil
|
||||
else
|
||||
player_print("Usage: /undo <player>")
|
||||
end
|
||||
end
|
||||
|
||||
local function antigrief_surface_tp()
|
||||
if (not game.player) or not game.player.admin then
|
||||
cant_run(cmd.name)
|
||||
return
|
||||
end
|
||||
Antigrief.antigrief_surface_tp()
|
||||
if (not game.player) or not game.player.admin then
|
||||
cant_run(cmd.name)
|
||||
return
|
||||
end
|
||||
Antigrief.antigrief_surface_tp()
|
||||
end
|
||||
|
||||
local function find_player(cmd)
|
||||
local player = game.player
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
|
||||
local name = cmd.parameter
|
||||
if not name then
|
||||
player.print('Usage: /find-player <player>')
|
||||
return
|
||||
end
|
||||
|
||||
local target = game.players[name]
|
||||
if not target then
|
||||
player.print('player ' .. name .. ' not found')
|
||||
return
|
||||
end
|
||||
|
||||
target = target.character
|
||||
if not target or not target.valid then
|
||||
player.print('player ' .. name .. ' does not have a character')
|
||||
return
|
||||
end
|
||||
|
||||
player.add_custom_alert(target, {type = 'virtual', name = 'signal-F'}, player.name, true)
|
||||
end
|
||||
|
||||
if not _DEBUG then
|
||||
@ -532,15 +575,48 @@ commands.add_command('walkabout', '<player> <duration> - Send someone on a walk.
|
||||
commands.add_command('regulars', 'Prints a list of game regulars.', UserGroups.print_regulars)
|
||||
commands.add_command('regular', '<promote, demote>, <player> Change regular status of a player. (Admins only)', regular)
|
||||
commands.add_command('afk', 'Shows how long players have been afk.', afk)
|
||||
commands.add_command('follow', '<player> makes you follow the player. Use /unfollow to stop following a player.', follow)
|
||||
commands.add_command(
|
||||
'follow',
|
||||
'<player> makes you follow the player. Use /unfollow to stop following a player.',
|
||||
follow
|
||||
)
|
||||
commands.add_command('unfollow', 'stops following a player.', unfollow)
|
||||
commands.add_command('tpmode', 'Toggles tp mode. When on place a ghost entity to teleport there (Admins only)', toggle_tp_mode)
|
||||
commands.add_command(
|
||||
'tpmode',
|
||||
'Toggles tp mode. When on place a ghost entity to teleport there (Admins only)',
|
||||
toggle_tp_mode
|
||||
)
|
||||
commands.add_command('forcetoggle', 'Toggles the players force between player and enemy (Admins only)', forcetoggle)
|
||||
commands.add_command('tempban', '<player> <minutes> Temporarily bans a player (Admins only)', tempban)
|
||||
commands.add_command('spyshot', '<player> Sends a screenshot of player to discord. (If a host is online. If no host is online, you can become one yourself. Ask on discord :))', spyshot)
|
||||
commands.add_command(
|
||||
'spyshot',
|
||||
'<player> Sends a screenshot of player to discord. (If a host is online. If no host is online, you can become one yourself. Ask on discord :))',
|
||||
spyshot
|
||||
)
|
||||
commands.add_command('zoom', '<number> Sets your zoom.', zoom)
|
||||
commands.add_command('all-tech', 'researches all technologies', function() if game.player and game.player.admin then game.player.force.research_all_technologies() end end)
|
||||
commands.add_command('hax', 'Toggles your hax', function() if game.player and game.player.admin then game.player.cheat_mode = not game.player.cheat_mode end end)
|
||||
commands.add_command(
|
||||
'all-tech',
|
||||
'researches all technologies',
|
||||
function()
|
||||
if game.player and game.player.admin then
|
||||
game.player.force.research_all_technologies()
|
||||
end
|
||||
end
|
||||
)
|
||||
commands.add_command(
|
||||
'hax',
|
||||
'Toggles your hax',
|
||||
function()
|
||||
if game.player and game.player.admin then
|
||||
game.player.cheat_mode = not game.player.cheat_mode
|
||||
end
|
||||
end
|
||||
)
|
||||
commands.add_command('pool', 'Spawns a pool', pool)
|
||||
commands.add_command('undo', '<player> undoes everything a player has done (Admins only)', undo)
|
||||
commands.add_command('antigrief_surface', 'moves you to the antigrief surface or back (Admins only)', antigrief_surface_tp)
|
||||
commands.add_command(
|
||||
'antigrief_surface',
|
||||
'moves you to the antigrief surface or back (Admins only)',
|
||||
antigrief_surface_tp
|
||||
)
|
||||
commands.add_command('find-player', '<player> shows an alert on the map where the player is located', find_player)
|
||||
|
217
infinite_storage_chest.lua
Normal file
@ -0,0 +1,217 @@
|
||||
local Event = require 'utils.event'
|
||||
local Gui = require 'utils.gui'
|
||||
local Token = require 'utils.global_token'
|
||||
local Task = require 'utils.Task'
|
||||
|
||||
local chests = {}
|
||||
local chests_data = {chests = chests}
|
||||
local chests_data_token = Token.register_global(chests_data)
|
||||
|
||||
Event.on_load(
|
||||
function()
|
||||
chests_data = Token.get_global(chests_data_token)
|
||||
chests = chests_data.chests
|
||||
end
|
||||
)
|
||||
|
||||
local chest_gui_frame_name = Gui.uid_name()
|
||||
|
||||
local function built_entity(event)
|
||||
local entity = event.created_entity
|
||||
if not entity or not entity.valid or entity.name ~= 'infinity-chest' then
|
||||
return
|
||||
end
|
||||
|
||||
local pos = entity.position
|
||||
|
||||
chests[pos.x .. ',' .. pos.y] = {entity = entity, storage = {}}
|
||||
end
|
||||
|
||||
local function mined_entity(event)
|
||||
local entity = event.entity
|
||||
if not entity or not entity.valid or entity.name ~= 'infinity-chest' then
|
||||
return
|
||||
end
|
||||
|
||||
local pos = entity.position
|
||||
|
||||
chests[pos.x .. ',' .. pos.y] = nil
|
||||
end
|
||||
|
||||
local function get_stack_size(name)
|
||||
local proto = game.item_prototypes[name]
|
||||
if not proto then
|
||||
log('item prototype ' .. name .. ' not found')
|
||||
return 1
|
||||
end
|
||||
|
||||
return proto.stack_size
|
||||
end
|
||||
|
||||
local function do_item(name, count, inv, storage)
|
||||
local size = get_stack_size(name)
|
||||
local diff = count - size
|
||||
|
||||
if diff == 0 then
|
||||
return
|
||||
end
|
||||
|
||||
local new_amount = 0
|
||||
|
||||
if diff > 0 then
|
||||
inv.remove({name = name, count = diff})
|
||||
local prev = storage[name] or 0
|
||||
new_amount = prev + diff
|
||||
elseif diff < 0 then
|
||||
local prev = storage[name]
|
||||
if not prev then
|
||||
return
|
||||
end
|
||||
|
||||
diff = math.min(prev, -diff)
|
||||
local inserted = inv.insert({name = name, count = diff})
|
||||
new_amount = prev - inserted
|
||||
end
|
||||
|
||||
if new_amount == 0 then
|
||||
storage[name] = nil
|
||||
else
|
||||
storage[name] = new_amount
|
||||
end
|
||||
end
|
||||
|
||||
local function tick()
|
||||
local chest
|
||||
chests_data.next, chest = next(chests, chests_data.next)
|
||||
|
||||
if not chest then
|
||||
return
|
||||
end
|
||||
|
||||
local entity = chest.entity
|
||||
if not entity or not entity.valid then
|
||||
chests[chests_data.next] = nil
|
||||
else
|
||||
local storage = chest.storage
|
||||
local inv = entity.get_inventory(1) --defines.inventory.chest
|
||||
local contents = inv.get_contents()
|
||||
|
||||
for name, count in pairs(contents) do
|
||||
do_item(name, count, inv, storage)
|
||||
end
|
||||
|
||||
for name, _ in pairs(storage) do
|
||||
if not contents[name] then
|
||||
do_item(name, 0, inv, storage)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function create_chest_gui_content(frame, player, chest)
|
||||
local storage = chest.storage
|
||||
local inv = chest.entity.get_inventory(1).get_contents()
|
||||
|
||||
local grid = frame.add {type = 'table', column_count = 10, style = 'slot_table'}
|
||||
|
||||
for name, count in pairs(storage) do
|
||||
local number = count + (inv[name] or 0)
|
||||
grid.add {
|
||||
type = 'sprite-button',
|
||||
sprite = 'item/' .. name,
|
||||
number = number,
|
||||
tooltip = name,
|
||||
--style = 'slot_button'
|
||||
enabled = false
|
||||
}
|
||||
end
|
||||
|
||||
for name, count in pairs(inv) do
|
||||
if not storage[name] then
|
||||
grid.add {
|
||||
type = 'sprite-button',
|
||||
sprite = 'item/' .. name,
|
||||
number = count,
|
||||
tooltip = name,
|
||||
--style = 'slot_button'
|
||||
enabled = false
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
player.opened = frame
|
||||
end
|
||||
|
||||
local chest_gui_content_callback
|
||||
chest_gui_content_callback =
|
||||
Token.register(
|
||||
function(data)
|
||||
local player = data.player
|
||||
|
||||
if not player or not player.valid then
|
||||
return
|
||||
end
|
||||
|
||||
local opened = data.opened
|
||||
if not opened or not opened.valid then
|
||||
return
|
||||
end
|
||||
|
||||
if not player.connected then
|
||||
player.opened = nil
|
||||
opened.destroy()
|
||||
end
|
||||
|
||||
opened.clear()
|
||||
create_chest_gui_content(opened, player, data.chest)
|
||||
|
||||
Task.set_timeout_in_ticks(60, chest_gui_content_callback, data)
|
||||
end
|
||||
)
|
||||
|
||||
local function gui_opened(event)
|
||||
if not event.gui_type == defines.gui_type.entity then
|
||||
return
|
||||
end
|
||||
|
||||
local entity = event.entity
|
||||
if not entity or not entity.valid or entity.name ~= 'infinity-chest' then
|
||||
return
|
||||
end
|
||||
|
||||
local pos = entity.position
|
||||
local chest = chests[pos.x .. ',' .. pos.y]
|
||||
|
||||
if not chest then
|
||||
return
|
||||
end
|
||||
|
||||
local player = game.players[event.player_index]
|
||||
if not player or not player.valid then
|
||||
return
|
||||
end
|
||||
|
||||
local frame =
|
||||
player.gui.center.add {type = 'frame', name = chest_gui_frame_name, caption = 'Infinite Storage Chest'}
|
||||
|
||||
create_chest_gui_content(frame, player, chest)
|
||||
|
||||
Task.set_timeout_in_ticks(60, chest_gui_content_callback, {player = player, chest = chest, opened = frame})
|
||||
end
|
||||
|
||||
Event.add(defines.events.on_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_robot_mined_entity, mined_entity)
|
||||
Event.add(defines.events.on_tick, tick)
|
||||
Event.add(defines.events.on_gui_opened, gui_opened)
|
||||
|
||||
Gui.on_custom_close(
|
||||
chest_gui_frame_name,
|
||||
function(event)
|
||||
event.element.destroy()
|
||||
end
|
||||
)
|
||||
|
||||
local market_items = require 'resources.market_items'
|
||||
table.insert(market_items, {price = {{'raw-fish', 100}}, offer = {type = 'give-item', item = 'infinity-chest'}})
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
Before Width: | Height: | Size: 149 KiB After Width: | Height: | Size: 149 KiB |
Before Width: | Height: | Size: 173 KiB After Width: | Height: | Size: 173 KiB |
Before Width: | Height: | Size: 167 KiB After Width: | Height: | Size: 167 KiB |
Before Width: | Height: | Size: 161 KiB After Width: | Height: | Size: 161 KiB |
Before Width: | Height: | Size: 142 KiB After Width: | Height: | Size: 142 KiB |
Before Width: | Height: | Size: 160 KiB After Width: | Height: | Size: 160 KiB |
Before Width: | Height: | Size: 282 KiB After Width: | Height: | Size: 282 KiB |
Before Width: | Height: | Size: 166 KiB After Width: | Height: | Size: 166 KiB |
Before Width: | Height: | Size: 138 KiB After Width: | Height: | Size: 138 KiB |
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 236 KiB After Width: | Height: | Size: 236 KiB |
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 226 KiB After Width: | Height: | Size: 226 KiB |
Before Width: | Height: | Size: 215 KiB After Width: | Height: | Size: 215 KiB |
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 127 KiB |
Before Width: | Height: | Size: 162 KiB After Width: | Height: | Size: 162 KiB |
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 116 KiB |
Before Width: | Height: | Size: 199 KiB After Width: | Height: | Size: 199 KiB |
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 101 KiB |
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 142 KiB After Width: | Height: | Size: 142 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 143 KiB After Width: | Height: | Size: 143 KiB |
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 130 KiB |
Before Width: | Height: | Size: 218 KiB After Width: | Height: | Size: 218 KiB |
Before Width: | Height: | Size: 237 KiB After Width: | Height: | Size: 237 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 129 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 239 KiB After Width: | Height: | Size: 239 KiB |
Before Width: | Height: | Size: 287 KiB After Width: | Height: | Size: 287 KiB |
Before Width: | Height: | Size: 2.1 MiB After Width: | Height: | Size: 2.1 MiB |
Before Width: | Height: | Size: 191 KiB After Width: | Height: | Size: 191 KiB |
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 215 KiB After Width: | Height: | Size: 215 KiB |
Before Width: | Height: | Size: 216 KiB After Width: | Height: | Size: 216 KiB |
Before Width: | Height: | Size: 197 KiB After Width: | Height: | Size: 197 KiB |
Before Width: | Height: | Size: 186 KiB After Width: | Height: | Size: 186 KiB |
Before Width: | Height: | Size: 141 KiB After Width: | Height: | Size: 141 KiB |
Before Width: | Height: | Size: 176 KiB After Width: | Height: | Size: 176 KiB |
Before Width: | Height: | Size: 146 KiB After Width: | Height: | Size: 146 KiB |
Before Width: | Height: | Size: 121 KiB After Width: | Height: | Size: 121 KiB |
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 96 KiB |
Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 172 KiB |
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 128 KiB |
Before Width: | Height: | Size: 164 KiB After Width: | Height: | Size: 164 KiB |
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 129 KiB |
Before Width: | Height: | Size: 142 KiB After Width: | Height: | Size: 142 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 144 KiB |
Before Width: | Height: | Size: 166 KiB After Width: | Height: | Size: 166 KiB |
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 136 KiB |
Before Width: | Height: | Size: 2.0 MiB After Width: | Height: | Size: 2.0 MiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 109 KiB |
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 194 KiB After Width: | Height: | Size: 194 KiB |
Before Width: | Height: | Size: 181 KiB After Width: | Height: | Size: 181 KiB |
Before Width: | Height: | Size: 365 KiB After Width: | Height: | Size: 365 KiB |
Before Width: | Height: | Size: 223 KiB After Width: | Height: | Size: 223 KiB |
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 105 KiB |
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 765 KiB After Width: | Height: | Size: 765 KiB |
Before Width: | Height: | Size: 665 KiB After Width: | Height: | Size: 665 KiB |
Before Width: | Height: | Size: 150 KiB After Width: | Height: | Size: 150 KiB |
Before Width: | Height: | Size: 5.8 MiB After Width: | Height: | Size: 5.8 MiB |
Before Width: | Height: | Size: 630 KiB After Width: | Height: | Size: 630 KiB |
Before Width: | Height: | Size: 618 KiB After Width: | Height: | Size: 618 KiB |
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.4 MiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 87 KiB |
Before Width: | Height: | Size: 815 B After Width: | Height: | Size: 815 B |
Before Width: | Height: | Size: 406 KiB After Width: | Height: | Size: 406 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 403 B After Width: | Height: | Size: 403 B |
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
Before Width: | Height: | Size: 266 KiB After Width: | Height: | Size: 266 KiB |
Before Width: | Height: | Size: 526 KiB After Width: | Height: | Size: 526 KiB |
Before Width: | Height: | Size: 351 B After Width: | Height: | Size: 351 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |