MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / applyBattlescapeTheme

Method applyBattlescapeTheme

src/Engine/State.cpp:257–312  ·  view source on GitHub ↗

* switch all the colours to something a little more battlescape appropriate. */

Source from the content-addressed store, hash-verified

255 * switch all the colours to something a little more battlescape appropriate.
256 */
257void State::applyBattlescapeTheme()
258{
259 for (std::vector<Surface*>::iterator i = _surfaces.begin(); i != _surfaces.end(); ++i)
260 {
261 Window* window = dynamic_cast<Window*>(*i);
262 if (window)
263 {
264 window->setColor(Palette::blockOffset(0)-1);
265 window->setHighContrast(true);
266 window->setBackground(_game->getResourcePack()->getSurface("TAC00.SCR"));
267 }
268 Text* text = dynamic_cast<Text*>(*i);
269 if (text)
270 {
271 text->setColor(Palette::blockOffset(0)-1);
272 text->setHighContrast(true);
273 }
274 TextButton* button = dynamic_cast<TextButton*>(*i);
275 if (button)
276 {
277 button->setColor(Palette::blockOffset(0)-1);
278 button->setHighContrast(true);
279 }
280 TextEdit* edit = dynamic_cast<TextEdit*>(*i);
281 if (edit)
282 {
283 edit->setColor(Palette::blockOffset(0)-1);
284 edit->setHighContrast(true);
285 }
286 TextList* list = dynamic_cast<TextList*>(*i);
287 if (list)
288 {
289 list->setColor(Palette::blockOffset(0)-1);
290 list->setArrowColor(Palette::blockOffset(0));
291 list->setHighContrast(true);
292 }
293 ArrowButton *arrow = dynamic_cast<ArrowButton*>(*i);
294 if (arrow)
295 {
296 arrow->setColor(Palette::blockOffset(0));
297 }
298 Slider *slider = dynamic_cast<Slider*>(*i);
299 if (slider)
300 {
301 slider->setColor(Palette::blockOffset(0)-1);
302 slider->setHighContrast(true);
303 }
304 ComboBox *combo = dynamic_cast<ComboBox*>(*i);
305 if (combo)
306 {
307 combo->setColor(Palette::blockOffset(0)-1);
308 combo->setArrowColor(Palette::blockOffset(0));
309 combo->setHighContrast(true);
310 }
311 }
312}
313
314/**

Callers

nothing calls this directly

Calls 6

setColorMethod · 0.45
setHighContrastMethod · 0.45
setBackgroundMethod · 0.45
getSurfaceMethod · 0.45
getResourcePackMethod · 0.45
setArrowColorMethod · 0.45

Tested by

no test coverage detected