First commit 🎉
This commit is contained in:
commit
43ea213f9b
728 changed files with 37080 additions and 0 deletions
|
@ -0,0 +1,46 @@
|
|||
@tool
|
||||
extends "res://addons/popochiu/editor/popups/create_object/create_object.gd"
|
||||
## Creates a new [PopochiuDialog].
|
||||
##
|
||||
## It creates all the necessary files to make a [PopochiuDialog] to work:
|
||||
## - dialog_xxx.gd (The script where the behavior for each dialog option is defined)
|
||||
## - dialog_xxx.tres (The Resource file used to create the dialog options in the Inspector)
|
||||
|
||||
var _new_dialog_name := ""
|
||||
var _factory: PopochiuDialogFactory
|
||||
|
||||
|
||||
#region Godot ######################################################################################
|
||||
func _ready() -> void:
|
||||
_info_files = "[code]- &t_&n.gd\n- &t_&n.tres[/code]"
|
||||
_info_files = _info_files.replace("&t", "dialog")
|
||||
|
||||
super()
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Virtual ####################################################################################
|
||||
func _create() -> Object:
|
||||
if _new_dialog_name.is_empty():
|
||||
error_feedback.show()
|
||||
return null
|
||||
|
||||
# Setup the prop helper and use it to create the prop ------------------------------------------
|
||||
_factory = PopochiuDialogFactory.new()
|
||||
if _factory.create(_new_dialog_name) != ResultCodes.SUCCESS:
|
||||
# TODO: show a message in the popup!
|
||||
return null
|
||||
await get_tree().create_timer(0.1).timeout
|
||||
|
||||
return _factory.get_obj_resource()
|
||||
|
||||
|
||||
func _set_info_text() -> void:
|
||||
_new_dialog_name = _name.to_snake_case()
|
||||
_target_folder = PopochiuResources.DIALOGS_PATH.path_join(_new_dialog_name)
|
||||
|
||||
info.text = (_info_text % _target_folder).replace("&n", _new_dialog_name)
|
||||
|
||||
|
||||
#endregion
|
|
@ -0,0 +1 @@
|
|||
uid://dh6csjemfnk6a
|
|
@ -0,0 +1,13 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://dlhcgfucwffgr"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://c1pfl2gwjjot5" path="res://addons/popochiu/editor/popups/create_object/create_object.tscn" id="1_i1dna"]
|
||||
[ext_resource type="Script" path="res://addons/popochiu/editor/popups/create_object/create_dialog/create_dialog.gd" id="2_ep8bb"]
|
||||
|
||||
[node name="CreateDialogConfirmation" instance=ExtResource("1_i1dna")]
|
||||
script = ExtResource("2_ep8bb")
|
||||
|
||||
[node name="Label" parent="PanelContainer/VBoxContainer/InputContainer" index="0"]
|
||||
text = "Dialog name:"
|
||||
|
||||
[node name="Guide" parent="PanelContainer/VBoxContainer" index="3"]
|
||||
text = "Use a descriptive name in PascalCase (e.g. GarageGlottis, OfficeEvaDesk)."
|
Loading…
Add table
Add a link
Reference in a new issue