diff --git a/addons/pvzadventure/scripts/AdventureEditor.cs b/addons/pvzadventure/scripts/AdventureEditor.cs index 0496a64..8f3aebc 100644 --- a/addons/pvzadventure/scripts/AdventureEditor.cs +++ b/addons/pvzadventure/scripts/AdventureEditor.cs @@ -13,6 +13,11 @@ public partial class AdventureEditor : MarginContainer [Signal] public delegate void HardReloadRequestedEventHandler(); + public override void _Ready() + { + EditorInterface.Singleton.GetInspector().PropertyEdited += OnInspectorPropertyChanged; + } + public void Reload() { EmitSignal(SignalName.ReloadRequested); @@ -33,5 +38,12 @@ public partial class AdventureEditor : MarginContainer } ResourceSaver.Save(editedResource, editedPath); } - + public void OnInspectorPropertyChanged(string property) + { + if (EditorInterface.Singleton.GetInspector().GetEditedObject() is AdventureLevelResource resource) + { + editedPath = resource.ResourcePath; + HardReload(); + } + } } diff --git a/resources/levels/balance_and_spawn_test.tres b/resources/levels/balance_and_spawn_test.tres index 67b2435..1ae978b 100644 --- a/resources/levels/balance_and_spawn_test.tres +++ b/resources/levels/balance_and_spawn_test.tres @@ -1,6 +1,16 @@ -[gd_resource type="Resource" script_class="AdventureLevelResource" load_steps=2 format=3 uid="uid://ctbue7dex4umy"] +[gd_resource type="Resource" script_class="AdventureLevelResource" load_steps=6 format=3 uid="uid://ctbue7dex4umy"] [ext_resource type="Script" uid="uid://bximdujbkj2n4" path="res://addons/pvzadventure/AdventureLevelResource.cs" id="1_46lr8"] +[ext_resource type="Script" uid="uid://cw7yc3i2lgcja" path="res://addons/pvzadventure/WaveEvent.cs" id="2_otfbt"] +[ext_resource type="Script" uid="uid://7rptlb5qr3b6" path="res://addons/pvzadventure/WaveData.cs" id="3_cugtx"] +[ext_resource type="Script" uid="uid://dl12rj75tk2qi" path="res://addons/pvzadventure/RowSpawn.cs" id="4_y1e37"] + +[sub_resource type="Resource" id="Resource_qsvr4"] +script = ExtResource("3_cugtx") +zombiesOrdered = Array[ExtResource("4_y1e37")]([]) +events = Array[ExtResource("2_otfbt")]([]) +customWaveDelay = -1.0 +isHugeWave = false [resource] script = ExtResource("1_46lr8") @@ -8,5 +18,5 @@ startSun = 50.0 wavePercentage = 0.0 standardWaveDelay = 0.0 initialWaveDelay = 0.0 -waves = [] +waves = [SubResource("Resource_qsvr4")] initialScenes = Array[PackedScene]([null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null])