Skip to content

Commit

Permalink
V0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mifth committed Jun 9, 2024
1 parent cf65308 commit c758e49
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 19 deletions.
8 changes: 4 additions & 4 deletions addons/dialoguecreator/Assets/Dialogue/DialogueCreator.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ grow_vertical = 2
layout_mode = 2
text = "File"
item_count = 3
popup/item_0/text = "New"
popup/item_0/text = "New (Ctrl+N)"
popup/item_0/id = 0
popup/item_1/text = "Open"
popup/item_1/text = "Open (Ctrl+O)"
popup/item_1/id = 1
popup/item_2/text = "Save"
popup/item_2/text = "Save (Ctrl+S)"
popup/item_2/id = 2
script = ExtResource("2_4wsl1")

Expand Down Expand Up @@ -136,7 +136,7 @@ size = Vector2i(589, 344)
dialog_hide_on_ok = true
dialog_autowrap = true
access = 2
filters = PackedStringArray("*.json")
filters = PackedStringArray("*.dcj")
use_native_dialog = true

[connection signal="pressed" from="VBoxContainer/MenuBar/HBoxContainer/HBoxContainer/PlaySceneButton" to="." method="_on_play_scene_button_pressed"]
Expand Down
11 changes: 11 additions & 0 deletions addons/dialoguecreator/Scripts/Dialogue/DCGraph.gd
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,18 @@ func add_node(node_name: String):
func _input(event):
if Input.is_key_pressed(KEY_DELETE):
delete_selected_graphNodes()

elif Input.is_key_pressed(KEY_S):
if Input.is_key_pressed(KEY_CTRL):
save_file_dialogue()

elif Input.is_key_pressed(KEY_O):
if Input.is_key_pressed(KEY_CTRL):
load_file_dialogue()

elif Input.is_key_pressed(KEY_N):
if Input.is_key_pressed(KEY_CTRL):
new_scene()

func delete_selected_graphNodes():
var nodes = graph.get_children()
Expand Down
10 changes: 4 additions & 6 deletions addons/dialoguecreator/Scripts/Menu/DCFileMenu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ func _ready():


func _on_item_pressed(ID):
var button_name = popup.get_item_text(ID)

if button_name == "New":
if ID == 0:
emit_signal("NewFile")
elif button_name == "Save":
emit_signal("SaveFile")
elif button_name == "Open":
elif ID == 1:
emit_signal("LoadFile")
elif ID == 2:
emit_signal("SaveFile")
1 change: 0 additions & 1 deletion addons/dialoguecreator/Scripts/Nodes/DCActionNode.gd
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ func get_node_params_js():

params["ActionPorts"]["Texts"].append(port.get_text_node().text)


return [params, DCGUtils.ActionNode]


Expand Down
4 changes: 2 additions & 2 deletions addons/dialoguecreator/Scripts/Parsing/DCParse.gd
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ static func save_file_js(main_graph: DCGraph, path: String):
var data_js_str = JSON.stringify(data_js, " ")

var final_path = path
if not final_path.ends_with(".json"):
final_path += ".json"
if not final_path.ends_with(".dcj"):
final_path += ".dcj"

if FileAccess.file_exists(final_path):
# Set Writable
Expand Down
5 changes: 3 additions & 2 deletions addons/dialoguecreator/Scripts/PlayScene/DCPlayScene.gd
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,11 @@ func set_up_dialogue_node(d_node: DCGDialogueData.NodeData):
var char_node = self.dc_data.get_character_node_js_by_id(char_id)
if char_node:
get_char_name_edit().text = char_node["CharacterName"]
#get_char_texture_edit().texture = null
#print(char_node["CharacterTexture"])

var icons = get_main_graph().graph.get_node(char_node["Name"]) as DCCharacterNode
get_char_texture_edit().texture = icons.GetItemsIcons().get_item_icon(char_node["CharacterTexture"])
else:
get_char_name_edit().text = "Character: " + str(char_id)


func clear_play_scene():
Expand Down
2 changes: 1 addition & 1 deletion addons/dialoguecreator/Scripts/Utils/DCUtils.gd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class_name DCUtils
extends Object

const version = [0, 1]
const version = [0, 2]



2 changes: 1 addition & 1 deletion addons/dialoguecreator/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="DialogueCreator"
description=""
author="Mifth"
version="0.1"
version="0.2"
script="dialoguecreatorplugin.gd"
2 changes: 1 addition & 1 deletion addons/dialoguecreatorgame/Scripts/Utils/DCGUtils.gd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const CharacterNode = "DCCharacterNode"
const dialogue_nodes_types = [ActionNode, DialogueNode]
const live_nodes_types = [ActionNode, DialogueNode, SetTextNode]

const version = [0, 1]
const version = [0, 2]


static func generate_id(ids, start_value: int) -> int:
Expand Down
2 changes: 1 addition & 1 deletion addons/dialoguecreatorgame/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="DialogueCreatorGame"
description=""
author="Mifth"
version="0.1"
version="0.2"
script="dcgplugin.gd"

0 comments on commit c758e49

Please sign in to comment.