mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-22 21:09:52 +00:00
UI fixes
This commit is contained in:
parent
3831ec1921
commit
61bd01144e
@ -203,8 +203,10 @@ namespace Reporting
|
||||
it = crcResults.find(gamePath);
|
||||
}
|
||||
|
||||
if (crcThread.joinable())
|
||||
if (crcThread.joinable()) {
|
||||
INFO_LOG(SYSTEM, "Finished CRC calculation");
|
||||
crcThread.join();
|
||||
}
|
||||
return it->second;
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,8 @@ public:
|
||||
|
||||
bool Ready(GameInfoFlags flags) {
|
||||
std::unique_lock<std::mutex> guard(lock);
|
||||
return (hasFlags & flags) != 0;
|
||||
// Avoid the operator, we want to check all the bits.
|
||||
return ((int)hasFlags & (int)flags) == (int)flags;
|
||||
}
|
||||
|
||||
void MarkReadyNoLock(GameInfoFlags flags) {
|
||||
|
@ -149,9 +149,10 @@ void GameScreen::CreateViews() {
|
||||
tvCRC_->SetVisibility(Reporting::HasCRC(gamePath_) ? V_VISIBLE : V_GONE);
|
||||
tvVerified_ = infoLayout->Add(new NoticeView(NoticeLevel::INFO, ga->T("Click \"Calculate CRC\" to verify ISO"), "", new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
|
||||
tvVerified_->SetVisibility(UI::V_GONE);
|
||||
tvVerified_->SetSquishy(true);
|
||||
if (info->badCHD) {
|
||||
auto e = GetI18NCategory(I18NCat::ERRORS);
|
||||
infoLayout->Add(new NoticeView(NoticeLevel::ERROR, e->T("BadCHD", "Bad CHD file.\nCompress using \"chdman createdvd\" for good performance."), "", new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
|
||||
infoLayout->Add(new NoticeView(NoticeLevel::ERROR, e->T("BadCHD", "Bad CHD file.\nCompress using \"chdman createdvd\" for good performance."), "", new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)))->SetSquishy(true);
|
||||
}
|
||||
} else {
|
||||
tvTitle_ = nullptr;
|
||||
@ -296,7 +297,7 @@ ScreenRenderFlags GameScreen::render(ScreenRenderMode mode) {
|
||||
tvTitle_->SetText(info->GetTitle());
|
||||
}
|
||||
|
||||
if (info->gameSizeOnDisk) {
|
||||
if (info->Ready(GameInfoFlags::SIZE | GameInfoFlags::UNCOMPRESSED_SIZE)) {
|
||||
char temp[256];
|
||||
if (tvGameSize_) {
|
||||
snprintf(temp, sizeof(temp), "%s: %s", ga->T("Game"), NiceSizeFormat(info->gameSizeOnDisk).c_str());
|
||||
@ -350,7 +351,7 @@ ScreenRenderFlags GameScreen::render(ScreenRenderMode mode) {
|
||||
|
||||
// Let's check the CRC in the game database, looking up the ID and also matching the crc.
|
||||
std::vector<GameDBInfo> dbInfos;
|
||||
if (tvVerified_ && !info->id_version.empty() && g_gameDB.GetGameInfos(info->id_version, &dbInfos)) {
|
||||
if (tvVerified_ && info->Ready(GameInfoFlags::PARAM_SFO) && g_gameDB.GetGameInfos(info->id_version, &dbInfos)) {
|
||||
bool found = false;
|
||||
for (auto &dbInfo : dbInfos) {
|
||||
if (dbInfo.crc == crcVal) {
|
||||
@ -365,21 +366,23 @@ ScreenRenderFlags GameScreen::render(ScreenRenderMode mode) {
|
||||
// Like the other messages below, disabled until we have a database we have confidence in.
|
||||
// tvVerified_->SetText(ga->T("CRC checksum does not match, bad or modified ISO"));
|
||||
// tvVerified_->SetLevel(NoticeLevel::ERROR);
|
||||
tvVerified_->SetVisibility(UI::V_GONE);
|
||||
}
|
||||
} else {
|
||||
} else if (tvVerified_) {
|
||||
// tvVerified_->SetText(ga->T("Game ID unknown - not in the Redump database"));
|
||||
// tvVerified_->SetVisibility(UI::V_VISIBLE);
|
||||
// tvVerified_->SetLevel(NoticeLevel::WARN);
|
||||
tvVerified_->SetVisibility(UI::V_GONE);
|
||||
}
|
||||
} else if (!isHomebrew_) {
|
||||
GameDBInfo dbInfo;
|
||||
if (tvVerified_) {
|
||||
std::vector<GameDBInfo> dbInfos;
|
||||
if (!info->id_version.empty() && !g_gameDB.GetGameInfos(info->id_version, &dbInfos)) {
|
||||
if (info->Ready(GameInfoFlags::PARAM_SFO) && !g_gameDB.GetGameInfos(info->id_version, &dbInfos)) {
|
||||
// tvVerified_->SetText(ga->T("Game ID unknown - not in the ReDump database"));
|
||||
// tvVerified_->SetVisibility(UI::V_VISIBLE);
|
||||
// tvVerified_->SetLevel(NoticeLevel::WARN);
|
||||
} else if (info->gameSizeUncompressed != 0) { // don't do this check if info still pending
|
||||
} else if (info->Ready(GameInfoFlags::UNCOMPRESSED_SIZE) && info->gameSizeUncompressed != 0) { // don't do this check if info still pending
|
||||
bool found = false;
|
||||
for (auto &dbInfo : dbInfos) {
|
||||
// TODO: Doesn't take CSO/CHD into account.
|
||||
@ -391,6 +394,7 @@ ScreenRenderFlags GameScreen::render(ScreenRenderMode mode) {
|
||||
// tvVerified_->SetText(ga->T("File size incorrect, bad or modified ISO"));
|
||||
// tvVerified_->SetVisibility(UI::V_VISIBLE);
|
||||
// tvVerified_->SetLevel(NoticeLevel::ERROR);
|
||||
// INFO_LOG(LOADER, "File size %d not matching game DB", (int)info->gameSizeUncompressed);
|
||||
} else {
|
||||
tvVerified_->SetText(ga->T("Click \"Calculate CRC\" to verify ISO"));
|
||||
tvVerified_->SetVisibility(UI::V_VISIBLE);
|
||||
|
@ -564,7 +564,9 @@ void NoticeView::GetContentDimensionsBySpec(const UIContext &dc, UI::MeasureSpec
|
||||
ApplyBoundsBySpec(bounds, horiz, vert);
|
||||
MeasureNotice(dc, level_, text_, detailsText_, iconName_, 0, &w, &h, &height1_);
|
||||
// Layout hack! Some weird problems with the layout that I can't figure out right now..
|
||||
w = 50.0;
|
||||
if (squishy_) {
|
||||
w = 50.0;
|
||||
}
|
||||
}
|
||||
|
||||
void NoticeView::Draw(UIContext &dc) {
|
||||
|
@ -69,6 +69,9 @@ public:
|
||||
void SetLevel(NoticeLevel level) {
|
||||
level_ = level;
|
||||
}
|
||||
void SetSquishy(bool squishy) {
|
||||
squishy_ = squishy;
|
||||
}
|
||||
|
||||
void GetContentDimensionsBySpec(const UIContext &dc, UI::MeasureSpec horiz, UI::MeasureSpec vert, float &w, float &h) const override;
|
||||
void Draw(UIContext &dc) override;
|
||||
@ -79,4 +82,5 @@ private:
|
||||
std::string iconName_;
|
||||
NoticeLevel level_;
|
||||
mutable float height1_ = 0.0f;
|
||||
bool squishy_ = false;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user