mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-02 22:29:21 +00:00
parent
53ae1a0725
commit
ffa25c4cf5
1 changed files with 15 additions and 0 deletions
|
@ -12,6 +12,21 @@ public abstract class AbstractCheat implements Cheat
|
||||||
public int trySet(@NonNull String name, @NonNull String creator, @NonNull String notes,
|
public int trySet(@NonNull String name, @NonNull String creator, @NonNull String notes,
|
||||||
@NonNull String code)
|
@NonNull String code)
|
||||||
{
|
{
|
||||||
|
if (!code.isEmpty() && code.charAt(0) == '$')
|
||||||
|
{
|
||||||
|
int firstLineEnd = code.indexOf('\n');
|
||||||
|
if (firstLineEnd == -1)
|
||||||
|
{
|
||||||
|
name = code.substring(1);
|
||||||
|
code = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
name = code.substring(1, firstLineEnd);
|
||||||
|
code = code.substring(firstLineEnd + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (name.isEmpty())
|
if (name.isEmpty())
|
||||||
return TRY_SET_FAIL_NO_NAME;
|
return TRY_SET_FAIL_NO_NAME;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue