From 767bf24a5154de2da7f997fd2b05c04c240f9029 Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Tue, 20 Apr 2021 12:37:32 +0200 Subject: [PATCH] rework first dilemma --- addons/dialogic/Dialog.tscn | 21 ++-- .../Editor/CharacterEditor/PortraitEntry.gd | 3 +- .../Editor/Events/ChangeBackground.gd | 24 ++-- .../Editor/Events/ChangeBackground.tscn | 51 +++++--- .../Events/Common/{ => Images}/ImagePicker.gd | 0 .../Common/{ => Images}/ImagePicker.tscn | 3 +- .../Common/{ => Images}/ImagePreview.gd | 0 .../Common/{ => Images}/ImagePreview.tscn | 2 +- .../Editor/Events/Templates/EventTemplate.gd | 11 +- .../Events/Templates/EventTemplate.tscn | 7 +- .../dialogic/Editor/Events/WaitSeconds.tscn | 9 +- .../Editor/ThemeEditor/ThemeEditor.gd | 11 ++ .../Editor/ThemeEditor/ThemeEditor.tscn | 63 ++++++---- .../Editor/TimelineEditor/TimelineArea.gd | 112 ++++-------------- .../Editor/TimelineEditor/TimelineEditor.gd | 83 ++++++++++--- addons/dialogic/Nodes/dialog_node.gd | 27 ++++- addons/dialogic/Other/DialogicClass.gd | 35 +++++- addons/dialogic/Other/DialogicResources.gd | 75 +++++------- addons/dialogic/Other/DialogicSharp.cs | 32 +++++ addons/dialogic/Other/DialogicSingleton.gd | 56 ++++++++- dialogic/characters/character-1616660196.json | 2 +- dialogic/characters/character-1618911589.json | 1 + dialogic/definitions.json | 2 +- dialogic/themes/theme-1616657657.cfg | 1 + dialogic/themes/theme-1618913551.cfg | 31 +++++ dialogic/timelines/timeline-1616656510.json | 1 - dialogic/timelines/timeline-1616657347.json | 2 +- dialogic/timelines/timeline-1616659153.json | 1 - dialogic/timelines/timeline-1616659306.json | 2 +- dialogic/timelines/timeline-1616659608.json | 1 - dialogic/timelines/timeline-1616659917.json | 2 +- dialogic/timelines/timeline-1616660188.json | 2 +- dialogic/timelines/timeline-1616660446.json | 2 +- dialogic/timelines/timeline-1616660984.json | 2 +- dialogic/timelines/timeline-1616661304.json | 2 +- dialogic/timelines/timeline-1616661658.json | 2 +- dialogic/timelines/timeline-1616661685.json | 2 +- dialogic/timelines/timeline-1616662258.json | 2 +- dialogic/timelines/timeline-1617871263.json | 1 - dialogic/timelines/timeline-1617874348.json | 1 - dialogic/timelines/timeline-1618851520.json | 1 - dialogic/timelines/timeline-1618911641.json | 1 + dialogic/timelines/timeline-1618912317.json | 1 + scenes/Main.gd | 2 +- 44 files changed, 436 insertions(+), 256 deletions(-) rename addons/dialogic/Editor/Events/Common/{ => Images}/ImagePicker.gd (100%) rename addons/dialogic/Editor/Events/Common/{ => Images}/ImagePicker.tscn (95%) rename addons/dialogic/Editor/Events/Common/{ => Images}/ImagePreview.gd (100%) rename addons/dialogic/Editor/Events/Common/{ => Images}/ImagePreview.tscn (93%) create mode 100644 dialogic/characters/character-1618911589.json create mode 100644 dialogic/themes/theme-1618913551.cfg delete mode 100644 dialogic/timelines/timeline-1616656510.json delete mode 100644 dialogic/timelines/timeline-1616659153.json delete mode 100644 dialogic/timelines/timeline-1616659608.json delete mode 100644 dialogic/timelines/timeline-1617871263.json delete mode 100644 dialogic/timelines/timeline-1617874348.json delete mode 100644 dialogic/timelines/timeline-1618851520.json create mode 100644 dialogic/timelines/timeline-1618911641.json create mode 100644 dialogic/timelines/timeline-1618912317.json diff --git a/addons/dialogic/Dialog.tscn b/addons/dialogic/Dialog.tscn index e5dc7ca..106b8dd 100644 --- a/addons/dialogic/Dialog.tscn +++ b/addons/dialogic/Dialog.tscn @@ -6,10 +6,10 @@ [ext_resource path="res://addons/dialogic/Nodes/dialog_node.gd" type="Script" id=6] [ext_resource path="res://addons/dialogic/Nodes/BackgroundMusic.tscn" type="PackedScene" id=7] -[sub_resource type="StyleBoxFlat" id=2] +[sub_resource type="StyleBoxFlat" id=1] bg_color = Color( 0.196078, 0.196078, 0.196078, 0 ) -[sub_resource type="StyleBoxFlat" id=1] +[sub_resource type="StyleBoxFlat" id=2] bg_color = Color( 1, 1, 1, 0 ) expand_margin_left = 10.0 @@ -31,12 +31,12 @@ __meta__ = { } [node name="TextBubble" parent="." instance=ExtResource( 1 )] +margin_left = -321.5 +margin_top = -264.0 +margin_right = 321.5 +margin_bottom = -60.0 [node name="Options" type="VBoxContainer" parent="."] -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 grow_horizontal = 2 grow_vertical = 2 alignment = 1 @@ -62,7 +62,7 @@ margin_right = 208.0 mouse_filter = 1 size_flags_horizontal = 3 size_flags_vertical = 3 -custom_styles/panel = SubResource( 2 ) +custom_styles/panel = SubResource( 1 ) script = ExtResource( 5 ) __meta__ = { "_edit_group_": true, @@ -92,7 +92,7 @@ margin_right = 208.0 margin_bottom = 27.0 size_flags_horizontal = 3 size_flags_vertical = 4 -custom_styles/normal = SubResource( 1 ) +custom_styles/normal = SubResource( 2 ) custom_fonts/normal_font = ExtResource( 4 ) bbcode_text = "This is the title" text = "This is the title" @@ -104,7 +104,7 @@ margin_top = 31.0 margin_right = 208.0 margin_bottom = 112.0 size_flags_horizontal = 3 -custom_styles/normal = SubResource( 1 ) +custom_styles/normal = SubResource( 2 ) custom_fonts/normal_font = ExtResource( 4 ) text = "This is the main copy. Here you write the relevant" fit_content_height = true @@ -119,7 +119,7 @@ margin_top = 116.0 margin_right = 208.0 margin_bottom = 143.0 size_flags_horizontal = 3 -custom_styles/normal = SubResource( 1 ) +custom_styles/normal = SubResource( 2 ) custom_fonts/normal_font = ExtResource( 4 ) text = "Una linea extra" fit_content_height = true @@ -129,4 +129,5 @@ __meta__ = { } [node name="Timer" type="Timer" parent="DefinitionInfo"] + [connection signal="timeout" from="DefinitionInfo/Timer" to="." method="_on_Definition_Timer_timeout"] diff --git a/addons/dialogic/Editor/CharacterEditor/PortraitEntry.gd b/addons/dialogic/Editor/CharacterEditor/PortraitEntry.gd index 3785162..9ea474d 100644 --- a/addons/dialogic/Editor/CharacterEditor/PortraitEntry.gd +++ b/addons/dialogic/Editor/CharacterEditor/PortraitEntry.gd @@ -34,10 +34,11 @@ func _on_focus_entered(): func update_preview(path): + var l_path = path.to_lower() if path == '': image_node.texture = null else: - if '.png' in path or '.svg' in path: + if '.png' in l_path or '.svg' in l_path: image_node.texture = load(path) return true return false diff --git a/addons/dialogic/Editor/Events/ChangeBackground.gd b/addons/dialogic/Editor/Events/ChangeBackground.gd index a4f5592..f82d71f 100644 --- a/addons/dialogic/Editor/Events/ChangeBackground.gd +++ b/addons/dialogic/Editor/Events/ChangeBackground.gd @@ -1,13 +1,9 @@ tool -extends Control +extends "res://addons/dialogic/Editor/Events/Templates/EventTemplate.gd" + +var preview_scene = preload("res://addons/dialogic/Editor/Events/Common/Images/ImagePreview.tscn") -var editor_reference var preview = "..." - -var preview_scene = preload("res://addons/dialogic/Editor/Events/Common/ImagePreview.tscn") - -onready var event_template = $EventTemplate - var image_picker # This is the information of this event and it will get parsed and saved to the JSON file. @@ -16,7 +12,7 @@ var event_data = { } func _ready(): - image_picker = event_template.get_header() + image_picker = get_header() # Needed to open the file dialog image_picker.editor_reference = editor_reference image_picker.connect("file_selected", self, "_on_file_selected") @@ -31,16 +27,16 @@ func load_data(data): func load_image(img_src: String): event_data['background'] = img_src if not img_src.empty() and not img_src.ends_with('.tscn'): - event_template.set_preview("...") - event_template.set_body(preview_scene) - event_template.get_body().set_image(load(img_src)) + set_preview("...") + set_body(preview_scene) + get_body().set_image(load(img_src)) image_picker.set_image(img_src) elif img_src.ends_with('.tscn'): - event_template.set_preview("...") + set_preview("...") image_picker.set_image(img_src) - event_template.set_body(null) + set_body(null) else: - event_template.set_body(null) + set_body(null) image_picker.clear_image() diff --git a/addons/dialogic/Editor/Events/ChangeBackground.tscn b/addons/dialogic/Editor/Events/ChangeBackground.tscn index 28e8f2f..fc5d3a3 100644 --- a/addons/dialogic/Editor/Events/ChangeBackground.tscn +++ b/addons/dialogic/Editor/Events/ChangeBackground.tscn @@ -4,23 +4,46 @@ [ext_resource path="res://addons/dialogic/Editor/Events/styles/ChangeBackground.tres" type="StyleBox" id=3] [ext_resource path="res://addons/dialogic/Editor/Events/Templates/EventTemplate.tscn" type="PackedScene" id=4] [ext_resource path="res://addons/dialogic/Images/Event Icons/Main Icons/change-background.svg" type="Texture" id=6] -[ext_resource path="res://addons/dialogic/Editor/Events/Common/ImagePicker.tscn" type="PackedScene" id=7] +[ext_resource path="res://addons/dialogic/Editor/Events/Common/Images/ImagePicker.tscn" type="PackedScene" id=7] -[node name="ChangeBackground" type="HBoxContainer"] -anchor_right = 1.0 -margin_bottom = 44.0 -size_flags_horizontal = 3 -size_flags_vertical = 9 +[node name="ChangeBackground" instance=ExtResource( 4 )] script = ExtResource( 2 ) -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="EventTemplate" parent="." instance=ExtResource( 4 )] -anchor_right = 0.0 -margin_right = 1024.0 -margin_bottom = 46.0 event_style = ExtResource( 3 ) event_icon = ExtResource( 6 ) event_name = "Change Background" header_scene = ExtResource( 7 ) + +[node name="PanelContainer" parent="." index="1"] +custom_styles/panel = ExtResource( 3 ) + +[node name="IconMarginContainer" parent="PanelContainer/MarginContainer/VBoxContainer/Header" index="0"] +margin_right = 37.0 + +[node name="IconTexture" parent="PanelContainer/MarginContainer/VBoxContainer/Header/IconMarginContainer" index="0"] +margin_right = 32.0 +texture = ExtResource( 6 ) + +[node name="TitleHBoxContainer" parent="PanelContainer/MarginContainer/VBoxContainer/Header" index="1"] +margin_left = 41.0 +margin_right = 191.0 + +[node name="TitleMarginContainer" parent="PanelContainer/MarginContainer/VBoxContainer/Header/TitleHBoxContainer" index="1"] +margin_right = 142.0 + +[node name="TitleLabel" parent="PanelContainer/MarginContainer/VBoxContainer/Header/TitleHBoxContainer/TitleMarginContainer" index="0"] +margin_right = 129.0 +text = "Change Background" + +[node name="VSeparator2" parent="PanelContainer/MarginContainer/VBoxContainer/Header/TitleHBoxContainer" index="2"] +margin_left = 146.0 +margin_right = 150.0 + +[node name="Content" parent="PanelContainer/MarginContainer/VBoxContainer/Header" index="2"] +margin_left = 195.0 +margin_right = 536.0 + +[node name="Spacer" parent="PanelContainer/MarginContainer/VBoxContainer/Header" index="4"] +margin_left = 540.0 + +[node name="OptionsControl" parent="PanelContainer/MarginContainer/VBoxContainer/Header" index="6"] +items = [ "Move Up", null, 0, false, false, 0, 0, null, "", false, "Move Down", null, 0, false, false, 1, 0, null, "", false, "", null, 0, false, false, 2, 0, null, "", false, "Remove", null, 0, false, false, 3, 0, null, "", false ] diff --git a/addons/dialogic/Editor/Events/Common/ImagePicker.gd b/addons/dialogic/Editor/Events/Common/Images/ImagePicker.gd similarity index 100% rename from addons/dialogic/Editor/Events/Common/ImagePicker.gd rename to addons/dialogic/Editor/Events/Common/Images/ImagePicker.gd diff --git a/addons/dialogic/Editor/Events/Common/ImagePicker.tscn b/addons/dialogic/Editor/Events/Common/Images/ImagePicker.tscn similarity index 95% rename from addons/dialogic/Editor/Events/Common/ImagePicker.tscn rename to addons/dialogic/Editor/Events/Common/Images/ImagePicker.tscn index 71bd81d..6a2d823 100644 --- a/addons/dialogic/Editor/Events/Common/ImagePicker.tscn +++ b/addons/dialogic/Editor/Events/Common/Images/ImagePicker.tscn @@ -1,7 +1,8 @@ [gd_scene load_steps=3 format=2] [ext_resource path="res://addons/dialogic/Images/Context Menus/Remove.svg" type="Texture" id=1] -[ext_resource path="res://addons/dialogic/Editor/Events/Common/ImagePicker.gd" type="Script" id=2] +[ext_resource path="res://addons/dialogic/Editor/Events/Common/Images/ImagePicker.gd" type="Script" id=2] + [node name="ImagePicker" type="HBoxContainer"] margin_left = 154.0 diff --git a/addons/dialogic/Editor/Events/Common/ImagePreview.gd b/addons/dialogic/Editor/Events/Common/Images/ImagePreview.gd similarity index 100% rename from addons/dialogic/Editor/Events/Common/ImagePreview.gd rename to addons/dialogic/Editor/Events/Common/Images/ImagePreview.gd diff --git a/addons/dialogic/Editor/Events/Common/ImagePreview.tscn b/addons/dialogic/Editor/Events/Common/Images/ImagePreview.tscn similarity index 93% rename from addons/dialogic/Editor/Events/Common/ImagePreview.tscn rename to addons/dialogic/Editor/Events/Common/Images/ImagePreview.tscn index 5a9a434..a283eaa 100644 --- a/addons/dialogic/Editor/Events/Common/ImagePreview.tscn +++ b/addons/dialogic/Editor/Events/Common/Images/ImagePreview.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=2] -[ext_resource path="res://addons/dialogic/Editor/Events/Common/ImagePreview.gd" type="Script" id=1] +[ext_resource path="res://addons/dialogic/Editor/Events/Common/Images/ImagePreview.gd" type="Script" id=1] [node name="ImagePreview" type="CenterContainer"] anchor_right = 1.0 diff --git a/addons/dialogic/Editor/Events/Templates/EventTemplate.gd b/addons/dialogic/Editor/Events/Templates/EventTemplate.gd index c7f64b2..2b9b968 100644 --- a/addons/dialogic/Editor/Events/Templates/EventTemplate.gd +++ b/addons/dialogic/Editor/Events/Templates/EventTemplate.gd @@ -8,7 +8,6 @@ export(PackedScene) var header_scene : PackedScene export(PackedScene) var body_scene : PackedScene signal option_action(action_name) -signal selected() onready var panel = $PanelContainer onready var title_container = $PanelContainer/MarginContainer/VBoxContainer/Header/TitleHBoxContainer @@ -21,11 +20,16 @@ onready var body_container = $PanelContainer/MarginContainer/VBoxContainer/Body onready var body_content_container = $PanelContainer/MarginContainer/VBoxContainer/Body/Content onready var indent_node = $Indent +var editor_reference var header_node var body_node var indent_size = 25 +# Setting this to true will ignore the event while saving +# Useful for making placeholder events in drag and drop +var ignore_save = false + ## ***************************************************************************** ## PUBLIC METHODS ## ***************************************************************************** @@ -77,8 +81,9 @@ func set_indent(indent: int): indent_node.visible = indent != 0 -func on_timeline_selected(): - emit_signal("selected") +# Override in inherited class +func on_timeline_selected(selected: bool): + pass func set_expanded(expanded: bool): diff --git a/addons/dialogic/Editor/Events/Templates/EventTemplate.tscn b/addons/dialogic/Editor/Events/Templates/EventTemplate.tscn index 04e771f..f936337 100644 --- a/addons/dialogic/Editor/Events/Templates/EventTemplate.tscn +++ b/addons/dialogic/Editor/Events/Templates/EventTemplate.tscn @@ -1,6 +1,5 @@ -[gd_scene load_steps=7 format=2] +[gd_scene load_steps=6 format=2] -[ext_resource path="res://addons/dialogic/Editor/Events/Templates/EventTemplate.gd" type="Script" id=1] [ext_resource path="res://addons/dialogic/Editor/Events/Templates/ExpandControl.tscn" type="PackedScene" id=2] [ext_resource path="res://addons/dialogic/Editor/Events/Common/Spacer.tscn" type="PackedScene" id=4] [ext_resource path="res://addons/dialogic/Editor/Events/Templates/OptionsControl.tscn" type="PackedScene" id=5] @@ -23,13 +22,9 @@ margin_bottom = 44.0 rect_min_size = Vector2( 0, 44 ) size_flags_horizontal = 3 size_flags_vertical = 9 -script = ExtResource( 1 ) __meta__ = { "_edit_use_anchors_": false } -event_style = SubResource( 1 ) -event_icon = ExtResource( 6 ) -event_name = "Event Template" [node name="Indent" type="Control" parent="."] visible = false diff --git a/addons/dialogic/Editor/Events/WaitSeconds.tscn b/addons/dialogic/Editor/Events/WaitSeconds.tscn index b92e761..6a8a11a 100644 --- a/addons/dialogic/Editor/Events/WaitSeconds.tscn +++ b/addons/dialogic/Editor/Events/WaitSeconds.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=7 format=2] [ext_resource path="res://addons/dialogic/Images/Event Icons/Main Icons/wait-seconds.svg" type="Texture" id=1] [ext_resource path="res://addons/dialogic/Editor/Events/WaitSeconds.gd" type="Script" id=2] @@ -6,9 +6,6 @@ [ext_resource path="res://addons/dialogic/Editor/Events/Common/PieceExtraSettings.tscn" type="PackedScene" id=4] [ext_resource path="res://addons/dialogic/Editor/Events/Common/SpinBoxPreventDnD.gd" type="Script" id=6] - - - [sub_resource type="StyleBoxFlat" id=1] content_margin_left = 16.0 content_margin_right = 6.0 @@ -79,7 +76,8 @@ margin_left = 79.0 margin_right = 153.0 margin_bottom = 28.0 min_value = 0.1 -value = 0.1 +step = 0.1 +value = 1.0 allow_greater = true align = 1 script = ExtResource( 6 ) @@ -108,4 +106,5 @@ margin_left = 945.0 margin_right = 982.0 margin_bottom = 28.0 items = [ "Move Up", null, 0, false, false, 0, 0, null, "", false, "Move Down", null, 0, false, false, 1, 0, null, "", false, "", null, 0, false, false, 2, 0, null, "", true, "Remove", null, 0, false, false, 3, 0, null, "", false ] + [connection signal="value_changed" from="PanelContainer/VBoxContainer/Header/SpinBox" to="." method="_on_SpinBox_value_changed"] diff --git a/addons/dialogic/Editor/ThemeEditor/ThemeEditor.gd b/addons/dialogic/Editor/ThemeEditor/ThemeEditor.gd index 8843d85..f08a780 100644 --- a/addons/dialogic/Editor/ThemeEditor/ThemeEditor.gd +++ b/addons/dialogic/Editor/ThemeEditor/ThemeEditor.gd @@ -82,6 +82,7 @@ onready var n : Dictionary = { # Glossary 'glossary_font': $VBoxContainer/TabContainer/Glossary/Column/GridContainer/FontButton, 'glossary_color': $VBoxContainer/TabContainer/Glossary/Column/GridContainer/ColorPickerButton, + 'glossary_enabled': $VBoxContainer/TabContainer/Glossary/Column/GridContainer/ShowGlossaryCheckBox, # Text preview 'text_preview': $VBoxContainer/HBoxContainer3/TextEdit, @@ -155,6 +156,7 @@ func load_theme(filename): # Definitions n['glossary_color'].color = Color(theme.get_value('definitions', 'color', "#ffffffff")) n['glossary_font'].text = DialogicResources.get_filename_from_path(theme.get_value('definitions', 'font', "res://addons/dialogic/Example Assets/Fonts/GlossaryFont.tres")) + n['glossary_enabled'].pressed = theme.get_value('definitions', 'show_glossary', true) # Text n['theme_text_speed'].value = theme.get_value('text','speed', 2) @@ -495,6 +497,14 @@ func _on_Glossary_Font_selected(path, target) -> void: _on_PreviewButton_pressed() # Refreshing the preview +func _on_ShowGlossaryCheckBox_toggled(button_pressed): + if loading: + return + DialogicResources.set_theme_value(current_theme, 'definitions','show_glossary', button_pressed) + _on_PreviewButton_pressed() # Refreshing the preview + + + func _on_visibility_changed() -> void: if visible: # Refreshing the dialog @@ -683,3 +693,4 @@ func _on_ButtonSize_value_changed(value): return DialogicResources.set_theme_value(current_theme, 'buttons','fixed_size', Vector2(n['button_fixed_x'].value,n['button_fixed_y'].value)) _on_PreviewButton_pressed() # Refreshing the preview + diff --git a/addons/dialogic/Editor/ThemeEditor/ThemeEditor.tscn b/addons/dialogic/Editor/ThemeEditor/ThemeEditor.tscn index 2bfcda0..0267186 100644 --- a/addons/dialogic/Editor/ThemeEditor/ThemeEditor.tscn +++ b/addons/dialogic/Editor/ThemeEditor/ThemeEditor.tscn @@ -8,7 +8,7 @@ content_margin_left = 4.0 content_margin_right = 4.0 content_margin_top = 4.0 content_margin_bottom = 4.0 -bg_color = Color( 0.252, 0.2718, 0.3246, 1 ) +bg_color = Color( 0.2652, 0.2784, 0.3114, 1 ) [node name="ThemeEditor" type="ScrollContainer"] anchor_right = 1.0 @@ -29,13 +29,13 @@ custom_constants/separation = 15 [node name="Panel" type="Panel" parent="VBoxContainer"] margin_right = 1018.0 -margin_bottom = 460.0 -rect_min_size = Vector2( 0, 460 ) +margin_bottom = 297.0 +rect_min_size = Vector2( 0, 297 ) [node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer"] -margin_top = 475.0 +margin_top = 312.0 margin_right = 1018.0 -margin_bottom = 535.0 +margin_bottom = 372.0 custom_constants/separation = 10 [node name="TextEdit" type="TextEdit" parent="VBoxContainer/HBoxContainer3"] @@ -55,7 +55,7 @@ text = " Preview changes " icon = ExtResource( 1 ) [node name="TabContainer" type="TabContainer" parent="VBoxContainer"] -margin_top = 550.0 +margin_top = 387.0 margin_right = 1018.0 margin_bottom = 911.0 size_flags_horizontal = 3 @@ -74,7 +74,7 @@ custom_constants/separation = 10 [node name="Column" type="VBoxContainer" parent="VBoxContainer/TabContainer/Dialog Text"] margin_right = 270.0 -margin_bottom = 325.0 +margin_bottom = 488.0 rect_min_size = Vector2( 270, 0 ) size_flags_vertical = 3 __meta__ = { @@ -200,12 +200,12 @@ prefix = "Y" [node name="VSeparator" type="VSeparator" parent="VBoxContainer/TabContainer/Dialog Text"] margin_left = 280.0 margin_right = 284.0 -margin_bottom = 325.0 +margin_bottom = 488.0 [node name="Column2" type="VBoxContainer" parent="VBoxContainer/TabContainer/Dialog Text"] margin_left = 294.0 margin_right = 564.0 -margin_bottom = 325.0 +margin_bottom = 488.0 rect_min_size = Vector2( 270, 0 ) size_flags_vertical = 3 __meta__ = { @@ -824,6 +824,7 @@ allow_greater = true allow_lesser = true [node name="Choice Buttons" type="HBoxContainer" parent="VBoxContainer/TabContainer"] +visible = false anchor_right = 1.0 anchor_bottom = 1.0 margin_left = 4.0 @@ -834,7 +835,7 @@ custom_constants/separation = 10 [node name="Column" type="VBoxContainer" parent="VBoxContainer/TabContainer/Choice Buttons"] margin_right = 270.0 -margin_bottom = 325.0 +margin_bottom = 488.0 rect_min_size = Vector2( 270, 0 ) size_flags_vertical = 3 __meta__ = { @@ -965,12 +966,12 @@ margin_bottom = 136.0 [node name="VSeparator" type="VSeparator" parent="VBoxContainer/TabContainer/Choice Buttons"] margin_left = 280.0 margin_right = 284.0 -margin_bottom = 325.0 +margin_bottom = 488.0 [node name="Column2" type="VBoxContainer" parent="VBoxContainer/TabContainer/Choice Buttons"] margin_left = 294.0 margin_right = 603.0 -margin_bottom = 325.0 +margin_bottom = 488.0 rect_min_size = Vector2( 270, 0 ) size_flags_vertical = 3 __meta__ = { @@ -1068,7 +1069,6 @@ allow_greater = true allow_lesser = true [node name="Glossary" type="HBoxContainer" parent="VBoxContainer/TabContainer"] -visible = false anchor_right = 1.0 anchor_bottom = 1.0 margin_left = 4.0 @@ -1079,7 +1079,7 @@ custom_constants/separation = 10 [node name="Column" type="VBoxContainer" parent="VBoxContainer/TabContainer/Glossary"] margin_right = 270.0 -margin_bottom = 157.0 +margin_bottom = 488.0 rect_min_size = Vector2( 270, 0 ) [node name="SectionTitle" type="Label" parent="VBoxContainer/TabContainer/Glossary/Column"] @@ -1091,7 +1091,7 @@ text = "Visuals" [node name="GridContainer" type="GridContainer" parent="VBoxContainer/TabContainer/Glossary/Column"] margin_top = 26.0 margin_right = 270.0 -margin_bottom = 80.0 +margin_bottom = 108.0 size_flags_horizontal = 3 custom_constants/hseparation = 10 columns = 2 @@ -1124,17 +1124,36 @@ margin_bottom = 54.0 rect_min_size = Vector2( 50, 30 ) color = Color( 0.215686, 0.654902, 0.67451, 1 ) +[node name="Label2" type="Label" parent="VBoxContainer/TabContainer/Glossary/Column/GridContainer"] +margin_top = 63.0 +margin_right = 165.0 +margin_bottom = 77.0 +text = "Show" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ShowGlossaryCheckBox" type="CheckBox" parent="VBoxContainer/TabContainer/Glossary/Column/GridContainer"] +margin_left = 175.0 +margin_top = 58.0 +margin_right = 270.0 +margin_bottom = 82.0 +__meta__ = { +"_edit_use_anchors_": false +} + [node name="Label" type="Label" parent="VBoxContainer/TabContainer/Glossary/Column/GridContainer"] visible = false -margin_top = 66.0 -margin_right = 141.0 -margin_bottom = 80.0 +margin_top = 58.0 +margin_right = 165.0 +margin_bottom = 72.0 text = "Shadow" [node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/TabContainer/Glossary/Column/GridContainer"] visible = false +margin_left = 175.0 margin_top = 58.0 -margin_right = 213.0 +margin_right = 270.0 margin_bottom = 88.0 [node name="CheckBoxShadow" type="CheckBox" parent="VBoxContainer/TabContainer/Glossary/Column/GridContainer/HBoxContainer2"] @@ -1143,7 +1162,7 @@ margin_bottom = 30.0 [node name="ColorPickerButtonShadow" type="ColorPickerButton" parent="VBoxContainer/TabContainer/Glossary/Column/GridContainer/HBoxContainer2"] margin_left = 28.0 -margin_right = 213.0 +margin_right = 95.0 margin_bottom = 30.0 rect_min_size = Vector2( 50, 30 ) size_flags_horizontal = 3 @@ -1159,7 +1178,7 @@ text = "S, Offset" [node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/TabContainer/Glossary/Column/GridContainer"] visible = false margin_top = 58.0 -margin_right = 213.0 +margin_right = 165.0 margin_bottom = 82.0 custom_constants/separation = 10 @@ -1182,7 +1201,6 @@ prefix = "Y" [node name="DelayPreviewTimer" type="Timer" parent="."] one_shot = true - [connection signal="text_changed" from="VBoxContainer/HBoxContainer3/TextEdit" to="." method="_on_Preview_text_changed"] [connection signal="pressed" from="VBoxContainer/HBoxContainer3/PreviewButton" to="." method="_on_PreviewButton_pressed"] [connection signal="pressed" from="VBoxContainer/TabContainer/Dialog Text/Column/GridContainer/FontButton" to="." method="_on_FontButton_pressed"] @@ -1240,6 +1258,7 @@ one_shot = true [connection signal="value_changed" from="VBoxContainer/TabContainer/Choice Buttons/Column2/GridContainer/HBoxContainer2/ButtonSizeY" to="." method="_on_ButtonSize_value_changed"] [connection signal="pressed" from="VBoxContainer/TabContainer/Glossary/Column/GridContainer/FontButton" to="." method="_on_GlossaryFontButton_pressed"] [connection signal="color_changed" from="VBoxContainer/TabContainer/Glossary/Column/GridContainer/ColorPickerButton" to="." method="_on_GlossaryColorPicker_color_changed"] +[connection signal="toggled" from="VBoxContainer/TabContainer/Glossary/Column/GridContainer/ShowGlossaryCheckBox" to="." method="_on_ShowGlossaryCheckBox_toggled"] [connection signal="toggled" from="VBoxContainer/TabContainer/Glossary/Column/GridContainer/HBoxContainer2/CheckBoxShadow" to="." method="_on_CheckBoxShadow_toggled"] [connection signal="color_changed" from="VBoxContainer/TabContainer/Glossary/Column/GridContainer/HBoxContainer2/ColorPickerButtonShadow" to="." method="_on_ColorPickerButtonShadow_color_changed"] [connection signal="value_changed" from="VBoxContainer/TabContainer/Glossary/Column/GridContainer/HBoxContainer/ShadowOffsetX" to="." method="_on_ShadowOffset_value_changed"] diff --git a/addons/dialogic/Editor/TimelineEditor/TimelineArea.gd b/addons/dialogic/Editor/TimelineEditor/TimelineArea.gd index 622184f..8cc2d87 100644 --- a/addons/dialogic/Editor/TimelineEditor/TimelineArea.gd +++ b/addons/dialogic/Editor/TimelineEditor/TimelineArea.gd @@ -1,12 +1,14 @@ tool extends ScrollContainer -var _drag_drop_indicator = null # store last attempts since godot sometimes misses drop events var _is_drag_receiving = false var _last_event_button_drop_attempt = '' var _mouse_exited = false +# todo, getting timeline like this is prone to fail someday +onready var timeline_editor = get_parent() + func _ready(): connect("mouse_entered", self, '_on_mouse_entered') connect("mouse_exited", self, '_on_mouse_exited') @@ -14,53 +16,43 @@ func _ready(): func can_drop_data(position, data): - if (data != null and data is Dictionary and data.has("source")): - if (data["source"] == "EventButton"): - # position drop indicator - _set_indicator_position(position) + if data != null and data is Dictionary and data.has("source"): + if data["source"] == "EventButton": + if _last_event_button_drop_attempt.empty(): + timeline_editor.create_drag_and_drop_event(data["event_name"]) _is_drag_receiving = true _last_event_button_drop_attempt = data["event_name"] return true - - _remove_drop_indicator() return false - + func cancel_drop(): _is_drag_receiving = false _last_event_button_drop_attempt = '' - _remove_drop_indicator() - pass + timeline_editor.cancel_drop_event() func drop_data(position, data): - # todo, getting timeline like this is prone to fail someday - var timeline_editor = get_parent() - # add event if (data["source"] == "EventButton"): - var piece = timeline_editor.create_event(data["event_name"]) - if (piece != null and _drag_drop_indicator != null): - var parent = piece.get_parent() - if (parent != null): - parent.remove_child(piece) - parent.add_child_below_node(_drag_drop_indicator, piece) - timeline_editor.indent_events() - # @todo _select_item seems to be a "private" function - # maybe expose it as "public" or add a public helper function - # to TimelineEditor.gd - timeline_editor._select_item(piece) - + timeline_editor.drop_event() _is_drag_receiving = false _last_event_button_drop_attempt = '' - _remove_drop_indicator() - - + + func _on_mouse_exited(): + if _is_drag_receiving and not _mouse_exited: + var preview_label = Label.new() + preview_label.text = "Cancel" + set_drag_preview(preview_label) _mouse_exited = true func _on_mouse_entered(): + if _is_drag_receiving and _mouse_exited: + var preview_label = Label.new() + preview_label.text = "Insert Event" + set_drag_preview(preview_label) _mouse_exited = false @@ -68,8 +60,8 @@ func _input(event): if (event is InputEventMouseButton and is_visible_in_tree() and event.button_index == BUTTON_LEFT): if (_mouse_exited and _is_drag_receiving): cancel_drop() - - + + func _on_gui_input(event): # godot sometimes misses drop events if (event is InputEventMouseButton and event.button_index == BUTTON_LEFT): @@ -77,63 +69,3 @@ func _on_gui_input(event): if (_last_event_button_drop_attempt != ''): drop_data(Vector2.ZERO, { "source": "EventButton", "event_name": _last_event_button_drop_attempt} ) _is_drag_receiving = false - _remove_drop_indicator() - pass - - -func _create_drop_indicator(): - _remove_drop_indicator() - - var timeline = get_child(0) - if (timeline == null): - return - - var indicator = ColorRect.new() - indicator.name = "DropIndicator" - indicator.rect_size.y = 100 - indicator.rect_min_size.y = 100 - indicator.color = Color(0.35, 0.37, 0.44) # default editor light blue - indicator.mouse_filter = MOUSE_FILTER_IGNORE - - # add indent node like the other scene nodes have - var indent = Control.new() - indent.rect_min_size.x = 25 - indent.visible = false - indent.name = "Indent" - indicator.add_child(indent) - - var label = Label.new() - label.text = "Drop here" - indicator.add_child(label) - - timeline.add_child(indicator) - - _drag_drop_indicator = indicator - - -func _remove_drop_indicator(): - if (_drag_drop_indicator != null): - _drag_drop_indicator.get_parent().remove_child(_drag_drop_indicator) - _drag_drop_indicator.queue_free() - - _drag_drop_indicator = null - - -func _set_indicator_position(position): - var timeline = get_child(0) - if (timeline == null): - return - - if (_drag_drop_indicator == null): - _create_drop_indicator() - - var highest_index = 0 - var index = 0 - for child in timeline.get_children(): - if child.get_local_mouse_position().y > 0 and index > highest_index: - highest_index = index - index += 1 - - if (_drag_drop_indicator.is_inside_tree()): - timeline.move_child(_drag_drop_indicator, max(0, highest_index)) - pass diff --git a/addons/dialogic/Editor/TimelineEditor/TimelineEditor.gd b/addons/dialogic/Editor/TimelineEditor/TimelineEditor.gd index ec62026..a1c9731 100644 --- a/addons/dialogic/Editor/TimelineEditor/TimelineEditor.gd +++ b/addons/dialogic/Editor/TimelineEditor/TimelineEditor.gd @@ -213,7 +213,8 @@ func _clear_selection(): if selected_panel != null: selected_panel.set('custom_styles/panel', saved_style) else: - selected_item.event_template.set_event_style(saved_style) + selected_item.set_event_style(saved_style) + selected_item.on_timeline_selected(false) selected_item = null saved_style = null @@ -238,9 +239,9 @@ func _select_item(item: Node): if (selected_item.has_method("on_timeline_selected")): selected_item.on_timeline_selected() else: - saved_style = item.event_template.get_event_style() - item.event_template.set_event_style(selected_style_template) - selected_item.event_template.on_timeline_selected() + saved_style = item.get_event_style() + item.set_event_style(selected_style_template) + selected_item.on_timeline_selected(true) else: _clear_selection() @@ -304,6 +305,34 @@ func _on_ButtonCondition_pressed() -> void: create_event("EndBranch", {'no-data': true}, true) +# Creates a ghost event for drag and drop +func create_drag_and_drop_event(scene: String): + var index = get_index_under_cursor() + var piece = create_event(scene) + timeline.move_child(piece, index) + moving_piece = piece + piece_was_dragged = true + set_event_ignore_save(piece, true) + _select_item(piece) + return piece + + +func drop_event(): + if moving_piece != null: + set_event_ignore_save(moving_piece, false) + moving_piece = null + piece_was_dragged = false + indent_events() + + +func cancel_drop_event(): + if moving_piece != null: + moving_piece = null + piece_was_dragged = false + delete_event() + _clear_selection() + + # Adding an event to the timeline func create_event(scene: String, data: Dictionary = {'no-data': true} , indent: bool = false): var piece = load("res://addons/dialogic/Editor/Events/" + scene + ".tscn").instance() @@ -316,7 +345,7 @@ func create_event(scene: String, data: Dictionary = {'no-data': true} , indent: piece.load_data(data) if _has_template(piece): - piece.event_template.connect("option_action", self, '_on_event_options_action', [piece]) + piece.connect("option_action", self, '_on_event_options_action', [piece]) piece.connect("gui_input", self, '_on_gui_input', [piece]) events_warning.visible = false @@ -343,7 +372,7 @@ func indent_events() -> void: indent_node = event.get_node("Indent") indent_node.visible = false else: - event.event_template.set_indent(0) + event.set_indent(0) # Adding new indents for event in event_list: @@ -382,9 +411,9 @@ func indent_events() -> void: indent_node.visible = false else: if starter: - event.event_template.set_indent(indent - 1) + event.set_indent(indent - 1) else: - event.event_template.set_indent(indent) + event.set_indent(indent) starter = false @@ -481,6 +510,16 @@ func get_block_height(block): return null +func get_index_under_cursor(): + var current_position = get_global_mouse_position() + var top_pos = 0 + for i in range(timeline.get_child_count()): + var c = timeline.get_child(i) + if c.rect_global_position.y < current_position.y: + top_pos = i + return top_pos + + # ordering blocks in timeline func move_block(block, direction): var block_index = block.get_index() @@ -523,14 +562,30 @@ func generate_save_data(): 'events': [] } for event in timeline.get_children(): - # check that event has event_data (e.g. drag drop indicators) - if (not "event_data" in event): - continue - if event.is_queued_for_deletion() == false: # Checking that the event is not waiting to be removed + # Checking that the event is not waiting to be removed + # or that it is not a drag and drop placeholder + if not get_event_ignore_save(event) and event.is_queued_for_deletion() == false: info_to_save['events'].append(event.event_data) return info_to_save +func set_event_ignore_save(event: Node, ignore: bool): + if _has_template(event): + event.ignore_save = ignore + else: + if ignore: + event.event_data["_ignore_save"] = true + else: + event.event_data.erase("_ignore_save") + + +func get_event_ignore_save(event: Node) -> bool: + if _has_template(event): + return event.ignore_save + else: + return event.event_data.has("_ignore_save") and event.event_data["_ignore_save"] + + func save_timeline() -> void: if timeline_file != '': var info_to_save = generate_save_data() @@ -544,7 +599,7 @@ func fold_all_nodes(): if event.has_node("PanelContainer/VBoxContainer/Header/VisibleToggle"): event.get_node("PanelContainer/VBoxContainer/Header/VisibleToggle").set_pressed(false) elif _has_template(event): - event.event_template.set_expanded(false) + event.set_expanded(false) func unfold_all_nodes(): @@ -552,4 +607,4 @@ func unfold_all_nodes(): if event.has_node("PanelContainer/VBoxContainer/Header/VisibleToggle"): event.get_node("PanelContainer/VBoxContainer/Header/VisibleToggle").set_pressed(true) elif _has_template(event): - event.event_template.set_expanded(true) + event.set_expanded(true) diff --git a/addons/dialogic/Nodes/dialog_node.gd b/addons/dialogic/Nodes/dialog_node.gd index f64dc25..60aa42d 100644 --- a/addons/dialogic/Nodes/dialog_node.gd +++ b/addons/dialogic/Nodes/dialog_node.gd @@ -23,8 +23,13 @@ export(bool) var reset_saves = true ## Should we show debug information when running? export(bool) var debug_mode = true +# Event end/start signal event_start(type, event) signal event_end(type) +# Timeline end/start +signal timeline_start(timeline_name) +signal timeline_end(timeline_name) +# Custom user signal signal dialogic_signal(value) var dialog_resource @@ -91,10 +96,16 @@ func resize_main(): set_global_position(Vector2(0,0)) reference = get_viewport().get_visible_rect().size + $Options.rect_position.x = (reference.x / 2) - ($Options.rect_size.x / 2) + $Options.rect_position.y = (reference.y / 2) - ($Options.rect_size.y / 2) + $TextBubble.rect_position.x = (reference.x / 2) - ($TextBubble.rect_size.x / 2) if current_theme != null: $TextBubble.rect_position.y = (reference.y) - ($TextBubble.rect_size.y) - current_theme.get_value('box', 'bottom_gap', 40) - + + var background = get_node_or_null('Background') + if background != null: + background.rect_size = reference func set_current_dialog(dialog_path: String): @@ -244,11 +255,17 @@ func parse_branches(dialog_script: Dictionary) -> Dictionary: return dialog_script +func _should_show_glossary(): + if current_theme != null: + return current_theme.get_value('definitions', 'show_glossary', true) + return true + + func parse_definitions(text: String, variables: bool = true, glossary: bool = true): var final_text: String = text if variables: final_text = _insert_variable_definitions(text) - if glossary: + if glossary and _should_show_glossary(): final_text = _insert_glossary_definitions(final_text) return final_text @@ -328,14 +345,18 @@ func on_timeline_start(): if not Engine.is_editor_hint(): DialogicSingleton.save_definitions() DialogicSingleton.set_current_timeline(current_timeline) + # TODO remove event_start in 2.0 emit_signal("event_start", "timeline", current_timeline) + emit_signal("timeline_start", current_timeline) func on_timeline_end(): if not Engine.is_editor_hint(): DialogicSingleton.save_definitions() DialogicSingleton.set_current_timeline('') + # TODO remove event_end in 2.0 emit_signal("event_end", "timeline") + emit_signal("timeline_end", current_timeline) dprint('[D] Timeline End') @@ -476,6 +497,8 @@ func event_handler(event: Dictionary): background.stretch_mode = TextureRect.STRETCH_SCALE background.show_behind_parent = true background.mouse_filter = Control.MOUSE_FILTER_IGNORE + call_deferred('resize_main') # Executing the resize main to update the background size + add_child(background) background.texture = null if (background.get_child_count() > 0): diff --git a/addons/dialogic/Other/DialogicClass.gd b/addons/dialogic/Other/DialogicClass.gd index 7facc81..972d251 100644 --- a/addons/dialogic/Other/DialogicClass.gd +++ b/addons/dialogic/Other/DialogicClass.gd @@ -77,7 +77,22 @@ static func get_definitions() -> Dictionary: ## ## @returns Error status, OK if all went well static func save_definitions(): - return DialogicSingleton.save_definitions() + # Always try to save as much as possible. + var err1 = DialogicSingleton.save_definitions() + var err2 = DialogicSingleton.save_state() + + # Try to combine the two error states in a way that makes sense. + return err1 if err1 != OK else err2 + + +## Sets whether to use Dialogic's built-in autosave functionality. +static func set_autosave(save: bool) -> void: + DialogicSingleton.set_autosave(save); + + +## Gets whether to use Dialogic's built-in autosave functionality. +static func get_autosave() -> bool: + return DialogicSingleton.get_autosave(); ## Resets data to default values. This is the same as calling start with reset_saves to true @@ -135,3 +150,21 @@ static func set_glossary(name: String, title: String, text: String, extra: Strin ## @returns The current timeline filename, or an empty string if none was saved. static func get_current_timeline() -> String: return DialogicSingleton.get_current_timeline() + + +## Export the current Dialogic state. +## This can be used as part of your own saving mechanism if you have one. If you use this, +## you should also disable autosaving. +## +## @return A dictionary of data that can be later provided to import(). +static func export() -> Dictionary: + return DialogicSingleton.export() + + +## Import a Dialogic state. +## This can be used as part of your own saving mechanism if you have one. If you use this, +## you should also disable autosaving. +## +## @param data A dictionary of data as created by export(). +static func import(data: Dictionary) -> void: + DialogicSingleton.import(data) diff --git a/addons/dialogic/Other/DialogicResources.gd b/addons/dialogic/Other/DialogicResources.gd index 7e3c336..0ad6f1b 100644 --- a/addons/dialogic/Other/DialogicResources.gd +++ b/addons/dialogic/Other/DialogicResources.gd @@ -65,13 +65,13 @@ static func get_config_files_paths() -> Dictionary: } -static func init_saves(overwrite: bool=true): +static func init_saves(): var err = init_working_dir() var paths := get_config_files_paths() - + if err == OK: - init_state_saves(overwrite) - init_definitions_saves(overwrite) + init_state_saves() + init_definitions_saves() else: print('[Dialogic] Error creating working directory: ' + str(err)) @@ -81,44 +81,37 @@ static func init_working_dir(): return directory.make_dir_recursive(get_working_directories()['WORKING_DIR']) -static func init_state_saves(overwrite: bool=true): +static func init_state_saves(): var file := File.new() var paths := get_config_files_paths() - - if not file.file_exists(paths["SAVED_STATE_FILE"]) or overwrite: - var err = file.open(paths["SAVED_STATE_FILE"], File.WRITE) - if err == OK: - file.store_string('') - file.close() - else: - print('[Dialogic] Error opening saved state file: ' + str(err)) + var err = file.open(paths["SAVED_STATE_FILE"], File.WRITE) + if err == OK: + file.store_string('') + file.close() + else: + print('[Dialogic] Error opening saved state file: ' + str(err)) -static func init_definitions_saves(overwrite: bool=true): +static func init_definitions_saves(): var directory := Directory.new() var source := File.new() var sink := File.new() var paths := get_config_files_paths() - var err - if not directory.file_exists(paths["SAVED_DEFINITIONS_FILE"]): - err = sink.open(paths["SAVED_DEFINITIONS_FILE"], File.WRITE) - print('[Dialogic] Saved definitions not present, creating file: ' + str(err)) - if err == OK: - sink.store_string('') - sink.close() - else: - print('[Dialogic] Error opening saved definitions file: ' + str(err)) - + var err = sink.open(paths["SAVED_DEFINITIONS_FILE"], File.WRITE) + print('[Dialogic] Saved definitions not present, creating file: ' + str(err)) + if err == OK: + sink.store_string('') + sink.close() + else: + print('[Dialogic] Error opening saved definitions file: ' + str(err)) + err = sink.open(paths["SAVED_DEFINITIONS_FILE"], File.READ_WRITE) if err == OK: - if overwrite or sink.get_len() == 0: - err = source.open(paths["DEFAULT_DEFINITIONS_FILE"], File.READ) - if err == OK: - sink.store_string(source.get_as_text()) - else: - print('[Dialogic] Error opening default definitions file: ' + str(err)) + err = source.open(paths["DEFAULT_DEFINITIONS_FILE"], File.READ) + if err == OK: + sink.store_string(source.get_as_text()) else: - print('[Dialogic] Did not overwrite previous saved definitions') + print('[Dialogic] Error opening default definitions file: ' + str(err)) else: print('[Dialogic] Error opening saved definitions file: ' + str(err)) @@ -323,23 +316,10 @@ static func get_saved_state() -> Dictionary: static func save_saved_state_config(data: Dictionary): + init_working_dir() set_json(get_config_files_paths()['SAVED_STATE_FILE'], data) -static func get_saved_state_general_key(key: String) -> String: - var data = get_saved_state() - if key in data['general'].keys(): - return data['general'][key] - else: - return '' - - -static func set_saved_state_general_key(key: String, value): - var data = get_saved_state() - data['general'][key] = str(value) - save_saved_state_config(data) - - # DEFAULT DEFINITIONS # Can only be edited in the editor @@ -382,9 +362,10 @@ static func delete_default_definition(id: String): # Can be edited at runtime, and will persist across runs -static func get_saved_definitions() -> Dictionary: - return load_json(get_config_files_paths()['SAVED_DEFINITIONS_FILE'], {'variables': [], 'glossary': []}) +static func get_saved_definitions(default: Dictionary = {'variables': [], 'glossary': []}) -> Dictionary: + return load_json(get_config_files_paths()['SAVED_DEFINITIONS_FILE'], default) static func save_saved_definitions(data: Dictionary): + init_working_dir() return set_json(get_config_files_paths()['SAVED_DEFINITIONS_FILE'], data) diff --git a/addons/dialogic/Other/DialogicSharp.cs b/addons/dialogic/Other/DialogicSharp.cs index f07005d..a7649f6 100644 --- a/addons/dialogic/Other/DialogicSharp.cs +++ b/addons/dialogic/Other/DialogicSharp.cs @@ -35,6 +35,18 @@ public static class DialogicSharp } } + public static bool Autosave + { + get + { + return (bool)_dialogic.Call("get_autosave"); + } + set + { + _dialogic.Call("set_autosave", value); + } + } + public static Node Start(String timeline, bool resetSaves = true, bool debugMode = false) { return Start(timeline, DEFAULT_DIALOG_RESOURCE, resetSaves, debugMode); @@ -74,4 +86,24 @@ public static class DialogicSharp { _dialogic.Call("set_glossary", name, title, text, extra); } + + public static void ResetSaves() + { + _dialogic.Call("reset_saves"); + } + + public static Error SaveDefinitions() + { + return (Error)_dialogic.Call("save_definitions"); + } + + public static GC.Dictionary Export() + { + return (GC.Dictionary)_dialogic.Call("export"); + } + + public static void Import(GC.Dictionary data) + { + _dialogic.Call("import", data); + } } diff --git a/addons/dialogic/Other/DialogicSingleton.gd b/addons/dialogic/Other/DialogicSingleton.gd index 346d194..9367e06 100644 --- a/addons/dialogic/Other/DialogicSingleton.gd +++ b/addons/dialogic/Other/DialogicSingleton.gd @@ -2,6 +2,8 @@ extends Node var current_definitions := {} var default_definitions := {} +var current_state := {} +var autosave := true var current_timeline := '' @@ -11,11 +13,13 @@ func _init() -> void: func init(reset: bool=false) -> void: - # Loads saved definitions into memory - DialogicResources.init_saves(reset) - current_definitions = DialogicResources.get_saved_definitions() + if reset and autosave: + # Loads saved definitions into memory + DialogicResources.init_saves() default_definitions = DialogicResources.get_default_definitions() - current_timeline = DialogicResources.get_saved_state_general_key('timeline') + current_definitions = DialogicResources.get_saved_definitions(default_definitions) + current_state = DialogicResources.get_saved_state() + current_timeline = get_saved_state_general_key('timeline') func get_definitions_list() -> Array: @@ -35,7 +39,16 @@ func get_default_definitions_list() -> Array: func save_definitions(): - return DialogicResources.save_saved_definitions(current_definitions) + if autosave: + return DialogicResources.save_saved_definitions(current_definitions) + else: + return OK + +func save_state(): + if autosave: + return DialogicResources.save_saved_state_config(current_state) + else: + return OK func get_variable(name: String) -> String: @@ -103,10 +116,41 @@ func set_glossary(name: String, title: String, text: String, extra: String) -> v func set_current_timeline(timeline: String): current_timeline = timeline - DialogicResources.set_saved_state_general_key('timeline', timeline) + set_saved_state_general_key('timeline', timeline) func get_current_timeline() -> String: return current_timeline +func get_saved_state_general_key(key: String) -> String: + if key in current_state['general'].keys(): + return current_state['general'][key] + else: + return '' + + +func set_saved_state_general_key(key: String, value) -> void: + current_state['general'][key] = str(value) + save_state() + + +func get_autosave() -> bool: + return autosave; + + +func set_autosave(save: bool): + autosave = save; + + +func export() -> Dictionary: + return { + 'definitions': current_definitions, + 'state': current_state, + } + +func import(data: Dictionary) -> void: + init(false); + current_definitions = data['definitions']; + current_state = data['state']; + current_timeline = get_saved_state_general_key('timeline') diff --git a/dialogic/characters/character-1616660196.json b/dialogic/characters/character-1616660196.json index f634cc5..dd3aa59 100644 --- a/dialogic/characters/character-1616660196.json +++ b/dialogic/characters/character-1616660196.json @@ -1 +1 @@ -{"color":"#ff07b99c","default_speaker":false,"description":"Les notifications de partout","display_name":"","display_name_bool":false,"id":"character-1616660196.json","name":"Téléphone","offset_x":0,"offset_y":-100,"portraits":[{"name":"Default","path":"res://characters/phone.png"}],"scale":100} +{"color":"#ff0766b9","default_speaker":false,"description":"Les notifications de partout","display_name":"","display_name_bool":false,"id":"character-1616660196.json","mirror_portraits":false,"name":"Téléphone","offset_x":0,"offset_y":-100,"portraits":[{"name":"Default","path":"res://characters/phone.png"}],"scale":100} diff --git a/dialogic/characters/character-1618911589.json b/dialogic/characters/character-1618911589.json new file mode 100644 index 0000000..8eda841 --- /dev/null +++ b/dialogic/characters/character-1618911589.json @@ -0,0 +1 @@ +{"color":"#ff03c6ab","default_speaker":false,"description":"","display_name":"","display_name_bool":false,"id":"character-1618911589.json","mirror_portraits":false,"name":"Narrateur","offset_x":0,"offset_y":0,"portraits":[{"name":"Default","path":""}],"scale":100} diff --git a/dialogic/definitions.json b/dialogic/definitions.json index 03514c9..85d3764 100644 --- a/dialogic/definitions.json +++ b/dialogic/definitions.json @@ -1 +1 @@ -{"glossary":[],"variables":[{"id":"1616657225-648","name":"tel_ouvert","type":0,"value":"0"}]} +{"glossary":[{"extra":"","id":"1618913698-364","name":"fermer","text":"Utilisateur habitué à cette fonctionnalité. Il n’est pas déboussolé face à une nouveauté.","title":"Téléphone verrouillé","type":1},{"extra":"","id":"1618913732-731","name":"ouvert","text":"Donne à l’entreprise une image moderne et éco-responsable. Possibilité de fidéliser des clients qui dépensent plus habituellement.","title":"Téléphone déverrouillé","type":1}],"variables":[{"id":"1616657225-648","name":"tel_ouvert","type":0,"value":"0"}]} diff --git a/dialogic/themes/theme-1616657657.cfg b/dialogic/themes/theme-1616657657.cfg index 742067e..9ed6314 100644 --- a/dialogic/themes/theme-1616657657.cfg +++ b/dialogic/themes/theme-1616657657.cfg @@ -22,6 +22,7 @@ shadow=false [definitions] color="#ffffffff" +show_glossary=false [name] diff --git a/dialogic/themes/theme-1618913551.cfg b/dialogic/themes/theme-1618913551.cfg new file mode 100644 index 0000000..1d0a606 --- /dev/null +++ b/dialogic/themes/theme-1618913551.cfg @@ -0,0 +1,31 @@ +[settings] + +name="theme_question" + +[buttons] + +use_background_color=false +background_color="#ff3c7c11" +text_color="#ff30c3f0" +use_native=true + +[box] + +size=Vector2( 1800, 200 ) + +[text] + +margin=Vector2( 40, 20 ) +alignment="Left" +shadow=false + +[definitions] + +color="#ffffffff" + +[name] + +image_visible=true +auto_color=true +shadow_visible=true +modulation=false diff --git a/dialogic/timelines/timeline-1616656510.json b/dialogic/timelines/timeline-1616656510.json deleted file mode 100644 index 7f716e6..0000000 --- a/dialogic/timelines/timeline-1616656510.json +++ /dev/null @@ -1 +0,0 @@ -{"events":[{"background":"res://backgrounds/bureauGroupe-2.jpg"},{"set_theme":"theme-1616657657.cfg"},{"options":[],"question":"Il est 10 heures, ce ne serait pas l'heure de la pause ?"},{"choice":"oui, j'ai soif !"},{"choice":"un petit café ne me ferait pas de mal"},{"choice":"Je vais voir mes merveilleux collègues !"},{"endbranch":""},{"change_timeline":"timeline-1616657347.json"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616656510.json","name":"question-cafe"}} diff --git a/dialogic/timelines/timeline-1616657347.json b/dialogic/timelines/timeline-1616657347.json index 22d456c..b0e8202 100644 --- a/dialogic/timelines/timeline-1616657347.json +++ b/dialogic/timelines/timeline-1616657347.json @@ -1 +1 @@ -{"events":[{"background":"res://backgrounds/coffeeRoom.jpg"},{"action":"join","character":"character-1616658373.json","portrait":"","position":{"0":false,"1":true,"2":false,"3":false,"4":false}},{"character":"","portrait":"","text":"Vous arrivez à la machine à café, Evelyne est déjà là"},{"definition":"1616657225-648","set_value":"5"},{"emit_signal":"value increment 10"},{"character":"character-1616658373.json","portrait":"","text":"Coucou !\nMoi c’est Evelyne, je suis dans ton service!\nJ’ai hâte de travailler avec toi, nous allons faire de belles choses ensemble !\nJ’ai entendu que le boss t’avais mis sur le projet du nouveau téléphone.\nC’est un gros projet pour commencer."},{"character":"character-1616658355.json","portrait":"","text":"Ouais c’est super mais ça me met la pression.\nEn plus je dois essayer de me démarquer des téléphones des autres entreprises en ajoutant de nouvelles fonctionnalités."},{"character":"character-1616658373.json","portrait":"","text":"Justement je voulais te parler d’un truc que j’ai en tête depuis un moment, je n’ai jamais eu l’occasion de le mettre en application, mais ton projet est parfait pour ça.\nAs-tu déjà entendu parlé du recyclage de pièces de téléphone ?"},{"options":[],"question":"Le recyclage, ça vous dit quelquechose ?"},{"choice":"Très brièvement…"},{"choice":"On m'en a parlé un peu"},{"character":"character-1616658355.json","portrait":"","text":"Quelqu’un m’en a parlé il y a longtemps mais je ne m’en souviens pas vraiment … "},{"endbranch":""},{"character":"character-1616658373.json","portrait":"","text":"En gros, contrairement aux derniers modèles de téléphones, le principe est que ton téléphone est démontable.\nDu coup, si tu as un problème sur une certaine pièce, comme la batterie, tu peux simplement la changer.\nÇa évite de devoir faire réparer ton téléphone entier ou d’en racheter un nouveau.\nTu peux imaginer l’économie que tu fais non seulement pour ton porte-monnaie, mais aussi pour la planète.\nSi tu l’appliques pour ton projet ça permettrait de donner une image éco-responsable de l’entreprise mais aussi de te démarquer de toutes ces marques qui poussent à la surconsommation."},{"options":[],"question":"Qu'en pensez vous ?"},{"choice":"C’est vrai que c’est intéressant je vais y réfléchir!"},{"character":"character-1616658373.json","portrait":"","text":"Super !"},{"choice":"Mouais…"},{"character":"character-1616658373.json","portrait":"","text":"Réfléchis-y, c'est important !"},{"endbranch":""},{"character":"character-1616658373.json","portrait":"","text":"Bon courage et à une prochaine pause café !"},{"action":"leaveall","character":"[All]"},{"wait_seconds":0},{"change_timeline":"timeline-1616659153.json"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616657347.json","name":"info-evelyne"}} +{"events":[{"background":"res://backgrounds/coffeeRoom.jpg"},{"action":"join","character":"character-1616658373.json","portrait":"","position":{"0":false,"1":true,"2":false,"3":false,"4":false}},{"character":"character-1616658373.json","portrait":"","text":"Coucou ! Moi c’est Evelyne, je suis dans ton service!\nJ’ai hâte de travailler avec toi, nous allons faire de belles choses ensemble !\nJ’ai entendu que le boss t’avais mis sur le projet du nouveau téléphone. C’est un gros projet pour commencer."},{"character":"character-1616658355.json","portrait":"","text":"Oui c’est super mais ça me met la pression. En plus je dois essayer de me démarquer des téléphones des autres entreprises en ajoutant de nouvelles fonctionnalités."},{"character":"character-1616658373.json","portrait":"","text":"Justement , tu pourrais laisser la possibilité à l’utilisateur de pouvoir ouvrir le téléphone. "},{"character":"character-1616658373.json","options":[],"portrait":"","question":"Si tu veux je peux te donner plus d’informations, je connais bien ce sujet."},{"choice":"Pourquoi pas","condition":"","definition":"","value":""},{"character":"character-1616658355.json","portrait":"","text":"Dis moi tout !"},{"character":"character-1616658373.json","portrait":"","text":"Si tu as un problème sur une certaine pièce, comme la batterie, tu peux simplement la changer au lieu d’en racheter un nouveau. \nTu peux imaginer l’économie que tu fais non seulement pour ton porte-monnaie, mais aussi pour la planète. \nSi tu l’appliques pour ton projet ça permettrait de donner une image éco-responsable à l’entreprise mais aussi de te démarquer de toutes ces marques qui poussent à la surconsommation."},{"choice":"J’ai du travail","condition":"","definition":"","value":""},{"character":"character-1616658355.json","portrait":"","text":"Je n’ai pas vraiment le temps, il faut que je retourne travailler."},{"character":"character-1616658373.json","options":[],"portrait":"","question":"Ça ne durera pas longtemps, promis !"},{"choice":"Je t’écoute !","condition":"","definition":"","value":""},{"character":"character-1616658355.json","portrait":"","text":"Ok, dis-moi tout."},{"character":"character-1616658373.json","portrait":"","text":"Si tu as un problème sur une certaine pièce, comme la batterie, tu peux simplement la changer au lieu d’en racheter un nouveau. \nTu peux imaginer l’économie que tu fais non seulement pour ton porte-monnaie, mais aussi pour la planète. "},{"choice":"Je n’ai vraiment pas le temps.","condition":"","definition":"","value":""},{"character":"character-1616658355.json","portrait":"","text":"Excuse moi, mais je n’ai vraiment pas le temps. Je retourne travailler, à la prochaine."},{"character":"character-1616658373.json","portrait":"","text":"D’accord, bon courage."},{"endbranch":""},{"endbranch":""},{"action":"join","character":"character-1616658435.json","mirror":false,"portrait":"Default","position":{"0":false,"1":false,"2":false,"3":true,"4":false}},{"character":"character-1616658435.json","portrait":"","text":"Salut toi ! Bienvenue parmi nous. Tu viens d’où mon ami ?"},{"character":"character-1616658355.json","portrait":"","text":"Oh rien d’original j’arrive tout droit de la région parisienne et toi ?"},{"character":"character-1616658435.json","portrait":"","text":"Alors … C’est compliqué … Je crois que je suis suisse."},{"character":"character-1616658355.json","portrait":"","text":"Tu crois ?"},{"character":"character-1616658435.json","portrait":"","text":"Je ne suis pas sûr… Bienvenue parmi nous !"},{"action":"leaveall","character":"[All]"},{"wait_seconds":1},{"change_timeline":"timeline-1618912317.json"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616657347.json","name":"1_1_info-cafe"}} diff --git a/dialogic/timelines/timeline-1616659153.json b/dialogic/timelines/timeline-1616659153.json deleted file mode 100644 index 1ad397c..0000000 --- a/dialogic/timelines/timeline-1616659153.json +++ /dev/null @@ -1 +0,0 @@ -{"events":[{"background":"res://backgrounds/bureauGroupe-2.jpg"},{"character":"","portrait":"","text":"Vous vous dirigez vers votre bureau"},{"action":"join","character":"character-1616658435.json","portrait":"","position":{"0":false,"1":false,"2":false,"3":true,"4":false}},{"character":"character-1616658435.json","portrait":"","text":"Salut toi ! Bienvenue parmi nous. Tu viens d’où mon ami ?"},{"character":"character-1616658355.json","portrait":"","text":"Oh rien d’original je viens de région parisienne et toi ?"},{"character":"character-1616658435.json","portrait":"","text":"Alors … C’est compliqué … Je crois que je suis suisse."},{"character":"character-1616658355.json","portrait":"","text":"Tu crois ?"},{"character":"character-1616658435.json","portrait":"","text":"Je ne suis pas sûr … Bisous ! Bienvenue parmi nous"},{"action":"leaveall","character":"[All]"},{"change_timeline":"timeline-1616659608.json"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616659153.json","name":"merde-patrick-1"}} diff --git a/dialogic/timelines/timeline-1616659306.json b/dialogic/timelines/timeline-1616659306.json index 73db1f1..50a5426 100644 --- a/dialogic/timelines/timeline-1616659306.json +++ b/dialogic/timelines/timeline-1616659306.json @@ -1 +1 @@ -{"events":[{"change_timeline":"timeline-1617871263.json"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616659306.json","name":"_start"}} +{"events":[{"change_timeline":"timeline-1618911641.json"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616659306.json","name":"0_start"}} diff --git a/dialogic/timelines/timeline-1616659608.json b/dialogic/timelines/timeline-1616659608.json deleted file mode 100644 index 88caeb7..0000000 --- a/dialogic/timelines/timeline-1616659608.json +++ /dev/null @@ -1 +0,0 @@ -{"events":[{"background":"res://backgrounds/bureauPerso.jpg"},{"character":"","portrait":"","text":"Vous arrivez à votre bureau."},{"action":"join","character":"character-1616658471.json","portrait":"","position":{"0":false,"1":false,"2":true,"3":false,"4":false}},{"character":"","portrait":"","text":"Vous avez reçu un mail du Boss !"},{"options":[],"question":"Le lire ?"},{"choice":"oui"},{"choice":"non"},{"character":"","portrait":"","text":"C'est un mail du Boss, il faudrait le lire quand même."},{"endbranch":""},{"character":"character-1616658471.json","portrait":"","text":"Bonjour\nJ’espère que tout se passe bien pour vous au sein de notre entreprise.\nJe viens vers vous pour vous rappeler que votre premier projet est le développement d’un nouveau téléphone portable.\nCe projet est d’une très grande importance pour l’entreprise et représente un très grand investissement.\nEn effet, il sera difficile pour l’entreprise de survivre à un échec commercial de ce produit. \nC’est pourquoi, il est vital que le projet soit non seulement un succès, mais également qu’il nous crée une clientèle nombreuse et fidèle.\nSi nous arrivons à fidéliser nos clients à notre téléphone, nous nous assurons un succès pour de possibles futures nouvelles versions de ce dernier.\nDès lors qu’il deviendra obsolète, ou encore si ses composants s’abîment, ces mêmes clients n'hésiteront pas à acheter la nouvelle version.\nJ’espère que vous mesurez donc l’importance de la réussite de ce projet et des impacts que cela pourrait avoir sur le chiffre d'affaires de l’entreprise.\nCordialement, The boss."},{"action":"leaveall","character":"[All]"},{"change_timeline":"timeline-1616659917.json"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616659608.json","name":"mail-ouverture"}} diff --git a/dialogic/timelines/timeline-1616659917.json b/dialogic/timelines/timeline-1616659917.json index 0a1d4e2..b2624f3 100644 --- a/dialogic/timelines/timeline-1616659917.json +++ b/dialogic/timelines/timeline-1616659917.json @@ -1 +1 @@ -{"events":[{"background":"res://backgrounds/bureauPerso.jpg"},{"action":"join","character":"character-1616658435.json","portrait":"","position":{"0":false,"1":true,"2":false,"3":false,"4":false}},{"character":"character-1616658435.json","portrait":"","text":"Tu savais que l’escargot le plus gros du monde peut peser jusqu’à 1,5 kg ?"},{"character":"character-1616658355.json","portrait":"","text":"Oh c’est toi ! Tu m’as fait peur... Mais non je ne savais pas c’est impressionnant !"},{"character":"character-1616658435.json","portrait":"","text":"Tu te coucheras moins bête ce soir !\nBisous !\nÀ plus dans le bus !"},{"action":"leaveall","character":"[All]"},{"wait_seconds":1},{"character":"character-1616658355.json","portrait":"","text":"Étrange collègue ce Patrick."},{"change_timeline":"timeline-1616660188.json"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616659917.json","name":"merde-patrick-2"}} +{"events":[{"background":"res://backgrounds/bureauPerso.jpg"},{"action":"join","character":"character-1616658435.json","portrait":"","position":{"0":false,"1":true,"2":false,"3":false,"4":false}},{"character":"character-1616658435.json","portrait":"","text":"Tu savais que l’escargot le plus gros du monde peut peser jusqu’à 1,5 kg ?"},{"character":"character-1616658355.json","portrait":"","text":"Oh c’est toi ! Tu m’as fait peur... Mais non je ne savais pas c’est impressionnant !"},{"character":"character-1616658435.json","portrait":"","text":"Tu te coucheras moins bête ce soir !"},{"action":"leaveall","character":"[All]"},{"wait_seconds":1},{"change_timeline":"timeline-1616660188.json"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616659917.json","name":"1_1_patrick_1"}} diff --git a/dialogic/timelines/timeline-1616660188.json b/dialogic/timelines/timeline-1616660188.json index 8c95e02..3493391 100644 --- a/dialogic/timelines/timeline-1616660188.json +++ b/dialogic/timelines/timeline-1616660188.json @@ -1 +1 @@ -{"events":[{"background":"res://backgrounds/bureauPerso.jpg"},{"action":"join","character":"character-1616660196.json","portrait":"","position":{"0":false,"1":false,"2":true,"3":false,"4":false}},{"character":"","portrait":"","text":"Vous avez reçu une notification d’un article parlant du recyclage des pièces en cas de panne des téléphones."},{"character":"character-1616660196.json","portrait":"","text":"Le dépannage représente également une alternative idéale au gaspillage généré par la consommation excessive d’appareils électroniques.\nDe plus en plus d’enseignes se consacrent à la réparation de smartphones et/ou commercialisent des pièces de rechange.\n Si auparavant, la plupart des utilisateurs de smartphones laissaient leur appareil à l’abandon suite à une panne quelconque, le constat n’est plus le même aujourd’hui.\nEn effet, les pièces de rechange, majoritairement issus du processus de recyclage, sont vendues à des prix très abordables.\nFace à la concurrence grandissante dans le domaine du dépannage de mobile, le coût des services est à la baisse.\nAu plus grand profit des utilisateurs de smartphones.\nFaire réparer son smartphone constitue une alternative plus économique que d’investir dans l’acquisition d’un nouvel appareil. "},{"action":"leaveall","character":"[All]"},{"change_timeline":"timeline-1616660446.json"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616660188.json","name":"notification-1"}} +{"events":[{"background":"res://backgrounds/bureauPerso.jpg"},{"action":"join","character":"character-1616660196.json","portrait":"","position":{"0":false,"1":false,"2":true,"3":false,"4":false}},{"character":"character-1616660196.json","portrait":"","text":"Vous avez reçu une notification d’un article parlant du recyclage des pièces en cas de panne des téléphones."},{"character":"character-1616660196.json","portrait":"","text":"Le dépannage représente une alternative idéale au gaspillage généré par la consommation excessive d’appareils électroniques. \nDe plus en plus d’enseignes se consacrent à la réparation de smartphones et/ou commercialisent des pièces de rechange. "},{"character":"character-1616660196.json","options":[],"portrait":"","question":"Ces dernières, majoritairement issues du processus de recyclage, sont vendues à des prix très abordables. "},{"choice":"Je n’y avais pas pensé","condition":"","definition":"","value":""},{"character":"character-1616660196.json","portrait":"","text":"Face à la concurrence grandissante dans le domaine du dépannage de mobile, le coût des services est à la baisse. \nFaire réparer son smartphone constitue donc une alternative plus économique que d’investir dans l’acquisition d’un nouvel appareil. "},{"choice":"Pas très utile","condition":"","definition":"","value":""},{"character":"character-1616658355.json","portrait":"","text":"Ça ne me sert à rien, j’arrête de lire."},{"endbranch":""},{"action":"leaveall","character":"[All]"},{"wait_seconds":1},{"change_timeline":"timeline-1616660446.json"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616660188.json","name":"1_1_notification_1"}} diff --git a/dialogic/timelines/timeline-1616660446.json b/dialogic/timelines/timeline-1616660446.json index 4baf44c..16fede3 100644 --- a/dialogic/timelines/timeline-1616660446.json +++ b/dialogic/timelines/timeline-1616660446.json @@ -1 +1 @@ -{"events":[{"background":"res://backgrounds/bureauPerso.jpg"},{"action":"join","character":"character-1616658403.json","portrait":"","position":{"0":false,"1":true,"2":false,"3":false,"4":false}},{"character":"","portrait":"","text":"Une personne rentre dans votre bureau..."},{"character":"character-1616658403.json","portrait":"","text":"Salut ça va ?\n Bienvenue !\nJe m’appelle Jean-Michel.\nDis moi, t'as déjà une idée de design pour le téléphone ?"},{"options":[],"question":"Avez vous une idée ?"},{"choice":"Pas vraiment"},{"choice":"Quelques unes"},{"endbranch":""},{"character":"character-1616658403.json","portrait":"","text":"De mon côté j’ai plein d’idées de designs vraiment cools qui pourraient plaire à tout le monde.\nEn plus, ça prendrait en compte toutes les fonctionnalités que le téléphone aura, comme un lecteur d’empreintes digitales."},{"character":"character-1616658355.json","portrait":"","text":"Super !\nPar contre, Evelyne m’a parlé d’une idée qui me plait et je sais pas si ça serait compatible avec tes designs."},{"character":"character-1616658403.json","portrait":"","text":"Houla !\nC’est quoi cette idée encore ?"},{"character":"character-1616658355.json","portrait":"","text":"Elle m’a parlé du fait de pouvoir ouvrir le téléphone et donc que la coque soit amovible..."},{"character":"character-1616658403.json","portrait":"","text":"Mais tu ne peux pas faire ça !\nLes designs différents c’est ce qui fera que le téléphone se distinguera des autres.\nPareil pour les fonctionnalités !\nToutes les marques concurrentes ont un lecteur d’empreintes.\nAvec cette modification, impossible de faire ça, et les utilisateurs diront que nous sommes à la traîne au niveau des technologies utilisées."},{"options":[],"question":"Qu'en pensez vous ?"},{"choice":"Tu n’as pas tord"},{"choice":"Je n’y ai pas encore réfléchi"},{"endbranch":""},{"character":"character-1616658403.json","portrait":"","text":"Fais attention des décisions comme celles-ci pourraient avoir de grandes conséquences pour l’entreprise…\nBonnes ou mauvaises !"},{"action":"leaveall","character":"[All]"},{"wait_seconds":0},{"change_timeline":"timeline-1616660984.json"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616660446.json","name":"info-jm"}} +{"events":[{"background":"res://backgrounds/bureauPerso.jpg"},{"action":"join","character":"character-1616658403.json","portrait":"","position":{"0":false,"1":true,"2":false,"3":false,"4":false}},{"character":"character-1616658403.json","portrait":"","text":"Salut ça va ?\nBienvenue ! Je m’appelle Jean-Michel. "},{"character":"character-1616658403.json","options":[],"portrait":"","question":"Dis-moi, t'as déjà une idée de design pour le téléphone ?"},{"choice":"Pas vraiment","condition":"","definition":"","value":""},{"character":"character-1616658403.json","portrait":"","text":"Ben j’ai plein d’idées de designs vraiment cools qui pourraient plaire à tout le monde.\nEn plus, ça prendrait en compte toutes les fonctionnalités du téléphone, comme un lecteur d’empreintes digitales."},{"choice":"J’ai quelques idées","condition":"","definition":"","value":""},{"character":"character-1616658355.json","portrait":"","text":"J’avais pensé à une coque transparente, je pense que ça pourrait plaire aux utilisateurs.\nOu bien faire une gamme de différentes couleurs, afin que chacun y trouve son compte.\nMais bon, rien n’est fixé pour le moment."},{"character":"character-1616658403.json","portrait":"","text":"Ok c’est intéressant, de mon côté, j’ai aussi plein d’idées de designs vraiment cools qui pourraient plaire à tout le monde. \nEn plus, ça prendrait en compte toutes les fonctionnalités du téléphone, comme un lecteur d’empreintes digitales."},{"endbranch":""},{"character":"character-1616658355.json","portrait":"","text":"Ah ben écoute super ! \nPar contre, j’ai discuté avec Evelyne de la possibilité d’ouvrir le téléphone, et donc que la coque soit amovible.\nJe ne sais pas si ça serait compatible avec tes designs."},{"character":"character-1616658403.json","portrait":"","text":"Mais tu peux pas faire ça ! "},{"character":"character-1616658355.json","portrait":"","text":"Pourquoi pas ?"},{"character":"character-1616658403.json","portrait":"","text":"Les designs différents c’est ce qui fera que le téléphone se distinguera des autres. \nPareil pour les fonctionnalités ! \nToutes les marques concurrentes ont un lecteur d’empreintes. \nAvec cette modification, impossible de faire ça, et les utilisateurs diront que nous sommes à la traîne au niveau des technologies utilisées."},{"character":"","options":[],"portrait":"","question":"Qu'en pensez vous ?"},{"choice":"Tu n’as pas tord","condition":"","definition":"","value":""},{"character":"character-1616658403.json","portrait":"","text":"Ravi de constater que nous sommes sur la même longueur d’onde."},{"choice":"C’est une bonne idée pourtant.","condition":"","definition":"","value":""},{"choice":"Je dois y réfléchir...","condition":"","definition":"","value":""},{"endbranch":""},{"character":"character-1616658403.json","portrait":"","text":"Fais attention des décisions comme celles-ci pourraient avoir de grandes conséquences pour l’entreprise… Bonnes ou mauvaises !"},{"action":"leaveall","character":"[All]"},{"wait_seconds":1},{"change_timeline":"timeline-1616660984.json"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616660446.json","name":"1_1_info_jm"}} diff --git a/dialogic/timelines/timeline-1616660984.json b/dialogic/timelines/timeline-1616660984.json index 19e25a3..6ac0aa4 100644 --- a/dialogic/timelines/timeline-1616660984.json +++ b/dialogic/timelines/timeline-1616660984.json @@ -1 +1 @@ -{"events":[{"background":"res://backgrounds/bureauPerso.jpg"},{"action":"join","character":"character-1616658471.json","portrait":"","position":{"0":false,"1":false,"2":true,"3":false,"4":false}},{"character":"","portrait":"","text":"Vous avez reçu un mail !"},{"character":"character-1616658471.json","portrait":"","text":"Bravo !\nVous êtes le gagnant de la tombola de l’école maternelle des coquelicots en fleurs !\nVous avez gagné un jambon entier félicitations ! \nPour récupérer votre prix, veuillez vous présenter au bureau de la directrice.\nL’association des parents d’élèves des coquelicots."},{"options":[],"question":"..."},{"choice":"C'est dommage je suis végétarien..."},{"character":"character-1616658355.json","portrait":"","text":"J'en parlerai à la directrice."},{"choice":"Miam !"},{"character":"character-1616658355.json","portrait":"","text":"Tous ces apéros en perspective !\nJe vais me régaler."},{"endbranch":""},{"action":"leaveall","character":"[All]"},{"wait_seconds":1},{"change_timeline":"timeline-1616661304.json"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616660984.json","name":"merde-mail-1"}} +{"events":[{"background":"res://backgrounds/bureauPerso.jpg"},{"action":"join","character":"character-1616658471.json","portrait":"","position":{"0":false,"1":false,"2":true,"3":false,"4":false}},{"character":"","options":[],"portrait":"","question":"Nouveau mail de l’école maternelle des coquelicots en fleurs ! Le lire ?"},{"choice":"Oui","condition":"","definition":"","value":""},{"character":"character-1616658471.json","portrait":"","text":"Tu es le gagnant de la tombola de l’école maternelle des coquelicots en fleurs ! \nTu as gagné un jambon entier, félicitations ! \nPour récupérer votre prix, veuillez vous présenter au bureau de la directrice."},{"character":"character-1616658471.json","options":[],"portrait":"","question":"L’association des parents d’élèves des coquelicots."},{"choice":"C'est dommage je suis végétarien...","condition":"","definition":"","value":""},{"character":"character-1616658355.json","portrait":"","text":"J'en parlerai à la directrice."},{"choice":"Miam !","condition":"","definition":"","value":""},{"character":"character-1616658355.json","portrait":"","text":"Tous ces apéros en perspective!"},{"endbranch":""},{"choice":"Non","condition":"","definition":"","value":""},{"endbranch":""},{"action":"leaveall","character":"[All]"},{"wait_seconds":1},{"change_timeline":"timeline-1616661304.json"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616660984.json","name":"1_1_junk_mail_1"}} diff --git a/dialogic/timelines/timeline-1616661304.json b/dialogic/timelines/timeline-1616661304.json index ea1fcb0..98f97db 100644 --- a/dialogic/timelines/timeline-1616661304.json +++ b/dialogic/timelines/timeline-1616661304.json @@ -1 +1 @@ -{"events":[{"background":"res://backgrounds/bureauPerso.jpg"},{"character":"","portrait":"","text":"C'est l'heure de passer au travail !\nIl est temps de décider du design du téléphone.\nVoulez vous permettre l'ouverture du téléphone ?\nOu plutot le verrouiller ? "},{"options":[],"question":"Téléphone verrouillé ou ouvert ?"},{"choice":"Ouvert"},{"character":"character-1616658355.json","portrait":"","text":"Un téléphone ouvert me semble être la meilleure solution.\nJe vais voir ce que mes collègues en pensent, je suis sûr qu'Evelyne me soutiendra !"},{"definition":"1616657225-648","set_value":"1"},{"choice":"Verrouillé"},{"character":"character-1616658355.json","portrait":"","text":"Un téléphone verrouillé me semble être la meilleure solution.\nJe vais voir ce que mes collègues en pensent, je suis sûr que Jean-Michel sera ravi !"},{"definition":"1616657225-648","set_value":"0"},{"endbranch":""},{"character":"","portrait":"","text":"Vous annoncez votre décision par mail à vos collègues.\nVous les rejoignez ensuite dans la salle de réunion."},{"wait_seconds":1},{"condition":"==","definition":"1616657225-648","value":"1"},{"change_timeline":"timeline-1616661658.json"},{"endbranch":""},{"condition":"==","definition":"1616657225-648","value":"0"},{"change_timeline":"timeline-1616661685.json"},{"endbranch":""}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616661304.json","name":"question-tel-ouvert"}} +{"events":[{"background":"res://backgrounds/bureauPerso.jpg"},{"action":"join","character":"character-1618911589.json","mirror":false,"portrait":"Default","position":{"0":false,"1":false,"2":true,"3":false,"4":false}},{"character":"character-1618911589.json","portrait":"","text":"C'est l'heure de faire un choix ! Vous devez décider si le prochain modèle de téléphone laissera la possibilité à l'utilisateur de l'ouvrir, ou sera verrouillé."},{"set_theme":"theme-1618913551.cfg"},{"character":"character-1618911589.json","options":[],"portrait":"","question":"Souhaitez-vous fermer le téléphone à l'utilisateur ou le laisser ouvert ?"},{"choice":"Ouvert","condition":"","definition":"","value":""},{"character":"character-1616658355.json","portrait":"","text":"Un téléphone ouvert me semble être la meilleure solution.\nJe vais voir ce que mes collègues en pensent, je suis sûr qu'Evelyne me soutiendra !"},{"definition":"1616657225-648","set_value":"1"},{"choice":"Verrouillé","condition":"","definition":"","value":""},{"character":"character-1616658355.json","portrait":"","text":"Un téléphone verrouillé me semble être la meilleure solution.\nJe vais voir ce que mes collègues en pensent, je suis sûr que Jean-Michel sera ravi !"},{"definition":"1616657225-648","set_value":"0"},{"endbranch":""},{"character":"character-1618911589.json","portrait":"","text":"Vous annoncez votre décision par mail à vos collègues.\nVous les rejoignez ensuite dans la salle de réunion."},{"wait_seconds":1},{"set_theme":"theme-1616657657.cfg"},{"condition":"==","definition":"1616657225-648","value":"1"},{"change_timeline":"timeline-1616661658.json"},{"endbranch":""},{"condition":"==","definition":"1616657225-648","value":"0"},{"change_timeline":"timeline-1616661685.json"},{"endbranch":""}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616661304.json","name":"1_1_question_tel_ouvert"}} diff --git a/dialogic/timelines/timeline-1616661658.json b/dialogic/timelines/timeline-1616661658.json index 6b5c9f8..747c727 100644 --- a/dialogic/timelines/timeline-1616661658.json +++ b/dialogic/timelines/timeline-1616661658.json @@ -1 +1 @@ -{"events":[{"background":"res://backgrounds/meetingRoom.jpg"},{"action":"join","character":"character-1616658403.json","portrait":"","position":{"0":false,"1":true,"2":false,"3":false,"4":false}},{"character":"","portrait":"","text":"Test"},{"character":"character-1616658403.json","portrait":"","text":"On peut discuter une minute ?"},{"character":"character-1616658355.json","portrait":"","text":"Euh oui pas de soucis qu’est ce qu’il se passe ?"},{"character":"character-1616658403.json","portrait":"","text":"Je viens d’apprendre que ton projet vient d’être validé mais que c’est le projet de développer un téléphone que l’utilisateur peut ouvrir !\nTu as une idée des répercussions sur l’entreprise que cela va avoir ?\nL’entreprise va perdre beaucoup d’argent à laisser la possibilité aux gens de réparer leurs téléphones en leur laissant l’accès aux composants !\nEt toutes les idées dont je t’avais parlé de technologies innovantes et de designs incroyables sont réduits à néant !\nFranchement je ne sais pas ce qui t’es passé par la tête mais ça me laisse sans voix …\nSur ce je n’ai plus rien à dire au revoir."},{"action":"join","character":"character-1616658373.json","portrait":"","position":{"0":false,"1":false,"2":false,"3":true,"4":false}},{"character":"character-1616658373.json","portrait":"","text":"Re-bonjour ! Quelle belle journée aujourd’hui !\nJ’ai appris que tu avais repris mon idée de pouvoir ouvrir le téléphone dans ton projet de développement.\nC’est une sage décision qui va engendrer tellement de choses positives pour l’entreprise.\nC’est le début d’une nouvelle ère technologique responsable, crois moi !\nOui au recyclage et oui à la seconde vie des appareils !"},{"character":"character-1616658355.json","portrait":"","text":"Je suis content que ce projet provoque un tel enthousiasme en toi !"},{"action":"join","character":"character-1616658435.json","portrait":"","position":{"0":true,"1":false,"2":false,"3":false,"4":false}},{"character":"character-1616658435.json","portrait":"","text":"Il se passe quoi ici ?"},{"character":"character-1616658355.json","portrait":"","text":"Tu n'as pas vu mon mail ?"},{"character":"character-1616658435.json","portrait":"","text":"Ah non.."},{"wait_seconds":1},{"character":"character-1616658435.json","portrait":"","text":"J'ai perdu mon mot de passe\n...\n..."},{"wait_seconds":1},{"action":"leaveall","character":"character-1616658435.json"},{"character":"character-1616658373.json","portrait":"","text":"...\nBon\nEn tout cas je suis ravie de ton choix !\nJe te laisse j’ai une réunion dans 10 min à bientôt !"},{"action":"leaveall","character":"[All]"},{"change_timeline":"timeline-1616662258.json"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616661658.json","name":"conseq-tel-ouvert-1"}} +{"events":[{"background":"res://backgrounds/meetingRoom.jpg"},{"action":"join","character":"character-1616658403.json","portrait":"","position":{"0":false,"1":true,"2":false,"3":false,"4":false}},{"character":"character-1616658403.json","portrait":"","text":"On peut discuter une minute ?"},{"character":"character-1616658355.json","portrait":"","text":"Euh oui pas de soucis qu’est ce qu’il se passe ?"},{"character":"character-1616658403.json","portrait":"","text":"Je viens d’apprendre que ton projet vient d’être validé mais que tu as gardé l’option de développer un téléphone que l’utilisateur peut ouvrir ! \nTu as une idée des répercussions sur l’entreprise que cela va avoir ? \nOn va perdre beaucoup d’argent cette année à laisser la possibilité aux clients de réparer leur téléphone s’ils ont accès aux composants ! "},{"character":"character-1616658355.json","portrait":"","text":"Pas forcément, l’entreprise peut élargir son activité à la fabrication de ces composants."},{"character":"character-1616658403.json","portrait":"","text":"Et tu crois que ça ne va pas coûter cher ?\nEt toutes les idées de design dont je t’avais parlé sont réduites à néant ! \nFranchement je ne sais pas ce qui t’est passé par la tête mais ça me laisse sans voix … \nSur ce je n’ai plus rien à dire au revoir."},{"action":"leaveall","character":"character-1616658403.json"},{"wait_seconds":0.1},{"action":"join","character":"character-1616658373.json","portrait":"","position":{"0":false,"1":false,"2":false,"3":true,"4":false}},{"character":"character-1616658373.json","portrait":"","text":"Bonjour ! Quelle belle journée aujourd’hui !"},{"character":"character-1616658355.json","portrait":"","text":"Bonjour !"},{"character":"character-1616658373.json","portrait":"","text":"J’ai appris que tu avais choisi de pouvoir ouvrir le téléphone dans ton projet de développement. \nC’est une sage décision qui va engendrer tellement de choses positives pour l’entreprise. \nC’est le début d’une nouvelle ère technologique responsable, crois moi !\nOui au recyclage et oui à la seconde vie des appareils !"},{"character":"character-1616658355.json","portrait":"","text":"Je suis content que ce projet provoque un tel enthousiasme en toi !"},{"character":"character-1616658373.json","portrait":"","text":"Je suis ravie ! Je te laisse j’ai une réunion dans 10 minutes à bientôt !"},{"action":"leaveall","character":"[All]"},{"wait_seconds":1},{"change_timeline":"timeline-1616662258.json"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616661658.json","name":"1_1_tel_ouvert_1"}} diff --git a/dialogic/timelines/timeline-1616661685.json b/dialogic/timelines/timeline-1616661685.json index 415394f..2124db8 100644 --- a/dialogic/timelines/timeline-1616661685.json +++ b/dialogic/timelines/timeline-1616661685.json @@ -1 +1 @@ -{"events":[{"background":"res://backgrounds/meetingRoom.jpg"},{"action":"join","character":"character-1616658471.json","portrait":"","position":{"0":false,"1":false,"2":true,"3":false,"4":false}},{"character":"","portrait":"","text":"Vous avez reçu un mail du Boss !"},{"character":"character-1616658471.json","portrait":"","text":"Bonjour,\nJe souhaitais vous féliciter concernant votre projet de téléphone.\nJ’ai récemment appris que vous aviez hésité concernant la possibilité d’ouvrir le téléphone ou non.\nSachez que je suis plus que satisfait de votre choix.\nEn effet, le fait d’avoir fermé le téléphone nous permettra d’augmenter notre chiffre d’affaires de manière significative.\nD’une part grâce à de nouveaux designs innovants et attractifs, mais également grâce à une fidélisation de la clientèle, je ne peux qu’approuver votre choix.\nContinuez sur cette lancée !\nEn vous souhaitant une bonne journée.\nCordialement, The boss"},{"action":"leaveall","character":"character-1616658471.json"},{"wait_seconds":1},{"action":"join","character":"character-1616658373.json","portrait":"","position":{"0":false,"1":true,"2":false,"3":false,"4":false}},{"character":"character-1616658373.json","portrait":"","text":"Re\nJe croyais que tu avais compris ce que je t’avais dit concernant le recyclage des composants des téléphones.\nEn fermant le téléphone, tu condamnes les utilisateurs à devoir changer leur téléphone au moindre problème.\nEn faisant ceci, tu deviens partisan de la surconsommation et donc de la pollution de notre planète.\nTu crois que le chiffre d’affaires de l’entreprise importera quand nous n’aurons même plus un endroit où vivre ?"},{"action":"join","character":"character-1616658403.json","portrait":"","position":{"0":false,"1":false,"2":false,"3":true,"4":false}},{"character":"character-1616658403.json","portrait":"","text":"Hey !\nUn petit golf samedi ?"},{"character":"character-1616658373.json","portrait":"","text":"Tu permets ?\nNous sommes en pleine discussion."},{"character":"character-1616658403.json","portrait":"","text":"Okay, faut pas être tendue comme ça..."},{"action":"leaveall","character":"character-1616658403.json"},{"character":"character-1616658373.json","portrait":"","text":"Bref\nJe te laisse réfléchir à ça je dois y aller il me reste 1h de pause je vais aller courir un peu…"},{"action":"leaveall","character":"[All]"},{"change_timeline":"timeline-1616662258.json"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616661685.json","name":"conseq-tel-ouvert-2"}} +{"events":[{"background":"res://backgrounds/meetingRoom.jpg"},{"action":"join","character":"character-1616658471.json","portrait":"","position":{"0":false,"1":false,"2":true,"3":false,"4":false}},{"character":"character-1616658471.json","portrait":"","text":"Vous avez reçu un mail du Boss !\nBonjour, je souhaitais vous féliciter concernant votre projet de téléphone. \nSachez que je suis plus que satisfait de votre choix. \nEn effet, le fait d’avoir fermé le téléphone nous permettra d’augmenter notre chiffre d'affaires de manière significative dans les mois à venir. \nContinuez sur cette lancée !\nEn vous souhaitant une bonne journée. Cordialement, The boss"},{"action":"leaveall","character":"character-1616658471.json"},{"wait_seconds":1},{"action":"join","character":"character-1616658373.json","portrait":"","position":{"0":false,"1":true,"2":false,"3":false,"4":false}},{"character":"character-1616658373.json","portrait":"","text":"Salut, t’as deux minutes ?"},{"character":"character-1616658355.json","portrait":"","text":"Euh …"},{"character":"character-1616658373.json","portrait":"","text":"Je croyais que tu avais compris ce que je t’avais dit concernant le recyclage des composants. \nEn fermant le téléphone, tu condamnes les utilisateurs à devoir le changer au moindre problème.\nEn faisant ceci, tu deviens partisan de la surconsommation et donc de la pollution de notre planète. "},{"character":"character-1616658355.json","portrait":"","text":"Peut être, mais cela va permettre de nettement augmenter le chiffre d'affaires de l’entreprise."},{"character":"character-1616658373.json","portrait":"","text":"Tu crois que notre chiffre d'affaires importera quand nous n’aurons même plus d’endroit décent pour vivre ? \nJe te laisse réfléchir à ça je dois y aller il me reste une heure de pause je vais aller courir un peu…"},{"action":"leaveall","character":"[All]"},{"wait_seconds":1},{"change_timeline":"timeline-1616662258.json"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616661685.json","name":"1_1_tel_ouvert_2"}} diff --git a/dialogic/timelines/timeline-1616662258.json b/dialogic/timelines/timeline-1616662258.json index ec58bf4..e8fb303 100644 --- a/dialogic/timelines/timeline-1616662258.json +++ b/dialogic/timelines/timeline-1616662258.json @@ -1 +1 @@ -{"events":[{"wait_seconds":1},{"character":"","portrait":"","text":"Fin de la démo, merci d'avoir joué !"},{"action":"join","character":"character-1616658435.json","portrait":"","position":{"0":false,"1":false,"2":false,"3":false,"4":true}},{"character":"character-1616658435.json","portrait":"","text":"À bientôt dans l'métro !"},{"action":"leaveall","character":"[All]"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616662258.json","name":"_end"}} +{"events":[{"wait_seconds":1},{"character":"","portrait":"","text":"Fin de la démo, merci d'avoir joué !"},{"action":"leaveall","character":"[All]"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616662258.json","name":"0_end"}} diff --git a/dialogic/timelines/timeline-1617871263.json b/dialogic/timelines/timeline-1617871263.json deleted file mode 100644 index 85366f8..0000000 --- a/dialogic/timelines/timeline-1617871263.json +++ /dev/null @@ -1 +0,0 @@ -{"events":[{"background":"res://backgrounds/bureauGroupe-2.jpg"},{"action":"join","character":"character-1616658373.json","portrait":"","position":{"0":false,"1":true,"2":false,"3":false,"4":false}},{"character":"character-1616658373.json","portrait":"","text":"Hello"},{"emit_signal":"setup_minigame score _test_minigame_end _test_minigame_end2"},{"background":""},{"character":"character-1616658373.json","portrait":"","text":"I explain stuff"},{"emit_signal":"start_minigame"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1617871263.json","name":"_test_minigame_start"}} diff --git a/dialogic/timelines/timeline-1617874348.json b/dialogic/timelines/timeline-1617874348.json deleted file mode 100644 index 1c90fd8..0000000 --- a/dialogic/timelines/timeline-1617874348.json +++ /dev/null @@ -1 +0,0 @@ -{"events":[{"action":"join","character":"character-1616658373.json","portrait":"","position":{"0":false,"1":false,"2":false,"3":true,"4":false}},{"character":"character-1616658373.json","portrait":"","text":"you lost"},{"character":"character-1616658373.json","options":[],"portrait":"","question":"Tu veux réessayer?"},{"choice":"Oui !","condition":"","definition":"","value":""},{"emit_signal":"setup_minigame score _test_minigame_end _test_minigame_end2"},{"background":""},{"emit_signal":"start_minigame"},{"choice":"Non","condition":"","definition":"","value":""},{"change_timeline":"timeline-1616661658.json"},{"endbranch":""}],"metadata":{"dialogic-version":"1.1","file":"timeline-1617874348.json","name":"_test_minigame_end"}} diff --git a/dialogic/timelines/timeline-1618851520.json b/dialogic/timelines/timeline-1618851520.json deleted file mode 100644 index 8218c1f..0000000 --- a/dialogic/timelines/timeline-1618851520.json +++ /dev/null @@ -1 +0,0 @@ -{"events":[{"action":"join","character":"character-1616658435.json","mirror":false,"portrait":"Default","position":{"0":true,"1":false,"2":false,"3":false,"4":false}},{"character":"","portrait":"","text":"T'as gagné! Enfin je crois..."},{"action":"leaveall","character":"[All]"},{"change_timeline":"timeline-1616656510.json"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1618851520.json","name":"_test_minigame_end2"}} diff --git a/dialogic/timelines/timeline-1618911641.json b/dialogic/timelines/timeline-1618911641.json new file mode 100644 index 0000000..e7b14ba --- /dev/null +++ b/dialogic/timelines/timeline-1618911641.json @@ -0,0 +1 @@ +{"events":[{"background":"res://backgrounds/bureauGroupe-2.jpg"},{"character":"character-1618911589.json","portrait":"","text":"Votre entretien s’est bien passé et vous avez eu le poste dans l’entreprise.\nLe premier projet que votre patron vous confie est de participer à la création d’un nouveau téléphone. \nVous allez travailler en collaboration avec trois de vos collègues : Jean-Michel, Evelyne et Patrick. "},{"character":"character-1616658355.json","portrait":"","text":"Il est 10h c’est l’heure de la pause !"},{"change_timeline":"timeline-1616657347.json"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1618911641.json","name":"1_1_intro"}} diff --git a/dialogic/timelines/timeline-1618912317.json b/dialogic/timelines/timeline-1618912317.json new file mode 100644 index 0000000..eed4f35 --- /dev/null +++ b/dialogic/timelines/timeline-1618912317.json @@ -0,0 +1 @@ +{"events":[{"background":"res://backgrounds/bureauPerso.jpg"},{"action":"join","character":"character-1616658471.json","mirror":false,"portrait":"Default","position":{"0":false,"1":false,"2":true,"3":false,"4":false}},{"character":"character-1616658471.json","options":[],"portrait":"","question":"Nouveau mail du Boss ! Le lire ?"},{"choice":"Oui","condition":"","definition":"","value":""},{"character":"character-1616658471.json","portrait":"","text":"Bonjour, J’espère que tout se passe bien pour vous au sein de notre entreprise. \nJe viens vers vous pour vous rappeler que votre premier projet est le développement d’un nouveau téléphone portable. \nCe projet est d’une très grande importance et représente un gros investissement."},{"character":"character-1616658471.json","options":[],"portrait":"","question":"En effet, il sera difficile pour l’entreprise de survivre à l’échec commercial de ce produit. "},{"choice":"Super, déjà des responsabilités !","condition":"","definition":"","value":""},{"character":"character-1616658471.json","portrait":"","text":"Ainsi, dès lors que le téléphone deviendra obsolète, ou si ses composants s’abîment, nos clients n'hésiteront pas à racheter nos produits. \nJ’espère que vous mesurez l’importance de la réussite de ce projet et de l’impact que cela pourrait avoir sur le chiffre d'affaires de l’entreprise.\nCordialement, The boss."},{"choice":"La pression... mieux vaut arrêter de lire","condition":"","definition":"","value":""},{"character":"character-1616658355.json","portrait":"","text":"Plus tard les mails"},{"endbranch":""},{"choice":"Non","condition":"","definition":"","value":""},{"character":"character-1616658355.json","options":[],"portrait":"","question":"C'est quand même un mail du boss..."},{"choice":"Oui mieux vaut le lire","condition":"","definition":"","value":""},{"character":"character-1616658471.json","portrait":"","text":"Bonjour, J’espère que tout se passe bien pour vous au sein de notre entreprise. \nJe viens vers vous pour vous rappeler que votre premier projet est le développement d’un nouveau téléphone portable. \nCe projet est d’une très grande importance et représente un gros investissement."},{"character":"character-1616658471.json","options":[],"portrait":"","question":"En effet, il sera difficile pour l’entreprise de survivre à l’échec commercial de ce produit. "},{"choice":"Super, déjà des responsabilités !","condition":"","definition":"","value":""},{"character":"character-1616658471.json","portrait":"","text":"Ainsi, dès lors que le téléphone deviendra obsolète, ou si ses composants s’abîment, nos clients n'hésiteront pas à racheter nos produits. \nJ’espère que vous mesurez l’importance de la réussite de ce projet et de l’impact que cela pourrait avoir sur le chiffre d'affaires de l’entreprise.\nCordialement, The boss."},{"choice":"La pression... mieux vaut arrêter de lire","condition":"","definition":"","value":""},{"character":"character-1616658355.json","portrait":"","text":"Plus tard les mails"},{"endbranch":""},{"choice":"Ce n’est pas le moment","condition":"","definition":"","value":""},{"character":"character-1616658355.json","portrait":"","text":"Plus tard les mails"},{"endbranch":""},{"endbranch":""},{"change_timeline":"timeline-1616659917.json"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1618912317.json","name":"1_1_mail_boss"}} diff --git a/scenes/Main.gd b/scenes/Main.gd index 1586bb7..b66fd7e 100644 --- a/scenes/Main.gd +++ b/scenes/Main.gd @@ -5,7 +5,7 @@ onready var mini_game = $MiniGame; var dialogic_node; func _ready(): - dialogic_node = Dialogic.start('_start') + dialogic_node = Dialogic.start('0_start') add_child_below_node($MiniGame, dialogic_node) dialogic_node.connect('dialogic_signal', self, "_on_Dialogic_signal_received")