입양 모달·고양이 카드에 실제 스프라이트 사용
- catSprite(breed, frame) 헬퍼 + CAT_SPRITE_DIR 품종별 폴더 매핑 준비 - 모달 후보는 idle 스프라이트(h-20), 카드 헤더는 미니 아바타(h-7) - 품종 시트가 들어오면 CAT_SPRITE_DIR 등록만으로 확장 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
이 커밋은 다음에 포함됨:
@@ -7,6 +7,7 @@ import { engine, effectiveRate, activeRecipe, fullnessPenalty } from "@/lib/game
|
|||||||
import {
|
import {
|
||||||
APTITUDE_LABEL,
|
APTITUDE_LABEL,
|
||||||
BREEDS,
|
BREEDS,
|
||||||
|
catSprite,
|
||||||
HALL_LEVELS,
|
HALL_LEVELS,
|
||||||
KITCHEN_BUILD_COST,
|
KITCHEN_BUILD_COST,
|
||||||
KITCHEN_MEAL_CAP,
|
KITCHEN_MEAL_CAP,
|
||||||
@@ -176,7 +177,12 @@ function AdoptModal({
|
|||||||
className="flex flex-col rounded-xl border border-gray-200 p-4 dark:border-gray-700"
|
className="flex flex-col rounded-xl border border-gray-200 p-4 dark:border-gray-700"
|
||||||
>
|
>
|
||||||
<div className="mb-2 text-center">
|
<div className="mb-2 text-center">
|
||||||
<div className="text-4xl">{cat.emoji}</div>
|
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||||
|
<img
|
||||||
|
src={catSprite(cat.breed, "idle")}
|
||||||
|
alt={cat.name}
|
||||||
|
className="mx-auto h-20 w-auto object-contain drop-shadow-sm"
|
||||||
|
/>
|
||||||
<div className="mt-1 font-bold">{cat.name}</div>
|
<div className="mt-1 font-bold">{cat.name}</div>
|
||||||
<div className="text-xs text-gray-400">
|
<div className="text-xs text-gray-400">
|
||||||
{cat.breedName}{" "}
|
{cat.breedName}{" "}
|
||||||
@@ -430,8 +436,14 @@ function CatCard({
|
|||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div className="mb-1 flex items-center justify-between">
|
<div className="mb-1 flex items-center justify-between">
|
||||||
<span className="font-semibold">
|
<span className="flex items-center gap-1.5 font-semibold">
|
||||||
{cat.emoji} {cat.name}{" "}
|
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||||
|
<img
|
||||||
|
src={catSprite(cat.breed, "idle")}
|
||||||
|
alt=""
|
||||||
|
className="h-7 w-7 object-contain"
|
||||||
|
/>
|
||||||
|
{cat.name}{" "}
|
||||||
<span className="text-xs font-normal text-gray-400">Lv{cat.level}</span>
|
<span className="text-xs font-normal text-gray-400">Lv{cat.level}</span>
|
||||||
</span>
|
</span>
|
||||||
<span className="text-xs text-gray-400">{cat.breedName}</span>
|
<span className="text-xs text-gray-400">{cat.breedName}</span>
|
||||||
|
|||||||
@@ -4,6 +4,18 @@ import type { AptitudeKey } from "./types";
|
|||||||
export const APTITUDE_RATE = [0, 1.0, 2.2, 4.8, 10.0, 21.0, 45.0];
|
export const APTITUDE_RATE = [0, 1.0, 2.2, 4.8, 10.0, 21.0, 45.0];
|
||||||
export const BASE_RATE = 0.2;
|
export const BASE_RATE = 0.2;
|
||||||
|
|
||||||
|
// 품종별 스프라이트 폴더 (public/assets/cats/{폴더}/). 미등록 품종은 기본(오렌지 태비) 사용
|
||||||
|
export const CAT_SPRITE_DIR: Record<string, string> = {
|
||||||
|
// 예: korean_shorthair: "korean_shorthair", ← 품종 시트가 준비되면 등록
|
||||||
|
};
|
||||||
|
|
||||||
|
export type CatFrame = "idle" | "walk1" | "walk2" | "work";
|
||||||
|
|
||||||
|
export function catSprite(breed: string, frame: CatFrame): string {
|
||||||
|
const dir = CAT_SPRITE_DIR[breed];
|
||||||
|
return dir ? `/assets/cats/${dir}/${frame}.png` : `/assets/cats/${frame}.png`;
|
||||||
|
}
|
||||||
|
|
||||||
// 적성별 도구 일러스트 (public/assets/tools/)
|
// 적성별 도구 일러스트 (public/assets/tools/)
|
||||||
export const TOOL_IMG: Record<AptitudeKey, string> = {
|
export const TOOL_IMG: Record<AptitudeKey, string> = {
|
||||||
fishing: "/assets/tools/fishing.png",
|
fishing: "/assets/tools/fishing.png",
|
||||||
|
|||||||
새 이슈에서 참조
사용자 차단