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

Method setPalette

src/Interface/TextList.cpp:378–403  ·  view source on GitHub ↗

* Replaces a certain amount of colors in the palette of all * the text contained in the list. * @param colors Pointer to the set of colors. * @param firstcolor Offset of the first color to replace. * @param ncolors Amount of colors to replace. */

Source from the content-addressed store, hash-verified

376 * @param ncolors Amount of colors to replace.
377 */
378void TextList::setPalette(SDL_Color *colors, int firstcolor, int ncolors)
379{
380 Surface::setPalette(colors, firstcolor, ncolors);
381 for (std::vector< std::vector<Text*> >::iterator u = _texts.begin(); u < _texts.end(); ++u)
382 {
383 for (std::vector<Text*>::iterator v = u->begin(); v < u->end(); ++v)
384 {
385 (*v)->setPalette(colors, firstcolor, ncolors);
386 }
387 }
388 for (std::vector<ArrowButton*>::iterator i = _arrowLeft.begin(); i < _arrowLeft.end(); ++i)
389 {
390 (*i)->setPalette(colors, firstcolor, ncolors);
391 }
392 for (std::vector<ArrowButton*>::iterator i = _arrowRight.begin(); i < _arrowRight.end(); ++i)
393 {
394 (*i)->setPalette(colors, firstcolor, ncolors);
395 }
396 if (_selector != 0)
397 {
398 _selector->setPalette(colors, firstcolor, ncolors);
399 }
400 _up->setPalette(colors, firstcolor, ncolors);
401 _down->setPalette(colors, firstcolor, ncolors);
402 _scrollbar->setPalette(colors, firstcolor, ncolors);
403}
404
405/**
406 * Changes the resources for the text in the list

Callers 5

addRowMethod · 0.45
initTextMethod · 0.45
setBigMethod · 0.45
setSmallMethod · 0.45
mouseOverMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected