Rename shop items to plain sprite labels and improve thumbnail visibility.
Use code-side display names in the shop UI so labels stay correct even when DB rows lag, and add a neutral thumbnail glow so dark colors remain visible.
This commit is contained in:
@@ -61,25 +61,25 @@ function presetFromHex(id: string, name: string, hex: string): ColorPreset {
|
||||
|
||||
export const VARIANT_DISPLAY_NAMES: Record<string, string> = {
|
||||
"skin-1": "Default Form",
|
||||
"pants-1": "Slim Fit Jeans",
|
||||
"pants-2": "Rolled Cuff Shorts",
|
||||
"pants-3": "Pleated Skirt",
|
||||
"shoes-1": "Canvas Sneakers",
|
||||
"shoes-2": "Chunky High-Tops",
|
||||
"shoes-3": "Neon Glow Runners",
|
||||
"torso-1": "Crew Neck Tee",
|
||||
"torso-2": "Zip-Up Hoodie",
|
||||
"torso-3": "Button-Up Shirt",
|
||||
"torso-4": "Crimson Blouse",
|
||||
"eyes-1": "Round Gentle Eyes",
|
||||
"eyes-2": "Starry Spark Eyes",
|
||||
"head-1": "Spiked Mohawk",
|
||||
"head-2": "Cozy Knit Beanie",
|
||||
"head-3": "Retro Snapback Cap",
|
||||
"head-4": "Long Hair",
|
||||
"head-5": "Shoulder-Length Hair",
|
||||
"head-6": "Flowing Side Locks",
|
||||
"head-7": "Messy Shag Cut",
|
||||
"pants-1": "Shorts",
|
||||
"pants-2": "Pants",
|
||||
"pants-3": "Skirt",
|
||||
"shoes-1": "Boots",
|
||||
"shoes-2": "Shoes",
|
||||
"shoes-3": "Loafers",
|
||||
"torso-1": "T-Shirt",
|
||||
"torso-2": "Button-up",
|
||||
"torso-3": "Vest",
|
||||
"torso-4": "Robe",
|
||||
"eyes-1": "Eyes",
|
||||
"eyes-2": "Eyelashes",
|
||||
"head-1": "Short",
|
||||
"head-2": "Short-medium",
|
||||
"head-3": "Mohawk",
|
||||
"head-4": "Long",
|
||||
"head-5": "Pixie",
|
||||
"head-6": "Middle-part",
|
||||
"head-7": "Bun",
|
||||
};
|
||||
|
||||
export function getVariantDisplayName(variantId: string, fallbackLabel = variantId) {
|
||||
|
||||
@@ -19,25 +19,25 @@ export const ROOM_SCENE_IMAGE_PATH = (id: RoomBackgroundId) =>
|
||||
export const ROOM_BACKGROUNDS: RoomBackground[] = [
|
||||
{
|
||||
id: "room-1",
|
||||
name: "Sunny Field",
|
||||
name: "Plains",
|
||||
free: true,
|
||||
sceneImage: ROOM_SCENE_IMAGE_PATH("room-1"),
|
||||
},
|
||||
{
|
||||
id: "room-2",
|
||||
name: "Golden Dusk",
|
||||
name: "Sunset",
|
||||
free: true,
|
||||
sceneImage: ROOM_SCENE_IMAGE_PATH("room-2"),
|
||||
},
|
||||
{
|
||||
id: "room-3",
|
||||
name: "Starlit Night",
|
||||
name: "Forest",
|
||||
free: false,
|
||||
sceneImage: ROOM_SCENE_IMAGE_PATH("room-3"),
|
||||
},
|
||||
{
|
||||
id: "room-4",
|
||||
name: "Mystic Forest",
|
||||
name: "Night",
|
||||
free: false,
|
||||
sceneImage: ROOM_SCENE_IMAGE_PATH("room-4"),
|
||||
},
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
import { isShopOnlyStyleVariant } from "@/lib/character/variant-access";
|
||||
import type { CharacterLayerId } from "@/lib/character/presets";
|
||||
import { CHARACTER_LAYERS, NONE_VARIANT_ID } from "@/lib/character/presets";
|
||||
import { getShopRoomBackgrounds } from "@/lib/room-backgrounds";
|
||||
import {
|
||||
CHARACTER_LAYERS,
|
||||
getVariantDisplayName,
|
||||
NONE_VARIANT_ID,
|
||||
} from "@/lib/character/presets";
|
||||
import { getRoomBackground, getShopRoomBackgrounds } from "@/lib/room-backgrounds";
|
||||
|
||||
export type ShopLayerId = Exclude<CharacterLayerId, "skin">;
|
||||
|
||||
@@ -95,6 +99,14 @@ export function getLayerLabel(layerId: ShopLayerId) {
|
||||
return CHARACTER_LAYERS.find((layer) => layer.id === layerId)?.label ?? layerId;
|
||||
}
|
||||
|
||||
export function getShopItemDisplayName(item: ShopItemRecord): string {
|
||||
if (item.type === "room") {
|
||||
return getRoomBackground(item.id).name;
|
||||
}
|
||||
|
||||
return getVariantDisplayName(item.id, item.name);
|
||||
}
|
||||
|
||||
export function findShopItemById(
|
||||
items: readonly ShopItemRecord[],
|
||||
itemId: string,
|
||||
|
||||
Reference in New Issue
Block a user