From 08645e6903082b7f943903aa10f6827d8857b230 Mon Sep 17 00:00:00 2001 From: StraToN Date: Wed, 27 Oct 2021 06:35:05 +0000 Subject: [PATCH] docs: Automatic update of API docs --- docs/api/ESCDialogManager.md | 87 +++++++++++++ docs/api/ESCDialogOptionsChooser.md | 2 +- ...ESCDialogsPlayer.md => ESCDialogPlayer.md} | 32 +++-- docs/api/SayCommand.md | 14 ++- docs/api/avatar_dialog_player.gd.md | 115 ------------------ docs/api/escoria.gd.md | 2 +- docs/api/floating_dialog_player.gd.md | 86 ------------- docs/api/text_dialog_chooser.gd.md | 48 -------- docs/esc.md | 6 +- 9 files changed, 115 insertions(+), 277 deletions(-) create mode 100644 docs/api/ESCDialogManager.md rename docs/api/{ESCDialogsPlayer.md => ESCDialogPlayer.md} (53%) delete mode 100644 docs/api/avatar_dialog_player.gd.md delete mode 100644 docs/api/floating_dialog_player.gd.md delete mode 100644 docs/api/text_dialog_chooser.gd.md diff --git a/docs/api/ESCDialogManager.md b/docs/api/ESCDialogManager.md new file mode 100644 index 00000000..371bff91 --- /dev/null +++ b/docs/api/ESCDialogManager.md @@ -0,0 +1,87 @@ + + +# ESCDialogManager + +**Extends:** [Control](../Control) + +## Description + +A base class for dialog plugins to work with Escoria + +## Method Descriptions + +### has\_type + +```gdscript +func has_type(type: String) -> bool +``` + +Check wether a specific type is supported by the +dialog plugin + +#### Parameters +- type: required type +*Returns* Wether the type is supported or not + +### has\_chooser\_type + +```gdscript +func has_chooser_type(type: String) -> bool +``` + +Check wether a specific chooser type is supported by the +dialog plugin + +#### Parameters +- type: required chooser type +*Returns* Wether the type is supported or not + +### say + +```gdscript +func say(dialog_player: Node, global_id: String, text: String, type: String) +``` + +Output a text said by the item specified by the global id. Emit +`say_finished` after finishing displaying the text. + +#### Parameters +- dialog_player: Node of the dialog player in the UI +- global_id: Global id of the item that is speaking +- text: Text to say, optional prefixed by a translation key separated + by a ":" +- type: Type of dialog box to use + +### choose + +```gdscript +func choose(dialog_player: Node, dialog: ESCDialog) +``` + +Present an option chooser to the player and sends the signal +`option_chosen` with the chosen dialog option + +#### Parameters +- dialog_player: Node of the dialog player in the UI +- dialog: Information about the dialog to display + +### speedup + +```gdscript +func speedup() +``` + +Trigger running the dialog faster + +### interrupt + +```gdscript +func interrupt() +``` + +The say command has been interrupted, cancel the dialog display + +## Signals + +- signal say_finished(): Emitted when the say function has completed showing the text +- signal option_chosen(option): Emitted when the player has chosen an option diff --git a/docs/api/ESCDialogOptionsChooser.md b/docs/api/ESCDialogOptionsChooser.md index e1db536c..b1a0935f 100644 --- a/docs/api/ESCDialogOptionsChooser.md +++ b/docs/api/ESCDialogOptionsChooser.md @@ -2,7 +2,7 @@ # ESCDialogOptionsChooser -**Extends:** [Node](../Node) +**Extends:** [Control](../Control) ## Description diff --git a/docs/api/ESCDialogsPlayer.md b/docs/api/ESCDialogPlayer.md similarity index 53% rename from docs/api/ESCDialogsPlayer.md rename to docs/api/ESCDialogPlayer.md index f5281a70..923ed44c 100644 --- a/docs/api/ESCDialogsPlayer.md +++ b/docs/api/ESCDialogPlayer.md @@ -1,8 +1,8 @@ -# ESCDialogsPlayer +# ESCDialogPlayer -**Extends:** [ResourcePreloader](../ResourcePreloader) +**Extends:** [Node](../Node) ## Description @@ -13,7 +13,7 @@ Escoria dialog player ### is\_speaking ```gdscript -var is_speaking +var is_speaking: bool = false ``` Wether the player is currently speaking @@ -23,21 +23,21 @@ Wether the player is currently speaking ### say ```gdscript -func say(character: String, ui: String, line: String) -> var +func say(character: String, type: String, text: String) -> var ``` -A short one line dialog +Make a character say a text #### Parameters - character: Character that is talking -- ui: UI to use for the dialog -- line: Line to say +- type: UI to use for the dialog +- text: Text to say -### finish\_fast +### speedup ```gdscript -func finish_fast() -> void +func speedup() -> void ``` Called when a dialog line is skipped @@ -45,7 +45,7 @@ Called when a dialog line is skipped ### start\_dialog\_choices ```gdscript -func start_dialog_choices(dialog: ESCDialog) +func start_dialog_choices(dialog: ESCDialog, type: String = "simple") ``` Display a list of choices @@ -54,17 +54,13 @@ Display a list of choices - dialog: The dialog to start -### play\_dialog\_option\_chosen +### interrupt ```gdscript -func play_dialog_option_chosen(option: ESCDialogOption) +func interrupt() ``` -Called when an option was chosen and emits the option_chosen signal - -#### Parameters - -- option: Option, that was chosen. +Interrupt the currently running dialog ## Signals @@ -73,4 +69,4 @@ Called when an option was chosen and emits the option_chosen signal ##### Parameters - option: The dialog option that was chosen -- signal dialog_line_finished(): Emitted when a dialog line was finished +- signal say_finished(): Emitted when a say command finished diff --git a/docs/api/SayCommand.md b/docs/api/SayCommand.md index 65d72a72..cebc4cbe 100644 --- a/docs/api/SayCommand.md +++ b/docs/api/SayCommand.md @@ -6,9 +6,9 @@ ## Description -`say object text [type] [avatar]` +`say player text [type]` -Runs the specified string as a dialog said by the object. Blocks execution +Runs the specified string as a dialog said by the player. Blocks execution until the dialog finishes playing. The text supports translation keys by prepending the key and separating @@ -19,8 +19,6 @@ Example: `say player ROOM1_PICTURE:"Picture's looking good."` Optional parameters: * "type" determines the type of dialog UI to use. Default value is "default" -* "avatar" determines the avatar to use for the dialog. Default value is - "default" @ESC @@ -34,6 +32,14 @@ func configure() -> ESCCommandArgumentDescriptor Return the descriptor of the arguments of this command +### validate + +```gdscript +func validate(arguments: Array) +``` + +Validate wether the given arguments match the command descriptor + ### run ```gdscript diff --git a/docs/api/avatar_dialog_player.gd.md b/docs/api/avatar_dialog_player.gd.md deleted file mode 100644 index c3a47974..00000000 --- a/docs/api/avatar_dialog_player.gd.md +++ /dev/null @@ -1,115 +0,0 @@ - - -# avatar\_dialog\_player.gd - -**Extends:** [Popup](../Popup) - -## Description - -A dialog GUI showing a dialog box and character portraits - -## Property Descriptions - -### current\_character - -```gdscript -export var current_character = "" -``` - -- **Setter**: `set_current_character` - -The currently speaking character - -### text\_speed\_per\_character - -```gdscript -export var text_speed_per_character = 0.1 -``` - -The text speed per character for normal display - -### fast\_text\_speed\_per\_character - -```gdscript -export var fast_text_speed_per_character = 0.25 -``` - -The text speed per character if the dialog line is skipped - -### max\_time\_to\_text\_disappear - -```gdscript -export var max_time_to_text_disappear = 1 -``` - -The time to wait before the dialog is finished - -### avatar\_node - -```gdscript -var avatar_node -``` - -The node holding the avatar - -### name\_node - -```gdscript -var name_node -``` - -The node holding the player name - -### text\_node - -```gdscript -var text_node -``` - -The node showing the text - -### tween - -```gdscript -var tween -``` - -The tween node for text animations - -## Method Descriptions - -### set\_current\_character - -```gdscript -func set_current_character(name: String) -``` - -Switch the current character - -#### Parameters -- name: The name of the current character - -### say - -```gdscript -func say(character: String, line: String) -``` - -Make a character say something - -#### Parameters -- character: The global id of the character speaking -- line: Line to say - -### finish\_fast - -```gdscript -func finish_fast() -``` - -Called by the dialog player when the - -## Signals - -- signal dialog_line_started(): Signal emitted when a dialog line has started -- signal dialog_line_finished(): Signal emitted when a dialog line has finished diff --git a/docs/api/escoria.gd.md b/docs/api/escoria.gd.md index 69656560..d61a0a39 100644 --- a/docs/api/escoria.gd.md +++ b/docs/api/escoria.gd.md @@ -124,7 +124,7 @@ Terrain of the current room ### dialog\_player ```gdscript -var dialog_player: ESCDialogsPlayer +var dialog_player: ESCDialogPlayer ``` Dialog player instantiator. This instance is called directly for dialogs. diff --git a/docs/api/floating_dialog_player.gd.md b/docs/api/floating_dialog_player.gd.md deleted file mode 100644 index 18361758..00000000 --- a/docs/api/floating_dialog_player.gd.md +++ /dev/null @@ -1,86 +0,0 @@ - - -# floating\_dialog\_player.gd - -**Extends:** [RichTextLabel](../RichTextLabel) - -## Description - -A dialog UI using a label above the head of the character - -## Property Descriptions - -### text\_speed\_per\_character - -```gdscript -export var text_speed_per_character = 0.1 -``` - -The text speed per character for normal display - -### fast\_text\_speed\_per\_character - -```gdscript -export var fast_text_speed_per_character = 0.25 -``` - -The text speed per character if the dialog line is skipped - -### max\_time\_to\_text\_disappear - -```gdscript -export var max_time_to_text_disappear = 2 -``` - -The time to wait before the dialog is finished - -### current\_character - -```gdscript -var current_character -``` - -Current character speaking, to keep track of reference for animation purposes - -### tween - -```gdscript -var tween -``` - -Tween node for text animation - -### text\_node - -```gdscript -var text_node -``` - -The node showing the text - -## Method Descriptions - -### say - -```gdscript -func say(character: String, line: String) -``` - -Make a character say something - -#### Parameters -- character: The global id of the character speaking -- line: Line to say - -### finish\_fast - -```gdscript -func finish_fast() -``` - -Called by the dialog player when the - -## Signals - -- signal dialog_line_started(): Signal emitted when a dialog line has started -- signal dialog_line_finished(): Signal emitted when a dialog line has finished diff --git a/docs/api/text_dialog_chooser.gd.md b/docs/api/text_dialog_chooser.gd.md deleted file mode 100644 index 2babadab..00000000 --- a/docs/api/text_dialog_chooser.gd.md +++ /dev/null @@ -1,48 +0,0 @@ - - -# text\_dialog\_chooser.gd - -**Extends:** [ESCDialogOptionsChooser](../ESCDialogOptionsChooser) < [Node](../Node) - -## Description - -A simple dialog chooser that shows selectable lines of text -Supports timeout and avatar display - -## Property Descriptions - -### color\_normal - -```gdscript -export var color_normal = "1,1,1,1" -``` - -### color\_hover - -```gdscript -export var color_hover = "165,42,42,1" -``` - -### font - -```gdscript -export var font = "[Object:null]" -``` - -## Method Descriptions - -### show\_chooser - -```gdscript -func show_chooser() -``` - -Show the chooser - -### hide\_chooser - -```gdscript -func hide_chooser() -``` - -Hide the chooser \ No newline at end of file diff --git a/docs/esc.md b/docs/esc.md index 799da835..880711e1 100644 --- a/docs/esc.md +++ b/docs/esc.md @@ -253,9 +253,9 @@ Fills the "name" global with a random value between 0 and max-value-1. Restarts the execution of the current scope at the start. A scope can be a group or an event. -#### `say object text [type] [avatar]` [API-Doc](api/SayCommand.md) +#### `say player text [type]` [API-Doc](api/SayCommand.md) -Runs the specified string as a dialog said by the object. Blocks execution +Runs the specified string as a dialog said by the player. Blocks execution until the dialog finishes playing. The text supports translation keys by prepending the key and separating @@ -266,8 +266,6 @@ Example: `say player ROOM1_PICTURE:"Picture's looking good."` Optional parameters: * "type" determines the type of dialog UI to use. Default value is "default" -* "avatar" determines the avatar to use for the dialog. Default value is - "default" #### `sched_event time object event` [API-Doc](api/SchedEventCommand.md) Schedules the execution of an "event" found in "object" in a time in seconds.