Commit Graph
24 Commits
Author SHA1 Message Date
khanhduytran0 54fb8a346d Workaround[dynamic position]: replace dp: and px: calls with direct find-and-replace
Certain iOS versions don't like when expression tries to call either dp: or px:
2023-09-28 13:49:34 +07:00
Duy Tran Khanh 36c3e312f3 Feat[controls]: v3: joystick & conditonal visibility
- Finish joystick view
+ Finish forward lock
+ When in menu, oystick can be used to move the virtual mouse
- Finish conditonal visibility
- Replace Make Default with Load
2023-08-11 20:58:14 +07:00
khanhduytran0 6cf61e62c0 Feats: preference isolation & profile management
- Rewrote LauncherPreferences -> PLPreferences
 + Now the file layout is the same as UI layout
 + (get/set)Preference are replaced with corresponding get/set types + Getting/setting is now done through keyPath instead of manually iterating over subdictionaries.
 + Implemented an isolation layer, allowing an instance to have its own settings. This is off by default

- Implemented launcher_profiles
 + Added Profile manager that can be accessed from the sidebar
 + Moved "Game directory (instances)" to this screen
 + Replaced version selector with profile selector. Version selector is moved into profile editor.

- Other changes
 + Cleanup code by using NSPredicate instead of huge for loops
 + Titles in settings are made multilined
 + Controller config: replaced bar button items with localized ones

Due to how large the changes are, this is committed directly to the mainline branch. Bugs are expected to be found (although I did enough tests for this locally)
2023-07-06 13:59:07 +07:00
Duy Tran Khanh dc6dd283ab Fix(controls->dynamic_pos): add missing functions
Apple's NSExpression doesn't come with those functions by default,
while exp4j's ExpressionBuilder do. This commit adds missing functions
to fix certain controls fail to load.
2023-05-27 20:50:48 +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 8d26ed38d7 Custom controls: make toggleable functional
Fixes #378
2022-09-10 18:28:09 +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
Duy Tran Khanh e1ff27c298 Fixes button scaling; Logging header cleanup 2022-07-02 11:42:22 +07:00
Duy Tran Khanh ee2c68fb98 Fixes
Makefile: fix path
Moved GameSurfaceView to a separate class
Renamed MinecraftDownloader to MinecraftResourceUtils

Fix: Some versions fails because GLFW_CLIENT_API is not set
2022-07-01 07:02:25 +07:00
Duy Tran Khanh 7d14371271 Custom control editor changes
- Added the resize pointer (might not work stable)
- (Attempt to) fix the wrong size of the window on iPadOS again
- The window now has a rounded corner
2022-03-23 21:32:13 +07:00
Duy Tran Khanh 5c618d907b CC: passthrough support; Lock mouse pointer
Custom controls button passthrough: currently, only passed-through
events are touch events.
Pointer locking is incomplete and might not work properly.
2022-03-03 08:16:14 +07:00
Duy Tran KhanhandDuy Tran Khanh 33cb7d0125 Custom Controls revisions implemenation (#292)
* Move control loaders to CustomControlsUtils.m

* WIP Drawer support (currently broken)

Also, updated MetalANGLE for helping debug stuff on crash.

* temp

* ControlDrawer: free orientation

* Avoid scrolling the hotbar in grab mode

* Popover: fix the frame inside the arrow

* Changes

- Attempt to allow Microsoft login when offline.
- Custom controls: drawer and sub-buttons are now visible.
- Pickers in Preferences: pre-select at the saved index.

* Bump version code to 4, hide sub-button by default

* Fix text trucanting

* impl scroll buttons, rewrite some parts to objc

* Virtual mouse implementation

Also, possible fix for popover crashes on iPad

Exception type: NSInternalInconsistencyException
> Reason: Tried to set <UIBarButtonItem: 0x10fee5660> menuOnTouchDown
menu=0x2810dce10 image=<UIImage:0x280149050 symbol(system:
ellipsis.circle) {20, 19} baseline=3.5,contentInsets={1, 1.5, 1,
1.5},alignmentRectInsets={-0.5, 0, -0.5, 0}
config=<traits=(UserInterfaceIdiom = Pad, DisplayScale = 2,
DisplayGamut = sRGB, HorizontalSizeClass = Regular, VerticalSizeClass
= Regular, UserInterfaceStyle = Dark, UserInterfaceLayoutDirection =
LTR, PreferredContentSizeCategory = L, AccessibilityContrast =
Normal)>> as sourceView of
<_UIAlertControllerActionSheetRegularPresentationController:
0x12043f5a0>, even though it is not a kind of UIView.

* Swap item between hands by double-tap item moment

* Basic editor (only several stuff implemented)

There's no save/load yet, so it's just a preview for now.

* Control editor (preview only)
TODO: Color picker for iOS < 14

* Save, load and set default are here

* Changes

- Ported Snap and Align from Android
- Added options: create and delete button

TODO:
- color picker for iOS < 14
- drawer editor
- maybe more

* Editor: Added orientation changer for drawer

Added some more check to determine whether dynamic position should be
visible (when the button is not a sub-button, or the parent drawer
doesn't use the FREE orientation)

* Editor: implemented adding drawer and sub-button

* Added a warning about unfinished custom controls

Co-authored-by: Duy Tran Khanh <[email protected]>
2021-11-26 10:35:21 +07:00
Duy Tran KhanhandDuy Tran Khanh db0074d1e5 Merge custom control changes (#284)
* Move control loaders to CustomControlsUtils.m

* WIP Drawer support (currently broken)

Also, updated MetalANGLE for helping debug stuff on crash.

* temp

* ControlDrawer: free orientation

* Avoid scrolling the hotbar in grab mode

* Popover: fix the frame inside the arrow

* Changes

- Attempt to allow Microsoft login when offline.
- Custom controls: drawer and sub-buttons are now visible.
- Pickers in Preferences: pre-select at the saved index.

* Bump version code to 4, hide sub-button by default

* Fix text trucanting

* impl scroll buttons, rewrite some parts to objc

* Virtual mouse implementation

Also, possible fix for popover crashes on iPad

Exception type: NSInternalInconsistencyException
> Reason: Tried to set <UIBarButtonItem: 0x10fee5660> menuOnTouchDown
menu=0x2810dce10 image=<UIImage:0x280149050 symbol(system:
ellipsis.circle) {20, 19} baseline=3.5,contentInsets={1, 1.5, 1,
1.5},alignmentRectInsets={-0.5, 0, -0.5, 0}
config=<traits=(UserInterfaceIdiom = Pad, DisplayScale = 2,
DisplayGamut = sRGB, HorizontalSizeClass = Regular, VerticalSizeClass
= Regular, UserInterfaceStyle = Dark, UserInterfaceLayoutDirection =
LTR, PreferredContentSizeCategory = L, AccessibilityContrast =
Normal)>> as sourceView of
<_UIAlertControllerActionSheetRegularPresentationController:
0x12043f5a0>, even though it is not a kind of UIView.

Co-authored-by: Duy Tran Khanh <[email protected]>
2021-10-15 05:16:17 +07:00
Duy Tran Khanh 2c8067dc21 Clean some debug prints 2021-08-30 07:41:23 +07:00
Duy Tran Khanh 49125524d3 Preliminary support for v2 (code 3) control
TODO:
- Control editor
- Implement Drawer

FIXME:
-[MGLLayer init] crashes. Maybe replace with CAMetalLayer?
2021-08-30 07:13:39 +07:00
Duy Tran Khanh 66bee901db Layout converter v1 -> unfinished v2
"i want new keyboard for pojavluancher" x20 by @𝙵𝚊𝚔ȇ̈_A𝕣ᴄᴀᴅᴇ#7200
2021-08-07 10:17:52 +07:00
Duy Tran Khanh 0668d016bf Changes
- Added Caciocavallo (libawt_xawt stubs) support library.
- Added support lauching Minecraft 1.5.2 and older (requires latest
JRE8 build)
- [Custom controls] Implemented opacity property.
- Version info is now updated through macro instead of `sed` command.
2021-08-01 10:41:02 +07:00
Duy Tran Khanh c896da08bb A lot of more changes
* Custom controls:
- Unfinished v2 control
- Auto generate default.json, removed internal fallback control
- Compatible with Android's dp (might need scaling)
- Implemented properties: keycodes, bgColor, strokeColor, strokeWidth,
cornerRadius

* Other changes
- Updated MetalANGLE to 0.0.7
- Updated gl4es 1.1.5

* TODO:
- Control converter
- Drawer buttons
- Multiple keys support (?)
- Implement properties: opacity, isSwipeable, isToggle,
passThruEnabled, (maybe more?)
2021-07-23 16:51:51 +07:00
Duy Tran Khanh 11e11a6ccf [Unfinished] Custom controls implementation 2021-07-19 20:02:58 +07:00
Duy Tran Khanh 255e896fdc Changes
* Bug fixes:
- Duplicate version in picker list.
- Version list does not get automatic updated.
- Version picker does not scroll to the current selected version.

* Code changes.
2021-06-19 09:49:23 +07:00
Duy Tran Khanh 3be87bfa46 Changes
- Added preferences screen (currently empty)
- Cleaned compiler warnings
- Implemented GLFW clipboard
2021-05-24 20:50:40 +07:00
Duy Tran Khanh fc19e16e4f Custom controls implementation changes
- Fallback to default control if custom control data size is over 100kb.
- Implemented dynamic position.
- Renamed folder from `customcontrols` to `controlmap` to match
Android.
2021-04-22 17:46:18 +07:00
Duy Tran Khanh 6005ae7206 Stills attempting to hide home indicator
Also, fixed custom controls
2021-03-20 19:39:13 +07:00
Duy Tran Khanh 3a80e5ce39 Prepare skeleton parts for Custom Controls 2021-03-04 17:22:10 +07:00