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
This commit is contained in:
2024-09-10 07:05:01 +09:00
committed by GitHub
parent c3ddb73076
commit 93377b4f6c
3 changed files with 18 additions and 17 deletions

View File

@@ -21,10 +21,10 @@ return {
base = 200 base = 200
}, },
gui_display_width = { gui_display_width = {
half = 180, half = 150,
label = 80, label = 70,
slider = 200, slider = 180,
count = 80 count = 50
}, },
conversion = { conversion = {
['cmms'] = 'character_mining_speed_modifier', ['cmms'] = 'character_mining_speed_modifier',

View File

@@ -62,7 +62,7 @@ Gui.element{
type = 'label', type = 'label',
name = 'bonus_control_pts_a', name = 'bonus_control_pts_a',
caption = {'bonus.control-pts-a'}, caption = {'bonus.control-pts-a'},
style = 'heading_1_label' style = 'heading_2_label'
}:style{ }:style{
width = config.gui_display_width['half'] width = config.gui_display_width['half']
} }
@@ -72,7 +72,7 @@ Gui.element{
type = 'label', type = 'label',
name = 'bonus_control_pts_a_count', name = 'bonus_control_pts_a_count',
caption = config.pts.base, caption = config.pts.base,
style = 'heading_1_label' style = 'heading_2_label'
}:style{ }:style{
width = config.gui_display_width['half'] width = config.gui_display_width['half']
} }
@@ -84,7 +84,7 @@ Gui.element{
type = 'label', type = 'label',
name = 'bonus_control_pts_n', name = 'bonus_control_pts_n',
caption = {'bonus.control-pts-n'}, caption = {'bonus.control-pts-n'},
style = 'heading_1_label' style = 'heading_2_label'
}:style{ }:style{
width = config.gui_display_width['half'] width = config.gui_display_width['half']
} }
@@ -94,7 +94,7 @@ Gui.element{
type = 'label', type = 'label',
name = 'bonus_control_pts_n_count', name = 'bonus_control_pts_n_count',
caption = '0', caption = '0',
style = 'heading_1_label' style = 'heading_2_label'
}:style{ }:style{
width =config.gui_display_width['half'] width =config.gui_display_width['half']
} }
@@ -106,7 +106,7 @@ Gui.element{
type = 'label', type = 'label',
name = 'bonus_control_pts_r', name = 'bonus_control_pts_r',
caption = {'bonus.control-pts-r'}, caption = {'bonus.control-pts-r'},
style = 'heading_1_label' style = 'heading_2_label'
}:style{ }:style{
width = config.gui_display_width['half'] width = config.gui_display_width['half']
} }
@@ -116,7 +116,7 @@ Gui.element{
type = 'label', type = 'label',
name = 'bonus_control_pts_r_count', name = 'bonus_control_pts_r_count',
caption = '0', caption = '0',
style = 'heading_1_label' style = 'heading_2_label'
}:style{ }:style{
width = config.gui_display_width['half'] width = config.gui_display_width['half']
} }
@@ -176,7 +176,7 @@ end)
local bonus_control_set = local bonus_control_set =
Gui.element(function(_, parent, name) Gui.element(function(_, parent, name)
local bonus_set = parent.add{type='flow', direction='vertical', name=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(disp)
bonus_gui_control_pts_a_count(disp) bonus_gui_control_pts_a_count(disp)
@@ -201,7 +201,7 @@ Gui.element(function(_definition, parent, name, caption, tooltip, bonus)
type = 'label', type = 'label',
caption = caption, caption = caption,
tooltip = tooltip, tooltip = tooltip,
style = 'heading_1_label' style = 'heading_2_label'
} }
label.style.width = config.gui_display_width['label'] label.style.width = config.gui_display_width['label']
@@ -234,7 +234,7 @@ Gui.element(function(_definition, parent, name, caption, tooltip, bonus)
type = 'label', type = 'label',
name = name .. '_count', name = name .. '_count',
caption = value, caption = value,
style = 'heading_1_label', style = 'heading_2_label',
} }
count.style.width = config.gui_display_width['count'] count.style.width = config.gui_display_width['count']
@@ -260,7 +260,7 @@ end)
local bonus_data_set = local bonus_data_set =
Gui.element(function(_, parent, name) Gui.element(function(_, parent, name)
local bonus_set = parent.add{type='flow', direction='vertical', name=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 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]) 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 = bonus_container =
Gui.element(function(definition, parent) Gui.element(function(definition, parent)
local player = Gui.get_player_from_element(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_control_set(container, 'bonus_st_1')
bonus_data_set(container, 'bonus_st_2') bonus_data_set(container, 'bonus_st_2')
@@ -292,7 +292,7 @@ end)
:static_name(Gui.unique_static_name) :static_name(Gui.unique_static_name)
:add_to_left_flow() :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 -- @element toggle_left_element
Gui.left_toolbar_button('item/exoskeleton-equipment', {'bonus.main-tooltip'}, bonus_container, function(player) Gui.left_toolbar_button('item/exoskeleton-equipment', {'bonus.main-tooltip'}, bonus_container, function(player)
return Roles.player_allowed(player, 'gui/bonus') return Roles.player_allowed(player, 'gui/bonus')

View File

@@ -86,7 +86,8 @@ Gui.element(function(_, parent, width, caption, tooltip, name)
type = 'label', type = 'label',
caption = caption, caption = caption,
tooltip = tooltip, tooltip = tooltip,
name = name name = name,
style = 'heading_2_label'
} }
new_label.style.width = width new_label.style.width = width