tutorial
The base for a contextual tutorial.
In order to give a tutorial to someone, use SStutorials.suggest_tutorial(user, /datum/tutorial/subtype)
Vars | |
grandfather_date | If set, any account who started playing before this date will not be given this tutorial. Date is in YYYY-MM-DD format. |
---|---|
user | The mob we are giving the tutorial to |
Procs | |
animate_ui_element | Creates a UI element with the given icon_state , starts it at initial_screen_loc , and animates it to target_screen_loc .
Waits animate_start_time before moving. |
complete | Called by the tutorial when the user has successfully completed it. Will mark it as completed in the datbaase and kick off destruction of the tutorial. |
dismiss | As opposed to complete() , this merely hides the tutorial.
This should be used when the user doesn't need the tutorial anymore, but didn't
actually properly finish it. |
keybinding_message | Given a keybind and a message, will replace %KEY% in message with the first keybind they have.
As a fallback, will return the third parameter, message_without_keybinds , if none are set. |
manager | Gets the [/datum/tutorial_manager ] that owns this tutorial. |
perform | The actual steps of the tutorial. Is given any excess arguments of suggest_tutorial. Must be overridden. |
perform_completion_effects_with_delay | Called when the tutorial is being hidden, but before it is deleted. You should unregister signals and fade out any of your creations in here. Returns how long extra to delay the deletion. |
should_perform | Returns TRUE/FALSE if this tutorial should be given. If FALSE, does not mean it won't come back later. |
show_instruction | Shows a large piece of text on the user's screen with the given message. If a message already exists, will fade it out and replace it. |
Var Details
grandfather_date
If set, any account who started playing before this date will not be given this tutorial. Date is in YYYY-MM-DD format.
user
The mob we are giving the tutorial to
Proc Details
animate_ui_element
Creates a UI element with the given icon_state
, starts it at initial_screen_loc
, and animates it to target_screen_loc
.
Waits animate_start_time
before moving.
complete
Called by the tutorial when the user has successfully completed it. Will mark it as completed in the datbaase and kick off destruction of the tutorial.
dismiss
As opposed to complete()
, this merely hides the tutorial.
This should be used when the user doesn't need the tutorial anymore, but didn't
actually properly finish it.
keybinding_message
Given a keybind and a message, will replace %KEY% in message
with the first keybind they have.
As a fallback, will return the third parameter, message_without_keybinds
, if none are set.
manager
Gets the [/datum/tutorial_manager
] that owns this tutorial.
perform
The actual steps of the tutorial. Is given any excess arguments of suggest_tutorial. Must be overridden.
perform_completion_effects_with_delay
Called when the tutorial is being hidden, but before it is deleted. You should unregister signals and fade out any of your creations in here. Returns how long extra to delay the deletion.
should_perform
Returns TRUE/FALSE if this tutorial should be given. If FALSE, does not mean it won't come back later.
show_instruction
Shows a large piece of text on the user's screen with the given message. If a message already exists, will fade it out and replace it.