mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-26 16:15:39 +00:00
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:
parent
36ecb83d8d
commit
9867e902de
|
@ -88,11 +88,11 @@ void Settings::loadFile()
|
||||||
return;
|
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());
|
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());
|
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());
|
setFloat(node.attribute("name").as_string(), node.attribute("value").as_float());
|
||||||
|
|
||||||
if(doc.child("scraper"))
|
if(doc.child("scraper"))
|
||||||
|
|
|
@ -42,6 +42,7 @@ GuiGameList::GuiGameList(Window* window) : GuiComponent(window),
|
||||||
mScreenshot(window),
|
mScreenshot(window),
|
||||||
mDescription(window),
|
mDescription(window),
|
||||||
mRating(window),
|
mRating(window),
|
||||||
|
mReleaseDateLabel(window),
|
||||||
mReleaseDate(window),
|
mReleaseDate(window),
|
||||||
mDescContainer(window),
|
mDescContainer(window),
|
||||||
mTransitionImage(window, 0.0f, 0.0f, "", (float)Renderer::getScreenWidth(), (float)Renderer::getScreenHeight(), true),
|
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);
|
mImageAnimation.addChild(&mScreenshot);
|
||||||
|
mDescContainer.addChild(&mReleaseDateLabel);
|
||||||
mDescContainer.addChild(&mReleaseDate);
|
mDescContainer.addChild(&mReleaseDate);
|
||||||
mDescContainer.addChild(&mRating);
|
mDescContainer.addChild(&mRating);
|
||||||
mDescContainer.addChild(&mDescription);
|
mDescContainer.addChild(&mDescription);
|
||||||
|
@ -370,6 +372,8 @@ void GuiGameList::updateTheme()
|
||||||
mScreenshot.setOrigin(mTheme->getFloat("gameImageOriginX"), mTheme->getFloat("gameImageOriginY"));
|
mScreenshot.setOrigin(mTheme->getFloat("gameImageOriginX"), mTheme->getFloat("gameImageOriginY"));
|
||||||
mScreenshot.setResize(mTheme->getFloat("gameImageWidth") * Renderer::getScreenWidth(), mTheme->getFloat("gameImageHeight") * Renderer::getScreenHeight(), false);
|
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.setColor(mTheme->getColor("description"));
|
||||||
mReleaseDate.setFont(mTheme->getDescriptionFont());
|
mReleaseDate.setFont(mTheme->getDescriptionFont());
|
||||||
|
|
||||||
|
@ -424,7 +428,9 @@ void GuiGameList::updateDetailData()
|
||||||
float ratingHeight = colwidth * 0.3f / 5.0f;
|
float ratingHeight = colwidth * 0.3f / 5.0f;
|
||||||
mRating.setSize(ratingHeight * 5.0f, ratingHeight);
|
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"));
|
mReleaseDate.setValue(game->metadata()->get("releasedate"));
|
||||||
|
|
||||||
mRating.setPosition(colwidth - mRating.getSize().x() - 12, 0);
|
mRating.setPosition(colwidth - mRating.getSize().x() - 12, 0);
|
||||||
|
|
|
@ -64,6 +64,7 @@ private:
|
||||||
|
|
||||||
TextComponent mDescription;
|
TextComponent mDescription;
|
||||||
RatingComponent mRating;
|
RatingComponent mRating;
|
||||||
|
TextComponent mReleaseDateLabel;
|
||||||
DateTimeComponent mReleaseDate;
|
DateTimeComponent mReleaseDate;
|
||||||
|
|
||||||
ScrollableContainer mDescContainer;
|
ScrollableContainer mDescContainer;
|
||||||
|
|
Loading…
Reference in a new issue