Lime-3DS-Emulator icon indicating copy to clipboard operation
Lime-3DS-Emulator copied to clipboard

android: Add game shortcuts to about game dialog

Open kleidis opened this issue 1 year ago • 14 comments
trafficstars

This PR adds a new button on the about-game menu, which allows you to create a shortcut on the home screen for any game. The shortcut skips the home menu and jumps straight to the game activity

Here is a video of it in action:

https://github.com/user-attachments/assets/134a0843-3a46-4d51-af69-1e140c8fb43a

There are bugs, though,

    1. I found this bug by accident because of the stability of the original fork. If a game crashes while being launched from a shortcut, the shortcut corrupts similarly to the video below
    1. The first shortcut I made corrupted on me, similar to the video below, as well

https://github.com/user-attachments/assets/28a8b164-0926-4225-a50d-464543fc1dab

Closes https://github.com/Lime3DS/Lime3DS/issues/185

kleidis avatar Jul 28 '24 08:07 kleidis

Just wondering, are you making an attempt to fix these bugs or is the PR ready for review?

BlurrySquire avatar Aug 11 '24 19:08 BlurrySquire

Need to find a good way to reproduce the bug so we can debug it, More testing is needed

ghost avatar Aug 12 '24 15:08 ghost

I'll remove this from the roadmap temporarily until these issues are ironed out; There's no way of knowing how long it may take.

OpenSauce04 avatar Aug 12 '24 16:08 OpenSauce04

I found that the reason the game doesn't open in the video is because it was installed instead of .3ds rom file

The shortcut can't access the full path to the .app file , currently it juat returns the file name, so it just does nothing

I already figured out how to get the path to the .app file from inside the user directory, but I'm struggling to map tree/primary to it, Help would be appreciated

ghost avatar Aug 22 '24 17:08 ghost

For now, I just decided to disable the shortcut button if a game is internally installed, just not to deal with the very special android permission system. If any other contributor wants to deal with formatting and handling the Installed games path correctly, feel free to add on top of this PR

Otherwise, the PR is ready for review, Let me know what placement is best for the button since this one was a placeholder

ghost avatar Aug 29 '24 12:08 ghost

This is just a general question, is it possible to also make a shortcut for the home menu? Instead of starting it through the system files menu? Thanks in advance

TheHuman20020 avatar Aug 29 '24 15:08 TheHuman20020

is it possible to also make a shortcut for the home menu? Instead of starting it through the system files menu?

What do you mean? That's exactly what this PR is doing.

OpenSauce04 avatar Aug 29 '24 15:08 OpenSauce04

is it possible to also make a shortcut for the home menu? Instead of starting it through the system files menu?

What do you mean? That's exactly what this PR is doing.

Oh, i thought it was to launch games only, not the 3ds home menu as well, my bad

TheHuman20020 avatar Aug 29 '24 15:08 TheHuman20020

is it possible to also make a shortcut for the home menu? Instead of starting it through the system files menu?

What do you mean? That's exactly what this PR is doing.

Oh, i thought it was to launch games only, not the 3ds home menu as well, my bad

I assume the 3ds system menu is installed inside the userDirevotry, in that case no it won't work because Android file permissions are rocket science

ghost avatar Aug 29 '24 16:08 ghost

.3ds ROMs only, the shortcut button is grayed out for internally installed games for reasons I stated above

ghost avatar Aug 29 '24 16:08 ghost

This is just a general question, is it possible to also make a shortcut for the home menu? Instead of starting it through the system files menu? Thanks in advance

Would making something like a shortcut of the home menu in the games list help? This is something I would like as well. If so you could open an issue requesting the feature.

BlurrySquire avatar Aug 31 '24 14:08 BlurrySquire

I'll probably do so for other devs, but no, I'm not dealing with the Android permissions system myself

ghost avatar Aug 31 '24 15:08 ghost

I'll probably do so for other devs, but no, I'm not dealing with the Android permissions system myself

What i meant was a shortcut in the list that shows the games (not like a shortcut like the ones in this pull request) since the home menu is treated kinda like an app in the 3ds from what i've seen. it is stored in the nand quite similarly to installed apps from what ive seen.

Edit: It shouldn't be too complex as you can just copy what is done internally when the boot home menu button is pressed and do that but with an entry in the games list? It would also needs checks for if the home menu is installed so it wouldn't be that simple.

BlurrySquire avatar Aug 31 '24 15:08 BlurrySquire

I'll probably do so for other devs, but no, I'm not dealing with the Android permissions system myself

What i meant was a shortcut in the list that shows the games (not like a shortcut like the ones in this pull request) since the home menu is treated kinda like an app in the 3ds from what i've seen. it is stored in the nand quite similarly to installed apps from what ive seen.

Edit: It shouldn't be too complex as you can just copy what is done internally when the boot home menu button is pressed and do that but with an entry in the games list? It would also needs checks for if the home menu is installed so it wouldn't be that simple.

It's not a bad idea, but outside the scope of this PR You should open an issue so we can track it, and maybe one of us will implement it

ghost avatar Aug 31 '24 17:08 ghost

Since this issue of the internal app path was dealt with The game shortcuts are working for internal apps as well now

Shoutkuts to @OpenSauce04

ghost avatar Oct 12 '24 19:10 ghost

@kleidis Can you verify that the imports in 4d4d582 served no purpose I missed? I have run this code on both Android 14 and Android 9 and saw no issues creating shortcuts.

OpenSauce04 avatar Oct 12 '24 20:10 OpenSauce04

As far as i can see by a quick glance,
It should be fine to keep them removed, most likely left accidentally by the mandarine dev when porting from Yuzu

And since the PR was made 3 months ago, i forgot to remove

ghost avatar Oct 12 '24 22:10 ghost

Tested CIA/app files myself today All seems to work good

ghost avatar Oct 13 '24 10:10 ghost