From d488be105da52492d652ac82fcdbf5149ae605a7 Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Sun, 26 Nov 2023 08:44:04 -0800 Subject: [PATCH] Rename joystick resources --- .../stendhal/client/input/DPadArrows.java | 16 ++++++++-------- .../arianne/stendhal/client/input/DPadJoy.java | 8 ++++---- .../{dpad_arrow_down.png => dpad_down.png} | Bin ...row_down_active.png => dpad_down_active.png} | Bin .../{dpad_arrow_left.png => dpad_left.png} | Bin ...row_left_active.png => dpad_left_active.png} | Bin .../{dpad_arrow_right.png => dpad_right.png} | Bin ...w_right_active.png => dpad_right_active.png} | Bin .../drawable/{dpad_arrow_up.png => dpad_up.png} | Bin ...d_arrow_up_active.png => dpad_up_active.png} | Bin ...dpad_circle_inner.png => joystick_inner.png} | Bin ...ner_active.png => joystick_inner_active.png} | Bin ...dpad_circle_outer.png => joystick_outer.png} | Bin .../{dpad_arrow_down.png => dpad_down.png} | Bin ...row_down_active.png => dpad_down_active.png} | Bin .../{dpad_arrow_left.png => dpad_left.png} | Bin ...row_left_active.png => dpad_left_active.png} | Bin .../{dpad_arrow_right.png => dpad_right.png} | Bin ...w_right_active.png => dpad_right_active.png} | Bin .../joystick/{dpad_arrow_up.png => dpad_up.png} | Bin ...d_arrow_up_active.png => dpad_up_active.png} | Bin srcjs/stendhal/ui/joystick/DirectionPad.ts | 16 ++++++++-------- 22 files changed, 20 insertions(+), 20 deletions(-) rename android/app/src/main/res/drawable/{dpad_arrow_down.png => dpad_down.png} (100%) rename android/app/src/main/res/drawable/{dpad_arrow_down_active.png => dpad_down_active.png} (100%) rename android/app/src/main/res/drawable/{dpad_arrow_left.png => dpad_left.png} (100%) rename android/app/src/main/res/drawable/{dpad_arrow_left_active.png => dpad_left_active.png} (100%) rename android/app/src/main/res/drawable/{dpad_arrow_right.png => dpad_right.png} (100%) rename android/app/src/main/res/drawable/{dpad_arrow_right_active.png => dpad_right_active.png} (100%) rename android/app/src/main/res/drawable/{dpad_arrow_up.png => dpad_up.png} (100%) rename android/app/src/main/res/drawable/{dpad_arrow_up_active.png => dpad_up_active.png} (100%) rename android/app/src/main/res/drawable/{dpad_circle_inner.png => joystick_inner.png} (100%) rename android/app/src/main/res/drawable/{dpad_circle_inner_active.png => joystick_inner_active.png} (100%) rename android/app/src/main/res/drawable/{dpad_circle_outer.png => joystick_outer.png} (100%) rename data/gui/joystick/{dpad_arrow_down.png => dpad_down.png} (100%) rename data/gui/joystick/{dpad_arrow_down_active.png => dpad_down_active.png} (100%) rename data/gui/joystick/{dpad_arrow_left.png => dpad_left.png} (100%) rename data/gui/joystick/{dpad_arrow_left_active.png => dpad_left_active.png} (100%) rename data/gui/joystick/{dpad_arrow_right.png => dpad_right.png} (100%) rename data/gui/joystick/{dpad_arrow_right_active.png => dpad_right_active.png} (100%) rename data/gui/joystick/{dpad_arrow_up.png => dpad_up.png} (100%) rename data/gui/joystick/{dpad_arrow_up_active.png => dpad_up_active.png} (100%) diff --git a/android/app/src/main/java/org/arianne/stendhal/client/input/DPadArrows.java b/android/app/src/main/java/org/arianne/stendhal/client/input/DPadArrows.java index c64b9b57a50..1237579d3cf 100644 --- a/android/app/src/main/java/org/arianne/stendhal/client/input/DPadArrows.java +++ b/android/app/src/main/java/org/arianne/stendhal/client/input/DPadArrows.java @@ -186,20 +186,20 @@ public ArrowView(final Context ctx, final Dir dir) { switch (dir) { case LEFT: - id = R.drawable.dpad_arrow_left; - id_active = R.drawable.dpad_arrow_left_active; + id = R.drawable.dpad_left; + id_active = R.drawable.dpad_left_active; break; case RIGHT: - id = R.drawable.dpad_arrow_right; - id_active = R.drawable.dpad_arrow_right_active; + id = R.drawable.dpad_right; + id_active = R.drawable.dpad_right_active; break; case UP: - id = R.drawable.dpad_arrow_up; - id_active = R.drawable.dpad_arrow_up_active; + id = R.drawable.dpad_up; + id_active = R.drawable.dpad_up_active; break; default: - id = R.drawable.dpad_arrow_down; - id_active = R.drawable.dpad_arrow_down_active; + id = R.drawable.dpad_down; + id_active = R.drawable.dpad_down_active; break; } diff --git a/android/app/src/main/java/org/arianne/stendhal/client/input/DPadJoy.java b/android/app/src/main/java/org/arianne/stendhal/client/input/DPadJoy.java index 08445530a31..e38e0485255 100644 --- a/android/app/src/main/java/org/arianne/stendhal/client/input/DPadJoy.java +++ b/android/app/src/main/java/org/arianne/stendhal/client/input/DPadJoy.java @@ -141,11 +141,11 @@ public OuterButton(final Context ctx) { pressedKeys = new ArrayList<>(); setBackgroundColor(android.graphics.Color.TRANSPARENT); - setImageResource(R.drawable.dpad_circle_outer); + setImageResource(R.drawable.joystick_outer); innerButton = new InnerButton(ctx); innerButton.setBackgroundColor(android.graphics.Color.TRANSPARENT); - innerButton.setImageResource(R.drawable.dpad_circle_inner); + innerButton.setImageResource(R.drawable.joystick_inner); setOnTouchListener(new View.OnTouchListener() { @Override @@ -156,7 +156,7 @@ public boolean onTouch(final View view, final MotionEvent event) { if (action == MotionEvent.ACTION_DOWN && !keyDown) { keyDown = true; - innerButton.setImageResource(R.drawable.dpad_circle_inner_active); + innerButton.setImageResource(R.drawable.joystick_inner_active); innerButton.setRelativeX(event.getX()); innerButton.setRelativeY(event.getY()); @@ -167,7 +167,7 @@ public boolean onTouch(final View view, final MotionEvent event) { } } else if (action == MotionEvent.ACTION_UP && keyDown) { keyDown = false; - innerButton.setImageResource(R.drawable.dpad_circle_inner); + innerButton.setImageResource(R.drawable.joystick_inner); innerButton.centerOn((JoyPadButton) view); clearPresses(); diff --git a/android/app/src/main/res/drawable/dpad_arrow_down.png b/android/app/src/main/res/drawable/dpad_down.png similarity index 100% rename from android/app/src/main/res/drawable/dpad_arrow_down.png rename to android/app/src/main/res/drawable/dpad_down.png diff --git a/android/app/src/main/res/drawable/dpad_arrow_down_active.png b/android/app/src/main/res/drawable/dpad_down_active.png similarity index 100% rename from android/app/src/main/res/drawable/dpad_arrow_down_active.png rename to android/app/src/main/res/drawable/dpad_down_active.png diff --git a/android/app/src/main/res/drawable/dpad_arrow_left.png b/android/app/src/main/res/drawable/dpad_left.png similarity index 100% rename from android/app/src/main/res/drawable/dpad_arrow_left.png rename to android/app/src/main/res/drawable/dpad_left.png diff --git a/android/app/src/main/res/drawable/dpad_arrow_left_active.png b/android/app/src/main/res/drawable/dpad_left_active.png similarity index 100% rename from android/app/src/main/res/drawable/dpad_arrow_left_active.png rename to android/app/src/main/res/drawable/dpad_left_active.png diff --git a/android/app/src/main/res/drawable/dpad_arrow_right.png b/android/app/src/main/res/drawable/dpad_right.png similarity index 100% rename from android/app/src/main/res/drawable/dpad_arrow_right.png rename to android/app/src/main/res/drawable/dpad_right.png diff --git a/android/app/src/main/res/drawable/dpad_arrow_right_active.png b/android/app/src/main/res/drawable/dpad_right_active.png similarity index 100% rename from android/app/src/main/res/drawable/dpad_arrow_right_active.png rename to android/app/src/main/res/drawable/dpad_right_active.png diff --git a/android/app/src/main/res/drawable/dpad_arrow_up.png b/android/app/src/main/res/drawable/dpad_up.png similarity index 100% rename from android/app/src/main/res/drawable/dpad_arrow_up.png rename to android/app/src/main/res/drawable/dpad_up.png diff --git a/android/app/src/main/res/drawable/dpad_arrow_up_active.png b/android/app/src/main/res/drawable/dpad_up_active.png similarity index 100% rename from android/app/src/main/res/drawable/dpad_arrow_up_active.png rename to android/app/src/main/res/drawable/dpad_up_active.png diff --git a/android/app/src/main/res/drawable/dpad_circle_inner.png b/android/app/src/main/res/drawable/joystick_inner.png similarity index 100% rename from android/app/src/main/res/drawable/dpad_circle_inner.png rename to android/app/src/main/res/drawable/joystick_inner.png diff --git a/android/app/src/main/res/drawable/dpad_circle_inner_active.png b/android/app/src/main/res/drawable/joystick_inner_active.png similarity index 100% rename from android/app/src/main/res/drawable/dpad_circle_inner_active.png rename to android/app/src/main/res/drawable/joystick_inner_active.png diff --git a/android/app/src/main/res/drawable/dpad_circle_outer.png b/android/app/src/main/res/drawable/joystick_outer.png similarity index 100% rename from android/app/src/main/res/drawable/dpad_circle_outer.png rename to android/app/src/main/res/drawable/joystick_outer.png diff --git a/data/gui/joystick/dpad_arrow_down.png b/data/gui/joystick/dpad_down.png similarity index 100% rename from data/gui/joystick/dpad_arrow_down.png rename to data/gui/joystick/dpad_down.png diff --git a/data/gui/joystick/dpad_arrow_down_active.png b/data/gui/joystick/dpad_down_active.png similarity index 100% rename from data/gui/joystick/dpad_arrow_down_active.png rename to data/gui/joystick/dpad_down_active.png diff --git a/data/gui/joystick/dpad_arrow_left.png b/data/gui/joystick/dpad_left.png similarity index 100% rename from data/gui/joystick/dpad_arrow_left.png rename to data/gui/joystick/dpad_left.png diff --git a/data/gui/joystick/dpad_arrow_left_active.png b/data/gui/joystick/dpad_left_active.png similarity index 100% rename from data/gui/joystick/dpad_arrow_left_active.png rename to data/gui/joystick/dpad_left_active.png diff --git a/data/gui/joystick/dpad_arrow_right.png b/data/gui/joystick/dpad_right.png similarity index 100% rename from data/gui/joystick/dpad_arrow_right.png rename to data/gui/joystick/dpad_right.png diff --git a/data/gui/joystick/dpad_arrow_right_active.png b/data/gui/joystick/dpad_right_active.png similarity index 100% rename from data/gui/joystick/dpad_arrow_right_active.png rename to data/gui/joystick/dpad_right_active.png diff --git a/data/gui/joystick/dpad_arrow_up.png b/data/gui/joystick/dpad_up.png similarity index 100% rename from data/gui/joystick/dpad_arrow_up.png rename to data/gui/joystick/dpad_up.png diff --git a/data/gui/joystick/dpad_arrow_up_active.png b/data/gui/joystick/dpad_up_active.png similarity index 100% rename from data/gui/joystick/dpad_arrow_up_active.png rename to data/gui/joystick/dpad_up_active.png diff --git a/srcjs/stendhal/ui/joystick/DirectionPad.ts b/srcjs/stendhal/ui/joystick/DirectionPad.ts index 0410a6625b0..fb34ead584d 100644 --- a/srcjs/stendhal/ui/joystick/DirectionPad.ts +++ b/srcjs/stendhal/ui/joystick/DirectionPad.ts @@ -104,19 +104,19 @@ export class DirectionPad extends JoystickBase { let action: {[index: string]: string} = {type: "move"}; switch(e.target) { case this.up: - this.up.src = this.getResource("dpad_arrow_up_active"); + this.up.src = this.getResource("dpad_up_active"); action.dir = "1"; break; case this.right: - this.right.src = this.getResource("dpad_arrow_right_active"); + this.right.src = this.getResource("dpad_right_active"); action.dir = "2"; break; case this.down: - this.down.src = this.getResource("dpad_arrow_down_active"); + this.down.src = this.getResource("dpad_down_active"); action.dir = "3"; break; case this.left: - this.left.src = this.getResource("dpad_arrow_left_active"); + this.left.src = this.getResource("dpad_left_active"); action.dir = "4"; break; } @@ -135,10 +135,10 @@ export class DirectionPad extends JoystickBase { public override reset() { // reset images - this.up.src = this.getResource("dpad_arrow_up"); - this.down.src = this.getResource("dpad_arrow_down"); - this.left.src = this.getResource("dpad_arrow_left"); - this.right.src = this.getResource("dpad_arrow_right"); + this.up.src = this.getResource("dpad_up"); + this.down.src = this.getResource("dpad_down"); + this.left.src = this.getResource("dpad_left"); + this.right.src = this.getResource("dpad_right"); } public override onRemoved() {