mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2025-12-27 11:05:22 +09:00
.
This commit is contained in:
@@ -307,20 +307,14 @@ if settings.startup['PHI-MI'].value or (settings.startup['PHI-GM'].value and set
|
|||||||
storage.phi_cl.combinator.research_progress = math.floor(game.forces['player'].research_progress * 100)
|
storage.phi_cl.combinator.research_progress = math.floor(game.forces['player'].research_progress * 100)
|
||||||
|
|
||||||
do
|
do
|
||||||
for i = 1, 7 do
|
storage.phi_cl.combinator.research_queue = {}
|
||||||
storage.phi_cl.combinator.research_queue[i] = nil
|
|
||||||
end
|
|
||||||
|
|
||||||
local n = 1
|
local n = 1
|
||||||
|
|
||||||
for _, r in pairs(game.forces['player'].research_queue) do
|
for _, r in pairs(game.forces['player'].research_queue) do
|
||||||
if r.name and r.level and r.research_unit_count_formula then
|
local raw_name = r.name:gsub('-%d+$', '')
|
||||||
if storage.phi_cl.combinator.research_queue[n] then
|
|
||||||
storage.phi_cl.combinator.research_queue[n].value = storage.phi_cl.combinator.research_queue[n].value + math.pow(2, n - 1)
|
|
||||||
|
|
||||||
else
|
if r.name and r.level and r.research_unit_count_formula then
|
||||||
storage.phi_cl.combinator.research_queue[n] = {name = r.name, value = math.pow(2, n - 1)}
|
storage.phi_cl.combinator.research_queue[raw_name] = ((storage.phi_cl.combinator.research_queue[raw_name] and storage.phi_cl.combinator.research_queue[raw_name]) or 0) + math.pow(2, n - 1)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
n = n + 1
|
n = n + 1
|
||||||
@@ -343,13 +337,14 @@ if settings.startup['PHI-MI'].value or (settings.startup['PHI-GM'].value and set
|
|||||||
|
|
||||||
if (val % 2) >= 1 then
|
if (val % 2) >= 1 then
|
||||||
-- read_type_technology_dropdown
|
-- read_type_technology_dropdown
|
||||||
for n, r in pairs(storage.phi_cl.combinator.research_queue) do
|
local n = 11
|
||||||
if r.name then
|
|
||||||
circuit_oc.set_slot(10 + n, {value = {type = 'virtual', name = 'signal-' .. r.name, quality = 'normal'}, min = r.value})
|
|
||||||
|
|
||||||
else
|
for rn, rv in pairs(storage.phi_cl.combinator.research_queue) do
|
||||||
circuit_oc.clear_slot(10 + n)
|
circuit_oc.set_slot(n, {value = {type = 'virtual', name = 'signal-' .. rn, quality = 'normal'}, min = rv})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
for i = n, 17 do
|
||||||
|
circuit_oc.clear_slot(i)
|
||||||
end
|
end
|
||||||
|
|
||||||
circuit_oc.set_slot(18, {value = {type = 'virtual', name = 'signal-PA', quality = 'normal'}, min = storage.phi_cl.combinator.research_progress})
|
circuit_oc.set_slot(18, {value = {type = 'virtual', name = 'signal-PA', quality = 'normal'}, min = storage.phi_cl.combinator.research_progress})
|
||||||
|
|||||||
Reference in New Issue
Block a user