Save on edit
This commit is contained in:
parent
19e16c62d7
commit
f7d19bbae6
10 changed files with 86 additions and 68 deletions
|
|
@ -60,11 +60,12 @@ layout_mode = 2
|
|||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="ResourceInspector" type="VBoxContainer" parent="Editor/WorkArea/Inspector" node_paths=PackedStringArray("editorContainer")]
|
||||
[node name="ResourceInspector" type="VBoxContainer" parent="Editor/WorkArea/Inspector" node_paths=PackedStringArray("editorContainer", "adventureEditor")]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
script = ExtResource("3_d5hwn")
|
||||
editorContainer = NodePath("../../PanelContainer")
|
||||
adventureEditor = NodePath("../../../..")
|
||||
|
||||
[node name="Tree" type="Tree" parent="Editor/WorkArea/Inspector/ResourceInspector"]
|
||||
custom_minimum_size = Vector2(0, 100)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://segxys6udhyw"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://fof6kr0et8ng" path="res://addons/pvzadventure/scripts/ZE_GridItem.cs" id="1_agbb0"]
|
||||
[ext_resource type="Script" uid="uid://fof6kr0et8ng" path="res://addons/pvzadventure/scripts/ZE_GridItem.cs" id="1_fwfh1"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_jbknv"]
|
||||
bg_color = Color(0.18359, 0.18359, 0.18359, 1)
|
||||
|
|
@ -19,7 +19,7 @@ anchor_bottom = 0.25
|
|||
offset_right = -0.200005
|
||||
offset_bottom = -15.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_jbknv")
|
||||
script = ExtResource("1_agbb0")
|
||||
script = ExtResource("1_fwfh1")
|
||||
|
||||
[node name="Texture" type="TextureRect" parent="."]
|
||||
layout_mode = 2
|
||||
|
|
@ -131,5 +131,6 @@ size_flags_horizontal = 3
|
|||
size_flags_vertical = 3
|
||||
script = ExtResource("1_klhya")
|
||||
|
||||
[connection signal="SaveCallback" from="ZombieGrid/HBoxContainer/RowEditors" to="." method="Save"]
|
||||
[connection signal="pressed" from="ZombieGrid/HBoxContainer/ControlButtons/NewButton" to="ZombieGrid/HBoxContainer/RowEditors" method="AddSpawn"]
|
||||
[connection signal="pressed" from="ZombieGrid/HBoxContainer/ControlButtons/RemoveButton" to="ZombieGrid/HBoxContainer/RowEditors" method="RemoveSpawn"]
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ public partial class AdventureResourceInspector : Node
|
|||
|
||||
[Export]
|
||||
public Control editorContainer;
|
||||
[Export]
|
||||
public AdventureEditor adventureEditor;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
|
|
@ -106,6 +108,7 @@ public partial class AdventureResourceInspector : Node
|
|||
|
||||
editorContainer.AddChild(editor);
|
||||
editor.SetEditedWave(heldResource.waves[GetWaveIndex(selected.GetParent())]);
|
||||
editor.SaveCallback += adventureEditor.Save;
|
||||
return;
|
||||
}
|
||||
else if (index == EVENTS)
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ public partial class ZE_GridContainer : Control
|
|||
{
|
||||
private PackedScene rowEditorScene = ResourceLoader.Load<PackedScene>("uid://buvnw8a7pku78");
|
||||
private WaveData waveData;
|
||||
[Signal] public delegate void SaveCallbackEventHandler();
|
||||
public void SetData(WaveData data)
|
||||
{
|
||||
waveData = data;
|
||||
|
|
@ -33,6 +34,11 @@ public partial class ZE_GridContainer : Control
|
|||
{
|
||||
var editor = rowEditorScene.Instantiate<ZE_RowEditor>();
|
||||
editor.editedSpawn = spawn;
|
||||
editor.SaveCallback += Save;
|
||||
AddChild(editor);
|
||||
}
|
||||
private void Save()
|
||||
{
|
||||
EmitSignal(SignalName.SaveCallback);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using Godot;
|
|||
public partial class ZE_RowEditor : VBoxContainer
|
||||
{
|
||||
private PackedScene buttonScene = ResourceLoader.Load<PackedScene>("uid://segxys6udhyw");
|
||||
[Signal] public delegate void SaveCallbackEventHandler();
|
||||
public RowSpawn editedSpawn;
|
||||
public override void _Ready()
|
||||
{
|
||||
|
|
@ -21,5 +22,6 @@ public partial class ZE_RowEditor : VBoxContainer
|
|||
public void OnResourceChanged(ZombieResource resource, int index)
|
||||
{
|
||||
editedSpawn.zombies[index] = resource;
|
||||
EmitSignal(SignalName.SaveCallback);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,10 +6,15 @@ public partial class ZombieEditor : VBoxContainer
|
|||
{
|
||||
public WaveData editedWave;
|
||||
[Export] private ZE_GridContainer container;
|
||||
[Signal] public delegate void SaveCallbackEventHandler();
|
||||
|
||||
public void SetEditedWave(WaveData data)
|
||||
{
|
||||
editedWave = data;
|
||||
container.SetData(editedWave);
|
||||
}
|
||||
public void Save()
|
||||
{
|
||||
EmitSignal(SignalName.SaveCallback);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,13 +12,13 @@
|
|||
|
||||
[sub_resource type="Resource" id="Resource_yvl2y"]
|
||||
script = ExtResource("4_8miqm")
|
||||
zombies = Array[ExtResource("5_8miqm")]([ExtResource("8_ulhin"), null, ExtResource("6_s62qb"), null, null])
|
||||
zombies = Array[ExtResource("5_8miqm")]([null, ExtResource("7_yvl2y"), ExtResource("6_s62qb"), ExtResource("6_s62qb"), null])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_s62qb"]
|
||||
script = ExtResource("3_hlq35")
|
||||
zombiesOrdered = Array[ExtResource("4_8miqm")]([SubResource("Resource_yvl2y")])
|
||||
events = Array[ExtResource("2_8aewt")]([])
|
||||
customWaveDelay = 1.0
|
||||
customWaveDelay = 10.0
|
||||
isHugeWave = false
|
||||
|
||||
[sub_resource type="Resource" id="Resource_cafd0"]
|
||||
|
|
|
|||
|
|
@ -46,69 +46,6 @@ tracks/2/keys = {
|
|||
"values": [2.0, 2.0, 1.0]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_yw4uo"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Camera2D:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(481, 200)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("GUI/ChooseYourSeeds:anchor_top")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [0.0]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("GUI/ChooseYourSeeds:anchor_bottom")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [1.0]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("GUI/ReadySetPlant:text")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [""]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("GUI/ReadySetPlant:visible")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_8ajos"]
|
||||
resource_name = "PG_Sequence"
|
||||
length = 5.0
|
||||
|
|
@ -187,6 +124,69 @@ tracks/5/keys = {
|
|||
}]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_yw4uo"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Camera2D:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(481, 200)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("GUI/ChooseYourSeeds:anchor_top")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [0.0]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("GUI/ChooseYourSeeds:anchor_bottom")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [1.0]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("GUI/ReadySetPlant:text")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [""]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("GUI/ReadySetPlant:visible")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_yw4uo"]
|
||||
_data = {
|
||||
&"CYS_Sequence": SubResource("Animation_vbgdr"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue