Initial Android commit

This commit is contained in:
OleSTEEP 2024-11-10 03:34:28 +03:00
commit 1e2b80c13d
8521 changed files with 231475 additions and 0 deletions

View file

@ -0,0 +1,65 @@
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,
"value_editor":$VBoxContainer / HBoxContainer / Value,
"value":$VBoxContainer / HBoxContainer / Value / ValueInput,
}
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["value"].text = current_definition["value"]
func reset_editor():
nodes["name"].text = ""
nodes["value"].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_value()->String:
var id = DialogicUtil.generate_random_id()
DialogicResources.set_default_definition_variable(id, "New value", "")
return id
func save_definition():
if current_definition != null and current_definition["id"] != "":
DialogicResources.set_default_definition_variable(current_definition["id"], nodes["name"].text, nodes["value"].text)

View file

@ -0,0 +1,62 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/dialogic/Editor/ValueEditor/ValueEditor.gd" type="Script" id=1]
[ext_resource path="res://addons/dialogic/Editor/Common/TLabel.tscn" type="PackedScene" id=2]
[node name="ValueEditor" 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 = 48.0
custom_constants/separation = 16
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer"]
margin_right = 300.0
margin_bottom = 48.0
rect_min_size = Vector2( 300, 0 )
custom_constants/separation = 10
[node name="NameLabel" 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 = "ValueName"
[node name="Name" type="LineEdit" parent="VBoxContainer/HBoxContainer/VBoxContainer"]
margin_top = 24.0
margin_right = 300.0
margin_bottom = 48.0
[node name="Value" type="VBoxContainer" parent="VBoxContainer/HBoxContainer"]
margin_left = 316.0
margin_right = 616.0
margin_bottom = 48.0
rect_min_size = Vector2( 300, 0 )
custom_constants/separation = 10
[node name="ValueLabel" parent="VBoxContainer/HBoxContainer/Value" instance=ExtResource( 2 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 300.0
margin_bottom = 14.0
text = "Value:"
text_key = "Value"
[node name="ValueInput" type="LineEdit" parent="VBoxContainer/HBoxContainer/Value"]
margin_top = 24.0
margin_right = 300.0
margin_bottom = 48.0