add basic functionality for adding group items
This commit is contained in:
25
UI/Dialogs/GroupEditDialog.gd
Normal file
25
UI/Dialogs/GroupEditDialog.gd
Normal file
@ -0,0 +1,25 @@
|
||||
extends ConfirmationDialog
|
||||
class_name GroupEditDialog
|
||||
|
||||
@onready var name_line_edit: LineEdit = %NameLineEdit
|
||||
@onready var icon_path_line_edit: LineEdit = %IconPathLineEdit
|
||||
@onready var description_text_edit: TextEdit = %DescriptionTextEdit
|
||||
@onready var override_editor_settings_menu: OverrideEditorSettingsMenu = %OverrideEditorSettingsMenu
|
||||
|
||||
var group_metadata: GroupMetadata
|
||||
|
||||
|
||||
func clear() -> void:
|
||||
name_line_edit.clear()
|
||||
icon_path_line_edit.clear()
|
||||
description_text_edit.clear()
|
||||
override_editor_settings_menu.clear()
|
||||
group_metadata = GroupMetadata.new()
|
||||
|
||||
|
||||
func get_group_metadata() -> GroupMetadata:
|
||||
group_metadata.icon_path = icon_path_line_edit.text
|
||||
group_metadata.description = description_text_edit.text
|
||||
group_metadata.settings_overrides = override_editor_settings_menu.get_overrides()
|
||||
|
||||
return group_metadata
|
@ -1,12 +1,13 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://du25gr7aoh34m"]
|
||||
[gd_scene load_steps=3 format=3 uid="uid://du25gr7aoh34m"]
|
||||
|
||||
[ext_resource type="Script" path="res://UI/Dialogs/GroupEditDialog.gd" id="1_ic3yh"]
|
||||
[ext_resource type="PackedScene" uid="uid://ig4wkr1lxvbv" path="res://UI/Components/OverrideEditorSettingsMenu/OverrideEditorSettingsMenu.tscn" id="1_yeeya"]
|
||||
|
||||
[node name="GroupEditDialog" type="ConfirmationDialog"]
|
||||
initial_position = 1
|
||||
title = "Edit Group"
|
||||
size = Vector2i(678, 411)
|
||||
visible = true
|
||||
script = ExtResource("1_ic3yh")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
offset_left = 8.0
|
||||
@ -22,6 +23,7 @@ layout_mode = 2
|
||||
text = "Name"
|
||||
|
||||
[node name="NameLineEdit" type="LineEdit" parent="VBoxContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
@ -33,11 +35,13 @@ layout_mode = 2
|
||||
text = "Icon"
|
||||
|
||||
[node name="IconPathLineEdit" type="LineEdit" parent="VBoxContainer/HBoxContainer2"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
placeholder_text = "Optional"
|
||||
|
||||
[node name="OpenIconFileDialogButton" type="Button" parent="VBoxContainer/HBoxContainer2"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "F"
|
||||
|
||||
@ -48,7 +52,8 @@ layout_mode = 2
|
||||
layout_mode = 2
|
||||
text = "Description"
|
||||
|
||||
[node name="TextEdit" type="TextEdit" parent="VBoxContainer/VBoxContainer"]
|
||||
[node name="DescriptionTextEdit" type="TextEdit" parent="VBoxContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(0, 100)
|
||||
layout_mode = 2
|
||||
placeholder_text = "Optional"
|
||||
@ -60,5 +65,6 @@ size_flags_vertical = 3
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="OverrideEditorSettingsMenu" parent="VBoxContainer/ScrollContainer" instance=ExtResource("1_yeeya")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
Reference in New Issue
Block a user