This commit is contained in:
phidias authored and GitHub committed 2026-11-26 19:20:04 +09:00
1 parent 7b96498591
commit 2bc6ec8c6a
1 file changed
+18 -3
@@ -31,6 +31,8 @@ local font_color = {
negative = { r = 1, g = 0.3, b = 0.3 }, negative = { r = 1, g = 0.3, b = 0.3 },
} }
local ing_used = {}
--- @class ExpGui_ResearchMilestones.research_targets --- @class ExpGui_ResearchMilestones.research_targets
--- @field index_lookup table<string, number> --- @field index_lookup table<string, number>
--- @field target_times table<number, { name: string, target: number, label: LocalisedString }> --- @field target_times table<number, { name: string, target: number, label: LocalisedString }>
@@ -43,12 +45,25 @@ local research_targets = {
do --- Calculate the research targets do --- Calculate the research targets
local research_index = 1 local research_index = 1
local total_time = config.milestone_warmup_time * 3600 local total_time = 0
for _, name in pairs(research_data.milestone[research_data.mod_set]) do for _, name in pairs(research_data.milestone[research_data.mod_set]) do
if prototypes.technology[name] and (not prototypes.technology[name].hidden) then local proto = prototypes.technology[name]
if proto and (not proto.hidden) then
research_targets.index_lookup[name] = research_index research_targets.index_lookup[name] = research_index
local r_ing = proto.research_unit_ingredients
if r_ing then
-- each new ingredient add warmup time once
for _, i in pairs(r_ing) do
if not ing_used[i.name] then
ing_used[i.name] = true
total_time = total_time + config.milestone_warmup_time * 3600
end
end
end
-- The number is affected by multiplier already -- The number is affected by multiplier already
total_time = total_time + math.ceil(prototypes.technology[name].research_unit_count * 3600 / config.milestone_rate) total_time = total_time + math.ceil(proto.research_unit_count * 3600 / config.milestone_rate)
research_targets.target_times[research_index] = { research_targets.target_times[research_index] = {
name = name, name = name,