Zombie editor
This commit is contained in:
parent
623362e430
commit
7d1ca26baa
23 changed files with 435 additions and 25 deletions
|
|
@ -1,5 +1,9 @@
|
|||
using Godot;
|
||||
using Godot.Collections;
|
||||
|
||||
[Tool]
|
||||
[GlobalClass]
|
||||
public partial class RowSpawn : Resource
|
||||
{
|
||||
[Export] public Array<ZombieResource> zombies = new(new ZombieResource[5]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,6 @@ using Godot.Collections;
|
|||
[Tool]
|
||||
public partial class WaveData : Resource
|
||||
{
|
||||
[Export] private Array<RowSpawn> zombiesOrdered;
|
||||
[Export] private Array<WaveEvent> spawns;
|
||||
[Export] public Array<RowSpawn> zombiesOrdered;
|
||||
[Export] public Array<WaveEvent> spawns;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://dkq82o31vr3i2"]
|
||||
[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://binuuattefn7d" path="res://addons/pvzadventure/scripts/FileButton.cs" id="2_d5hwn"]
|
||||
[ext_resource type="PackedScene" uid="uid://db5ah76l43ng2" path="res://addons/pvzadventure/scenes/zombie_editor.tscn" id="3_1ojhm"]
|
||||
[ext_resource type="Script" uid="uid://b0hl4ap18wbb2" path="res://addons/pvzadventure/scripts/AdventureResourceInspector.cs" id="3_d5hwn"]
|
||||
|
||||
[node name="AdventureEditor" type="MarginContainer"]
|
||||
|
|
@ -50,13 +51,18 @@ split_offset = 500
|
|||
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/WorkArea"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ZombieEditor" parent="VBoxContainer/WorkArea/PanelContainer" instance=ExtResource("3_1ojhm")]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Inspector" type="VSplitContainer" parent="VBoxContainer/WorkArea"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ResourceInspector" type="VBoxContainer" parent="VBoxContainer/WorkArea/Inspector"]
|
||||
[node name="ResourceInspector" type="VBoxContainer" parent="VBoxContainer/WorkArea/Inspector" node_paths=PackedStringArray("editorContainer")]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
script = ExtResource("3_d5hwn")
|
||||
editorContainer = NodePath("../../PanelContainer")
|
||||
|
||||
[node name="Tree" type="Tree" parent="VBoxContainer/WorkArea/Inspector/ResourceInspector"]
|
||||
custom_minimum_size = Vector2(0, 100)
|
||||
|
|
|
|||
27
addons/pvzadventure/scenes/asset_browser_button.tscn
Normal file
27
addons/pvzadventure/scenes/asset_browser_button.tscn
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
[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"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_jbknv"]
|
||||
bg_color = Color(0.18359, 0.18359, 0.18359, 1)
|
||||
border_color = Color(0.140447, 0.140447, 0.140447, 1)
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[node name="AssetBrowserButton" type="PanelContainer"]
|
||||
clip_contents = true
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
anchors_preset = -1
|
||||
anchor_right = 0.172
|
||||
anchor_bottom = 0.25
|
||||
offset_right = -0.200005
|
||||
offset_bottom = -15.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_jbknv")
|
||||
script = ExtResource("1_jbknv")
|
||||
|
||||
[node name="Texture" type="TextureRect" parent="."]
|
||||
layout_mode = 2
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
27
addons/pvzadventure/scenes/grid_item.tscn
Normal file
27
addons/pvzadventure/scenes/grid_item.tscn
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
[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"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_jbknv"]
|
||||
bg_color = Color(0.18359, 0.18359, 0.18359, 1)
|
||||
border_color = Color(0.140447, 0.140447, 0.140447, 1)
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[node name="GridItem" type="PanelContainer"]
|
||||
clip_contents = true
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
anchors_preset = -1
|
||||
anchor_right = 0.172
|
||||
anchor_bottom = 0.25
|
||||
offset_right = -0.200005
|
||||
offset_bottom = -15.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_jbknv")
|
||||
script = ExtResource("1_agbb0")
|
||||
|
||||
[node name="Texture" type="TextureRect" parent="."]
|
||||
layout_mode = 2
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
11
addons/pvzadventure/scenes/row_editor.tscn
Normal file
11
addons/pvzadventure/scenes/row_editor.tscn
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
[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"]
|
||||
|
||||
[node name="RowEditor" type="VBoxContainer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_wm7b4")
|
||||
|
|
@ -1,9 +1,135 @@
|
|||
[gd_scene format=3 uid="uid://db5ah76l43ng2"]
|
||||
[gd_scene load_steps=10 format=3 uid="uid://db5ah76l43ng2"]
|
||||
|
||||
[node name="ZombieEditor" type="Control"]
|
||||
layout_mode = 3
|
||||
[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"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_thd7y"]
|
||||
bg_color = Color(0.430693, 0.742747, 0.314214, 1)
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_a2umq"]
|
||||
bg_color = Color(0.503317, 0.859941, 0.370424, 1)
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_13ic4"]
|
||||
bg_color = Color(0.655235, 0.676224, 0.627655, 1)
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_h81wb"]
|
||||
bg_color = Color(1, 0.617482, 0.590722, 1)
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_vak4b"]
|
||||
bg_color = Color(0.655235, 0.676224, 0.627655, 1)
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_nm0oj"]
|
||||
bg_color = Color(0.999983, 0.30398, 0.31271, 1)
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[node name="ZombieEditor" type="VBoxContainer" node_paths=PackedStringArray("container")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_thd7y")
|
||||
container = NodePath("ZombieGrid/HBoxContainer/RowEditors")
|
||||
|
||||
[node name="ZombieGrid" type="ScrollContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
size_flags_stretch_ratio = 3.0
|
||||
horizontal_scroll_mode = 2
|
||||
vertical_scroll_mode = 0
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="ZombieGrid"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="RowEditors" type="HBoxContainer" parent="ZombieGrid/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
size_flags_stretch_ratio = 3.0
|
||||
script = ExtResource("2_13ic4")
|
||||
|
||||
[node name="ControlButtons" type="VBoxContainer" parent="ZombieGrid/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="NewButton" type="Button" parent="ZombieGrid/HBoxContainer/ControlButtons"]
|
||||
custom_minimum_size = Vector2(32, 0)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_colors/font_disabled_color = Color(1, 1, 1, 1)
|
||||
theme_override_colors/font_hover_pressed_color = Color(1, 1, 1, 1)
|
||||
theme_override_colors/font_hover_color = Color(1, 1, 1, 1)
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_colors/font_focus_color = Color(1, 1, 1, 1)
|
||||
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 24
|
||||
theme_override_styles/disabled_mirrored = SubResource("StyleBoxFlat_thd7y")
|
||||
theme_override_styles/disabled = SubResource("StyleBoxFlat_thd7y")
|
||||
theme_override_styles/hover_pressed = SubResource("StyleBoxFlat_a2umq")
|
||||
theme_override_styles/hover_mirrored = SubResource("StyleBoxFlat_a2umq")
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_thd7y")
|
||||
theme_override_styles/pressed_mirrored = SubResource("StyleBoxFlat_13ic4")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_13ic4")
|
||||
theme_override_styles/normal_mirrored = SubResource("StyleBoxFlat_thd7y")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_thd7y")
|
||||
text = "+"
|
||||
|
||||
[node name="RemoveButton" type="Button" parent="ZombieGrid/HBoxContainer/ControlButtons"]
|
||||
custom_minimum_size = Vector2(32, 0)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_colors/font_disabled_color = Color(1, 1, 1, 1)
|
||||
theme_override_colors/font_hover_pressed_color = Color(1, 1, 1, 1)
|
||||
theme_override_colors/font_hover_color = Color(1, 1, 1, 1)
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_colors/font_focus_color = Color(1, 1, 1, 1)
|
||||
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 24
|
||||
theme_override_styles/disabled_mirrored = SubResource("StyleBoxFlat_h81wb")
|
||||
theme_override_styles/disabled = SubResource("StyleBoxFlat_h81wb")
|
||||
theme_override_styles/hover_pressed = SubResource("StyleBoxFlat_h81wb")
|
||||
theme_override_styles/hover_mirrored = SubResource("StyleBoxFlat_h81wb")
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_h81wb")
|
||||
theme_override_styles/pressed_mirrored = SubResource("StyleBoxFlat_vak4b")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_vak4b")
|
||||
theme_override_styles/normal_mirrored = SubResource("StyleBoxFlat_nm0oj")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_nm0oj")
|
||||
text = "-"
|
||||
|
||||
[node name="AssetBrowser" type="ScrollContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
vertical_scroll_mode = 0
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="AssetBrowser"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
script = ExtResource("1_klhya")
|
||||
|
||||
[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"]
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ public partial class AdventureResourceInspector : Node
|
|||
{
|
||||
const int ORDERED = 0;
|
||||
const int EVENTS = 1;
|
||||
private PackedScene zombieEditorScene = ResourceLoader.Load<PackedScene>("uid://db5ah76l43ng2");
|
||||
|
||||
private Tree tree;
|
||||
private AdventureLevelResource heldResource;
|
||||
|
|
@ -14,6 +15,10 @@ public partial class AdventureResourceInspector : Node
|
|||
|
||||
[Signal]
|
||||
public delegate void RefreshedEventHandler();
|
||||
|
||||
[Export]
|
||||
public Control editorContainer;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
tree = GetNode<Tree>("Tree");
|
||||
|
|
@ -57,6 +62,11 @@ public partial class AdventureResourceInspector : Node
|
|||
|
||||
public void OnItemSelected()
|
||||
{
|
||||
foreach (var child in editorContainer.GetChildren())
|
||||
{
|
||||
child.QueueFree();
|
||||
}
|
||||
|
||||
var selected = tree.GetSelected();
|
||||
if (selected == root)
|
||||
{
|
||||
|
|
@ -70,7 +80,10 @@ public partial class AdventureResourceInspector : Node
|
|||
var index = selected.GetIndex();
|
||||
if (index == ORDERED)
|
||||
{
|
||||
GD.Print("Zombies pressed");
|
||||
var editor = zombieEditorScene.Instantiate<ZombieEditor>();
|
||||
|
||||
editorContainer.AddChild(editor);
|
||||
editor.SetEditedWave(heldResource.waves[int.Parse(selected.GetParent().GetText(0).Split(" ")[1])]);
|
||||
}
|
||||
else if (index == EVENTS)
|
||||
{
|
||||
|
|
|
|||
19
addons/pvzadventure/scripts/ZE_AssetBrowser.cs
Normal file
19
addons/pvzadventure/scripts/ZE_AssetBrowser.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
using Godot;
|
||||
|
||||
|
||||
[Tool]
|
||||
public partial class ZE_AssetBrowser : HBoxContainer
|
||||
{
|
||||
const string ZOMBIE_PATH = "res://resources/zombies/";
|
||||
private PackedScene scene = ResourceLoader.Load<PackedScene>("uid://iwnklc62rni8");
|
||||
public override void _Ready()
|
||||
{
|
||||
foreach (var file in ResourceLoader.ListDirectory(ZOMBIE_PATH))
|
||||
{
|
||||
var data = ResourceLoader.Load<ZombieResource>(ZOMBIE_PATH + file);
|
||||
var button = scene.Instantiate<ZE_AssetBrowserButton>();
|
||||
button.SetData(data);
|
||||
AddChild(button);
|
||||
}
|
||||
}
|
||||
}
|
||||
1
addons/pvzadventure/scripts/ZE_AssetBrowser.cs.uid
Normal file
1
addons/pvzadventure/scripts/ZE_AssetBrowser.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bnuno3uhya4sg
|
||||
22
addons/pvzadventure/scripts/ZE_AssetBrowserButton.cs
Normal file
22
addons/pvzadventure/scripts/ZE_AssetBrowserButton.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using Godot;
|
||||
|
||||
[Tool]
|
||||
public partial class ZE_AssetBrowserButton : PanelContainer
|
||||
{
|
||||
private ZombieResource resource;
|
||||
public void SetData(ZombieResource data)
|
||||
{
|
||||
resource = data;
|
||||
UpdateContent();
|
||||
}
|
||||
private void UpdateContent()
|
||||
{
|
||||
GetNode<TextureRect>("Texture").Texture = resource.Preview;
|
||||
}
|
||||
|
||||
public override Variant _GetDragData(Vector2 atPosition)
|
||||
{
|
||||
return resource;
|
||||
}
|
||||
|
||||
}
|
||||
1
addons/pvzadventure/scripts/ZE_AssetBrowserButton.cs.uid
Normal file
1
addons/pvzadventure/scripts/ZE_AssetBrowserButton.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cpedvgx23hlko
|
||||
38
addons/pvzadventure/scripts/ZE_GridContainer.cs
Normal file
38
addons/pvzadventure/scripts/ZE_GridContainer.cs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
using Godot;
|
||||
|
||||
[Tool]
|
||||
public partial class ZE_GridContainer : Control
|
||||
{
|
||||
private PackedScene rowEditorScene = ResourceLoader.Load<PackedScene>("uid://buvnw8a7pku78");
|
||||
private WaveData waveData;
|
||||
public void SetData(WaveData data)
|
||||
{
|
||||
waveData = data;
|
||||
foreach (var child in GetChildren())
|
||||
{
|
||||
child.QueueFree();
|
||||
}
|
||||
foreach (var spawn in waveData.zombiesOrdered)
|
||||
{
|
||||
InitEditor(spawn);
|
||||
}
|
||||
}
|
||||
public void AddSpawn()
|
||||
{
|
||||
var spawn = new RowSpawn();
|
||||
waveData.zombiesOrdered.Add(spawn);
|
||||
InitEditor(spawn);
|
||||
}
|
||||
public void RemoveSpawn()
|
||||
{
|
||||
var editor = GetChild<ZE_RowEditor>(GetChildCount() - 1);
|
||||
waveData.zombiesOrdered.Remove(editor.editedSpawn);
|
||||
editor.QueueFree();
|
||||
}
|
||||
private void InitEditor(RowSpawn spawn)
|
||||
{
|
||||
var editor = rowEditorScene.Instantiate<ZE_RowEditor>();
|
||||
editor.editedSpawn = spawn;
|
||||
AddChild(editor);
|
||||
}
|
||||
}
|
||||
1
addons/pvzadventure/scripts/ZE_GridContainer.cs.uid
Normal file
1
addons/pvzadventure/scripts/ZE_GridContainer.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://do7s5mo36c280
|
||||
47
addons/pvzadventure/scripts/ZE_GridItem.cs
Normal file
47
addons/pvzadventure/scripts/ZE_GridItem.cs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
using Godot;
|
||||
|
||||
|
||||
[Tool]
|
||||
public partial class ZE_GridItem : Control
|
||||
{
|
||||
private ZombieResource resource;
|
||||
public int index;
|
||||
[Signal] public delegate void ResourceChangedEventHandler(ZombieResource resource, int index);
|
||||
public void SetData(ZombieResource data)
|
||||
{
|
||||
resource = data;
|
||||
UpdateContent();
|
||||
}
|
||||
private void UpdateContent()
|
||||
{
|
||||
if (resource == null)
|
||||
{
|
||||
GetNode<TextureRect>("Texture").Texture = null;
|
||||
return;
|
||||
}
|
||||
GetNode<TextureRect>("Texture").Texture = resource.Preview;
|
||||
}
|
||||
|
||||
public override Variant _GetDragData(Vector2 atPosition)
|
||||
{
|
||||
return resource;
|
||||
}
|
||||
public override bool _CanDropData(Vector2 atPosition, Variant data)
|
||||
{
|
||||
return data.AsGodotObject() is ZombieResource;
|
||||
}
|
||||
public override void _DropData(Vector2 atPosition, Variant data)
|
||||
{
|
||||
SetData((ZombieResource)data.AsGodotObject());
|
||||
EmitSignal(SignalName.ResourceChanged, resource, index);
|
||||
}
|
||||
public override void _GuiInput(InputEvent @event)
|
||||
{
|
||||
if (@event is InputEventMouseButton buttonEvent && buttonEvent.ButtonIndex == MouseButton.Right )
|
||||
{
|
||||
SetData(null);
|
||||
EmitSignal(SignalName.ResourceChanged, resource, index);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
1
addons/pvzadventure/scripts/ZE_GridItem.cs.uid
Normal file
1
addons/pvzadventure/scripts/ZE_GridItem.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://fof6kr0et8ng
|
||||
25
addons/pvzadventure/scripts/ZE_RowEditor.cs
Normal file
25
addons/pvzadventure/scripts/ZE_RowEditor.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
using Godot;
|
||||
|
||||
[Tool]
|
||||
public partial class ZE_RowEditor : VBoxContainer
|
||||
{
|
||||
private PackedScene buttonScene = ResourceLoader.Load<PackedScene>("uid://segxys6udhyw");
|
||||
public RowSpawn editedSpawn;
|
||||
public override void _Ready()
|
||||
{
|
||||
for (int i = 0; i < editedSpawn.zombies.Count; i++)
|
||||
{
|
||||
var button = buttonScene.Instantiate<ZE_GridItem>();
|
||||
AddChild(button);
|
||||
button.index = i;
|
||||
if (editedSpawn.zombies[i] != null)
|
||||
button.SetData(editedSpawn.zombies[i]);
|
||||
button.ResourceChanged += OnResourceChanged;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnResourceChanged(ZombieResource resource, int index)
|
||||
{
|
||||
editedSpawn.zombies[index] = resource;
|
||||
}
|
||||
}
|
||||
1
addons/pvzadventure/scripts/ZE_RowEditor.cs.uid
Normal file
1
addons/pvzadventure/scripts/ZE_RowEditor.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://q84g5imvatfl
|
||||
15
addons/pvzadventure/scripts/ZombieEditor.cs
Normal file
15
addons/pvzadventure/scripts/ZombieEditor.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
using Godot;
|
||||
|
||||
|
||||
[Tool]
|
||||
public partial class ZombieEditor : VBoxContainer
|
||||
{
|
||||
public WaveData editedWave;
|
||||
[Export] private ZE_GridContainer container;
|
||||
|
||||
public void SetEditedWave(WaveData data)
|
||||
{
|
||||
editedWave = data;
|
||||
container.SetData(editedWave);
|
||||
}
|
||||
}
|
||||
1
addons/pvzadventure/scripts/ZombieEditor.cs.uid
Normal file
1
addons/pvzadventure/scripts/ZombieEditor.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bd5hl0etgvf5a
|
||||
Loading…
Add table
Add a link
Reference in a new issue