Fix race conditions when reading game title.

Fixes #5030.
This commit is contained in:
Unknown W. Brackets 2015-12-24 13:18:46 -08:00
parent bc9c3ca649
commit e6b5fbb40a
5 changed files with 23 additions and 16 deletions

View file

@ -277,8 +277,9 @@ void GameButton::Draw(UIContext &dc) {
float tw, th;
dc.Draw()->Flush();
dc.PushScissor(bounds_);
if (title_.empty() && !ginfo->title.empty()) {
title_ = ReplaceAll(ginfo->title + discNumInfo, "&", "&&");
const std::string currentTitle = ginfo->GetTitle();
if (!currentTitle.empty()) {
title_ = ReplaceAll(currentTitle + discNumInfo, "&", "&&");
title_ = ReplaceAll(title_, "\n", " ");
}
@ -310,8 +311,7 @@ void GameButton::Draw(UIContext &dc) {
} else {
dc.Draw()->Flush();
}
if (!ginfo->id.empty() && ginfo->hasConfig)
{
if (ginfo->hasConfig && !ginfo->id.empty()) {
dc.Draw()->DrawImage(I_GEAR, x, y + h - ui_images[I_GEAR].h, 1.0f);
}
if (overlayColor) {