|
|
@@ -19,7 +19,6 @@ import {
|
|
|
purchaseChatbotShopItem,
|
|
|
type ChatbotLayoutBackdrop,
|
|
|
type ChatbotLayoutItem,
|
|
|
- type ChatbotBackdropSlot,
|
|
|
type ChatbotShopCatalogItem,
|
|
|
type ChatbotShopCartLine,
|
|
|
unequipChatbotFurniture,
|
|
|
@@ -82,16 +81,6 @@ const CHATBOT_Z_INDEX = {
|
|
|
GRID_LINES: 1,
|
|
|
GRID_DYNAMIC_MIN: 3,
|
|
|
} as const;
|
|
|
-const SLOT_HIGHLIGHT_COLORS = [
|
|
|
- '#00FF62',
|
|
|
- '#FFB020',
|
|
|
- '#4DA3FF',
|
|
|
- '#FF5FA2',
|
|
|
- '#A56BFF',
|
|
|
- '#00D1FF',
|
|
|
- '#FFD60A',
|
|
|
- '#FF6B6B',
|
|
|
-] as const;
|
|
|
|
|
|
type FurnitureActionModalMode = 'equip' | 'remove';
|
|
|
|
|
|
@@ -183,7 +172,6 @@ export const LumiShopPage = () => {
|
|
|
/** 首次拉取布局完成前不渲染默认幕布 init3,避免与真实幕布切换时产生「窗户闪一下」 */
|
|
|
const [chatbotLayoutReady, setChatbotLayoutReady] = useState(false);
|
|
|
const [chatbotLayoutItems, setChatbotLayoutItems] = useState<ChatbotLayoutItem[]>([]);
|
|
|
- const [chatbotBackdropSlots, setChatbotBackdropSlots] = useState<ChatbotBackdropSlot[]>([]);
|
|
|
const [furnitureNotice, setFurnitureNotice] = useState<string>('');
|
|
|
const [activePurchaseItem, setActivePurchaseItem] = useState<ChatbotShopCatalogItem | null>(null);
|
|
|
const [purchaseSuccessItem, setPurchaseSuccessItem] = useState<ChatbotShopCatalogItem | null>(null);
|
|
|
@@ -263,7 +251,6 @@ export const LumiShopPage = () => {
|
|
|
if (!res.success || !res.data) return;
|
|
|
setChatbotBackdrop(res.data.backdrop ?? null);
|
|
|
setChatbotLayoutItems(res.data.items ?? []);
|
|
|
- setChatbotBackdropSlots(res.data.slots ?? []);
|
|
|
setChatbotGrid({
|
|
|
grid_rows: res.data.grid_rows,
|
|
|
grid_cols: res.data.grid_cols,
|
|
|
@@ -290,7 +277,6 @@ export const LumiShopPage = () => {
|
|
|
if (!mounted) return;
|
|
|
setChatbotBackdrop(null);
|
|
|
setChatbotLayoutItems([]);
|
|
|
- setChatbotBackdropSlots([]);
|
|
|
});
|
|
|
return () => {
|
|
|
mounted = false;
|
|
|
@@ -307,7 +293,6 @@ export const LumiShopPage = () => {
|
|
|
const activeLayoutItems = chatbotLayoutItems;
|
|
|
const cellWidth = chatbotGrid.cell_width ?? 96;
|
|
|
const cellHeight = chatbotGrid.cell_height ?? 96;
|
|
|
- const gridRows = chatbotGrid.grid_rows ?? 5;
|
|
|
const gridCols = chatbotGrid.grid_cols ?? 4;
|
|
|
const gridOriginY = 0;
|
|
|
/** 5×4 区整体在幕布层水平居中,槽位坐标相对网格左上角 */
|
|
|
@@ -729,54 +714,6 @@ export const LumiShopPage = () => {
|
|
|
zIndex: 1,
|
|
|
}}
|
|
|
>
|
|
|
- {lumiBagTab === 'furniture' && (
|
|
|
- <div
|
|
|
- className="absolute pointer-events-none"
|
|
|
- style={{
|
|
|
- left: px2vmin(gridOriginX),
|
|
|
- top: px2vmin(gridOriginY),
|
|
|
- width: px2vmin(gridCols * cellWidth),
|
|
|
- height: px2vmin(gridRows * cellHeight),
|
|
|
- zIndex: CHATBOT_Z_INDEX.GRID_LINES,
|
|
|
- border: '1px solid rgba(255, 255, 255, 0.35)',
|
|
|
- boxSizing: 'border-box',
|
|
|
- }}
|
|
|
- >
|
|
|
- {Array.from({ length: gridCols - 1 }, (_, idx) => {
|
|
|
- const col = idx + 1;
|
|
|
- return (
|
|
|
- <div
|
|
|
- key={col}
|
|
|
- style={{
|
|
|
- position: 'absolute',
|
|
|
- top: 0,
|
|
|
- left: px2vmin(col * cellWidth),
|
|
|
- width: 1,
|
|
|
- height: '100%',
|
|
|
- backgroundColor: 'rgba(255, 255, 255, 0.35)',
|
|
|
- }}
|
|
|
- />
|
|
|
- );
|
|
|
- })}
|
|
|
- {Array.from({ length: gridRows - 1 }, (_, idx) => {
|
|
|
- const row = idx + 1;
|
|
|
- return (
|
|
|
- <div
|
|
|
- key={row}
|
|
|
- style={{
|
|
|
- position: 'absolute',
|
|
|
- left: 0,
|
|
|
- top: px2vmin(row * cellHeight),
|
|
|
- height: 1,
|
|
|
- width: '100%',
|
|
|
- backgroundColor: 'rgba(255, 255, 255, 0.35)',
|
|
|
- }}
|
|
|
- />
|
|
|
- );
|
|
|
- })}
|
|
|
- </div>
|
|
|
- )}
|
|
|
-
|
|
|
{activeLayoutItems.map((item, idx) => {
|
|
|
const slotLeftPx = gridOriginX + (item.start_col - 1) * cellWidth;
|
|
|
const slotTopPx = gridOriginY + (item.start_row - 1) * cellHeight;
|
|
|
@@ -810,37 +747,6 @@ export const LumiShopPage = () => {
|
|
|
/>
|
|
|
);
|
|
|
})}
|
|
|
-
|
|
|
- {lumiBagTab === 'furniture' &&
|
|
|
- chatbotBackdropSlots.map((slot, idx) => {
|
|
|
- const slotLeftPx = gridOriginX + (slot.start_col - 1) * cellWidth;
|
|
|
- const slotTopPx = gridOriginY + (slot.start_row - 1) * cellHeight;
|
|
|
- const slotWidthPx = slot.size_cols * cellWidth;
|
|
|
- const slotHeightPx = slot.size_rows * cellHeight;
|
|
|
- const isPixelSlot = slot.render_mode === 'pixel';
|
|
|
- const offsetX = slot.offset_x ?? 0;
|
|
|
- const offsetY = slot.offset_y ?? 0;
|
|
|
- const widthPx = isPixelSlot ? (slot.pixel_width ?? slotWidthPx) : slotWidthPx;
|
|
|
- const heightPx = isPixelSlot ? (slot.pixel_height ?? slotHeightPx) : slotHeightPx;
|
|
|
- const leftPx = isPixelSlot ? slotLeftPx + offsetX : slotLeftPx;
|
|
|
- const topPx = isPixelSlot ? slotTopPx + offsetY : slotTopPx;
|
|
|
- const color = SLOT_HIGHLIGHT_COLORS[idx % SLOT_HIGHLIGHT_COLORS.length];
|
|
|
- return (
|
|
|
- <div
|
|
|
- key={`slot-highlight-${slot.id}-${idx}`}
|
|
|
- className="absolute pointer-events-none"
|
|
|
- style={{
|
|
|
- left: px2vmin(leftPx),
|
|
|
- top: px2vmin(topPx),
|
|
|
- width: px2vmin(widthPx),
|
|
|
- height: px2vmin(heightPx),
|
|
|
- border: `2PX solid ${color}`,
|
|
|
- boxSizing: 'border-box',
|
|
|
- zIndex: 20,
|
|
|
- }}
|
|
|
- />
|
|
|
- );
|
|
|
- })}
|
|
|
</div>
|
|
|
</div>
|
|
|
|