Skip to content

Commit

Permalink
Portraits: Add text effect for extra_data (#2438)
Browse files Browse the repository at this point in the history
  • Loading branch information
salianifo authored Oct 23, 2024
1 parent 262dff2 commit 6a6e30f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion addons/dialogic/Modules/Character/index.gd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ func _get_settings_pages() -> Array:
return [this_folder.path_join('settings_portraits.tscn')]

func _get_text_effects() -> Array[Dictionary]:
return [{'command':'portrait', 'subsystem':'Portraits', 'method':'text_effect_portrait', 'arg':true}]
return [
{'command':'portrait', 'subsystem':'Portraits', 'method':'text_effect_portrait', 'arg':true},
{'command':'extra_data', 'subsystem':'Portraits', 'method':'text_effect_extradata', 'arg':true},
]


func _get_special_resources() -> Dictionary:
Expand Down
7 changes: 7 additions & 0 deletions addons/dialogic/Modules/Character/subsystem_portraits.gd
Original file line number Diff line number Diff line change
Expand Up @@ -698,4 +698,11 @@ func text_effect_portrait(_text_node:Control, _skipped:bool, argument:String) ->
if dialogic.current_state_info.get('speaker', null):
change_character_portrait(load(dialogic.current_state_info.speaker), argument)
change_speaker(load(dialogic.current_state_info.speaker), argument)


## Called from the [extra_data=something] text effect.
func text_effect_extradata(_text_node:Control, _skipped:bool, argument:String) -> void:
if argument:
if dialogic.current_state_info.get('speaker', null):
change_character_extradata(load(dialogic.current_state_info.speaker), argument)
#endregion

0 comments on commit 6a6e30f

Please sign in to comment.