mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-10 22:49:00 +01:00
Merge pull request #10018 from JosJuice/code-allow-name-line
DolphinQt: Allow $ line when entering AR/Gecko code
This commit is contained in:
commit
82969db7de
@ -122,6 +122,8 @@ void CheatCodeEditor::ConnectWidgets()
|
|||||||
|
|
||||||
bool CheatCodeEditor::AcceptAR()
|
bool CheatCodeEditor::AcceptAR()
|
||||||
{
|
{
|
||||||
|
QString name = m_name_edit->text();
|
||||||
|
|
||||||
std::vector<ActionReplay::AREntry> entries;
|
std::vector<ActionReplay::AREntry> entries;
|
||||||
std::vector<std::string> encrypted_lines;
|
std::vector<std::string> encrypted_lines;
|
||||||
|
|
||||||
@ -134,6 +136,14 @@ bool CheatCodeEditor::AcceptAR()
|
|||||||
if (line.isEmpty())
|
if (line.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (i == 0 && line[0] == u'$')
|
||||||
|
{
|
||||||
|
if (name.isEmpty())
|
||||||
|
name = line.right(line.size() - 1);
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
QStringList values = line.split(QLatin1Char{' '});
|
QStringList values = line.split(QLatin1Char{' '});
|
||||||
|
|
||||||
bool good = true;
|
bool good = true;
|
||||||
@ -220,7 +230,7 @@ bool CheatCodeEditor::AcceptAR()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ar_code->name = m_name_edit->text().toStdString();
|
m_ar_code->name = name.toStdString();
|
||||||
m_ar_code->ops = std::move(entries);
|
m_ar_code->ops = std::move(entries);
|
||||||
m_ar_code->user_defined = true;
|
m_ar_code->user_defined = true;
|
||||||
|
|
||||||
@ -229,6 +239,8 @@ bool CheatCodeEditor::AcceptAR()
|
|||||||
|
|
||||||
bool CheatCodeEditor::AcceptGecko()
|
bool CheatCodeEditor::AcceptGecko()
|
||||||
{
|
{
|
||||||
|
QString name = m_name_edit->text();
|
||||||
|
|
||||||
std::vector<Gecko::GeckoCode::Code> entries;
|
std::vector<Gecko::GeckoCode::Code> entries;
|
||||||
|
|
||||||
QStringList lines = m_code_edit->toPlainText().split(QLatin1Char{'\n'});
|
QStringList lines = m_code_edit->toPlainText().split(QLatin1Char{'\n'});
|
||||||
@ -240,6 +252,14 @@ bool CheatCodeEditor::AcceptGecko()
|
|||||||
if (line.isEmpty())
|
if (line.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (i == 0 && line[0] == u'$')
|
||||||
|
{
|
||||||
|
if (name.isEmpty())
|
||||||
|
name = line.right(line.size() - 1);
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
QStringList values = line.split(QLatin1Char{' '});
|
QStringList values = line.split(QLatin1Char{' '});
|
||||||
|
|
||||||
bool good = values.size() == 2;
|
bool good = values.size() == 2;
|
||||||
@ -283,7 +303,7 @@ bool CheatCodeEditor::AcceptGecko()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_gecko_code->name = m_name_edit->text().toStdString();
|
m_gecko_code->name = name.toStdString();
|
||||||
m_gecko_code->creator = m_creator_edit->text().toStdString();
|
m_gecko_code->creator = m_creator_edit->text().toStdString();
|
||||||
m_gecko_code->codes = std::move(entries);
|
m_gecko_code->codes = std::move(entries);
|
||||||
m_gecko_code->notes = SplitString(m_notes_edit->toPlainText().toStdString(), '\n');
|
m_gecko_code->notes = SplitString(m_notes_edit->toPlainText().toStdString(), '\n');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user