Dungeon Builder Change

This commit is contained in:
dingo
2026-01-31 18:51:45 -05:00
parent f7e60cf947
commit 739c624b71
28 changed files with 2575 additions and 18 deletions
+62 -4
View File
@@ -124,23 +124,72 @@
</div>
</div>
<!-- Note about Tile Templates -->
<!-- Note about Tile Definitions -->
@if (Model.Sheet.Id > 0)
{
<div class="card p-4 md:p-6 mt-4 md:mt-6">
<div class="flex items-center gap-3">
<div class="text-2xl">💡</div>
<div>
<h3 class="font-semibold text-white">Create Tile Templates</h3>
<h3 class="font-semibold text-white">Define Tile Properties</h3>
<p class="text-gray-400 text-sm mt-1">
To use tiles from this sheet, create <a href="/admin/dungeonbuilder/tiles" class="text-blue-400 hover:underline">Tile Templates</a>
which define walkability, sockets, and other properties.
Use Tile Definitions below to set walkability, buckets, and other gameplay properties per frame.
</p>
</div>
</div>
</div>
}
@if (Model.Sheet.Id > 0)
{
<div class="card p-4 md:p-6 mt-4 md:mt-6">
<div class="flex flex-col md:flex-row md:items-center md:justify-between gap-4">
<div>
<h3 class="text-lg font-semibold text-white">Tile Definitions</h3>
<p class="text-gray-400 text-sm mt-1">Define gameplay properties and buckets per frame.</p>
</div>
<div class="flex gap-2">
<input type="number" id="frameJump" class="input text-sm w-28" min="0" placeholder="Frame #" />
<button type="button" class="btn btn-secondary text-sm" onclick="openTileEditor()">Edit Frame</button>
</div>
</div>
<div class="overflow-x-auto mt-4">
<table class="w-full text-sm">
<thead>
<tr class="text-left text-gray-400 border-b border-gray-700">
<th class="pb-2 pr-4">Frame</th>
<th class="pb-2 pr-4">Name</th>
<th class="pb-2 pr-4">Type</th>
<th class="pb-2 pr-4">Buckets</th>
<th class="pb-2">Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-700/50">
@foreach (var row in Model.TileDefinitionRows)
{
<tr class="hover:bg-gray-800/50">
<td class="py-2 pr-4 text-gray-300">@row.FrameIndex</td>
<td class="py-2 pr-4 text-white">@(!string.IsNullOrWhiteSpace(row.Name) ? row.Name : "-")</td>
<td class="py-2 pr-4 text-gray-400">@row.Type</td>
<td class="py-2 pr-4 text-gray-400">@row.BucketCount</td>
<td class="py-2">
<a href="/admin/tilemaps/tiles/edit?id=@row.Id" class="text-blue-400 hover:text-blue-300">Edit</a>
</td>
</tr>
}
@if (!Model.TileDefinitionRows.Any())
{
<tr>
<td colspan="5" class="py-6 text-center text-gray-500">No tile definitions yet. Use "Edit Frame" to create one.</td>
</tr>
}
</tbody>
</table>
</div>
</div>
}
<!-- CDN Browser Modal -->
<div id="cdnBrowserModal" class="fixed inset-0 bg-black/50 z-50 hidden items-center justify-center p-4">
<div class="bg-gray-900 rounded-xl shadow-xl p-4 md:p-6 w-full max-w-2xl border border-gray-700 max-h-[90vh] overflow-hidden flex flex-col">
@@ -230,5 +279,14 @@
closeCdnBrowser();
}
});
function openTileEditor() {
const frame = document.getElementById('frameJump').value;
if (frame === '') {
alert('Enter a frame index.');
return;
}
window.location.href = `/admin/tilemaps/tiles/edit?sheetId=@Model.Sheet.Id&frameIndex=${frame}`;
}
</script>
}