OpenXcom Forum

Modding => OpenXcom Extended => OXCE Support => Topic started by: Alpha Centauri Bear on January 03, 2024, 01:49:18 pm

Title: How to use palette and color?
Post by: Alpha Centauri Bear on January 03, 2024, 01:49:18 pm
I am building geoscape popup and trying to do this.
All text is one white.
List rows may be one of two other colors (not white) on condition.
What is the correct way to do it? Thank you.



Some generic questions.

Not all interfaces have palette set. Which palette will be used?

What is "id: palette" element? Is it same as palette or something different?

What palette is used by UFOInfo interface?
Title: Re: How to use palette and color?
Post by: Alpha Centauri Bear on January 03, 2024, 02:28:10 pm
One example of my confusion.
The UFO detection popup. Apparently it uses two colors in the list but I cannot find any color setting code in the UfoDetectedState::UfoDetectedState.
Title: Re: How to use palette and color?
Post by: Meridian on January 03, 2024, 05:34:54 pm
Not all interfaces have palette set. Which palette will be used?

Depends on the interface (and the source code).
Usually PAL_GEOSCAPE.

What is "id: palette" element?

It's an element for the background palette configuration.

Is it same as palette or something different?

Different.

What palette is used by UFOInfo interface?

PAL_GEOSCAPE

One example of my confusion.
The UFO detection popup. Apparently it uses two colors in the list but I cannot find any color setting code in the UfoDetectedState::UfoDetectedState.

Loading colors:

   add(_lstInfo, "text", "UFOInfo");

Changing colors:

   ss << Unicode::TOK_COLOR_FLIP << tr(heading);
Title: Re: How to use palette and color?
Post by: Alpha Centauri Bear on January 03, 2024, 06:26:00 pm
Thank you. Much clearer now.

One question about dots. Does OXCE always use primary color or it matches the color of the text in the cell?
Title: Re: How to use palette and color?
Post by: Meridian on January 03, 2024, 07:54:01 pm
Don't know.
It does the same as OXC.