summaryrefslogtreecommitdiff
path: root/Source/Android
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2019-04-09 19:30:26 -0400
committerGitHub <noreply@github.com>2019-04-09 19:30:26 -0400
commite10a472134fdf557ec35505eb5fb7c74ba9f2af7 (patch)
tree9593eb71abc3f724159693d46eb8504ede9529f0 /Source/Android
parent0b8ac0a22f2fcebb7cbd00bbb36fd0c89191d34a (diff)
parent5efb717873691fa42447ca0d9d9810b5ad501b42 (diff)
Merge pull request #7936 from jordan-woyak/numeric-setting-cleanup
InputCommon: Clean up how numeric settings are handled.
Diffstat (limited to 'Source/Android')
-rw-r--r--Source/Android/app/src/main/assets/WiimoteNew.ini24
-rw-r--r--Source/Android/app/src/main/assets/WiimoteProfile.ini8
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java94
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/utils/SettingsFile.java6
-rw-r--r--Source/Android/app/src/main/res/layout/dialog_ir_sensitivity.xml34
-rw-r--r--Source/Android/app/src/main/res/values/strings.xml6
6 files changed, 88 insertions, 84 deletions
diff --git a/Source/Android/app/src/main/assets/WiimoteNew.ini b/Source/Android/app/src/main/assets/WiimoteNew.ini
index e1a3804587..2ebd9d61d9 100644
--- a/Source/Android/app/src/main/assets/WiimoteNew.ini
+++ b/Source/Android/app/src/main/assets/WiimoteNew.ini
@@ -18,9 +18,9 @@ IR/Right = `Axis 115`
IR/Forward = `Axis 116`
IR/Backward = `Axis 117`
IR/Hide = `Button 118`
-IR/Height = 50
-IR/Width = 50
-IR/Center = 50
+IR/Total Pitch = 15
+IR/Total Yaw = 15
+IR/Vertical Offset = 10
Swing/Up = `Axis 120`
Swing/Down = `Axis 121`
Swing/Left = `Axis 122`
@@ -157,9 +157,9 @@ IR/Right = `Axis 115`
IR/Forward = `Axis 116`
IR/Backward = `Axis 117`
IR/Hide = `Button 118`
-IR/Height = 50
-IR/Width = 50
-IR/Center = 50
+IR/Total Pitch = 15
+IR/Total Yaw = 15
+IR/Vertical Offset = 10
Swing/Up = `Axis 120`
Swing/Down = `Axis 121`
Swing/Left = `Axis 122`
@@ -296,9 +296,9 @@ IR/Right = `Axis 115`
IR/Forward = `Axis 116`
IR/Backward = `Axis 117`
IR/Hide = `Button 118`
-IR/Height = 50
-IR/Width = 50
-IR/Center = 50
+IR/Total Pitch = 15
+IR/Total Yaw = 15
+IR/Vertical Offset = 10
Swing/Up = `Axis 120`
Swing/Down = `Axis 121`
Swing/Left = `Axis 122`
@@ -435,9 +435,9 @@ IR/Right = `Axis 115`
IR/Forward = `Axis 116`
IR/Backward = `Axis 117`
IR/Hide = `Button 118`
-IR/Height = 50
-IR/Width = 50
-IR/Center = 50
+IR/Total Pitch = 15
+IR/Total Yaw = 15
+IR/Vertical Offset = 10
Swing/Up = `Axis 120`
Swing/Down = `Axis 121`
Swing/Left = `Axis 122`
diff --git a/Source/Android/app/src/main/assets/WiimoteProfile.ini b/Source/Android/app/src/main/assets/WiimoteProfile.ini
index 2283a1add2..2546736d13 100644
--- a/Source/Android/app/src/main/assets/WiimoteProfile.ini
+++ b/Source/Android/app/src/main/assets/WiimoteProfile.ini
@@ -18,9 +18,9 @@ IR/Right = `Axis 115`
IR/Forward = `Axis 116`
IR/Backward = `Axis 117`
IR/Hide = `Button 118`
-IR/Height = 50
-IR/Width = 50
-IR/Center = 50
+IR/Total Pitch = 15
+IR/Total Yaw = 15
+IR/Vertical Offset = 10
Swing/Up = `Axis 120`
Swing/Down = `Axis 121`
Swing/Left = `Axis 122`
@@ -135,4 +135,4 @@ Turntable/Stick/Radius = 100,000000
Turntable/Effect/Dial = `Axis 621`
Turntable/Crossfade/Left = `Axis 623`
Turntable/Crossfade/Right = `Axis 624`
-Rumble/Motor = `Rumble 700` \ No newline at end of file
+Rumble/Motor = `Rumble 700`
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java
index 880487c00e..3ba7e5f893 100644
--- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java
+++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java
@@ -842,26 +842,26 @@ public final class EmulationActivity extends AppCompatActivity
private void setIRSensitivity()
{
- int irHeight = Integer.valueOf(
- mPreferences.getString(SettingsFile.KEY_WIIBIND_IR_HEIGHT + mSelectedGameId, "50"));
+ int ir_pitch = Integer.valueOf(
+ mPreferences.getString(SettingsFile.KEY_WIIBIND_IR_PITCH + mSelectedGameId, "15"));
LayoutInflater inflater = LayoutInflater.from(this);
View view = inflater.inflate(R.layout.dialog_ir_sensitivity, null);
- TextView mTextSliderValueHeight = (TextView) view.findViewById(R.id.text_ir_height);
- TextView units = (TextView) view.findViewById(R.id.text_ir_height_units);
- SeekBar seekbarHeight = view.findViewById(R.id.seekbar_height);
+ TextView text_slider_value_pitch = (TextView) view.findViewById(R.id.text_ir_pitch);
+ TextView units = (TextView) view.findViewById(R.id.text_ir_pitch_units);
+ SeekBar seekbar_pitch = view.findViewById(R.id.seekbar_pitch);
- mTextSliderValueHeight.setText(String.valueOf(irHeight));
- units.setText(getString(R.string.height));
- seekbarHeight.setMax(100);
- seekbarHeight.setProgress(irHeight);
- seekbarHeight.setKeyProgressIncrement(5);
- seekbarHeight.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()
+ text_slider_value_pitch.setText(String.valueOf(ir_pitch));
+ units.setText(getString(R.string.pitch));
+ seekbar_pitch.setMax(100);
+ seekbar_pitch.setProgress(ir_pitch);
+ seekbar_pitch.setKeyProgressIncrement(5);
+ seekbar_pitch.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()
{
@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
{
- mTextSliderValueHeight.setText(String.valueOf(progress));
+ text_slider_value_pitch.setText(String.valueOf(progress));
}
@Override public void onStartTrackingTouch(SeekBar seekBar)
@@ -875,23 +875,23 @@ public final class EmulationActivity extends AppCompatActivity
}
});
- int irWidth = Integer.valueOf(
- mPreferences.getString(SettingsFile.KEY_WIIBIND_IR_WIDTH + mSelectedGameId, "50"));
+ int ir_yaw = Integer.valueOf(
+ mPreferences.getString(SettingsFile.KEY_WIIBIND_IR_YAW + mSelectedGameId, "15"));
- TextView mTextSliderValueWidth = (TextView) view.findViewById(R.id.text_ir_width);
- TextView unitsWidth = (TextView) view.findViewById(R.id.text_ir_width_units);
- SeekBar seekbarWidth = view.findViewById(R.id.seekbar_width);
+ TextView text_slider_value_yaw = (TextView) view.findViewById(R.id.text_ir_yaw);
+ TextView units_yaw = (TextView) view.findViewById(R.id.text_ir_yaw_units);
+ SeekBar seekbar_yaw = view.findViewById(R.id.seekbar_width);
- mTextSliderValueWidth.setText(String.valueOf(irWidth));
- unitsWidth.setText(getString(R.string.width));
- seekbarWidth.setMax(100);
- seekbarWidth.setProgress(irWidth);
- seekbarWidth.setKeyProgressIncrement(5);
- seekbarWidth.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()
+ text_slider_value_yaw.setText(String.valueOf(ir_yaw));
+ units_yaw.setText(getString(R.string.yaw));
+ seekbar_yaw.setMax(100);
+ seekbar_yaw.setProgress(ir_yaw);
+ seekbar_yaw.setKeyProgressIncrement(5);
+ seekbar_yaw.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()
{
@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
{
- mTextSliderValueWidth.setText(String.valueOf(progress));
+ text_slider_value_yaw.setText(String.valueOf(progress));
}
@Override public void onStartTrackingTouch(SeekBar seekBar)
@@ -906,23 +906,26 @@ public final class EmulationActivity extends AppCompatActivity
});
- int irCenter = Integer.valueOf(
- mPreferences.getString(SettingsFile.KEY_WIIBIND_IR_CENTER + mSelectedGameId, "50"));
+ int ir_vertical_offset = Integer.valueOf(
+ mPreferences.getString(SettingsFile.KEY_WIIBIND_IR_VERTICAL_OFFSET + mSelectedGameId,
+ "10"));
- TextView mTextSliderValueCenter = (TextView) view.findViewById(R.id.text_ir_center);
- TextView unitsCenter = (TextView) view.findViewById(R.id.text_ir_center_units);
- SeekBar seekbarCenter = view.findViewById(R.id.seekbar_center);
+ TextView text_slider_value_vertical_offset =
+ (TextView) view.findViewById(R.id.text_ir_vertical_offset);
+ TextView units_vertical_offset =
+ (TextView) view.findViewById(R.id.text_ir_vertical_offset_units);
+ SeekBar seekbar_vertical_offset = view.findViewById(R.id.seekbar_vertical_offset);
- mTextSliderValueCenter.setText(String.valueOf(irCenter));
- unitsCenter.setText(getString(R.string.center));
- seekbarCenter.setMax(100);
- seekbarCenter.setProgress(irCenter);
- seekbarCenter.setKeyProgressIncrement(5);
- seekbarCenter.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()
+ text_slider_value_vertical_offset.setText(String.valueOf(ir_vertical_offset));
+ units_vertical_offset.setText(getString(R.string.vertical_offset));
+ seekbar_vertical_offset.setMax(100);
+ seekbar_vertical_offset.setProgress(ir_vertical_offset);
+ seekbar_vertical_offset.setKeyProgressIncrement(5);
+ seekbar_vertical_offset.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()
{
@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
{
- mTextSliderValueCenter.setText(String.valueOf(progress));
+ text_slider_value_vertical_offset.setText(String.valueOf(progress));
}
@Override public void onStartTrackingTouch(SeekBar seekBar)
@@ -942,21 +945,22 @@ public final class EmulationActivity extends AppCompatActivity
builder.setPositiveButton(R.string.ok, (dialogInterface, i) ->
{
SettingsFile.saveSingleCustomSetting(mSelectedGameId, Settings.SECTION_CONTROLS,
- SettingsFile.KEY_WIIBIND_IR_HEIGHT, mTextSliderValueHeight.getText().toString());
+ SettingsFile.KEY_WIIBIND_IR_PITCH, text_slider_value_pitch.getText().toString());
SettingsFile.saveSingleCustomSetting(mSelectedGameId, Settings.SECTION_CONTROLS,
- SettingsFile.KEY_WIIBIND_IR_WIDTH, mTextSliderValueWidth.getText().toString());
+ SettingsFile.KEY_WIIBIND_IR_YAW, text_slider_value_yaw.getText().toString());
SettingsFile.saveSingleCustomSetting(mSelectedGameId, Settings.SECTION_CONTROLS,
- SettingsFile.KEY_WIIBIND_IR_CENTER, mTextSliderValueCenter.getText().toString());
+ SettingsFile.KEY_WIIBIND_IR_VERTICAL_OFFSET,
+ text_slider_value_vertical_offset.getText().toString());
NativeLibrary.ReloadWiimoteConfig();
SharedPreferences.Editor editor = mPreferences.edit();
- editor.putString(SettingsFile.KEY_WIIBIND_IR_HEIGHT + mSelectedGameId,
- mTextSliderValueHeight.getText().toString());
- editor.putString(SettingsFile.KEY_WIIBIND_IR_WIDTH + mSelectedGameId,
- mTextSliderValueWidth.getText().toString());
- editor.putString(SettingsFile.KEY_WIIBIND_IR_CENTER + mSelectedGameId,
- mTextSliderValueCenter.getText().toString());
+ editor.putString(SettingsFile.KEY_WIIBIND_IR_PITCH + mSelectedGameId,
+ text_slider_value_pitch.getText().toString());
+ editor.putString(SettingsFile.KEY_WIIBIND_IR_YAW + mSelectedGameId,
+ text_slider_value_yaw.getText().toString());
+ editor.putString(SettingsFile.KEY_WIIBIND_IR_VERTICAL_OFFSET + mSelectedGameId,
+ text_slider_value_vertical_offset.getText().toString());
editor.apply();
});
builder.setNegativeButton(R.string.cancel, (dialogInterface, i) ->
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/utils/SettingsFile.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/utils/SettingsFile.java
index 5ac2a2193a..ff24a7a6d3 100644
--- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/utils/SettingsFile.java
+++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/utils/SettingsFile.java
@@ -153,9 +153,9 @@ public final class SettingsFile
public static final String KEY_WIIBIND_IR_FORWARD = "IRForward_";
public static final String KEY_WIIBIND_IR_BACKWARD = "IRBackward_";
public static final String KEY_WIIBIND_IR_HIDE = "IRHide_";
- public static final String KEY_WIIBIND_IR_HEIGHT = "IRHeight";
- public static final String KEY_WIIBIND_IR_WIDTH = "IRWidth";
- public static final String KEY_WIIBIND_IR_CENTER = "IRCenter";
+ public static final String KEY_WIIBIND_IR_PITCH = "IRTotalPitch";
+ public static final String KEY_WIIBIND_IR_YAW = "IRTotalYaw";
+ public static final String KEY_WIIBIND_IR_VERTICAL_OFFSET = "IRVerticalOffset";
public static final String KEY_WIIBIND_SWING_UP = "SwingUp_";
public static final String KEY_WIIBIND_SWING_DOWN = "SwingDown_";
public static final String KEY_WIIBIND_SWING_LEFT = "SwingLeft_";
diff --git a/Source/Android/app/src/main/res/layout/dialog_ir_sensitivity.xml b/Source/Android/app/src/main/res/layout/dialog_ir_sensitivity.xml
index 8f60d318e2..49f3434a38 100644
--- a/Source/Android/app/src/main/res/layout/dialog_ir_sensitivity.xml
+++ b/Source/Android/app/src/main/res/layout/dialog_ir_sensitivity.xml
@@ -16,13 +16,13 @@
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentStart="true"
- android:layout_below="@+id/text_ir_width"
+ android:layout_below="@+id/text_ir_yaw"
android:layout_marginBottom="@dimen/spacing_medlarge"
android:layout_marginLeft="@dimen/spacing_large"
android:layout_marginRight="@dimen/spacing_large"/>
<TextView
- android:id="@+id/text_ir_width"
+ android:id="@+id/text_ir_yaw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
@@ -32,11 +32,11 @@
tools:text="75"/>
<TextView
- android:id="@+id/text_ir_width_units"
+ android:id="@+id/text_ir_yaw_units"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignTop="@+id/text_ir_width"
- android:layout_toEndOf="@+id/text_ir_width"
+ android:layout_alignTop="@+id/text_ir_yaw"
+ android:layout_toEndOf="@+id/text_ir_yaw"
tools:text="%"/>
</RelativeLayout>
@@ -46,18 +46,18 @@
android:layout_weight="1">
<SeekBar
- android:id="@+id/seekbar_height"
+ android:id="@+id/seekbar_pitch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentStart="true"
- android:layout_below="@+id/text_ir_height"
+ android:layout_below="@+id/text_ir_pitch"
android:layout_marginBottom="@dimen/spacing_medlarge"
android:layout_marginLeft="@dimen/spacing_large"
android:layout_marginRight="@dimen/spacing_large"/>
<TextView
- android:id="@+id/text_ir_height"
+ android:id="@+id/text_ir_pitch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
@@ -67,11 +67,11 @@
tools:text="75"/>
<TextView
- android:id="@+id/text_ir_height_units"
+ android:id="@+id/text_ir_pitch_units"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignTop="@+id/text_ir_height"
- android:layout_toEndOf="@+id/text_ir_height"
+ android:layout_alignTop="@+id/text_ir_pitch"
+ android:layout_toEndOf="@+id/text_ir_pitch"
tools:text="%"/>
</RelativeLayout>
@@ -82,18 +82,18 @@
android:layout_weight="1">
<SeekBar
- android:id="@+id/seekbar_center"
+ android:id="@+id/seekbar_vertical_offset"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentStart="true"
- android:layout_below="@+id/text_ir_center"
+ android:layout_below="@+id/text_ir_vertical_offset"
android:layout_marginBottom="@dimen/spacing_medlarge"
android:layout_marginLeft="@dimen/spacing_large"
android:layout_marginRight="@dimen/spacing_large"/>
<TextView
- android:id="@+id/text_ir_center"
+ android:id="@+id/text_ir_vertical_offset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
@@ -103,11 +103,11 @@
tools:text="75"/>
<TextView
- android:id="@+id/text_ir_center_units"
+ android:id="@+id/text_ir_vertical_offset_units"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignTop="@+id/text_ir_center"
- android:layout_toEndOf="@+id/text_ir_center"
+ android:layout_alignTop="@+id/text_ir_vertical_offset"
+ android:layout_toEndOf="@+id/text_ir_vertical_offset"
tools:text="%"/>
</RelativeLayout>
diff --git a/Source/Android/app/src/main/res/values/strings.xml b/Source/Android/app/src/main/res/values/strings.xml
index 9cf0ac1d45..cc54d46d98 100644
--- a/Source/Android/app/src/main/res/values/strings.xml
+++ b/Source/Android/app/src/main/res/values/strings.xml
@@ -330,8 +330,8 @@
<string name="select_dir">Select This Directory</string>
<!-- Misc -->
- <string name="height">Height</string>
- <string name="width">Width</string>
- <string name="center">Center</string>
+ <string name="pitch">Total Pitch</string>
+ <string name="yaw">Total Yaw</string>
+ <string name="vertical_offset">Vertical Offset</string>
</resources>