diff options
| author | JosJuice <josjuice@gmail.com> | 2021-08-13 19:45:08 +0200 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2021-09-16 18:48:40 +0200 |
| commit | ffa25c4cf55d7ec4b3133e0597569072ea0f1b6a (patch) | |
| tree | 5c574b6dafbe1a16b2da543a9437f959ecc96b9c /Source/Android/app/src/main/java | |
| parent | 53ae1a07252d628f33543e1a19427d4848cc7393 (diff) | |
Android: Allow $ line when entering cheat code
Port of cda442d.
Diffstat (limited to 'Source/Android/app/src/main/java')
| -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; |
