From f49391d206e8cf2a2e0b133614f108e335c0c639 Mon Sep 17 00:00:00 2001 From: LangLangbart <92653266+LangLangBart@users.noreply.github.com> Date: Tue, 27 Sep 2022 20:57:00 +0200 Subject: [PATCH] update mod to 2.6.2 fix the production queue --- gui/pregame/ProjectInformation.js | 2 +- gui/session/stats/BoonGUIStats.js | 2 +- mod.json | 2 +- simulation/components/GuiInterface~boongui.js | 31 ++++++++----------- 4 files changed, 16 insertions(+), 21 deletions(-) diff --git a/gui/pregame/ProjectInformation.js b/gui/pregame/ProjectInformation.js index fe05f226..839cd937 100644 --- a/gui/pregame/ProjectInformation.js +++ b/gui/pregame/ProjectInformation.js @@ -15,7 +15,7 @@ var g_ProjectInformation = { "caption": getBuildString() }, "productDescription": { - "caption": setStringTags(translate("Alpha XXV: Yaunā"), { "font": "sans-bold-18" }) + "\n" + + "caption": setStringTags(translate("Alpha XXVI: Zhuangzi"), { "font": "sans-bold-18" }) + "\n" + setStringTags(translate("boonGUI" + " " + Engine.GetEngineInfo().mods.find(obj => obj.name == "boonGUI").version), { "font": "sans-16" }) } }; diff --git a/gui/session/stats/BoonGUIStats.js b/gui/session/stats/BoonGUIStats.js index 19e4f0a2..81326649 100644 --- a/gui/session/stats/BoonGUIStats.js +++ b/gui/session/stats/BoonGUIStats.js @@ -309,7 +309,7 @@ class BoonGUIStats this.mapCache = new MapCache(); this.shortGameInfoLabel.caption = Engine.IsAtlasRunning() ? "" : sprintf("%(icon_alpha)s %(AlphaText)s %(icon_map)s %(mapName)s%(mapSize)s%(biome)s %(icon_pop)s %(pop)s%(duration)s%(rating)s", { "icon_alpha": '[icon="icon_alpha" displace="1 5"]', - "AlphaText": "Alpha XXV", + "AlphaText": "Alpha XXVI", "icon_map": '[icon="icon_map" displace="2 6"]', "mapName": this.mapCache.translateMapName(this.mapCache.getTranslatableMapName(g_InitAttributes.mapType, g_InitAttributes.map)), "mapSize": g_InitAttributes.mapType == "random" ? " - " + g_MapSizes.Name[g_MapSizes.Tiles.indexOf(g_InitAttributes.settings.Size)] : "", diff --git a/mod.json b/mod.json index ebfdd5f6..b4d6a7ac 100644 --- a/mod.json +++ b/mod.json @@ -1,6 +1,6 @@ { "name": "boonGUI", - "version": "2.6.1", + "version": "2.6.2", "label": "boonGUI", "description": "Enhance the observer's experience with an additional stats overlay.", "ignoreInCompatibilityChecks": true, diff --git a/simulation/components/GuiInterface~boongui.js b/simulation/components/GuiInterface~boongui.js index c053cfc2..de5742e6 100644 --- a/simulation/components/GuiInterface~boongui.js +++ b/simulation/components/GuiInterface~boongui.js @@ -362,34 +362,29 @@ GuiInterface.prototype.boongui_GetOverlay = function(_, { g_IsObserver, g_Viewed } } - if (cmpProductionQueue) { for (const queue of cmpProductionQueue.queue) { + + const cmpTrainer = Engine.QueryInterface(queue.producer, IID_Trainer); + const cmpResearcher = Engine.QueryInterface(queue.producer, IID_Researcher); + const mode = "production"; if (!queue.started || queue.paused) continue; - // TODO: where is timeRemaining ? - const { timeRemaining, timeTotal } = queue; - const progress = 1; - if (queue.originalItem) + if (queue.entity) { - const template = queue.originalItem.templateName; - const mode = "production"; + const { count, progress, "unitTemplate": template } = cmpTrainer.GetBatch(queue.entity); const templateType = "unit"; - const count = queue.originalItem.count; cached.queue.add({ mode, templateType, entity, template, count, progress }); } - // TODO: where is tech template ? - // if (queue.technology) - // { - // const mode = "production"; - // const templateType = "technology"; - // const template = queue.technologyTemplate; - // const count = 1; - // cached.queue.add({ mode, templateType, entity, template, count, progress }); - // } - + if (queue.technology) + { + const { progress, "templateName": template } = cmpResearcher.GetResearchingTechnology(queue.technology); + const templateType = "technology"; + const count = 1; + cached.queue.add({ mode, templateType, entity, template, count, progress }); + } } }