Jeck - Some basic options handling rewrites, main menu update, example alternate theme (for testing). I'm closing issues 44 and 45, as hopefully this resolves them satisfactorily.
* The alternate theme is just useful for testing themes, but please comment on the changes to the main theme. * Options reading and initializing separated from UI. * Options UI abstracted a bit, made more easily extensible. * With some extension, the options UI could be used as the basis for more complicated themes, if we load a file and use it to do stuff like GameStateOptions::Start()
This commit is contained in:
@@ -117,7 +117,7 @@ void SimpleMenu::Render() {
|
||||
float height = mHeight;
|
||||
if (timeOpen < 1) height *= timeOpen > 0 ? timeOpen : -timeOpen;
|
||||
|
||||
renderer->FillRect(mX, mY, mWidth, height, options[Metrics::POPUP_MENU_FC].asColor(ARGB(180,0,0,0)));
|
||||
renderer->FillRect(mX, mY, mWidth, height, ARGB(180,0,0,0));
|
||||
|
||||
drawVertPole(mX, mY - 16, height + 32);
|
||||
drawVertPole(mX + mWidth, mY - 16, height + 32);
|
||||
@@ -135,9 +135,9 @@ void SimpleMenu::Render() {
|
||||
if ((static_cast<SimpleMenuItem*>(mObjects[i]))->mY - LINE_HEIGHT * startId < mY + height - LINE_HEIGHT + 7) {
|
||||
if (static_cast<SimpleMenuItem*>(mObjects[i])->hasFocus()){
|
||||
resources.GetJLBFont(Constants::MAIN_FONT)->DrawString(static_cast<SimpleMenuItem*>(mObjects[i])->desc.c_str(),mX+mWidth+10,mY+15);
|
||||
mFont->SetColor(options[Metrics::POPUP_MENU_TCH].asColor(ARGB(255,255,255,0)));
|
||||
mFont->SetColor(ARGB(255,255,255,0));
|
||||
} else {
|
||||
mFont->SetColor(options[Metrics::POPUP_MENU_TC].asColor(ARGB(150,255,255,255)));
|
||||
mFont->SetColor(ARGB(150,255,255,255));
|
||||
}
|
||||
(static_cast<SimpleMenuItem*>(mObjects[i]))->RenderWithOffset(-LINE_HEIGHT*startId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user