From eb71d2a199182495fe524adc8ffbfd4cfb55a22d Mon Sep 17 00:00:00 2001 From: JiWoong Sul Date: Sun, 21 Dec 2025 11:54:06 +0900 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=EB=AA=AC=EC=8A=A4=ED=84=B0=20HP=20?= =?UTF-8?q?=EB=B0=94=20=EA=B3=B5=EA=B0=84=20=EC=A0=9C=EC=95=BD=20=EB=8C=80?= =?UTF-8?q?=EC=9D=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 아이콘/이름 제거하고 HP 바 + 퍼센트만 표시 - 좁은 공간에서도 오버플로우 발생하지 않음 --- lib/src/features/game/widgets/hp_mp_bar.dart | 40 +++----------------- 1 file changed, 6 insertions(+), 34 deletions(-) diff --git a/lib/src/features/game/widgets/hp_mp_bar.dart b/lib/src/features/game/widgets/hp_mp_bar.dart index 361d8b4..daf2a31 100644 --- a/lib/src/features/game/widgets/hp_mp_bar.dart +++ b/lib/src/features/game/widgets/hp_mp_bar.dart @@ -307,10 +307,8 @@ class _HpMpBarState extends State with TickerProviderStateMixin { /// 몬스터 HP 바 Widget _buildMonsterBar() { - final current = widget.monsterHpCurrent!; final max = widget.monsterHpMax!; - final ratio = max > 0 ? current / max : 0.0; - final name = widget.monsterName ?? 'Enemy'; + final ratio = max > 0 ? widget.monsterHpCurrent! / max : 0.0; return AnimatedBuilder( animation: _monsterFlashAnimation, @@ -332,30 +330,9 @@ class _HpMpBarState extends State with TickerProviderStateMixin { child: Stack( clipBehavior: Clip.none, children: [ + // HP 바만 표시 (공간 제약으로 아이콘/이름 생략) Row( children: [ - // 몬스터 아이콘 - const Icon(Icons.pest_control, size: 14, color: Colors.orange), - const SizedBox(width: 4), - - // 이름 (Flexible로 공간 부족 시 축소) - Flexible( - flex: 0, - child: ConstrainedBox( - constraints: const BoxConstraints(maxWidth: 50), - child: Text( - name.length > 8 ? '${name.substring(0, 6)}...' : name, - style: const TextStyle( - fontSize: 9, - fontWeight: FontWeight.bold, - color: Colors.orange, - ), - overflow: TextOverflow.ellipsis, - ), - ), - ), - const SizedBox(width: 4), - // HP 바 Expanded( child: ClipRRect( @@ -370,15 +347,10 @@ class _HpMpBarState extends State with TickerProviderStateMixin { ), ), const SizedBox(width: 4), - - // HP 숫자 (Flexible로 오버플로우 방지) - Flexible( - child: Text( - '$current/$max', - style: const TextStyle(fontSize: 8, color: Colors.orange), - textAlign: TextAlign.right, - overflow: TextOverflow.ellipsis, - ), + // HP 퍼센트 + Text( + '${(ratio * 100).toInt()}%', + style: const TextStyle(fontSize: 8, color: Colors.orange), ), ], ),