생성 때 고른 행성 형태·색 표시 · HOME 주간 정보
This commit is contained in:
@@ -19,6 +19,7 @@ class PlanetNode {
|
||||
this.isMine = false,
|
||||
this.stage,
|
||||
this.colorKey,
|
||||
this.planetType,
|
||||
bool? isCenter,
|
||||
bool? ranked,
|
||||
}) : isCenter = isCenter ?? isMine,
|
||||
@@ -34,6 +35,9 @@ class PlanetNode {
|
||||
/// 팬덤 `colorKey`(행성 색 팔레트 `planetColors` 의 키). 미제공이면 null.
|
||||
final String? colorKey;
|
||||
|
||||
/// 팬덤 `planetType`(생성 때 고른 형태). 미제공이면 null.
|
||||
final String? planetType;
|
||||
|
||||
final String name;
|
||||
|
||||
/// 갤럭시 전체 순위. HUD 의 `Rank`.
|
||||
@@ -140,6 +144,7 @@ class GalaxySnapshot {
|
||||
isMine: p.isMine,
|
||||
stage: p.stage,
|
||||
colorKey: p.colorKey,
|
||||
planetType: p.planetType,
|
||||
ranked: p.ranked,
|
||||
isCenter: identical(p, top),
|
||||
),
|
||||
|
||||
@@ -4,6 +4,7 @@ import '../../core/data/planet_visual_state.dart';
|
||||
import '../../core/theme/tokens.dart';
|
||||
import '../../core/ui/app_dialog.dart';
|
||||
import '../../core/ui/app_icons.dart';
|
||||
import '../../core/ui/planet_25d.dart' show PlanetArt;
|
||||
import '../notification/notification_screen.dart';
|
||||
import '../eclipse/eclipse_data.dart';
|
||||
import '../eclipse/widgets/eclipse_banner.dart';
|
||||
@@ -29,8 +30,8 @@ class GalaxyHomeScreen extends StatefulWidget {
|
||||
/// 카드 그림 — HOME · 맵과 같이 팬덤 `stage` 로 고른다. Stage0 성운만 성운 그림이고
|
||||
/// 정식 행성은 시안 행성 그림(`image 8` · 파란 행성 벡터)을 칸마다 번갈아 쓴다.
|
||||
/// 예전엔 칸 순서로 골라 둘째 칸이 행성이어도 성운 그림이 됐다.
|
||||
// ponytail: 행성마다 고정된 두 그림 중 하나(id 기준) — 칸 순서가 바뀌어도 같은 그림.
|
||||
// 탄생 때 고른 모양 · 색 에셋은 최신 Figma 행성 에셋 교체(10/8)에서 연결한다.
|
||||
// ponytail: 형태가 없는 행성(옛 데이터)만 고정된 두 그림 중 하나(id 기준). 형태가 있으면
|
||||
// 카드가 [PlanetArt] 로 생성 때 고른 형태 · 색을 그린다.
|
||||
static String cardImageOf(PlanetNode p, [int _ = 0]) => p.stage == 0
|
||||
? 'assets/figma/nebula-card.png'
|
||||
: (p.id.codeUnits.fold<int>(0, (a, c) => a + c).isEven
|
||||
@@ -349,9 +350,10 @@ class _PlanetCard extends StatelessWidget {
|
||||
Positioned.fill(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(11, 10, 10, 11),
|
||||
child: Image.asset(
|
||||
image,
|
||||
fit: BoxFit.contain,
|
||||
child: PlanetArt(
|
||||
fallback: image,
|
||||
planetType: planet.stage == 0 ? null : planet.planetType,
|
||||
colorKey: planet.colorKey,
|
||||
semanticLabel: planet.name,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -152,6 +152,7 @@ class FirestoreGalaxyRepository implements GalaxyRepository {
|
||||
_ => null,
|
||||
},
|
||||
colorKey: data['colorKey'] is String ? data['colorKey'] as String : null,
|
||||
planetType: data['planetType'] is String ? data['planetType'] as String : null,
|
||||
name: data.strOr('name', id),
|
||||
rank: rank,
|
||||
fpi: data.intOr('fpiScore'),
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../core/theme/tokens.dart';
|
||||
import '../../../core/ui/live_planet.dart';
|
||||
import '../../../core/ui/planet_25d.dart' show planetShapeImage;
|
||||
import '../../../core/data/planet_visual_state.dart';
|
||||
import '../galaxy_data.dart';
|
||||
import '../galaxy_motion.dart';
|
||||
@@ -133,12 +134,15 @@ class GalaxyField extends StatelessWidget {
|
||||
return radiusOf(p) * depthScaleOf(at);
|
||||
}
|
||||
|
||||
/// 행성 일러스트. 내 행성은 홈과 같은 그림, 나머지는 시안 행성 2종을 돌려 쓴다.
|
||||
static String imageOf(PlanetNode p, int index) => p.isMine
|
||||
? 'assets/figma/planet-home.png'
|
||||
: (index.isEven
|
||||
? 'assets/figma/planet-1.png'
|
||||
: 'assets/figma/planet-2.png');
|
||||
/// 행성 일러스트 — 생성 때 고른 형태([planetShapeImage]). 형태가 없는 행성(성운 · 옛 데이터)만
|
||||
/// 내 행성은 홈과 같은 그림, 나머지는 시안 행성 2종을 돌려 쓴다. 색은 [LivePlanet25D] 가 입힌다.
|
||||
static String imageOf(PlanetNode p, int index) =>
|
||||
planetShapeImage(p.planetType) ??
|
||||
(p.isMine
|
||||
? 'assets/figma/planet-home.png'
|
||||
: (index.isEven
|
||||
? 'assets/figma/planet-1.png'
|
||||
: 'assets/figma/planet-2.png'));
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
Reference in New Issue
Block a user