From 93377b4f6c1bfbd943b4cb3e8a280fb0e884429c Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Tue, 10 Sep 2024 07:05:01 +0900 Subject: [PATCH] Adjust font of bonus GUI (#324) * Update playerdata.lua * Update bonus.lua * Update bonus.lua * Update commands.cfg * Update commands.cfg * Update commands.cfg * Update research.lua * Update research.lua * Update bonus.lua * Delete modules/gui/research.lua * Create research.lua * Update research.lua * Update commands.cfg * Update commands.cfg * Update commands.cfg * Update bonus.lua * Update bonus.lua * Update bonus.lua * Update bonus.lua * Update bonus.lua --- config/bonus.lua | 8 ++++---- modules/gui/bonus.lua | 24 ++++++++++++------------ modules/gui/playerdata.lua | 3 ++- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/config/bonus.lua b/config/bonus.lua index f5287143..c009aa0f 100644 --- a/config/bonus.lua +++ b/config/bonus.lua @@ -21,10 +21,10 @@ return { base = 200 }, gui_display_width = { - half = 180, - label = 80, - slider = 200, - count = 80 + half = 150, + label = 70, + slider = 180, + count = 50 }, conversion = { ['cmms'] = 'character_mining_speed_modifier', diff --git a/modules/gui/bonus.lua b/modules/gui/bonus.lua index 87f11576..3d3c1fe4 100644 --- a/modules/gui/bonus.lua +++ b/modules/gui/bonus.lua @@ -62,7 +62,7 @@ Gui.element{ type = 'label', name = 'bonus_control_pts_a', caption = {'bonus.control-pts-a'}, - style = 'heading_1_label' + style = 'heading_2_label' }:style{ width = config.gui_display_width['half'] } @@ -72,7 +72,7 @@ Gui.element{ type = 'label', name = 'bonus_control_pts_a_count', caption = config.pts.base, - style = 'heading_1_label' + style = 'heading_2_label' }:style{ width = config.gui_display_width['half'] } @@ -84,7 +84,7 @@ Gui.element{ type = 'label', name = 'bonus_control_pts_n', caption = {'bonus.control-pts-n'}, - style = 'heading_1_label' + style = 'heading_2_label' }:style{ width = config.gui_display_width['half'] } @@ -94,7 +94,7 @@ Gui.element{ type = 'label', name = 'bonus_control_pts_n_count', caption = '0', - style = 'heading_1_label' + style = 'heading_2_label' }:style{ width =config.gui_display_width['half'] } @@ -106,7 +106,7 @@ Gui.element{ type = 'label', name = 'bonus_control_pts_r', caption = {'bonus.control-pts-r'}, - style = 'heading_1_label' + style = 'heading_2_label' }:style{ width = config.gui_display_width['half'] } @@ -116,7 +116,7 @@ Gui.element{ type = 'label', name = 'bonus_control_pts_r_count', caption = '0', - style = 'heading_1_label' + style = 'heading_2_label' }:style{ width = config.gui_display_width['half'] } @@ -176,7 +176,7 @@ end) local bonus_control_set = Gui.element(function(_, parent, name) local bonus_set = parent.add{type='flow', direction='vertical', name=name} - local disp = Gui.scroll_table(bonus_set, 360, 2, 'disp') + local disp = Gui.scroll_table(bonus_set, config.gui_display_width['half'] * 2, 2, 'disp') bonus_gui_control_pts_a(disp) bonus_gui_control_pts_a_count(disp) @@ -201,7 +201,7 @@ Gui.element(function(_definition, parent, name, caption, tooltip, bonus) type = 'label', caption = caption, tooltip = tooltip, - style = 'heading_1_label' + style = 'heading_2_label' } label.style.width = config.gui_display_width['label'] @@ -234,7 +234,7 @@ Gui.element(function(_definition, parent, name, caption, tooltip, bonus) type = 'label', name = name .. '_count', caption = value, - style = 'heading_1_label', + style = 'heading_2_label', } count.style.width = config.gui_display_width['count'] @@ -260,7 +260,7 @@ end) local bonus_data_set = Gui.element(function(_, parent, name) local bonus_set = parent.add{type='flow', direction='vertical', name=name} - local disp = Gui.scroll_table(bonus_set, 360, 3, 'disp') + local disp = Gui.scroll_table(bonus_set, config.gui_display_width['half'] * 2, 3, 'disp') for k, v in pairs(config.conversion) do bonus_gui_slider(disp, 'bonus_display_' .. k, {'bonus.display-' .. k}, {'bonus.display-' .. k .. '-tooltip'}, config.player_bonus[v]) @@ -274,7 +274,7 @@ end) bonus_container = Gui.element(function(definition, parent) local player = Gui.get_player_from_element(parent) - local container = Gui.container(parent, definition.name, 320) + local container = Gui.container(parent, definition.name, config.gui_display_width['half'] * 2) bonus_control_set(container, 'bonus_st_1') bonus_data_set(container, 'bonus_st_2') @@ -292,7 +292,7 @@ end) :static_name(Gui.unique_static_name) :add_to_left_flow() ---- Button on the top flow used to toggle the task list container +--- Button on the top flow used to toggle the bonus container -- @element toggle_left_element Gui.left_toolbar_button('item/exoskeleton-equipment', {'bonus.main-tooltip'}, bonus_container, function(player) return Roles.player_allowed(player, 'gui/bonus') diff --git a/modules/gui/playerdata.lua b/modules/gui/playerdata.lua index 3a2165d5..76473f48 100644 --- a/modules/gui/playerdata.lua +++ b/modules/gui/playerdata.lua @@ -86,7 +86,8 @@ Gui.element(function(_, parent, width, caption, tooltip, name) type = 'label', caption = caption, tooltip = tooltip, - name = name + name = name, + style = 'heading_2_label' } new_label.style.width = width