refactor(game): 게임 화면 및 위젯 정리

This commit is contained in:
JiWoong Sul
2026-01-12 16:17:20 +09:00
parent 104d23cdfd
commit cbbbbba1a5
13 changed files with 662 additions and 570 deletions

View File

@@ -70,20 +70,18 @@ class DeathOverlay extends StatelessWidget {
// 헤더 바
Container(
width: double.infinity,
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
padding: const EdgeInsets.symmetric(
horizontal: 12,
vertical: 8,
),
decoration: BoxDecoration(
color: hpColor.withValues(alpha: 0.3),
border: Border(
bottom: BorderSide(color: hpColor, width: 2),
),
border: Border(bottom: BorderSide(color: hpColor, width: 2)),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'',
style: TextStyle(fontSize: 16, color: hpColor),
),
Text('', style: TextStyle(fontSize: 16, color: hpColor)),
const SizedBox(width: 8),
Text(
'GAME OVER',
@@ -95,10 +93,7 @@ class DeathOverlay extends StatelessWidget {
),
),
const SizedBox(width: 8),
Text(
'',
style: TextStyle(fontSize: 16, color: hpColor),
),
Text('', style: TextStyle(fontSize: 16, color: hpColor)),
],
),
),
@@ -107,49 +102,49 @@ class DeathOverlay extends StatelessWidget {
child: SingleChildScrollView(
padding: const EdgeInsets.all(16),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
// 사망 타이틀
_buildDeathTitle(context),
const SizedBox(height: 16),
// 캐릭터 정보
_buildCharacterInfo(context),
const SizedBox(height: 16),
// 사망 원인
_buildDeathCause(context),
const SizedBox(height: 20),
// 구분선
_buildRetroDivider(hpColor, hpDark),
const SizedBox(height: 16),
// 상실 정보
_buildLossInfo(context),
// 전투 로그 (있는 경우만 표시)
if (deathInfo.lastCombatEvents.isNotEmpty) ...[
mainAxisSize: MainAxisSize.min,
children: [
// 사망 타이틀
_buildDeathTitle(context),
const SizedBox(height: 16),
// 캐릭터 정보
_buildCharacterInfo(context),
const SizedBox(height: 16),
// 사망 원인
_buildDeathCause(context),
const SizedBox(height: 20),
// 구분선
_buildRetroDivider(hpColor, hpDark),
const SizedBox(height: 8),
_buildCombatLog(context),
const SizedBox(height: 16),
// 상실 정보
_buildLossInfo(context),
// 전투 로그 (있는 경우만 표시)
if (deathInfo.lastCombatEvents.isNotEmpty) ...[
const SizedBox(height: 16),
_buildRetroDivider(hpColor, hpDark),
const SizedBox(height: 8),
_buildCombatLog(context),
],
const SizedBox(height: 24),
// 부활 버튼
_buildResurrectButton(context),
// 자동 부활 버튼
if (onToggleAutoResurrect != null) ...[
const SizedBox(height: 12),
_buildAutoResurrectButton(context),
],
],
const SizedBox(height: 24),
// 부활 버튼
_buildResurrectButton(context),
// 자동 부활 버튼
if (onToggleAutoResurrect != null) ...[
const SizedBox(height: 12),
_buildAutoResurrectButton(context),
],
],
),
),
),
),
],
),
),
@@ -264,10 +259,7 @@ class DeathOverlay extends StatelessWidget {
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
'',
style: TextStyle(fontSize: 14, color: hpColor),
),
Text('', style: TextStyle(fontSize: 14, color: hpColor)),
const SizedBox(width: 8),
Flexible(
child: Text(
@@ -309,16 +301,11 @@ class DeathOverlay extends StatelessWidget {
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
color: hpDark.withValues(alpha: 0.2),
border: Border.all(
color: hpColor.withValues(alpha: 0.4),
),
border: Border.all(color: hpColor.withValues(alpha: 0.4)),
),
child: Row(
children: [
const Text(
'🔥',
style: TextStyle(fontSize: 16),
),
const Text('🔥', style: TextStyle(fontSize: 16)),
const SizedBox(width: 8),
Expanded(
child: Column(
@@ -383,10 +370,7 @@ class DeathOverlay extends StatelessWidget {
children: [
Row(
children: [
Text(
asciiIcon,
style: TextStyle(fontSize: 14, color: valueColor),
),
Text(asciiIcon, style: TextStyle(fontSize: 14, color: valueColor)),
const SizedBox(width: 8),
Text(
label,
@@ -433,14 +417,8 @@ class DeathOverlay extends StatelessWidget {
border: Border(
top: BorderSide(color: expColor, width: 3),
left: BorderSide(color: expColor, width: 3),
bottom: BorderSide(
color: expDark.withValues(alpha: 0.8),
width: 3,
),
right: BorderSide(
color: expDark.withValues(alpha: 0.8),
width: 3,
),
bottom: BorderSide(color: expDark.withValues(alpha: 0.8), width: 3),
right: BorderSide(color: expDark.withValues(alpha: 0.8), width: 3),
),
),
child: Row(
@@ -478,7 +456,9 @@ class DeathOverlay extends StatelessWidget {
// 활성화 상태에 따른 색상
final buttonColor = isAutoResurrectEnabled ? mpColor : muted;
final buttonDark = isAutoResurrectEnabled ? mpDark : muted.withValues(alpha: 0.5);
final buttonDark = isAutoResurrectEnabled
? mpDark
: muted.withValues(alpha: 0.5);
return GestureDetector(
onTap: onToggleAutoResurrect,
@@ -551,10 +531,7 @@ class DeathOverlay extends StatelessWidget {
children: [
Row(
children: [
const Text(
'📜',
style: TextStyle(fontSize: 12),
),
const Text('📜', style: TextStyle(fontSize: 12)),
const SizedBox(width: 6),
Text(
l10n.deathCombatLog.toUpperCase(),
@@ -595,10 +572,7 @@ class DeathOverlay extends StatelessWidget {
padding: const EdgeInsets.symmetric(vertical: 1),
child: Row(
children: [
Text(
asciiIcon,
style: TextStyle(fontSize: 10, color: color),
),
Text(asciiIcon, style: TextStyle(fontSize: 10, color: color)),
const SizedBox(width: 4),
Expanded(
child: Text(