diff --git a/data.gd b/data.gd index 6faf9f5..0dde571 100644 --- a/data.gd +++ b/data.gd @@ -42,5 +42,6 @@ const Themes = { } const Images = { - INTRO_BG = "res://img/intro_bg.png" + INTRO_BG = "res://img/intro_bg.png", + NEXT_BG = "res://img/next_bg.png" } \ No newline at end of file diff --git a/dialog/introduction.txt b/dialog/introduction.txt index 556d718..c326e84 100644 --- a/dialog/introduction.txt +++ b/dialog/introduction.txt @@ -1,3 +1,7 @@ ... You wake up to the sound of sirens blaring. ... maybe it's time to go to school? -> SWITCH_SCENE [FIRST_SCENE] + +>> FADE_IN_OUT [0.5, 0.5] +> SET_BACKGROUND [NEXT_BG] + ... Looking around, it definitely wasn't time to get up just yet. +> HIDE [background] \ No newline at end of file diff --git a/dialog_layer.gd b/dialog_layer.gd index 4050aea..710650d 100644 --- a/dialog_layer.gd +++ b/dialog_layer.gd @@ -15,8 +15,12 @@ func _ready(): # set up params dialog_box.set_dialog_path(dialog_path) + dialog_box.set_get_character_function(funcref(self, "_on_get_character")) +func _on_get_character(char_name): + return get_parent().get_node(char_name) + func _on_scene_ready(): # init after yes diff --git a/game.gd b/game.gd index 2b94e91..62bc41f 100644 --- a/game.gd +++ b/game.gd @@ -49,8 +49,16 @@ func _register_functions(): # default VN.. functions current_registry["SWITCH_SCENE"] = funcref(self, "_switch_scene_fnc") current_registry["SET_BACKGROUND"] = funcref(self, "_set_background_fnc") + current_registry["FADE_IN_OUT"] = funcref(self, "_fade_in_out_fnc") +func _fade_in_out_fnc(args): + if args.size() == 2: + var time_in = float(args[0]) + var time_out = float(args[1]) + transition.start_transition(time_in, time_out) + return [transition, "on_transition_time"] + func _set_background_fnc(args): if args.size() == 1: var bg_name = args[0] diff --git a/img/next_bg.ase b/img/next_bg.ase new file mode 100644 index 0000000..6c50023 --- /dev/null +++ b/img/next_bg.ase @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:659dc8733e69699238169cc99ec8a5a6be935a83642a40e4a5cddf5cc07f96ee +size 2943 diff --git a/img/next_bg.png b/img/next_bg.png new file mode 100644 index 0000000..0a99284 --- /dev/null +++ b/img/next_bg.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9c810860e9a4e34ecd3068682edc19cc7fe2f805110a4d406ea96eb9a1f9cd5 +size 3852 diff --git a/img/next_bg.png.import b/img/next_bg.png.import new file mode 100644 index 0000000..0b54dd8 --- /dev/null +++ b/img/next_bg.png.import @@ -0,0 +1,29 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/next_bg.png-b590abc492018a55534a418f689729f4.stex" + +[deps] + +source_file="res://img/next_bg.png" +dest_files=[ "res://.import/next_bg.png-b590abc492018a55534a418f689729f4.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/menus/main_menu.tscn b/menus/main_menu.tscn index ad097a8..f4cf046 100644 --- a/menus/main_menu.tscn +++ b/menus/main_menu.tscn @@ -9,7 +9,7 @@ content_margin_right = -1.0 content_margin_top = -1.0 content_margin_bottom = -1.0 -[node name="main_menu" type="Control"] +[node name="main_menu" type="Control" index="0"] anchor_left = 0.0 anchor_top = 0.0 diff --git a/scenes/intro.tscn b/scenes/intro.tscn index ccb813c..be492f0 100644 --- a/scenes/intro.tscn +++ b/scenes/intro.tscn @@ -5,7 +5,7 @@ [ext_resource path="res://dialog_layer.gd" type="Script" id=3] [ext_resource path="res://ui/dialog_box.tscn" type="PackedScene" id=4] -[node name="intro" type="Node2D"] +[node name="intro" type="Node2D" index="0"] script = ExtResource( 1 ) diff --git a/transition.gd b/transition.gd index 64662c9..bb84edc 100644 --- a/transition.gd +++ b/transition.gd @@ -11,7 +11,7 @@ const TRANSITION_TIME = 1.0 func _ready(): pass -func start_transition(): +func start_transition(time_in = TRANSITION_TIME, time_out = TRANSITION_TIME): tween.interpolate_property( background, "color:a", background.color.a, 1.0, diff --git a/ui/dialog_box.gd b/ui/dialog_box.gd index a9a845f..5b4e7f4 100644 --- a/ui/dialog_box.gd +++ b/ui/dialog_box.gd @@ -179,7 +179,7 @@ func _set_expr_fnc(args): func _show_char(args): var char_name = args[0] - var character = get_node_fnc.call(char_name) + var character = get_node_fnc.call_func(char_name) _do_show_char(character) func _do_show_char(c): @@ -192,7 +192,7 @@ func _do_show_char(c): func _hide_char(args): var char_name = args[0] - var character = get_node_fnc.call(char_name) + var character = get_node_fnc.call_func(char_name) _do_hide_char(character) func _do_hide_char(c): @@ -205,7 +205,7 @@ func _do_hide_char(c): func _flip_char(args): var char_name = args[0] - var character = get_node_fnc.call(char_name) + var character = get_node_fnc.call_func(char_name) _do_flip_char(character) func _do_flip_char(c):