feat(ui): 게임 화면 및 설정 화면 개선

- GamePlayScreen 개선
- GameSessionController 확장
- MobileCarouselLayout 기능 추가
- SettingsScreen 테스트 기능 추가
This commit is contained in:
JiWoong Sul
2026-01-12 20:02:54 +09:00
parent 12f195bed7
commit 1d855b64a2
5 changed files with 275 additions and 32 deletions

View File

@@ -1,3 +1,4 @@
import 'package:flutter/foundation.dart' show kDebugMode;
import 'package:flutter/material.dart';
import 'package:asciineverdie/src/core/notification/notification_service.dart';
@@ -50,6 +51,7 @@ class MobileCarouselLayout extends StatefulWidget {
this.onCheatTask,
this.onCheatQuest,
this.onCheatPlot,
this.onCreateTestCharacter,
});
final GameState state;
@@ -97,6 +99,9 @@ class MobileCarouselLayout extends StatefulWidget {
/// 치트: 액트(플롯) 완료
final VoidCallback? onCheatPlot;
/// 테스트 캐릭터 생성 콜백 (디버그 모드 전용)
final Future<void> Function()? onCreateTestCharacter;
@override
State<MobileCarouselLayout> createState() => _MobileCarouselLayoutState();
}
@@ -364,6 +369,39 @@ class _MobileCarouselLayoutState extends State<MobileCarouselLayout> {
);
}
/// 테스트 캐릭터 생성 확인 다이얼로그
Future<void> _showTestCharacterDialog(BuildContext context) async {
final confirmed = await showDialog<bool>(
context: context,
builder: (context) => AlertDialog(
title: const Text('Create Test Character?'),
content: const Text(
'현재 캐릭터가 레벨 100으로 변환되어 명예의 전당에 등록됩니다.\n\n'
'⚠️ 현재 세이브 파일이 삭제됩니다.\n'
'이 작업은 되돌릴 수 없습니다.',
),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(false),
child: const Text('Cancel'),
),
ElevatedButton(
onPressed: () => Navigator.of(context).pop(true),
style: ElevatedButton.styleFrom(
backgroundColor: Theme.of(context).colorScheme.error,
foregroundColor: Theme.of(context).colorScheme.onError,
),
child: const Text('Create'),
),
],
),
);
if (confirmed == true && mounted) {
await widget.onCreateTestCharacter?.call();
}
}
/// 옵션 메뉴 표시
void _showOptionsMenu(BuildContext context) {
final localizations = L10n.of(context);
@@ -609,6 +647,34 @@ class _MobileCarouselLayoutState extends State<MobileCarouselLayout> {
),
],
// 디버그 도구 섹션 (kDebugMode에서만 표시)
if (kDebugMode && widget.onCreateTestCharacter != null) ...[
const Divider(),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 8,
),
child: Text(
'DEBUG TOOLS',
style: TextStyle(
fontFamily: 'PressStart2P',
fontSize: 8,
color: Colors.orange.shade300,
),
),
),
ListTile(
leading: const Icon(Icons.science, color: Colors.orange),
title: const Text('Create Test Character'),
subtitle: const Text('레벨 100 캐릭터를 명예의 전당에 등록'),
onTap: () {
Navigator.pop(context);
_showTestCharacterDialog(context);
},
),
],
const SizedBox(height: 8),
],
),