├── DialogSystem2 ├── Assets │ ├── AdobeClean-Bold.otf │ ├── AdobeClean-SemiCn.otf │ ├── Clean.tres │ ├── GreenTheme.tres │ ├── GreenThemeOption.tres │ ├── LightTheme.tres │ ├── SourceSerif.tres │ ├── SourceSerif4_18pt-Italic.ttf │ ├── SourceSerif4_18pt-Regular.ttf │ ├── SourceSerif4_18pt-SemiBold.ttf │ ├── dialog_box.png │ ├── dialog_box.png.import │ ├── port.png │ ├── port.png.import │ ├── portrait.png │ └── portrait.png.import ├── ConditionalsStack.gd ├── ConditionalsStack.tscn ├── ConditionalsStacks │ ├── ConditionalsBrowniePoints.tscn │ ├── ConditionalsVar.tscn │ └── ConditionalsVisited.tscn ├── Control.gd ├── DialogBox │ ├── Continue.tscn │ ├── DialogBox.gd │ ├── DialogBox.tscn │ ├── Option.gd │ └── Option.tscn ├── DiceRoll.gd ├── DiceRoll.tscn ├── Feature.gd ├── Feature.tscn ├── Global │ ├── CharacterProfiles.gd │ ├── GameSave.gd │ └── GameSave.tscn ├── Graph.tscn ├── GraphNode.gd ├── GraphNode.tscn ├── JSON_template ├── JSON_template.json ├── Option.tscn ├── OptionNode.gd ├── OptionNode.tscn ├── SaveVar.tscn ├── Test.tscn ├── default_env.tres ├── export_presets.cfg ├── icon.png ├── icon.png.import ├── icon.png.import copy ├── project.godot └── test.gd ├── LICENSE └── README.md /DialogSystem2/Assets/AdobeClean-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amberlim/GodotDialogSystem/310ddfdfa495c15ae8d201e43bbbd3222650db70/DialogSystem2/Assets/AdobeClean-Bold.otf -------------------------------------------------------------------------------- /DialogSystem2/Assets/AdobeClean-SemiCn.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amberlim/GodotDialogSystem/310ddfdfa495c15ae8d201e43bbbd3222650db70/DialogSystem2/Assets/AdobeClean-SemiCn.otf -------------------------------------------------------------------------------- /DialogSystem2/Assets/Clean.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="DynamicFont" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://Assets/AdobeClean-Bold.otf" type="DynamicFontData" id=1] 4 | 5 | [resource] 6 | size = 19 7 | use_mipmaps = true 8 | use_filter = true 9 | extra_spacing_char = 1 10 | font_data = ExtResource( 1 ) 11 | -------------------------------------------------------------------------------- /DialogSystem2/Assets/GreenTheme.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Theme" load_steps=11 format=2] 2 | 3 | [ext_resource path="res://Assets/AdobeClean-SemiCn.otf" type="DynamicFontData" id=1] 4 | [ext_resource path="res://Assets/Clean.tres" type="DynamicFont" id=2] 5 | 6 | [sub_resource type="StyleBoxFlat" id=2] 7 | content_margin_left = 7.0 8 | content_margin_right = 7.0 9 | content_margin_top = 3.0 10 | content_margin_bottom = 3.0 11 | bg_color = Color( 0, 0, 0, 1 ) 12 | corner_radius_top_left = 5 13 | corner_radius_top_right = 5 14 | corner_radius_bottom_right = 5 15 | corner_radius_bottom_left = 5 16 | 17 | [sub_resource type="StyleBoxFlat" id=3] 18 | content_margin_left = 7.0 19 | content_margin_right = 7.0 20 | content_margin_top = 3.0 21 | content_margin_bottom = 3.0 22 | bg_color = Color( 0.113281, 0.113281, 0.113281, 1 ) 23 | corner_radius_top_left = 5 24 | corner_radius_top_right = 5 25 | corner_radius_bottom_right = 5 26 | corner_radius_bottom_left = 5 27 | 28 | [sub_resource type="StyleBoxEmpty" id=4] 29 | 30 | [sub_resource type="StyleBoxFlat" id=9] 31 | content_margin_top = 30.0 32 | bg_color = Color( 0.113725, 0.113725, 0.113725, 0.588235 ) 33 | corner_radius_top_left = 15 34 | corner_radius_top_right = 15 35 | corner_radius_bottom_right = 15 36 | corner_radius_bottom_left = 15 37 | expand_margin_left = 15.0 38 | expand_margin_right = 15.0 39 | expand_margin_top = 15.0 40 | expand_margin_bottom = 15.0 41 | 42 | [sub_resource type="StyleBoxFlat" id=10] 43 | content_margin_top = 30.0 44 | bg_color = Color( 1, 1, 1, 0.909804 ) 45 | corner_radius_top_left = 15 46 | corner_radius_top_right = 15 47 | corner_radius_bottom_right = 15 48 | corner_radius_bottom_left = 15 49 | expand_margin_left = 15.0 50 | expand_margin_right = 15.0 51 | expand_margin_top = 15.0 52 | expand_margin_bottom = 15.0 53 | 54 | [sub_resource type="DynamicFont" id=7] 55 | size = 24 56 | use_mipmaps = true 57 | use_filter = true 58 | extra_spacing_char = 2 59 | font_data = ExtResource( 1 ) 60 | 61 | [sub_resource type="StyleBoxFlat" id=8] 62 | content_margin_left = 12.0 63 | content_margin_right = 12.0 64 | content_margin_top = 12.0 65 | content_margin_bottom = 12.0 66 | bg_color = Color( 0.117647, 0.117647, 0.117647, 1 ) 67 | corner_radius_top_left = 8 68 | corner_radius_top_right = 8 69 | corner_radius_bottom_right = 8 70 | corner_radius_bottom_left = 8 71 | 72 | [sub_resource type="StyleBoxFlat" id=11] 73 | content_margin_left = 12.0 74 | content_margin_right = 12.0 75 | content_margin_top = 12.0 76 | content_margin_bottom = 12.0 77 | bg_color = Color( 0.113725, 0.113725, 0.113725, 1 ) 78 | corner_radius_top_left = 15 79 | corner_radius_top_right = 15 80 | corner_radius_bottom_right = 15 81 | corner_radius_bottom_left = 15 82 | 83 | [resource] 84 | default_font = ExtResource( 2 ) 85 | Button/colors/font_color = Color( 0.356863, 0.721569, 0.345098, 1 ) 86 | Button/colors/font_color_disabled = Color( 1, 1, 1, 0.305882 ) 87 | Button/colors/font_color_focus = Color( 0.0313726, 1, 0, 1 ) 88 | Button/colors/font_color_hover = Color( 0.0313726, 1, 0, 1 ) 89 | Button/colors/font_color_pressed = Color( 0.0313726, 1, 0, 1 ) 90 | Button/constants/hseparation = 2 91 | Button/fonts/font = ExtResource( 2 ) 92 | Button/styles/disabled = null 93 | Button/styles/focus = SubResource( 2 ) 94 | Button/styles/hover = SubResource( 2 ) 95 | Button/styles/normal = SubResource( 3 ) 96 | Button/styles/pressed = SubResource( 2 ) 97 | CheckBox/constants/hseparation = 20 98 | CheckBox/styles/normal = SubResource( 4 ) 99 | GraphNode/constants/port_offset = -17 100 | GraphNode/styles/frame = SubResource( 9 ) 101 | GraphNode/styles/selectedframe = SubResource( 10 ) 102 | Label/colors/font_color = Color( 0.356863, 0.721569, 0.345098, 1 ) 103 | Label/fonts/font = null 104 | LineEdit/fonts/font = SubResource( 7 ) 105 | LineEdit/styles/normal = SubResource( 8 ) 106 | TextEdit/colors/font_color = Color( 0.88, 0.88, 0.88, 1 ) 107 | TextEdit/fonts/font = null 108 | TextEdit/styles/normal = SubResource( 11 ) 109 | -------------------------------------------------------------------------------- /DialogSystem2/Assets/GreenThemeOption.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Theme" load_steps=11 format=2] 2 | 3 | [ext_resource path="res://Assets/AdobeClean-SemiCn.otf" type="DynamicFontData" id=1] 4 | [ext_resource path="res://Assets/Clean.tres" type="DynamicFont" id=2] 5 | 6 | [sub_resource type="StyleBoxFlat" id=2] 7 | content_margin_left = 7.0 8 | content_margin_right = 7.0 9 | content_margin_top = 3.0 10 | content_margin_bottom = 3.0 11 | bg_color = Color( 0, 0, 0, 1 ) 12 | corner_radius_top_left = 5 13 | corner_radius_top_right = 5 14 | corner_radius_bottom_right = 5 15 | corner_radius_bottom_left = 5 16 | 17 | [sub_resource type="StyleBoxFlat" id=3] 18 | content_margin_left = 7.0 19 | content_margin_right = 7.0 20 | content_margin_top = 3.0 21 | content_margin_bottom = 3.0 22 | bg_color = Color( 0.113281, 0.113281, 0.113281, 1 ) 23 | corner_radius_top_left = 5 24 | corner_radius_top_right = 5 25 | corner_radius_bottom_right = 5 26 | corner_radius_bottom_left = 5 27 | 28 | [sub_resource type="StyleBoxEmpty" id=4] 29 | 30 | [sub_resource type="StyleBoxFlat" id=15] 31 | content_margin_top = 30.0 32 | bg_color = Color( 0.113725, 0.113725, 0.113725, 0.588235 ) 33 | border_width_top = 1 34 | border_color = Color( 0.0313726, 1, 0, 1 ) 35 | corner_radius_top_left = 10 36 | corner_radius_top_right = 10 37 | corner_radius_bottom_right = 10 38 | corner_radius_bottom_left = 10 39 | expand_margin_left = 15.0 40 | expand_margin_right = 15.0 41 | expand_margin_top = 15.0 42 | expand_margin_bottom = 15.0 43 | 44 | [sub_resource type="StyleBoxFlat" id=14] 45 | content_margin_top = 30.0 46 | bg_color = Color( 0.0313726, 1, 0, 0.0666667 ) 47 | border_width_left = 2 48 | border_width_top = 2 49 | border_width_right = 2 50 | border_width_bottom = 2 51 | border_color = Color( 0.0313726, 1, 0, 1 ) 52 | corner_radius_top_left = 15 53 | corner_radius_top_right = 15 54 | corner_radius_bottom_right = 15 55 | corner_radius_bottom_left = 15 56 | expand_margin_left = 15.0 57 | expand_margin_right = 15.0 58 | expand_margin_top = 15.0 59 | expand_margin_bottom = 15.0 60 | 61 | [sub_resource type="DynamicFont" id=7] 62 | size = 24 63 | use_mipmaps = true 64 | use_filter = true 65 | extra_spacing_char = 2 66 | font_data = ExtResource( 1 ) 67 | 68 | [sub_resource type="StyleBoxFlat" id=8] 69 | content_margin_left = 12.0 70 | content_margin_right = 12.0 71 | content_margin_top = 12.0 72 | content_margin_bottom = 12.0 73 | bg_color = Color( 0.117647, 0.117647, 0.117647, 1 ) 74 | corner_radius_top_left = 8 75 | corner_radius_top_right = 8 76 | corner_radius_bottom_right = 8 77 | corner_radius_bottom_left = 8 78 | 79 | [sub_resource type="StyleBoxFlat" id=11] 80 | content_margin_left = 12.0 81 | content_margin_right = 12.0 82 | content_margin_top = 12.0 83 | content_margin_bottom = 12.0 84 | bg_color = Color( 0.113725, 0.113725, 0.113725, 1 ) 85 | corner_radius_top_left = 15 86 | corner_radius_top_right = 15 87 | corner_radius_bottom_right = 15 88 | corner_radius_bottom_left = 15 89 | 90 | [resource] 91 | default_font = ExtResource( 2 ) 92 | Button/colors/font_color = Color( 0.356863, 0.721569, 0.345098, 1 ) 93 | Button/colors/font_color_disabled = Color( 1, 1, 1, 0.305882 ) 94 | Button/colors/font_color_focus = Color( 0.0313726, 1, 0, 1 ) 95 | Button/colors/font_color_hover = Color( 0.0313726, 1, 0, 1 ) 96 | Button/colors/font_color_pressed = Color( 0.0313726, 1, 0, 1 ) 97 | Button/constants/hseparation = 2 98 | Button/fonts/font = ExtResource( 2 ) 99 | Button/styles/disabled = null 100 | Button/styles/focus = SubResource( 2 ) 101 | Button/styles/hover = SubResource( 2 ) 102 | Button/styles/normal = SubResource( 3 ) 103 | Button/styles/pressed = SubResource( 2 ) 104 | CheckBox/constants/hseparation = 20 105 | CheckBox/styles/normal = SubResource( 4 ) 106 | GraphNode/constants/port_offset = -17 107 | GraphNode/styles/frame = SubResource( 15 ) 108 | GraphNode/styles/selectedframe = SubResource( 14 ) 109 | Label/colors/font_color = Color( 0.356863, 0.721569, 0.345098, 1 ) 110 | Label/fonts/font = null 111 | LineEdit/fonts/font = SubResource( 7 ) 112 | LineEdit/styles/normal = SubResource( 8 ) 113 | TextEdit/colors/font_color = Color( 0.88, 0.88, 0.88, 1 ) 114 | TextEdit/fonts/font = null 115 | TextEdit/styles/normal = SubResource( 11 ) 116 | -------------------------------------------------------------------------------- /DialogSystem2/Assets/LightTheme.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Theme" load_steps=12 format=2] 2 | 3 | [ext_resource path="res://Assets/AdobeClean-SemiCn.otf" type="DynamicFontData" id=1] 4 | [ext_resource path="res://Assets/Clean.tres" type="DynamicFont" id=2] 5 | [ext_resource path="res://Assets/port.png" type="Texture" id=3] 6 | 7 | [sub_resource type="StyleBoxFlat" id=12] 8 | content_margin_left = 10.0 9 | content_margin_right = 10.0 10 | bg_color = Color( 0.639216, 0.258824, 0.0823529, 0.380392 ) 11 | border_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 12 | corner_radius_top_left = 4 13 | corner_radius_top_right = 4 14 | corner_radius_bottom_right = 4 15 | corner_radius_bottom_left = 4 16 | 17 | [sub_resource type="StyleBoxFlat" id=13] 18 | content_margin_left = 10.0 19 | content_margin_right = 10.0 20 | bg_color = Color( 0.639216, 0.258824, 0.0823529, 0.0941176 ) 21 | border_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 22 | corner_radius_top_left = 4 23 | corner_radius_top_right = 4 24 | corner_radius_bottom_right = 4 25 | corner_radius_bottom_left = 4 26 | 27 | [sub_resource type="StyleBoxFlat" id=14] 28 | bg_color = Color( 0.796078, 0.784314, 0.741176, 1 ) 29 | 30 | [sub_resource type="StyleBoxFlat" id=16] 31 | content_margin_top = 30.0 32 | bg_color = Color( 1, 1, 1, 0.270588 ) 33 | expand_margin_left = 15.0 34 | expand_margin_right = 15.0 35 | expand_margin_top = 15.0 36 | expand_margin_bottom = 15.0 37 | 38 | [sub_resource type="StyleBoxFlat" id=15] 39 | content_margin_top = 30.0 40 | bg_color = Color( 1, 1, 1, 0.403922 ) 41 | border_width_left = 3 42 | border_width_top = 3 43 | border_width_right = 3 44 | border_width_bottom = 3 45 | border_color = Color( 1, 1, 1, 1 ) 46 | corner_radius_top_left = 3 47 | corner_radius_top_right = 3 48 | corner_radius_bottom_right = 3 49 | corner_radius_bottom_left = 3 50 | expand_margin_left = 15.0 51 | expand_margin_right = 15.0 52 | expand_margin_top = 15.0 53 | expand_margin_bottom = 15.0 54 | 55 | [sub_resource type="DynamicFont" id=7] 56 | size = 24 57 | use_mipmaps = true 58 | use_filter = true 59 | extra_spacing_char = 2 60 | font_data = ExtResource( 1 ) 61 | 62 | [sub_resource type="StyleBoxFlat" id=8] 63 | content_margin_left = 12.0 64 | content_margin_right = 12.0 65 | content_margin_top = 12.0 66 | content_margin_bottom = 12.0 67 | bg_color = Color( 0.796078, 0.784314, 0.741176, 1 ) 68 | 69 | [sub_resource type="StyleBoxFlat" id=11] 70 | content_margin_left = 12.0 71 | content_margin_right = 12.0 72 | content_margin_top = 12.0 73 | content_margin_bottom = 12.0 74 | bg_color = Color( 0.796078, 0.784314, 0.741176, 1 ) 75 | corner_radius_top_left = 6 76 | corner_radius_top_right = 6 77 | corner_radius_bottom_right = 6 78 | corner_radius_bottom_left = 6 79 | 80 | [resource] 81 | default_font = ExtResource( 2 ) 82 | Button/colors/font_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 83 | Button/constants/hseparation = 2 84 | Button/fonts/font = ExtResource( 2 ) 85 | Button/styles/focus = SubResource( 12 ) 86 | Button/styles/hover = SubResource( 12 ) 87 | Button/styles/normal = SubResource( 13 ) 88 | Button/styles/pressed = SubResource( 12 ) 89 | CheckBox/constants/hseparation = 20 90 | GraphEdit/styles/bg = SubResource( 14 ) 91 | GraphNode/constants/port_offset = -17 92 | GraphNode/icons/port = ExtResource( 3 ) 93 | GraphNode/styles/frame = SubResource( 16 ) 94 | GraphNode/styles/selectedframe = SubResource( 15 ) 95 | Label/colors/font_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 96 | Label/fonts/font = null 97 | LineEdit/colors/font_color = Color( 0, 0, 0, 1 ) 98 | LineEdit/fonts/font = SubResource( 7 ) 99 | LineEdit/styles/normal = SubResource( 8 ) 100 | TextEdit/colors/font_color = Color( 0, 0, 0, 1 ) 101 | TextEdit/fonts/font = null 102 | TextEdit/styles/normal = SubResource( 11 ) 103 | -------------------------------------------------------------------------------- /DialogSystem2/Assets/SourceSerif.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="DynamicFont" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://Assets/SourceSerif4_18pt-Italic.ttf" type="DynamicFontData" id=1] 4 | 5 | [resource] 6 | size = 26 7 | use_mipmaps = true 8 | use_filter = true 9 | extra_spacing_top = 10 10 | font_data = ExtResource( 1 ) 11 | -------------------------------------------------------------------------------- /DialogSystem2/Assets/SourceSerif4_18pt-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amberlim/GodotDialogSystem/310ddfdfa495c15ae8d201e43bbbd3222650db70/DialogSystem2/Assets/SourceSerif4_18pt-Italic.ttf -------------------------------------------------------------------------------- /DialogSystem2/Assets/SourceSerif4_18pt-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amberlim/GodotDialogSystem/310ddfdfa495c15ae8d201e43bbbd3222650db70/DialogSystem2/Assets/SourceSerif4_18pt-Regular.ttf -------------------------------------------------------------------------------- /DialogSystem2/Assets/SourceSerif4_18pt-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amberlim/GodotDialogSystem/310ddfdfa495c15ae8d201e43bbbd3222650db70/DialogSystem2/Assets/SourceSerif4_18pt-SemiBold.ttf -------------------------------------------------------------------------------- /DialogSystem2/Assets/dialog_box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amberlim/GodotDialogSystem/310ddfdfa495c15ae8d201e43bbbd3222650db70/DialogSystem2/Assets/dialog_box.png -------------------------------------------------------------------------------- /DialogSystem2/Assets/dialog_box.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/dialog_box.png-56d224106c5820b44575d07327da51e0.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Assets/dialog_box.png" 13 | dest_files=[ "res://.import/dialog_box.png-56d224106c5820b44575d07327da51e0.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /DialogSystem2/Assets/port.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amberlim/GodotDialogSystem/310ddfdfa495c15ae8d201e43bbbd3222650db70/DialogSystem2/Assets/port.png -------------------------------------------------------------------------------- /DialogSystem2/Assets/port.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/port.png-2f436e7dca5b6f48f25c8448dcea5f85.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Assets/port.png" 13 | dest_files=[ "res://.import/port.png-2f436e7dca5b6f48f25c8448dcea5f85.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /DialogSystem2/Assets/portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amberlim/GodotDialogSystem/310ddfdfa495c15ae8d201e43bbbd3222650db70/DialogSystem2/Assets/portrait.png -------------------------------------------------------------------------------- /DialogSystem2/Assets/portrait.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/portrait.png-17b4ae06e5d7ecbbe0f441b315e1678a.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Assets/portrait.png" 13 | dest_files=[ "res://.import/portrait.png-17b4ae06e5d7ecbbe0f441b315e1678a.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /DialogSystem2/ConditionalsStack.gd: -------------------------------------------------------------------------------- 1 | extends VBoxContainer 2 | 3 | export(NodePath) onready var skill = get_node(skill) as HBoxContainer 4 | export(NodePath) onready var stack_index = get_node(stack_index) as Label 5 | 6 | var variable_count = 0 7 | var brownie_count = 0 8 | var visited_count = 0 9 | var selected_conditional 10 | 11 | var conditionals_var = [] 12 | var conditionals_brownie = [] 13 | var conditionals_visited = [] 14 | 15 | func _on_Conditionals_item_selected(index): 16 | selected_conditional = index 17 | 18 | func _on_Button_pressed(): 19 | if selected_conditional == 0: #skill 20 | skill.visible = true 21 | elif selected_conditional == 1: #global var 22 | var new_var = load("res://ConditionalsStacks/ConditionalsVar.tscn") 23 | new_var = new_var.instance() 24 | add_child(new_var) 25 | new_var.name = "NewVar" + str(variable_count) 26 | variable_count += 1 27 | conditionals_var.append(new_var.name) 28 | # print("Variables: " + str(variable_count)) 29 | elif selected_conditional == 2: #visited 30 | var new_visited = load("res://ConditionalsStacks/ConditionalsVisited.tscn") 31 | new_visited = new_visited.instance() 32 | add_child(new_visited) 33 | new_visited.name = "NewVisited" + str(visited_count) 34 | visited_count += 1 35 | conditionals_visited.append(new_visited.name) 36 | # print("Visited: " + str(visited_count)) 37 | elif selected_conditional == 3: #brownie 38 | var new_brownie = load("res://ConditionalsStacks/ConditionalsBrowniePoints.tscn") 39 | new_brownie = new_brownie.instance() 40 | add_child(new_brownie) 41 | new_brownie.name = "NewBrownie" + str(brownie_count) 42 | brownie_count += 1 43 | # print("Brownie NPCs: " + str(brownie_count)) 44 | -------------------------------------------------------------------------------- /DialogSystem2/ConditionalsStack.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://ConditionalsStack.gd" type="Script" id=1] 4 | 5 | [node name="ConditionalsStack" type="VBoxContainer"] 6 | anchor_right = 1.0 7 | anchor_bottom = 1.0 8 | margin_right = -731.0 9 | margin_bottom = -406.0 10 | custom_constants/separation = 10 11 | script = ExtResource( 1 ) 12 | skill = NodePath("ConditionalsSkill") 13 | stack_index = NodePath("HBoxContainer/Label") 14 | 15 | [node name="Label" type="Label" parent="."] 16 | margin_right = 1189.0 17 | margin_bottom = 14.0 18 | text = "_________________________________________________" 19 | clip_text = true 20 | 21 | [node name="HBoxContainer" type="HBoxContainer" parent="."] 22 | margin_top = 24.0 23 | margin_right = 1189.0 24 | margin_bottom = 44.0 25 | custom_constants/separation = 10 26 | 27 | [node name="Label" type="Label" parent="HBoxContainer"] 28 | margin_top = 3.0 29 | margin_right = 12.0 30 | margin_bottom = 17.0 31 | custom_colors/font_color = Color( 1, 0.290196, 0.290196, 1 ) 32 | text = "IF" 33 | 34 | [node name="Conditionals" type="OptionButton" parent="HBoxContainer"] 35 | margin_left = 22.0 36 | margin_right = 51.0 37 | margin_bottom = 20.0 38 | toggle_mode = false 39 | align = 1 40 | items = [ "Skills", null, false, 0, null, "Global Variables", null, false, 1, null, "Visited", null, false, 2, null, "NPC Brownie Points", null, false, 5, null ] 41 | selected = 0 42 | 43 | [node name="Button" type="Button" parent="HBoxContainer"] 44 | margin_left = 61.0 45 | margin_right = 81.0 46 | margin_bottom = 20.0 47 | text = "+" 48 | 49 | [node name="ConditionalsSkill" type="HBoxContainer" parent="."] 50 | visible = false 51 | margin_top = 54.0 52 | margin_right = 1189.0 53 | margin_bottom = 78.0 54 | custom_constants/separation = 13 55 | 56 | [node name="Skills" type="Label" parent="ConditionalsSkill"] 57 | margin_top = 5.0 58 | margin_right = 49.0 59 | margin_bottom = 19.0 60 | text = "IF Skills" 61 | 62 | [node name="HBoxContainer" type="HBoxContainer" parent="ConditionalsSkill"] 63 | margin_left = 62.0 64 | margin_right = 259.0 65 | margin_bottom = 24.0 66 | 67 | [node name="SkillOption" type="OptionButton" parent="ConditionalsSkill/HBoxContainer"] 68 | margin_right = 83.0 69 | margin_bottom = 24.0 70 | text = "Intellect" 71 | items = [ "Intellect", null, false, 0, null, "Charisma", null, false, 1, null, "Endurance", null, false, 2, null, "Dexterity", null, false, 3, null ] 72 | selected = 0 73 | 74 | [node name="SkillPoints" type="LineEdit" parent="ConditionalsSkill/HBoxContainer"] 75 | margin_left = 87.0 76 | margin_right = 197.0 77 | margin_bottom = 24.0 78 | rect_min_size = Vector2( 110, 0 ) 79 | placeholder_text = "<=> int" 80 | 81 | [connection signal="item_selected" from="HBoxContainer/Conditionals" to="." method="_on_Conditionals_item_selected"] 82 | [connection signal="pressed" from="HBoxContainer/Button" to="." method="_on_Button_pressed"] 83 | -------------------------------------------------------------------------------- /DialogSystem2/ConditionalsStacks/ConditionalsBrowniePoints.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene format=2] 2 | 3 | [node name="ConditionalsBrowniePoints" type="HBoxContainer" groups=["conditionals_brownie"]] 4 | margin_top = 98.0 5 | margin_right = 293.0 6 | margin_bottom = 122.0 7 | custom_constants/separation = 13 8 | 9 | [node name="BrowniePoints" type="Label" parent="."] 10 | margin_top = 5.0 11 | margin_right = 112.0 12 | margin_bottom = 19.0 13 | text = "IF Brownie Points" 14 | 15 | [node name="HBoxContainer" type="HBoxContainer" parent="."] 16 | margin_left = 125.0 17 | margin_right = 271.0 18 | margin_bottom = 24.0 19 | 20 | [node name="NPC" type="OptionButton" parent="HBoxContainer"] 21 | margin_right = 68.0 22 | margin_bottom = 24.0 23 | text = "Mable" 24 | items = [ "Mable", null, false, 0, null, "Letty", null, false, 1, null ] 25 | selected = 0 26 | 27 | [node name="BrowniePoints" type="SpinBox" parent="HBoxContainer"] 28 | margin_left = 72.0 29 | margin_right = 146.0 30 | margin_bottom = 24.0 31 | allow_lesser = true 32 | -------------------------------------------------------------------------------- /DialogSystem2/ConditionalsStacks/ConditionalsVar.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene format=2] 2 | 3 | [node name="ConditionalsVar" type="HBoxContainer"] 4 | margin_top = 64.0 5 | margin_right = 293.0 6 | margin_bottom = 104.0 7 | custom_constants/separation = 13 8 | 9 | [node name="Var" type="Label" parent="."] 10 | margin_top = 13.0 11 | margin_right = 40.0 12 | margin_bottom = 27.0 13 | text = "IF Var " 14 | 15 | [node name="HBoxContainer" type="HBoxContainer" parent="."] 16 | margin_left = 53.0 17 | margin_right = 243.0 18 | margin_bottom = 40.0 19 | 20 | [node name="GlobalVar" type="LineEdit" parent="HBoxContainer"] 21 | margin_right = 110.0 22 | margin_bottom = 40.0 23 | rect_min_size = Vector2( 110, 0 ) 24 | placeholder_text = "Global Var" 25 | caret_blink = true 26 | caret_blink_speed = 0.5 27 | 28 | [node name="CheckButton" type="CheckButton" parent="HBoxContainer"] 29 | margin_left = 114.0 30 | margin_right = 190.0 31 | margin_bottom = 40.0 32 | -------------------------------------------------------------------------------- /DialogSystem2/ConditionalsStacks/ConditionalsVisited.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene format=2] 2 | 3 | [node name="ConditionalsVisited" type="HBoxContainer" groups=["conditionals_visited"]] 4 | margin_top = 64.0 5 | margin_right = 295.0 6 | margin_bottom = 88.0 7 | custom_constants/separation = 13 8 | 9 | [node name="Visited" type="Label" parent="."] 10 | margin_top = 5.0 11 | margin_right = 60.0 12 | margin_bottom = 19.0 13 | text = "IF Visited" 14 | 15 | [node name="HBoxContainer" type="HBoxContainer" parent="."] 16 | margin_left = 73.0 17 | margin_right = 293.0 18 | margin_bottom = 24.0 19 | rect_min_size = Vector2( 200, 0 ) 20 | custom_constants/separation = 20 21 | 22 | [node name="VisitedNode" type="SpinBox" parent="HBoxContainer"] 23 | margin_right = 100.0 24 | margin_bottom = 24.0 25 | rect_min_size = Vector2( 100, 0 ) 26 | prefix = "Node" 27 | 28 | [node name="VisitedIndex" type="SpinBox" parent="HBoxContainer"] 29 | margin_left = 120.0 30 | margin_right = 220.0 31 | margin_bottom = 24.0 32 | rect_min_size = Vector2( 100, 0 ) 33 | suffix = "times" 34 | -------------------------------------------------------------------------------- /DialogSystem2/Control.gd: -------------------------------------------------------------------------------- 1 | extends Control 2 | 3 | var dialog = {} 4 | var dialog_for_localisation = [] 5 | 6 | export(String) onready var file_path 7 | 8 | var initial_pos = Vector2(40,40) 9 | onready var graph_edit = $GraphEdit 10 | onready var timer = $Timer 11 | 12 | onready var node_count = $NodeCount 13 | onready var option_count = $OptionCount 14 | var option_index = 0 15 | var node_index = 0 16 | var all_nodes_index = 0 17 | 18 | func _ready(): 19 | if not file_path.empty(): 20 | load_save() 21 | 22 | 23 | 24 | # ADD NEW NODE 25 | func _on_Button_pressed(): 26 | 27 | # update node count 28 | all_nodes_index += 1 29 | node_index += 1 30 | node_count.text = "Node Count: " + str(node_index) 31 | 32 | # instance node 33 | var node = load("res://GraphNode.tscn") 34 | node = node.instance() 35 | graph_edit.add_child(node) 36 | 37 | # graph offset 38 | # node.offset += initial_pos + (node_index * Vector2(5,5)) 39 | node.offset = get_global_mouse_position() 40 | initial_pos = node.offset 41 | 42 | # autosave everytime a new node is instanced 43 | # _on_RunProgram_pressed(0) 44 | 45 | # SAVE 46 | func _on_RunProgram_pressed(): 47 | 48 | # extract data from nodes 49 | # for node in range(0, connection_list.size()): 50 | for node in get_tree().get_nodes_in_group("graph_nodes"): 51 | 52 | var dialog_template = {} 53 | var localise_dialog = {} 54 | 55 | # name the node 56 | dialog[node.title] = dialog_template 57 | dialog_template["id"] = node.title 58 | 59 | # offset 60 | dialog_template["offset x"] = node.offset.x 61 | dialog_template["offset y"] = node.offset.y 62 | 63 | # go to 64 | dialog_template["go to"] = [] 65 | for connection in graph_edit.get_connection_list(): 66 | if connection["from"] == node.name: 67 | dialog_template["go to"].append(connection["to"]) 68 | 69 | # dice roll 70 | if node.node_type == "Dice Roll": 71 | 72 | dialog_template["node type"] = node.node_type 73 | dialog_template["dice skill"] = node.skill.text 74 | dialog_template["dice target"] = node.target_number.value 75 | 76 | # BREAKDOWN of connections 77 | # ["from"] = node.name # from current node 78 | # ["from port"] = option_count # from current option port 79 | # ["to"] = data[node_index]["go to"][option_count - 1] # connect to node 80 | # ["to port"] = 0 # connect to text port 81 | 82 | elif node.node_type == "Feature": 83 | # money 84 | if node.money.visible: 85 | dialog_template["money"] = node.money.get_node("Spinbox").value 86 | 87 | if node.end.visible: 88 | dialog_template["emit signal"] = "dialog_end" 89 | 90 | # save global variables 91 | if node.save_var.visible: 92 | for save_var in node.save_var_list: 93 | save_var = node.main.get_node(save_var) 94 | var variable_in_question = save_var.get_node("LineEdit").text 95 | 96 | # record purposes 97 | dialog_template[variable_in_question] = save_var.get_node("CheckButton").pressed 98 | 99 | # auto save variables to game save 100 | GameSave.variables[variable_in_question] = save_var.get_node("CheckButton").pressed 101 | 102 | # save game 103 | 104 | if node.task.visible: 105 | # record purposes 106 | dialog_template["task"] = node.task.get_node("LineEdit").text 107 | if node.skills.visible: 108 | dialog_template["skill lvl up"] = {} 109 | var dict_key = node.skills.get_node("HBoxContainer/SkillOption").text 110 | var dict_value = node.skills.get_node("HBoxContainer/SkillUpgrade").value 111 | 112 | dialog_template["skill lvl up"][dict_key] = dict_value 113 | 114 | if node.signal_emit.visible: 115 | dialog_template["emit signal"] = node.signal_emit.get_node("LineEdit").text 116 | 117 | elif node.node_type == "Option": 118 | dialog_template["node type"] = node.node_type 119 | 120 | # dialog text 121 | var option_text = node.get_node("HBoxContainer/MainColumn/Text/TextEdit").text 122 | 123 | if option_text != "": 124 | dialog_template["text"] = option_text 125 | 126 | else: 127 | 128 | dialog_template["character"] = node.character.get_node("CharacterDrop").text 129 | 130 | if node.display_name.visible: 131 | dialog_template["display name"] = node.display_name.get_node("LineEdit").text 132 | 133 | if node.line_asset.visible: 134 | dialog_template["line asset"] = node.line_asset.get_node("LineEdit").text 135 | 136 | # dialog text 137 | var dialog_text = node.get_node("HBoxContainer/MainColumn/Text/TextEdit").text 138 | 139 | if dialog_text != "": 140 | dialog_template["text"] = dialog_text 141 | 142 | # print(dialog_text) #for localisation 143 | 144 | # conditionals 145 | if node.stack_count > 0 : 146 | dialog_template["conditionals"] = [] 147 | 148 | for if_stack in node.conditionals_list: # loop through all stacks 149 | var stack = node.main.get_node(if_stack) 150 | var one_stack = {} # save each stack data as dictionary 151 | 152 | # if conditional variables exist 153 | if stack.variable_count > 0: 154 | var if_var_stack = {} 155 | var var_count = 0 156 | 157 | for var_stack in stack.conditionals_var: # for each variable 158 | var_stack = stack.get_node(var_stack) 159 | 160 | if_var_stack[var_stack.get_node("HBoxContainer/GlobalVar").text] = var_stack.get_node("HBoxContainer/CheckButton").pressed 161 | 162 | var_count += 1 163 | 164 | one_stack["if var"] = if_var_stack 165 | 166 | 167 | # skills 168 | var conditionals_skills = stack.get_node("ConditionalsSkill") 169 | if conditionals_skills.visible: 170 | one_stack["if skill"] = {} 171 | var if_skill_stack = {} 172 | 173 | if_skill_stack[conditionals_skills.get_node("HBoxContainer/SkillOption").text] = conditionals_skills.get_node("HBoxContainer/SkillPoints").text 174 | 175 | one_stack["if skill"] = if_skill_stack 176 | 177 | # if visited 178 | if stack.visited_count > 0: 179 | var if_visited_stack = {} 180 | 181 | for visited_stack in stack.conditionals_visited: # for each variable 182 | visited_stack = stack.get_node(visited_stack) 183 | 184 | if_visited_stack[visited_stack.get_node("HBoxContainer/VisitedNode").value] = visited_stack.get_node("HBoxContainer/VisitedIndex").value 185 | 186 | one_stack["if visited"] = if_visited_stack 187 | 188 | 189 | # brownie 190 | if stack.brownie_count > 0: 191 | var if_brownie_stack = {} 192 | 193 | for brownie_stack in stack.conditionals_brownie: 194 | brownie_stack = stack.geT_node(brownie_stack) 195 | 196 | if_brownie_stack[brownie_stack.get_node("HBoxContainer/NPC").text] = [brownie_stack.get_node("HBoxContainer/BrowniePoints").value] 197 | 198 | one_stack["if brownie"] = if_brownie_stack 199 | 200 | # append one stack as a dictionary 201 | dialog_template["conditionals"].append(one_stack) 202 | 203 | # go to 204 | dialog_template["go to"] = [] 205 | for connection in graph_edit.get_connection_list(): 206 | if connection["from"] == node.name: 207 | dialog_template["go to"].append(connection["to"]) 208 | 209 | # append to dictionary 210 | dialog[node.title] = dialog_template 211 | 212 | # save node and option count 213 | dialog["all_nodes_index"] = all_nodes_index 214 | dialog["option_index"] = option_index 215 | dialog["node_index"] = node_index 216 | 217 | var time = OS.get_datetime() 218 | var year = str(time["year"]) 219 | var month = str(time["month"]) 220 | var day = str(time["day"]) 221 | var hour = str(time["hour"]) 222 | var minute = str(time["minute"]) 223 | var file_path = day + "." + month + "." + year + "_" + hour + minute 224 | 225 | save_dialog(file_path) 226 | 227 | func save_dialog(file_path): 228 | # save file 229 | var file = File.new() 230 | file_path = "user://" + file_path 231 | file.open(file_path, File.WRITE) 232 | file.store_line(to_json(dialog)) 233 | file.close() 234 | 235 | $HBoxContainer/Notification.visible = true 236 | timer.start() 237 | yield(timer, "timeout") 238 | $HBoxContainer/Notification.visible = false 239 | 240 | 241 | 242 | func load_save(): 243 | var file = File.new() 244 | 245 | if not file.file_exists("user://" + file_path): 246 | save_dialog(file_path) 247 | OS.alert("New file is created.") 248 | return 249 | 250 | file.open("user://" + file_path, File.READ) 251 | var data = file.get_as_text() 252 | data = parse_json(data) 253 | file.close() 254 | 255 | # load node and option count 256 | all_nodes_index = data["all_nodes_index"] 257 | option_index = data["option_index"] 258 | node_index = data["node_index"] 259 | 260 | option_count.text = "Option Count: " + str(option_index) 261 | node_count.text = "Node Count: " + str(node_index) 262 | 263 | for graph_node in data: 264 | 265 | # ignore index counts 266 | if not "index" in graph_node: 267 | 268 | var node 269 | 270 | if "OPTION" in graph_node: 271 | print("OPTION") 272 | # instance node 273 | node = load("res://OptionNode.tscn") 274 | node = node.instance() 275 | graph_edit.add_child(node) 276 | 277 | if "dice skill" in graph_node: node.dice.get_node("SkillOption").text = data[graph_node]["dice skill"] 278 | 279 | if "text" in data[graph_node]: 280 | node._on_Text_toggled(true) 281 | node.text.get_node("TextEdit").text = data[graph_node]["text"] 282 | 283 | elif "DICEROLL" in graph_node: 284 | print("DICEROLL") 285 | node = load("res://DiceRoll.tscn") 286 | node = node.instance() 287 | graph_edit.add_child(node) 288 | 289 | node.skill.text = data[graph_node]["dice skill"] 290 | node.target_number.value = data[graph_node]["dice target"] 291 | 292 | elif "FEATURE" in graph_node: 293 | print("FEATURE") 294 | # instance node 295 | node = load("res://Feature.tscn") 296 | node = node.instance() 297 | graph_edit.add_child(node) 298 | 299 | if "save var" in data[graph_node]: 300 | node._on_SaveVar_toggled(true) 301 | var save_var_count = data[node_index]["save var"].size() 302 | var var_count = 0 303 | for variable in data[node_index]["save var"]: 304 | if var_count == 0: 305 | 306 | node.emit_signal("toggled", true) 307 | # get key as string 308 | var key_name = data[node_index]["save var"].keys() 309 | key_name = key_name[var_count] 310 | 311 | node.save_var.get_node("LineEdit").text = key_name 312 | 313 | node.save_var.get_node("CheckButton").pressed = data[node_index]["save var"][key_name] 314 | 315 | else: 316 | node._on_new_save_var_button_pressed() 317 | var new_var = node.main.get_node("SaveVar" + str(var_count)) 318 | 319 | # get key as string 320 | var key_name = data[node_index]["save var"].keys() 321 | key_name = key_name[var_count] 322 | 323 | new_var.get_node("LineEdit").text = key_name 324 | new_var.get_node("CheckButton").pressed = data[node_index]["save var"][key_name] 325 | 326 | var_count += 1 327 | 328 | if "money" in data[graph_node]: 329 | node._on_Money_toggled(true) 330 | node.money.get_node("Spinbox").value = data[graph_node]["money"] 331 | 332 | if "task" in data[graph_node]: 333 | node._on_Task_toggled(true) 334 | node.task.get_node("LineEdit").text = data[graph_node]["task"] 335 | 336 | if "emit signal" in data[graph_node]: 337 | if data[graph_node]["emit signal"] == "dialog_end": 338 | node._on_End_toggled(true) 339 | else: 340 | node._on_EmitSignal_toggled(true) 341 | node.signal_emit.get_node("LineEdit").text = data[graph_node]["emit signal"] 342 | 343 | if "skill lvl up" in data[graph_node]: 344 | node._on_Skills_toggled(true) 345 | var skill_option = node.skills.get_node("HBoxContainer").get_node("SkillOption") 346 | var skill_upgrade = node.skills.get_node("HBoxContainer").get_node("SkillUpgrade") 347 | 348 | var skill_key = data[graph_node]["skill lvl up"].keys() 349 | skill_option.text = skill_key[0] 350 | skill_upgrade.value = int(data[graph_node]["skill lvl up"][skill_key[0]]) 351 | 352 | elif "NODE" in graph_node: 353 | print("NODE" + graph_node) 354 | # instance node 355 | node = load("res://GraphNode.tscn") 356 | node = node.instance() 357 | graph_edit.add_child(node) 358 | 359 | 360 | node.character.get_node("CharacterDrop").text = data[graph_node]["character"] 361 | 362 | if "display name" in data[graph_node]: 363 | node._on_DisplayName_toggled(true) 364 | node.display_name.get_node("LineEdit").text = data[graph_node]["display name"] 365 | 366 | 367 | if "line asset" in data[graph_node]: 368 | node._on_LineAsset_toggled(true) 369 | node.line_asset.get_node("LineEdit").text = data[graph_node]["line asset"] 370 | 371 | if "text" in data[graph_node]: 372 | node._on_Text_toggled(true) 373 | node.text.get_node("TextEdit").text = data[graph_node]["text"] 374 | 375 | # conditionals 376 | if "conditionals" in data[graph_node]: 377 | 378 | for stack in data[graph_node]["conditionals"]: #get each stack 379 | # create a new if stack 380 | node._on_Conditional_pressed() 381 | 382 | if "if var" in stack: 383 | var if_var_count = 0 384 | 385 | for each_var in stack["if var"]: #get each var (from file) 386 | # create a new var 387 | node.if_stack.selected_conditional = 1 388 | node.if_stack._on_Button_pressed() 389 | 390 | # get new var node 391 | var new_var_node = node.if_stack.get_node("NewVar"+str(if_var_count)) 392 | 393 | # reassign values 394 | new_var_node.get_node("HBoxContainer/GlobalVar").text = each_var 395 | 396 | new_var_node.get_node("HBoxContainer/CheckButton").pressed = stack["if var"][each_var] 397 | 398 | # keep count 399 | if_var_count += 1 400 | 401 | if "if visited" in stack: 402 | var if_visited_count = 0 403 | 404 | for each_visited in stack["if visited"]: #get each visited (from file) 405 | # create a new visited 406 | node.if_stack.selected_conditional = 2 407 | node.if_stack._on_Button_pressed() 408 | 409 | # get new var visited 410 | var new_visited_node = node.if_stack.get_node("NewVisited"+str(if_visited_count)) 411 | 412 | # reassign values 413 | new_visited_node.get_node("HBoxContainer/VisitedNode").value = int(each_visited) 414 | 415 | new_visited_node.get_node("HBoxContainer/VisitedIndex").value = stack["if visited"][each_visited] 416 | 417 | # keep count 418 | if_visited_count += 1 419 | 420 | if "if brownie" in stack: 421 | var if_brownie_count = 0 422 | 423 | for each_brownie in stack["if brownie"]: #get each brownie (from file) 424 | # create a new brownie 425 | node.if_stack.selected_conditional = 3 426 | node.if_stack._on_Button_pressed() 427 | 428 | # get new var node 429 | var new_brownie_node = node.if_stack.get_node("NewBrownie"+str(if_brownie_count)) 430 | 431 | # reassign values 432 | new_brownie_node.get_node("HBoxContainer/NPC").text = each_brownie 433 | 434 | new_brownie_node.get_node("HBoxContainer/BrowniePoints").value = stack["if brownie"][each_brownie] 435 | 436 | # keep count 437 | if_brownie_count += 1 438 | 439 | if "if skill" in stack: 440 | # create a new skill 441 | node.if_stack.selected_conditional = 0 442 | node.if_stack._on_Button_pressed() 443 | 444 | # get skill node 445 | var skill_node = node.if_stack.get_node("ConditionalsSkill/HBoxContainer") 446 | var skill_key = stack["if skill"].keys() 447 | 448 | # reassign values 449 | skill_node.get_node("SkillOption").text = skill_key[0] 450 | skill_node.get_node("SkillPoints").text = stack["if skill"][skill_key[0]] 451 | 452 | # node name 453 | node.name = data[graph_node]["id"] 454 | node.title = data[graph_node]["id"] 455 | node.node_title.text = node.name 456 | 457 | if "go to" in data[graph_node]: 458 | 459 | if "DICEROLL" in graph_node: 460 | 461 | var go_to_count = 0 462 | 463 | for go_to in data[graph_node]["go to"]: # get each in array 464 | graph_edit.connect_node(node.name, go_to_count, data[graph_node]["go to"][go_to_count], 0) 465 | 466 | go_to_count += 1 467 | else: 468 | var go_to_count = 0 469 | for go_to in data[graph_node]["go to"]: # get each in array 470 | graph_edit.connect_node(node.name, 0, data[graph_node]["go to"][go_to_count], 0) 471 | 472 | go_to_count += 1 473 | 474 | 475 | # node offset 476 | # offset 477 | node.offset.x = data[graph_node]["offset x"] 478 | node.offset.y = data[graph_node]["offset y"] 479 | initial_pos = node.offset 480 | 481 | 482 | 483 | func _on_NewOption_pressed(): 484 | 485 | # update option count 486 | all_nodes_index += 1 487 | option_index += 1 488 | option_count.text = "Option Count: " + str(option_index) 489 | 490 | # instance node 491 | var option_node = load("res://OptionNode.tscn") 492 | option_node = option_node.instance() 493 | graph_edit.add_child(option_node) 494 | 495 | # graph offset 496 | option_node.offset = get_global_mouse_position() 497 | # += initial_pos + (node_index * Vector2(5,5)) 498 | initial_pos = option_node.offset 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | # connect nodes 516 | func _on_GraphEdit_connection_request(from, from_slot, to, to_slot): 517 | graph_edit.connect_node(from, from_slot, to, to_slot) 518 | 519 | func _on_GraphEdit_disconnection_request(from, from_slot, to, to_slot): 520 | graph_edit.disconnect_node(from, from_slot, to, to_slot) 521 | 522 | func _on_Clear_pressed(): 523 | for node in get_tree().get_nodes_in_group("graph_nodes"): 524 | node.queue_free() 525 | graph_edit.clear_connections() 526 | 527 | node_index = 0 528 | all_nodes_index = 0 529 | option_count = 0 530 | 531 | 532 | func _on_GraphEdit_gui_input(event): 533 | if Input.is_action_pressed("right_click"): 534 | _on_Button_pressed() 535 | elif event is InputEventMouseButton and event.doubleclick: 536 | _on_NewOption_pressed() 537 | elif Input.is_action_pressed("save"): 538 | _on_RunProgram_pressed() 539 | elif Input.is_action_just_pressed("new_option"): 540 | _on_NewOption_pressed() 541 | 542 | 543 | func _on_NewRoll_pressed(): 544 | node_index += 1 545 | 546 | # instance node 547 | var dice_roll = load("res://DiceRoll.tscn") 548 | dice_roll = dice_roll.instance() 549 | graph_edit.add_child(dice_roll) 550 | 551 | # graph offset 552 | dice_roll.offset += initial_pos + (node_index * Vector2(5,5)) 553 | initial_pos = dice_roll.offset 554 | 555 | 556 | func _on_feature_pressed(): 557 | # instance node 558 | var feature = load("res://Feature.tscn") 559 | feature = feature.instance() 560 | graph_edit.add_child(feature) 561 | 562 | -------------------------------------------------------------------------------- /DialogSystem2/DialogBox/Continue.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene format=2] 2 | 3 | [node name="Continue" type="Button"] 4 | margin_top = 843.0 5 | margin_right = 496.0 6 | margin_bottom = 863.0 7 | text = "CONTINUE" 8 | -------------------------------------------------------------------------------- /DialogSystem2/DialogBox/DialogBox.gd: -------------------------------------------------------------------------------- 1 | extends Control 2 | 3 | signal timeline_end 4 | export(int) var play_node 5 | 6 | # get node components 7 | export(NodePath) onready var portrait = get_node(portrait) as TextureRect 8 | export(NodePath) onready var ch_name = get_node(ch_name) as Label 9 | export(NodePath) onready var text = get_node(text) as RichTextLabel 10 | 11 | # File paths 12 | export(String, DIR) var portraits_folder 13 | 14 | var dialog 15 | 16 | func _ready(): 17 | load_dialog() 18 | play("Node 1") 19 | 20 | func extract_node_number(node_name): 21 | return int(node_name.lstrip("Node ")) 22 | 23 | func load_dialog(): 24 | var file = File.new() 25 | file.open("user://dialog_json", File.READ) 26 | dialog = file.get_as_text() 27 | dialog = parse_json(dialog) 28 | file.close() 29 | 30 | func play(play_node: String): 31 | 32 | var current_dict 33 | 34 | for block in dialog: 35 | if block["id"] == play_node: 36 | current_dict = block 37 | 38 | 39 | print("Current node: " + current_dict["id"]) # debug 40 | 41 | 42 | # execute go-to only at the end of each dialog node 43 | var final_go_to_node_index : int 44 | var final_go_to_option_index = [] 45 | 46 | # add node to visited 47 | GameSave.visited[current_dict["id"]] += 1 48 | 49 | 50 | if current_dict.has("go to"): 51 | 52 | # conditionals : multiple go-tos 53 | if current_dict["go to"].size() > 1: 54 | for go_to in current_dict["go to"]: # each go to 55 | 56 | # get the node_index of the go_to node 57 | var node_number = extract_node_number(go_to) 58 | var go_to_node = dialog[node_number-1] # node index 59 | 60 | # if branches into options 61 | if go_to_node.has("node type") and go_to_node["node type"] == "Option": 62 | 63 | # check if options has conditionals 64 | if go_to_node.has("conditionals"): 65 | 66 | # check for conditions 67 | var conditions_fulfilled = check_for_conditionals(go_to_node) 68 | 69 | # if false, check the next go_to_option 70 | # if true, set to display that option 71 | if conditions_fulfilled: 72 | final_go_to_option_index.append(node_number - 1) 73 | 74 | # if option doesn't have conditionals 75 | else: 76 | final_go_to_option_index.append(node_number - 1) 77 | 78 | 79 | else: # if branches into conditional nodes 80 | 81 | if go_to_node.has("conditionals"): 82 | # check for conditions 83 | var conditions_fulfilled = check_for_conditionals(go_to_node) 84 | 85 | # if false, check the next go_to_node 86 | # if true, play that node 87 | if conditions_fulfilled: 88 | final_go_to_node_index = node_number - 1 89 | break 90 | # if node doesn't have conditionals 91 | else: 92 | final_go_to_node_index = node_number - 1 93 | 94 | # simple go-to : one go-to and no options 95 | elif current_dict["go to"].size() == 1: 96 | var go_to_node = extract_node_number(current_dict["go to"][0]) - 1 97 | 98 | final_go_to_node_index = go_to_node 99 | 100 | else: 101 | # end dialog : play end animation, emit signal 102 | emit_signal("timeline_end") 103 | 104 | if current_dict.has("save var"): 105 | for save_var_key in current_dict["save var"]: 106 | GameSave.variables[save_var_key] = current_dict["save var"][save_var_key] 107 | 108 | if current_dict.has("text"): 109 | text.bbcode_text = current_dict["text"] 110 | 111 | # NODE TYPE: Default 112 | if current_dict.has("character"): 113 | 114 | # set label text 115 | ch_name = current_dict["character"] + ", " + Profiles.character[current_dict["character"]] 116 | 117 | # set character portrait 118 | portrait.texture = load(portraits_folder + "/" + current_dict["character"]) 119 | 120 | if current_dict.has("display name"): 121 | # set label text 122 | ch_name = current_dict["display name"] 123 | 124 | if current_dict.has("task"): 125 | pass 126 | 127 | # task splash 128 | 129 | if current_dict.has("emit signal"): 130 | get_tree().current_scene.emit_signal(current_dict["emit_signal"]) 131 | 132 | if current_dict.has("skill lvl up"): 133 | 134 | var skill = current_dict["skill lvl up"].keys() 135 | skill = skill[skill.size() - 1] 136 | 137 | # update stats 138 | GameSave.skills[skill] = current_dict["skill lvl up"][skill] 139 | 140 | # splash level up 141 | 142 | if current_dict.has("line asset"): 143 | pass 144 | 145 | if current_dict.has("go to"): 146 | if final_go_to_option_index.empty(): 147 | continue_dialog(final_go_to_node_index) 148 | else: # options 149 | continue_dialog(final_go_to_option_index, "Options") 150 | 151 | func check_for_conditionals(current_dict): 152 | var stack_keys = current_dict["conditionals"] 153 | var stack_fulfilled 154 | 155 | var stack_index = 0 156 | 157 | for stack in current_dict["conditionals"]: # each stack 158 | 159 | print ("STACK " + str(stack_index) + ":") # debug 160 | 161 | stack_fulfilled = false 162 | 163 | if stack_keys.has("if var"): 164 | for if_var in stack_keys["if var"]: 165 | if GameSave.variables.has(if_var): 166 | if GameSave.variables[if_var] == stack_keys["if var"][if_var]: 167 | stack_fulfilled = true 168 | 169 | print(stack_keys["if var"][if_var] + " = true") # debug 170 | else: 171 | stack_fulfilled = false 172 | print(stack_keys["if var"][if_var] + " = false") # debug 173 | 174 | if stack_keys.has("if skill"): 175 | for if_skill in stack_keys["if skill"]: 176 | 177 | # bigger than 178 | if stack_keys["if skill"][if_skill].has(">"): 179 | if GameSave.skills[if_skill] >= stack_keys["if skill"][if_skill]: 180 | stack_fulfilled = true 181 | 182 | print(stack_keys["if skill"][if_skill] +" is greater than = true") # debug 183 | 184 | else: 185 | stack_fulfilled = false 186 | 187 | print(stack_keys["if skill"][if_skill] +" is greater than = false") # debug 188 | # less than 189 | if stack_keys["if skill"][if_skill].has("<"): 190 | if GameSave.skills[if_skill] <= stack_keys["if skill"][if_skill]: 191 | stack_fulfilled = true 192 | print(stack_keys["if skill"][if_skill] +" is less than = true") # debug 193 | else: 194 | stack_fulfilled = false 195 | print(stack_keys["if skill"][if_skill] +" is less than = false") # debug 196 | 197 | else: # equals to 198 | if GameSave.skills[if_skill] == stack_keys["if skill"][if_skill]: 199 | stack_fulfilled = true 200 | print(stack_keys["if skill"][if_skill] + " is equal to = true") # debug 201 | else: 202 | stack_fulfilled = false 203 | print(stack_keys["if skill"][if_skill] + " sis equal to = false") # debug 204 | 205 | 206 | if stack_keys.has("if visited"): 207 | for if_visited in stack_keys["if visited"]: 208 | if GameSave.visited[if_visited] == stack_keys["if visited"][if_visited]: 209 | stack_fulfilled = true 210 | print(stack_keys["if visited"][if_visited] + " visited = true") # debug 211 | else: 212 | stack_fulfilled = false 213 | print(stack_keys["if visited"][if_visited] + " visited = false") # debug 214 | 215 | 216 | if stack_keys.has("if npc brownie"): 217 | for if_brownie in stack_keys["if brownie"]: 218 | if GameSave.brownies[if_brownie] == stack_keys["if brownie"][if_brownie]: 219 | stack_fulfilled = true 220 | 221 | print( str(stack_keys["if brownie"][if_brownie]) + " brownie points = true") # debug 222 | 223 | else: 224 | stack_fulfilled = false 225 | print( str(stack_keys["if brownie"][if_brownie]) + " brownie points = false") # debug 226 | 227 | # if a stack is fulfilled, break, but if not, continue looping through the stacks. If none of the stacks are fulfilled, go to the next node (+1) 228 | if stack_fulfilled: 229 | break 230 | print("Stack index " + str(stack_index) + " fulfilled.") # debug 231 | 232 | if stack_fulfilled: 233 | # play node 234 | return true 235 | else: 236 | # do NOT play node, go to the next node 237 | return false 238 | print("Stack index " + str(stack_index) + " NOT fulfilled.") # debug 239 | 240 | func continue_dialog(next_node_index_to_play, node_type = "Default"): 241 | var vbox_container = $VBoxContainer 242 | 243 | # continue button appears 244 | var continue_button = load("res://DialogBox/Continue.tscn") 245 | continue_button = continue_button.instance() 246 | vbox_container.add_child(continue_button) 247 | 248 | yield(continue_button, "pressed") 249 | 250 | # upon pressing continue button 251 | if node_type == "Default": 252 | play(next_node_index_to_play) 253 | 254 | elif node_type == "Options": 255 | 256 | for node in next_node_index_to_play: 257 | 258 | # instance valid options 259 | var option = load("res://DialogBox/Option.tscn") 260 | option = option.instance() 261 | vbox_container.add_child(option) 262 | 263 | # set option data 264 | option.text = dialog[node]["text"] 265 | option.node_index = node 266 | 267 | # assign custom signal for option selection 268 | option.connect("option_pressed", self, "go_to_selected_node") 269 | 270 | func go_to_selected_node(option_go_to_index): 271 | # go to option's node index 272 | play(option_go_to_index) 273 | 274 | 275 | 276 | 277 | -------------------------------------------------------------------------------- /DialogSystem2/DialogBox/DialogBox.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=10 format=2] 2 | 3 | [ext_resource path="res://Assets/dialog_box.png" type="Texture" id=1] 4 | [ext_resource path="res://Assets/portrait.png" type="Texture" id=2] 5 | [ext_resource path="res://Assets/SourceSerif4_18pt-Italic.ttf" type="DynamicFontData" id=3] 6 | [ext_resource path="res://Assets/SourceSerif4_18pt-Regular.ttf" type="DynamicFontData" id=4] 7 | [ext_resource path="res://Assets/SourceSerif4_18pt-SemiBold.ttf" type="DynamicFontData" id=5] 8 | [ext_resource path="res://DialogBox/DialogBox.gd" type="Script" id=6] 9 | 10 | [sub_resource type="DynamicFont" id=3] 11 | size = 23 12 | use_mipmaps = true 13 | use_filter = true 14 | extra_spacing_top = 10 15 | font_data = ExtResource( 5 ) 16 | 17 | [sub_resource type="DynamicFont" id=1] 18 | size = 23 19 | use_mipmaps = true 20 | use_filter = true 21 | extra_spacing_top = 10 22 | font_data = ExtResource( 3 ) 23 | 24 | [sub_resource type="DynamicFont" id=2] 25 | size = 26 26 | use_mipmaps = true 27 | use_filter = true 28 | extra_spacing_top = 10 29 | font_data = ExtResource( 4 ) 30 | 31 | [node name="DialogBox" type="Control"] 32 | script = ExtResource( 6 ) 33 | portrait = NodePath("Portrait") 34 | ch_name = NodePath("VBoxContainer/Name") 35 | text = NodePath("VBoxContainer/Text") 36 | 37 | [node name="Bgk" type="TextureRect" parent="."] 38 | margin_left = 1061.0 39 | margin_top = -4.0 40 | margin_right = 1788.0 41 | margin_bottom = 1076.0 42 | texture = ExtResource( 1 ) 43 | 44 | [node name="Portrait" type="TextureRect" parent="."] 45 | margin_left = 996.0 46 | margin_top = 28.0 47 | margin_right = 1195.0 48 | margin_bottom = 571.0 49 | texture = ExtResource( 2 ) 50 | 51 | [node name="VBoxContainer" type="VBoxContainer" parent="."] 52 | margin_left = 1192.0 53 | margin_top = 137.0 54 | margin_right = 1688.0 55 | margin_bottom = 1000.0 56 | grow_horizontal = 0 57 | rect_clip_content = true 58 | alignment = 2 59 | 60 | [node name="Name" type="Label" parent="VBoxContainer"] 61 | margin_top = 488.0 62 | margin_right = 496.0 63 | margin_bottom = 530.0 64 | custom_colors/font_color = Color( 0.235294, 0.32549, 0.219608, 1 ) 65 | custom_fonts/font = SubResource( 3 ) 66 | text = "LETTY, YOUR SISTER" 67 | 68 | [node name="Text" type="RichTextLabel" parent="VBoxContainer"] 69 | margin_top = 534.0 70 | margin_right = 496.0 71 | margin_bottom = 863.0 72 | custom_colors/default_color = Color( 0, 0, 0, 1 ) 73 | custom_fonts/italics_font = SubResource( 1 ) 74 | custom_fonts/normal_font = SubResource( 2 ) 75 | bbcode_enabled = true 76 | bbcode_text = "10 years ago, you left to the City for college. You didn’t feel particularly drawn to any one thing. Nothing felt like it was made for you. Like you were a leftover blob of after thought of whoever or whatever made the universe. 77 | " 78 | text = "10 years ago, you left to the City for college. You didn’t feel particularly drawn to any one thing. Nothing felt like it was made for you. Like you were a leftover blob of after thought of whoever or whatever made the universe. 79 | " 80 | fit_content_height = true 81 | scroll_active = false 82 | -------------------------------------------------------------------------------- /DialogSystem2/DialogBox/Option.gd: -------------------------------------------------------------------------------- 1 | extends Button 2 | 3 | var node_index 4 | 5 | signal option_pressed 6 | 7 | 8 | func _on_Option_pressed(): 9 | emit_signal("option_pressed", node_index) 10 | -------------------------------------------------------------------------------- /DialogSystem2/DialogBox/Option.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://DialogBox/Option.gd" type="Script" id=1] 4 | 5 | [node name="Option" type="Button"] 6 | margin_right = 496.0 7 | margin_bottom = 47.0 8 | rect_min_size = Vector2( 496, 47 ) 9 | mouse_default_cursor_shape = 2 10 | text = "1. Hello, this is me." 11 | align = 0 12 | script = ExtResource( 1 ) 13 | 14 | [connection signal="pressed" from="." to="." method="_on_Option_pressed"] 15 | -------------------------------------------------------------------------------- /DialogSystem2/DiceRoll.gd: -------------------------------------------------------------------------------- 1 | extends GraphNode 2 | 3 | var node_type = "Dice Roll" 4 | 5 | onready var skill = $VBoxContainer/Skill/OptionButton 6 | onready var target_number = $VBoxContainer/Target/TargetNumber 7 | export(NodePath) onready var node_title = get_node(node_title) as LineEdit 8 | 9 | 10 | func _on_LineEdit_text_changed(new_text): 11 | title = "DICEROLL_" + new_text 12 | name = "DICEROLL_" + new_text 13 | -------------------------------------------------------------------------------- /DialogSystem2/DiceRoll.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=14 format=2] 2 | 3 | [ext_resource path="res://DiceRoll.gd" type="Script" id=1] 4 | [ext_resource path="res://Assets/Clean.tres" type="DynamicFont" id=2] 5 | [ext_resource path="res://Assets/AdobeClean-SemiCn.otf" type="DynamicFontData" id=3] 6 | [ext_resource path="res://Assets/port.png" type="Texture" id=4] 7 | 8 | [sub_resource type="StyleBoxFlat" id=12] 9 | content_margin_left = 10.0 10 | content_margin_right = 10.0 11 | bg_color = Color( 0.639216, 0.258824, 0.0823529, 0.380392 ) 12 | border_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 13 | corner_radius_top_left = 4 14 | corner_radius_top_right = 4 15 | corner_radius_bottom_right = 4 16 | corner_radius_bottom_left = 4 17 | 18 | [sub_resource type="StyleBoxFlat" id=13] 19 | content_margin_left = 10.0 20 | content_margin_right = 10.0 21 | bg_color = Color( 0.639216, 0.258824, 0.0823529, 0.0941176 ) 22 | border_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 23 | corner_radius_top_left = 4 24 | corner_radius_top_right = 4 25 | corner_radius_bottom_right = 4 26 | corner_radius_bottom_left = 4 27 | 28 | [sub_resource type="StyleBoxFlat" id=14] 29 | bg_color = Color( 0.796078, 0.784314, 0.741176, 1 ) 30 | 31 | [sub_resource type="StyleBoxFlat" id=16] 32 | content_margin_top = 30.0 33 | bg_color = Color( 1, 1, 1, 0.705882 ) 34 | expand_margin_left = 15.0 35 | expand_margin_right = 15.0 36 | expand_margin_top = 15.0 37 | expand_margin_bottom = 15.0 38 | 39 | [sub_resource type="StyleBoxFlat" id=15] 40 | content_margin_top = 30.0 41 | bg_color = Color( 1, 1, 1, 1 ) 42 | border_width_left = 3 43 | border_width_top = 3 44 | border_width_right = 3 45 | border_width_bottom = 3 46 | border_color = Color( 1, 1, 1, 1 ) 47 | corner_radius_top_left = 3 48 | corner_radius_top_right = 3 49 | corner_radius_bottom_right = 3 50 | corner_radius_bottom_left = 3 51 | expand_margin_left = 15.0 52 | expand_margin_right = 15.0 53 | expand_margin_top = 15.0 54 | expand_margin_bottom = 15.0 55 | 56 | [sub_resource type="DynamicFont" id=7] 57 | size = 24 58 | use_mipmaps = true 59 | use_filter = true 60 | extra_spacing_char = 2 61 | font_data = ExtResource( 3 ) 62 | 63 | [sub_resource type="StyleBoxFlat" id=8] 64 | content_margin_left = 12.0 65 | content_margin_right = 12.0 66 | content_margin_top = 12.0 67 | content_margin_bottom = 12.0 68 | bg_color = Color( 0.796078, 0.784314, 0.741176, 1 ) 69 | 70 | [sub_resource type="StyleBoxFlat" id=11] 71 | content_margin_left = 12.0 72 | content_margin_right = 12.0 73 | content_margin_top = 12.0 74 | content_margin_bottom = 12.0 75 | bg_color = Color( 0.796078, 0.784314, 0.741176, 1 ) 76 | corner_radius_top_left = 6 77 | corner_radius_top_right = 6 78 | corner_radius_bottom_right = 6 79 | corner_radius_bottom_left = 6 80 | 81 | [sub_resource type="Theme" id=17] 82 | default_font = ExtResource( 2 ) 83 | Button/colors/font_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 84 | Button/constants/hseparation = 2 85 | Button/fonts/font = ExtResource( 2 ) 86 | Button/styles/focus = SubResource( 12 ) 87 | Button/styles/hover = SubResource( 12 ) 88 | Button/styles/normal = SubResource( 13 ) 89 | Button/styles/pressed = SubResource( 12 ) 90 | CheckBox/constants/hseparation = 20 91 | GraphEdit/styles/bg = SubResource( 14 ) 92 | GraphNode/constants/port_offset = -17 93 | GraphNode/icons/port = ExtResource( 4 ) 94 | GraphNode/styles/frame = SubResource( 16 ) 95 | GraphNode/styles/selectedframe = SubResource( 15 ) 96 | Label/colors/font_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 97 | Label/fonts/font = null 98 | LineEdit/colors/font_color = Color( 0, 0, 0, 1 ) 99 | LineEdit/fonts/font = SubResource( 7 ) 100 | LineEdit/styles/normal = SubResource( 8 ) 101 | TextEdit/colors/font_color = Color( 0, 0, 0, 1 ) 102 | TextEdit/fonts/font = null 103 | TextEdit/styles/normal = SubResource( 11 ) 104 | 105 | [node name="DiceRoll" type="GraphNode" groups=["graph_nodes"]] 106 | anchor_right = 0.102 107 | anchor_bottom = 0.269 108 | margin_right = 85.16 109 | margin_bottom = 104.48 110 | theme = SubResource( 17 ) 111 | custom_constants/separation = 20 112 | title = "Dice Roll" 113 | slot/0/left_enabled = false 114 | slot/0/left_type = 0 115 | slot/0/left_color = Color( 1, 1, 1, 1 ) 116 | slot/0/right_enabled = true 117 | slot/0/right_type = 0 118 | slot/0/right_color = Color( 1, 0.905882, 0.666667, 1 ) 119 | slot/1/left_enabled = false 120 | slot/1/left_type = 0 121 | slot/1/left_color = Color( 1, 1, 1, 1 ) 122 | slot/1/right_enabled = true 123 | slot/1/right_type = 0 124 | slot/1/right_color = Color( 0.0901961, 1, 0, 1 ) 125 | slot/2/left_enabled = true 126 | slot/2/left_type = 0 127 | slot/2/left_color = Color( 1, 1, 1, 1 ) 128 | slot/2/right_enabled = false 129 | slot/2/right_type = 0 130 | slot/2/right_color = Color( 0.435294, 0.901961, 0, 1 ) 131 | script = ExtResource( 1 ) 132 | node_title = NodePath("VBoxContainer/Title/LineEdit") 133 | 134 | [node name="Fail" type="Label" parent="."] 135 | margin_top = 30.0 136 | margin_right = 281.0 137 | margin_bottom = 55.0 138 | text = "Fail" 139 | align = 2 140 | 141 | [node name="Pass" type="Label" parent="."] 142 | margin_top = 75.0 143 | margin_right = 281.0 144 | margin_bottom = 100.0 145 | custom_colors/font_color = Color( 0.0784314, 0.545098, 0, 1 ) 146 | text = "Pass" 147 | align = 2 148 | 149 | [node name="VBoxContainer" type="VBoxContainer" parent="."] 150 | margin_top = 120.0 151 | margin_right = 281.0 152 | margin_bottom = 305.0 153 | custom_constants/separation = 40 154 | 155 | [node name="Title" type="HBoxContainer" parent="VBoxContainer"] 156 | margin_right = 281.0 157 | margin_bottom = 55.0 158 | custom_constants/separation = 60 159 | 160 | [node name="Label" type="Label" parent="VBoxContainer/Title"] 161 | margin_top = 15.0 162 | margin_right = 40.0 163 | margin_bottom = 40.0 164 | text = "Title" 165 | 166 | [node name="LineEdit" type="LineEdit" parent="VBoxContainer/Title"] 167 | margin_left = 100.0 168 | margin_right = 208.0 169 | margin_bottom = 55.0 170 | 171 | [node name="Skill" type="Label" parent="VBoxContainer"] 172 | margin_top = 95.0 173 | margin_right = 281.0 174 | margin_bottom = 120.0 175 | text = "Skill involved" 176 | 177 | [node name="OptionButton" type="OptionButton" parent="VBoxContainer/Skill"] 178 | margin_top = 30.0 179 | margin_right = 160.0 180 | margin_bottom = 38.0 181 | text = "None" 182 | items = [ "None", null, false, 0, null, "Endurance", null, false, 1, null, "Charisma", null, false, 2, null, "Dexterity", null, false, 3, null, "Intellect", null, false, 4, null ] 183 | selected = 0 184 | 185 | [node name="Target" type="Label" parent="VBoxContainer"] 186 | margin_top = 160.0 187 | margin_right = 281.0 188 | margin_bottom = 185.0 189 | text = "Target" 190 | 191 | [node name="TargetNumber" type="SpinBox" parent="VBoxContainer/Target"] 192 | margin_top = 30.0 193 | margin_right = 161.0 194 | margin_bottom = 42.0 195 | allow_greater = true 196 | allow_lesser = true 197 | 198 | [connection signal="text_changed" from="VBoxContainer/Title/LineEdit" to="." method="_on_LineEdit_text_changed"] 199 | -------------------------------------------------------------------------------- /DialogSystem2/Feature.gd: -------------------------------------------------------------------------------- 1 | extends GraphNode 2 | 3 | export(NodePath) onready var more = get_node(more) as VBoxContainer 4 | 5 | export(NodePath) onready var money = get_node(money) as HBoxContainer 6 | 7 | export(NodePath) onready var save_var = get_node(save_var) as HBoxContainer 8 | export(NodePath) onready var task = get_node(task) as HBoxContainer 9 | export(NodePath) onready var end = get_node(end) as HBoxContainer 10 | export(NodePath) onready var skills = get_node(skills) as HBoxContainer 11 | export(NodePath) onready var signal_emit = get_node(signal_emit) as HBoxContainer 12 | export(NodePath) onready var node_title = get_node(node_title) as LineEdit 13 | 14 | onready var main = $HBoxContainer/MainColumn 15 | 16 | var save_var_list = ["SaveVar"] 17 | var node_type = "Feature" 18 | var save_var_count = 0 19 | 20 | var feature_title 21 | 22 | func _on_GraphNode_resize_request(new_minsize): 23 | rect_size = new_minsize 24 | 25 | func _on_GraphNode_close_request(): 26 | queue_free() 27 | 28 | 29 | 30 | func _on_Skills_toggled(button_pressed): 31 | if button_pressed: 32 | skills.visible = true 33 | else: 34 | skills.visible = false 35 | 36 | 37 | 38 | func _on_Task_toggled(button_pressed): 39 | if button_pressed: 40 | task.visible = true 41 | else: 42 | task.visible = false 43 | 44 | 45 | func _on_SaveVar_toggled(button_pressed): 46 | if button_pressed: 47 | for save_var in save_var_list: 48 | main.get_node(save_var).visible = true 49 | save_var_count += 1 50 | else: 51 | for save_var in save_var_list: 52 | main.get_node(save_var).visible = false 53 | save_var_count -= 1 54 | 55 | 56 | func _on_More_toggled(button_pressed): 57 | var add_column = $HBoxContainer/AddColumn 58 | 59 | if button_pressed: 60 | add_column.visible = true 61 | else: 62 | add_column.visible = false 63 | 64 | 65 | func _on_new_save_var_button_pressed(): 66 | var new_save_var = load("res://SaveVar.tscn") 67 | new_save_var = new_save_var.instance() 68 | $HBoxContainer/MainColumn.add_child(new_save_var) 69 | 70 | new_save_var.name = "SaveVar" + str(save_var_count) 71 | 72 | save_var_list.append(new_save_var.name) 73 | 74 | save_var_count += 1 75 | 76 | 77 | func _on_EmitSignal_toggled(button_pressed): 78 | if button_pressed: 79 | signal_emit.visible = true 80 | else: 81 | signal_emit.visible = false 82 | 83 | 84 | 85 | func _on_Money_toggled(button_pressed): 86 | if button_pressed: 87 | money.visible = true 88 | else: 89 | money.visible = false 90 | 91 | 92 | func _on_LineEdit_text_changed(new_text): 93 | name = "FEATURE_" + new_text 94 | title = "FEATURE_" + new_text 95 | 96 | 97 | func _on_End_toggled(button_pressed): 98 | if button_pressed: 99 | end.visible = true 100 | else: 101 | end.visible = false 102 | -------------------------------------------------------------------------------- /DialogSystem2/Feature.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=15 format=2] 2 | 3 | [ext_resource path="res://Feature.gd" type="Script" id=1] 4 | [ext_resource path="res://Assets/port.png" type="Texture" id=2] 5 | [ext_resource path="res://Assets/AdobeClean-SemiCn.otf" type="DynamicFontData" id=3] 6 | [ext_resource path="res://Assets/Clean.tres" type="DynamicFont" id=4] 7 | 8 | [sub_resource type="StyleBoxFlat" id=12] 9 | content_margin_left = 10.0 10 | content_margin_right = 10.0 11 | bg_color = Color( 0.639216, 0.258824, 0.0823529, 0.380392 ) 12 | border_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 13 | corner_radius_top_left = 4 14 | corner_radius_top_right = 4 15 | corner_radius_bottom_right = 4 16 | corner_radius_bottom_left = 4 17 | 18 | [sub_resource type="StyleBoxFlat" id=13] 19 | content_margin_left = 10.0 20 | content_margin_right = 10.0 21 | bg_color = Color( 0.639216, 0.258824, 0.0823529, 0.0941176 ) 22 | border_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 23 | corner_radius_top_left = 4 24 | corner_radius_top_right = 4 25 | corner_radius_bottom_right = 4 26 | corner_radius_bottom_left = 4 27 | 28 | [sub_resource type="StyleBoxFlat" id=14] 29 | bg_color = Color( 0.796078, 0.784314, 0.741176, 1 ) 30 | 31 | [sub_resource type="StyleBoxFlat" id=16] 32 | content_margin_top = 30.0 33 | bg_color = Color( 1, 1, 1, 0.705882 ) 34 | expand_margin_left = 15.0 35 | expand_margin_right = 15.0 36 | expand_margin_top = 15.0 37 | expand_margin_bottom = 15.0 38 | 39 | [sub_resource type="StyleBoxFlat" id=15] 40 | content_margin_top = 30.0 41 | bg_color = Color( 1, 1, 1, 1 ) 42 | border_width_left = 3 43 | border_width_top = 3 44 | border_width_right = 3 45 | border_width_bottom = 3 46 | border_color = Color( 1, 1, 1, 1 ) 47 | corner_radius_top_left = 3 48 | corner_radius_top_right = 3 49 | corner_radius_bottom_right = 3 50 | corner_radius_bottom_left = 3 51 | expand_margin_left = 15.0 52 | expand_margin_right = 15.0 53 | expand_margin_top = 15.0 54 | expand_margin_bottom = 15.0 55 | 56 | [sub_resource type="DynamicFont" id=7] 57 | size = 24 58 | use_mipmaps = true 59 | use_filter = true 60 | extra_spacing_char = 2 61 | font_data = ExtResource( 3 ) 62 | 63 | [sub_resource type="StyleBoxFlat" id=8] 64 | content_margin_left = 12.0 65 | content_margin_right = 12.0 66 | content_margin_top = 12.0 67 | content_margin_bottom = 12.0 68 | bg_color = Color( 0.796078, 0.784314, 0.741176, 1 ) 69 | 70 | [sub_resource type="StyleBoxFlat" id=11] 71 | content_margin_left = 12.0 72 | content_margin_right = 12.0 73 | content_margin_top = 12.0 74 | content_margin_bottom = 12.0 75 | bg_color = Color( 0.796078, 0.784314, 0.741176, 1 ) 76 | corner_radius_top_left = 6 77 | corner_radius_top_right = 6 78 | corner_radius_bottom_right = 6 79 | corner_radius_bottom_left = 6 80 | 81 | [sub_resource type="Theme" id=17] 82 | default_font = ExtResource( 4 ) 83 | Button/colors/font_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 84 | Button/constants/hseparation = 2 85 | Button/fonts/font = ExtResource( 4 ) 86 | Button/styles/focus = SubResource( 12 ) 87 | Button/styles/hover = SubResource( 12 ) 88 | Button/styles/normal = SubResource( 13 ) 89 | Button/styles/pressed = SubResource( 12 ) 90 | CheckBox/constants/hseparation = 20 91 | GraphEdit/styles/bg = SubResource( 14 ) 92 | GraphNode/constants/port_offset = -17 93 | GraphNode/icons/port = ExtResource( 2 ) 94 | GraphNode/styles/frame = SubResource( 16 ) 95 | GraphNode/styles/selectedframe = SubResource( 15 ) 96 | Label/colors/font_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 97 | Label/fonts/font = null 98 | LineEdit/colors/font_color = Color( 0, 0, 0, 1 ) 99 | LineEdit/fonts/font = SubResource( 7 ) 100 | LineEdit/styles/normal = SubResource( 8 ) 101 | TextEdit/colors/font_color = Color( 0, 0, 0, 1 ) 102 | TextEdit/fonts/font = null 103 | TextEdit/styles/normal = SubResource( 11 ) 104 | 105 | [sub_resource type="StyleBoxFlat" id=1] 106 | bg_color = Color( 0.6, 0.6, 0.6, 0 ) 107 | 108 | [node name="FeatureNode" type="GraphNode" groups=["graph_nodes"]] 109 | margin_right = 390.0 110 | margin_bottom = 257.0 111 | theme = SubResource( 17 ) 112 | title = "New node" 113 | show_close = true 114 | resizable = true 115 | slot/0/left_enabled = true 116 | slot/0/left_type = 0 117 | slot/0/left_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 118 | slot/0/right_enabled = true 119 | slot/0/right_type = 0 120 | slot/0/right_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 121 | script = ExtResource( 1 ) 122 | more = NodePath("HBoxContainer/More") 123 | money = NodePath("HBoxContainer/MainColumn/Money") 124 | save_var = NodePath("HBoxContainer/MainColumn/SaveVar") 125 | task = NodePath("HBoxContainer/MainColumn/Task") 126 | end = NodePath("HBoxContainer/MainColumn/End") 127 | skills = NodePath("HBoxContainer/MainColumn/Skills") 128 | signal_emit = NodePath("HBoxContainer/MainColumn/EmitSignal") 129 | node_title = NodePath("HBoxContainer/MainColumn/Title/LineEdit") 130 | 131 | [node name="HBoxContainer" type="HBoxContainer" parent="."] 132 | margin_top = 30.0 133 | margin_right = 390.0 134 | margin_bottom = 85.0 135 | custom_constants/separation = 40 136 | 137 | [node name="MainColumn" type="VBoxContainer" parent="HBoxContainer"] 138 | margin_right = 208.0 139 | margin_bottom = 55.0 140 | custom_constants/separation = 10 141 | 142 | [node name="Title" type="HBoxContainer" parent="HBoxContainer/MainColumn"] 143 | margin_right = 208.0 144 | margin_bottom = 55.0 145 | custom_constants/separation = 60 146 | 147 | [node name="Label" type="Label" parent="HBoxContainer/MainColumn/Title"] 148 | margin_top = 15.0 149 | margin_right = 40.0 150 | margin_bottom = 40.0 151 | text = "Title" 152 | 153 | [node name="LineEdit" type="LineEdit" parent="HBoxContainer/MainColumn/Title"] 154 | margin_left = 100.0 155 | margin_right = 208.0 156 | margin_bottom = 55.0 157 | 158 | [node name="EmitSignal" type="HBoxContainer" parent="HBoxContainer/MainColumn"] 159 | visible = false 160 | margin_top = 65.0 161 | margin_right = 233.0 162 | margin_bottom = 120.0 163 | custom_constants/separation = 60 164 | 165 | [node name="EmitSignal" type="Label" parent="HBoxContainer/MainColumn/EmitSignal"] 166 | margin_top = 15.0 167 | margin_right = 53.0 168 | margin_bottom = 40.0 169 | text = "Signal" 170 | 171 | [node name="LineEdit" type="LineEdit" parent="HBoxContainer/MainColumn/EmitSignal"] 172 | margin_left = 113.0 173 | margin_right = 233.0 174 | margin_bottom = 55.0 175 | rect_min_size = Vector2( 120, 0 ) 176 | 177 | [node name="Timer2" type="Timer" parent="HBoxContainer/MainColumn/EmitSignal/LineEdit"] 178 | wait_time = 0.65 179 | 180 | [node name="PopupMenu2" type="PopupMenu" parent="HBoxContainer/MainColumn/EmitSignal/LineEdit"] 181 | items = [ "Cut", null, 0, false, false, 0, 134217816, null, "", false, "Copy", null, 0, false, false, 1, 134217795, null, "", false, "Paste", null, 0, false, false, 2, 134217814, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Select All", null, 0, false, false, 4, 134217793, null, "", false, "Clear", null, 0, false, false, 3, 0, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Undo", null, 0, false, false, 5, 134217818, null, "", false, "Redo", null, 0, false, false, 6, 167772250, null, "", false ] 182 | 183 | [node name="Timer3" type="Timer" parent="HBoxContainer/MainColumn/EmitSignal/LineEdit"] 184 | wait_time = 0.65 185 | 186 | [node name="PopupMenu3" type="PopupMenu" parent="HBoxContainer/MainColumn/EmitSignal/LineEdit"] 187 | items = [ "Cut", null, 0, false, false, 0, 134217816, null, "", false, "Copy", null, 0, false, false, 1, 134217795, null, "", false, "Paste", null, 0, false, false, 2, 134217814, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Select All", null, 0, false, false, 4, 134217793, null, "", false, "Clear", null, 0, false, false, 3, 0, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Undo", null, 0, false, false, 5, 134217818, null, "", false, "Redo", null, 0, false, false, 6, 167772250, null, "", false ] 188 | 189 | [node name="Task" type="HBoxContainer" parent="HBoxContainer/MainColumn"] 190 | visible = false 191 | margin_right = 302.0 192 | margin_bottom = 30.0 193 | custom_constants/separation = 74 194 | 195 | [node name="Task" type="Label" parent="HBoxContainer/MainColumn/Task"] 196 | margin_top = 8.0 197 | margin_right = 28.0 198 | margin_bottom = 22.0 199 | text = "Task" 200 | 201 | [node name="LineEdit" type="TextEdit" parent="HBoxContainer/MainColumn/Task"] 202 | margin_left = 102.0 203 | margin_right = 302.0 204 | margin_bottom = 30.0 205 | rect_min_size = Vector2( 200, 30 ) 206 | syntax_highlighting = true 207 | wrap_enabled = true 208 | 209 | [node name="HScrollBar2" type="HScrollBar" parent="HBoxContainer/MainColumn/Task/LineEdit"] 210 | 211 | [node name="VScrollBar2" type="VScrollBar" parent="HBoxContainer/MainColumn/Task/LineEdit"] 212 | 213 | [node name="Timer4" type="Timer" parent="HBoxContainer/MainColumn/Task/LineEdit"] 214 | wait_time = 0.65 215 | 216 | [node name="Timer5" type="Timer" parent="HBoxContainer/MainColumn/Task/LineEdit"] 217 | wait_time = 3.0 218 | one_shot = true 219 | 220 | [node name="Timer6" type="Timer" parent="HBoxContainer/MainColumn/Task/LineEdit"] 221 | wait_time = 0.05 222 | 223 | [node name="PopupMenu2" type="PopupMenu" parent="HBoxContainer/MainColumn/Task/LineEdit"] 224 | items = [ "Undo", null, 0, false, false, 5, 134217818, null, "", false, "Redo", null, 0, false, false, 6, 167772250, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Cut", null, 0, false, false, 0, 134217816, null, "", false, "Copy", null, 0, false, false, 1, 134217795, null, "", false, "Paste", null, 0, false, false, 2, 134217814, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Select All", null, 0, false, false, 4, 134217793, null, "", false, "Clear", null, 0, false, false, 3, 0, null, "", false ] 225 | 226 | [node name="HScrollBar3" type="HScrollBar" parent="HBoxContainer/MainColumn/Task/LineEdit"] 227 | visible = false 228 | margin_top = 18.0 229 | margin_right = 188.0 230 | margin_bottom = 30.0 231 | max_value = 0.0 232 | 233 | [node name="VScrollBar3" type="VScrollBar" parent="HBoxContainer/MainColumn/Task/LineEdit"] 234 | visible = false 235 | margin_left = 188.0 236 | margin_right = 200.0 237 | margin_bottom = 30.0 238 | max_value = 0.0 239 | 240 | [node name="Timer7" type="Timer" parent="HBoxContainer/MainColumn/Task/LineEdit"] 241 | wait_time = 0.65 242 | 243 | [node name="Timer8" type="Timer" parent="HBoxContainer/MainColumn/Task/LineEdit"] 244 | wait_time = 3.0 245 | one_shot = true 246 | 247 | [node name="Timer9" type="Timer" parent="HBoxContainer/MainColumn/Task/LineEdit"] 248 | wait_time = 0.05 249 | 250 | [node name="PopupMenu3" type="PopupMenu" parent="HBoxContainer/MainColumn/Task/LineEdit"] 251 | items = [ "Cut", null, 0, false, false, 0, 134217816, null, "", false, "Copy", null, 0, false, false, 1, 134217795, null, "", false, "Paste", null, 0, false, false, 2, 134217814, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Select All", null, 0, false, false, 4, 134217793, null, "", false, "Clear", null, 0, false, false, 3, 0, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Undo", null, 0, false, false, 5, 134217818, null, "", false, "Redo", null, 0, false, false, 6, 167772250, null, "", false ] 252 | 253 | [node name="Money" type="HBoxContainer" parent="HBoxContainer/MainColumn"] 254 | visible = false 255 | margin_top = 140.0 256 | margin_right = 503.0 257 | margin_bottom = 170.0 258 | custom_constants/separation = 74 259 | 260 | [node name="Money" type="Label" parent="HBoxContainer/MainColumn/Money"] 261 | margin_top = 8.0 262 | margin_right = 43.0 263 | margin_bottom = 22.0 264 | text = "Money" 265 | 266 | [node name="Spinbox" type="SpinBox" parent="HBoxContainer/MainColumn/Money"] 267 | margin_left = 117.0 268 | margin_right = 317.0 269 | margin_bottom = 30.0 270 | rect_min_size = Vector2( 200, 30 ) 271 | allow_greater = true 272 | allow_lesser = true 273 | 274 | [node name="LineEdit2" type="LineEdit" parent="HBoxContainer/MainColumn/Money/Spinbox"] 275 | anchor_right = 1.0 276 | anchor_bottom = 1.0 277 | margin_right = -16.0 278 | mouse_filter = 1 279 | text = "0" 280 | 281 | [node name="Timer2" type="Timer" parent="HBoxContainer/MainColumn/Money/Spinbox"] 282 | 283 | [node name="LineEdit3" type="LineEdit" parent="HBoxContainer/MainColumn/Money/Spinbox"] 284 | anchor_right = 1.0 285 | anchor_bottom = 1.0 286 | mouse_filter = 1 287 | text = "0" 288 | 289 | [node name="Timer3" type="Timer" parent="HBoxContainer/MainColumn/Money/Spinbox"] 290 | 291 | [node name="Skills" type="HBoxContainer" parent="HBoxContainer/MainColumn"] 292 | visible = false 293 | margin_top = 140.0 294 | margin_right = 503.0 295 | margin_bottom = 164.0 296 | custom_constants/separation = 7 297 | 298 | [node name="Skills" type="Label" parent="HBoxContainer/MainColumn/Skills"] 299 | margin_top = 5.0 300 | margin_right = 77.0 301 | margin_bottom = 19.0 302 | text = "Skills Lvl Up" 303 | 304 | [node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer/MainColumn/Skills"] 305 | margin_left = 84.0 306 | margin_right = 281.0 307 | margin_bottom = 24.0 308 | 309 | [node name="SkillOption" type="OptionButton" parent="HBoxContainer/MainColumn/Skills/HBoxContainer"] 310 | margin_right = 83.0 311 | margin_bottom = 24.0 312 | text = "Intellect" 313 | items = [ "Intellect", null, false, 0, null, "Charisma", null, false, 1, null, "Endurance", null, false, 2, null, "Dexterity", null, false, 3, null ] 314 | selected = 0 315 | 316 | [node name="PopupMenu2" type="PopupMenu" parent="HBoxContainer/MainColumn/Skills/HBoxContainer/SkillOption"] 317 | input_pass_on_modal_close_click = false 318 | items = [ "Intellect", null, 2, true, false, 0, 0, null, "", false, "Charisma", null, 2, false, false, 1, 0, null, "", false, "Endurance", null, 2, false, false, 2, 0, null, "", false, "Dexterity", null, 2, false, false, 3, 0, null, "", false ] 319 | allow_search = true 320 | 321 | [node name="PopupMenu3" type="PopupMenu" parent="HBoxContainer/MainColumn/Skills/HBoxContainer/SkillOption"] 322 | input_pass_on_modal_close_click = false 323 | items = [ "Intellect", null, 2, true, false, 0, 0, null, "", false, "Charisma", null, 2, false, false, 1, 0, null, "", false, "Endurance", null, 2, false, false, 2, 0, null, "", false, "Dexterity", null, 2, false, false, 3, 0, null, "", false ] 324 | allow_search = true 325 | 326 | [node name="SkillUpgrade" type="SpinBox" parent="HBoxContainer/MainColumn/Skills/HBoxContainer"] 327 | margin_left = 87.0 328 | margin_right = 197.0 329 | margin_bottom = 24.0 330 | rect_min_size = Vector2( 110, 0 ) 331 | allow_greater = true 332 | allow_lesser = true 333 | 334 | [node name="LineEdit2" type="LineEdit" parent="HBoxContainer/MainColumn/Skills/HBoxContainer/SkillUpgrade"] 335 | anchor_right = 1.0 336 | anchor_bottom = 1.0 337 | margin_right = -16.0 338 | mouse_filter = 1 339 | text = "0" 340 | 341 | [node name="Timer2" type="Timer" parent="HBoxContainer/MainColumn/Skills/HBoxContainer/SkillUpgrade"] 342 | 343 | [node name="LineEdit3" type="LineEdit" parent="HBoxContainer/MainColumn/Skills/HBoxContainer/SkillUpgrade"] 344 | anchor_right = 1.0 345 | anchor_bottom = 1.0 346 | mouse_filter = 1 347 | text = "0" 348 | 349 | [node name="Timer3" type="Timer" parent="HBoxContainer/MainColumn/Skills/HBoxContainer/SkillUpgrade"] 350 | 351 | [node name="SaveVar" type="HBoxContainer" parent="HBoxContainer/MainColumn"] 352 | visible = false 353 | margin_top = 340.0 354 | margin_right = 503.0 355 | margin_bottom = 380.0 356 | custom_constants/separation = -5 357 | 358 | [node name="SaveVar" type="Label" parent="HBoxContainer/MainColumn/SaveVar"] 359 | margin_top = 13.0 360 | margin_right = 84.0 361 | margin_bottom = 27.0 362 | text = "Save Variable" 363 | 364 | [node name="LineEdit" type="LineEdit" parent="HBoxContainer/MainColumn/SaveVar"] 365 | margin_left = 79.0 366 | margin_right = 229.0 367 | margin_bottom = 40.0 368 | rect_min_size = Vector2( 150, 0 ) 369 | 370 | [node name="Timer2" type="Timer" parent="HBoxContainer/MainColumn/SaveVar/LineEdit"] 371 | wait_time = 0.65 372 | 373 | [node name="PopupMenu2" type="PopupMenu" parent="HBoxContainer/MainColumn/SaveVar/LineEdit"] 374 | items = [ "Cut", null, 0, false, false, 0, 134217816, null, "", false, "Copy", null, 0, false, false, 1, 134217795, null, "", false, "Paste", null, 0, false, false, 2, 134217814, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Select All", null, 0, false, false, 4, 134217793, null, "", false, "Clear", null, 0, false, false, 3, 0, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Undo", null, 0, false, false, 5, 134217818, null, "", false, "Redo", null, 0, false, false, 6, 167772250, null, "", false ] 375 | 376 | [node name="Timer3" type="Timer" parent="HBoxContainer/MainColumn/SaveVar/LineEdit"] 377 | wait_time = 0.65 378 | 379 | [node name="PopupMenu3" type="PopupMenu" parent="HBoxContainer/MainColumn/SaveVar/LineEdit"] 380 | items = [ "Cut", null, 0, false, false, 0, 134217816, null, "", false, "Copy", null, 0, false, false, 1, 134217795, null, "", false, "Paste", null, 0, false, false, 2, 134217814, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Select All", null, 0, false, false, 4, 134217793, null, "", false, "Clear", null, 0, false, false, 3, 0, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Undo", null, 0, false, false, 5, 134217818, null, "", false, "Redo", null, 0, false, false, 6, 167772250, null, "", false ] 381 | 382 | [node name="CheckButton" type="CheckButton" parent="HBoxContainer/MainColumn/SaveVar"] 383 | margin_left = 224.0 384 | margin_right = 300.0 385 | margin_bottom = 40.0 386 | 387 | [node name="Button" type="Button" parent="HBoxContainer/MainColumn/SaveVar"] 388 | margin_left = 295.0 389 | margin_right = 315.0 390 | margin_bottom = 40.0 391 | text = "+" 392 | 393 | [node name="End" type="HBoxContainer" parent="HBoxContainer/MainColumn"] 394 | visible = false 395 | margin_top = 65.0 396 | margin_right = 208.0 397 | margin_bottom = 90.0 398 | 399 | [node name="Label" type="Label" parent="HBoxContainer/MainColumn/End"] 400 | margin_right = 114.0 401 | margin_bottom = 25.0 402 | text = "DIALOG END" 403 | 404 | [node name="AddColumn" type="VBoxContainer" parent="HBoxContainer"] 405 | visible = false 406 | margin_left = 186.0 407 | margin_right = 264.0 408 | margin_bottom = 116.0 409 | grow_horizontal = 2 410 | grow_vertical = 2 411 | 412 | [node name="Options" type="Button" parent="HBoxContainer/AddColumn"] 413 | visible = false 414 | margin_top = 24.0 415 | margin_right = 105.0 416 | margin_bottom = 44.0 417 | toggle_mode = true 418 | text = "Options" 419 | 420 | [node name="Task" type="Button" parent="HBoxContainer/AddColumn"] 421 | margin_right = 78.0 422 | margin_bottom = 20.0 423 | toggle_mode = true 424 | text = "+Task" 425 | 426 | [node name="Skills" type="Button" parent="HBoxContainer/AddColumn"] 427 | margin_top = 24.0 428 | margin_right = 78.0 429 | margin_bottom = 44.0 430 | toggle_mode = true 431 | text = "+Skills" 432 | 433 | [node name="Money" type="Button" parent="HBoxContainer/AddColumn"] 434 | margin_top = 48.0 435 | margin_right = 78.0 436 | margin_bottom = 68.0 437 | toggle_mode = true 438 | text = "Money" 439 | 440 | [node name="EmitSignal" type="Button" parent="HBoxContainer/AddColumn"] 441 | margin_top = 72.0 442 | margin_right = 78.0 443 | margin_bottom = 92.0 444 | toggle_mode = true 445 | text = "EmitSignal" 446 | 447 | [node name="SaveVar" type="Button" parent="HBoxContainer/AddColumn"] 448 | margin_top = 96.0 449 | margin_right = 78.0 450 | margin_bottom = 116.0 451 | toggle_mode = true 452 | text = "+SaveVar" 453 | 454 | [node name="End" type="Button" parent="HBoxContainer/AddColumn"] 455 | margin_top = 96.0 456 | margin_right = 78.0 457 | margin_bottom = 116.0 458 | toggle_mode = true 459 | text = "END" 460 | 461 | [node name="More" type="Button" parent="HBoxContainer"] 462 | margin_left = 248.0 463 | margin_right = 263.0 464 | margin_bottom = 55.0 465 | rect_min_size = Vector2( 15, 0 ) 466 | mouse_default_cursor_shape = 2 467 | custom_styles/normal = SubResource( 1 ) 468 | toggle_mode = true 469 | text = "+" 470 | 471 | [connection signal="close_request" from="." to="." method="_on_GraphNode_close_request"] 472 | [connection signal="resize_request" from="." to="." method="_on_GraphNode_resize_request"] 473 | [connection signal="text_changed" from="HBoxContainer/MainColumn/Title/LineEdit" to="." method="_on_LineEdit_text_changed"] 474 | [connection signal="pressed" from="HBoxContainer/MainColumn/SaveVar/Button" to="." method="_on_new_save_var_button_pressed"] 475 | [connection signal="toggled" from="HBoxContainer/AddColumn/Options" to="." method="_on_Options_toggled"] 476 | [connection signal="toggled" from="HBoxContainer/AddColumn/Task" to="." method="_on_Task_toggled"] 477 | [connection signal="toggled" from="HBoxContainer/AddColumn/Skills" to="." method="_on_Skills_toggled"] 478 | [connection signal="toggled" from="HBoxContainer/AddColumn/Money" to="." method="_on_Money_toggled"] 479 | [connection signal="toggled" from="HBoxContainer/AddColumn/EmitSignal" to="." method="_on_EmitSignal_toggled"] 480 | [connection signal="toggled" from="HBoxContainer/AddColumn/SaveVar" to="." method="_on_SaveVar_toggled"] 481 | [connection signal="toggled" from="HBoxContainer/AddColumn/End" to="." method="_on_End_toggled"] 482 | [connection signal="toggled" from="HBoxContainer/More" to="." method="_on_More_toggled"] 483 | -------------------------------------------------------------------------------- /DialogSystem2/Global/CharacterProfiles.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | var character = { 4 | "Letty": ", your sister", 5 | } 6 | -------------------------------------------------------------------------------- /DialogSystem2/Global/GameSave.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | export(Dictionary) var skills = { 4 | "Charisma": 0, 5 | "Intellect": 0, 6 | "Endurance": 0, 7 | "Dexterity": 0 8 | } 9 | 10 | export(Dictionary) var variables = { 11 | "happy": false, 12 | "sad": false, 13 | "angry": false 14 | } 15 | 16 | export(Dictionary) var visited = { 17 | "Node 0": 0, 18 | "Node 1": 0, 19 | "Node 2": 0, 20 | "Node 3": 0, 21 | } 22 | 23 | export(Dictionary) var brownies = { 24 | "Letty": 0, 25 | "Raymond": 0 26 | } 27 | 28 | export(Dictionary) var character 29 | -------------------------------------------------------------------------------- /DialogSystem2/Global/GameSave.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://Global/GameSave.gd" type="Script" id=1] 4 | 5 | [node name="GameSave" type="Node2D"] 6 | script = ExtResource( 1 ) 7 | variables = { 8 | "angry": false, 9 | "happy": false, 10 | "sad": false 11 | } 12 | -------------------------------------------------------------------------------- /DialogSystem2/Graph.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://Control.gd" type="Script" id=1] 4 | [ext_resource path="res://Assets/LightTheme.tres" type="Theme" id=2] 5 | 6 | [node name="Control" type="Control"] 7 | margin_right = 40.0 8 | margin_bottom = 40.0 9 | theme = ExtResource( 2 ) 10 | script = ExtResource( 1 ) 11 | file_path = "4.2.2023_2028" 12 | 13 | [node name="GraphEdit" type="GraphEdit" parent="."] 14 | margin_top = 2.0 15 | margin_right = 1930.0 16 | margin_bottom = 1086.0 17 | right_disconnects = true 18 | scroll_offset = Vector2( -40, -123 ) 19 | 20 | [node name="HBoxContainer" type="HBoxContainer" parent="."] 21 | margin_left = 27.0 22 | margin_top = 82.0 23 | margin_right = 214.0 24 | margin_bottom = 133.0 25 | custom_constants/separation = 10 26 | 27 | [node name="NewNode" type="Button" parent="HBoxContainer"] 28 | margin_right = 89.0 29 | margin_bottom = 51.0 30 | mouse_default_cursor_shape = 2 31 | text = "+ NODE" 32 | 33 | [node name="NewOption" type="Button" parent="HBoxContainer"] 34 | margin_left = 99.0 35 | margin_right = 206.0 36 | margin_bottom = 51.0 37 | mouse_default_cursor_shape = 2 38 | text = "+ OPTION" 39 | 40 | [node name="Feature" type="Button" parent="HBoxContainer"] 41 | margin_left = 216.0 42 | margin_right = 334.0 43 | margin_bottom = 51.0 44 | mouse_default_cursor_shape = 2 45 | text = "+ FEATURE" 46 | 47 | [node name="NewRoll" type="Button" parent="HBoxContainer"] 48 | margin_left = 344.0 49 | margin_right = 471.0 50 | margin_bottom = 51.0 51 | mouse_default_cursor_shape = 2 52 | text = "+DICE ROLL" 53 | 54 | [node name="Save" type="Button" parent="HBoxContainer"] 55 | margin_left = 481.0 56 | margin_right = 539.0 57 | margin_bottom = 51.0 58 | mouse_default_cursor_shape = 2 59 | text = "RUN" 60 | 61 | [node name="Clear" type="Button" parent="HBoxContainer"] 62 | margin_left = 549.0 63 | margin_right = 627.0 64 | margin_bottom = 51.0 65 | mouse_default_cursor_shape = 2 66 | text = "CLEAR" 67 | 68 | [node name="Notification" type="Label" parent="HBoxContainer"] 69 | visible = false 70 | margin_left = 509.0 71 | margin_top = 13.0 72 | margin_right = 575.0 73 | margin_bottom = 38.0 74 | text = "SAVED!" 75 | 76 | [node name="Timer" type="Timer" parent="."] 77 | wait_time = 3.0 78 | one_shot = true 79 | 80 | [connection signal="connection_request" from="GraphEdit" to="." method="_on_GraphEdit_connection_request"] 81 | [connection signal="disconnection_request" from="GraphEdit" to="." method="_on_GraphEdit_disconnection_request"] 82 | [connection signal="gui_input" from="GraphEdit" to="." method="_on_GraphEdit_gui_input"] 83 | [connection signal="pressed" from="HBoxContainer/NewNode" to="." method="_on_Button_pressed"] 84 | [connection signal="pressed" from="HBoxContainer/NewOption" to="." method="_on_NewOption_pressed"] 85 | [connection signal="pressed" from="HBoxContainer/Feature" to="." method="_on_feature_pressed"] 86 | [connection signal="pressed" from="HBoxContainer/NewRoll" to="." method="_on_NewRoll_pressed"] 87 | [connection signal="pressed" from="HBoxContainer/Save" to="." method="_on_RunProgram_pressed"] 88 | [connection signal="pressed" from="HBoxContainer/Clear" to="." method="_on_Clear_pressed"] 89 | -------------------------------------------------------------------------------- /DialogSystem2/GraphNode.gd: -------------------------------------------------------------------------------- 1 | extends GraphNode 2 | 3 | export(NodePath) onready var comment_box = get_node(comment_box) as HBoxContainer 4 | export(NodePath) onready var main = get_node(main) as VBoxContainer 5 | export(NodePath) onready var more = get_node(more) as VBoxContainer 6 | export(NodePath) onready var text = get_node(text) as HBoxContainer 7 | export(NodePath) onready var display_name = get_node(display_name) as HBoxContainer 8 | export(NodePath) onready var node_title = get_node(node_title) as LineEdit 9 | 10 | export(NodePath) onready var character = get_node(character) as HBoxContainer 11 | export(NodePath) onready var character_drop = get_node(character_drop) as OptionButton 12 | 13 | export(NodePath) onready var line_asset = get_node(line_asset) as HBoxContainer 14 | 15 | var if_stack 16 | 17 | # edit character drop down items 18 | #var profiles = ["Raymond", "Mable", "???", "Ren", "Narration", "Uncle Ping"] 19 | var profiles = ["Santa", "Elf"] 20 | 21 | var stack_count = 0 22 | var save_var_count = 0 23 | var conditionals_list = [] 24 | var save_var_list = ["SaveVar"] 25 | var node_type = "Node" 26 | 27 | func _ready(): 28 | var profile_index = 0 29 | for profile in profiles: 30 | character_drop.add_item(profile, profile_index) 31 | profile_index += 1 32 | 33 | func _on_GraphNode_resize_request(new_minsize): 34 | rect_size = new_minsize 35 | 36 | func _on_GraphNode_close_request(): 37 | # if last node is deleted, replace that node index and name 38 | if get_parent().get_parent().node_index == (int(self.name.lstrip("Node "))): 39 | get_parent().get_parent().node_index -= 1 40 | queue_free() 41 | 42 | 43 | 44 | 45 | func _on_Conditional_pressed(): 46 | var conditionals_stack = load("res://ConditionalsStack.tscn") 47 | conditionals_stack = conditionals_stack.instance() 48 | main.add_child(conditionals_stack) 49 | 50 | stack_count += 1 51 | 52 | if stack_count >= 2: 53 | conditionals_stack.stack_index.text = "OR" 54 | 55 | conditionals_stack.name = "IfStack" + str(stack_count) 56 | conditionals_list.append(conditionals_stack.name) 57 | 58 | if_stack = conditionals_stack 59 | 60 | 61 | 62 | func _on_DisplayName_toggled(button_pressed): 63 | if button_pressed: 64 | display_name.visible = true 65 | else: 66 | display_name.visible = false 67 | 68 | 69 | func _on_Comment_toggled(button_pressed): 70 | if button_pressed: 71 | comment_box.visible = true 72 | else: 73 | comment_box.visible = false 74 | 75 | 76 | 77 | 78 | 79 | func _on_More_toggled(button_pressed): 80 | var add_column = $HBoxContainer/AddColumn 81 | 82 | if button_pressed: 83 | add_column.visible = true 84 | else: 85 | add_column.visible = false 86 | 87 | 88 | 89 | func _on_LineAsset_toggled(button_pressed): 90 | if button_pressed: 91 | line_asset.visible = true 92 | else: 93 | line_asset.visible = false 94 | 95 | 96 | 97 | func _on_Text_toggled(button_pressed): 98 | if button_pressed: 99 | text.visible = true 100 | else: 101 | text.visible = false 102 | 103 | 104 | 105 | 106 | 107 | func _on_LineEdit_text_changed(new_text): 108 | name = "NODE_" + new_text 109 | title = "NODE_" + new_text 110 | -------------------------------------------------------------------------------- /DialogSystem2/GraphNode.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://GraphNode.gd" type="Script" id=1] 4 | 5 | [sub_resource type="StyleBoxFlat" id=1] 6 | bg_color = Color( 0.6, 0.6, 0.6, 0 ) 7 | 8 | [node name="GraphNode" type="GraphNode" groups=["graph_nodes"]] 9 | margin_right = 390.0 10 | margin_bottom = 257.0 11 | title = "New node" 12 | show_close = true 13 | resizable = true 14 | slot/0/left_enabled = true 15 | slot/0/left_type = 0 16 | slot/0/left_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 17 | slot/0/right_enabled = true 18 | slot/0/right_type = 0 19 | slot/0/right_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 20 | script = ExtResource( 1 ) 21 | comment_box = NodePath("HBoxContainer/MainColumn/Comment") 22 | main = NodePath("HBoxContainer/MainColumn") 23 | more = NodePath("HBoxContainer/AddColumn") 24 | text = NodePath("HBoxContainer/MainColumn/Text") 25 | display_name = NodePath("HBoxContainer/MainColumn/DisplayName") 26 | node_title = NodePath("HBoxContainer/MainColumn/Title/LineEdit") 27 | character = NodePath("HBoxContainer/MainColumn/Character") 28 | character_drop = NodePath("HBoxContainer/MainColumn/Character/CharacterDrop") 29 | line_asset = NodePath("HBoxContainer/MainColumn/LineAsset") 30 | 31 | [node name="HBoxContainer" type="HBoxContainer" parent="."] 32 | margin_left = 16.0 33 | margin_top = 24.0 34 | margin_right = 574.0 35 | margin_bottom = 188.0 36 | custom_constants/separation = 40 37 | 38 | [node name="MainColumn" type="VBoxContainer" parent="HBoxContainer"] 39 | margin_right = 503.0 40 | margin_bottom = 164.0 41 | custom_constants/separation = 10 42 | 43 | [node name="Title" type="HBoxContainer" parent="HBoxContainer/MainColumn"] 44 | margin_right = 503.0 45 | margin_bottom = 24.0 46 | custom_constants/separation = 60 47 | 48 | [node name="Label" type="Label" parent="HBoxContainer/MainColumn/Title"] 49 | margin_top = 5.0 50 | margin_right = 28.0 51 | margin_bottom = 19.0 52 | text = "Title" 53 | 54 | [node name="LineEdit" type="LineEdit" parent="HBoxContainer/MainColumn/Title"] 55 | margin_left = 88.0 56 | margin_right = 146.0 57 | margin_bottom = 24.0 58 | 59 | [node name="Character" type="HBoxContainer" parent="HBoxContainer/MainColumn"] 60 | margin_top = 34.0 61 | margin_right = 503.0 62 | margin_bottom = 54.0 63 | custom_constants/separation = 30 64 | 65 | [node name="Character" type="Label" parent="HBoxContainer/MainColumn/Character"] 66 | margin_top = 3.0 67 | margin_right = 60.0 68 | margin_bottom = 17.0 69 | text = "Character" 70 | 71 | [node name="CharacterDrop" type="OptionButton" parent="HBoxContainer/MainColumn/Character"] 72 | margin_left = 90.0 73 | margin_right = 178.0 74 | margin_bottom = 20.0 75 | text = "Raymond" 76 | 77 | [node name="DisplayName" type="HBoxContainer" parent="HBoxContainer/MainColumn"] 78 | visible = false 79 | margin_top = 41.0 80 | margin_right = 314.0 81 | margin_bottom = 96.0 82 | custom_constants/separation = -9 83 | 84 | [node name="DisplayName" type="Label" parent="HBoxContainer/MainColumn/DisplayName"] 85 | margin_top = 15.0 86 | margin_right = 122.0 87 | margin_bottom = 40.0 88 | text = "Display Name" 89 | 90 | [node name="LineEdit" type="LineEdit" parent="HBoxContainer/MainColumn/DisplayName"] 91 | margin_left = 113.0 92 | margin_right = 221.0 93 | margin_bottom = 55.0 94 | 95 | [node name="LineAsset" type="HBoxContainer" parent="HBoxContainer/MainColumn"] 96 | visible = false 97 | margin_top = 41.0 98 | margin_right = 314.0 99 | margin_bottom = 96.0 100 | custom_constants/separation = 65 101 | 102 | [node name="LineAsset" type="Label" parent="HBoxContainer/MainColumn/LineAsset"] 103 | margin_top = 15.0 104 | margin_right = 48.0 105 | margin_bottom = 40.0 106 | text = "Asset" 107 | 108 | [node name="LineEdit" type="LineEdit" parent="HBoxContainer/MainColumn/LineAsset"] 109 | margin_left = 113.0 110 | margin_right = 233.0 111 | margin_bottom = 55.0 112 | rect_min_size = Vector2( 120, 0 ) 113 | 114 | [node name="Text" type="HBoxContainer" parent="HBoxContainer/MainColumn"] 115 | margin_top = 64.0 116 | margin_right = 503.0 117 | margin_bottom = 164.0 118 | custom_constants/separation = 76 119 | 120 | [node name="Text" type="Label" parent="HBoxContainer/MainColumn/Text"] 121 | margin_top = 43.0 122 | margin_right = 27.0 123 | margin_bottom = 57.0 124 | text = "Text" 125 | 126 | [node name="TextEdit" type="TextEdit" parent="HBoxContainer/MainColumn/Text"] 127 | margin_left = 103.0 128 | margin_right = 503.0 129 | margin_bottom = 100.0 130 | rect_min_size = Vector2( 400, 100 ) 131 | wrap_enabled = true 132 | caret_blink = true 133 | 134 | [node name="Comment" type="HBoxContainer" parent="HBoxContainer/MainColumn"] 135 | visible = false 136 | margin_top = 140.0 137 | margin_right = 503.0 138 | margin_bottom = 190.0 139 | custom_constants/separation = 28 140 | 141 | [node name="Comment" type="Label" parent="HBoxContainer/MainColumn/Comment"] 142 | margin_top = 18.0 143 | margin_right = 63.0 144 | margin_bottom = 32.0 145 | text = "Comment" 146 | 147 | [node name="Comment2" type="TextEdit" parent="HBoxContainer/MainColumn/Comment"] 148 | margin_left = 91.0 149 | margin_right = 291.0 150 | margin_bottom = 50.0 151 | rect_min_size = Vector2( 200, 50 ) 152 | custom_colors/font_color = Color( 0, 0, 0, 1 ) 153 | custom_colors/background_color = Color( 1, 0.933333, 0.694118, 1 ) 154 | syntax_highlighting = true 155 | wrap_enabled = true 156 | 157 | [node name="AddColumn" type="VBoxContainer" parent="HBoxContainer"] 158 | visible = false 159 | margin_left = 543.0 160 | margin_right = 648.0 161 | margin_bottom = 236.0 162 | grow_horizontal = 2 163 | grow_vertical = 2 164 | 165 | [node name="DisplayName" type="Button" parent="HBoxContainer/AddColumn"] 166 | margin_right = 105.0 167 | margin_bottom = 20.0 168 | toggle_mode = true 169 | text = "+DisplayName" 170 | 171 | [node name="Options" type="Button" parent="HBoxContainer/AddColumn"] 172 | visible = false 173 | margin_top = 24.0 174 | margin_right = 105.0 175 | margin_bottom = 44.0 176 | toggle_mode = true 177 | text = "Options" 178 | 179 | [node name="Text" type="Button" parent="HBoxContainer/AddColumn"] 180 | margin_top = 96.0 181 | margin_right = 105.0 182 | margin_bottom = 116.0 183 | toggle_mode = true 184 | text = "Text" 185 | 186 | [node name="Conditional" type="Button" parent="HBoxContainer/AddColumn"] 187 | margin_top = 144.0 188 | margin_right = 105.0 189 | margin_bottom = 164.0 190 | text = "+Conditional" 191 | 192 | [node name="LineAsset" type="Button" parent="HBoxContainer/AddColumn"] 193 | margin_top = 192.0 194 | margin_right = 105.0 195 | margin_bottom = 212.0 196 | toggle_mode = true 197 | text = "+LineAsset" 198 | 199 | [node name="Comment" type="Button" parent="HBoxContainer/AddColumn"] 200 | margin_top = 216.0 201 | margin_right = 105.0 202 | margin_bottom = 236.0 203 | toggle_mode = true 204 | text = "+Comment" 205 | 206 | [node name="More" type="Button" parent="HBoxContainer"] 207 | margin_left = 543.0 208 | margin_right = 558.0 209 | margin_bottom = 164.0 210 | rect_min_size = Vector2( 15, 0 ) 211 | mouse_default_cursor_shape = 2 212 | custom_styles/normal = SubResource( 1 ) 213 | toggle_mode = true 214 | text = "+" 215 | 216 | [connection signal="close_request" from="." to="." method="_on_GraphNode_close_request"] 217 | [connection signal="resize_request" from="." to="." method="_on_GraphNode_resize_request"] 218 | [connection signal="text_changed" from="HBoxContainer/MainColumn/Title/LineEdit" to="." method="_on_LineEdit_text_changed"] 219 | [connection signal="toggled" from="HBoxContainer/AddColumn/DisplayName" to="." method="_on_DisplayName_toggled"] 220 | [connection signal="toggled" from="HBoxContainer/AddColumn/Options" to="." method="_on_Options_toggled"] 221 | [connection signal="toggled" from="HBoxContainer/AddColumn/Text" to="." method="_on_Text_toggled"] 222 | [connection signal="pressed" from="HBoxContainer/AddColumn/Conditional" to="." method="_on_Conditional_pressed"] 223 | [connection signal="toggled" from="HBoxContainer/AddColumn/LineAsset" to="." method="_on_LineAsset_toggled"] 224 | [connection signal="toggled" from="HBoxContainer/AddColumn/Comment" to="." method="_on_Comment_toggled"] 225 | [connection signal="toggled" from="HBoxContainer/More" to="." method="_on_More_toggled"] 226 | -------------------------------------------------------------------------------- /DialogSystem2/JSON_template: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amberlim/GodotDialogSystem/310ddfdfa495c15ae8d201e43bbbd3222650db70/DialogSystem2/JSON_template -------------------------------------------------------------------------------- /DialogSystem2/JSON_template.json: -------------------------------------------------------------------------------- 1 | [ 2 | 3 | { 4 | "id": "", 5 | "character": "", 6 | "display name": "", # localise 7 | "text": "", #localise 8 | "task":"", # auto splash 9 | "emit signal":"", 10 | "save var": {}, # auto save 11 | "skill lvl up": {}, # auto update 12 | 13 | "conditionals": 14 | [ 15 | 16 | { 17 | "if var": {}, 18 | "if skill": {}, 19 | "if visited": {}, 20 | "if npc brownie": {}, 21 | }, 22 | ], 23 | 24 | 25 | "options": [{#option, repeatable}], 26 | "line asset": "", #name of asset 27 | 28 | "go to": "node id" 29 | 30 | }, 31 | 32 | 33 | { 34 | "id": "Node 2", 35 | "text":"", 36 | "option": true, 37 | "save var": {}, 38 | "go to": "node id" 39 | 40 | "conditionals": 41 | [ 42 | 43 | { 44 | "if var": {}, 45 | "if skill": {}, 46 | "if visited": {}, 47 | "if npc brownie": {}, 48 | }, 49 | ], 50 | 51 | } 52 | 53 | ] 54 | -------------------------------------------------------------------------------- /DialogSystem2/Option.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene format=2] 2 | 3 | [node name="Option" type="HBoxContainer"] 4 | margin_left = 16.0 5 | margin_top = 180.0 6 | margin_right = 359.0 7 | margin_bottom = 204.0 8 | custom_constants/separation = 39 9 | 10 | [node name="Option" type="Label" parent="."] 11 | margin_top = 5.0 12 | margin_right = 56.0 13 | margin_bottom = 19.0 14 | text = "Option 1" 15 | 16 | [node name="LineEdit" type="LineEdit" parent="."] 17 | margin_left = 95.0 18 | margin_right = 295.0 19 | margin_bottom = 24.0 20 | rect_min_size = Vector2( 200, 0 ) 21 | 22 | [node name="RepeatableOption" type="CheckBox" parent="."] 23 | margin_left = 334.0 24 | margin_right = 433.0 25 | margin_bottom = 24.0 26 | text = "Repeatable" 27 | -------------------------------------------------------------------------------- /DialogSystem2/OptionNode.gd: -------------------------------------------------------------------------------- 1 | extends GraphNode 2 | 3 | var node_type = "Option" 4 | 5 | export(NodePath) onready var comment_box = get_node(comment_box) as HBoxContainer 6 | 7 | export(NodePath) onready var main = get_node(main) as VBoxContainer 8 | export(NodePath) onready var more = get_node(more) as VBoxContainer 9 | export(NodePath) onready var text = get_node(text) as HBoxContainer 10 | export(NodePath) onready var node_title = get_node(node_title) as LineEdit 11 | 12 | var if_stack 13 | 14 | 15 | var stack_count = 0 16 | var save_var_list = ["SaveVar"] 17 | var save_var_count = 0 18 | var conditionals_list = [] 19 | 20 | func _on_OptionNode_resize_request(new_minsize): 21 | rect_size = new_minsize 22 | 23 | func _on_OptionNode_close_request(): 24 | # if last node is deleted, replace that node index and name 25 | if get_parent().get_parent().node_index == (int(self.name.lstrip("Node "))): 26 | get_parent().get_parent().node_index -= 1 27 | queue_free() 28 | 29 | 30 | func _on_LineEdit_text_changed(new_text): 31 | title = "OPTION_" + new_text 32 | name = "OPTION_" + new_text 33 | 34 | func _on_Conditional_pressed(): 35 | var conditionals_stack = load("res://ConditionalsStack.tscn") 36 | conditionals_stack = conditionals_stack.instance() 37 | main.add_child(conditionals_stack) 38 | 39 | stack_count += 1 40 | 41 | if stack_count >= 2: 42 | conditionals_stack.stack_index.text = "OR" 43 | 44 | conditionals_stack.name = "IfStack" + str(stack_count) 45 | conditionals_list.append(conditionals_stack.name) 46 | 47 | if_stack = conditionals_stack 48 | 49 | 50 | func _on_Comment_toggled(button_pressed): 51 | if button_pressed: 52 | comment_box.visible = true 53 | else: 54 | comment_box.visible = false 55 | 56 | 57 | 58 | 59 | 60 | func _on_More_toggled(button_pressed): 61 | var add_column = $HBoxContainer/AddColumn 62 | 63 | if button_pressed: 64 | add_column.visible = true 65 | else: 66 | add_column.visible = false 67 | 68 | 69 | func _on_Text_toggled(button_pressed): 70 | if button_pressed: 71 | text.visible = true 72 | else: 73 | text.visible = false 74 | 75 | -------------------------------------------------------------------------------- /DialogSystem2/OptionNode.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=15 format=2] 2 | 3 | [ext_resource path="res://OptionNode.gd" type="Script" id=1] 4 | [ext_resource path="res://Assets/AdobeClean-SemiCn.otf" type="DynamicFontData" id=2] 5 | [ext_resource path="res://Assets/Clean.tres" type="DynamicFont" id=3] 6 | [ext_resource path="res://Assets/port.png" type="Texture" id=4] 7 | 8 | [sub_resource type="StyleBoxFlat" id=12] 9 | content_margin_left = 10.0 10 | content_margin_right = 10.0 11 | bg_color = Color( 0.639216, 0.258824, 0.0823529, 0.380392 ) 12 | border_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 13 | corner_radius_top_left = 4 14 | corner_radius_top_right = 4 15 | corner_radius_bottom_right = 4 16 | corner_radius_bottom_left = 4 17 | 18 | [sub_resource type="StyleBoxFlat" id=13] 19 | content_margin_left = 10.0 20 | content_margin_right = 10.0 21 | bg_color = Color( 0.639216, 0.258824, 0.0823529, 0.0941176 ) 22 | border_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 23 | corner_radius_top_left = 4 24 | corner_radius_top_right = 4 25 | corner_radius_bottom_right = 4 26 | corner_radius_bottom_left = 4 27 | 28 | [sub_resource type="StyleBoxFlat" id=14] 29 | bg_color = Color( 0.796078, 0.784314, 0.741176, 1 ) 30 | 31 | [sub_resource type="StyleBoxFlat" id=9] 32 | content_margin_top = 30.0 33 | bg_color = Color( 0.639216, 0.258824, 0.0823529, 0.105882 ) 34 | border_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 35 | expand_margin_left = 15.0 36 | expand_margin_right = 15.0 37 | expand_margin_top = 15.0 38 | expand_margin_bottom = 15.0 39 | 40 | [sub_resource type="StyleBoxFlat" id=17] 41 | content_margin_top = 30.0 42 | bg_color = Color( 1, 0.611765, 0.435294, 0.172549 ) 43 | border_width_left = 3 44 | border_width_top = 3 45 | border_width_right = 3 46 | border_width_bottom = 3 47 | border_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 48 | expand_margin_left = 15.0 49 | expand_margin_right = 15.0 50 | expand_margin_top = 15.0 51 | expand_margin_bottom = 15.0 52 | 53 | [sub_resource type="DynamicFont" id=7] 54 | size = 24 55 | use_mipmaps = true 56 | use_filter = true 57 | extra_spacing_char = 2 58 | font_data = ExtResource( 2 ) 59 | 60 | [sub_resource type="StyleBoxFlat" id=8] 61 | content_margin_left = 12.0 62 | content_margin_right = 12.0 63 | content_margin_top = 12.0 64 | content_margin_bottom = 12.0 65 | bg_color = Color( 0.796078, 0.784314, 0.741176, 1 ) 66 | 67 | [sub_resource type="StyleBoxFlat" id=11] 68 | content_margin_left = 12.0 69 | content_margin_right = 12.0 70 | content_margin_top = 12.0 71 | content_margin_bottom = 12.0 72 | bg_color = Color( 0.796078, 0.784314, 0.741176, 1 ) 73 | corner_radius_top_left = 6 74 | corner_radius_top_right = 6 75 | corner_radius_bottom_right = 6 76 | corner_radius_bottom_left = 6 77 | 78 | [sub_resource type="Theme" id=16] 79 | default_font = ExtResource( 3 ) 80 | Button/colors/font_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 81 | Button/constants/hseparation = 2 82 | Button/fonts/font = ExtResource( 3 ) 83 | Button/styles/focus = SubResource( 12 ) 84 | Button/styles/hover = SubResource( 12 ) 85 | Button/styles/normal = SubResource( 13 ) 86 | Button/styles/pressed = SubResource( 12 ) 87 | CheckBox/constants/hseparation = 20 88 | GraphEdit/styles/bg = SubResource( 14 ) 89 | GraphNode/constants/port_offset = -17 90 | GraphNode/icons/port = ExtResource( 4 ) 91 | GraphNode/styles/frame = SubResource( 9 ) 92 | GraphNode/styles/selectedframe = SubResource( 17 ) 93 | Label/colors/font_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 94 | Label/fonts/font = null 95 | LineEdit/colors/font_color = Color( 0, 0, 0, 1 ) 96 | LineEdit/fonts/font = SubResource( 7 ) 97 | LineEdit/styles/normal = SubResource( 8 ) 98 | TextEdit/colors/font_color = Color( 0, 0, 0, 1 ) 99 | TextEdit/fonts/font = null 100 | TextEdit/styles/normal = SubResource( 11 ) 101 | 102 | [sub_resource type="StyleBoxFlat" id=1] 103 | bg_color = Color( 0.6, 0.6, 0.6, 0 ) 104 | 105 | [node name="OptionNode" type="GraphNode" groups=["graph_nodes"]] 106 | anchor_right = 1.0 107 | anchor_bottom = 1.0 108 | margin_right = -1530.0 109 | margin_bottom = -914.0 110 | theme = SubResource( 16 ) 111 | title = "New Option" 112 | show_close = true 113 | resizable = true 114 | slot/0/left_enabled = false 115 | slot/0/left_type = 0 116 | slot/0/left_color = Color( 0.235294, 0.32549, 0.219608, 1 ) 117 | slot/0/right_enabled = false 118 | slot/0/right_type = 0 119 | slot/0/right_color = Color( 0.235294, 0.32549, 0.219608, 1 ) 120 | slot/1/left_enabled = true 121 | slot/1/left_type = 0 122 | slot/1/left_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 123 | slot/1/right_enabled = true 124 | slot/1/right_type = 0 125 | slot/1/right_color = Color( 0.639216, 0.258824, 0.0823529, 1 ) 126 | script = ExtResource( 1 ) 127 | comment_box = NodePath("HBoxContainer/MainColumn/Comment") 128 | main = NodePath("HBoxContainer/MainColumn") 129 | more = NodePath("HBoxContainer/AddColumn") 130 | text = NodePath("HBoxContainer/MainColumn/Text") 131 | node_title = NodePath("HBoxContainer/MainColumn/Title/LineEdit") 132 | 133 | [node name="Label" type="Label" parent="."] 134 | margin_top = 30.0 135 | margin_right = 390.0 136 | margin_bottom = 55.0 137 | text = "OPTION" 138 | 139 | [node name="HBoxContainer" type="HBoxContainer" parent="."] 140 | margin_top = 56.0 141 | margin_right = 390.0 142 | margin_bottom = 221.0 143 | custom_constants/separation = 40 144 | 145 | [node name="MainColumn" type="VBoxContainer" parent="HBoxContainer"] 146 | margin_right = 314.0 147 | margin_bottom = 165.0 148 | custom_constants/separation = 10 149 | 150 | [node name="Title" type="HBoxContainer" parent="HBoxContainer/MainColumn"] 151 | margin_right = 314.0 152 | margin_bottom = 55.0 153 | custom_constants/separation = 60 154 | 155 | [node name="Label" type="Label" parent="HBoxContainer/MainColumn/Title"] 156 | margin_top = 15.0 157 | margin_right = 40.0 158 | margin_bottom = 40.0 159 | text = "Title" 160 | 161 | [node name="LineEdit" type="LineEdit" parent="HBoxContainer/MainColumn/Title"] 162 | margin_left = 100.0 163 | margin_right = 208.0 164 | margin_bottom = 55.0 165 | 166 | [node name="Text" type="HBoxContainer" parent="HBoxContainer/MainColumn"] 167 | margin_top = 65.0 168 | margin_right = 314.0 169 | margin_bottom = 165.0 170 | custom_constants/separation = 76 171 | 172 | [node name="Text" type="Label" parent="HBoxContainer/MainColumn/Text"] 173 | margin_top = 37.0 174 | margin_right = 38.0 175 | margin_bottom = 62.0 176 | text = "Text" 177 | 178 | [node name="TextEdit" type="TextEdit" parent="HBoxContainer/MainColumn/Text"] 179 | margin_left = 114.0 180 | margin_right = 314.0 181 | margin_bottom = 100.0 182 | rect_min_size = Vector2( 200, 100 ) 183 | wrap_enabled = true 184 | 185 | [node name="Comment" type="HBoxContainer" parent="HBoxContainer/MainColumn"] 186 | visible = false 187 | margin_top = 110.0 188 | margin_right = 303.0 189 | margin_bottom = 160.0 190 | custom_constants/separation = 28 191 | 192 | [node name="Comment" type="Label" parent="HBoxContainer/MainColumn/Comment"] 193 | margin_top = 18.0 194 | margin_right = 63.0 195 | margin_bottom = 32.0 196 | text = "Comment" 197 | 198 | [node name="Comment2" type="TextEdit" parent="HBoxContainer/MainColumn/Comment"] 199 | margin_left = 91.0 200 | margin_right = 291.0 201 | margin_bottom = 50.0 202 | rect_min_size = Vector2( 200, 50 ) 203 | custom_colors/font_color = Color( 0, 0, 0, 1 ) 204 | custom_colors/background_color = Color( 1, 0.933333, 0.694118, 1 ) 205 | syntax_highlighting = true 206 | wrap_enabled = true 207 | 208 | [node name="AddColumn" type="VBoxContainer" parent="HBoxContainer"] 209 | visible = false 210 | margin_left = 343.0 211 | margin_right = 448.0 212 | margin_bottom = 260.0 213 | 214 | [node name="Text" type="Button" parent="HBoxContainer/AddColumn"] 215 | margin_top = 120.0 216 | margin_right = 105.0 217 | margin_bottom = 140.0 218 | toggle_mode = true 219 | text = "Text" 220 | 221 | [node name="Conditional" type="Button" parent="HBoxContainer/AddColumn"] 222 | margin_top = 168.0 223 | margin_right = 105.0 224 | margin_bottom = 188.0 225 | text = "+Conditional" 226 | 227 | [node name="Comment" type="Button" parent="HBoxContainer/AddColumn"] 228 | margin_top = 240.0 229 | margin_right = 105.0 230 | margin_bottom = 260.0 231 | toggle_mode = true 232 | text = "+Comment" 233 | 234 | [node name="More" type="Button" parent="HBoxContainer"] 235 | margin_left = 354.0 236 | margin_right = 369.0 237 | margin_bottom = 165.0 238 | rect_min_size = Vector2( 15, 0 ) 239 | mouse_default_cursor_shape = 2 240 | custom_styles/normal = SubResource( 1 ) 241 | toggle_mode = true 242 | text = "+" 243 | 244 | [connection signal="close_request" from="." to="." method="_on_OptionNode_close_request"] 245 | [connection signal="resize_request" from="." to="." method="_on_OptionNode_resize_request"] 246 | [connection signal="text_changed" from="HBoxContainer/MainColumn/Title/LineEdit" to="." method="_on_LineEdit_text_changed"] 247 | [connection signal="toggled" from="HBoxContainer/AddColumn/Text" to="." method="_on_Text_toggled"] 248 | [connection signal="pressed" from="HBoxContainer/AddColumn/Conditional" to="." method="_on_Conditional_pressed"] 249 | [connection signal="toggled" from="HBoxContainer/AddColumn/Comment" to="." method="_on_Comment_toggled"] 250 | [connection signal="toggled" from="HBoxContainer/More" to="." method="_on_More_toggled"] 251 | -------------------------------------------------------------------------------- /DialogSystem2/SaveVar.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene format=2] 2 | 3 | [node name="SaveVar" type="HBoxContainer"] 4 | margin_top = 30.0 5 | margin_right = 345.0 6 | margin_bottom = 70.0 7 | custom_constants/separation = 5 8 | 9 | [node name="SaveVar" type="Label" parent="."] 10 | margin_top = 13.0 11 | margin_right = 84.0 12 | margin_bottom = 27.0 13 | text = "Save Variable" 14 | 15 | [node name="SaveVar2" type="LineEdit" parent="."] 16 | margin_left = 89.0 17 | margin_right = 239.0 18 | margin_bottom = 40.0 19 | rect_min_size = Vector2( 150, 0 ) 20 | 21 | [node name="CheckButton" type="CheckButton" parent="."] 22 | margin_left = 244.0 23 | margin_right = 320.0 24 | margin_bottom = 40.0 25 | -------------------------------------------------------------------------------- /DialogSystem2/Test.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://test.gd" type="Script" id=1] 4 | 5 | [node name="Test" type="Node2D"] 6 | script = ExtResource( 1 ) 7 | -------------------------------------------------------------------------------- /DialogSystem2/default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | 5 | [resource] 6 | background_mode = 2 7 | background_sky = SubResource( 1 ) 8 | -------------------------------------------------------------------------------- /DialogSystem2/export_presets.cfg: -------------------------------------------------------------------------------- 1 | [preset.0] 2 | 3 | name="Dialog System" 4 | platform="Mac OSX" 5 | runnable=true 6 | custom_features="" 7 | export_filter="all_resources" 8 | include_filter=".json" 9 | exclude_filter="" 10 | export_path="../Dialog System 2.dmg" 11 | script_export_mode=1 12 | script_encryption_key="" 13 | 14 | [preset.0.options] 15 | 16 | custom_template/debug="" 17 | custom_template/release="" 18 | application/name="Dialog System" 19 | application/info="Made with Godot Engine" 20 | application/icon="" 21 | application/identifier="com.dialogsystem.app" 22 | application/signature="" 23 | application/app_category="Games" 24 | application/short_version="1.0" 25 | application/version="1.0" 26 | application/copyright="" 27 | display/high_res=false 28 | privacy/camera_usage_description="" 29 | privacy/microphone_usage_description="" 30 | codesign/enable=true 31 | codesign/identity="" 32 | codesign/timestamp=true 33 | codesign/hardened_runtime=true 34 | codesign/replace_existing_signature=true 35 | codesign/entitlements/custom_file="" 36 | codesign/entitlements/allow_jit_code_execution=false 37 | codesign/entitlements/allow_unsigned_executable_memory=false 38 | codesign/entitlements/allow_dyld_environment_variables=false 39 | codesign/entitlements/disable_library_validation=false 40 | codesign/entitlements/audio_input=false 41 | codesign/entitlements/camera=false 42 | codesign/entitlements/location=false 43 | codesign/entitlements/address_book=false 44 | codesign/entitlements/calendars=false 45 | codesign/entitlements/photos_library=false 46 | codesign/entitlements/apple_events=false 47 | codesign/entitlements/debugging=false 48 | codesign/entitlements/app_sandbox/enabled=false 49 | codesign/entitlements/app_sandbox/network_server=false 50 | codesign/entitlements/app_sandbox/network_client=false 51 | codesign/entitlements/app_sandbox/device_usb=false 52 | codesign/entitlements/app_sandbox/device_bluetooth=false 53 | codesign/entitlements/app_sandbox/files_downloads=0 54 | codesign/entitlements/app_sandbox/files_pictures=0 55 | codesign/entitlements/app_sandbox/files_music=0 56 | codesign/entitlements/app_sandbox/files_movies=0 57 | codesign/custom_options=PoolStringArray( ) 58 | notarization/enable=false 59 | notarization/apple_id_name="" 60 | notarization/apple_id_password="" 61 | notarization/apple_team_id="" 62 | texture_format/s3tc=true 63 | texture_format/etc=false 64 | texture_format/etc2=false 65 | -------------------------------------------------------------------------------- /DialogSystem2/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amberlim/GodotDialogSystem/310ddfdfa495c15ae8d201e43bbbd3222650db70/DialogSystem2/icon.png -------------------------------------------------------------------------------- /DialogSystem2/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://icon.png" 13 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /DialogSystem2/icon.png.import copy: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://icon.png" 13 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /DialogSystem2/project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | [application] 12 | 13 | config/name="Dialog System 2" 14 | run/main_scene="res://Graph.tscn" 15 | config/icon="res://icon.png" 16 | 17 | [autoload] 18 | 19 | CharacterProfiles="*res://Global/CharacterProfiles.gd" 20 | GameSave="*res://Global/GameSave.gd" 21 | 22 | [display] 23 | 24 | window/size/width=1920 25 | window/size/height=1080 26 | window/size/fullscreen=true 27 | window/stretch/mode="2d" 28 | 29 | [input] 30 | 31 | right_click={ 32 | "deadzone": 0.5, 33 | "events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":2,"pressed":false,"doubleclick":false,"script":null) 34 | ] 35 | } 36 | save={ 37 | "deadzone": 0.5, 38 | "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":true,"command":true,"pressed":false,"scancode":83,"physical_scancode":0,"unicode":0,"echo":false,"script":null) 39 | ] 40 | } 41 | new_option={ 42 | "deadzone": 0.5, 43 | "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":true,"control":false,"meta":false,"command":false,"pressed":false,"scancode":79,"physical_scancode":0,"unicode":0,"echo":false,"script":null) 44 | ] 45 | } 46 | 47 | [physics] 48 | 49 | common/enable_pause_aware_picking=true 50 | 51 | [rendering] 52 | 53 | environment/default_environment="res://default_env.tres" 54 | -------------------------------------------------------------------------------- /DialogSystem2/test.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | var dict = { 3 | "one": 1, 4 | "two": 2 5 | } 6 | 7 | func _ready(): 8 | var node_name = "Node 200" 9 | node_name = int(node_name.lstrip("Node ")) 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Amberlim 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GodotDialogSystem 🦖 2 | An untitled godot dialog system waiting to be named a cool name. 3 | 4 | This system converts your story/dialog into a JSON file which you can then use to create your dialog in game. 5 | 6 | CURRENTLY ONLY SUPPORTING GODOT 3++ 7 | 8 | ### Brief Steps to Start Your Story 9 | 1. Open the project.gd file in the DialogSystem2 folder. 10 | 2. Enter a new or existing file name (without file extension suffix). Run the project. 11 | 3. Check ```Project>Project Settings>Autoload``` for global variables and character profiles. 12 | 4. In the visual editor, click **RUN** to save. Files will be saved at ```~/.local/share/godot/app_userdata/file_name``` on Mac and ```%APPDATA%/Name``` on Windows. File named after the date and time. 13 | 14 | ### More Support 15 | 1. For a a runthrough, watch my video on youtube: https://www.youtube.com/watch?v=QCySgbADhEA&ab_channel=AmberLimShin%F0%9F%8D%A0 16 | 17 | 2. Hop into Discord to share your project: https://discord.gg/AAcKmJz7Na 18 | --------------------------------------------------------------------------------