Commit Graph
34 Commits
Author SHA1 Message Date
Duy Tran Khanh d40539df05 Localize CustomControlsViewController 2022-11-04 19:10:10 +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 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 e69b019032 View controller presentation tweaks 2022-09-22 19:11:22 +07:00
Duy Tran Khanh fde7bb0139 null fix, remove some log calls 2022-09-22 10:36:15 +07:00
Duy Tran Khanh d939654c2f Log branch name, tweaks, localization 2022-09-11 17:48:58 +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 d311a03628 iPadOS: view ctrls should now be fullscreen again 2022-07-25 06:27:40 +07:00
Duy Tran Khanh d8459effc0 WIP: New User interface
UISplitViewController is being used to create split menu.
Currently, autolayout is not yet done.
Added account switcher to the split view.

Fixes:
- auth_session parameter for legacy Minecraft versions
- Updating self.view background color is now automated by
UIColor.systemBackgroundColor
2022-07-22 08:02:40 +07:00
Duy Tran Khanh b06049a5bb Potential fix for the editor size issue on iPadOS 2022-06-14 15:18:08 +07:00
Duy Tran Khanh 984647084b Fixes
- [Internal] Changed how setting current viewController work
- [Internal] Correct 018e46a: avoid duplicating code
- [Internal] Saving JSON now uses NSData to write directly
- Correct a check of the Launch .jar option
- Set the AWT window size for the game
2022-05-27 21:54:26 +07:00
khanhduytran0 bf12743457 Moved the JVM entry point to start when needed 2022-05-27 05:48:25 +07:00
khanhduytran0 2a9d3909f8 Internal, renderer and UI changes + 1.19-pre1 support
Minecraft 1.19 support:
- Since 1.19-pre1, LWJGL 3.3.1 is used. However, LWJGL 3.2.3 still works with it, at least for this Minecraft release.
- Added a hack to skip calling to ObjC codes (skipped an asset file to skip setting the icon)
- JNA version replacing: now only change to 5.8.0 if version < 5.8.0

Internal changes:
- Cleanup: moved global functions to a new place
- Handle demo user correctly: actually authenticate the game with demo's access token and use the Xbox gamertag as the username
- Start moving strings to Localizable.strings (WIP)
- Re-wrote the Microsoft authentication and account management to Objective-C
- Assets downloading: added a tiny sleep call so that the UI won’t be frozen when too many tasks are executed at the same time

Renderers changes
- gl4es: `init_constructor` is now enabled, therefore moved the preload part to before `eglInitialize` (or EGL will be de-init after gl4es's hardware test).
- gl4es-extra (aka holy gl4es 1.1.4) is now used to replace the regular gl4es. This fixes VBO issue on version < 1.13 and some extra stuff. https://github.com/PojavLauncherTeam/gl4es-114-extra/commit/d6cf5c4
- Removed gl4es 1.1.5 and `Disable gl4es shaderconv` as it's unnecessary for now
- Removed vgpu, as it requires some missing extensions when come to shaders

User interface:
- The account selection list now displays the skin head (or the Xbox gamerpic if demo) and the account type
2022-05-22 11:31:14 +07:00
khanhduytran0 1d7e8a8214 Experimental Minecraft Downloader
This is not yet finished, there are 3 main things left
- Make sure everything works
- (Assets) download old structure
- Cleanup

What are implemented?
- Downloading file is handled with AFNetworking
- SHA1 validation, can be turned off in Preferences
- inheritsFrom support (need testing)
- Downloading assets with 20 jobs parallel

Known issue
- Assets SHA1 validating freezes the UI

Additional things
- [Custom controls] Dynamic position error is now handled instead of just crashes
- [Custom controls] The editor animation is now changed to fade in/out (for now, later might change)
- VGPU renderer is now made hidden, since it's too limited on iOS, removal planned
- [Code cleanup] Use NSDictionary instead of a set of fields for renderer list; Fix wrong field name.
- Some more stuff...
2022-04-20 20:45:47 +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 fcd52ce2aa CC editor: set VC bounds size for iPad + draggable
Fixes #326
2022-03-21 18:25:36 +07:00
Duy Tran Khanh a23f0cf30e CC editor: view controller now follow bounds(#326) 2022-02-14 06:04:43 +07:00
Duy Tran Khanh f48408ced0 Only load Alderis.framework when needed 2022-02-13 04:36:49 +07:00
Duy Tran Khanh e5018cc094 Bug fix: Fabric 1.17+ crash at startup(fixes #304)
Microsoft account now set accountType to msa.
Minor change in custom control view controller.
2022-02-05 16:47:04 +07:00
Duy Tran Khanh dc5c5a9c65 [Custom controls] Added color picker for iOS < 14
Might aswell add an option to optionally use this instead of the system
color picker on iOS 14+. Used library: Alderis

Other changes
- [Custom controls] The editor is now fullscreen due to the
presentation of the color picker.
- Fixes scroll wheel input is always int
2022-02-01 21:58:54 +07:00
khanhduytran0 b6f552df85 Keyboard + Mouse input handling; some cleanups
* Keyboard input: KeyboardInput.m
- Requires iOS 13.4. Used pressesBegan and pressesEnded.
- Not all keys are handled, these will be handled later.

* Mouse input
- Requires iOS 13.0 for hovering. Used UIHoverGestureRecognizer.
- Requires iOS 14.0 for L/R mouse buttons and scroll handling. Used GCMouse for now. We will use iOS 13.4(?)'s API later.
- Pointer lock is not yet handled.

These above apply to iPadOS aswell, not sure about tvOS. iPhone users need to disable "Perform Touch Gestures" in the AssistiveTouch Accessibility settings in order to get the pointer hovering to work.

* Cleanups
- Use asprintf instead of sprintf when possible
- CallbackBridge functions: removed unnecessary JNI fields.
- Condition cleanup (managing virtual mouse position).
2022-01-04 09:55:47 +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 fe5f9e77a9 Changes
- Added a check to prevent attempt to launch 1.17+ with Java 8.
- Added an option to disable gl4es shaderconv in order to let ANGLE
processes them directly. This option lets Minecraft 1.17+ work
without the patch resource pack, OptiFine works aswell :)
- Changing renderer library no longer requires restart the launcher.
- Fixed some alert dialogs not displaying.
- PList default values are now set every time it loads.
2021-08-13 07:25:17 +07:00
Duy Tran Khanh 411a53a3b7 Add resolution slider help option 2021-08-10 21:09:33 +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
doregon 69e596f64c Merge remote-tracking branch 'origin/main'
# Conflicts:
#	Makefile
2021-08-03 14:09:39 -04: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
doregon 3ab2447e80 Fix version issue 🇫🇷 2021-07-27 22:06:25 -04: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 8f5059e741 Changes
- [Custom controls] Removed control size limit, prepare custom controls
screen.
- [Jailed] Use  directory as home instead of

- [Preference] Added "button scale"
- [Preferences] Moved into launcher_preferences.plist
2021-07-17 07:18:03 +07:00