summaryrefslogtreecommitdiff
path: root/Source/Android/app/src/main/java
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2021-08-13 19:45:08 +0200
committerJosJuice <josjuice@gmail.com>2021-09-16 18:48:40 +0200
commitffa25c4cf55d7ec4b3133e0597569072ea0f1b6a (patch)
tree5c574b6dafbe1a16b2da543a9437f959ecc96b9c /Source/Android/app/src/main/java
parent53ae1a07252d628f33543e1a19427d4848cc7393 (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.java15
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;