mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-29 20:16:38 +09:00
Update all code styles
This commit is contained in:
@@ -8,7 +8,7 @@ local concat = table.concat
|
||||
|
||||
local Public = {}
|
||||
|
||||
local ignore = {tokens = true, data_store = true, datastores = true}
|
||||
local ignore = { tokens = true, data_store = true, datastores = true }
|
||||
|
||||
local header_name = Gui.uid_name()
|
||||
local left_panel_name = Gui.uid_name()
|
||||
@@ -16,40 +16,40 @@ local right_panel_name = Gui.uid_name()
|
||||
local input_text_box_name = Gui.uid_name()
|
||||
local refresh_name = Gui.uid_name()
|
||||
|
||||
Public.name = 'storage'
|
||||
Public.name = "storage"
|
||||
|
||||
function Public.show(container)
|
||||
local main_flow = container.add {type = 'flow', direction = 'horizontal'}
|
||||
local main_flow = container.add{ type = "flow", direction = "horizontal" }
|
||||
|
||||
local left_panel = main_flow.add {type = 'scroll-pane', name = left_panel_name}
|
||||
local left_panel = main_flow.add{ type = "scroll-pane", name = left_panel_name }
|
||||
local left_panel_style = left_panel.style
|
||||
left_panel_style.width = 300
|
||||
|
||||
for key, _ in pairs(storage) do
|
||||
if not ignore[key] then
|
||||
local header =
|
||||
left_panel.add({type = 'flow'}).add {type = 'label', name = header_name, caption = tostring(key)}
|
||||
left_panel.add{ type = "flow" }.add{ type = "label", name = header_name, caption = tostring(key) }
|
||||
Gui.set_data(header, key)
|
||||
end
|
||||
end
|
||||
|
||||
local right_flow = main_flow.add {type = 'flow', direction = 'vertical'}
|
||||
local right_flow = main_flow.add{ type = "flow", direction = "vertical" }
|
||||
|
||||
local right_top_flow = right_flow.add {type = 'flow', direction = 'horizontal'}
|
||||
local right_top_flow = right_flow.add{ type = "flow", direction = "horizontal" }
|
||||
|
||||
local input_text_box = right_top_flow.add {type = 'text-box', name = input_text_box_name}
|
||||
local input_text_box = right_top_flow.add{ type = "text-box", name = input_text_box_name }
|
||||
local input_text_box_style = input_text_box.style
|
||||
input_text_box_style.horizontally_stretchable = true
|
||||
input_text_box_style.height = 32
|
||||
input_text_box_style.maximal_width = 1000
|
||||
|
||||
local refresh_button =
|
||||
right_top_flow.add {type = 'sprite-button', name = refresh_name, sprite = 'utility/reset', tooltip = 'refresh'}
|
||||
right_top_flow.add{ type = "sprite-button", name = refresh_name, sprite = "utility/reset", tooltip = "refresh" }
|
||||
local refresh_button_style = refresh_button.style
|
||||
refresh_button_style.width = 32
|
||||
refresh_button_style.height = 32
|
||||
|
||||
local right_panel = right_flow.add {type = 'text-box', name = right_panel_name}
|
||||
local right_panel = right_flow.add{ type = "text-box", name = right_panel_name }
|
||||
right_panel.read_only = true
|
||||
right_panel.selectable = true
|
||||
|
||||
@@ -63,7 +63,7 @@ function Public.show(container)
|
||||
right_panel = right_panel,
|
||||
input_text_box = input_text_box,
|
||||
selected_header = nil,
|
||||
selected_token_id = nil
|
||||
selected_token_id = nil,
|
||||
}
|
||||
|
||||
Gui.set_data(input_text_box, data)
|
||||
@@ -90,10 +90,10 @@ Gui.on_click(
|
||||
element.style.font_color = Color.orange
|
||||
data.selected_header = element
|
||||
|
||||
input_text_box.text = concat {"storage['", key, "']"}
|
||||
input_text_box.text = concat{ "storage['", key, "']" }
|
||||
input_text_box.style.font_color = Color.black
|
||||
|
||||
local content = dump(storage[key]) or 'nil'
|
||||
local content = dump(storage[key]) or "nil"
|
||||
right_panel.text = content
|
||||
end
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user