mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 07:30:41 +09:00
Replace spaces with tabs
This commit is contained in:
1 parent
e63f1246da
commit
2ffb848fe6
15 files changed
+473
-473
No files matched your search
@@ -1,31 +1,31 @@
|
||||
-- Show inventory download progressbar
|
||||
function dialog_failed_download(player)
|
||||
if player.gui.screen.dialog_failed_download then
|
||||
player.gui.screen.dialog_failed_download.destroy()
|
||||
end
|
||||
if player.gui.screen.dialog_failed_download then
|
||||
player.gui.screen.dialog_failed_download.destroy()
|
||||
end
|
||||
|
||||
local frame = player.gui.screen.add {
|
||||
name = "dialog_failed_download",
|
||||
type = "frame",
|
||||
direction = "vertical",
|
||||
}
|
||||
local frame = player.gui.screen.add {
|
||||
name = "dialog_failed_download",
|
||||
type = "frame",
|
||||
direction = "vertical",
|
||||
}
|
||||
|
||||
local titlebar = frame.add {
|
||||
type = "flow",
|
||||
}
|
||||
titlebar.drag_target = frame
|
||||
local titlebar = frame.add {
|
||||
type = "flow",
|
||||
}
|
||||
titlebar.drag_target = frame
|
||||
|
||||
local title = titlebar.add {
|
||||
type = "label",
|
||||
style = "frame_title",
|
||||
caption = "Inventory sync download failed",
|
||||
}
|
||||
title.drag_target = frame
|
||||
local title = titlebar.add {
|
||||
type = "label",
|
||||
style = "frame_title",
|
||||
caption = "Inventory sync download failed",
|
||||
}
|
||||
title.drag_target = frame
|
||||
|
||||
local filler = titlebar.add {
|
||||
type = "empty-widget",
|
||||
style = "draggable_space_header",
|
||||
}
|
||||
local filler = titlebar.add {
|
||||
type = "empty-widget",
|
||||
style = "draggable_space_header",
|
||||
}
|
||||
filler.style.horizontally_stretchable = "on"
|
||||
filler.style.right_margin = 4
|
||||
filler.style.height = 24
|
||||
@@ -46,15 +46,15 @@ function dialog_failed_download(player)
|
||||
p1.style.single_line = false
|
||||
p1.style.bottom_margin = 8
|
||||
|
||||
local abort = content.add {
|
||||
name = "inventory_sync_failed_download_abort",
|
||||
type = "button",
|
||||
caption = "Continue with new inventory",
|
||||
tooltip = "Create a new empty temporary inventory. Items you pick up will be placed in a chest when the sync completes.",
|
||||
}
|
||||
local abort = content.add {
|
||||
name = "inventory_sync_failed_download_abort",
|
||||
type = "button",
|
||||
caption = "Continue with new inventory",
|
||||
tooltip = "Create a new empty temporary inventory. Items you pick up will be placed in a chest when the sync completes.",
|
||||
}
|
||||
|
||||
frame.force_auto_center()
|
||||
player.opened = frame
|
||||
frame.force_auto_center()
|
||||
player.opened = frame
|
||||
end
|
||||
|
||||
return dialog_failed_download
|
||||
@@ -2,22 +2,22 @@ local ensure_character = require("modules/inventory_sync/ensure_character")
|
||||
|
||||
-- on_gui_click
|
||||
local handle_gui_events = function(event)
|
||||
local player = game.get_player(event.player_index)
|
||||
local element = event.element
|
||||
if element.name == "inventory_sync_failed_download_abort" then
|
||||
-- Give the player a new inventory and mark it as dirty
|
||||
-- Show dirty status and an explanation in a GUI
|
||||
local player = game.get_player(event.player_index)
|
||||
local element = event.element
|
||||
if element.name == "inventory_sync_failed_download_abort" then
|
||||
-- Give the player a new inventory and mark it as dirty
|
||||
-- Show dirty status and an explanation in a GUI
|
||||
|
||||
-- Remove GUI element
|
||||
player.gui.screen.dialog_failed_download.destroy()
|
||||
-- Handle inventory dirtying
|
||||
if not global.inventory_sync.players[player.name].dirty_inventory then
|
||||
global.inventory_sync.players[player.name].dirty_inventory = true
|
||||
|
||||
-- Restore player character
|
||||
ensure_character(player)
|
||||
end
|
||||
end
|
||||
-- Remove GUI element
|
||||
player.gui.screen.dialog_failed_download.destroy()
|
||||
-- Handle inventory dirtying
|
||||
if not global.inventory_sync.players[player.name].dirty_inventory then
|
||||
global.inventory_sync.players[player.name].dirty_inventory = true
|
||||
|
||||
-- Restore player character
|
||||
ensure_character(player)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return handle_gui_events
|
||||
@@ -1,34 +1,34 @@
|
||||
-- Show inventory download progressbar
|
||||
function open_dialog(player, progress, total)
|
||||
if player.gui.screen.inventory_sync_progress then
|
||||
player.gui.screen.inventory_sync_progress.destroy()
|
||||
end
|
||||
if progress == total then
|
||||
return -- Hide dialog on completed download
|
||||
end
|
||||
if player.gui.screen.inventory_sync_progress then
|
||||
player.gui.screen.inventory_sync_progress.destroy()
|
||||
end
|
||||
if progress == total then
|
||||
return -- Hide dialog on completed download
|
||||
end
|
||||
|
||||
local frame = player.gui.screen.add {
|
||||
name = "inventory_sync_progress",
|
||||
type = "frame",
|
||||
direction = "vertical",
|
||||
}
|
||||
local frame = player.gui.screen.add {
|
||||
name = "inventory_sync_progress",
|
||||
type = "frame",
|
||||
direction = "vertical",
|
||||
}
|
||||
|
||||
local titlebar = frame.add {
|
||||
type = "flow",
|
||||
}
|
||||
titlebar.drag_target = frame
|
||||
local titlebar = frame.add {
|
||||
type = "flow",
|
||||
}
|
||||
titlebar.drag_target = frame
|
||||
|
||||
local title = titlebar.add {
|
||||
type = "label",
|
||||
style = "frame_title",
|
||||
caption = "Inventory sync",
|
||||
}
|
||||
title.drag_target = frame
|
||||
local title = titlebar.add {
|
||||
type = "label",
|
||||
style = "frame_title",
|
||||
caption = "Inventory sync",
|
||||
}
|
||||
title.drag_target = frame
|
||||
|
||||
local filler = titlebar.add {
|
||||
type = "empty-widget",
|
||||
style = "draggable_space_header",
|
||||
}
|
||||
local filler = titlebar.add {
|
||||
type = "empty-widget",
|
||||
style = "draggable_space_header",
|
||||
}
|
||||
filler.style.horizontally_stretchable = "on"
|
||||
filler.style.right_margin = 4
|
||||
filler.style.height = 24
|
||||
@@ -58,14 +58,14 @@ function open_dialog(player, progress, total)
|
||||
p1.style.single_line = false
|
||||
p1.style.bottom_margin = 8
|
||||
|
||||
local progressbar = content.add {
|
||||
type = "progressbar",
|
||||
value = progress / total,
|
||||
}
|
||||
progressbar.style.width = 376 -- inside_shallow_frame_with_padding has 12px padding on each side
|
||||
local progressbar = content.add {
|
||||
type = "progressbar",
|
||||
value = progress / total,
|
||||
}
|
||||
progressbar.style.width = 376 -- inside_shallow_frame_with_padding has 12px padding on each side
|
||||
|
||||
frame.force_auto_center()
|
||||
player.opened = frame
|
||||
frame.force_auto_center()
|
||||
player.opened = frame
|
||||
end
|
||||
|
||||
return open_dialog
|
||||
@@ -1,9 +1,9 @@
|
||||
local function welcome_new_player(player_name)
|
||||
local player = game.get_player(player_name)
|
||||
if player == nil then return end
|
||||
player.print("Welcome to the server!")
|
||||
player.print("Your inventory will be automatically synchronized between servers in this cluster.")
|
||||
player.print("To improve sync performance, please avoid storing blueprints in your inventory.")
|
||||
local player = game.get_player(player_name)
|
||||
if player == nil then return end
|
||||
player.print("Welcome to the server!")
|
||||
player.print("Your inventory will be automatically synchronized between servers in this cluster.")
|
||||
player.print("To improve sync performance, please avoid storing blueprints in your inventory.")
|
||||
end
|
||||
|
||||
return welcome_new_player
|
||||
Reference in new issue
Block a user