feat(ui): Phase 8 UI/UX 개선 완료

- CombatLog 위젯 게임 화면에 통합
- HP/MP 바 추가 (HP < 20% 깜빡임 효과)
- SkillPanel 추가 (쿨타임 완료 시 glow 효과)
- combatLog 로컬라이제이션 (4개 언어)
- 테스트 수정 (skipOffstage 처리)
This commit is contained in:
JiWoong Sul
2025-12-17 18:52:24 +09:00
parent abcb89d334
commit 7c7f3b0d9e
13 changed files with 480 additions and 4 deletions

View File

@@ -10,7 +10,10 @@ import 'package:askiineverdie/src/core/notification/notification_service.dart';
import 'package:askiineverdie/src/core/util/pq_logic.dart' as pq_logic;
import 'package:askiineverdie/src/features/game/game_session_controller.dart';
import 'package:askiineverdie/src/features/game/widgets/cinematic_view.dart';
import 'package:askiineverdie/src/features/game/widgets/combat_log.dart';
import 'package:askiineverdie/src/features/game/widgets/hp_mp_bar.dart';
import 'package:askiineverdie/src/features/game/widgets/notification_overlay.dart';
import 'package:askiineverdie/src/features/game/widgets/skill_panel.dart';
import 'package:askiineverdie/src/features/game/widgets/stats_panel.dart';
import 'package:askiineverdie/src/features/game/widgets/task_progress_panel.dart';
@@ -38,16 +41,28 @@ class _GamePlayScreenState extends State<GamePlayScreen>
StoryAct _lastAct = StoryAct.prologue;
bool _showingCinematic = false;
// Phase 8: 전투 로그 (Combat Log)
final List<CombatLogEntry> _combatLogEntries = [];
String _lastTaskCaption = '';
// 이전 상태 추적 (레벨업/퀘스트/Act 완료 감지용)
int _lastLevel = 0;
int _lastQuestCount = 0;
int _lastPlotStageCount = 0;
void _checkSpecialEvents(GameState state) {
// Phase 8: 태스크 변경 시 로그 추가
final currentCaption = state.progress.currentTask.caption;
if (currentCaption.isNotEmpty && currentCaption != _lastTaskCaption) {
_addCombatLog(currentCaption, CombatLogType.normal);
_lastTaskCaption = currentCaption;
}
// 레벨업 감지
if (state.traits.level > _lastLevel && _lastLevel > 0) {
_specialAnimation = AsciiAnimationType.levelUp;
_notificationService.showLevelUp(state.traits.level);
_addCombatLog('Level Up! Now level ${state.traits.level}', CombatLogType.levelUp);
_resetSpecialAnimationAfterFrame();
// Phase 9: Act 변경 감지 (레벨 기반)
@@ -68,6 +83,7 @@ class _GamePlayScreenState extends State<GamePlayScreen>
.lastOrNull;
if (completedQuest != null) {
_notificationService.showQuestComplete(completedQuest.caption);
_addCombatLog('Quest Complete: ${completedQuest.caption}', CombatLogType.questComplete);
}
_resetSpecialAnimationAfterFrame();
}
@@ -83,6 +99,19 @@ class _GamePlayScreenState extends State<GamePlayScreen>
_lastPlotStageCount = state.progress.plotStageCount;
}
/// Phase 8: 전투 로그 추가 (Add Combat Log Entry)
void _addCombatLog(String message, CombatLogType type) {
_combatLogEntries.add(CombatLogEntry(
message: message,
timestamp: DateTime.now(),
type: type,
));
// 최대 50개 유지
if (_combatLogEntries.length > 50) {
_combatLogEntries.removeAt(0);
}
}
/// Phase 9: Act 시네마틱 표시 (Show Act Cinematic)
Future<void> _showCinematicForAct(StoryAct act) async {
if (_showingCinematic) return;
@@ -309,6 +338,14 @@ class _GamePlayScreenState extends State<GamePlayScreen>
_buildSectionHeader(l10n.stats),
Expanded(flex: 2, child: StatsPanel(stats: state.stats)),
// Phase 8: HP/MP 바 (사망 위험 시 깜빡임)
HpMpBar(
hpCurrent: state.stats.hp,
hpMax: state.stats.hpMax,
mpCurrent: state.stats.mp,
mpMax: state.stats.mpMax,
),
// Experience 바
_buildSectionHeader(l10n.experience),
_buildProgressBar(
@@ -323,6 +360,10 @@ class _GamePlayScreenState extends State<GamePlayScreen>
// Spell Book
_buildSectionHeader(l10n.spellBook),
Expanded(flex: 2, child: _buildSpellsList(state)),
// Phase 8: 스킬 (Skills with cooldown glow)
_buildSectionHeader('Skills'),
Expanded(flex: 2, child: SkillPanel(skillSystem: state.skillSystem)),
],
),
);
@@ -343,7 +384,7 @@ class _GamePlayScreenState extends State<GamePlayScreen>
// Inventory
_buildPanelHeader(l10n.inventory),
Expanded(flex: 3, child: _buildInventoryList(state)),
Expanded(flex: 2, child: _buildInventoryList(state)),
// Encumbrance 바
_buildSectionHeader(l10n.encumbrance),
@@ -352,6 +393,10 @@ class _GamePlayScreenState extends State<GamePlayScreen>
state.progress.encumbrance.max,
Colors.orange,
),
// Phase 8: 전투 로그 (Combat Log)
_buildPanelHeader(l10n.combatLog),
Expanded(flex: 2, child: CombatLog(entries: _combatLogEntries)),
],
),
);