fix:绘制存档界面缩略图

This commit is contained in:
ShakeFlower 2025-06-23 16:04:58 +08:00
parent f32b9edb72
commit a2cbe66409
2 changed files with 21 additions and 3 deletions

View File

@ -5,6 +5,7 @@ import {
} from '@motajs/render-core';
import { SpriteProps } from '@motajs/render-vue';
import { defineComponent, ref, watch } from 'vue';
import { SetupComponentOptions } from '@motajs/system-ui';
export interface ThumbnailProps extends SpriteProps {
loc: ElementLocator;
@ -15,9 +16,25 @@ export interface ThumbnailProps extends SpriteProps {
// configs
damage?: boolean;
all?: boolean;
noHD?: boolean;
/** 缩略图的比例 */
size?: number;
}
const thumbnailProps = {
props: [
'loc',
'padStyle',
'floorId',
'map',
'hero',
'damage',
'all',
'noHD',
'size'
]
} satisfies SetupComponentOptions<ThumbnailProps>;
export const Thumbnail = defineComponent<ThumbnailProps>(props => {
const spriteRef = ref<Sprite>();
@ -35,7 +52,7 @@ export const Thumbnail = defineComponent<ThumbnailProps>(props => {
y: 0,
size: props.size ?? 1,
all: props.all,
noHD: false,
noHD: props.noHD,
v2: true,
inFlyMap: false
};
@ -58,4 +75,4 @@ export const Thumbnail = defineComponent<ThumbnailProps>(props => {
return () => (
<sprite ref={spriteRef} loc={props.loc} render={drawThumbnail} />
);
});
}, thumbnailProps);

View File

@ -105,12 +105,13 @@ export const SaveBtn = defineComponent<
<Thumbnail
hidden={data.value == null}
loc={[3, 26, w - 6, w - 4]}
size={w / MAP_WIDTH}
padStyle="gray"
floorId={data.value?.data.floorId || 'MT0'}
map={mapBlocks.value}
hero={data.value?.data.hero as HeroStatus}
all={true}
noHD={true}
size={w / MAP_WIDTH}
/>
<text
text="placeholder"