MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / ThemeSetColour

Function ThemeSetColour

src/openrct2-ui/interface/Theme.cpp:797–821  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

795 }
796
797 void ThemeSetColour(WindowClass wc, uint8_t index, ColourWithFlags colour)
798 {
799 UIThemeWindowEntry entry{};
800 entry.Class = wc;
801
802 auto currentEntry = const_cast<UIThemeWindowEntry*>(ThemeManager::CurrentTheme->GetEntry(wc));
803 if (currentEntry != nullptr)
804 {
805 entry.Theme = currentEntry->Theme;
806 }
807 else
808 {
809 const WindowThemeDesc* desc = GetWindowThemeDescriptor(wc);
810 if (desc == nullptr)
811 {
812 return;
813 }
814 entry.Theme = desc->windowColours.defaultTheme;
815 }
816
817 entry.Theme.Colours[index] = colour;
818 ThemeManager::CurrentTheme->SetEntry(&entry);
819
820 ThemeSave();
821 }
822
823 uint8_t ThemeGetFlags()
824 {

Callers 2

onDropdownMethod · 0.85
onScrollMouseDownMethod · 0.85

Calls 4

GetWindowThemeDescriptorFunction · 0.85
ThemeSaveFunction · 0.85
SetEntryMethod · 0.80
GetEntryMethod · 0.45

Tested by

no test coverage detected