This commit is contained in:
Rendo 2025-07-16 02:18:17 +05:00
commit 623362e430
33 changed files with 69 additions and 261 deletions

View file

@ -1,3 +1,3 @@
{ {
"godotTools.editorPath.godot4": "c:\\Users\\User\\Desktop\\Godot_v4.4.1-stable_mono_win64\\Godot_v4.4.1-stable_mono_win64.exe" "godotTools.editorPath.godot4": "c:\\Program Files\\Godot\\Godot_v4.4.1-stable_mono_win64.exe"
} }

View file

@ -1,8 +0,0 @@
<Project Sdk="Godot.NET.Sdk/4.3.0">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework Condition=" '$(GodotTargetPlatform)' == 'android' ">net7.0</TargetFramework>
<TargetFramework Condition=" '$(GodotTargetPlatform)' == 'ios' ">net8.0</TargetFramework>
<EnableDynamicLoading>true</EnableDynamicLoading>
</PropertyGroup>
</Project>

View file

@ -7,5 +7,6 @@ public partial class AdventureLevelResource : Resource
{ {
[Export] public float startSun; [Export] public float startSun;
//[Export] public Array<Conditions> conditions; //[Export] public Array<Conditions> conditions;
[Export(PropertyHint.Range,"0,1,0.01")] public float wavePercentage;
[Export] public Array<WaveData> waves; [Export] public Array<WaveData> waves;
} }

View file

@ -1,8 +0,0 @@
using Godot;
using System;
public partial class FieldSpawn : Resource
{
[Export] public SpawnInfo info;
[Export] public Vector2 position;
}

View file

@ -1 +0,0 @@
uid://gbeuv0b1mvd7

View file

@ -1,7 +0,0 @@
using Godot;
public partial class GroupSpawn : Resource
{
[Export] public PackedScene packedScene;
[Export] public int amount;
}

View file

@ -1 +0,0 @@
uid://b604mrxpt0owi

View file

@ -1,12 +1,5 @@
using Godot; using Godot;
[Tool]
public partial class RowSpawn : Resource public partial class RowSpawn : Resource
{ {
[Export] public SpawnInfo zombie1;
[Export] public SpawnInfo zombie2;
[Export] public SpawnInfo zombie3;
[Export] public SpawnInfo zombie4;
[Export] public SpawnInfo zombie5;
} }

View file

@ -1 +1 @@
uid://comcftlx0eey2 uid://dl12rj75tk2qi

View file

@ -1,7 +0,0 @@
using Godot;
public partial class SpawnInfo : Resource
{
[Export]
public PackedScene scene;
}

View file

@ -1 +0,0 @@
uid://rnnlkqtm6nhy

View file

@ -5,7 +5,6 @@ using Godot.Collections;
[Tool] [Tool]
public partial class WaveData : Resource public partial class WaveData : Resource
{ {
[Export] private Array<GroupSpawn> zombiesDisordered;
[Export] private Array<RowSpawn> zombiesOrdered; [Export] private Array<RowSpawn> zombiesOrdered;
[Export] private Array<FieldSpawn> spawns; [Export] private Array<WaveEvent> spawns;
} }

View file

@ -0,0 +1,5 @@
using Godot;
public partial class WaveEvent : Resource
{
}

View file

@ -0,0 +1 @@
uid://cw7yc3i2lgcja

View file

@ -1,8 +1,7 @@
[gd_scene load_steps=5 format=3 uid="uid://dkq82o31vr3i2"] [gd_scene load_steps=4 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/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://binuuattefn7d" path="res://addons/pvzadventure/scripts/FileButton.cs" id="2_d5hwn"]
[ext_resource type="PackedScene" uid="uid://dbiv5n3asc848" path="res://addons/pvzadventure/scenes/disordered_editor.tscn" id="3_1ojhm"]
[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/AdventureResourceInspector.cs" id="3_d5hwn"]
[node name="AdventureEditor" type="MarginContainer"] [node name="AdventureEditor" type="MarginContainer"]
@ -11,6 +10,8 @@ anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_constants/margin_left = 5 theme_override_constants/margin_left = 5
theme_override_constants/margin_top = 5 theme_override_constants/margin_top = 5
theme_override_constants/margin_right = 5 theme_override_constants/margin_right = 5
@ -49,16 +50,9 @@ split_offset = 500
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/WorkArea"] [node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/WorkArea"]
layout_mode = 2 layout_mode = 2
[node name="DisorderedEditor" parent="VBoxContainer/WorkArea/PanelContainer" instance=ExtResource("3_1ojhm")]
layout_mode = 2
[node name="Inspector" type="VSplitContainer" parent="VBoxContainer/WorkArea"] [node name="Inspector" type="VSplitContainer" parent="VBoxContainer/WorkArea"]
layout_mode = 2 layout_mode = 2
[node name="Cellinspector" type="MarginContainer" parent="VBoxContainer/WorkArea/Inspector"]
layout_mode = 2
size_flags_vertical = 3
[node name="ResourceInspector" type="VBoxContainer" parent="VBoxContainer/WorkArea/Inspector"] [node name="ResourceInspector" type="VBoxContainer" parent="VBoxContainer/WorkArea/Inspector"]
layout_mode = 2 layout_mode = 2
size_flags_vertical = 3 size_flags_vertical = 3
@ -70,7 +64,6 @@ layout_mode = 2
size_flags_vertical = 3 size_flags_vertical = 3
hide_folding = true hide_folding = true
enable_recursive_folding = false enable_recursive_folding = false
hide_root = true
[node name="ControlButtons" type="HBoxContainer" parent="VBoxContainer/WorkArea/Inspector/ResourceInspector"] [node name="ControlButtons" type="HBoxContainer" parent="VBoxContainer/WorkArea/Inspector/ResourceInspector"]
layout_mode = 2 layout_mode = 2

View file

@ -1,43 +0,0 @@
[gd_scene load_steps=3 format=3 uid="uid://dbiv5n3asc848"]
[ext_resource type="Script" uid="uid://dvwbkbsccrnri" path="res://addons/pvzadventure/scripts/DisorderedEditor.cs" id="1_55p46"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_c8vty"]
content_margin_left = 20.0
bg_color = Color(0.351173, 0.700939, 0, 1)
border_width_left = 5
border_width_top = 5
border_width_right = 5
border_width_bottom = 5
border_color = Color(0.216217, 0.607245, 9.62615e-07, 1)
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
[node name="DisorderedEditor" type="ScrollContainer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
vertical_scroll_mode = 0
script = ExtResource("1_55p46")
[node name="MarginContainer" type="MarginContainer" parent="."]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_constants/margin_left = 0
theme_override_constants/margin_top = 0
theme_override_constants/margin_right = 0
theme_override_constants/margin_bottom = 200
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="AddButton" type="Button" parent="MarginContainer/HBoxContainer"]
layout_mode = 2
theme_override_styles/normal = SubResource("StyleBoxFlat_c8vty")

View file

@ -1,45 +0,0 @@
[gd_scene load_steps=4 format=3 uid="uid://dcxxgs78o2apq"]
[ext_resource type="Script" uid="uid://c2wsvwbqpay8p" path="res://addons/pvzadventure/scripts/DnDCard.cs" id="1_k1qq1"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_t7e3j"]
bg_color = Color(0.136826, 0.136826, 0.136826, 1)
border_width_left = 5
border_width_top = 5
border_width_right = 5
border_width_bottom = 5
border_color = Color(0.099986, 0.099986, 0.0999859, 1)
border_blend = true
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
[sub_resource type="ViewportTexture" id="ViewportTexture_k1qq1"]
viewport_path = NodePath("SubViewport")
[node name="DnDCard" type="PanelContainer"]
custom_minimum_size = Vector2(60, 80)
anchors_preset = -1
anchor_right = 0.098
anchor_bottom = 0.172
offset_right = 1.2
offset_bottom = 11.2
theme_override_styles/panel = SubResource("StyleBoxFlat_t7e3j")
script = ExtResource("1_k1qq1")
[node name="TextureRect" type="TextureRect" parent="."]
layout_mode = 2
mouse_filter = 2
texture = SubResource("ViewportTexture_k1qq1")
expand_mode = 4
stretch_mode = 5
[node name="SubViewport" type="SubViewport" parent="."]
transparent_bg = true
canvas_item_default_texture_filter = 0
size = Vector2i(50, 70)
[node name="Camera2D" type="Camera2D" parent="SubViewport"]
position = Vector2(0, -40)
zoom = Vector2(0.6, 0.6)

View file

@ -1,23 +0,0 @@
[gd_scene load_steps=3 format=3 uid="uid://bcswnjdptjuuf"]
[ext_resource type="PackedScene" uid="uid://dcxxgs78o2apq" path="res://addons/pvzadventure/scenes/dn_d_card.tscn" id="1_7k686"]
[ext_resource type="Script" uid="uid://da8tobx0q5ij3" path="res://addons/pvzadventure/scripts/DnDWithNumber.cs" id="1_dkrus"]
[node name="DnDWithNumber" type="VBoxContainer"]
offset_right = 40.0
offset_bottom = 40.0
script = ExtResource("1_dkrus")
[node name="DnDCard" parent="." instance=ExtResource("1_7k686")]
layout_mode = 2
size_flags_vertical = 3
[node name="SpinBox" type="SpinBox" parent="."]
layout_mode = 2
size_flags_vertical = 8
min_value = 1.0
value = 1.0
allow_greater = true
[connection signal="DnDDropped" from="DnDCard" to="." method="OnCardDropped"]
[connection signal="value_changed" from="SpinBox" to="." method="OnNumberSubmitted"]

View file

@ -0,0 +1,9 @@
[gd_scene format=3 uid="uid://db5ah76l43ng2"]
[node name="ZombieEditor" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

View file

@ -4,9 +4,8 @@ using System;
[Tool] [Tool]
public partial class AdventureResourceInspector : Node public partial class AdventureResourceInspector : Node
{ {
const int DISORDERED = 0; const int ORDERED = 0;
const int ORDERED = 1; const int EVENTS = 1;
const int SPAWNS = 2;
private Tree tree; private Tree tree;
private AdventureLevelResource heldResource; private AdventureLevelResource heldResource;
@ -31,6 +30,7 @@ public partial class AdventureResourceInspector : Node
tree.Clear(); tree.Clear();
root = tree.CreateItem(); root = tree.CreateItem();
root.DisableFolding = true; root.DisableFolding = true;
root.SetText(0, "Level");
EmitSignal(SignalName.Refreshed); EmitSignal(SignalName.Refreshed);
for (int i = 0; i < heldResource.waves.Count; i++) for (int i = 0; i < heldResource.waves.Count; i++)
@ -40,14 +40,11 @@ public partial class AdventureResourceInspector : Node
item.SetText(0, string.Format("Wave {0}", i)); item.SetText(0, string.Format("Wave {0}", i));
item.AddButton(0, deleteTexture, tooltipText: "Removes wave. (note that number will not visibly change)"); item.AddButton(0, deleteTexture, tooltipText: "Removes wave. (note that number will not visibly change)");
var disorder = tree.CreateItem(item);
disorder.SetText(0, "Disordered zombies");
var order = tree.CreateItem(item); var order = tree.CreateItem(item);
order.SetText(0, "Ordered zombies"); order.SetText(0, "Zombies");
var spawns = tree.CreateItem(item); var spawns = tree.CreateItem(item);
spawns.SetText(0, "Field spawns"); spawns.SetText(0, "Events");
} }
} }
@ -61,20 +58,24 @@ public partial class AdventureResourceInspector : Node
public void OnItemSelected() public void OnItemSelected()
{ {
var selected = tree.GetSelected(); var selected = tree.GetSelected();
if (selected == root)
{
GD.Print("level pressed");
}
else
{
if (selected.GetParent() == root) return; if (selected.GetParent() == root) return;
var index = selected.GetIndex(); var index = selected.GetIndex();
if (index == DISORDERED) if (index == ORDERED)
{ {
GD.Print("Zombies pressed");
} }
else if (index == ORDERED) else if (index == EVENTS)
{ {
GD.Print("Events pressed");
} }
else if (index == SPAWNS)
{
} }
} }

View file

@ -1,7 +0,0 @@
using Godot;
[Tool]
public partial class DisorderedEditor : ScrollContainer
{
public WaveData editedWave;
}

View file

@ -1 +0,0 @@
uid://dvwbkbsccrnri

View file

@ -1,37 +0,0 @@
using Godot;
using Godot.Collections;
[Tool]
public partial class DnDCard : PanelContainer
{
private Variant tempData;
private PackedScene packedScene;
private Node instantiated;
[Signal] public delegate void DnDDroppedEventHandler(PackedScene scene);
public override void _Notification(int what)
{
if (what == NotificationDragBegin)
{
tempData = GetViewport().GuiGetDragData();
}
else if (what == NotificationDragEnd && GetGlobalRect().HasPoint(GetGlobalMousePosition()))
{
var loaded = ResourceLoader.Load(tempData.AsGodotDictionary()["files"].AsStringArray()[0]);
if (loaded is PackedScene scene)
{
packedScene = scene;
EmitSignal(SignalName.DnDDropped, packedScene);
}
}
}
private void Refresh()
{
if (instantiated != null) instantiated.QueueFree();
instantiated = packedScene.Instantiate();
GetNode("SubViewport").AddChild(instantiated);
}
}

View file

@ -1 +0,0 @@
uid://c2wsvwbqpay8p

View file

@ -1,26 +0,0 @@
using Godot;
[Tool]
public partial class DnDWithNumber : VBoxContainer
{
[Signal] public delegate void DnDChangedEventHandler(PackedScene scene, int number);
private PackedScene packedScene;
private int number;
public void OnCardDropped(PackedScene scene)
{
packedScene = scene;
SendSignal();
}
public void OnNumberSubmitted(float value)
{
number = (int)value;
SendSignal();
}
public void SendSignal()
{
EmitSignal(SignalName.DnDChanged, packedScene, number);
}
}

View file

@ -1 +0,0 @@
uid://da8tobx0q5ij3

View file

@ -1,17 +1,40 @@
[gd_resource type="Resource" script_class="AdventureLevelResource" load_steps=4 format=3 uid="uid://bx1wnrgickeyd"] [gd_resource type="Resource" script_class="AdventureLevelResource" load_steps=9 format=3 uid="uid://bx1wnrgickeyd"]
[ext_resource type="Script" uid="uid://bximdujbkj2n4" path="res://addons/pvzadventure/AdventureLevelResource.cs" id="1_ed2ji"] [ext_resource type="Script" uid="uid://bximdujbkj2n4" path="res://addons/pvzadventure/AdventureLevelResource.cs" id="1_ed2ji"]
[ext_resource type="Script" uid="uid://7rptlb5qr3b6" path="res://addons/pvzadventure/WaveData.cs" id="2_46l53"] [ext_resource type="Script" uid="uid://7rptlb5qr3b6" path="res://addons/pvzadventure/WaveData.cs" id="2_46l53"]
[sub_resource type="Resource" id="Resource_46l53"] [sub_resource type="Resource" id="Resource_46l53"]
script = ExtResource("2_46l53") script = ExtResource("2_46l53")
zombiesDisordered = [null] zombiesOrdered = null
zombiesOrdered = [null] spawns = null
spawns = [null]
metadata/_custom_type_script = "uid://7rptlb5qr3b6" [sub_resource type="Resource" id="Resource_yo1i5"]
script = ExtResource("2_46l53")
zombiesOrdered = null
spawns = null
[sub_resource type="Resource" id="Resource_xqi0a"]
script = ExtResource("2_46l53")
zombiesOrdered = null
spawns = null
[sub_resource type="Resource" id="Resource_ak572"]
script = ExtResource("2_46l53")
zombiesOrdered = null
spawns = null
[sub_resource type="Resource" id="Resource_vfl7c"]
script = ExtResource("2_46l53")
zombiesOrdered = null
spawns = null
[sub_resource type="Resource" id="Resource_pdnxq"]
script = ExtResource("2_46l53")
zombiesOrdered = null
spawns = null
[resource] [resource]
script = ExtResource("1_ed2ji") script = ExtResource("1_ed2ji")
startSun = 0.0 startSun = 0.0
waves = [SubResource("Resource_46l53")] waves = [SubResource("Resource_46l53"), SubResource("Resource_yo1i5"), SubResource("Resource_xqi0a"), SubResource("Resource_ak572"), SubResource("Resource_vfl7c"), SubResource("Resource_pdnxq")]
metadata/_custom_type_script = "uid://bximdujbkj2n4" metadata/_custom_type_script = "uid://bximdujbkj2n4"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.