Skip to content

Commit

Permalink
Android: Change default buttons back to A/B (instead of Z/X) due to u…
Browse files Browse the repository at this point in the history
…ser feedback

The option to change it is still available
  • Loading branch information
Ghabry committed Jan 3, 2025
1 parent b77dd94 commit 9f5cc93
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,16 @@ public char getAppropriateChar(int keyCode) {
char charButton;

if (keyCode == ENTER) {
if (SettingsManager.getShowZXasAB()) {
charButton = 'A';
} else {
if (SettingsManager.getShowABasZX()) {
charButton = 'Z';
} else {
charButton = 'A';
}
} else if (keyCode == CANCEL) {
if (SettingsManager.getShowZXasAB()) {
charButton = 'B';
} else {
if (SettingsManager.getShowABasZX()) {
charButton = 'X';
} else {
charButton = 'B';
}
} else if (keyCode == SHIFT) {
charButton = 'S';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ enum SettingsEnum {
FONT1_SIZE("Font1Size"),
FONT2_SIZE("Font2Size"),
GAME_BROWSER_LABEL_MODE("GAME_BROWSER_LABEL_MODE"),
SHOW_ZX_AS_AB("SHOW_ZX_AS_AB")
SHOW_AB_AS_ZX("SHOW_AB_AS_ZX")
;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import android.widget.SeekBar;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatSpinner;

import org.easyrpg.player.BaseActivity;
Expand All @@ -36,9 +35,9 @@ public void onCreate(Bundle savedInstanceState) {
enableVibrateWhenSlidingCheckbox.setChecked(SettingsManager.isVibrateWhenSlidingDirectionEnabled());
enableVibrateWhenSlidingCheckbox.setOnClickListener(this);

CheckBox showZXasABcheckbox = findViewById(R.id.settings_show_zx_as_ab);
showZXasABcheckbox.setChecked(SettingsManager.getShowZXasAB());
showZXasABcheckbox.setOnClickListener(this);
CheckBox showABasZXcheckbox = findViewById(R.id.settings_show_ab_as_zx);
showABasZXcheckbox.setChecked(SettingsManager.getShowABasZX());
showABasZXcheckbox.setOnClickListener(this);

configureFastForwardButton();
configureLayoutTransparencySystem();
Expand All @@ -60,8 +59,8 @@ public void onClick(View v) {
enableVibrateWhenSlidingCheckbox.setEnabled(c.isChecked());
} else if (id == R.id.settings_vibrate_when_sliding){
SettingsManager.setVibrateWhenSlidingDirectionEnabled(((CheckBox) v).isChecked());
} else if (id == R.id.settings_show_zx_as_ab) {
SettingsManager.setShowZXasAB(((CheckBox)v).isChecked());
} else if (id == R.id.settings_show_ab_as_zx) {
SettingsManager.setShowABasZX(((CheckBox)v).isChecked());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class SettingsManager {
FONTS_FOLDER_NAME = "fonts";
public static int FAST_FORWARD_MODE_HOLD = 0, FAST_FORWARD_MODE_TAP = 1;
private static int gameBrowserLabelMode = 0;
private static boolean showZXasAB = false;
private static boolean showABasZX = false;

private static List<String> imageSizeOption = Arrays.asList("nearest", "integer", "bilinear");
private static List<String> gameResolutionOption = Arrays.asList("original", "widescreen", "ultrawide");
Expand Down Expand Up @@ -107,7 +107,7 @@ private static void loadSettings(Context context) {

gameBrowserLabelMode = sharedPref.getInt(GAME_BROWSER_LABEL_MODE.toString(), 0);

showZXasAB = sharedPref.getBoolean(SHOW_ZX_AS_AB.toString(), false);
showABasZX = sharedPref.getBoolean(SHOW_AB_AS_ZX.toString(), false);
}

public static Set<String> getFavoriteGamesList() {
Expand Down Expand Up @@ -505,13 +505,13 @@ public static void setGameBrowserLabelMode(int i) {
editor.commit();
}

public static boolean getShowZXasAB() {
return showZXasAB;
public static boolean getShowABasZX() {
return showABasZX;
}

public static void setShowZXasAB(boolean b) {
showZXasAB = b;
editor.putBoolean(SHOW_ZX_AS_AB.toString(), b);
public static void setShowABasZX(boolean b) {
showABasZX = b;
editor.putBoolean(SHOW_AB_AS_ZX.toString(), b);
editor.commit();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
android:textSize="20sp"/>

<CheckBox
android:id="@+id/settings_show_zx_as_ab"
android:id="@+id/settings_show_ab_as_zx"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/settings_input_show_zx_as_ab"
android:text="@string/settings_input_show_ab_as_zx"
android:textSize="20sp"/>

<include layout="@layout/separator"/>
Expand Down
2 changes: 1 addition & 1 deletion builds/android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Please tell us in detail what went wrong.\n\n
<string name="sound_volume">Sound effect volume</string>
<string name="input_layout_transparency">Input layout transparency:</string>
<string name="ignore_size_settings">Ignore button size settings and use this instead:</string>
<string name="settings_input_show_zx_as_ab">Display Z and X buttons as A and B</string>
<string name="settings_input_show_ab_as_zx">Display A and B buttons as Z and X</string>
<string name="no_read_access_on_dir">No read access on %1$s</string>
<string name="quick_access">Quick access</string>
<string name="fast_forward">Fast-forward button mode:</string>
Expand Down

0 comments on commit 9f5cc93

Please sign in to comment.