Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/GuiInterface.js
Show First 20 Lines • Show All 678 Lines • ▼ Show 20 Lines | GuiInterface.prototype.GetStartedResearch = function(player) | ||||
let ret = {}; | let ret = {}; | ||||
for (let tech of cmpTechnologyManager.GetStartedTechs()) | for (let tech of cmpTechnologyManager.GetStartedTechs()) | ||||
{ | { | ||||
ret[tech] = { "researcher": cmpTechnologyManager.GetResearcher(tech) }; | ret[tech] = { "researcher": cmpTechnologyManager.GetResearcher(tech) }; | ||||
let cmpProductionQueue = Engine.QueryInterface(ret[tech].researcher, IID_ProductionQueue); | let cmpProductionQueue = Engine.QueryInterface(ret[tech].researcher, IID_ProductionQueue); | ||||
if (cmpProductionQueue) | if (cmpProductionQueue) | ||||
{ | { | ||||
ret[tech].progress = cmpProductionQueue.GetQueue()[0].progress; | const research = cmpProductionQueue.GetQueue().find(item => item.technologyTemplate === tech); | ||||
ret[tech].timeRemaining = cmpProductionQueue.GetQueue()[0].timeRemaining; | ret[tech].progress = research.progress; | ||||
ret[tech].timeRemaining = research.timeRemaining; | |||||
ret[tech].paused = research.paused; | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
ret[tech].progress = 0; | ret[tech].progress = 0; | ||||
ret[tech].timeRemaining = 0; | ret[tech].timeRemaining = 0; | ||||
ret[tech].paused = true; | |||||
} | } | ||||
} | } | ||||
return ret; | return ret; | ||||
}; | }; | ||||
/** | /** | ||||
* Returns the battle state of the player. | * Returns the battle state of the player. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 1,445 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator