custom textbox colors

Co-authored-by: Misa Elizabeth Kai <infoteddy@infoteddy.info>
This commit is contained in:
AllyTally
2022-11-21 15:02:38 -04:00
committed by Misa Elizabeth Kai
parent de43005676
commit 3d5ba95b96
4 changed files with 53 additions and 0 deletions

View File

@@ -389,6 +389,8 @@ void customlevelclass::reset(void)
script.clearcustom();
onewaycol_override = false;
customcolours.clear();
}
const int* customlevelclass::loadlevel( int rxi, int ryi )
@@ -1285,6 +1287,35 @@ next:
script.customscripts.push_back(script_);
}
}
if (SDL_strcmp(pKey, "TextboxColours") == 0)
{
for (tinyxml2::XMLElement* textColourElement = pElem->FirstChildElement(); textColourElement; textColourElement = textColourElement->NextSiblingElement())
{
if (SDL_strcmp(textColourElement->Value(), "colour") == 0)
{
int r = 255;
int g = 255;
int b = 255;
textColourElement->QueryIntAttribute("r", &r);
textColourElement->QueryIntAttribute("g", &g);
textColourElement->QueryIntAttribute("b", &b);
const char* name = textColourElement->Attribute("name");
if (name != NULL)
{
SDL_Colour colour;
colour.r = r;
colour.g = g;
colour.b = b;
customcolours[name] = colour;
}
}
}
}
}
if (mapwidth < maxwidth)