1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-01-12 02:28:02 +02:00

GUI updates for #129

This commit is contained in:
TWLTriston 2017-12-15 11:52:26 -05:00
parent eb6beb7488
commit 69815e84bb
7 changed files with 57 additions and 71 deletions

View File

@ -32,7 +32,7 @@ local function create_band_gui(event)
local player = game.players[event.player_index] local player = game.players[event.player_index]
global.band_last_change[event.player_index] = game.tick global.band_last_change[event.player_index] = game.tick
if player.gui.top.band_toggle_btn == nil then if player.gui.top.band_toggle_btn == nil then
local button = player.gui.top.add { name = "band_toggle_btn", type = "sprite-button", caption = "Tag", style = "dialog_button_style" } local button = player.gui.top.add { name = "band_toggle_btn", type = "sprite-button", caption = "Tag" }
button.style.font = "default-bold" button.style.font = "default-bold"
button.style.minimal_height = 38 button.style.minimal_height = 38
button.style.minimal_width = 38 button.style.minimal_width = 38
@ -123,7 +123,6 @@ end
-- dev_icons(ctrl + click): show icon-choose buttons -- dev_icons(ctrl + click): show icon-choose buttons
-- dev_addfakes(alt + click): add random number of player names w/ color -- dev_addfakes(alt + click): add random number of player names w/ color
expand_band_gui = function(player, dev_icons, dev_addfakes, right_click) expand_band_gui = function(player, dev_icons, dev_addfakes, right_click)
player.gui.left.direction = "horizontal"
local frame = player.gui.left["band_panel"] local frame = player.gui.left["band_panel"]
if (frame) then if (frame) then
frame.destroy() frame.destroy()
@ -189,14 +188,13 @@ expand_band_gui = function(player, dev_icons, dev_addfakes, right_click)
local button--reusable variable :D local button--reusable variable :D
local frame = player.gui.left.add { type = "frame", direction = "vertical", name = "band_panel", caption = "Choose your role:"} local frame = player.gui.left.add { type = "frame", direction = "vertical", name = "band_panel", caption = "Choose your role:"}
frame.style.font = "default-listbox"
frame.style.font_color = { r=0.98, g=0.66, b=0.22} frame.style.font_color = { r=0.98, g=0.66, b=0.22}
if dev_icons then if dev_icons then
local choose local choose
local chooselist = frame.add { type = "flow", direction = "horizontal" } local chooselist = frame.add { type = "flow", direction = "horizontal" }
-- ["signal"] = {type = "virtual", name = "signal-A"} -- ["signal"] = {type = "virtual", name = "signal-A"}
for itype, ivalue in pairs({["item"] = "green-wire", ["entity"] = "medium-spitter", ["tile"] = "grass"}) do for itype, ivalue in pairs({["item"] = "green-wire", ["entity"] = "medium-spitter", ["tile"] = "concrete"}) do
choose = chooselist.add { type = "choose-elem-button", elem_type = itype, [itype] = ivalue, name = "help_item_icon_choose_"..itype } choose = chooselist.add { type = "choose-elem-button", elem_type = itype, [itype] = ivalue, name = "help_item_icon_choose_"..itype }
choose.style.minimal_height = 36 choose.style.minimal_height = 36
choose.style.minimal_width = 36 choose.style.minimal_width = 36
@ -212,7 +210,7 @@ expand_band_gui = function(player, dev_icons, dev_addfakes, right_click)
scroll.style.minimal_width = 250 scroll.style.minimal_width = 250
scroll.style.bottom_padding = 10 scroll.style.bottom_padding = 10
local table_roles = scroll.add{type = "table", name = "table_roles", colspan = 2} local table_roles = scroll.add{type = "table", name = "table_roles", column_count = 2}
table_roles.style.horizontal_spacing = 15 table_roles.style.horizontal_spacing = 15
table_roles.style.vertical_spacing = 4 table_roles.style.vertical_spacing = 4
@ -227,17 +225,19 @@ expand_band_gui = function(player, dev_icons, dev_addfakes, right_click)
local role_line = table_roles.add { type = "flow", direction = "horizontal" } local role_line = table_roles.add { type = "flow", direction = "horizontal" }
button = role_line.add { type = "sprite-button", sprite = get_random_from_table(role_icons), name = "band_role_"..role, style = "recipe_slot_button_style"} button = role_line.add { type = "sprite-button", sprite = get_random_from_table(role_icons), name = "band_role_"..role}
button.style.top_padding = 4 button.style.top_padding = 4
button.style.left_padding = 0 button.style.left_padding = 4
button.style.right_padding = 0 button.style.right_padding = 4
button.style.bottom_padding = 4 button.style.bottom_padding = 4
button.style.width = 40
button.style.height = 40
if show_role_tooltip and role_icons.tooltip then if show_role_tooltip and role_icons.tooltip then
button.tooltip = get_random_from_table( role_icons.tooltip ) button.tooltip = get_random_from_table( role_icons.tooltip )
end end
local role_cap_line = role_line.add { type = "flow", name = "role_cap_line", direction = "horizontal" } local role_cap_line = role_line.add { type = "flow", name = "role_cap_line", direction = "horizontal" }
role_cap_line.style.max_on_row = 1 -- role_cap_line.style.max_on_row = 1
local role_label = role_cap_line.add { type = "label", caption = role, single_line = true} local role_label = role_cap_line.add { type = "label", caption = role, single_line = true}
-- role_label.style.minimal_width = 0 -- role_label.style.minimal_width = 0
@ -255,7 +255,7 @@ expand_band_gui = function(player, dev_icons, dev_addfakes, right_click)
subgui_update_role_counter(role_cap_line, #players_by_role[role]) subgui_update_role_counter(role_cap_line, #players_by_role[role])
local list_players = table_roles.add { type = "flow", direction = "horizontal" } local list_players = table_roles.add { type = "flow", direction = "horizontal" }
list_players.style.max_on_row = 3 -- list_players.style.max_on_row = 3
list_players.style.top_padding = 0 list_players.style.top_padding = 0
list_players.style.bottom_padding = 7 list_players.style.bottom_padding = 7

View File

@ -32,15 +32,13 @@ And this is what you ought to know:
Paypal: paypal.me/jsuesse Paypal: paypal.me/jsuesse
]===] ]===]
player.gui.left.direction = "horizontal"
local frame = player.gui.left.add { type = "frame", name = "info_panel"} local frame = player.gui.left.add { type = "frame", name = "info_panel"}
frame.style.top_padding = 20 frame.style.top_padding = 20
frame.style.left_padding = 20 frame.style.left_padding = 20
frame.style.right_padding = 20 frame.style.right_padding = 20
frame.style.bottom_padding = 20 frame.style.bottom_padding = 20
local info_table = frame.add { type = "table", colspan = 1, name = "info_table" } local info_table = frame.add { type = "table", column_count = 1, name = "info_table" }
local headline_label = info_table.add { type = "label", name = "headline_label", caption = "redmew fishy info" } local headline_label = info_table.add { type = "label", name = "headline_label", caption = "redmew fishy info" }
headline_label.style.font = "default-listbox"
headline_label.style.font_color = { r=0.98, g=0.66, b=0.22} headline_label.style.font_color = { r=0.98, g=0.66, b=0.22}
@ -53,10 +51,9 @@ And this is what you ought to know:
text_box.style.left_padding = 5 text_box.style.left_padding = 5
text_box.style.bottom_padding = 5 text_box.style.bottom_padding = 5
local info_table_2 = info_table.add { type = "table", colspan = 2, name = "info_table" } local info_table_2 = info_table.add { type = "table", column_count = 2, name = "info_table" }
info_table_2.add { type = "label", caption = " " } info_table_2.add { type = "label", caption = " " }
local close_button = info_table_2.add { type = "button", caption = "CLOSE", name = "info_close_button" } local close_button = info_table_2.add { type = "button", caption = "CLOSE", name = "info_close_button" }
close_button.style.font = "default-listbox"
end end

View File

@ -22,9 +22,9 @@ local FRAME_TABS = {
-- Static Content -- Static Content
local CONTENT = { local CONTENT = {
rules = {""}, rules = {""},
comm = {""}, comm = {""},
resources = {""}, resources = {""},
about = {""} about = {""}
} }
@ -158,21 +158,21 @@ end
-- @param container - gui element to add to -- @param container - gui element to add to
function draw_players(container) function draw_players(container)
GUI.clear_element(container) -- Clear the current info before adding new GUI.clear_element(container) -- Clear the current info before adding new
local table_name = "tbl_readme_players" local table_name = "tbl_readme_players"
container.add {type = "label", name = "lbl_player_tile", caption = "=== ALL TIME PLAYERS ==="} container.add {type = "label", name = "lbl_player_tile", caption = "=== ALL TIME PLAYERS ==="}
container.add {type = "table", name = table_name, colspan = 2} container.add {type = "table", name = table_name, column_count = 2}
container[table_name].style.minimal_width = 500 container[table_name].style.minimal_width = 500
container[table_name].style.maximal_width = 500 container[table_name].style.maximal_width = 500
container[table_name].add {type = "label", name = "lbl_hours", caption = "Time (h:m)"} container[table_name].add {type = "label", name = "lbl_hours", caption = "Time (h:m)"}
container[table_name].add {type = "label", name = "lbl_name", caption = "Name"} container[table_name].add {type = "label", name = "lbl_name", caption = "Name"}
-- Copy player list into local list -- Copy player list into local list
local player_list = {} local player_list = {}
for i, player in pairs(game.players) do for i, player in pairs(game.players) do
table.insert(player_list, {name = player.name, online_time = player.online_time}) table.insert(player_list, {name = player.name, online_time = player.online_time})
end end
-- Sort players based on time played -- Sort players based on time played
table.sort( table.sort(
player_list, player_list,
@ -180,7 +180,7 @@ function draw_players(container)
return a.online_time > b.online_time return a.online_time > b.online_time
end end
) )
-- Add in gui list -- Add in gui list
for i, player in pairs(player_list) do for i, player in pairs(player_list) do
local total_min = Time.tick_to_min(player.online_time) local total_min = Time.tick_to_min(player.online_time)

View File

@ -182,11 +182,9 @@ local function get_sorted_list(sort_by)
end end
local function player_list_show(player, sort_by) local function player_list_show(player, sort_by)
local frame = player.gui.left["player-list-panel"] local frame = player.gui.left["player-list-panel"]
if frame then frame.destroy() end if frame then frame.destroy() end
player.gui.left.direction = "horizontal"
local frame = player.gui.left.add { type = "frame", name = "player-list-panel", direction = "vertical" } local frame = player.gui.left.add { type = "frame", name = "player-list-panel", direction = "vertical" }
frame.style.minimal_width = 650 frame.style.minimal_width = 650
frame.style.top_padding = 8 frame.style.top_padding = 8
@ -195,7 +193,7 @@ local function player_list_show(player, sort_by)
frame.style.bottom_padding = 8 frame.style.bottom_padding = 8
local player_list_panel_header_table = frame.add { type = "table", name = "player_list_panel_header_table", colspan = 7 } local player_list_panel_header_table = frame.add { type = "table", name = "player_list_panel_header_table", column_count = 7 }
local label = player_list_panel_header_table.add { type = "label", name = "player_list_panel_header_1", caption = " " .. #game.connected_players } local label = player_list_panel_header_table.add { type = "label", name = "player_list_panel_header_1", caption = " " .. #game.connected_players }
label.style.font = "default-game" label.style.font = "default-game"
@ -206,7 +204,6 @@ local function player_list_show(player, sort_by)
if sort_by == "name_asc" then str = symbol_asc .. " " end if sort_by == "name_asc" then str = symbol_asc .. " " end
if sort_by == "name_desc" then str = symbol_desc .. " " end if sort_by == "name_desc" then str = symbol_desc .. " " end
local label = player_list_panel_header_table.add { type = "label", name = "player_list_panel_header_2", caption = str .. "Players online" } local label = player_list_panel_header_table.add { type = "label", name = "player_list_panel_header_2", caption = str .. "Players online" }
label.style.font = "default-listbox"
label.style.font_color = { r=0.98, g=0.66, b=0.22} label.style.font_color = { r=0.98, g=0.66, b=0.22}
label.style.minimal_width = 160 label.style.minimal_width = 160
label.style.maximal_width = 160 label.style.maximal_width = 160
@ -215,7 +212,6 @@ local function player_list_show(player, sort_by)
if sort_by == "time_played_asc" then str = symbol_asc .. " " end if sort_by == "time_played_asc" then str = symbol_asc .. " " end
if sort_by == "time_played_desc" then str = symbol_desc .. " " end if sort_by == "time_played_desc" then str = symbol_desc .. " " end
local label = player_list_panel_header_table.add { type = "label", name = "player_list_panel_header_3", caption = str .. "Time" } local label = player_list_panel_header_table.add { type = "label", name = "player_list_panel_header_3", caption = str .. "Time" }
label.style.font = "default-listbox"
label.style.font_color = { r=0.98, g=0.66, b=0.22} label.style.font_color = { r=0.98, g=0.66, b=0.22}
label.style.minimal_width = 130 label.style.minimal_width = 130
label.style.maximal_width = 130 label.style.maximal_width = 130
@ -225,7 +221,6 @@ local function player_list_show(player, sort_by)
if sort_by == "distance_asc" then str = symbol_asc .. " " end if sort_by == "distance_asc" then str = symbol_asc .. " " end
if sort_by == "distance_desc" then str = symbol_desc .. " " end if sort_by == "distance_desc" then str = symbol_desc .. " " end
local label = player_list_panel_header_table.add { type = "label", name = "player_list_panel_header_4", caption = str .. "Walked" } local label = player_list_panel_header_table.add { type = "label", name = "player_list_panel_header_4", caption = str .. "Walked" }
label.style.font = "default-listbox"
label.style.font_color = { r=0.98, g=0.66, b=0.22} label.style.font_color = { r=0.98, g=0.66, b=0.22}
label.style.minimal_width = 100 label.style.minimal_width = 100
label.style.maximal_width = 100 label.style.maximal_width = 100
@ -234,7 +229,6 @@ local function player_list_show(player, sort_by)
if sort_by == "fish_asc" then str = symbol_asc .. " " end if sort_by == "fish_asc" then str = symbol_asc .. " " end
if sort_by == "fish_desc" then str = symbol_desc .. " " end if sort_by == "fish_desc" then str = symbol_desc .. " " end
local label = player_list_panel_header_table.add { type = "label", name = "player_list_panel_header_fish", caption = str .. "Fish" } local label = player_list_panel_header_table.add { type = "label", name = "player_list_panel_header_fish", caption = str .. "Fish" }
label.style.font = "default-listbox"
label.style.font_color = { r=0.98, g=0.66, b=0.22} label.style.font_color = { r=0.98, g=0.66, b=0.22}
label.style.minimal_width = 80 label.style.minimal_width = 80
label.style.maximal_width = 80 label.style.maximal_width = 80
@ -243,7 +237,6 @@ local function player_list_show(player, sort_by)
if sort_by == "deaths_asc" then str = symbol_asc .. " " end if sort_by == "deaths_asc" then str = symbol_asc .. " " end
if sort_by == "deaths_desc" then str = symbol_desc .. " " end if sort_by == "deaths_desc" then str = symbol_desc .. " " end
local label = player_list_panel_header_table.add { type = "label", name = "player_list_panel_header_deaths", caption = str .. "Deaths" } local label = player_list_panel_header_table.add { type = "label", name = "player_list_panel_header_deaths", caption = str .. "Deaths" }
label.style.font = "default-listbox"
label.style.font_color = { r=0.98, g=0.66, b=0.22} label.style.font_color = { r=0.98, g=0.66, b=0.22}
label.style.minimal_width = 80 label.style.minimal_width = 80
label.style.maximal_width = 80 label.style.maximal_width = 80
@ -252,7 +245,6 @@ local function player_list_show(player, sort_by)
if sort_by == "pokes_asc" then str = symbol_asc .. " " end if sort_by == "pokes_asc" then str = symbol_asc .. " " end
if sort_by == "pokes_desc" then str = symbol_desc .. " " end if sort_by == "pokes_desc" then str = symbol_desc .. " " end
local label = player_list_panel_header_table.add { type = "label", name = "player_list_panel_header_5", caption = str .. "Poke" } local label = player_list_panel_header_table.add { type = "label", name = "player_list_panel_header_5", caption = str .. "Poke" }
label.style.font = "default-listbox"
label.style.font_color = { r=0.98, g=0.66, b=0.22} label.style.font_color = { r=0.98, g=0.66, b=0.22}
label.style.minimal_width = 35 label.style.minimal_width = 35
@ -260,7 +252,7 @@ local function player_list_show(player, sort_by)
player_list_panel_table.style.maximal_height = 650 player_list_panel_table.style.maximal_height = 650
player_list_panel_table = player_list_panel_table.add { type = "table", name = "player_list_panel_table", colspan = 7 } player_list_panel_table = player_list_panel_table.add { type = "table", name = "player_list_panel_table", column_count = 7 }
local player_list = get_sorted_list(sort_by) local player_list = get_sorted_list(sort_by)

View File

@ -20,10 +20,9 @@ end
local function poll_show(player) local function poll_show(player)
player.gui.left.direction = "horizontal"
local frame = player.gui.left.add { type = "frame", name = "poll-panel", direction = "vertical" } local frame = player.gui.left.add { type = "frame", name = "poll-panel", direction = "vertical" }
frame.add { type = "table", name = "poll_panel_table", colspan = 2 } frame.add { type = "table", name = "poll_panel_table", column_count = 2 }
local poll_panel_table = frame.poll_panel_table local poll_panel_table = frame.poll_panel_table
@ -68,12 +67,11 @@ local function poll_show(player)
answer_label.style.font = "default" answer_label.style.font = "default"
local answerbutton = poll_panel_table.add { type = "button", caption = global.poll_button_votes[y], name = "answer_button_" .. z } local answerbutton = poll_panel_table.add { type = "button", caption = global.poll_button_votes[y], name = "answer_button_" .. z }
answerbutton.style.font = "default-listbox"
end end
y = y + 1 y = y + 1
end end
frame.add { type = "table", name = "poll_panel_button_table", colspan = 3 } frame.add { type = "table", name = "poll_panel_button_table", column_count = 3 }
local poll_panel_button_table = frame.poll_panel_button_table local poll_panel_button_table = frame.poll_panel_button_table
poll_panel_button_table.add { type = "button", caption = "New Poll", name = "new_poll_assembler_button" } poll_panel_button_table.add { type = "button", caption = "New Poll", name = "new_poll_assembler_button" }
@ -187,7 +185,7 @@ end
local function poll_assembler(player) local function poll_assembler(player)
local frame = player.gui.left.add { type = "frame", name = "poll-assembler", caption = "" } local frame = player.gui.left.add { type = "frame", name = "poll-assembler", caption = "" }
local frame_table = frame.add { type = "table", name = "table_poll_assembler", colspan = 2 } local frame_table = frame.add { type = "table", name = "table_poll_assembler", column_count = 2 }
frame_table.add { type = "label", caption = "Question:" } frame_table.add { type = "label", caption = "Question:" }
frame_table.add { type = "textfield", name = "textfield_question", text = "" } frame_table.add { type = "textfield", name = "textfield_question", text = "" }
frame_table.add { type = "label", caption = "Answer #1:" } frame_table.add { type = "label", caption = "Answer #1:" }

View File

@ -2,9 +2,9 @@ if not global.score_rockets_launched then global.score_rockets_launched = 0 end
local function create_score_gui(event) local function create_score_gui(event)
local player = game.players[event.player_index] local player = game.players[event.player_index]
if player.gui.top.score == nil then if player.gui.top.score == nil then
local button = player.gui.top.add({ type = "sprite-button", name = "score", sprite = "item/rocket-silo" }) local button = player.gui.top.add({ type = "sprite-button", name = "score", sprite = "item/rocket-silo" })
button.style.minimal_height = 38 button.style.minimal_height = 38
button.style.minimal_width = 38 button.style.minimal_width = 38
button.style.top_padding = 2 button.style.top_padding = 2
@ -16,13 +16,13 @@ end
function refresh_score() function refresh_score()
local x = 1 local x = 1
while (game.players[x] ~= nil) do while (game.players[x] ~= nil) do
local player = game.players[x] local player = game.players[x]
local frame = player.gui.top["score_panel"] local frame = player.gui.top["score_panel"]
if (frame) then if (frame) then
frame.score_table.label_rockets_launched.caption = "Rockets launched: " .. global.score_rockets_launched frame.score_table.label_rockets_launched.caption = "Rockets launched: " .. global.score_rockets_launched
frame.score_table.label_biters_killed.caption = "Biters liberated: " .. global.score_biter_total_kills frame.score_table.label_biters_killed.caption = "Biters liberated: " .. global.score_biter_total_kills
-- frame.score_table.label_score_polls_created.caption = "Polls created: " .. global.score_total_polls_created -- frame.score_table.label_score_polls_created.caption = "Polls created: " .. global.score_total_polls_created
end end
x = x + 1 x = x + 1
@ -34,46 +34,46 @@ local function score_show(player)
local rocket_score_value_string = tostring(global.score_rockets_launched) local rocket_score_value_string = tostring(global.score_rockets_launched)
local frame = player.gui.top.add { type = "frame", name = "score_panel" } local frame = player.gui.top.add { type = "frame", name = "score_panel" }
local score_table = frame.add { type = "table", colspan = 5, name = "score_table" } local score_table = frame.add { type = "table", column_count = 5, name = "score_table" }
local label = score_table.add { type = "label", caption = "", name = "label_rockets_launched" } local label = score_table.add { type = "label", caption = "", name = "label_rockets_launched" }
label.style.font = "default-bold" label.style.font = "default-bold"
label.style.font_color = { r=0.98, g=0.66, b=0.22} label.style.font_color = { r=0.98, g=0.66, b=0.22}
label.style.top_padding = 2 label.style.top_padding = 2
label.style.left_padding = 4 label.style.left_padding = 4
label.style.right_padding = 4 label.style.right_padding = 4
score_table.add { type = "label", caption = "|"} score_table.add { type = "label", caption = "|"}
local label = score_table.add { type = "label", caption = "", name = "label_biters_killed" } local label = score_table.add { type = "label", caption = "", name = "label_biters_killed" }
label.style.font = "default-bold" label.style.font = "default-bold"
label.style.font_color = { r=0.98, g=0.11, b=0.11} label.style.font_color = { r=0.98, g=0.11, b=0.11}
label.style.top_padding = 2 label.style.top_padding = 2
label.style.left_padding = 4 label.style.left_padding = 4
label.style.right_padding = 4 label.style.right_padding = 4
--[[ --[[
if global.score_total_polls_created then if global.score_total_polls_created then
score_table.add { type = "label", caption = "|"} score_table.add { type = "label", caption = "|"}
local label = score_table.add { type = "label", caption = "", name = "label_score_polls_created" } local label = score_table.add { type = "label", caption = "", name = "label_score_polls_created" }
label.style.font = "default-bold" label.style.font = "default-bold"
label.style.font_color = { r=0.80, g=0.80, b=0.80} label.style.font_color = { r=0.80, g=0.80, b=0.80}
label.style.top_padding = 2 label.style.top_padding = 2
label.style.left_padding = 4 label.style.left_padding = 4
label.style.right_padding = 4 label.style.right_padding = 4
end end
--]] --]]
refresh_score() refresh_score()
end end
local function on_gui_click(event) local function on_gui_click(event)
if not (event and event.element and event.element.valid) then return end if not (event and event.element and event.element.valid) then return end
local player = game.players[event.element.player_index] local player = game.players[event.element.player_index]
local name = event.element.name local name = event.element.name
local frame = player.gui.top["score_panel"] local frame = player.gui.top["score_panel"]
if (name == "score") and (frame == nil) then if (name == "score") and (frame == nil) then
score_show(player) score_show(player)
else else
@ -81,12 +81,12 @@ local function on_gui_click(event)
frame.destroy() frame.destroy()
end end
end end
end end
local function rocket_launched(event) local function rocket_launched(event)
global.score_rockets_launched = global.score_rockets_launched + 1 global.score_rockets_launched = global.score_rockets_launched + 1
game.print ("A rocket has been launched!") game.print ("A rocket has been launched!")
refresh_score() refresh_score()
end end
@ -95,4 +95,4 @@ end
Event.register(defines.events.on_entity_died, refresh_score) Event.register(defines.events.on_entity_died, refresh_score)
Event.register(defines.events.on_gui_click, on_gui_click) Event.register(defines.events.on_gui_click, on_gui_click)
Event.register(defines.events.on_player_joined_game, create_score_gui) Event.register(defines.events.on_player_joined_game, create_score_gui)
Event.register(defines.events.on_rocket_launched, rocket_launched) Event.register(defines.events.on_rocket_launched, rocket_launched)

View File

@ -20,10 +20,9 @@ end
local function tasklist_show(player) local function tasklist_show(player)
player.gui.left.direction = "horizontal"
local frame = player.gui.left.add { type = "frame", name = "tasklist-panel", direction = "vertical" } local frame = player.gui.left.add { type = "frame", name = "tasklist-panel", direction = "vertical" }
frame.add { type = "table", name = "tasklist_panel_table", colspan = 1 } frame.add { type = "table", name = "tasklist_panel_table", column_count = 1 }
local tasklist_panel_table = frame.tasklist_panel_table local tasklist_panel_table = frame.tasklist_panel_table
@ -60,7 +59,7 @@ local function tasklist_show(player)
tasklist_label.style.font_color = {r = 0.55, g = 0.55, b = 0.55} tasklist_label.style.font_color = {r = 0.55, g = 0.55, b = 0.55}
end end
frame.add { type = "table", name = "tasklist_panel_button_table", colspan = 3 } frame.add { type = "table", name = "tasklist_panel_button_table", column_count = 3 }
local tasklist_panel_button_table = frame.tasklist_panel_button_table local tasklist_panel_button_table = frame.tasklist_panel_button_table
global.tasklist_panel_creation_time[player.index] = game.tick global.tasklist_panel_creation_time[player.index] = game.tick
@ -119,7 +118,7 @@ end
local function tasklist_assembler(player) local function tasklist_assembler(player)
local frame = player.gui.left.add { type = "frame", name = "tasklist-assembler", caption = "" } local frame = player.gui.left.add { type = "frame", name = "tasklist-assembler", caption = "" }
local frame_table = frame.add { type = "table", name = "table_tasklist_assembler", colspan = 2 } local frame_table = frame.add { type = "table", name = "table_tasklist_assembler", column_count = 2 }
frame_table.add { type = "label", caption = "Task #1:" } frame_table.add { type = "label", caption = "Task #1:" }
frame_table.add { type = "textfield", name = "textfield_task_1", text = global.tasklist_items[1], } frame_table.add { type = "textfield", name = "textfield_task_1", text = global.tasklist_items[1], }
frame_table["textfield_task_1"].style.minimal_width = 450 frame_table["textfield_task_1"].style.minimal_width = 450