diff --git a/UI/GameInfoCache.cpp b/UI/GameInfoCache.cpp index 8a13c52f8..2ff3adc58 100644 --- a/UI/GameInfoCache.cpp +++ b/UI/GameInfoCache.cpp @@ -209,6 +209,8 @@ public: info_->title = info_->paramSFO.GetValueString("TITLE"); info_->id = info_->paramSFO.GetValueString("DISC_ID"); info_->id_version = info_->paramSFO.GetValueString("DISC_ID") + "_" + info_->paramSFO.GetValueString("DISC_VERSION"); + info_->disc_total = info_->paramSFO.GetValueInt("DISC_TOTAL"); + info_->disc_number = info_->paramSFO.GetValueInt("DISC_NUMBER"); info_->paramSFOLoaded = true; } @@ -276,6 +278,8 @@ public: info_->title = info_->paramSFO.GetValueString("TITLE"); info_->id = info_->paramSFO.GetValueString("DISC_ID"); info_->id_version = info_->paramSFO.GetValueString("DISC_ID") + "_" + info_->paramSFO.GetValueString("DISC_VERSION"); + info_->disc_total = info_->paramSFO.GetValueInt("DISC_TOTAL"); + info_->disc_number = info_->paramSFO.GetValueInt("DISC_NUMBER"); info_->paramSFOLoaded = true; } @@ -308,6 +312,8 @@ public: info_->title = info_->paramSFO.GetValueString("TITLE"); info_->id = info_->paramSFO.GetValueString("DISC_ID"); info_->id_version = info_->paramSFO.GetValueString("DISC_ID") + "_" + info_->paramSFO.GetValueString("DISC_VERSION"); + info_->disc_total = info_->paramSFO.GetValueInt("DISC_TOTAL"); + info_->disc_number = info_->paramSFO.GetValueInt("DISC_NUMBER"); info_->paramSFOLoaded = true; } else { diff --git a/UI/GameInfoCache.h b/UI/GameInfoCache.h index 0d4be8c5b..6defdf57a 100644 --- a/UI/GameInfoCache.h +++ b/UI/GameInfoCache.h @@ -59,6 +59,8 @@ public: std::string title; // for easy access, also available in paramSFO. std::string id; std::string id_version; + int disc_total; + int disc_number; IdentifiedFileType fileType; ParamSFOData paramSFO; bool paramSFOLoaded; diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index b42261eea..e46d1f275 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -186,6 +186,12 @@ void GameButton::Draw(UIContext &dc) { dc.Draw()->Flush(); } + char discNumInfo[8]; + if (ginfo->disc_total > 1) + sprintf(discNumInfo, "-DISC%d",ginfo->disc_number); + else + sprintf(discNumInfo, ""); + dc.Draw()->Flush(); dc.RebindTexture(); dc.SetFontStyle(dc.theme->uiFont); @@ -193,8 +199,9 @@ void GameButton::Draw(UIContext &dc) { float tw, th; dc.Draw()->Flush(); dc.PushScissor(bounds_); + std::string title = ginfo->title + discNumInfo; - dc.MeasureText(dc.GetFontStyle(), ginfo->title.c_str(), &tw, &th, 0); + dc.MeasureText(dc.GetFontStyle(), title.c_str(), &tw, &th, 0); int availableWidth = bounds_.w - 150; float sineWidth = std::max(0.0f, (tw - availableWidth)) / 2.0f; @@ -207,7 +214,7 @@ void GameButton::Draw(UIContext &dc) { tb.w = bounds_.w - 150; dc.PushScissor(tb); } - dc.DrawText(ginfo->title.c_str(), bounds_.x + tx, bounds_.centerY(), style.fgColor, ALIGN_VCENTER); + dc.DrawText(title.c_str(), bounds_.x + tx, bounds_.centerY(), style.fgColor, ALIGN_VCENTER); if (availableWidth < tw) { dc.PopScissor(); } @@ -216,7 +223,7 @@ void GameButton::Draw(UIContext &dc) { } else if (!texture) { dc.Draw()->Flush(); dc.PushScissor(bounds_); - dc.DrawText(ginfo->title.c_str(), bounds_.x + 4, bounds_.centerY(), style.fgColor, ALIGN_VCENTER); + dc.DrawText((ginfo->title + discNumInfo).c_str(), bounds_.x + 4, bounds_.centerY(), style.fgColor, ALIGN_VCENTER); dc.Draw()->Flush(); dc.PopScissor(); } else {