diff options
Diffstat (limited to 'Source/Android/app/src')
| -rw-r--r-- | Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/AbstractCheat.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/AbstractCheat.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/AbstractCheat.java index 5dc5e80b6f..9a86d58533 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/AbstractCheat.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/AbstractCheat.java @@ -12,6 +12,21 @@ public abstract class AbstractCheat implements Cheat public int trySet(@NonNull String name, @NonNull String creator, @NonNull String notes, @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()) return TRY_SET_FAIL_NO_NAME; |
