Gamepad pointer size is now dynamic !

This commit is contained in:
SerpentSpirale 2021-07-20 14:53:26 +02:00
parent 97a8a11f80
commit ee0b715061
4 changed files with 6 additions and 2 deletions

View file

@ -922,7 +922,7 @@ public class BaseMainActivity extends LoggableActivity {
return true; return true;
} }
public void getMcScale() { public int getMcScale() {
//Get the scale stored in game files, used auto scale if found or if the stored scaled is bigger than the authorized size. //Get the scale stored in game files, used auto scale if found or if the stored scaled is bigger than the authorized size.
MCOptionUtils.load(); MCOptionUtils.load();
String str = MCOptionUtils.get("guiScale"); String str = MCOptionUtils.get("guiScale");
@ -935,6 +935,7 @@ public class BaseMainActivity extends LoggableActivity {
} }
if(gamepad != null) gamepad.notifyGUISizeChange(this.guiScale); if(gamepad != null) gamepad.notifyGUISizeChange(this.guiScale);
return this.guiScale;
} }
public int handleGuiBar(int x, int y) { public int handleGuiBar(int x, int y) {

View file

@ -70,6 +70,9 @@ public class Gamepad {
this.gameActivity = gameActivity; this.gameActivity = gameActivity;
pointerView = this.gameActivity.findViewById(R.id.console_pointer); pointerView = this.gameActivity.findViewById(R.id.console_pointer);
pointerView.getDrawable().setFilterBitmap(false);
notifyGUISizeChange(gameActivity.getMcScale());
mouseThread = new Thread("Gamepad Thread"){ mouseThread = new Thread("Gamepad Thread"){
long lastTime = System.nanoTime(); long lastTime = System.nanoTime();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 695 B

Before After
Before After

View file

@ -41,7 +41,7 @@
<ImageView <ImageView
android:id="@+id/console_pointer" android:id="@+id/console_pointer"
android:visibility="visible" android:visibility="invisible"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:srcCompat="@drawable/pointer" /> app:srcCompat="@drawable/pointer" />