jdungeon
jdungeon copied to clipboard
Dev Task: Popup menu to select different actions on an object
If we want the player to be able to perform more than one action on a given object, we need a menu to sort the available ones.
This should not use a PopupMenu Node due to it using an OS level kind of input (which can get buggy and doesn't provide much control).
By default, pressing the left_click action on an object performs the default action, if SHIFT is held while clicking, the menu appears. This means that the feature is not used when not necessary. The following examples are in order of priority for being chosen as default, if an action is not present, the next one becomes the default one (the order could be customizable by the player if necessary).
Possible actions:
-
Items
- Activate/Deactivate (for items that may be placed down and activated)
- Pickup
- Inspect (bring up a tooltip with the item's information)
-
NPCs
- Buy
- Talk
- Inspect (if we do any of the social systems, this would show the NPCs faction, opinion towards you, type of NPC, etc. Some of this information may not be available until the player talks to them and unlocks the information.)
-
Enemies
- Point at (causes the target to glow briefly, useful for coordinating with other players)
- Inspect (bring up a bestiary entry of the enemy, if available)
- Evaluate (show superficial stats for the enemy, if you have its bestiary entry)
-
Players
- Inspect (tooltip of a quick summary of the player's equipment and class(es))
- Whisper (automatically type /whisper PlayerName on the chat box and give it focus)
- Grab attention (causes a client-side message to appear in the target's chat box and an icon to appear above the player that used the action, similar to "point at" for enemies, but only the target can see the effects)
This also allows adding more actions in the future without having to worry about having more inputs.