mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:05:34 +00:00
Custom module
This commit is contained in:
parent
e43f67c872
commit
0b1ea343dc
25 changed files with 598 additions and 33 deletions
37
Dialogue/CustomScenes/DefaultImageScene/DialogicImage.gd
Normal file
37
Dialogue/CustomScenes/DefaultImageScene/DialogicImage.gd
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
extends Node
|
||||
class_name DialogicImage
|
||||
|
||||
## This is the base class for dialogic images.
|
||||
## Extend it and override it's methods when you create a custom image.
|
||||
## You can take a look at the default background to get an idea of how it's working.
|
||||
|
||||
|
||||
## The subviewport container that holds this background. Set when instanced.
|
||||
var viewport_container: SubViewportContainer
|
||||
## The viewport that holds this background. Set when instanced.
|
||||
var viewport: SubViewport
|
||||
|
||||
|
||||
## Load the new background in here.
|
||||
## The time argument is given for when [_should_do_background_update] returns true
|
||||
## (then you have to do a transition in here)
|
||||
func _update_image(_argument:String, _time:float) -> void:
|
||||
pass
|
||||
|
||||
|
||||
## If a background event with this scene is encountered while this background is used,
|
||||
## this decides whether to create a new instance and call fade_out or just call [_update_background] # on this scene. Default is false
|
||||
func _should_do_image_update(_argument:String) -> bool:
|
||||
return false
|
||||
|
||||
|
||||
## Called by dialogic when first created.
|
||||
## If you return false (by default) it will attempt to animate the "modulate" property.
|
||||
func _custom_fade_in(_time:float) -> bool:
|
||||
return false
|
||||
|
||||
|
||||
## Called by dialogic before removing (done by dialogic).
|
||||
## If you return false (by default) it will attempt to animate the "modulate" property.
|
||||
func _custom_fade_out(_time:float) -> bool:
|
||||
return false
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://igc188fln1wv
|
||||
29
Dialogue/CustomScenes/DefaultImageScene/default_image.gd
Normal file
29
Dialogue/CustomScenes/DefaultImageScene/default_image.gd
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
extends DialogicImage
|
||||
|
||||
## The default background scene.
|
||||
## Extend the DialogicBackground class to create your own background scene.
|
||||
|
||||
@onready var image_node: TextureRect = $Image
|
||||
@onready var color_node: ColorRect = $ColorRect
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
#image_node.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
|
||||
#image_node.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_COVERED
|
||||
image_node.expand_mode = TextureRect.EXPAND_KEEP_SIZE
|
||||
image_node.stretch_mode = TextureRect.STRETCH_KEEP_CENTERED
|
||||
|
||||
image_node.anchor_right = 1
|
||||
image_node.anchor_bottom = 1
|
||||
|
||||
|
||||
func _update_image(argument:String, _time:float) -> void:
|
||||
if argument.begins_with('res://'):
|
||||
image_node.texture = load(argument)
|
||||
color_node.color = Color.TRANSPARENT
|
||||
elif argument.is_valid_html_color():
|
||||
image_node.texture = null
|
||||
color_node.color = Color(argument, 1)
|
||||
else:
|
||||
image_node.texture = null
|
||||
color_node.color = Color.from_string(argument, Color.TRANSPARENT)
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://bo6kn3exqjn4v
|
||||
25
Dialogue/CustomScenes/DefaultImageScene/default_image.tscn
Normal file
25
Dialogue/CustomScenes/DefaultImageScene/default_image.tscn
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://bjymtmtnuct1c"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bo6kn3exqjn4v" path="res://Dialogue/CustomScenes/DefaultImageScene/default_image.gd" id="1_ph6py"]
|
||||
|
||||
[node name="DefaultImage" type="Node"]
|
||||
script = ExtResource("1_ph6py")
|
||||
metadata/_custom_type_script = "uid://igc188fln1wv"
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="Image" type="TextureRect" parent="."]
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 0
|
||||
stretch_mode = 3
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://jypfiwjsk8wh"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bisx1nk1bjyjc" path="res://addons/dialogic/Modules/Background/node_background_holder.gd" id="1_4gfgy"]
|
||||
[ext_resource type="Script" uid="uid://hiekbi2rsq1j" path="res://Dialogue/Styles/Layers/Image_Layer/Image/node_image_holder.gd" id="1_og2vk"]
|
||||
|
||||
[node name="DialogicImage" type="Node2D"]
|
||||
|
||||
[node name="DialogicNode_BackgroundHolder" type="ColorRect" parent="."]
|
||||
[node name="DialogicNode_ImageHolder" type="ColorRect" parent="."]
|
||||
offset_left = 126.0
|
||||
offset_top = 41.0
|
||||
offset_right = 209.0
|
||||
offset_bottom = 124.0
|
||||
script = ExtResource("1_4gfgy")
|
||||
script = ExtResource("1_og2vk")
|
||||
|
|
|
|||
|
|
@ -1,22 +1,12 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://1qx7a3isffve"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://xwj105ltniqb" path="res://addons/dialogic/Modules/Background/DefaultBackgroundScene/default_background.gd" id="1_2qy85"]
|
||||
[ext_resource type="Script" uid="uid://bo6kn3exqjn4v" path="res://Dialogue/CustomScenes/DefaultImageScene/default_image.gd" id="1_sosx8"]
|
||||
|
||||
[node name="DefaultBackground" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 180.0
|
||||
offset_top = 20.0
|
||||
offset_right = -60.0
|
||||
offset_bottom = -60.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_2qy85")
|
||||
[node name="DefaultBackground" type="Node"]
|
||||
script = ExtResource("1_sosx8")
|
||||
metadata/_custom_type_script = "uid://igc188fln1wv"
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
|
|
@ -24,10 +14,9 @@ grow_horizontal = 2
|
|||
grow_vertical = 2
|
||||
|
||||
[node name="Image" type="TextureRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
grow_horizontal = 0
|
||||
mouse_filter = 0
|
||||
stretch_mode = 3
|
||||
|
|
|
|||
91
Dialogue/Styles/Briefing_Style.tres
Normal file
91
Dialogue/Styles/Briefing_Style.tres
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
[gd_resource type="Resource" script_class="DialogicStyle" load_steps=22 format=3 uid="uid://1360okdjnu04"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dh4po8pgey4yv" path="res://addons/dialogic/Resources/dialogic_style_layer.gd" id="1_1na1v"]
|
||||
[ext_resource type="PackedScene" uid="uid://c1k5m0w3r40xf" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_FullBackground/full_background_layer.tscn" id="2_yysma"]
|
||||
[ext_resource type="PackedScene" uid="uid://cy1y14inwkplb" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Portraits/vn_portrait_layer.tscn" id="3_tapfv"]
|
||||
[ext_resource type="PackedScene" uid="uid://cn674foxwedqu" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_Input/full_advance_input_layer.tscn" id="4_c3ltj"]
|
||||
[ext_resource type="PackedScene" uid="uid://bkycr7efsukaj" path="res://Resources/Styles/VN_Dialogue_Box/VisualNovelTextbox/custom_visual_novel_textbox.tscn" id="5_rmqst"]
|
||||
[ext_resource type="PackedScene" uid="uid://dsbwnp5hegnu3" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_Glossary/glossary_popup_layer.tscn" id="6_eh3mk"]
|
||||
[ext_resource type="PackedScene" uid="uid://dhk6j6eb6e3q" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Choices/vn_choice_layer.tscn" id="7_tsnk8"]
|
||||
[ext_resource type="PackedScene" uid="uid://cvgf4c6gg0tsy" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_TextInput/text_input_layer.tscn" id="8_ipd3l"]
|
||||
[ext_resource type="PackedScene" uid="uid://lx24i8fl6uo" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_History/history_layer.tscn" id="9_sowdg"]
|
||||
[ext_resource type="Script" uid="uid://dfja8ptqdlfix" path="res://addons/dialogic/Resources/dialogic_style.gd" id="10_lggnn"]
|
||||
[ext_resource type="PackedScene" uid="uid://bvoym0jf534us" path="res://Dialogue/Styles/Layers/Image_Layer/Image/custom_image.tscn" id="10_yysma"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_1umci"]
|
||||
script = ExtResource("1_1na1v")
|
||||
overrides = {}
|
||||
|
||||
[sub_resource type="Resource" id="Resource_k5ph0"]
|
||||
script = ExtResource("1_1na1v")
|
||||
scene = ExtResource("2_yysma")
|
||||
overrides = {}
|
||||
|
||||
[sub_resource type="Resource" id="Resource_pd24n"]
|
||||
script = ExtResource("1_1na1v")
|
||||
scene = ExtResource("3_tapfv")
|
||||
overrides = {}
|
||||
|
||||
[sub_resource type="Resource" id="Resource_msgpj"]
|
||||
script = ExtResource("1_1na1v")
|
||||
scene = ExtResource("4_c3ltj")
|
||||
overrides = {}
|
||||
|
||||
[sub_resource type="Resource" id="Resource_20kch"]
|
||||
script = ExtResource("1_1na1v")
|
||||
scene = ExtResource("5_rmqst")
|
||||
overrides = {
|
||||
"box_margin_bottom": "1.0",
|
||||
"box_panel": "\"res://Resources/Styles/PixelStyleBoxRed.tres\"",
|
||||
"box_size": "Vector2(300, 50)",
|
||||
"name_label_box_offset": "Vector2(0, 8)",
|
||||
"name_label_box_panel": "\"res://Resources/Styles/PixelStyleBoxRed.tres\"",
|
||||
"name_label_custom_font_size": "11.0",
|
||||
"next_indicator_size": "Vector2(12, 12)",
|
||||
"text_size": "6.0"
|
||||
}
|
||||
|
||||
[sub_resource type="Resource" id="Resource_7dp66"]
|
||||
script = ExtResource("1_1na1v")
|
||||
scene = ExtResource("6_eh3mk")
|
||||
overrides = {}
|
||||
|
||||
[sub_resource type="Resource" id="Resource_63vmy"]
|
||||
script = ExtResource("1_1na1v")
|
||||
scene = ExtResource("7_tsnk8")
|
||||
overrides = {}
|
||||
|
||||
[sub_resource type="Resource" id="Resource_disj7"]
|
||||
script = ExtResource("1_1na1v")
|
||||
scene = ExtResource("8_ipd3l")
|
||||
overrides = {}
|
||||
|
||||
[sub_resource type="Resource" id="Resource_6rqr5"]
|
||||
script = ExtResource("1_1na1v")
|
||||
scene = ExtResource("9_sowdg")
|
||||
overrides = {}
|
||||
|
||||
[sub_resource type="Resource" id="Resource_tapfv"]
|
||||
script = ExtResource("1_1na1v")
|
||||
scene = ExtResource("10_yysma")
|
||||
overrides = {}
|
||||
|
||||
[resource]
|
||||
script = ExtResource("10_lggnn")
|
||||
name = "Briefing_Style"
|
||||
layer_list = Array[String](["10", "18", "11", "12", "13", "14", "15", "16", "17"])
|
||||
layer_info = {
|
||||
"": SubResource("Resource_1umci"),
|
||||
"10": SubResource("Resource_k5ph0"),
|
||||
"11": SubResource("Resource_pd24n"),
|
||||
"12": SubResource("Resource_msgpj"),
|
||||
"13": SubResource("Resource_20kch"),
|
||||
"14": SubResource("Resource_7dp66"),
|
||||
"15": SubResource("Resource_63vmy"),
|
||||
"16": SubResource("Resource_disj7"),
|
||||
"17": SubResource("Resource_6rqr5"),
|
||||
"18": SubResource("Resource_tapfv")
|
||||
}
|
||||
base_overrides = {}
|
||||
layers = Array[ExtResource("1_1na1v")]([])
|
||||
metadata/_latest_layer = "18"
|
||||
25
Dialogue/Styles/Layers/Image_Layer/Image/custom_image.tscn
Normal file
25
Dialogue/Styles/Layers/Image_Layer/Image/custom_image.tscn
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://bvoym0jf534us"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ct3rq3r2th80u" path="res://Dialogue/Styles/Layers/Image_Layer/Image/image_layer.gd" id="1_3ircq"]
|
||||
[ext_resource type="Script" uid="uid://hiekbi2rsq1j" path="res://Dialogue/Styles/Layers/Image_Layer/Image/node_image_holder.gd" id="2_3ircq"]
|
||||
|
||||
[node name="ImageLayer" type="Control"]
|
||||
layout_direction = 2
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_3ircq")
|
||||
|
||||
[node name="DialogicNode_ImageHolder" type="ColorRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
color = Color(1, 1, 1, 0)
|
||||
script = ExtResource("2_3ircq")
|
||||
2
Dialogue/Styles/Layers/Image_Layer/Image/image_layer.gd
Normal file
2
Dialogue/Styles/Layers/Image_Layer/Image/image_layer.gd
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
@tool
|
||||
extends DialogicLayoutLayer
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://ct3rq3r2th80u
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
class_name DialogicNode_ImageHolder
|
||||
extends DialogicNode_BackgroundHolder
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
add_to_group('dialogic_image_holders')
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://hiekbi2rsq1j
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
[gd_resource type="Resource" script_class="DialogicStyle" load_steps=20 format=3 uid="uid://b6omw5u7u4f3"]
|
||||
[gd_resource type="Resource" script_class="DialogicStyle" load_steps=21 format=3 uid="uid://b6omw5u7u4f3"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://cqpb3ie51rwl5" path="res://addons/dialogic/Modules/DefaultLayoutParts/Base_Default/default_layout_base.tscn" id="1_1vg82"]
|
||||
[ext_resource type="Script" uid="uid://dh4po8pgey4yv" path="res://addons/dialogic/Resources/dialogic_style_layer.gd" id="1_47mos"]
|
||||
[ext_resource type="PackedScene" uid="uid://c1k5m0w3r40xf" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_FullBackground/full_background_layer.tscn" id="2_obap8"]
|
||||
[ext_resource type="PackedScene" uid="uid://cy1y14inwkplb" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Portraits/vn_portrait_layer.tscn" id="3_kxjow"]
|
||||
|
|
@ -13,6 +14,7 @@
|
|||
|
||||
[sub_resource type="Resource" id="Resource_mqh25"]
|
||||
script = ExtResource("1_47mos")
|
||||
scene = ExtResource("1_1vg82")
|
||||
overrides = {
|
||||
"global_font": "\"res://fonts/Silver.ttf\"",
|
||||
"global_font_size": "19.0"
|
||||
|
|
@ -84,4 +86,4 @@ layer_info = {
|
|||
}
|
||||
base_overrides = {}
|
||||
layers = Array[ExtResource("1_47mos")]([])
|
||||
metadata/_latest_layer = "13"
|
||||
metadata/_latest_layer = "10"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
[style name="VN"]
|
||||
Welcome to the Resistance, Cirno.
|
||||
[background arg="res://Sprites/Briefing/Refinery.png" fade="0.0"]
|
||||
This is your objective
|
||||
[background arg="res://Sprites/UI/TitleBackground.png" fade="0.0"]
|
||||
[style name="Briefing_Style"]
|
||||
join Colonel center [animation="Fade In"]
|
||||
Colonel: Welcome to the Resistance, Cirno.
|
||||
update Colonel left [move_time="0.4"]
|
||||
[image scene="res://Dialogue/CustomScenes/dialogic_windowed_image.tscn" arg="res://Sprites/Briefing/RefinerySmall.png" fade="0.0"]
|
||||
Colonel: This is your objective
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue