Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Scenery.ECBehaviorInteractPrompt Class Reference

Behavior adding support to elements to show interact prompt to player. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorInteractPrompt:
Dragengine.Scenery.DefaultECBehavior Dragengine.Scenery.ECBehavior Dragengine.Scenery.BehaviorCompatiblePersistency

Classes

class  Factory
 Behavior factory. More...
class  Instance
 Behavior instance. More...

Public Member Functions

ECPStringList getAlternativeCommands ()
 Alternative commands.
ECPStringList getBones ()
 List of bones to restrict the prompt to.
ECPString getCommand ()
 Command.
ECPUnicodeString getDescription ()
 Description.
ECPString getDescriptionTranslate ()
 Description translated by active language.
ECPBoolean getEnabled ()
 Prompt is enabled.
ECPImage getImage ()
 Image.
ECPFloat getMaximumDistance ()
 Maximum distance to show interact prompt for when looking at it.
ECPString getSettings ()
 Optional settings to modify custom prompt widget display.
ECPString getStyle ()
 Style.
TranslationManager getTranslationManager ()
 Translation manager or null.
ECPUnicodeString getVerb ()
 Verb.
ECPString getVerbTranslate ()
 Verb translated by active language.
ECPVideo getVideo ()
 Video.
Instance instance (BehaviorElement element)
 Get instance in element from owner element class.
ECBehaviorInteractPrompt new (BehaviorElementClass eclass)
 Create behavior element class.
ECBehaviorInteractPrompt new (BehaviorElementClass eclass, String id)
 Create default composeable behavior.
ECBehaviorInteractPrompt new (BehaviorElementClass eclass, String id, String subID)
ECBehaviorInteractPrompt new (BehaviorElementClass eclass, String id, String subID, String prefix)
void setTranslationManager (TranslationManager manager)
 Set translation manager or null.
Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
void assignInstanceIndex (int instanceIndex)
 Assign instance index.
void dispose ()
 Dispose of behavior.
String getBehaviorID ()
 Unique identifier of behavior.
String getID ()
 Identifier.
int getInstanceIndex ()
 Instance index.
void loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance)
 Load instance data of another behavior.
bool supportsBehaviorID (String identifier)
 Behavior supports loading instance data of another behavior.
Public Member Functions inherited from Dragengine.Scenery.ECBehavior
ECBehaviorInstance createInstance (BehaviorElement element)
 Create Behavior instance.

Static Public Member Functions

static ECBehaviorInteractPrompt getBehaviorIn (BehaviorElementClass eclass)
 Get behavior in element class or null if absent.

Public Attributes

ECPStringList pAlternativeCommands
ECPStringList pBones
ECPString pCommand
ECPUnicodeString pDescription
ECPString pDescriptionTranslate
ECPBoolean pEnabled
ECPImage pImage
ECPFloat pMaximumDistance
ECPString pSettings
ECPString pStyle
TranslationManager pTranslationManager
ECPUnicodeString pVerb
ECPString pVerbTranslate
ECPVideo pVideo

Additional Inherited Members

Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
void setBehaviorID (String identifier)
 Set behavior identifier.
void useClassNameAsBehaviorID ()
 Set behavior identifier to "<class-name>:<identifier>".
void useFullyQualifiedClassNameAsBehaviorID ()
 Set behavior identifier to "<fully-qualified-class-name>:<identifier>".

Detailed Description

Behavior adding support to elements to show interact prompt to player.

This is a passive behavior storing the information used by player prompt behaviors to show to the player what he can do with the element for example when looking at it.

The promp information composes of an image/video, style, verb, description and command. Not all information is shown by player prompt behaviors. Typically the image/video and verb is shown sometimes only the image/video. If multiple interactions are possible the command is usually also shown. The description can be used if the player needs some more information that can not be easily given using an image/video or a simple interact verb. The style is an optional information can be be used by the player prompt behavior to tint the image/video, verb text or even the description. This can be used to tell the player additional hints like if the interaction has potential caveats or is currently not possible to be done. The meaning of the style value depends on the prompt display widget used. A typical use of style is to be used as suffix for the widget designer selector.

The player prompt behavior determines where the image/video, verb, command and description text is shown.

This behavior has an enabled parameter. This can be used to temporarily disable the interact prompt for example to enable it when certain conditions are met or if multiple interact prompts are used for the same element. This allows to set them all up and enabling only the active one.

The command parameter is the name of the command as present in the CommandManager used by the player interact prompt display. If found the bindings used to trigger this command are shown or the command name whever the prompt display decides to use.

Prompts are typically used with collision testing for example ECBehaviorLookAt and likewise. In this situation it can be useful to assign prompts to individual areas of a collider for example using hit bone name as produced by collision tests. For this use case the bones parameter can be used. If this parameter is an not an empty list this prompt shall only be considered if the hit bone is included in the list.

This behavior can be used multiple times on an element to add different interaction prompts. Use the behavior identifier to tell them apart.

Default property prefix is "interactPrompt{(id)}."

Supports these properties:

See also
https://developer.dragondreams.ch/wiki/doku.php/dragengine:modules:dragonscript:behavior_interactprompt

Member Function Documentation

◆ getAlternativeCommands()

ECPStringList Dragengine.Scenery.ECBehaviorInteractPrompt.getAlternativeCommands ( )

Alternative commands.

Version
1.20

References pSettings.

Referenced by getBehaviorIn().

◆ getBehaviorIn()

◆ getBones()

ECPStringList Dragengine.Scenery.ECBehaviorInteractPrompt.getBones ( )

List of bones to restrict the prompt to.

References pBones.

Referenced by getBehaviorIn(), and Dragengine.Scenery.ECBehaviorInteractPrompt.Instance.setStyle().

◆ getCommand()

ECPString Dragengine.Scenery.ECBehaviorInteractPrompt.getCommand ( )

Command.

Referenced by getBehaviorIn().

◆ getDescription()

ECPUnicodeString Dragengine.Scenery.ECBehaviorInteractPrompt.getDescription ( )

Description.

Referenced by getBehaviorIn().

◆ getDescriptionTranslate()

ECPString Dragengine.Scenery.ECBehaviorInteractPrompt.getDescriptionTranslate ( )

Description translated by active language.

Version
1.16

References getSettings(), and pSettings.

Referenced by getBehaviorIn(), and Dragengine.Scenery.ECBehaviorInteractPrompt.Instance.setVerb().

◆ getEnabled()

ECPBoolean Dragengine.Scenery.ECBehaviorInteractPrompt.getEnabled ( )

Prompt is enabled.

Referenced by getBehaviorIn(), and new().

◆ getImage()

ECPImage Dragengine.Scenery.ECBehaviorInteractPrompt.getImage ( )

Image.

Referenced by getBehaviorIn().

◆ getMaximumDistance()

ECPFloat Dragengine.Scenery.ECBehaviorInteractPrompt.getMaximumDistance ( )

Maximum distance to show interact prompt for when looking at it.

Version
1.18

References pBones.

Referenced by getBehaviorIn(), and getStyle().

◆ getSettings()

ECPString Dragengine.Scenery.ECBehaviorInteractPrompt.getSettings ( )

Optional settings to modify custom prompt widget display.

Version
1.19

References pBones.

Referenced by getBehaviorIn(), and getDescriptionTranslate().

◆ getStyle()

ECPString Dragengine.Scenery.ECBehaviorInteractPrompt.getStyle ( )

Style.

References getMaximumDistance(), and pMaximumDistance.

Referenced by getBehaviorIn().

◆ getTranslationManager()

TranslationManager Dragengine.Scenery.ECBehaviorInteractPrompt.getTranslationManager ( )

◆ getVerb()

ECPUnicodeString Dragengine.Scenery.ECBehaviorInteractPrompt.getVerb ( )

Verb.

Referenced by getBehaviorIn().

◆ getVerbTranslate()

ECPString Dragengine.Scenery.ECBehaviorInteractPrompt.getVerbTranslate ( )

Verb translated by active language.

Version
1.16

References pMaximumDistance.

Referenced by getBehaviorIn(), and Dragengine.Scenery.ECBehaviorInteractPrompt.Instance.getVerb().

◆ getVideo()

ECPVideo Dragengine.Scenery.ECBehaviorInteractPrompt.getVideo ( )

Video.

Referenced by getBehaviorIn().

◆ instance()

Instance Dragengine.Scenery.ECBehaviorInteractPrompt.instance ( BehaviorElement element)

Get instance in element from owner element class.

References pDescription, pImage, pStyle, pVerb, pVerbTranslate, and pVideo.

Referenced by getBehaviorIn().

◆ new() [1/4]

ECBehaviorInteractPrompt Dragengine.Scenery.ECBehaviorInteractPrompt.new ( BehaviorElementClass eclass)

Create behavior element class.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

References pAlternativeCommands.

Referenced by getBehaviorIn().

◆ new() [2/4]

ECBehaviorInteractPrompt Dragengine.Scenery.ECBehaviorInteractPrompt.new ( BehaviorElementClass eclass,
String id )

Create default composeable behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

◆ new() [3/4]

ECBehaviorInteractPrompt Dragengine.Scenery.ECBehaviorInteractPrompt.new ( BehaviorElementClass eclass,
String id,
String subID )

References getEnabled(), and pEnabled.

◆ new() [4/4]

ECBehaviorInteractPrompt Dragengine.Scenery.ECBehaviorInteractPrompt.new ( BehaviorElementClass eclass,
String id,
String subID,
String prefix )

References pEnabled.

◆ setTranslationManager()

void Dragengine.Scenery.ECBehaviorInteractPrompt.setTranslationManager ( TranslationManager manager)

Set translation manager or null.

Version
1.16

References pBones.

Referenced by getBehaviorIn().

Member Data Documentation

◆ pAlternativeCommands

ECPStringList Dragengine.Scenery.ECBehaviorInteractPrompt.pAlternativeCommands

Referenced by getBehaviorIn(), and new().

◆ pBones

ECPStringList Dragengine.Scenery.ECBehaviorInteractPrompt.pBones

◆ pCommand

ECPString Dragengine.Scenery.ECBehaviorInteractPrompt.pCommand

Referenced by getBehaviorIn().

◆ pDescription

ECPUnicodeString Dragengine.Scenery.ECBehaviorInteractPrompt.pDescription

Referenced by getBehaviorIn(), and instance().

◆ pDescriptionTranslate

ECPString Dragengine.Scenery.ECBehaviorInteractPrompt.pDescriptionTranslate

Referenced by getBehaviorIn().

◆ pEnabled

ECPBoolean Dragengine.Scenery.ECBehaviorInteractPrompt.pEnabled

Referenced by getBehaviorIn(), new(), and new().

◆ pImage

ECPImage Dragengine.Scenery.ECBehaviorInteractPrompt.pImage

Referenced by getBehaviorIn(), and instance().

◆ pMaximumDistance

ECPFloat Dragengine.Scenery.ECBehaviorInteractPrompt.pMaximumDistance

◆ pSettings

ECPString Dragengine.Scenery.ECBehaviorInteractPrompt.pSettings

◆ pStyle

ECPString Dragengine.Scenery.ECBehaviorInteractPrompt.pStyle

Referenced by getBehaviorIn(), and instance().

◆ pTranslationManager

TranslationManager Dragengine.Scenery.ECBehaviorInteractPrompt.pTranslationManager

Referenced by getBehaviorIn().

◆ pVerb

ECPUnicodeString Dragengine.Scenery.ECBehaviorInteractPrompt.pVerb

Referenced by getBehaviorIn(), and instance().

◆ pVerbTranslate

ECPString Dragengine.Scenery.ECBehaviorInteractPrompt.pVerbTranslate

Referenced by getBehaviorIn(), and instance().

◆ pVideo

ECPVideo Dragengine.Scenery.ECBehaviorInteractPrompt.pVideo

Referenced by getBehaviorIn(), and instance().


The documentation for this class was generated from the following file: