Fix pop indication of paused items.

Reported by @Langbart at 75aa2091b7.

Differential revision: https://code.wildfiregames.com/D4308
Comments by: @Langbart, @marder, @Silier
Fixes #6452

This was SVN commit r26739.
This commit is contained in:
Freagarach 2022-04-01 05:22:49 +00:00
parent 02b87cdb46
commit 12ac4c7714
4 changed files with 10 additions and 4 deletions

View File

@ -117,4 +117,4 @@ ResearchProgressButton.prototype.PortraitDirectory = "session/portraits/";
ResearchProgressButton.prototype.CountdownFormat = markForTranslationWithContext("countdown format", "m:ss");
// Translation: String displayed when the research is paused. E.g. by being garrisoned or when not the first item in the queue.
ResearchProgressButton.prototype.PausedResearchString = markForTranslation("(This item is paused.)");
ResearchProgressButton.prototype.PausedResearchString = markForTranslation("This item is paused.");

View File

@ -594,7 +594,7 @@ g_SelectionPanels.Queue = {
Engine.GetGUIObjectByName("unitQueuePausedIcon[" + data.i + "]").hidden = !queuedItem.paused;
if (queuedItem.paused)
// Translation: String displayed when the research is paused. E.g. by being garrisoned or when not the first item in the queue.
data.button.tooltip += "\n" + translate("(This item is paused.)");
data.button.tooltip += "\n" + translate("This item is paused.");
}
if (template.icon)

View File

@ -14,7 +14,7 @@
<object name="unitQueueIcon[n]" ghost="true" type="image" size="3 3 35 35"/>
<object name="unitQueueProgressSlider[n]" type="image" sprite="queueProgressSlider" ghost="true" size="3 3 35 35"/>
<object name="unitQueueCount[n]" ghost="true" style="groupIconsText" type="text" z="20"/>
<object name="unitQueuePausedIcon[n]" ghost="true" type="image" sprite="stretched:session/icons/stop.png" size="3 3 35 35"/>
<object name="unitQueuePausedIcon[n]" hidden="true" ghost="true" type="image" sprite="stretched:session/icons/stop.png" size="3 3 35 35"/>
</object>
</repeat>
</object>

View File

@ -350,7 +350,13 @@ Trainer.prototype.Item.prototype.Progress = function(allocatedTime)
Trainer.prototype.Item.prototype.Pause = function()
{
this.paused = true;
if (this.started)
this.paused = true;
else if (this.missingPopSpace)
{
delete this.missingPopSpace;
QueryOwnerInterface(this.trainer)?.UnBlockTraining();
}
};
Trainer.prototype.Item.prototype.Unpause = function()