From 8cfbad01cfd4026d4480c8a702748191b1c7181d Mon Sep 17 00:00:00 2001 From: Rendo Date: Tue, 29 Jul 2025 00:53:29 +0500 Subject: [PATCH] Editor slight refactor --- addons/pvzadventure/scenes/adventure_editor.tscn | 4 ++-- addons/pvzadventure/scenes/asset_browser_button.tscn | 2 +- addons/pvzadventure/scenes/ze_grid_item.tscn | 2 +- addons/pvzadventure/scenes/ze_row_editor.tscn | 2 +- addons/pvzadventure/scenes/zombie_editor.tscn | 6 +++--- .../scripts/{ => adventure-editor}/AdventureEditor.cs | 1 + .../scripts/{ => adventure-editor}/AdventureEditor.cs.uid | 0 .../scripts/{ => adventure-editor}/AdventurePlayer.cs | 0 .../scripts/{ => adventure-editor}/AdventurePlayer.cs.uid | 0 .../{ => adventure-editor}/AdventureResourceInspector.cs | 0 .../AdventureResourceInspector.cs.uid | 0 .../scripts/{ => zombie-editor}/ZE_AssetBrowser.cs | 0 .../scripts/{ => zombie-editor}/ZE_AssetBrowser.cs.uid | 0 .../scripts/{ => zombie-editor}/ZE_AssetBrowserButton.cs | 0 .../{ => zombie-editor}/ZE_AssetBrowserButton.cs.uid | 0 .../scripts/{ => zombie-editor}/ZE_GridContainer.cs | 0 .../scripts/{ => zombie-editor}/ZE_GridContainer.cs.uid | 0 .../pvzadventure/scripts/{ => zombie-editor}/ZE_GridItem.cs | 0 .../scripts/{ => zombie-editor}/ZE_GridItem.cs.uid | 0 .../scripts/{ => zombie-editor}/ZE_RowEditor.cs | 0 .../scripts/{ => zombie-editor}/ZE_RowEditor.cs.uid | 0 .../scripts/{ => zombie-editor}/ZombieEditor.cs | 0 .../scripts/{ => zombie-editor}/ZombieEditor.cs.uid | 0 23 files changed, 9 insertions(+), 8 deletions(-) rename addons/pvzadventure/scripts/{ => adventure-editor}/AdventureEditor.cs (96%) rename addons/pvzadventure/scripts/{ => adventure-editor}/AdventureEditor.cs.uid (100%) rename addons/pvzadventure/scripts/{ => adventure-editor}/AdventurePlayer.cs (100%) rename addons/pvzadventure/scripts/{ => adventure-editor}/AdventurePlayer.cs.uid (100%) rename addons/pvzadventure/scripts/{ => adventure-editor}/AdventureResourceInspector.cs (100%) rename addons/pvzadventure/scripts/{ => adventure-editor}/AdventureResourceInspector.cs.uid (100%) rename addons/pvzadventure/scripts/{ => zombie-editor}/ZE_AssetBrowser.cs (100%) rename addons/pvzadventure/scripts/{ => zombie-editor}/ZE_AssetBrowser.cs.uid (100%) rename addons/pvzadventure/scripts/{ => zombie-editor}/ZE_AssetBrowserButton.cs (100%) rename addons/pvzadventure/scripts/{ => zombie-editor}/ZE_AssetBrowserButton.cs.uid (100%) rename addons/pvzadventure/scripts/{ => zombie-editor}/ZE_GridContainer.cs (100%) rename addons/pvzadventure/scripts/{ => zombie-editor}/ZE_GridContainer.cs.uid (100%) rename addons/pvzadventure/scripts/{ => zombie-editor}/ZE_GridItem.cs (100%) rename addons/pvzadventure/scripts/{ => zombie-editor}/ZE_GridItem.cs.uid (100%) rename addons/pvzadventure/scripts/{ => zombie-editor}/ZE_RowEditor.cs (100%) rename addons/pvzadventure/scripts/{ => zombie-editor}/ZE_RowEditor.cs.uid (100%) rename addons/pvzadventure/scripts/{ => zombie-editor}/ZombieEditor.cs (100%) rename addons/pvzadventure/scripts/{ => zombie-editor}/ZombieEditor.cs.uid (100%) diff --git a/addons/pvzadventure/scenes/adventure_editor.tscn b/addons/pvzadventure/scenes/adventure_editor.tscn index 3b35cce..134f5b3 100644 --- a/addons/pvzadventure/scenes/adventure_editor.tscn +++ b/addons/pvzadventure/scenes/adventure_editor.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=5 format=3 uid="uid://dkq82o31vr3i2"] -[ext_resource type="Script" uid="uid://dkgxtig5fwdgi" path="res://addons/pvzadventure/scripts/AdventureEditor.cs" id="1_go5yu"] +[ext_resource type="Script" uid="uid://dkgxtig5fwdgi" path="res://addons/pvzadventure/scripts/adventure-editor/AdventureEditor.cs" id="1_go5yu"] [ext_resource type="Script" uid="uid://binuuattefn7d" path="res://addons/pvzadventure/scripts/FileButton.cs" id="2_d5hwn"] [ext_resource type="Script" uid="uid://c6jttmpeyakoa" path="res://addons/pvzadventure/scripts/EditorsContainer.cs" id="3_5imrs"] -[ext_resource type="Script" uid="uid://b0hl4ap18wbb2" path="res://addons/pvzadventure/scripts/AdventureResourceInspector.cs" id="3_d5hwn"] +[ext_resource type="Script" uid="uid://b0hl4ap18wbb2" path="res://addons/pvzadventure/scripts/adventure-editor/AdventureResourceInspector.cs" id="3_d5hwn"] [node name="AdventureEditor" type="MarginContainer"] anchors_preset = 15 diff --git a/addons/pvzadventure/scenes/asset_browser_button.tscn b/addons/pvzadventure/scenes/asset_browser_button.tscn index 5725a16..f135cd9 100644 --- a/addons/pvzadventure/scenes/asset_browser_button.tscn +++ b/addons/pvzadventure/scenes/asset_browser_button.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=3 uid="uid://iwnklc62rni8"] -[ext_resource type="Script" uid="uid://cpedvgx23hlko" path="res://addons/pvzadventure/scripts/ZE_AssetBrowserButton.cs" id="1_jbknv"] +[ext_resource type="Script" uid="uid://cpedvgx23hlko" path="res://addons/pvzadventure/scripts/zombie-editor/ZE_AssetBrowserButton.cs" id="1_jbknv"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_jbknv"] bg_color = Color(0.18359, 0.18359, 0.18359, 1) diff --git a/addons/pvzadventure/scenes/ze_grid_item.tscn b/addons/pvzadventure/scenes/ze_grid_item.tscn index 58534ee..ecc6455 100644 --- a/addons/pvzadventure/scenes/ze_grid_item.tscn +++ b/addons/pvzadventure/scenes/ze_grid_item.tscn @@ -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_fwfh1"] +[ext_resource type="Script" uid="uid://fof6kr0et8ng" path="res://addons/pvzadventure/scripts/zombie-editor/ZE_GridItem.cs" id="1_fwfh1"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_jbknv"] bg_color = Color(0.18359, 0.18359, 0.18359, 1) diff --git a/addons/pvzadventure/scenes/ze_row_editor.tscn b/addons/pvzadventure/scenes/ze_row_editor.tscn index b06dfcd..38390c9 100644 --- a/addons/pvzadventure/scenes/ze_row_editor.tscn +++ b/addons/pvzadventure/scenes/ze_row_editor.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://buvnw8a7pku78"] -[ext_resource type="Script" uid="uid://q84g5imvatfl" path="res://addons/pvzadventure/scripts/ZE_RowEditor.cs" id="1_wm7b4"] +[ext_resource type="Script" uid="uid://q84g5imvatfl" path="res://addons/pvzadventure/scripts/zombie-editor/ZE_RowEditor.cs" id="1_wm7b4"] [node name="RowEditor" type="VBoxContainer"] anchors_preset = 15 diff --git a/addons/pvzadventure/scenes/zombie_editor.tscn b/addons/pvzadventure/scenes/zombie_editor.tscn index c5426c2..c799abf 100644 --- a/addons/pvzadventure/scenes/zombie_editor.tscn +++ b/addons/pvzadventure/scenes/zombie_editor.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=10 format=3 uid="uid://db5ah76l43ng2"] -[ext_resource type="Script" uid="uid://bnuno3uhya4sg" path="res://addons/pvzadventure/scripts/ZE_AssetBrowser.cs" id="1_klhya"] -[ext_resource type="Script" uid="uid://bd5hl0etgvf5a" path="res://addons/pvzadventure/scripts/ZombieEditor.cs" id="1_thd7y"] -[ext_resource type="Script" uid="uid://do7s5mo36c280" path="res://addons/pvzadventure/scripts/ZE_GridContainer.cs" id="2_13ic4"] +[ext_resource type="Script" uid="uid://bnuno3uhya4sg" path="res://addons/pvzadventure/scripts/zombie-editor/ZE_AssetBrowser.cs" id="1_klhya"] +[ext_resource type="Script" uid="uid://bd5hl0etgvf5a" path="res://addons/pvzadventure/scripts/zombie-editor/ZombieEditor.cs" id="1_thd7y"] +[ext_resource type="Script" uid="uid://do7s5mo36c280" path="res://addons/pvzadventure/scripts/zombie-editor/ZE_GridContainer.cs" id="2_13ic4"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_thd7y"] bg_color = Color(0.430693, 0.742747, 0.314214, 1) diff --git a/addons/pvzadventure/scripts/AdventureEditor.cs b/addons/pvzadventure/scripts/adventure-editor/AdventureEditor.cs similarity index 96% rename from addons/pvzadventure/scripts/AdventureEditor.cs rename to addons/pvzadventure/scripts/adventure-editor/AdventureEditor.cs index a6f3948..32b1ccd 100644 --- a/addons/pvzadventure/scripts/AdventureEditor.cs +++ b/addons/pvzadventure/scripts/adventure-editor/AdventureEditor.cs @@ -57,6 +57,7 @@ public partial class AdventureEditor : MarginContainer } public void Play() { + if (ResourceLoader.Exists(editedPath) == false) return; var player = new AdventurePlayer(); var packed = new PackedScene(); player.pathToLevel = editedPath; diff --git a/addons/pvzadventure/scripts/AdventureEditor.cs.uid b/addons/pvzadventure/scripts/adventure-editor/AdventureEditor.cs.uid similarity index 100% rename from addons/pvzadventure/scripts/AdventureEditor.cs.uid rename to addons/pvzadventure/scripts/adventure-editor/AdventureEditor.cs.uid diff --git a/addons/pvzadventure/scripts/AdventurePlayer.cs b/addons/pvzadventure/scripts/adventure-editor/AdventurePlayer.cs similarity index 100% rename from addons/pvzadventure/scripts/AdventurePlayer.cs rename to addons/pvzadventure/scripts/adventure-editor/AdventurePlayer.cs diff --git a/addons/pvzadventure/scripts/AdventurePlayer.cs.uid b/addons/pvzadventure/scripts/adventure-editor/AdventurePlayer.cs.uid similarity index 100% rename from addons/pvzadventure/scripts/AdventurePlayer.cs.uid rename to addons/pvzadventure/scripts/adventure-editor/AdventurePlayer.cs.uid diff --git a/addons/pvzadventure/scripts/AdventureResourceInspector.cs b/addons/pvzadventure/scripts/adventure-editor/AdventureResourceInspector.cs similarity index 100% rename from addons/pvzadventure/scripts/AdventureResourceInspector.cs rename to addons/pvzadventure/scripts/adventure-editor/AdventureResourceInspector.cs diff --git a/addons/pvzadventure/scripts/AdventureResourceInspector.cs.uid b/addons/pvzadventure/scripts/adventure-editor/AdventureResourceInspector.cs.uid similarity index 100% rename from addons/pvzadventure/scripts/AdventureResourceInspector.cs.uid rename to addons/pvzadventure/scripts/adventure-editor/AdventureResourceInspector.cs.uid diff --git a/addons/pvzadventure/scripts/ZE_AssetBrowser.cs b/addons/pvzadventure/scripts/zombie-editor/ZE_AssetBrowser.cs similarity index 100% rename from addons/pvzadventure/scripts/ZE_AssetBrowser.cs rename to addons/pvzadventure/scripts/zombie-editor/ZE_AssetBrowser.cs diff --git a/addons/pvzadventure/scripts/ZE_AssetBrowser.cs.uid b/addons/pvzadventure/scripts/zombie-editor/ZE_AssetBrowser.cs.uid similarity index 100% rename from addons/pvzadventure/scripts/ZE_AssetBrowser.cs.uid rename to addons/pvzadventure/scripts/zombie-editor/ZE_AssetBrowser.cs.uid diff --git a/addons/pvzadventure/scripts/ZE_AssetBrowserButton.cs b/addons/pvzadventure/scripts/zombie-editor/ZE_AssetBrowserButton.cs similarity index 100% rename from addons/pvzadventure/scripts/ZE_AssetBrowserButton.cs rename to addons/pvzadventure/scripts/zombie-editor/ZE_AssetBrowserButton.cs diff --git a/addons/pvzadventure/scripts/ZE_AssetBrowserButton.cs.uid b/addons/pvzadventure/scripts/zombie-editor/ZE_AssetBrowserButton.cs.uid similarity index 100% rename from addons/pvzadventure/scripts/ZE_AssetBrowserButton.cs.uid rename to addons/pvzadventure/scripts/zombie-editor/ZE_AssetBrowserButton.cs.uid diff --git a/addons/pvzadventure/scripts/ZE_GridContainer.cs b/addons/pvzadventure/scripts/zombie-editor/ZE_GridContainer.cs similarity index 100% rename from addons/pvzadventure/scripts/ZE_GridContainer.cs rename to addons/pvzadventure/scripts/zombie-editor/ZE_GridContainer.cs diff --git a/addons/pvzadventure/scripts/ZE_GridContainer.cs.uid b/addons/pvzadventure/scripts/zombie-editor/ZE_GridContainer.cs.uid similarity index 100% rename from addons/pvzadventure/scripts/ZE_GridContainer.cs.uid rename to addons/pvzadventure/scripts/zombie-editor/ZE_GridContainer.cs.uid diff --git a/addons/pvzadventure/scripts/ZE_GridItem.cs b/addons/pvzadventure/scripts/zombie-editor/ZE_GridItem.cs similarity index 100% rename from addons/pvzadventure/scripts/ZE_GridItem.cs rename to addons/pvzadventure/scripts/zombie-editor/ZE_GridItem.cs diff --git a/addons/pvzadventure/scripts/ZE_GridItem.cs.uid b/addons/pvzadventure/scripts/zombie-editor/ZE_GridItem.cs.uid similarity index 100% rename from addons/pvzadventure/scripts/ZE_GridItem.cs.uid rename to addons/pvzadventure/scripts/zombie-editor/ZE_GridItem.cs.uid diff --git a/addons/pvzadventure/scripts/ZE_RowEditor.cs b/addons/pvzadventure/scripts/zombie-editor/ZE_RowEditor.cs similarity index 100% rename from addons/pvzadventure/scripts/ZE_RowEditor.cs rename to addons/pvzadventure/scripts/zombie-editor/ZE_RowEditor.cs diff --git a/addons/pvzadventure/scripts/ZE_RowEditor.cs.uid b/addons/pvzadventure/scripts/zombie-editor/ZE_RowEditor.cs.uid similarity index 100% rename from addons/pvzadventure/scripts/ZE_RowEditor.cs.uid rename to addons/pvzadventure/scripts/zombie-editor/ZE_RowEditor.cs.uid diff --git a/addons/pvzadventure/scripts/ZombieEditor.cs b/addons/pvzadventure/scripts/zombie-editor/ZombieEditor.cs similarity index 100% rename from addons/pvzadventure/scripts/ZombieEditor.cs rename to addons/pvzadventure/scripts/zombie-editor/ZombieEditor.cs diff --git a/addons/pvzadventure/scripts/ZombieEditor.cs.uid b/addons/pvzadventure/scripts/zombie-editor/ZombieEditor.cs.uid similarity index 100% rename from addons/pvzadventure/scripts/ZombieEditor.cs.uid rename to addons/pvzadventure/scripts/zombie-editor/ZombieEditor.cs.uid