Commit Graph
195 Commits
Author SHA1 Message Date
Duy Tran Khanh bcfc13a4f1 Major cleanup for the controller config vc
- Cleanup unused parts
- Cleanup complicated dictionary constructions
- Fix lag spikes during scrolling in this screen

Allow audio settings to be changed ingame
2023-04-19 19:12:32 +07:00
Eilionoir TunnicliffandDuy Tran Khanh 57ecfbf096 Use native input for controls (#524)
* WIP feature: native input

* Fixes: 1.13+, jar installer input
What's left: fix hotbar position

* Fix broken hotbar

---------

Co-authored-by: Duy Tran Khanh <[email protected]>
2023-04-09 13:33:30 +07:00
Duy Tran Khanh 31906e33b7 Fix: control safe area breaks in portrait mode
Rewrite the control safe area system:
- Use UIEdgeInsets instead of CGRect (breaking change!)
- Auto change depending on orientation (not really consistent yet)
The safe area is reset to reflect this breaking change.
2023-04-08 22:11:53 +07:00
Duy Tran Khanh 5c40cf8aa3 Apply the scroll workaround for both axes 2023-04-06 11:15:34 +07:00
Duy Tran Khanh b808f03b80 Workaround(scroll input) send both x and y as y
More proper workaround for https://bugs.mojang.com/browse/MC-121772
2023-04-04 18:18:52 +07:00
Eilionoir Tunnicliff 7611c71bfe Forgot the haptics in that commit 2023-03-16 20:26:40 -04:00
Eilionoir Tunnicliff eef107e5fd Huh, I apparently never commit this 2023-03-16 18:23:35 -04:00
Eilionoir Tunnicliff e96111c572 Feature: option to disable control overlay when a mouse or game controller is connected
To be paired with incoming game controller configuration, as right now the keyboard cannot be opened with this enabled and a controller connected.
2023-03-13 10:07:34 -04:00
Duy Tran Khanh e83b3a3bb3 Feature: mouse/hotbar gesture switches
Closes #519
2023-03-05 22:13:23 +07:00
Duy Tran Khanh d2986295ba Feature(custom controls): menu button
When added to custom control, it will replace the traditional swipe
gesture, while also show the menu in place (aka context menu)
2023-02-23 18:13:14 +07:00
Duy Tran Khanh 78e84807e6 Fix #507: multipleTouchEnabled is not set 2023-02-17 06:20:49 +07:00
Duy Tran Khanh ac0687ca8f Workaround(Input): treat horizontal scroll as vertical
The direction is unchecked: it may need to be inverted
2023-02-10 17:45:39 +07:00
Duy Tran Khanh 35802571f4 FIx(GyroInput): camera jumps + (WIP)orientation
Use DeviceMotion (gyroscope + accelerometer) instead of Gyro for less
jittering
FIXME: camera jumps upon rotating screen while gyro is active
2023-02-05 17:47:06 +07:00
Duy Tran Khanh 54c2564c2f Feature: gyroscope controls 2023-02-05 12:16:46 +07:00
khanhduytran0 b0203d6fc7 Text input for jar launcher, update lib, fixes
News
- Added text input support for jar launcher.
- Updated MoltenVK to https://github.com/KhronosGroup/MoltenVK/commit/d880f4c

Internal changes
- Added more handling cases to avoid missing call to pojav_initOpenGL()
- Moved custom control’s global functions and properties to ControlLayout.
- Moved dylib framework outside its folder, as it’s not necessary to be bundled in framework.
- Reusing custom controls to produce flexible buttons in jar launcher, which might be extended in the future.

Fixes
- Multistage text input (Japanese, Chinese, etc) should now work again.
- Pointer lock should now function properly again.

- Updated README.md to reflect current stuff
2023-01-19 09:54:55 +07:00
Duy Tran Khanh 652316e8f6 Various fixes and enhancements
- Change setNeedsUpdateOfPrefersPointerLocked logic to hopefully fix
issues with mouse not recognizing on iPhones
- Change reloadVersionList logic to load Installed version list
instantly at startup
- Enable game's CALayer opaque and drawsAsynchronously to improve
rendering performance
- Handle natives_directory variable for legacy modded versions
- Set LD_LIBRARY_PATH to silent Caciocavallo NPE error in locating
Android-only code
- Tapping Play when no version selected will now bring up the version
picker instead of doing nothing
2023-01-13 20:11:50 +07:00
Duy Tran Khanh 63c2fe0f30 Added option to control AirPlay mode
Closes #450

Internal change to debug: cache to debugBoundsEnabled instead of
getting preference every time
2022-12-17 21:25:23 +07:00
Duy Tran Khanh d0279af8aa Internal changes
- First changes for tvOS (very WIP) this will be a challenge to use
remote storage as ATV doesn't allow persistent storage (at least
without jailbreak). Low priority for now.
- Change regLog, debugLog to NSLog, NSDebugLog
- Rewrite most of JavaLauncher.m to ObjC
- Update README.md
2022-12-17 21:25:23 +07:00
Duy Tran Khanh 27924ca870 Changes to custom controls
Allow saving to default.json
Put custom controls editor to in-game menu
Localization
2022-12-06 18:27:11 +07:00
Duy Tran Khanh b46cfcfc82 New debug option: auto correction
Sometimes autocorrection can be annoying, so there's now a toggle,
enabled by default to preserve behavior.
2022-12-06 18:21:31 +07:00
Duy Tran Khanh f1da61ef26 New debug option: hide home indicator
This allows home indicator to be hidden again, usually useful for users
who play with external controlling device without having to use Guided
Access.

Changed icon of some settings.
Home indicator, status bar and screen edge lock is now based on side
menu visibility.
2022-11-29 19:17:10 +07:00
Duy Tran Khanh 83a5994881 Fix: duplicate init line in d01d616
Duplicated init caused views to be messed up when safe area is set. This commit removes the duplicated line as a part of the undo commit d01d616.

Also fix some spacing issues
2022-11-26 06:24:13 +07:00
Eilionoir Tunnicliff c5d5ed0bfa Swap LNC + SVC home bar hiding 2022-11-25 11:14:57 -05:00
Eilionoir Tunnicliff d01d616c06 Undo WIP SVC code + fix text in LPVC 2022-11-25 10:31:52 -05:00
Eilionoir Tunnicliff 8fe44a1aea Add alternate Dark icon
Feature request from a whiiiiiiiiiile ago
2022-11-25 10:22:27 -05:00
Duy Tran Khanh 54fd01a7f2 Fix: lost updateSavedResolution in viewWillTransitionToSize
This caused game not to update resolution on window resize.
2022-11-19 11:15:23 +07:00
Duy Tran Khanh 1af09ca02d Tweak NSLocalizedString; Keep split display mode
Tweak NSLocalizedString to return English if not yet localized.
Keep Split display mode between rotations.
New debug option: skip JIT wait, for #423
2022-11-17 21:46:38 +07:00
Duy Tran Khanh 80132a5964 Fix: did not prefer ext pointer lock on hotplug 2022-11-15 21:37:41 +07:00
Duy Tran Khanh 973568eaea Tweak pointer lock, fix inverted scrolling
Fixed these following issues: #420, #421
Replaced commit 3e2d3c9 because it was not complete.
2022-11-14 20:24:46 +07:00
Duy Tran Khanh 838f99af1b Support external display resolution
TODO: add checks to not confuse with Stage Manager + external display

README.md: Added missing credits
2022-11-13 22:01:57 +07:00
Eilionoir Tunnicliff ab5bd8469e Changes
- Removed FAQ, About Launcher, and Update History buttons
- Moved *.png to Assets.xcassets
- Moved LPVC2 to LPVC
2022-11-10 00:03:37 -05:00
Duy Tran Khanh b5af92d0f5 JVM crash dump: now shown, disable some Cr4shed handler
When Cr4shed crash handler is on, chaining to it will eventually crash
instead of returning so that JVM can continue perform dump. For now,
signal handlers are reset to default.

abort() is now caught and shown in the launcher.

Temporarily disabled safe area when windowed, until I can properly set
it up, in order to workaround buttons going out of bounds.
2022-11-03 21:12:55 +07:00
Duy Tran Khanh 8ca77a1b73 Support resizable for iPadOS Stage Manager
On iPadOS, PojavLauncher can be launched in portrait mode
Declare controller support in Info.plist
Sync LWJGL changes from Android repo
2022-10-31 11:13:03 +07:00
Duy Tran Khanh 8218a28e4d For 503aa82: it turns out iOS has stolen inputView
This commit should fix its core issue, so the workaround is removed.
For a while, UITextField variable was named `inputView`, which is same
as the name UIKit used to query custom input view. It was not until
recently that the crash started occurring on my device.
Other fixes (for LogView):
- Line indentation in SurfaceViewController+LogView.m:214
- Navigation bar size: now call sizeToFit
2022-10-19 17:59:18 +07:00
Duy Tran Khanh 8c0b8da9c3 Add menu icons; Error is now shown in fullscreen
JIT check: increase check timeout
2022-10-18 18:27:50 +07:00
Duy Tran Khanh 76ae494557 Split SurfaceViewController.m to separate files
It's slowly getting too big, so I have to split, module-like organized.
- Category LogView (Log output, just added)
- Category Navigation (drawer menu)
- TrackedTextField
2022-10-11 19:54:58 +07:00
Duy Tran Khanh 31fee44bf7 Fixes (mostly for #385) 2022-10-06 20:43:03 +07:00
Duy Tran Khanh b46c64cc59 Changes and fixes to input, mark nonatomic to others
- Controller: implement ticking, swapped thumbstick mapping to match
common usage
- External mouse should continue sending move while mouse button is
being held
- Tweak touch scroll velocity division to 100
2022-10-02 10:54:04 +07:00
Duy Tran Khanh 6c256aa362 Correct swipeable button offset 2022-09-26 05:41:04 +07:00
Duy Tran Khanh f404ddd2cb Add a delay between held state on click 2022-09-17 21:46:26 +07:00
Duy Tran Khanh 77370a01ea Self-controlled Jetsam limit for unsandboxed env 2022-09-16 17:43:53 +07:00
khanhduytran0 d949a3d661 Correct hotbar slot scaling 2022-09-15 21:55:23 +07:00
Duy Tran Khanh 8d26ed38d7 Custom controls: make toggleable functional
Fixes #378
2022-09-10 18:28:09 +07:00
Duy Tran Khanh d42d4e963e Allow changing resolution while in game (1.13+)
For now, this only works properly on Minecraft 1.13+. Older version
doesn't seem to get the new resolution (will be fixed later)

Additional changes:
- Make ingame settings background transparent
- Set prefersHomeIndicatorAutoHidden to YES
2022-09-05 19:38:39 +07:00
khanhduytran0 f27808464b Allow control settings to be changed ingame 2022-09-04 09:47:46 +07:00
Duy Tran Khanh 97c2f4b473 Added controller input (not tested)
This works by mapping gamepad keys to keyboard keys, just like
PojavLauncher Android.
2022-08-28 21:47:25 +07:00
Duy Tran Khanh 10aa3d07e8 Simplify scrollPanGesture handling 2022-08-14 09:12:19 +07:00
Duy Tran Khanh d17728a093 Virtual keyboard: fix Return key not working 2022-08-03 12:33:31 +07:00
Duy Tran Khanh 292fb8166f Custom controls: safe area is now customizable
Other changes:
- Cleanup unused functions
- Internal changes to access ViewController globally
- Moved ControlLayout to a separate file
2022-08-03 12:23:27 +07:00
khanhduytran0 ce292d518a Tweaks
Added UIRequiresFullScreen for iPad
Only force full navigation bar height on iPhone
The Virtual mouse preference can now be set by the toggle button
Use UIColor.whiteColor instead of RGB 255/255
Use arm64e-supported fishhook fork
2022-07-29 13:27:18 +07:00