Index: binaries/data/mods/public/simulation/components/ProductionQueue.js =================================================================== --- binaries/data/mods/public/simulation/components/ProductionQueue.js +++ binaries/data/mods/public/simulation/components/ProductionQueue.js @@ -23,6 +23,11 @@ "" + "" + "" + + "" + + "" + + "" + + "" + + "" + "" + "" + "tokens" + @@ -68,6 +73,7 @@ this.entityCache = []; this.spawnNotified = false; + this.researchVariant = this.template.ResearchVariant || "researching"; }; /* @@ -350,7 +356,10 @@ let cmpTechnologyManager = QueryOwnerInterface(this.entity, IID_TechnologyManager); cmpTechnologyManager.QueuedResearch(templateName, this.entity); if (this.queue.length == 0) + { cmpTechnologyManager.StartedResearch(templateName, false); + this.SetAnimation(this.researchVariant); + } this.queue.push({ "id": this.nextID++, @@ -447,6 +456,7 @@ // item.player is used as this.entity's owner may be invalid (deletion, etc.) var cmpTechnologyManager = QueryPlayerIDInterface(item.player, IID_TechnologyManager); cmpTechnologyManager.StoppedResearch(item.technologyTemplate, true); + this.SetAnimation("idle"); } // Remove from the queue @@ -458,6 +468,13 @@ } }; +ProductionQueue.prototype.SetAnimation = function(name) +{ + let cmpVisual = Engine.QueryInterface(this.entity, IID_Visual); + if (cmpVisual) + cmpVisual.SelectAnimation(name, false, 1); +} + /* * Returns basic data from all batches in the production queue. */ @@ -704,6 +721,7 @@ // Mark the research as started. var cmpTechnologyManager = QueryOwnerInterface(this.entity, IID_TechnologyManager); cmpTechnologyManager.StartedResearch(item.technologyTemplate, true); + this.SetAnimation(this.researchVariant); } item.productionStarted = true; @@ -763,9 +781,8 @@ { var cmpTechnologyManager = QueryOwnerInterface(this.entity, IID_TechnologyManager); cmpTechnologyManager.ResearchTechnology(item.technologyTemplate); - + this.SetAnimation("idle"); let template = TechnologyTemplates.Get(item.technologyTemplate); - if (template && template.soundComplete) { var cmpSoundManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_SoundManager);