Working on fixing enemy identification
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user