MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / refreshDelayText

Method refreshDelayText

game/ui/tileview/battleview.cpp:2226–2254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2224}
2225
2226void BattleView::refreshDelayText()
2227{
2228 int delay = primingTab->findControlTyped<ScrollBar>("DELAY_SLIDER")->getValue();
2229 LogWarning("Delay %d", delay);
2230 UString text;
2231 if (delay == 0)
2232 {
2233 text = format(tr("Activates now."));
2234 }
2235 else
2236 {
2237 if (battle.mode == Battle::Mode::TurnBased)
2238 {
2239 if (delay == 1)
2240 {
2241 text = format(tr("Activates at end of turn."));
2242 }
2243 else
2244 {
2245 text = format("%s %d", tr("Turns before activation:"), delay - 1);
2246 }
2247 }
2248 else
2249 {
2250 text = format(tr("Delay = %i"), (int)((float)delay / 4.0f));
2251 }
2252 }
2253 primingTab->findControlTyped<Label>("DELAY_TEXT")->setText(text);
2254}
2255
2256void BattleView::refreshRangeText()
2257{

Callers 1

BattleViewMethod · 0.95

Calls 4

formatFunction · 0.85
trFunction · 0.85
getValueMethod · 0.45
setTextMethod · 0.45

Tested by

no test coverage detected