생성 때 고른 행성 형태·색 표시 · HOME 주간 정보
This commit is contained in:
@@ -35,7 +35,8 @@ class LivePlanet25D extends StatelessWidget {
|
||||
create: () => watch(fandomId),
|
||||
builder: (context, state) => Planet25D(
|
||||
key: ValueKey((fandomId, state != null)),
|
||||
image: image,
|
||||
// 생성 때 고른 형태가 있으면 그 그림, 없으면(성운 · 형태 없는 옛 행성) 화면이 준 그림.
|
||||
image: planetShapeImage(state?.planetType) ?? image,
|
||||
onOpenHistory: onOpenHistory,
|
||||
size: size,
|
||||
glow: glow,
|
||||
|
||||
@@ -59,6 +59,63 @@ Color? planetColorOf(String? key) =>
|
||||
_planetColorMaster.where((c) => c.$1 == key).firstOrNull?.$2 ??
|
||||
planetColors.where((c) => c.$1 == key).firstOrNull?.$2;
|
||||
|
||||
/// 생성 때 고른 형태(`planetType`, 서버 `PLANET_SHAPES`) → 형태 그림. 모르는 값 · 성운이면 null.
|
||||
///
|
||||
/// 그림은 Figma 「홈_성장 완료/행성 생성」(`344:214421`) 형태 칸이 쓰는 **행성 형태 시트 이미지
|
||||
/// (1536×1024 · 투명 배경 · 2행 5열)** 에서 칸과 같은 형태를 잘라 낸 것이다(2026-10-06 재추출).
|
||||
/// 칸 1~5 는 시트 1 · 2 · 3 · 4 · 10번째 형태다. 6번째 칸은 Figma 에서 「다음」 버튼에 가려
|
||||
/// 어떤 형태인지 보이지 않아 자리표시(1번과 같은 그림)를 둔다 — 해석 확인 요청 Q-A14.
|
||||
/// 시트 원본이 형태당 약 260px 라 큰 화면에서는 흐릴 수 있다(Admin 등록 이미지로 바뀌면 해소).
|
||||
String? planetShapeImage(String? planetType) {
|
||||
final n = int.tryParse(
|
||||
RegExp(r'^shape([1-6])$').firstMatch(planetType ?? '')?.group(1) ?? '',
|
||||
);
|
||||
if (n == null) return null;
|
||||
return n <= 5
|
||||
? 'assets/figma/planet-shape-$n.png'
|
||||
: 'assets/figma/planet-shape-placeholder.png';
|
||||
}
|
||||
|
||||
/// 정지 그림 — 형태 · 색을 입힌 행성(목록 카드 · MY). 형태가 없으면 [fallback] 그림 그대로다.
|
||||
/// 색은 [Planet25D] 와 같은 곱하기 합성이다.
|
||||
class PlanetArt extends StatelessWidget {
|
||||
const PlanetArt({
|
||||
super.key,
|
||||
required this.fallback,
|
||||
this.planetType,
|
||||
this.colorKey,
|
||||
this.width,
|
||||
this.height,
|
||||
this.semanticLabel,
|
||||
});
|
||||
|
||||
final String fallback;
|
||||
final String? planetType;
|
||||
final String? colorKey;
|
||||
final double? width;
|
||||
final double? height;
|
||||
final String? semanticLabel;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final shape = planetShapeImage(planetType);
|
||||
final image = Image.asset(
|
||||
shape ?? fallback,
|
||||
width: width,
|
||||
height: height,
|
||||
fit: BoxFit.contain,
|
||||
semanticLabel: semanticLabel,
|
||||
);
|
||||
final tint = shape == null ? null : planetColorOf(colorKey);
|
||||
return tint == null
|
||||
? image
|
||||
: ColorFiltered(
|
||||
colorFilter: ColorFilter.mode(tint, BlendMode.modulate),
|
||||
child: image,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Figma 본체에 UX/FX v1.5 §2의 Stage별 레이어를 조합한다.
|
||||
/// Stage는 서버 확정값이며, null은 단계 데이터 미제공 상태다.
|
||||
class Planet25D extends StatefulWidget {
|
||||
|
||||
Reference in New Issue
Block a user