Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/session/selection_panels.js
Show First 20 Lines • Show All 631 Lines • ▼ Show 20 Lines | if (data.item.neededSlots) | ||||
"population": resourceIcon("population"), | "population": resourceIcon("population"), | ||||
"neededSlots": data.item.neededSlots | "neededSlots": data.item.neededSlots | ||||
}); | }); | ||||
} | } | ||||
data.button.tooltip = tooltip; | data.button.tooltip = tooltip; | ||||
data.countDisplay.caption = data.item.count > 1 ? data.item.count : ""; | data.countDisplay.caption = data.item.count > 1 ? data.item.count : ""; | ||||
// Show the progress number for the first item | // Show the time remaining to finish the first item | ||||
if (data.i == 0) | if (data.i == 0) | ||||
Engine.GetGUIObjectByName("queueProgress").caption = Math.round(data.item.progress*100) + "%"; | Engine.GetGUIObjectByName("queueTimeRemaining").caption = Engine.FormatMillisecondsIntoDateStringGMT(data.item.timeRemaining, translateWithContext("countdown format", "m:ss")); | ||||
let guiObject = Engine.GetGUIObjectByName("unitQueueProgressSlider["+data.i+"]"); | let guiObject = Engine.GetGUIObjectByName("unitQueueProgressSlider["+data.i+"]"); | ||||
let size = guiObject.size; | let size = guiObject.size; | ||||
// Buttons are assumed to be square, so left/right offsets can be used for top/bottom. | // Buttons are assumed to be square, so left/right offsets can be used for top/bottom. | ||||
size.top = size.left + Math.round(data.item.progress * (size.right - size.left)); | size.top = size.left + Math.round(data.item.progress * (size.right - size.left)); | ||||
guiObject.size = size; | guiObject.size = size; | ||||
▲ Show 20 Lines • Show All 556 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator