diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..45587ac --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 John Pennycook + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..84c3a66 --- /dev/null +++ b/README.md @@ -0,0 +1,58 @@ +# Godot Input Prompts + +This Godot plugin adds new nodes providing easy-to-use input prompts. + +A demo of the prompts in action is available on [itch.io][1]; if you find this +plugin useful, please consider supporting my work there. + +[1]:https://pennycook.itch.io/godot-input-prompts + +The current version supports the following icons: +- Keyboard and mouse +- Xbox +- PlayStation +- Nintendo Switch + +Please note that the PlayStation icons must be completed manually in an editor. + +## ActionPrompt + +![ActionPrompt](./addons/input_prompts/ActionPrompt/screenshot.png) + +ActionPrompt nodes display prompts based on the InputMap and an icon +preference. When set to "Automatic", the prompts update to match the input +device. + +## JoypadButtonPrompt + +![JoypadButtonPrompt](./addons/input_prompts/JoypadButtonPrompt/screenshot.png) + +JoypadButtonPrompt nodes display prompts corresponding to a button index. + +## JoypadMotionPrompt + +![JoypadMotionPrompt](./addons/input_prompts/JoypadMotionPrompt/screenshot.png) + +JoypadMotionPrompt nodes display prompts corresponding to an axis and an axis +value. + +## KeyPrompt + +![KeyPrompt](./addons/input_prompts/KeyPrompt/screenshot.png) + +KeyPrompt nodes display prompts corresponding to a key scancode. + +## MousePrompt + +![MouseButtonPrompt](./addons/input_prompts/MouseButtonPrompt/screenshot.png) + +MouseButtonPrompt nodes display prompts corresponding to a button index. + +# License + +Code is licensed under the MIT license. +Icons are in the [public domain][2], originally released by [Kenney][3]. + +[2]:https://creativecommons.org/publicdomain/zero/1.0/ +[3]:https://kenney.nl/ + diff --git a/addons/input_prompts/ActionPrompt/ActionPrompt.gd b/addons/input_prompts/ActionPrompt/ActionPrompt.gd new file mode 100644 index 0000000..799dc98 --- /dev/null +++ b/addons/input_prompts/ActionPrompt/ActionPrompt.gd @@ -0,0 +1,106 @@ +# Copyright (C) 2022 John Pennycook +# SPDX-License-Identifier: MIT +tool +extends "res://addons/input_prompts/BasePrompt.gd" + +var action = "ui_accept" setget _set_action +var icon = InputPrompts.Icons.AUTOMATIC setget _set_icon +var _events : Array = [] + +func _ready(): + self.action = action + self.icon = icon + _update_icon() + +func _set_action(new_action : String): + action = new_action + # In the Editor, InputMap reflects Editor settings + # Read the list of actions from ProjectSettings instead + if Engine.editor_hint: + _events = ProjectSettings.get_setting("input/" + action)["events"] + else: + _events = InputMap.get_action_list(action) + _update_icon() + +func _set_icon(new_icon): + icon = new_icon + _update_icon() + +func _find_event(list : Array, types : Array): + for candidate in list: + for type in types: + if candidate is type: + return candidate + return null + +func _update_icon(): + # If icon is set to AUTOMATIC, first determine which icon to display + var display_icon : int = icon + if icon == InputPrompts.Icons.AUTOMATIC: + display_icon = InputPrompts.get_icons() + + # Choose the atlas and region associated with the InputEvent + # If the InputMap contains multiple events, choose the first + if display_icon == InputPrompts.Icons.KEYBOARD: + var types = [InputEventKey, InputEventMouseButton] + var ev = _find_event(_events, types) + if not (ev is InputEventKey or ev is InputEventMouseButton): + push_error("No Key/Mouse input for " + action + " in InputMap") + if ev is InputEventKey: + var scancode = ev.get_scancode() + texture.atlas = InputPrompts.get_key_atlas() + texture.region = InputPrompts.get_key_region(scancode) + elif ev is InputEventMouseButton: + var button = ev.get_button_index() + texture.atlas = InputPrompts.get_mouse_atlas() + texture.region = InputPrompts.get_mouse_region(button) + else: + var types = [InputEventJoypadButton, InputEventJoypadMotion] + var ev = _find_event(_events, types) + if not (ev is InputEventJoypadButton or ev is InputEventJoypadMotion): + push_error("No Joypad input for " + action + " in InputMap") + if ev is InputEventJoypadButton: + var button = ev.get_button_index() + texture.atlas = InputPrompts.get_joypad_button_atlas(display_icon) + texture.region = InputPrompts.get_joypad_button_region(button) + elif ev is InputEventJoypadMotion: + var axis = ev.get_axis() + var value = ev.get_axis_value() + texture.atlas = InputPrompts.get_joypad_motion_atlas() + texture.region = InputPrompts.get_joypad_motion_region(axis, value) + update() + +func _input(event : InputEvent): + if not event.is_action_pressed(action): + return + emit_signal("pressed") + +func _get_property_list(): + var properties = [] + properties.append({ + name = "ActionPrompt", + type = TYPE_NIL, + usage = PROPERTY_USAGE_CATEGORY | PROPERTY_USAGE_SCRIPT_VARIABLE + }) + # In the Editor, InputMap reflects Editor settings + # Read the list of actions from ProjectSettings instead + var actions : String = "" + for property in ProjectSettings.get_property_list(): + var name = property["name"] + if name.begins_with("input/"): + if actions != "": + actions += "," + actions += name.trim_prefix("input/") + properties.append({ + name = "action", + type = TYPE_STRING, + hint = PROPERTY_HINT_ENUM, + hint_string = actions + }) + properties.append({ + name = "icon", + type = TYPE_INT, + hint = PROPERTY_HINT_ENUM, + hint_string = "Automatic,Xbox,Sony,Nintendo,Keyboard" + }) + return properties diff --git a/addons/input_prompts/ActionPrompt/icon.png b/addons/input_prompts/ActionPrompt/icon.png new file mode 100644 index 0000000..436b4f3 Binary files /dev/null and b/addons/input_prompts/ActionPrompt/icon.png differ diff --git a/addons/input_prompts/ActionPrompt/icon.png.import b/addons/input_prompts/ActionPrompt/icon.png.import new file mode 100644 index 0000000..1e766af --- /dev/null +++ b/addons/input_prompts/ActionPrompt/icon.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/icon.png-81530b8bad18876c36fd6be5243690a5.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/input_prompts/ActionPrompt/icon.png" +dest_files=[ "res://.import/icon.png-81530b8bad18876c36fd6be5243690a5.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/input_prompts/ActionPrompt/screenshot.png b/addons/input_prompts/ActionPrompt/screenshot.png new file mode 100644 index 0000000..5544974 Binary files /dev/null and b/addons/input_prompts/ActionPrompt/screenshot.png differ diff --git a/addons/input_prompts/BasePrompt.gd b/addons/input_prompts/BasePrompt.gd new file mode 100644 index 0000000..1f071cf --- /dev/null +++ b/addons/input_prompts/BasePrompt.gd @@ -0,0 +1,21 @@ +# Copyright (C) 2022 John Pennycook +# SPDX-License-Identifier: MIT +tool +extends TextureRect + +signal pressed() + +func _is_input_prompt(): + return true + +func _ready(): + self.texture = AtlasTexture.new() + +func _update_icon(): + pass + +func _enter_tree(): + InputPrompts.connect("icons_changed", self, "_update_icon") + +func _exit_tree(): + InputPrompts.disconnect("icons_changed", self, "_update_icon") diff --git a/addons/input_prompts/InputPrompts.gd b/addons/input_prompts/InputPrompts.gd new file mode 100644 index 0000000..e64b640 --- /dev/null +++ b/addons/input_prompts/InputPrompts.gd @@ -0,0 +1,327 @@ +# Copyright (C) 2022 John Pennycook +# SPDX-License-Identifier: MIT +tool +extends Node + +signal icons_changed + +enum Icons { + AUTOMATIC, + XBOX, + SONY, + NINTENDO, + KEYBOARD, +} + +const KeyPromptMap = { + KEY_ESCAPE : Rect2(0, 0, 16, 16), + KEY_F1 : Rect2(16, 0, 16, 16), + KEY_F2 : Rect2(32, 0, 16, 16), + KEY_F3 : Rect2(48, 0, 16, 16), + KEY_F4 : Rect2(64, 0, 16, 16), + KEY_F5 : Rect2(80, 0, 16, 16), + KEY_F6 : Rect2(96, 0, 16, 16), + KEY_F7 : Rect2(112, 0, 16, 16), + KEY_F8 : Rect2(128, 0, 16, 16), + KEY_F9 : Rect2(144, 0, 16, 16), + KEY_F10 : Rect2(160, 0, 16, 16), + KEY_F11 : Rect2(176, 0, 16, 16), + KEY_F12 : Rect2(192, 0, 16, 16), + KEY_ASCIITILDE : Rect2(208, 0, 16, 16), + KEY_EXCLAM : Rect2(224, 0, 16, 16), + KEY_AT : Rect2(240, 0, 16, 16), + KEY_NUMBERSIGN : Rect2(256, 0, 16, 16), + KEY_1 : Rect2(0, 16, 16, 16), + KEY_2 : Rect2(16, 16, 16, 16), + KEY_3 : Rect2(32, 16, 16, 16), + KEY_4 : Rect2(48, 16, 16, 16), + KEY_5 : Rect2(64, 16, 16, 16), + KEY_6 : Rect2(80, 16, 16, 16), + KEY_7 : Rect2(96, 16, 16, 16), + KEY_8 : Rect2(112, 16, 16, 16), + KEY_9 : Rect2(128, 16, 16, 16), + KEY_0 : Rect2(144, 16, 16, 16), + KEY_MINUS : Rect2(160, 16, 16, 16), + KEY_PLUS : Rect2(176, 16, 16, 16), + KEY_EQUAL : Rect2(192, 16, 16, 16), + KEY_UNDERSCORE : Rect2(208, 16, 16, 16), + KEY_BAR : Rect2(224, 16, 16, 16), + KEY_BACKSPACE : Rect2(240, 16, 32, 16), + KEY_Q : Rect2(0, 32, 16, 16), + KEY_W : Rect2(16, 32, 16, 16), + KEY_E : Rect2(32, 32, 16, 16), + KEY_R : Rect2(48, 32, 16, 16), + KEY_T : Rect2(64, 32, 16, 16), + KEY_Y : Rect2(80, 32, 16, 16), + KEY_U : Rect2(96, 32, 16, 16), + KEY_I : Rect2(112, 32, 16, 16), + KEY_O : Rect2(128, 32, 16, 16), + KEY_P : Rect2(144, 32, 16, 16), + KEY_BRACKETLEFT : Rect2(160, 32, 16, 16), + KEY_BRACKETRIGHT : Rect2(176, 32, 16, 16), + KEY_BRACELEFT : Rect2(192, 32, 16, 16), + KEY_BRACERIGHT : Rect2(208, 32, 16, 16), + KEY_BACKSLASH : Rect2(224, 32, 16, 16), + KEY_ENTER : Rect2(240, 32, 32, 32), + KEY_A : Rect2(16, 48, 16, 16), + KEY_S : Rect2(32, 48, 16, 16), + KEY_D : Rect2(48, 48, 16, 16), + KEY_F : Rect2(64, 48, 16, 16), + KEY_G : Rect2(80, 48, 16, 16), + KEY_H : Rect2(96, 48, 16, 16), + KEY_J : Rect2(112, 48, 16, 16), + KEY_K : Rect2(128, 48, 16, 16), + KEY_L : Rect2(144, 48, 16, 16), + KEY_APOSTROPHE : Rect2(160, 48, 16, 16), + KEY_QUOTEDBL : Rect2(176, 48, 16, 16), + KEY_COLON : Rect2(192, 48, 16, 16), + KEY_SEMICOLON : Rect2(208, 48, 16, 16), + KEY_ASTERISK : Rect2(224, 48, 16, 16), + KEY_NOBREAKSPACE : Rect2(0, 64, 16, 16), + KEY_META : Rect2(16, 64, 16, 16), + KEY_Z : Rect2(32, 64, 16, 16), + KEY_X : Rect2(48, 64, 16, 16), + KEY_C : Rect2(64, 64, 16, 16), + KEY_V : Rect2(80, 64, 16, 16), + KEY_B : Rect2(96, 64, 16, 16), + KEY_N : Rect2(112, 64, 16, 16), + KEY_M : Rect2(128, 64, 16, 16), + KEY_LESS : Rect2(144, 64, 16, 16), + KEY_GREATER : Rect2(160, 64, 16, 16), + KEY_QUESTION : Rect2(176, 64, 16, 16), + KEY_SLASH : Rect2(192, 64, 16, 16), + KEY_UP : Rect2(208, 64, 16, 16), + KEY_RIGHT : Rect2(224, 64, 16, 16), + KEY_DOWN : Rect2(240, 64, 16, 16), + KEY_LEFT : Rect2(256, 64, 16, 16), + KEY_ALT : Rect2(0, 80, 32, 16), + KEY_TAB : Rect2(32, 80, 32, 16), + KEY_DELETE : Rect2(64, 80, 32, 16), + KEY_END : Rect2(96, 80, 32, 16), + KEY_NUMLOCK : Rect2(128, 80, 32, 16), + KEY_PERIOD : Rect2(160, 80, 16, 16), + KEY_DOLLAR : Rect2(176, 80, 16, 16), + KEY_PERCENT : Rect2(192, 80, 16, 16), + KEY_ASCIICIRCUM : Rect2(208, 80, 16, 16), + KEY_CENT : Rect2(224, 80, 16, 16), + KEY_PARENLEFT : Rect2(240, 80, 16, 16), + KEY_PARENRIGHT : Rect2(256, 80, 16, 16), + KEY_CONTROL : Rect2(0, 96, 32, 16), + KEY_CAPSLOCK : Rect2(32, 96, 32, 16), + KEY_HOME : Rect2(64, 96, 32, 16), + KEY_PAGEUP : Rect2(96, 96, 32, 16), + KEY_PAGEDOWN : Rect2(128, 96, 32, 16), + KEY_COMMA : Rect2(160, 96, 16, 16), + KEY_MEDIARECORD : Rect2(208, 96, 16, 16), + KEY_SPACE : Rect2(224, 96, 48, 16), + KEY_SHIFT : Rect2(0, 112, 32, 16), + KEY_INSERT : Rect2(32, 112, 32, 16), + KEY_PRINT : Rect2(64, 112, 32, 16), + KEY_SCROLLLOCK : Rect2(96, 112, 32, 16), + KEY_PAUSE : Rect2(128, 112, 32, 16), + KEY_MEDIAPLAY : Rect2(160, 112, 16, 16), + KEY_MEDIASTOP : Rect2(192, 112, 16, 16), + KEY_BACK : Rect2(208, 112, 16, 16), + KEY_FORWARD : Rect2(224, 112, 16, 16), + KEY_MEDIAPREVIOUS : Rect2(240, 112, 16, 16), + KEY_MEDIANEXT : Rect2(256, 112, 16, 16), +} + +const KeyPromptNames = { + KEY_ESCAPE : "Escape", + KEY_F1 : "F1", + KEY_F2 : "F2", + KEY_F3 : "F3", + KEY_F4 : "F4", + KEY_F5 : "F5", + KEY_F6 : "F6", + KEY_F7 : "F7", + KEY_F8 : "F8", + KEY_F9 : "F9", + KEY_F10 : "F10", + KEY_F11 : "F11", + KEY_F12 : "F12", + KEY_ASCIITILDE : "~", + KEY_EXCLAM : "!", + KEY_AT : "@", + KEY_NUMBERSIGN : "#", + KEY_1 : "1", + KEY_2 : "2", + KEY_3 : "3", + KEY_4 : "4", + KEY_5 : "5", + KEY_6 : "6", + KEY_7 : "7", + KEY_8 : "8", + KEY_9 : "9", + KEY_0 : "0", + KEY_MINUS : "-", + KEY_PLUS : "+", + KEY_EQUAL : "=", + KEY_UNDERSCORE : "_", + KEY_BAR : "|", + KEY_BACKSPACE : "Backspace", + KEY_Q : "Q", + KEY_W : "W", + KEY_E : "E", + KEY_R : "R", + KEY_T : "T", + KEY_Y : "Y", + KEY_U : "U", + KEY_I : "I", + KEY_O : "O", + KEY_P : "P", + KEY_BRACKETLEFT : "[", + KEY_BRACKETRIGHT : "]", + KEY_BRACELEFT : "(", + KEY_BRACERIGHT : ")", + KEY_BACKSLASH : "\\", + KEY_ENTER : "Enter", + KEY_A : "A", + KEY_S : "S", + KEY_D : "D", + KEY_F : "F", + KEY_G : "G", + KEY_H : "H", + KEY_J : "J", + KEY_K : "K", + KEY_L : "L", + KEY_APOSTROPHE : "'", + KEY_QUOTEDBL : "\"", + KEY_COLON : "Colon", + KEY_SEMICOLON : "Semi-colon", + KEY_ASTERISK : "*", + KEY_NOBREAKSPACE : "Non-Breaking Space", + KEY_META : "Meta", + KEY_Z : "Z", + KEY_X : "X", + KEY_C : "C", + KEY_V : "V", + KEY_B : "B", + KEY_N : "N", + KEY_M : "M", + KEY_LESS : "<", + KEY_GREATER : ">", + KEY_QUESTION : "?", + KEY_SLASH : "/", + KEY_UP : "Up", + KEY_RIGHT : "Right", + KEY_DOWN : "Down", + KEY_LEFT : "Left", + KEY_ALT : "Alt", + KEY_TAB : "Tab", + KEY_DELETE : "Delete", + KEY_END : "End", + KEY_NUMLOCK : "Num Lock", + KEY_PERIOD : ".", + KEY_DOLLAR : "$", + KEY_PERCENT : "%", + KEY_ASCIICIRCUM : "^", + KEY_CENT : "Cent", + KEY_PARENLEFT : "(", + KEY_PARENRIGHT : ")", + KEY_CONTROL : "Control", + KEY_CAPSLOCK : "Caps Lock", + KEY_HOME : "Home", + KEY_PAGEUP : "Page Up", + KEY_PAGEDOWN : "Page Down", + KEY_COMMA : "Comma", + KEY_MEDIARECORD : "Record", + KEY_SPACE : "Space", + KEY_SHIFT : "Shift", + KEY_INSERT : "Insert", + KEY_PRINT : "Print", + KEY_SCROLLLOCK : "Scroll Lock", + KEY_PAUSE : "Pause", + KEY_MEDIAPLAY : "Play", + KEY_MEDIASTOP : "Stop", + KEY_BACK : "Back", + KEY_FORWARD : "Forward", + KEY_MEDIAPREVIOUS : "Previous", + KEY_MEDIANEXT : "Next", +} + +var _preferred_icons = Icons.AUTOMATIC +var _icons = Icons.XBOX + +func get_preferred_icons(): + return _preferred_icons + +func set_preferred_icons(icons): + _preferred_icons = icons + if _preferred_icons == null or _preferred_icons == Icons.AUTOMATIC: + _icons = Icons.XBOX + else: + _icons = icons + emit_signal("icons_changed") + +func get_icons(): + # In the Editor, InputMap reflects Editor settings + # Pick a default so there's something to render + if Engine.editor_hint: + return Icons.XBOX + else: + return _icons + +func get_key_atlas(): + return preload("res://addons/input_prompts/KeyPrompt/keys.png") + +func get_key_region(scancode : int): + return KeyPromptMap[scancode] + +func get_mouse_atlas(): + return preload("res://addons/input_prompts/MouseButtonPrompt/buttons.png") + +func get_mouse_region(button : int): + var x = button - 1 + return Rect2(x * 16, 0, 16, 16) + +func get_joypad_button_atlas(icons : int): + match icons: + Icons.AUTOMATIC: + return get_joypad_button_atlas(get_icons()) + Icons.XBOX: + return preload("res://addons/input_prompts/JoypadButtonPrompt/xbox.png") + Icons.SONY: + return preload("res://addons/input_prompts/JoypadButtonPrompt/sony.png") + Icons.NINTENDO: + return preload("res://addons/input_prompts/JoypadButtonPrompt/nintendo.png") + +func get_joypad_button_region(button : int): + var x = button % 16 + var y = button / 16 + return Rect2(x * 16, y * 16, 16, 16) + +func get_joypad_motion_atlas(): + return preload("res://addons/input_prompts/JoypadMotionPrompt/axis.png") + +func get_joypad_motion_region(axis : int, axis_value : int): + var x = 0 if axis_value == -1 else 1 + var y = axis + return Rect2(x * 16, y * 16, 16, 16) + +# Monitor InputEvents and emit icons_changed if: +# 1) The user has not expressed an icon preference +# 2) The type of InputEvent is different to last time +func _input(event : InputEvent): + if not (_preferred_icons == null or _preferred_icons == Icons.AUTOMATIC): + return + if event is InputEventKey or event is InputEventMouse: + if _icons != Icons.KEYBOARD: + _icons = Icons.KEYBOARD + emit_signal("icons_changed") + if event is InputEventJoypadButton or event is InputEventJoypadMotion: + var device = event.device + var joy_name = Input.get_joy_name(device) + var joy_icons = null + if joy_name.find("Xbox"): + joy_icons = Icons.XBOX + elif joy_name.find("DualShock") or joy_name.find("PS"): + joy_icons = Icons.SONY + elif joy_name.find("Nintendo"): + joy_icons = Icons.NINTENDO + else: + joy_icons = Icons.XBOX + if _icons != joy_icons: + _icons = joy_icons + emit_signal("icons_changed") diff --git a/addons/input_prompts/InspectorPlugin.gd b/addons/input_prompts/InspectorPlugin.gd new file mode 100644 index 0000000..e1fbf06 --- /dev/null +++ b/addons/input_prompts/InspectorPlugin.gd @@ -0,0 +1,12 @@ +# Copyright (C) 2022 John Pennycook +# SPDX-License-Identifier: MIT +tool +extends EditorInspectorPlugin + +func can_handle(object): + return object.has_method("_is_input_prompt") + +func parse_property(object, type, path, hint, hint_text, usage): + # Hide the texture property of TextureRect to ensure that user can only + # modify it indirectly (e.g. via setting key, button, action or icon) + return path == "texture" diff --git a/addons/input_prompts/JoypadButtonPrompt/JoypadButtonPrompt.gd b/addons/input_prompts/JoypadButtonPrompt/JoypadButtonPrompt.gd new file mode 100644 index 0000000..2446205 --- /dev/null +++ b/addons/input_prompts/JoypadButtonPrompt/JoypadButtonPrompt.gd @@ -0,0 +1,55 @@ +# Copyright (C) 2022 John Pennycook +# SPDX-License-Identifier: MIT +tool +extends "res://addons/input_prompts/BasePrompt.gd" + +var button = 0 setget _set_button +var icon = InputPrompts.Icons.AUTOMATIC setget _set_icon + +func _ready(): + self.button = button + self.icon = icon + _update_icon() + +func _set_button(index : int): + button = index + _update_icon() + +func _set_icon(new_icon): + icon = new_icon + _update_icon() + +func _update_icon(): + texture.atlas = InputPrompts.get_joypad_button_atlas(icon) + texture.region = InputPrompts.get_joypad_button_region(button) + update() + +func _input(event : InputEvent): + if not event is InputEventJoypadButton: + return + if not event.get_button_index() == button: + return + if not event.is_pressed(): + return + emit_signal("pressed") + +func _get_property_list(): + var properties = [] + properties.append({ + name = "JoypadButtonPrompt", + type = TYPE_NIL, + usage = PROPERTY_USAGE_CATEGORY | PROPERTY_USAGE_SCRIPT_VARIABLE + }) + properties.append({ + name = "button", + type = TYPE_INT, + hint = PROPERTY_HINT_RANGE, + hint_string = "0,22" + }) + properties.append({ + name = "icon", + type = TYPE_INT, + hint = PROPERTY_HINT_ENUM, + hint_string = "Automatic,Xbox,Sony,Nintendo" + }) + return properties diff --git a/addons/input_prompts/JoypadButtonPrompt/icon.png b/addons/input_prompts/JoypadButtonPrompt/icon.png new file mode 100644 index 0000000..0592b91 Binary files /dev/null and b/addons/input_prompts/JoypadButtonPrompt/icon.png differ diff --git a/addons/input_prompts/JoypadButtonPrompt/icon.png.import b/addons/input_prompts/JoypadButtonPrompt/icon.png.import new file mode 100644 index 0000000..795d9cf --- /dev/null +++ b/addons/input_prompts/JoypadButtonPrompt/icon.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/icon.png-bafb3d4b8d483c8f59bf8847560aa5dd.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/input_prompts/JoypadButtonPrompt/icon.png" +dest_files=[ "res://.import/icon.png-bafb3d4b8d483c8f59bf8847560aa5dd.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/input_prompts/JoypadButtonPrompt/nintendo.png b/addons/input_prompts/JoypadButtonPrompt/nintendo.png new file mode 100644 index 0000000..61dd947 Binary files /dev/null and b/addons/input_prompts/JoypadButtonPrompt/nintendo.png differ diff --git a/addons/input_prompts/JoypadButtonPrompt/nintendo.png.import b/addons/input_prompts/JoypadButtonPrompt/nintendo.png.import new file mode 100644 index 0000000..fb8d38e --- /dev/null +++ b/addons/input_prompts/JoypadButtonPrompt/nintendo.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/nintendo.png-4a4bd90f1c5d7d74acc28e5baaa06a3a.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/input_prompts/JoypadButtonPrompt/nintendo.png" +dest_files=[ "res://.import/nintendo.png-4a4bd90f1c5d7d74acc28e5baaa06a3a.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/addons/input_prompts/JoypadButtonPrompt/screenshot.png b/addons/input_prompts/JoypadButtonPrompt/screenshot.png new file mode 100644 index 0000000..4d3eb8f Binary files /dev/null and b/addons/input_prompts/JoypadButtonPrompt/screenshot.png differ diff --git a/addons/input_prompts/JoypadButtonPrompt/sony.png b/addons/input_prompts/JoypadButtonPrompt/sony.png new file mode 100644 index 0000000..1f56edb Binary files /dev/null and b/addons/input_prompts/JoypadButtonPrompt/sony.png differ diff --git a/addons/input_prompts/JoypadButtonPrompt/sony.png.import b/addons/input_prompts/JoypadButtonPrompt/sony.png.import new file mode 100644 index 0000000..8297729 --- /dev/null +++ b/addons/input_prompts/JoypadButtonPrompt/sony.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/sony.png-75156a549b1364c12071a460e28e12d5.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/input_prompts/JoypadButtonPrompt/sony.png" +dest_files=[ "res://.import/sony.png-75156a549b1364c12071a460e28e12d5.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/addons/input_prompts/JoypadButtonPrompt/xbox.png b/addons/input_prompts/JoypadButtonPrompt/xbox.png new file mode 100644 index 0000000..679b3f3 Binary files /dev/null and b/addons/input_prompts/JoypadButtonPrompt/xbox.png differ diff --git a/addons/input_prompts/JoypadButtonPrompt/xbox.png.import b/addons/input_prompts/JoypadButtonPrompt/xbox.png.import new file mode 100644 index 0000000..e23eea8 --- /dev/null +++ b/addons/input_prompts/JoypadButtonPrompt/xbox.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/xbox.png-15e413432859a5e74433fa1e6b33d4ff.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/input_prompts/JoypadButtonPrompt/xbox.png" +dest_files=[ "res://.import/xbox.png-15e413432859a5e74433fa1e6b33d4ff.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/addons/input_prompts/JoypadMotionPrompt/JoypadMotionPrompt.gd b/addons/input_prompts/JoypadMotionPrompt/JoypadMotionPrompt.gd new file mode 100644 index 0000000..9defd08 --- /dev/null +++ b/addons/input_prompts/JoypadMotionPrompt/JoypadMotionPrompt.gd @@ -0,0 +1,57 @@ +# Copyright (C) 2022 John Pennycook +# SPDX-License-Identifier: MIT +tool +extends "res://addons/input_prompts/BasePrompt.gd" + +var axis = 0 setget _set_axis +var axis_value = -1 setget _set_axis_value + +func _ready(): + self.axis = axis + self.axis_value = axis_value + _update_icon() + +func _set_axis(new_axis : int): + axis = new_axis + _update_icon() + +func _set_axis_value(new_value : int): + axis_value = new_value + _update_icon() + +func _update_icon(): + texture.atlas = InputPrompts.get_joypad_motion_atlas() + texture.region = InputPrompts.get_joypad_motion_region(axis, axis_value) + update() + +func _input(event : InputEvent): + if not event is InputEventJoypadMotion: + return + if not event.get_axis() == axis: + return + if axis_value == -1 and event.get_axis_value() > 0: + return + if axis_value == 1 and event.get_axis_value() < 0: + return + emit_signal("pressed") + +func _get_property_list(): + var properties = [] + properties.append({ + name = "JoypadMotionPrompt", + type = TYPE_NIL, + usage = PROPERTY_USAGE_CATEGORY | PROPERTY_USAGE_SCRIPT_VARIABLE + }) + properties.append({ + name = "axis", + type = TYPE_INT, + hint = PROPERTY_HINT_ENUM, + hint_string = "Left Horizontal:0,Left Vertical:1,Right Horizontal:2,Right Vertical:3" + }) + properties.append({ + name = "axis_value", + type = TYPE_INT, + hint = PROPERTY_HINT_ENUM, + hint_string = "Negative:-1,Positive:1" + }) + return properties diff --git a/addons/input_prompts/JoypadMotionPrompt/axis.png b/addons/input_prompts/JoypadMotionPrompt/axis.png new file mode 100644 index 0000000..4042ff3 Binary files /dev/null and b/addons/input_prompts/JoypadMotionPrompt/axis.png differ diff --git a/addons/input_prompts/JoypadMotionPrompt/axis.png.import b/addons/input_prompts/JoypadMotionPrompt/axis.png.import new file mode 100644 index 0000000..d500887 --- /dev/null +++ b/addons/input_prompts/JoypadMotionPrompt/axis.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/axis.png-a2411931683e5d679a7e49455ed6ce01.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/input_prompts/JoypadMotionPrompt/axis.png" +dest_files=[ "res://.import/axis.png-a2411931683e5d679a7e49455ed6ce01.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/addons/input_prompts/JoypadMotionPrompt/icon.png b/addons/input_prompts/JoypadMotionPrompt/icon.png new file mode 100644 index 0000000..04ed2bb Binary files /dev/null and b/addons/input_prompts/JoypadMotionPrompt/icon.png differ diff --git a/addons/input_prompts/JoypadMotionPrompt/icon.png.import b/addons/input_prompts/JoypadMotionPrompt/icon.png.import new file mode 100644 index 0000000..f12f660 --- /dev/null +++ b/addons/input_prompts/JoypadMotionPrompt/icon.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/icon.png-b83b2ba7091ea5bca43f4e97fdc27327.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/input_prompts/JoypadMotionPrompt/icon.png" +dest_files=[ "res://.import/icon.png-b83b2ba7091ea5bca43f4e97fdc27327.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/addons/input_prompts/JoypadMotionPrompt/screenshot.png b/addons/input_prompts/JoypadMotionPrompt/screenshot.png new file mode 100644 index 0000000..f25c17d Binary files /dev/null and b/addons/input_prompts/JoypadMotionPrompt/screenshot.png differ diff --git a/addons/input_prompts/KeyPrompt/KeyPrompt.gd b/addons/input_prompts/KeyPrompt/KeyPrompt.gd new file mode 100644 index 0000000..de1f48a --- /dev/null +++ b/addons/input_prompts/KeyPrompt/KeyPrompt.gd @@ -0,0 +1,50 @@ +# Copyright (C) 2022 John Pennycook +# SPDX-License-Identifier: MIT +tool +extends "res://addons/input_prompts/BasePrompt.gd" + +var key = KEY_EXCLAM setget _set_key + +func _ready(): + self.key = key + _update_icon() + +func _set_key(scancode : int): + key = scancode + _update_icon() + +func _update_icon(): + texture.atlas = InputPrompts.get_key_atlas() + texture.region = InputPrompts.get_key_region(key) + update() + +func _input(event : InputEvent): + if not event is InputEventKey: + return + if not event.get_scancode() == key: + return + if not event.is_pressed(): + return + if event.is_echo(): + return + emit_signal("pressed") + +func _get_property_list(): + var properties = [] + properties.append({ + name = "KeyPrompt", + type = TYPE_NIL, + usage = PROPERTY_USAGE_CATEGORY | PROPERTY_USAGE_SCRIPT_VARIABLE + }) + var keys : String = "" + for k in InputPrompts.KeyPromptMap: + if keys != "": + keys += "," + keys += "{0}:{1}".format([InputPrompts.KeyPromptNames[k], k]) + properties.append({ + name = "key", + type = TYPE_INT, + hint = PROPERTY_HINT_ENUM, + hint_string = keys + }) + return properties diff --git a/addons/input_prompts/KeyPrompt/icon.png b/addons/input_prompts/KeyPrompt/icon.png new file mode 100644 index 0000000..04c28d9 Binary files /dev/null and b/addons/input_prompts/KeyPrompt/icon.png differ diff --git a/addons/input_prompts/KeyPrompt/icon.png.import b/addons/input_prompts/KeyPrompt/icon.png.import new file mode 100644 index 0000000..4945657 --- /dev/null +++ b/addons/input_prompts/KeyPrompt/icon.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/icon.png-9ccd4cfe631ac8999d06689264d1cd45.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/input_prompts/KeyPrompt/icon.png" +dest_files=[ "res://.import/icon.png-9ccd4cfe631ac8999d06689264d1cd45.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/input_prompts/KeyPrompt/keys.png b/addons/input_prompts/KeyPrompt/keys.png new file mode 100644 index 0000000..8664631 Binary files /dev/null and b/addons/input_prompts/KeyPrompt/keys.png differ diff --git a/addons/input_prompts/KeyPrompt/keys.png.import b/addons/input_prompts/KeyPrompt/keys.png.import new file mode 100644 index 0000000..27561a7 --- /dev/null +++ b/addons/input_prompts/KeyPrompt/keys.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/keys.png-f8501c88e9ce93ada6165831486fdcb6.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/input_prompts/KeyPrompt/keys.png" +dest_files=[ "res://.import/keys.png-f8501c88e9ce93ada6165831486fdcb6.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/addons/input_prompts/KeyPrompt/screenshot.png b/addons/input_prompts/KeyPrompt/screenshot.png new file mode 100644 index 0000000..9e57d5c Binary files /dev/null and b/addons/input_prompts/KeyPrompt/screenshot.png differ diff --git a/addons/input_prompts/MouseButtonPrompt/MouseButtonPrompt.gd b/addons/input_prompts/MouseButtonPrompt/MouseButtonPrompt.gd new file mode 100644 index 0000000..556e623 --- /dev/null +++ b/addons/input_prompts/MouseButtonPrompt/MouseButtonPrompt.gd @@ -0,0 +1,43 @@ +# Copyright (C) 2022 John Pennycook +# SPDX-License-Identifier: MIT +tool +extends "res://addons/input_prompts/BasePrompt.gd" + +var button = 1 setget _set_button + +func _ready(): + self.button = button + _update_icon() + +func _set_button(index : int): + button = index + _update_icon() + +func _update_icon(): + texture.atlas = InputPrompts.get_mouse_atlas() + texture.region = InputPrompts.get_mouse_region(button) + update() + +func _input(event : InputEvent): + if not event is InputEventMouseButton: + return + if not event.get_button_index() == button: + return + if not event.is_pressed(): + return + emit_signal("pressed") + +func _get_property_list(): + var properties = [] + properties.append({ + name = "MouseButtonPrompt", + type = TYPE_NIL, + usage = PROPERTY_USAGE_CATEGORY | PROPERTY_USAGE_SCRIPT_VARIABLE + }) + properties.append({ + name = "button", + type = TYPE_INT, + hint = PROPERTY_HINT_ENUM, + hint_string = "Left:1,Right:2,Middle:3,Wheel Up:4,Wheel Down:5,Wheel Left:6,Wheel Right:7" + }) + return properties diff --git a/addons/input_prompts/MouseButtonPrompt/buttons.png b/addons/input_prompts/MouseButtonPrompt/buttons.png new file mode 100644 index 0000000..1413ca5 Binary files /dev/null and b/addons/input_prompts/MouseButtonPrompt/buttons.png differ diff --git a/addons/input_prompts/MouseButtonPrompt/buttons.png.import b/addons/input_prompts/MouseButtonPrompt/buttons.png.import new file mode 100644 index 0000000..27dc0d6 --- /dev/null +++ b/addons/input_prompts/MouseButtonPrompt/buttons.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/buttons.png-32635abe3b89c38460525337905c6e16.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/input_prompts/MouseButtonPrompt/buttons.png" +dest_files=[ "res://.import/buttons.png-32635abe3b89c38460525337905c6e16.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/addons/input_prompts/MouseButtonPrompt/icon.png b/addons/input_prompts/MouseButtonPrompt/icon.png new file mode 100644 index 0000000..5347820 Binary files /dev/null and b/addons/input_prompts/MouseButtonPrompt/icon.png differ diff --git a/addons/input_prompts/MouseButtonPrompt/icon.png.import b/addons/input_prompts/MouseButtonPrompt/icon.png.import new file mode 100644 index 0000000..8db661a --- /dev/null +++ b/addons/input_prompts/MouseButtonPrompt/icon.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/icon.png-a4cf49637cbd987795973db246882433.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/input_prompts/MouseButtonPrompt/icon.png" +dest_files=[ "res://.import/icon.png-a4cf49637cbd987795973db246882433.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/addons/input_prompts/MouseButtonPrompt/screenshot.png b/addons/input_prompts/MouseButtonPrompt/screenshot.png new file mode 100644 index 0000000..c8c3094 Binary files /dev/null and b/addons/input_prompts/MouseButtonPrompt/screenshot.png differ diff --git a/addons/input_prompts/plugin.cfg b/addons/input_prompts/plugin.cfg new file mode 100644 index 0000000..6a07bc9 --- /dev/null +++ b/addons/input_prompts/plugin.cfg @@ -0,0 +1,7 @@ +[plugin] + +name="Input Prompts" +description="Adds input prompts with support for keyboard/mouse and controllers." +author="John Pennycook" +version="1.0" +script="plugin.gd" diff --git a/addons/input_prompts/plugin.gd b/addons/input_prompts/plugin.gd new file mode 100644 index 0000000..cd1fce7 --- /dev/null +++ b/addons/input_prompts/plugin.gd @@ -0,0 +1,24 @@ +# Copyright (C) 2022 John Pennycook +# SPDX-License-Identifier: MIT +tool +extends EditorPlugin + +var inspector_plugin = preload("res://addons/input_prompts/InspectorPlugin.gd").new() + +func _enter_tree(): + add_autoload_singleton("InputPrompts", "res://addons/input_prompts/InputPrompts.gd") + add_custom_type("ActionPrompt", "TextureRect", load("res://addons/input_prompts/ActionPrompt/ActionPrompt.gd"), preload("res://addons/input_prompts/ActionPrompt/icon.png")) + add_custom_type("JoypadButtonPrompt", "TextureRect", load("res://addons/input_prompts/JoypadButtonPrompt/JoypadButtonPrompt.gd"), preload("res://addons/input_prompts/JoypadButtonPrompt/icon.png")) + add_custom_type("JoypadMotionPrompt", "TextureRect", load("res://addons/input_prompts/JoypadMotionPrompt/JoypadMotionPrompt.gd"), preload("res://addons/input_prompts/JoypadMotionPrompt/icon.png")) + add_custom_type("KeyPrompt", "TextureRect", load("res://addons/input_prompts/KeyPrompt/KeyPrompt.gd"), preload("res://addons/input_prompts/KeyPrompt/icon.png")) + add_custom_type("MouseButtonPrompt", "TextureRect", load("res://addons/input_prompts/MouseButtonPrompt/MouseButtonPrompt.gd"), preload("res://addons/input_prompts/MouseButtonPrompt/icon.png")) + add_inspector_plugin(inspector_plugin) + +func _exit_tree(): + remove_inspector_plugin(inspector_plugin) + remove_custom_type("MouseButtonPrompt") + remove_custom_type("KeyPrompt") + remove_custom_type("JoypadMotionPrompt") + remove_custom_type("JoypadButtonPrompt") + remove_custom_type("ActionPrompt") + remove_autoload_singleton("InputPrompts")