diff --git a/configurator.cpp b/configurator.cpp index 5a1d6c8..458f2ec 100644 --- a/configurator.cpp +++ b/configurator.cpp @@ -48,6 +48,13 @@ Configurator::Configurator() { #pragma clang diagnostic pop void Configurator::read_card() { + this->aime_gen = GetPrivateProfileIntA( + "aime", + "aimeGen", + 1, + ".\\segatools.ini" + ); + GetPrivateProfileStringA( "aime", "aimePath", @@ -71,6 +78,13 @@ void Configurator::read_card() { f.close(); } + this->felica_gen = GetPrivateProfileIntA( + "aime", + "felicaGen", + 0, + ".\\segatools.ini" + ); + GetPrivateProfileStringA( "aime", "felicaPath", @@ -96,6 +110,12 @@ void Configurator::read_card() { } void Configurator::write_card() { + WritePrivateProfileStringA( + "aime", + "aimeGen", + this->aime_gen ? "1" : "0", + ".\\segatools.ini" + ); WritePrivateProfileStringA( "aime", "aimePath", @@ -113,6 +133,12 @@ void Configurator::write_card() { } } + WritePrivateProfileStringA( + "aime", + "felicaGen", + this->felica_gen ? "1" : "0", + ".\\segatools.ini" + ); WritePrivateProfileStringA( "aime", "felicaPath", @@ -232,6 +258,13 @@ void Configurator::build_cards() { ImGui::PushID("CardAime"); ImGui::TextColored(ImVec4(1, 0.7f, 0, 1), "AiMe"); + ImGui::AlignTextToFramePadding(); + ImGui::Text("Automatically generate if not exist when scanning"); + ImGui::SameLine(); + if (ImGui::Checkbox(this->aime_gen ? "Enabled" : "Disabled", &this->aime_gen)) { + updated = true; + } + if (ImGui::InputTextWithHint("Card Path", "DEVICE\\aime.txt", this->aime_card_path, sizeof(this->aime_card_path))) { updated = true; } @@ -297,6 +330,13 @@ void Configurator::build_cards() { ImGui::PushID("CardFeliCa"); ImGui::TextColored(ImVec4(1, 0.7f, 0, 1), "FeliCa"); + ImGui::AlignTextToFramePadding(); + ImGui::Text("Automatically generate if not exist when scanning"); + ImGui::SameLine(); + if (ImGui::Checkbox(this->felica_gen ? "Enabled" : "Disabled", &this->felica_gen)) { + updated = true; + } + if (ImGui::InputTextWithHint("Card Path", "DEVICE\\felica.txt", this->felica_card_path, sizeof(this->felica_card_path))) { updated = true; } diff --git a/configurator.h b/configurator.h index a23c002..27a59df 100644 --- a/configurator.h +++ b/configurator.h @@ -25,9 +25,11 @@ private: std::thread *card_select_thread = nullptr; bool card_select_done = false; + bool aime_gen; char aime_card_id[21]; char aime_card_path[MAX_PATH]; + bool felica_gen; char felica_card_id[17]; char felica_card_path[MAX_PATH];