Skip to content

Commit ba73e62

Browse files
committed
fix: better tooltip name fix
1 parent 3b136a3 commit ba73e62

File tree

2 files changed

+36
-24
lines changed

2 files changed

+36
-24
lines changed

src/game_object.lua

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,13 +1230,16 @@ Set `prefix_config.key = false` on your object instead.]]):format(obj.key), obj.
12301230

12311231
if desc_nodes == full_UI_table.main and not full_UI_table.name then
12321232
full_UI_table.name = self.set == 'Enhanced' and 'temp_value' or localize { type = 'name', set = target.set, key = res.name_key or target.key, nodes = full_UI_table.name, vars = res.name_vars or target.vars or {} }
1233-
elseif desc_nodes ~= full_UI_table.main and not desc_nodes.name and not full_UI_table.from_detailed_tooltip then
1233+
elseif desc_nodes ~= full_UI_table.main and not desc_nodes.name then
12341234
desc_nodes.name = localize{type = 'name_text', key = res.name_key or target.key, set = target.set }
1235-
desc_nodes.name_styled = {}
1236-
1237-
localize{type = 'name', key = res.name_key or target.key, set = target.set, nodes = desc_nodes.name_styled, fixed_scale = 0.63, no_pop_in = true, no_shadow = true, y_offset = 0, no_spacing = true, no_bump = true, vars = target.vars}
1238-
desc_nodes.name_styled = SMODS.info_queue_desc_from_rows(desc_nodes.name_styled, true)
1239-
desc_nodes.name_styled.config.align = "cm"
1235+
if (full_UI_table.from_detailed_tooltip and full_UI_table.info[1] == desc_nodes)
1236+
and not full_UI_table.no_styled_name then
1237+
desc_nodes.name_styled = {}
1238+
1239+
localize{type = 'name', key = res.name_key or target.key, set = target.set, nodes = desc_nodes.name_styled, fixed_scale = 0.63, no_pop_in = true, no_shadow = true, y_offset = 0, no_spacing = true, no_bump = true, vars = target.vars}
1240+
desc_nodes.name_styled = SMODS.info_queue_desc_from_rows(desc_nodes.name_styled, true)
1241+
desc_nodes.name_styled.config.align = "cm"
1242+
end
12401243
end
12411244
if specific_vars and specific_vars.debuffed and not res.replace_debuff then
12421245
target = { type = 'other', key = 'debuffed_' ..
@@ -1472,13 +1475,16 @@ Set `prefix_config.key = false` on your object instead.]]):format(obj.key), obj.
14721475
end
14731476
if desc_nodes == full_UI_table.main and not full_UI_table.name then
14741477
full_UI_table.name = localize{type = 'name', set = 'Other', key = res.name_key or target.key, nodes = full_UI_table.name, vars = res.name_vars or target.vars or {}}
1475-
elseif desc_nodes ~= full_UI_table.main and not desc_nodes.name and not full_UI_table.from_detailed_tooltip then
1476-
desc_nodes.name = localize{type = 'name_text', key = res.name_key or target.key, set = 'Other' }
1477-
desc_nodes.name_styled = {}
1478-
1479-
localize{type = 'name', key = res.name_key or target.key, set = 'Other', nodes = desc_nodes.name_styled, fixed_scale = 0.63, no_pop_in = true, no_shadow = true, y_offset = 0, no_spacing = true, no_bump = true, vars = target.vars}
1480-
desc_nodes.name_styled = SMODS.info_queue_desc_from_rows(desc_nodes.name_styled, true)
1481-
desc_nodes.name_styled.config.align = "cm"
1478+
elseif desc_nodes ~= full_UI_table.main and not desc_nodes.name then
1479+
desc_nodes.name = localize { type = 'name_text', key = res.name_key or target.key, set = 'Other' }
1480+
if (full_UI_table.from_detailed_tooltip and full_UI_table.info[1] == desc_nodes)
1481+
and not full_UI_table.no_styled_name then
1482+
desc_nodes.name_styled = {}
1483+
1484+
localize{type = 'name', key = res.name_key or target.key, set = 'Other', nodes = desc_nodes.name_styled, fixed_scale = 0.63, no_pop_in = true, no_shadow = true, y_offset = 0, no_spacing = true, no_bump = true, vars = target.vars}
1485+
desc_nodes.name_styled = SMODS.info_queue_desc_from_rows(desc_nodes.name_styled, true)
1486+
desc_nodes.name_styled.config.align = "cm"
1487+
end
14821488
end
14831489
localize(target)
14841490
desc_nodes.background_colour = res.background_colour
@@ -1886,13 +1892,16 @@ Set `prefix_config.key = false` on your object instead.]]):format(obj.key), obj.
18861892
end
18871893
if desc_nodes == full_UI_table.main and not full_UI_table.name then
18881894
full_UI_table.name = localize { type = 'name', set = target.set, key = res.name_key or target.key, nodes = full_UI_table.name, vars = res.name_vars or target.vars or {} }
1889-
elseif desc_nodes ~= full_UI_table.main and not desc_nodes.name and not full_UI_table.from_detailed_tooltip then
1895+
elseif desc_nodes ~= full_UI_table.main and not desc_nodes.name then
18901896
desc_nodes.name = localize{type = 'name_text', key = res.name_key or target.key, set = target.set }
1891-
desc_nodes.name_styled = {}
1897+
if (full_UI_table.from_detailed_tooltip and full_UI_table.info[1] == desc_nodes)
1898+
and not full_UI_table.no_styled_name then
1899+
desc_nodes.name_styled = {}
18921900

1893-
localize{type = 'name', key = res.name_key or target.key, set = target.set, nodes = desc_nodes.name_styled, fixed_scale = 0.63, no_pop_in = true, no_shadow = true, y_offset = 0, no_spacing = true, no_bump = true, vars = target.vars}
1894-
desc_nodes.name_styled = SMODS.info_queue_desc_from_rows(desc_nodes.name_styled, true)
1895-
desc_nodes.name_styled.config.align = "cm"
1901+
localize{type = 'name', key = res.name_key or target.key, set = target.set, nodes = desc_nodes.name_styled, fixed_scale = 0.63, no_pop_in = true, no_shadow = true, y_offset = 0, no_spacing = true, no_bump = true, vars = target.vars}
1902+
desc_nodes.name_styled = SMODS.info_queue_desc_from_rows(desc_nodes.name_styled, true)
1903+
desc_nodes.name_styled.config.align = "cm"
1904+
end
18961905
end
18971906
if res.main_start then
18981907
desc_nodes[#desc_nodes + 1] = res.main_start
@@ -3011,13 +3020,16 @@ Set `prefix_config.key = false` on your object instead.]]):format(obj.key), obj.
30113020
end
30123021
if desc_nodes == full_UI_table.main and not full_UI_table.name then
30133022
full_UI_table.name = localize { type = 'name', set = target.set, key = res.name_key or target.key, nodes = full_UI_table.name, vars = res.name_vars or res.vars or {} }
3014-
elseif desc_nodes ~= full_UI_table.main and not desc_nodes.name and not full_UI_table.from_detailed_tooltip then
3023+
elseif desc_nodes ~= full_UI_table.main and not desc_nodes.name then
30153024
desc_nodes.name = localize{type = 'name_text', key = res.name_key or target.key, set = target.set }
3016-
desc_nodes.name_styled = {}
3025+
if (full_UI_table.from_detailed_tooltip and full_UI_table.info[1] == desc_nodes)
3026+
and not full_UI_table.no_styled_name then
3027+
desc_nodes.name_styled = {}
30173028

3018-
localize{type = 'name', key = res.name_key or target.key, set = target.set, nodes = desc_nodes.name_styled, fixed_scale = 0.63, no_pop_in = true, no_shadow = true, y_offset = 0, no_spacing = true, no_bump = true, vars = target.vars}
3019-
desc_nodes.name_styled = SMODS.info_queue_desc_from_rows(desc_nodes.name_styled, true)
3020-
desc_nodes.name_styled.config.align = "cm"
3029+
localize{type = 'name', key = res.name_key or target.key, set = target.set, nodes = desc_nodes.name_styled, fixed_scale = 0.63, no_pop_in = true, no_shadow = true, y_offset = 0, no_spacing = true, no_bump = true, vars = target.vars}
3030+
desc_nodes.name_styled = SMODS.info_queue_desc_from_rows(desc_nodes.name_styled, true)
3031+
desc_nodes.name_styled.config.align = "cm"
3032+
end
30213033
end
30223034
if res.main_start then
30233035
desc_nodes[#desc_nodes + 1] = res.main_start

version.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
return "1.0.0~BETA-1522a-STEAMODDED"
1+
return "1.0.0~BETA-1522b-STEAMODDED"

0 commit comments

Comments
 (0)