feat(animation): ASCII 애니메이션 시스템 구현
- TaskType별 애니메이션 (전투, 마을, 걷기) - 몬스터 카테고리별 전투 애니메이션 (7종) - 특수 애니메이션 (레벨업, 퀘스트 완료, Act 완료) - 색상 테마 옵션 (green, amber, white, system) - 테마 설정 SharedPreferences 저장 - 프로그레스 바를 상단으로 이동
This commit is contained in:
24
lib/src/core/storage/theme_preferences.dart
Normal file
24
lib/src/core/storage/theme_preferences.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import 'package:askiineverdie/src/core/animation/ascii_animation_data.dart';
|
||||
|
||||
/// 테마 설정 저장/로드 서비스
|
||||
class ThemePreferences {
|
||||
static const _keyColorTheme = 'ascii_color_theme';
|
||||
|
||||
/// 테마 설정 저장
|
||||
static Future<void> saveColorTheme(AsciiColorTheme theme) async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setInt(_keyColorTheme, theme.index);
|
||||
}
|
||||
|
||||
/// 테마 설정 로드 (기본값: green)
|
||||
static Future<AsciiColorTheme> loadColorTheme() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
final index = prefs.getInt(_keyColorTheme);
|
||||
if (index == null || index < 0 || index >= AsciiColorTheme.values.length) {
|
||||
return AsciiColorTheme.green;
|
||||
}
|
||||
return AsciiColorTheme.values[index];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user