feat(nav): 프론트 화면에 아레나 버튼 추가

- 아레나 화면 네비게이션 연결
- 프론트 화면 UI에 아레나 접근 버튼 추가
This commit is contained in:
JiWoong Sul
2026-01-06 17:55:12 +09:00
parent 687d04974e
commit 8cd09b9f86
2 changed files with 59 additions and 0 deletions

View File

@@ -16,8 +16,10 @@ class FrontScreen extends StatelessWidget {
this.onNewCharacter,
this.onLoadSave,
this.onHallOfFame,
this.onLocalArena,
this.hasSaveFile = false,
this.savedGamePreview,
this.hallOfFameCount = 0,
});
/// "New character" 버튼 클릭 시 호출
@@ -29,12 +31,18 @@ class FrontScreen extends StatelessWidget {
/// "Hall of Fame" 버튼 클릭 시 호출
final void Function(BuildContext context)? onHallOfFame;
/// "Local Arena" 버튼 클릭 시 호출
final void Function(BuildContext context)? onLocalArena;
/// 세이브 파일 존재 여부 (새 캐릭터 시 경고용)
final bool hasSaveFile;
/// 저장된 게임 미리보기 정보
final SavedGamePreview? savedGamePreview;
/// 명예의 전당 캐릭터 수 (아레나 활성화 조건: 2명 이상)
final int hallOfFameCount;
/// 새 캐릭터 생성 시 세이브 파일 존재하면 경고 표시
void _handleNewCharacter(BuildContext context) {
if (hasSaveFile) {
@@ -99,7 +107,12 @@ class FrontScreen extends StatelessWidget {
onHallOfFame: onHallOfFame != null
? () => onHallOfFame!(context)
: null,
onLocalArena: onLocalArena != null &&
hallOfFameCount >= 2
? () => onLocalArena!(context)
: null,
savedGamePreview: savedGamePreview,
hallOfFameCount: hallOfFameCount,
),
],
),
@@ -199,13 +212,17 @@ class _ActionButtons extends StatelessWidget {
this.onNewCharacter,
this.onLoadSave,
this.onHallOfFame,
this.onLocalArena,
this.savedGamePreview,
this.hallOfFameCount = 0,
});
final VoidCallback? onNewCharacter;
final VoidCallback? onLoadSave;
final VoidCallback? onHallOfFame;
final VoidCallback? onLocalArena;
final SavedGamePreview? savedGamePreview;
final int hallOfFameCount;
@override
Widget build(BuildContext context) {
@@ -245,6 +262,16 @@ class _ActionButtons extends StatelessWidget {
onPressed: onHallOfFame,
isPrimary: false,
),
// 로컬 아레나 (2명 이상일 때만 활성화)
if (hallOfFameCount >= 2) ...[
const SizedBox(height: 12),
RetroTextButton(
text: game_l10n.uiLocalArena,
icon: Icons.sports_kabaddi,
onPressed: onLocalArena,
isPrimary: false,
),
],
],
),
);