Uploaded game files

This commit is contained in:
JamnedZ 2022-11-18 00:52:05 +07:00
parent 459da513f6
commit f71e7e39a0
1543 changed files with 50503 additions and 0 deletions

View file

@ -0,0 +1,71 @@
tool
extends ScrollContainer
var editor_reference
onready var master_tree = get_node('../MasterTreeContainer/MasterTree')
var current_definition = null
onready var nodes = {
'name' : $VBoxContainer/HBoxContainer/VBoxContainer/Name,
'extra_editor': $VBoxContainer/HBoxContainer/ExtraInfo,
'extra_title': $VBoxContainer/HBoxContainer/ExtraInfo/Title,
'extra_text': $VBoxContainer/HBoxContainer/ExtraInfo/Text,
'extra_extra': $VBoxContainer/HBoxContainer/ExtraInfo/Extra,
}
func _ready():
editor_reference = find_parent('EditorView')
reset_editor()
nodes['name'].connect('text_changed', self, '_on_name_changed')
nodes['name'].connect('focus_exited', self, '_update_name_on_tree')
func is_selected(id: String):
return current_definition != null and current_definition['id'] == id
func load_definition(id):
current_definition = DialogicResources.get_default_definition_item(id)
reset_editor()
nodes['name'].editable = true
nodes['name'].text = current_definition['name']
nodes['extra_title'].text = current_definition['title']
nodes['extra_text'].text = current_definition['text']
nodes['extra_extra'].text = current_definition['extra']
func reset_editor():
nodes['name'].text = ''
nodes['extra_title'].text = ''
nodes['extra_text'].text = ''
nodes['extra_extra'].text = ''
func _on_name_changed(text):
if current_definition != null:
save_definition()
func _input(event):
if event is InputEventKey and event.pressed:
if nodes['name'].has_focus():
if event.scancode == KEY_ENTER:
nodes['name'].release_focus()
func _update_name_on_tree():
var item = master_tree.get_selected()
item.set_text(0, nodes['name'].text)
if current_definition != null:
save_definition()
master_tree.build_definitions(current_definition['id'])
func create_glossary_entry() -> String:
var id = DialogicUtil.generate_random_id()
DialogicResources.set_default_definition_glossary(id, 'New glossary entry', '', '', '')
return id
func save_definition():
if current_definition != null and current_definition['id'] != '':
DialogicResources.set_default_definition_glossary(current_definition['id'], nodes['name'].text, nodes['extra_title'].text, nodes['extra_text'].text, nodes['extra_extra'].text)

View file

@ -0,0 +1,87 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/dialogic/Editor/GlossaryEntryEditor/GlossaryEntryEditor.gd" type="Script" id=1]
[ext_resource path="res://addons/dialogic/Editor/Common/TLabel.tscn" type="PackedScene" id=2]
[node name="GlossaryEntryEditor" type="ScrollContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="."]
margin_right = 1024.0
margin_bottom = 600.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
margin_right = 1024.0
margin_bottom = 192.0
custom_constants/separation = 16
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer"]
margin_right = 300.0
margin_bottom = 192.0
rect_min_size = Vector2( 300, 0 )
custom_constants/separation = 10
[node name="TLabel" parent="VBoxContainer/HBoxContainer/VBoxContainer" instance=ExtResource( 2 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 300.0
margin_bottom = 14.0
text = "Name:"
text_key = "GlossaryName"
[node name="Name" type="LineEdit" parent="VBoxContainer/HBoxContainer/VBoxContainer"]
margin_top = 24.0
margin_right = 300.0
margin_bottom = 48.0
[node name="TLabel2" parent="VBoxContainer/HBoxContainer/VBoxContainer" instance=ExtResource( 2 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 58.0
margin_right = 300.0
margin_bottom = 89.0
text = "A popup will display this information when a player hovers the word in a dialog."
autowrap = true
text_key = "GlossaryExplanation"
[node name="ExtraInfo" type="VBoxContainer" parent="VBoxContainer/HBoxContainer"]
margin_left = 316.0
margin_right = 616.0
margin_bottom = 192.0
rect_min_size = Vector2( 300, 0 )
custom_constants/separation = 10
[node name="TLabel3" parent="VBoxContainer/HBoxContainer/ExtraInfo" instance=ExtResource( 2 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 300.0
margin_bottom = 14.0
text = "Content:"
text_key = "GlossaryContent"
[node name="Title" type="LineEdit" parent="VBoxContainer/HBoxContainer/ExtraInfo"]
margin_top = 24.0
margin_right = 300.0
margin_bottom = 48.0
placeholder_text = "Title"
[node name="Text" type="TextEdit" parent="VBoxContainer/HBoxContainer/ExtraInfo"]
margin_top = 58.0
margin_right = 300.0
margin_bottom = 158.0
rect_min_size = Vector2( 0, 100 )
size_flags_vertical = 3
wrap_enabled = true
[node name="Extra" type="LineEdit" parent="VBoxContainer/HBoxContainer/ExtraInfo"]
margin_top = 168.0
margin_right = 300.0
margin_bottom = 192.0
placeholder_text = "Extra"