Unverified Commit 0d4b4d00 authored by Ignacio Sanchez Gines's avatar Ignacio Sanchez Gines
Browse files

Increase maximum number of cheats

parent c933b7a0
Pipeline #33767 passed with stages
in 2 minutes and 6 seconds
......@@ -367,28 +367,48 @@ static void main_menu(void)
ImGui::Separator();
ImGui::SetNextWindowSizeConstraints({300.0f, 200.0f}, {300.0f, 500.0f});
if (ImGui::BeginMenu("Cheats"))
{
ImGui::Text("Game Genie or Pro Action Replay codes:");
ImGui::Text("Game Genie or Pro Action Replay codes\n(one code per line):");
static char cheat_buffer[12] = "";
ImGui::Columns(2, "cheats", false);
static char cheat_buffer[20*50] = "";
ImGui::PushItemWidth(150);
ImGui::InputText("", cheat_buffer, 12);
ImGui::InputTextMultiline("", cheat_buffer, IM_ARRAYSIZE(cheat_buffer));
ImGui::PopItemWidth();
ImGui::SameLine();
ImGui::NextColumn();
if (ImGui::Button("Add Cheat Code"))
{
std::string cheat = cheat_buffer;
std::string cheats = cheat_buffer;
std::istringstream ss(cheats);
std::string cheat;
if ((cheat.length() == 7) || (cheat.length() == 11) || (cheat.length() == 8) || (cheat.length() == 9))
while (getline(ss, cheat))
{
cheat_list.push_back(cheat_buffer);
emu_add_cheat(cheat_buffer);
cheat_buffer[0] = 0;
if ((cheat_list.size() < 50) && ((cheat.length() == 7) || (cheat.length() == 11) || (cheat.length() == 8) || (cheat.length() == 9)))
{
cheat_list.push_back(cheat);
emu_add_cheat(cheat.c_str());
cheat_buffer[0] = 0;
}
}
}
if (cheat_list.size() > 0)
{
if (ImGui::Button("Clear All"))
{
cheat_list.clear();
emu_clear_cheats();
}
}
ImGui::Columns(1);
std::list<std::string>::iterator it;
for (it = cheat_list.begin(); it != cheat_list.end(); it++)
......@@ -399,15 +419,6 @@ static void main_menu(void)
ImGui::Text("Pro Action Replay: %s", it->c_str());
}
if (cheat_list.size() > 0)
{
if (ImGui::Button("Clear All"))
{
cheat_list.clear();
emu_clear_cheats();
}
}
ImGui::EndMenu();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment