Improvements to save and loading

Improvements to Chinthe animation logic
Fix broken Godot Tool system and just use a more manual approach to setting map nodes
Remove ItemDatabase from individual room scenes
This commit is contained in:
2025-10-24 01:33:18 -07:00
parent f5360adbf1
commit 286c221530
93 changed files with 497 additions and 678 deletions

View File

@@ -1,68 +0,0 @@
using Godot;
using Godot.Collections;
using System.Linq;
using Zennysoft.Game.Ma;
[Tool]
public partial class DungeonFloorLayout : LayoutType
{
[Export]
public DungeonFloorSetType SetType
{
get => _setType;
set
{
_setType = value;
LayoutWithSpawnRate = [];
NotifyPropertyListChanged();
}
}
[ExportToolButton("Populate Map Data")]
public Callable PopulateMapList => Callable.From(() => PopulateDictionary(SetType));
[Export]
public Dictionary<string, float> LayoutWithSpawnRate;
[Export]
public Dictionary<EnemyType, float> EnemySpawnRates;
private string _floorPath = "res://src/map/dungeon/floors/";
private DungeonFloorSetType _setType;
private void PopulateDictionary(DungeonFloorSetType setType)
{
var floorPath = _floorPath;
var floorType = string.Empty;
if (setType == DungeonFloorSetType.SetA)
floorType = "SetAFloors";
else if (setType == DungeonFloorSetType.SetB)
floorType = "SetBFloors";
var pathToScenes = $"{floorPath}/{floorType}";
var files = DirAccess.GetFilesAt(pathToScenes).Where(x => x.EndsWith(".tscn"));
var newMaps = new Dictionary<string, float>();
foreach (var file in files)
{
if (LayoutWithSpawnRate.ContainsKey($"{floorType}/{file}"))
{
var spawnRate = LayoutWithSpawnRate.TryGetValue($"{floorType}/{file}", out var currentSpawnRate);
newMaps.Add($"{floorType}/{file}", currentSpawnRate);
}
else
newMaps.Add($"{floorType}/{file}", 1.0f);
}
LayoutWithSpawnRate = newMaps;
NotifyPropertyListChanged();
}
public enum DungeonFloorSetType
{
SetA,
SetB
}
}

View File

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

View File

@@ -1,22 +0,0 @@
#if TOOLS
using Godot;
using Zennysoft.Game.Ma;
[Tool]
public partial class DungeonFloorLayoutNode : EditorPlugin
{
public override void _EnterTree()
{
// Initialization of the plugin goes here.
var script = GD.Load<Script>("res://addons/dungeon_floor_layout/DungeonFloorLayout.cs");
var texture = GD.Load<Texture2D>("res://addons/dungeon_floor_layout/icon.png");
AddCustomType(nameof(DungeonFloorLayout), nameof(LayoutType), script, texture);
}
public override void _ExitTree()
{
// Clean-up of the plugin goes here.
RemoveCustomType(nameof(DungeonFloorLayout));
}
}
#endif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 B

View File

@@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cgd2d4fusp4pg"
path="res://.godot/imported/icon.png-f075641bee242eff6dcbc69a1dabede8.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/dungeon_floor_layout/icon.png"
dest_files=["res://.godot/imported/icon.png-f075641bee242eff6dcbc69a1dabede8.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

View File

@@ -1,7 +0,0 @@
[plugin]
name="Dungeon Floor Layout"
description=""
author="Zenny"
version=""
script="DungeonFloorLayoutNode.cs"

View File

@@ -1,25 +0,0 @@
using Godot;
using Zennysoft.Game.Ma;
[Tool]
public partial class SpecialFloorLayout : LayoutType
{
[Export]
public SpecialFloorType FloorName { get; set; }
public override void _EnterTree()
{
base._EnterTree();
}
public enum SpecialFloorType
{
Overworld,
Altar,
BossFloorA,
BossFloorB,
GoddessOfGuidanceFloor,
TrueGoddessOfGuidanceFloor,
FinalFloor
}
}

View File

@@ -1,23 +0,0 @@
#if TOOLS
using Godot;
using System;
using Zennysoft.Game.Ma;
[Tool]
public partial class SpecialFloorLayoutNode : EditorPlugin
{
public override void _EnterTree()
{
// Initialization of the plugin goes here.
var script = GD.Load<Script>("res://addons/special_floor_layout_node/SpecialFloorLayout.cs");
var texture = GD.Load<Texture2D>("res://addons/special_floor_layout_node/icon.png");
AddCustomType(nameof(SpecialFloorLayout), nameof(LayoutType), script, texture);
}
public override void _ExitTree()
{
// Clean-up of the plugin goes here.
RemoveCustomType(nameof(SpecialFloorLayout));
}
}
#endif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 B

View File

@@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dkj2u56olatdq"
path="res://.godot/imported/icon.png-f3d3329191ced87c3dfb24631add3cb6.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/special_floor_layout_node/icon.png"
dest_files=["res://.godot/imported/icon.png-f3d3329191ced87c3dfb24631add3cb6.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

View File

@@ -1,7 +0,0 @@
[plugin]
name="Special Floor Layout Node"
description=""
author="Zenny"
version=""
script="SpecialFloorLayoutNode.cs"