mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-20 21:40:15 -07:00
[Feature request] Customizable mouse size
This commit is contained in:
parent
6a4eccb07b
commit
3fba4ab3a0
5 changed files with 36 additions and 6 deletions
|
|
@ -171,6 +171,15 @@ public class BaseMainActivity extends LoggableActivity {
|
|||
//this.mouseToggleButton = findButton(R.id.control_togglemouse);
|
||||
this.touchPad = (LinearLayout) findViewById(R.id.main_touchpad);
|
||||
this.mousePointer = (ImageView) findViewById(R.id.main_mouse_pointer);
|
||||
this.mousePointer.post(new Runnable(){
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
ViewGroup.LayoutParams params = mousePointer.getLayoutParams();
|
||||
params.width = (int) (mousePointer.getWidth() / 100f * LauncherPreferences.PREF_MOUSESCALE);
|
||||
params.height = (int) (mousePointer.getHeight() / 100f * LauncherPreferences.PREF_MOUSESCALE);
|
||||
}
|
||||
});
|
||||
|
||||
this.contentLog = (LinearLayout) findViewById(R.id.content_log_layout);
|
||||
this.contentScroll = (ScrollView) findViewById(R.id.content_log_scroll);
|
||||
|
|
|
|||
|
|
@ -25,6 +25,12 @@ public class LauncherPreferenceFragment extends PreferenceFragmentCompat
|
|||
seek3.setMin(20);
|
||||
seek3.setMax(500);
|
||||
seek3.setValue((int) LauncherPreferences.PREF_BUTTONSIZE);
|
||||
|
||||
SeekBarPreference seek4 = (SeekBarPreference) findPreference("mousescale");
|
||||
seek4.setMin(20);
|
||||
seek4.setMax(500);
|
||||
seek4.setValue((int) LauncherPreferences.PREF_MOUSESCALE);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@ public class LauncherPreferences
|
|||
public static boolean PREF_VERTYPE_OLDALPHA = false;
|
||||
public static boolean PREF_VERTYPE_OLDBETA = false;
|
||||
public static boolean PREF_FREEFORM = false;
|
||||
public static float PREF_BUTTONSIZE = 1.0f;
|
||||
public static float PREF_BUTTONSIZE = 100f;
|
||||
public static float PREF_MOUSESCALE = 100f;
|
||||
public static int PREF_LONGPRESS_TRIGGER = 500;
|
||||
public static String PREF_DEFAULTCTRL_PATH = Tools.CTRLDEF_FILE;
|
||||
public static String PREF_CUSTOM_JAVA_ARGS;
|
||||
|
|
@ -21,6 +22,7 @@ public class LauncherPreferences
|
|||
|
||||
public static void loadPreferences() {
|
||||
PREF_BUTTONSIZE = DEFAULT_PREF.getInt("buttonscale", 100);
|
||||
PREF_MOUSESCALE = DEFAULT_PREF.getInt("mousescale", 100);
|
||||
PREF_FREEFORM = DEFAULT_PREF.getBoolean("freeform", false);
|
||||
PREF_VERTYPE_RELEASE = DEFAULT_PREF.getBoolean("vertype_release", true);
|
||||
PREF_VERTYPE_SNAPSHOT = DEFAULT_PREF.getBoolean("vertype_snapshot", false);
|
||||
|
|
|
|||
|
|
@ -99,10 +99,13 @@
|
|||
<string name="mcl_setting_subtitle_longpresstrigger">Change trigger time for long press in destroy block and drop item.</string>
|
||||
<string name="mcl_setting_title_buttonscale">Control buttons scaling</string>
|
||||
<string name="mcl_setting_subtitle_buttonscale">Upscale them if buttons are too small.</string>
|
||||
<string name="mcl_setting_title_mousescale">Mouse scaling</string>
|
||||
<string name="mcl_setting_subtitle_mousescale">Change size of virtual mouse.</string>
|
||||
<string name="mcl_setting_title_controlsize">Set control buttons size</string>
|
||||
<string name="mcl_setting_title_javaargs">JVM Launch arguments</string>
|
||||
<string name="mcl_setting_subtitle_javaargs">Be careful, this may make game crash if modified without knowledge.</string>
|
||||
<string name="mcl_setting_category_general">General settings</string>
|
||||
<string name="mcl_setting_category_scaling">Scaling settings</string>
|
||||
<string name="mcl_setting_category_veroption">Version type will be in version list</string>
|
||||
<string name="mcl_setting_veroption_release">Release</string>
|
||||
<string name="mcl_setting_veroption_snapshot">Snapshot</string>
|
||||
|
|
|
|||
|
|
@ -15,11 +15,6 @@
|
|||
android:title="@string/mcl_setting_title_longpresstrigger"
|
||||
android:summary="@string/mcl_setting_subtitle_longpresstrigger" />
|
||||
|
||||
<android.support.v7.preference.SeekBarPreference
|
||||
android:key="buttonscale"
|
||||
android:title="@string/mcl_setting_title_buttonscale"
|
||||
android:summary="@string/mcl_setting_subtitle_buttonscale" />
|
||||
|
||||
<android.support.v7.preference.SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="freeform"
|
||||
|
|
@ -35,6 +30,21 @@
|
|||
|
||||
</android.support.v7.preference.PreferenceCategory>
|
||||
|
||||
<android.support.v7.preference.PreferenceCategory
|
||||
android:title="@string/mcl_setting_category_scaling">
|
||||
|
||||
<android.support.v7.preference.SeekBarPreference
|
||||
android:key="buttonscale"
|
||||
android:title="@string/mcl_setting_title_buttonscale"
|
||||
android:summary="@string/mcl_setting_subtitle_buttonscale" />
|
||||
|
||||
<android.support.v7.preference.SeekBarPreference
|
||||
android:key="mousescale"
|
||||
android:title="@string/mcl_setting_title_mousescale"
|
||||
android:summary="@string/mcl_setting_subtitle_mousescale" />
|
||||
|
||||
</android.support.v7.preference.PreferenceCategory>
|
||||
|
||||
<android.support.v7.preference.PreferenceCategory
|
||||
android:title="@string/mcl_setting_category_veroption">
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue