This commit is contained in:
phidias authored and GitHub committed 2026-11-18 15:11:24 +09:00
1 parent 75245fa89e
commit 8a7fa3423d
1 file changed
+10 -9
+10 -9
View File
@@ -172,10 +172,10 @@ Elements.items_table = Gui.define("vlayer/items_table")
end) --[[@as any]] end) --[[@as any]]
--- Calculate the display data of every statistic, the same for every player --- Calculate the display data of every statistic, the same for every player
--- @param s_index number Surface index --- @param surface_index number Surface index
--- @return table<string, ExpGui_Vlayer.elements.stat_bar.display_data> --- @return table<string, ExpGui_Vlayer.elements.stat_bar.display_data>
function Elements.stats_table.calculate_display_data(s_index) function Elements.stats_table.calculate_display_data(surface_index)
local statistics = Vlayer.get_statistics(s_index) local statistics = Vlayer.get_statistics(surface_index)
local energy_production = ceil(statistics.energy_production) local energy_production = ceil(statistics.energy_production)
local energy_max = ceil(statistics.energy_max) local energy_max = ceil(statistics.energy_max)
local energy_sustained = ceil(statistics.energy_sustained) local energy_sustained = ceil(statistics.energy_sustained)
@@ -238,11 +238,11 @@ function Elements.stats_table.calculate_display_data(s_index)
end end
--- Calculate the display data of every item, the same for every player --- Calculate the display data of every item, the same for every player
--- @param s_index number Surface index --- @param surface_index number Surface index
--- @return table<string, ExpGui_Vlayer.elements.stat_bar.display_data> --- @return table<string, ExpGui_Vlayer.elements.stat_bar.display_data>
function Elements.items_table.calculate_display_data(s_index) function Elements.items_table.calculate_display_data(surface_index)
local items = Vlayer.get_items(s_index) local items = Vlayer.get_items(surface_index)
local allocated = Vlayer.get_allocated_items(s_index) local allocated = Vlayer.get_allocated_items(surface_index)
local result = {} local result = {}
local index = 1 local index = 1
@@ -326,7 +326,7 @@ function Elements.items_table.rows_adjust(items_table, display_data)
"[img=entity/%s]", "[img=entity/%s]",
disp.name disp.name
), ),
prototypes.entity[name].localised_name, prototypes.entity[disp.name].localised_name,
format_string( format_string(
" [%s]", " [%s]",
disp.quality disp.quality
@@ -340,7 +340,8 @@ function Elements.items_table.rows_adjust(items_table, display_data)
}, },
"" ""
) )
r[2] = Elements.stat_bar(items_table, disp) r[2] = Elements.stat_bar(items_table)
Elements.stat_bar.refresh(r[2], disp)
rows[i] = r rows[i] = r
end end
end end