Fixed a Settings loading bug that would cause values from other types to

get loaded into a map.
Added a "Released:" label for release date on GuiGameList.
This commit is contained in:
Aloshi 2013-10-16 18:20:21 -05:00
parent 36ecb83d8d
commit 9867e902de
3 changed files with 11 additions and 4 deletions

View file

@ -88,11 +88,11 @@ void Settings::loadFile()
return;
}
for(pugi::xml_node node = doc.child("bool"); node; node = node.next_sibling())
for(pugi::xml_node node = doc.child("bool"); node; node = node.next_sibling("bool"))
setBool(node.attribute("name").as_string(), node.attribute("value").as_bool());
for(pugi::xml_node node = doc.child("int"); node; node = node.next_sibling())
for(pugi::xml_node node = doc.child("int"); node; node = node.next_sibling("int"))
setInt(node.attribute("name").as_string(), node.attribute("value").as_int());
for(pugi::xml_node node = doc.child("float"); node; node = node.next_sibling())
for(pugi::xml_node node = doc.child("float"); node; node = node.next_sibling("float"))
setFloat(node.attribute("name").as_string(), node.attribute("value").as_float());
if(doc.child("scraper"))

View file

@ -42,6 +42,7 @@ GuiGameList::GuiGameList(Window* window) : GuiComponent(window),
mScreenshot(window),
mDescription(window),
mRating(window),
mReleaseDateLabel(window),
mReleaseDate(window),
mDescContainer(window),
mTransitionImage(window, 0.0f, 0.0f, "", (float)Renderer::getScreenWidth(), (float)Renderer::getScreenHeight(), true),
@ -63,6 +64,7 @@ GuiGameList::GuiGameList(Window* window) : GuiComponent(window),
}
mImageAnimation.addChild(&mScreenshot);
mDescContainer.addChild(&mReleaseDateLabel);
mDescContainer.addChild(&mReleaseDate);
mDescContainer.addChild(&mRating);
mDescContainer.addChild(&mDescription);
@ -370,6 +372,8 @@ void GuiGameList::updateTheme()
mScreenshot.setOrigin(mTheme->getFloat("gameImageOriginX"), mTheme->getFloat("gameImageOriginY"));
mScreenshot.setResize(mTheme->getFloat("gameImageWidth") * Renderer::getScreenWidth(), mTheme->getFloat("gameImageHeight") * Renderer::getScreenHeight(), false);
mReleaseDateLabel.setColor(mTheme->getColor("description"));
mReleaseDateLabel.setFont(mTheme->getDescriptionFont());
mReleaseDate.setColor(mTheme->getColor("description"));
mReleaseDate.setFont(mTheme->getDescriptionFont());
@ -424,7 +428,9 @@ void GuiGameList::updateDetailData()
float ratingHeight = colwidth * 0.3f / 5.0f;
mRating.setSize(ratingHeight * 5.0f, ratingHeight);
mReleaseDate.setPosition(0, 0);
mReleaseDateLabel.setPosition(0, 0);
mReleaseDateLabel.setText("Released: ");
mReleaseDate.setPosition(mReleaseDateLabel.getPosition().x() + mReleaseDateLabel.getSize().x(), mReleaseDateLabel.getPosition().y());
mReleaseDate.setValue(game->metadata()->get("releasedate"));
mRating.setPosition(colwidth - mRating.getSize().x() - 12, 0);

View file

@ -64,6 +64,7 @@ private:
TextComponent mDescription;
RatingComponent mRating;
TextComponent mReleaseDateLabel;
DateTimeComponent mReleaseDate;
ScrollableContainer mDescContainer;