@@ -19,7 +19,7 @@ func clear_game_state(clear_flag:=DialogicGameHandler.ClearFlags.FULL_CLEAR):
1919
2020
2121func load_game_state (load_flag := LoadFlags .FULL_LOAD ):
22- update_background (dialogic .current_state_info .get ('background_scene' , '' ), dialogic .current_state_info .get ('background_argument' , '' ))
22+ update_background (dialogic .current_state_info .get ('background_scene' , '' ), dialogic .current_state_info .get ('background_argument' , '' ), 0.0 , default_transition , true )
2323
2424
2525## ##################################################################################################
@@ -35,8 +35,12 @@ func load_game_state(load_flag:=LoadFlags.FULL_LOAD):
3535## and use the same scene.
3636## To do so implement [_should_do_background_update()] on the custom background scene.
3737## Then [_update_background()] will be called directly on that previous scene.
38- func update_background (scene :String = '' , argument :String = '' , fade_time :float = 0.0 , transition_path := default_transition ) -> void :
39- var background_holder : DialogicNode_BackgroundHolder = get_tree ().get_first_node_in_group ('dialogic_background_holders' )
38+ func update_background (scene :String = '' , argument :String = '' , fade_time :float = 0.0 , transition_path := default_transition , force :bool = false ) -> void :
39+ var background_holder : DialogicNode_BackgroundHolder
40+ if dialogic .has_subsystem ('Styles' ):
41+ background_holder = Dialogic .Styles .get_first_node_in_layout ('dialogic_background_holders' )
42+ else :
43+ background_holder = get_tree ().get_first_node_in_group ('dialogic_background_holders' )
4044 if background_holder == null :
4145 return
4246
@@ -47,7 +51,7 @@ func update_background(scene:String = '', argument:String = '', fade_time:float
4751 # First try just updating the existing scene.
4852 if scene == dialogic .current_state_info .get ('background_scene' , '' ):
4953
50- if argument == dialogic .current_state_info .get ('background_argument' , '' ):
54+ if not force and argument == dialogic .current_state_info .get ('background_argument' , '' ):
5155 return
5256
5357 for old_bg in background_holder .get_children ():
0 commit comments