godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.15k stars 97 forks source link

Add Android "App shortcuts" #2739

Open sosasees opened 3 years ago

sosasees commented 3 years ago

Describe the project you are working on

I am working on an Android game with a title screen.

Describe the problem or limitation you are having in your project

I want to implement an "App shortcut" so that the player can select and continue playing their latest Save File already, bypassing the title screen and main menu completely.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

image When holding down an icon of an app that supports "app shortcuts" on the home screen, it'll open a window with these "app shortcuts". These are shortcuts to other parts of the app that aren't the app's normal starting screen.

This is where I want to put my second "Continue" button that's outside of the game instead of its title screen.

This is the Android Developer's documentation for App Shortcuts.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Shortcut types:

enum AndroidAppShortcuts.ShortcutType {
ANDROID_APP_SHORTCUT_TYPE_STATIC,
ANDROID_APP_SHORTCUT_TYPE_DYNAMIC,
ANDROID_APP_SHORTCUT_TYPE_PINNED }

To add shortcut:

if OS.name == "Android":
    AndroidAppShortcuts.add_shortcut(shortcut_id, shortcut_type, "path://to/scene", "Shortcut Description", "path://to/scene")

To update shortcut:

if OS.name == "Android":
    AndroidAppShortcuts.update_shortcut(shortcut_id, shortcut_type, "path://to/scene", "Shortcut Description", "path://to/scene")

To disable shortcut:

if OS.name == "Android":
    AndroidAppShortcuts.disable_shortcut(shortcut_id)

To enable shortcut:

if OS.name == "Android":
    AndroidAppShortcuts.enable_shortcut(shortcut_id)

If this enhancement will not be used often, can it be worked around with a few lines of script?

I haven't found anything.

Is there a reason why this should be core and not an add-on in the asset library?

If possible, it might actually be better as an add-on instead of a core feature.

ghost commented 2 years ago

Did they add this feature

Calinou commented 2 years ago

@hani09876 No, not yet. There is no ETA for implementing this feature, since nobody has looked into implementing it yet.