diff --git a/SMRT/dialog.gd b/SMRT/dialog.gd index 6b5dc46..94b20f5 100644 --- a/SMRT/dialog.gd +++ b/SMRT/dialog.gd @@ -1,6 +1,7 @@ extends Patch9Frame #Declared variables: + export (String, FILE, "*.lan") var language = "res://addons/SMRT/example.lan" var dialogs = [] var speech_bubble @@ -16,6 +17,9 @@ export (int) var font_size = 32 export (SpriteFrames) var face_sprites = preload("res://addons/SMRT/faces/dialog.tres") export (Texture) var next_dialog_texture = preload("res://addons/SMRT/next_line.png") export var dialog_frame_height = 4 + +#DEBUG MESSAGES +export var show_debug_messages = false #Speed of the typewriter effect. If there is no value given in the message, #it defaults to this. var speed = float(.05) @@ -27,12 +31,12 @@ signal dialog_control(information) #It is a string that is interpreted: "top", "middle" and "down" #Thinking of making some global constants and change it to vector2 values var position + #If true, a beep sound will play for each character, excluding " " var beep = true # The pitch is a float that enables the beep to sound lower or higher to # create variations for characters. var beep_pitch = float(1.0) -# var finished = false var on_dialog = false var text @@ -40,10 +44,10 @@ var typewriter = true var enable_question var answers var btn_answers +var answer_number var black_screen var texture_width - - +var dialog_array #THE NEXT VAR IS SENT THROUGH THE SIGNALS dialog_control #AND answer_selected var info = {chapter = null, dialog = null, last_text_index = null, total_text = null, answer = null} @@ -68,21 +72,22 @@ func _ready(): #defaults if beep_WAV == null: - print(audio.get_sample_library().get_sample_list()) + if show_debug_messages: + print("Beep sound file not found, loading default") preload("res://addons/SMRT/beep_letter.wav") - print("NULL BEEP WAV") var beep = SampleLibrary.new() beep.add_sample("beep_letter", beep_WAV) audio.set_sample_library(beep) - print("beep letter: ",audio.get_sample_library().get_sample_list()) - print(font, typeof(font)) if font == null: + if show_debug_messages: + print("Font file not found, loading default") load("res://addons/SMRT/font/main_font.tres") - print("FONT IS LOADED FROM DEFAULT") + if face_sprites == null: + if show_debug_messages: + print("Face sprites file not found, loading default") preload("res://addons/SMRT/faces/dialog.tres") - print("FACE SPRITES", face) - print(face.get_sprite_frames().has_animation("default")) + face.set_sprite_frames(face_sprites) if next_dialog_texture == null: preload("res://addons/SMRT/next_line.png") @@ -97,6 +102,17 @@ func _ready(): store_dimensions() store_margins() +func reset(): + if show_debug_messages: + print("reseting the dialog system") + finished = false + on_dialog = false + text = null + position= null + side = null + answer_number = null + textObj.set_bbcode("") + dialog_array = [] func load_language(lang_file="res://addons/SMRT/example.lan"): @@ -105,13 +121,15 @@ func load_language(lang_file="res://addons/SMRT/example.lan"): lang_file = "res://addons/SMRT/example.lan" #Check for and load the language file if (file.open(lang_file,File.READ) == OK): + if show_debug_messages: + print("Found dialog file" , lang_file) var temp_lang = file.get_as_text() var dictionary = {} dictionary.parse_json(temp_lang) - print("LANGUAGE FILE WAS JUST LOADED") return dictionary else: - print("Error loading the language file") + if show_debug_messages: + print("Error loading dialog file") var temp_lang = {"Problem":{"Debug":[{"beep_pitch":1, "face_position":1, "beep":true, "text":"Error loading the language file!", "enable_question":false, "typewriter_speed":0.05, "typewriter":true, "frame_position":1, "face_frame":1}]}} var dictionary = {} dictionary.parse_json(temp_lang) @@ -121,7 +139,7 @@ func load_language(lang_file="res://addons/SMRT/example.lan"): func store_dimensions(): dimensions.box_rectangle = get_rect() dimensions.text_rectangle = textObj.get_rect() - print("DIMENSIONS ARE: ", dimensions.text_rectangle) + dimensions.text_rectangle.size.x += textObj.get_margin(0) + textObj.get_margin(2) dimensions.text_rectangle.size.y += textObj.get_margin(1) + textObj.get_margin(3) dimensions.font_size = font_size @@ -132,19 +150,16 @@ func store_margins(): dimensions.text_margin.right = textObj.get_margin(2) dimensions.text_margin.bottom = textObj.get_margin(3) -func show_text(chapter, dialog, start_at=0): - - +func show_text(chapter, dialog, start_at = 0): textObj.set_bbcode("") + text="" if start_at == null: start_at = 0 - var dialog_array if chapter =="single_text": info = {chapter = chapter, dialog = null, last_text_index = null, total_text = 1, answer = null} dialog_array = dialog position = 1 if typeof(dialog_array) == TYPE_STRING: - print("dialog was a single line of string") var single_text = {"text": dialog_array} dialog_array = [] dialog_array.append(single_text) @@ -153,11 +168,12 @@ func show_text(chapter, dialog, start_at=0): if current_chapter.empty(): dialog_array.append({text: "Chapter has no dialogs"}) else: - print("CHAPTER SIZE IS: ",current_chapter.size()) + if current_chapter.has(dialog): - print("Found dialog: ",dialog) + if show_debug_messages: + print("found dialog ", dialog) + dialog_array = current_chapter[dialog] - print("FOUND DIALOG!") if not dialog_array == null and typeof(dialogs) == TYPE_ARRAY: # STORE INFO info.chapter = chapter @@ -180,12 +196,13 @@ func show_text(chapter, dialog, start_at=0): BOTTOM = (get_viewport_rect().size)-Vector2(0,get_size().y) # A while loop that goes over each array value inside of dialog_array # based on the start_at parameter - while start_at < dialog_array.size() and on_dialog: - get_node("nextLine/animation").stop() + while on_dialog and start_at < dialog_array.size(): textObj.add_font_override("normal_font", font) nextLine.hide() # Gets the values to be reseted at the end of the loop # ERROR CHECKING: + if show_debug_messages: + print("STARTED DIALOG AT ", start_at) if dialog_array[start_at].has("beep"): beep = dialog_array[start_at].beep if dialog_array[start_at].has("beep_pitch"): @@ -206,7 +223,7 @@ func show_text(chapter, dialog, start_at=0): face.show() texture_width = face.get_sprite_frames().get_frame(face.get_animation(), face.get_frame()).get_width() - print("TEXTURE WIDTH IS: ",texture_width) + # Side of the dialog to display the face # RESETING THE DIALOG text = dialog_array[start_at].text @@ -217,16 +234,14 @@ func show_text(chapter, dialog, start_at=0): # SPEED if dialog_array[start_at].has("typewriter"): - print("TYPEWRITER EFFECT IS ON") typewriter = dialog_array[start_at].typewriter if typewriter: - print("=============") - print("CHECKING FOR TYPEWRITER EFFECT SPEED") + if dialog_array[start_at].has("typewriter_speed"): speed = dialog_array[start_at].typewriter_speed - print("SETTING TYPEWRITER EFFECT SPEED") + # If typewriter boolean is false, then gives ZERO to speed variable # to make the effect disapear. else: @@ -244,7 +259,6 @@ func show_text(chapter, dialog, start_at=0): #POSITION if the dialog is not bubble if position==0: - print("position is TOP") set_pos(Vector2(0,0)) elif position==1: set_pos(Vector2(0,screen_res.size.y/2)-Vector2(0,get_size().y/2)) @@ -275,37 +289,43 @@ func show_text(chapter, dialog, start_at=0): textObj.set_visible_characters(textObj.get_total_character_count()) #Play beep sound for each character if beep: + if show_debug_messages: + print("beep pitch = ", beep_pitch) audio.set_default_pitch_scale(beep_pitch) audio.play("beep_letter") #audio.set_param(1,old_beep_pitch) textObj.set_visible_characters(textObj.get_visible_characters()+ 1) timer.set_wait_time(speed) - #print("Value of characters visible: ",textObj.get_visible_characters()) timer.start() yield(timer, "timeout") #So, it will only happen if it is false at first if textObj.get_total_character_count() <= textObj.get_visible_characters():# and not finished and start_at < dialog_array.size()-1: get_node("nextLine/animation").play("idle") - print("Finished text display") + if show_debug_messages: + print("Finished text display") finished = true yield(get_tree(), "idle_frame") info.last_text_index = start_at yield(self,"dialog_control") if enable_question: question(answers) + start_at +=1 yield(self, "answer_selected") - start_at +=1 + else: + start_at +=1 finished = false #RESET The message system: - print("Added +1 to the start_at variable") on_dialog = false # Emits a signal when all the dialogs are over. # Useful to know exactly when it is possible to free the resources it holds. + if show_debug_messages: + print("SMRT finished displaying all the dialog") emit_signal("finished") beep_pitch = 1.0 self.hide() func question(answer_array): - print("STARTED QUESTION FUNCTION") + if show_debug_messages: + print("STARTED QUESTION FUNCTION") btn_answers = HButtonArray.new() btn_answers.add_font_override("font", font) btn_answers.add_style_override("normal", StyleBoxEmpty.new()) @@ -322,9 +342,20 @@ func question(answer_array): btn_answers.add_button(answer) func selected_answer(btn): - info.answer = btn + if show_debug_messages: + print("Answer selected: ", btn) + answer_number = btn func _input(event): + + if not event.is_echo() and event.is_action_pressed("ui_accept") and btn_answers != null and answer_number != null: + info.answer = answer_number + answer_number = null + emit_signal("dialog_control", info) + emit_signal("answer_selected") + btn_answers.queue_free() + info.answer = null + if not event.is_echo() and event.is_action_pressed("ui_accept"): if textObj.get_total_character_count() > textObj.get_visible_characters() and on_dialog: textObj.set_visible_characters(textObj.get_total_character_count()) @@ -332,13 +363,10 @@ func _input(event): if finished and not event.is_echo() and event.is_action_pressed("ui_accept"): emit_signal("dialog_control", info) - if not event.is_echo() and event.is_action_pressed("ui_accept") and btn_answers != null and info.answer != null: - btn_answers.queue_free() - btn_answers = null - print(btn_answers) - emit_signal("dialog_control", info) - emit_signal("answer_selected") - info.answer = null func stop(): - on_dialog = false + if show_debug_messages: + print("Stopping smrt godot") + if btn_answers != null: + btn_answers.queue_free() + reset() \ No newline at end of file diff --git a/SMRT/dialog.tscn b/SMRT/dialog.tscn index 8ac9340..c74b968 100644 --- a/SMRT/dialog.tscn +++ b/SMRT/dialog.tscn @@ -8,7 +8,7 @@ [ext_resource path="res://addons/SMRT/next_line.png" type="Texture" id=6] [ext_resource path="res://addons/SMRT/font/zig_____.ttf" type="DynamicFontData" id=7] -[sub_resource type="Animation" id=2] +[sub_resource type="Animation" id=1] length = 1.0 loop = true @@ -19,7 +19,7 @@ tracks/0/interp = 1 tracks/0/imported = false tracks/0/keys = { "times":FloatArray( 0, 0.5 ), "transitions":FloatArray( 1, 1 ), "update":1, "values":[ true, false ] } -[sub_resource type="Animation" id=3] +[sub_resource type="Animation" id=2] length = 1.0 loop = false @@ -35,7 +35,7 @@ tracks/1/interp = 1 tracks/1/imported = false tracks/1/keys = { "times":FloatArray( 0, 0.6 ), "transitions":FloatArray( 1, 1 ), "update":0, "values":[ 0.0, 1.0 ] } -[sub_resource type="Animation" id=4] +[sub_resource type="Animation" id=3] length = 1.0 loop = false @@ -51,7 +51,7 @@ tracks/1/interp = 1 tracks/1/imported = false tracks/1/keys = { "times":FloatArray( 0, 0.6 ), "transitions":FloatArray( 1, 1 ), "update":0, "values":[ 1.0, 0.0 ] } -[sub_resource type="Animation" id=5] +[sub_resource type="Animation" id=4] length = 1.0 loop = false @@ -67,11 +67,11 @@ tracks/1/interp = 1 tracks/1/imported = false tracks/1/keys = { "times":FloatArray( 0 ), "transitions":FloatArray( 1 ), "update":0, "values":[ 1.0 ] } -[sub_resource type="SampleLibrary" id=6] +[sub_resource type="SampleLibrary" id=5] samples/beep_letter = { "db":0.0, "pitch":1.0, "sample":ExtResource( 3 ) } -[sub_resource type="DynamicFont" id=7] +[sub_resource type="DynamicFont" id=6] font/size = 12 font/use_mipmaps = false @@ -128,7 +128,7 @@ stretch_mode = 0 playback/process_mode = 1 playback/default_blend_time = 0.0 root/root = NodePath("..") -anims/idle = SubResource( 2 ) +anims/idle = SubResource( 1 ) playback/active = true playback/speed = 1.0 blend_times = [ ] @@ -154,11 +154,9 @@ centered = false playback/process_mode = 1 playback/default_blend_time = 0.0 root/root = NodePath("..") -anims/blackScreen = SubResource( 3 ) -"anims/blackScreen off" = SubResource( 4 ) -anims/default = SubResource( 5 ) -"next/blackScreen off" = "" -next/default = "" +anims/blackScreen = SubResource( 2 ) +"anims/blackScreen off" = SubResource( 3 ) +anims/default = SubResource( 4 ) playback/active = true playback/speed = 1.0 blend_times = [ ] @@ -167,7 +165,7 @@ autoplay = "" [node name="SamplePlayer" type="SamplePlayer" parent="."] config/polyphony = 1 -config/samples = SubResource( 6 ) +config/samples = SubResource( 5 ) default/volume_db = -18.0 default/pitch_scale = 1.0 default/pan = 0.0 @@ -194,7 +192,7 @@ margin/left = 16.0 margin/top = 8.0 margin/right = 16.0 margin/bottom = 8.0 -custom_fonts/normal_font = SubResource( 7 ) +custom_fonts/normal_font = SubResource( 6 ) custom_colors/default_color = Color( 1, 1, 1, 1 ) bbcode/enabled = true bbcode/bbcode = "ABRAKADABRA" diff --git a/SMRT/editor.tscn b/SMRT/editor.tscn index 0ef3c4d..4d9ab86 100644 --- a/SMRT/editor.tscn +++ b/SMRT/editor.tscn @@ -55,7 +55,7 @@ size_flags/vertical = 2 margin/left = 0.0 margin/top = 18.0 margin/right = 750.0 -margin/bottom = 54.0 +margin/bottom = 52.0 [node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/PanelContainer"] @@ -66,7 +66,7 @@ size_flags/vertical = 2 margin/left = 7.0 margin/top = 7.0 margin/right = 743.0 -margin/bottom = 29.0 +margin/bottom = 27.0 alignment = 0 [node name="info" type="Label" parent="VBoxContainer/PanelContainer/HBoxContainer"] @@ -76,9 +76,9 @@ focus/stop_mouse = true size_flags/horizontal = 2 size_flags/vertical = 0 margin/left = 0.0 -margin/top = 4.0 +margin/top = 3.0 margin/right = 74.0 -margin/bottom = 18.0 +margin/bottom = 17.0 text = "File loaded:" align = 1 percent_visible = 1.0 @@ -93,18 +93,23 @@ size_flags/horizontal = 2 size_flags/vertical = 2 margin/left = 78.0 margin/top = 0.0 -margin/right = 307.0 -margin/bottom = 22.0 +margin/right = 255.0 +margin/bottom = 20.0 +flat = false button/count = 4 button/min_button_size = -1.0 button/align = 0 button/0/text = "New" +button/0/tooltip = "" button/0/icon = null button/1/text = "Load" +button/1/tooltip = "" button/1/icon = null button/2/text = "Save" +button/2/tooltip = "" button/2/icon = null button/3/text = "Help" +button/3/tooltip = "" button/3/icon = null button/selected = 0 @@ -115,9 +120,9 @@ focus/stop_mouse = false size_flags/horizontal = 2 size_flags/vertical = 2 margin/left = 0.0 -margin/top = 58.0 +margin/top = 56.0 margin/right = 750.0 -margin/bottom = 342.0 +margin/bottom = 337.0 alignment = 0 [node name="ChapterContainer" type="PanelContainer" parent="VBoxContainer/HBoxContainer"] @@ -129,8 +134,8 @@ size_flags/horizontal = 2 size_flags/vertical = 2 margin/left = 0.0 margin/top = 0.0 -margin/right = 117.0 -margin/bottom = 284.0 +margin/right = 114.0 +margin/bottom = 281.0 [node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/ChapterContainer"] @@ -140,8 +145,8 @@ size_flags/horizontal = 2 size_flags/vertical = 2 margin/left = 7.0 margin/top = 7.0 -margin/right = 110.0 -margin/bottom = 277.0 +margin/right = 107.0 +margin/bottom = 274.0 alignment = 0 [node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/ChapterContainer/VBoxContainer"] @@ -153,7 +158,7 @@ size_flags/horizontal = 2 size_flags/vertical = 2 margin/left = 0.0 margin/top = 0.0 -margin/right = 103.0 +margin/right = 100.0 margin/bottom = 14.0 alignment = 0 @@ -181,7 +186,7 @@ size_flags/horizontal = 2 size_flags/vertical = 2 margin/left = 0.0 margin/top = 18.0 -margin/right = 103.0 +margin/right = 100.0 margin/bottom = 218.0 [node name="HButtonArray" type="HButtonArray" parent="VBoxContainer/HBoxContainer/ChapterContainer/VBoxContainer"] @@ -192,14 +197,17 @@ size_flags/horizontal = 2 size_flags/vertical = 2 margin/left = 0.0 margin/top = 222.0 -margin/right = 103.0 -margin/bottom = 244.0 +margin/right = 100.0 +margin/bottom = 242.0 +flat = false button/count = 2 button/min_button_size = 1.0 button/align = 0 button/0/text = "Add" +button/0/tooltip = "" button/0/icon = null button/1/text = "Dup" +button/1/tooltip = "" button/1/icon = null button/selected = 0 @@ -210,15 +218,18 @@ focus/stop_mouse = true size_flags/horizontal = 2 size_flags/vertical = 2 margin/left = 0.0 -margin/top = 248.0 -margin/right = 103.0 -margin/bottom = 270.0 +margin/top = 246.0 +margin/right = 100.0 +margin/bottom = 266.0 +flat = false button/count = 2 button/min_button_size = 1.0 button/align = 0 button/0/text = "Del" +button/0/tooltip = "" button/0/icon = null button/1/text = "Edit" +button/1/tooltip = "" button/1/icon = null button/selected = 0 @@ -229,10 +240,10 @@ focus/ignore_mouse = false focus/stop_mouse = true size_flags/horizontal = 2 size_flags/vertical = 2 -margin/left = 121.0 +margin/left = 118.0 margin/top = 0.0 -margin/right = 238.0 -margin/bottom = 284.0 +margin/right = 232.0 +margin/bottom = 281.0 [node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/DialogContainer"] @@ -242,8 +253,8 @@ size_flags/horizontal = 2 size_flags/vertical = 2 margin/left = 7.0 margin/top = 7.0 -margin/right = 110.0 -margin/bottom = 277.0 +margin/right = 107.0 +margin/bottom = 274.0 alignment = 0 [node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/DialogContainer/VBoxContainer"] @@ -255,7 +266,7 @@ size_flags/horizontal = 2 size_flags/vertical = 2 margin/left = 0.0 margin/top = 0.0 -margin/right = 103.0 +margin/right = 100.0 margin/bottom = 14.0 alignment = 0 @@ -283,7 +294,7 @@ size_flags/horizontal = 2 size_flags/vertical = 2 margin/left = 0.0 margin/top = 18.0 -margin/right = 103.0 +margin/right = 100.0 margin/bottom = 218.0 [node name="HButtonArray" type="HButtonArray" parent="VBoxContainer/HBoxContainer/DialogContainer/VBoxContainer"] @@ -294,14 +305,17 @@ size_flags/horizontal = 2 size_flags/vertical = 2 margin/left = 0.0 margin/top = 222.0 -margin/right = 103.0 -margin/bottom = 244.0 +margin/right = 100.0 +margin/bottom = 242.0 +flat = false button/count = 2 button/min_button_size = 1.0 button/align = 0 button/0/text = "Add" +button/0/tooltip = "" button/0/icon = null button/1/text = "Dup" +button/1/tooltip = "" button/1/icon = null button/selected = 0 @@ -312,15 +326,18 @@ focus/stop_mouse = true size_flags/horizontal = 2 size_flags/vertical = 2 margin/left = 0.0 -margin/top = 248.0 -margin/right = 103.0 -margin/bottom = 270.0 +margin/top = 246.0 +margin/right = 100.0 +margin/bottom = 266.0 +flat = false button/count = 2 button/min_button_size = 1.0 button/align = 0 button/0/text = "Del" +button/0/tooltip = "" button/0/icon = null button/1/text = "Edit" +button/1/tooltip = "" button/1/icon = null button/selected = 0 @@ -332,10 +349,10 @@ focus/ignore_mouse = false focus/stop_mouse = true size_flags/horizontal = 2 size_flags/vertical = 2 -margin/left = 242.0 +margin/left = 236.0 margin/top = 0.0 -margin/right = 411.0 -margin/bottom = 284.0 +margin/right = 381.0 +margin/bottom = 281.0 [node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/TextContainer"] @@ -345,8 +362,8 @@ size_flags/horizontal = 2 size_flags/vertical = 2 margin/left = 7.0 margin/top = 7.0 -margin/right = 162.0 -margin/bottom = 277.0 +margin/right = 138.0 +margin/bottom = 274.0 alignment = 0 [node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/TextContainer/VBoxContainer"] @@ -357,7 +374,7 @@ size_flags/horizontal = 2 size_flags/vertical = 2 margin/left = 0.0 margin/top = 0.0 -margin/right = 155.0 +margin/right = 131.0 margin/bottom = 14.0 alignment = 0 @@ -385,7 +402,7 @@ size_flags/horizontal = 2 size_flags/vertical = 2 margin/left = 0.0 margin/top = 18.0 -margin/right = 155.0 +margin/right = 131.0 margin/bottom = 218.0 [node name="HButtonArray" type="HButtonArray" parent="VBoxContainer/HBoxContainer/TextContainer/VBoxContainer"] @@ -396,16 +413,20 @@ size_flags/horizontal = 2 size_flags/vertical = 2 margin/left = 0.0 margin/top = 222.0 -margin/right = 155.0 -margin/bottom = 244.0 +margin/right = 131.0 +margin/bottom = 242.0 +flat = false button/count = 3 button/min_button_size = 1.0 button/align = 1 button/0/text = "Add" +button/0/tooltip = "" button/0/icon = null button/1/text = "Dup" +button/1/tooltip = "" button/1/icon = null button/2/text = "Del" +button/2/tooltip = "" button/2/icon = null button/selected = 0 @@ -416,15 +437,18 @@ focus/stop_mouse = true size_flags/horizontal = 2 size_flags/vertical = 2 margin/left = 0.0 -margin/top = 248.0 -margin/right = 155.0 -margin/bottom = 270.0 +margin/top = 246.0 +margin/right = 131.0 +margin/bottom = 266.0 +flat = false button/count = 2 button/min_button_size = -1.0 button/align = 1 button/0/text = "/\\" +button/0/tooltip = "" button/0/icon = null button/1/text = "\\/" +button/1/tooltip = "" button/1/icon = null button/selected = 0 @@ -434,10 +458,10 @@ focus/ignore_mouse = false focus/stop_mouse = true size_flags/horizontal = 2 size_flags/vertical = 2 -margin/left = 415.0 +margin/left = 385.0 margin/top = 0.0 -margin/right = 418.0 -margin/bottom = 284.0 +margin/right = 388.0 +margin/bottom = 281.0 [node name="GridContainer" type="GridContainer" parent="VBoxContainer/HBoxContainer"] @@ -445,10 +469,10 @@ focus/ignore_mouse = false focus/stop_mouse = false size_flags/horizontal = 2 size_flags/vertical = 2 -margin/left = 422.0 +margin/left = 392.0 margin/top = 0.0 -margin/right = 706.0 -margin/bottom = 284.0 +margin/right = 676.0 +margin/bottom = 281.0 columns = 2 [node name="FramePosition1" type="PanelContainer" parent="VBoxContainer/HBoxContainer/GridContainer"] @@ -733,9 +757,9 @@ focus/stop_mouse = true size_flags/horizontal = 2 size_flags/vertical = 2 margin/left = 0.0 -margin/top = 346.0 +margin/top = 341.0 margin/right = 750.0 -margin/bottom = 478.0 +margin/bottom = 473.0 [node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/TextPanel"] @@ -799,6 +823,7 @@ margin/left = 0.0 margin/top = 0.0 margin/right = 367.0 margin/bottom = 100.0 +syntax_highlighting = false show_line_numbers = false highlight_all_occurrences = false caret/block_caret = false @@ -813,12 +838,14 @@ size_flags/horizontal = 2 size_flags/vertical = 2 margin/left = 371.0 margin/top = 0.0 -margin/right = 423.0 +margin/right = 413.0 margin/bottom = 100.0 +flat = false button/count = 1 button/min_button_size = 22.0 button/align = 1 button/0/text = "Next" +button/0/tooltip = "" button/0/icon = null button/selected = 0 @@ -829,9 +856,9 @@ focus/stop_mouse = true size_flags/horizontal = 2 size_flags/vertical = 2 margin/left = 0.0 -margin/top = 482.0 +margin/top = 477.0 margin/right = 750.0 -margin/bottom = 504.0 +margin/bottom = 499.0 toggle_mode = true enabled_focus_mode = 2 shortcut = null @@ -846,9 +873,9 @@ focus/stop_mouse = true size_flags/horizontal = 2 size_flags/vertical = 2 margin/left = 0.0 -margin/top = 508.0 +margin/top = 503.0 margin/right = 750.0 -margin/bottom = 592.0 +margin/bottom = 587.0 [node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/question"] @@ -933,6 +960,7 @@ margin/top = 18.0 margin/right = 97.0 margin/bottom = 42.0 placeholder/alpha = 0.6 +expand_to_len = false focus_mode = 2 caret/caret_blink = false caret/caret_blink_speed = 0.65 @@ -975,6 +1003,7 @@ margin/top = 18.0 margin/right = 97.0 margin/bottom = 42.0 placeholder/alpha = 0.6 +expand_to_len = false focus_mode = 2 caret/caret_blink = false caret/caret_blink_speed = 0.65 @@ -1017,6 +1046,7 @@ margin/top = 18.0 margin/right = 97.0 margin/bottom = 42.0 placeholder/alpha = 0.6 +expand_to_len = false focus_mode = 2 caret/caret_blink = false caret/caret_blink_speed = 0.65 @@ -1059,6 +1089,7 @@ margin/top = 18.0 margin/right = 97.0 margin/bottom = 42.0 placeholder/alpha = 0.6 +expand_to_len = false focus_mode = 2 caret/caret_blink = false caret/caret_blink_speed = 0.65 diff --git a/SMRT/example.lan b/SMRT/example.lan index efcb8cc..e950228 100644 --- a/SMRT/example.lan +++ b/SMRT/example.lan @@ -1 +1 @@ -{"INTRO":{"OLD MAN":[{"face_position":0, "beep_pitch":1, "answers":[], "beep":true, "text":"This is a little example file for SMRT-Godot!", "enable_question":false, "frame_position":0, "typewriter":true, "typewriter_speed":0.05, "face_frame":1}, {"face_position":0, "beep_pitch":1, "answers":[], "beep":true, "text":"Who am I you ask?", "enable_question":false, "frame_position":0, "typewriter":false, "typewriter_speed":0.05, "face_frame":1}, {"face_position":2, "beep_pitch":1, "answers":[], "beep":true, "text":"It'za me Mario!", "enable_question":false, "frame_position":0, "typewriter":true, "typewriter_speed":0.05, "face_frame":1}, {"face_position":1, "beep_pitch":1, "answers":["Let's go!", "Yup, let's go!", "Nope."], "beep":true, "text":"Shall we begin demonstrating what can be done with [color=#ff0000]SMRT[/color]ness?", "enable_question":true, "frame_position":0, "typewriter":true, "typewriter_speed":0.05, "face_frame":1}, {"face_position":0, "beep_pitch":1, "answers":[], "beep":true, "text":"So... we can make this go slower", "enable_question":false, "frame_position":1, "typewriter":true, "typewriter_speed":0.1, "face_frame":1}, {"face_position":0, "beep_pitch":1, "answers":[], "beep":true, "text":"And yes, appearing on the middle of the screen as you probably noticed.", "enable_question":false, "frame_position":2, "typewriter":true, "typewriter_speed":0.052353, "face_frame":1}, {"face_position":0, "beep_pitch":1, "answers":[], "beep":true, "text":"We can color our [color=#0062ff]L[/color][color=#58ff00]E[/color][color=#b400ff]T[/color][color=#eaff00]T[/color][color=#2c762b]E[/color][color=#7c72ad]R[/color][color=#975f30]S[/color] any RGB color we wish!", "enable_question":false, "frame_position":1, "typewriter":true, "typewriter_speed":0.05, "face_frame":1}, {"answers":[], "beep_pitch":1, "face_position":0, "beep":true, "text":"We can also change the pitch of the sound so we can give it more character.", "enable_question":false, "typewriter_speed":0.05, "typewriter":true, "frame_position":1, "face_frame":1}, {"answers":[], "beep_pitch":4, "face_position":0, "beep":true, "text":"Like this", "enable_question":false, "typewriter_speed":0.105906, "typewriter":true, "frame_position":2, "face_frame":1}, {"answers":[], "beep_pitch":0.5, "face_position":0, "beep":true, "text":"Or this", "enable_question":false, "typewriter_speed":0.105906, "typewriter":true, "frame_position":2, "face_frame":1}, {"face_position":0, "beep_pitch":1, "answers":[], "beep":true, "text":"So... yeah... go on...", "enable_question":false, "frame_position":2, "typewriter":true, "typewriter_speed":0.05, "face_frame":1}, {"answers":[], "beep_pitch":1, "face_position":0, "beep":true, "text":"Try moving the logo with the arrow keys towards the other logo to see another example!", "enable_question":false, "typewriter_speed":0.05, "typewriter":true, "frame_position":2, "face_frame":1}], "Freddie":[{"face_position":0, "beep_pitch":1, "answers":[], "beep":true, "text":"Don't stop me now!", "enable_question":false, "frame_position":2, "typewriter":true, "typewriter_speed":0.05, "face_frame":1}, {"face_position":0, "beep_pitch":0.1, "answers":[], "beep":true, "text":"Mother... just killed a man", "enable_question":false, "frame_position":2, "typewriter":true, "typewriter_speed":0.1, "face_frame":1}], "NPC1":[{"answers":[], "beep_pitch":1, "face_position":0, "beep":true, "text":"Hi there!", "enable_question":false, "typewriter_speed":0.05, "typewriter":true, "frame_position":2, "face_frame":1}, {"answers":[], "beep_pitch":1, "face_position":0, "beep":true, "text":"I am a little NPC... a very simple one.", "enable_question":false, "typewriter_speed":0.05, "typewriter":true, "frame_position":2, "face_frame":1}]}} \ No newline at end of file +{"INTRO":{"Freddie":[{"answers":[], "beep_pitch":1, "face_position":0, "beep":true, "text":"Don't stop me now!", "enable_question":false, "typewriter_speed":0.05, "typewriter":true, "frame_position":2, "face_frame":1}, {"answers":[], "beep_pitch":0.1, "face_position":0, "beep":true, "text":"Mother... just killed a man", "enable_question":false, "typewriter_speed":0.1, "typewriter":true, "frame_position":2, "face_frame":1}], "OLD MAN":[{"answers":[], "beep_pitch":1, "face_position":0, "beep":true, "text":"This is a little example file for SMRT-Godot!", "enable_question":false, "typewriter_speed":0.05, "typewriter":true, "frame_position":0, "face_frame":1}, {"answers":[], "beep_pitch":1, "face_position":0, "beep":true, "text":"Who am I you ask?", "enable_question":false, "typewriter_speed":0.05, "typewriter":false, "frame_position":0, "face_frame":1}, {"answers":[], "beep_pitch":1, "face_position":2, "beep":true, "text":"It'za me Mario!", "enable_question":false, "typewriter_speed":0.05, "typewriter":true, "frame_position":0, "face_frame":1}, {"answers":["Let's go!", "Yup, let's go!", "Nope."], "beep_pitch":1, "face_position":1, "beep":true, "text":"Shall we begin demonstrating what can be done with [color=#ff0000]SMRT[/color]ness?", "enable_question":true, "typewriter_speed":0.05, "typewriter":true, "frame_position":0, "face_frame":1}, {"answers":[], "beep_pitch":1, "face_position":0, "beep":true, "text":"So... we can make this go slower", "enable_question":false, "typewriter_speed":0.1, "typewriter":true, "frame_position":1, "face_frame":1}, {"answers":[], "beep_pitch":1, "face_position":0, "beep":true, "text":"And yes, appearing on the middle of the screen as you probably noticed.", "enable_question":false, "typewriter_speed":0.052353, "typewriter":true, "frame_position":2, "face_frame":1}, {"answers":[], "beep_pitch":1, "face_position":0, "beep":true, "text":"We can color our [color=#0062ff]L[/color][color=#58ff00]E[/color][color=#b400ff]T[/color][color=#eaff00]T[/color][color=#2c762b]E[/color][color=#7c72ad]R[/color][color=#975f30]S[/color] any RGB color we wish!", "enable_question":false, "typewriter_speed":0.05, "typewriter":true, "frame_position":1, "face_frame":1}, {"face_position":0, "beep_pitch":1, "answers":[], "beep":true, "text":"We can also change the pitch of the sound so we can give it more character.", "enable_question":false, "frame_position":1, "typewriter":true, "typewriter_speed":0.05, "face_frame":1}, {"face_position":0, "beep_pitch":4, "answers":[], "beep":true, "text":"Like this", "enable_question":false, "frame_position":2, "typewriter":true, "typewriter_speed":0.105906, "face_frame":1}, {"face_position":0, "beep_pitch":0.5, "answers":[], "beep":true, "text":"Or this", "enable_question":false, "frame_position":2, "typewriter":true, "typewriter_speed":0.105906, "face_frame":1}, {"answers":[], "beep_pitch":1, "face_position":0, "beep":true, "text":"So... yeah... go on...", "enable_question":false, "typewriter_speed":0.05, "typewriter":true, "frame_position":2, "face_frame":1}, {"face_position":0, "beep_pitch":1, "answers":[], "beep":true, "text":"Try moving the logo with the arrow keys towards the other logo to see another example!", "enable_question":false, "frame_position":2, "typewriter":true, "typewriter_speed":0.05, "face_frame":1}], "NPC1":[{"face_position":0, "beep_pitch":1, "answers":[], "beep":true, "text":"Hi there!", "enable_question":false, "frame_position":2, "typewriter":true, "typewriter_speed":0.05, "face_frame":1}, {"face_position":0, "beep_pitch":1, "answers":[], "beep":true, "text":"I am a little NPC... a very simple one.", "enable_question":false, "frame_position":2, "typewriter":true, "typewriter_speed":0.05, "face_frame":1}]}} \ No newline at end of file diff --git a/SMRT/plugin.cfg b/SMRT/plugin.cfg index ad70b14..0840242 100644 --- a/SMRT/plugin.cfg +++ b/SMRT/plugin.cfg @@ -3,7 +3,7 @@ name="SMRT" description="SMRT is a dialog system for godot" author="BrunoSXS" -version="1.1" +version="1.2" script="SMRT.gd"