From 7bf429336bc5211f8a89e8c18cd2f0d633a164b5 Mon Sep 17 00:00:00 2001 From: chinosk <2248589280@qq.com> Date: Fri, 22 Nov 2024 22:45:52 +0000 Subject: [PATCH] fix build error, add card name suffixes match --- app/build.gradle | 2 +- app/lint.xml | 3 +++ app/src/main/cpp/GakumasLocalify/Local.cpp | 11 +++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 app/lint.xml diff --git a/app/build.gradle b/app/build.gradle index 340ca3a..f92b51c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -16,7 +16,7 @@ android { minSdk 29 targetSdk 34 versionCode 4 - versionName "v1.6.2" + versionName "v1.6.3" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { diff --git a/app/lint.xml b/app/lint.xml new file mode 100644 index 0000000..018c372 --- /dev/null +++ b/app/lint.xml @@ -0,0 +1,3 @@ + + + diff --git a/app/src/main/cpp/GakumasLocalify/Local.cpp b/app/src/main/cpp/GakumasLocalify/Local.cpp index fd9e170..562f397 100644 --- a/app/src/main/cpp/GakumasLocalify/Local.cpp +++ b/app/src/main/cpp/GakumasLocalify/Local.cpp @@ -521,6 +521,17 @@ namespace GakumasLocal::Local { return false; } + // 匹配升级卡名 + if (auto plusPos = origText.find_last_not_of('+'); plusPos != std::string::npos) { + const auto noPlusText = origText.substr(0, plusPos + 1); + + if (const auto iter = genericText.find(noPlusText); iter != genericText.end()) { + size_t plusCount = origText.length() - (plusPos + 1); + *newStr = iter->second + std::string(plusCount, '+'); + return true; + } + } + // fmt 文本 auto fmtText = StringParser::ParseItems::parse(origText, false); if (fmtText.isValid) {