Working on fixing enemy identification

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-03-14 21:06:31 +01:00
parent 12e2e7e3a8
commit 1ec891d9a0
18 changed files with 293 additions and 292 deletions

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:wolf_3d_data/wolf_3d_data.dart';
import 'package:wolf_dart/features/entities/enemies/enemy.dart';
import 'package:wolf_dart/features/renderer/color_palette.dart';
class SpriteGallery extends StatelessWidget {
@@ -11,7 +12,7 @@ class SpriteGallery extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("VSWAP Sprite Gallery"),
title: const Text("Sprite Gallery"),
automaticallyImplyLeading: true,
),
backgroundColor: Colors.black,
@@ -21,11 +22,22 @@ class SpriteGallery extends StatelessWidget {
),
itemCount: sprites.length,
itemBuilder: (context, index) {
// --- Check which enemy owns this sprite ---
String label = "Idx: $index";
for (final enemy in EnemyType.values) {
if (enemy.claimsSpriteIndex(index)) {
// Appends the enum name (e.g., "guard", "dog")
label += "\n${enemy.name}";
break;
}
}
return Column(
children: [
Text(
"Idx: $index",
label,
style: const TextStyle(color: Colors.white, fontSize: 10),
textAlign: TextAlign.center,
),
Expanded(
child: CustomPaint(