Made the list selected color have no effect if zero.

This commit is contained in:
Aloshi 2013-01-08 09:23:28 -06:00
parent 9da01403a0
commit 8fc2b8377a
4 changed files with 8 additions and 5 deletions

View file

@ -96,7 +96,7 @@ Display tags define some "meta" display attributes about your theme. Display tag
`<listSelectorColor>` - the hex color to use for the "selector bar" on the GuiGameList. Default is `000000FF`.
`<listSelectedColor>` - the hex color to use for selected text on the GuiGameList. Default is the value of `<listPrimaryColor>`.
`<listSelectedColor>` - the hex color to use for selected text on the GuiGameList. Default is zero, which means no change.
`<listLeftAlign />` - if present, the games list names will be left aligned to the value of `<listOffsetX>` (default 0.5).

View file

@ -1,3 +1,6 @@
January 8, 2012
-Made a value of zero for "list selected color" mean no change.
January 6, 2012
-Added <basicTheme> tag support.

View file

@ -18,7 +18,7 @@ GuiList<listType>::GuiList(int offsetX, int offsetY, Font* font)
mFont = font;
mSelectorColor = 0x000000FF;
mSelectedTextColorOverride = 0x0000FFFF;
mSelectedTextColorOverride = 0;
mScrollSound = NULL;
mDrawCentered = true;
@ -75,7 +75,7 @@ void GuiList<listType>::onRender()
ListRow row = mRowVector.at((unsigned int)i);
if(mDrawCentered)
Renderer::drawCenteredText(row.name, getOffsetX(), y, (mSelection == i) ? mSelectedTextColorOverride : row.color, mFont);
Renderer::drawCenteredText(row.name, getOffsetX(), y, (mSelection == i && mSelectedTextColorOverride != 0) ? mSelectedTextColorOverride : row.color, mFont);
else
Renderer::drawText(row.name, getOffsetX() + mTextOffsetX, y, (mSelection == i) ? mSelectedTextColorOverride : row.color, mFont);

View file

@ -79,7 +79,7 @@ void GuiTheme::setDefaults()
mColorMap["primary"] = 0x0000FFFF;
mColorMap["secondary"] = 0x00FF00FF;
mColorMap["selector"] = 0x000000FF;
mColorMap["selected"] = 0xFF0000FF;
mColorMap["selected"] = 0x00000000;
mColorMap["description"] = 0x0000FFFF;
mColorMap["fastSelect"] = 0xFF0000FF;
@ -185,7 +185,7 @@ void GuiTheme::readXML(std::string path)
mColorMap["primary"] = resolveColor(root.child("listPrimaryColor").text().get(), mColorMap["primary"]);
mColorMap["secondary"] = resolveColor(root.child("listSecondaryColor").text().get(), mColorMap["secondary"]);
mColorMap["selector"] = resolveColor(root.child("listSelectorColor").text().get(), mColorMap["selector"]);
mColorMap["selected"] = resolveColor(root.child("listSelectedColor").text().get(), mColorMap["primary"]);
mColorMap["selected"] = resolveColor(root.child("listSelectedColor").text().get(), mColorMap["selected"]);
mColorMap["description"] = resolveColor(root.child("descColor").text().get(), mColorMap["description"]);
mColorMap["fastSelect"] = resolveColor(root.child("fastSelectColor").text().get(), mColorMap["fastSelect"]);