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]
global.band_last_change[event.player_index] = game.tick
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.minimal_height = 38
button.style.minimal_width = 38
@ -123,7 +123,6 @@ end
-- dev_icons(ctrl + click): show icon-choose buttons
-- dev_addfakes(alt + click): add random number of player names w/ color
expand_band_gui = function(player, dev_icons, dev_addfakes, right_click)
player.gui.left.direction = "horizontal"
local frame = player.gui.left["band_panel"]
if (frame) then
frame.destroy()
@ -189,14 +188,13 @@ expand_band_gui = function(player, dev_icons, dev_addfakes, right_click)
local button--reusable variable :D
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}
if dev_icons then
local choose
local chooselist = frame.add { type = "flow", direction = "horizontal" }
-- ["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.style.minimal_height = 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.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.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" }
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.left_padding = 0
button.style.right_padding = 0
button.style.left_padding = 4
button.style.right_padding = 4
button.style.bottom_padding = 4
button.style.width = 40
button.style.height = 40
if show_role_tooltip and role_icons.tooltip then
button.tooltip = get_random_from_table( role_icons.tooltip )
end
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}
-- 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])
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.bottom_padding = 7

View File

@ -32,15 +32,13 @@ And this is what you ought to know:
Paypal: paypal.me/jsuesse
]===]
player.gui.left.direction = "horizontal"
local frame = player.gui.left.add { type = "frame", name = "info_panel"}
frame.style.top_padding = 20
frame.style.left_padding = 20
frame.style.right_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" }
headline_label.style.font = "default-listbox"
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.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 = " " }
local close_button = info_table_2.add { type = "button", caption = "CLOSE", name = "info_close_button" }
close_button.style.font = "default-listbox"
end

View File

@ -161,7 +161,7 @@ function draw_players(container)
local table_name = "tbl_readme_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.maximal_width = 500
container[table_name].add {type = "label", name = "lbl_hours", caption = "Time (h:m)"}

View File

@ -182,11 +182,9 @@ local function get_sorted_list(sort_by)
end
local function player_list_show(player, sort_by)
local frame = player.gui.left["player-list-panel"]
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" }
frame.style.minimal_width = 650
frame.style.top_padding = 8
@ -195,7 +193,7 @@ local function player_list_show(player, sort_by)
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 }
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_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" }
label.style.font = "default-listbox"
label.style.font_color = { r=0.98, g=0.66, b=0.22}
label.style.minimal_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_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" }
label.style.font = "default-listbox"
label.style.font_color = { r=0.98, g=0.66, b=0.22}
label.style.minimal_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_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" }
label.style.font = "default-listbox"
label.style.font_color = { r=0.98, g=0.66, b=0.22}
label.style.minimal_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_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" }
label.style.font = "default-listbox"
label.style.font_color = { r=0.98, g=0.66, b=0.22}
label.style.minimal_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_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" }
label.style.font = "default-listbox"
label.style.font_color = { r=0.98, g=0.66, b=0.22}
label.style.minimal_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_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" }
label.style.font = "default-listbox"
label.style.font_color = { r=0.98, g=0.66, b=0.22}
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 = 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)

View File

@ -20,10 +20,9 @@ end
local function poll_show(player)
player.gui.left.direction = "horizontal"
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
@ -68,12 +67,11 @@ local function poll_show(player)
answer_label.style.font = "default"
local answerbutton = poll_panel_table.add { type = "button", caption = global.poll_button_votes[y], name = "answer_button_" .. z }
answerbutton.style.font = "default-listbox"
end
y = y + 1
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
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 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 = "textfield", name = "textfield_question", text = "" }
frame_table.add { type = "label", caption = "Answer #1:" }

View File

@ -35,7 +35,7 @@ local function score_show(player)
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" }
label.style.font = "default-bold"
label.style.font_color = { r=0.98, g=0.66, b=0.22}

View File

@ -20,10 +20,9 @@ end
local function tasklist_show(player)
player.gui.left.direction = "horizontal"
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
@ -60,7 +59,7 @@ local function tasklist_show(player)
tasklist_label.style.font_color = {r = 0.55, g = 0.55, b = 0.55}
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
global.tasklist_panel_creation_time[player.index] = game.tick
@ -119,7 +118,7 @@ end
local function tasklist_assembler(player)
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 = "textfield", name = "textfield_task_1", text = global.tasklist_items[1], }
frame_table["textfield_task_1"].style.minimal_width = 450