mirror of
				https://github.com/unanmed/HumanBreak.git
				synced 2025-11-04 15:12:58 +08:00 
			
		
		
		
	fix:绘制存档界面缩略图
This commit is contained in:
		
							parent
							
								
									f32b9edb72
								
							
						
					
					
						commit
						a2cbe66409
					
				@ -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);
 | 
			
		||||
 | 
			
		||||
@ -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"
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user