mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-07-23 23:01:49 +08:00
Compare commits
No commits in common. "5b5708c5cb285d7864279c049a64a85ae85d766c" and "b026287a71f9be38244c37053cd68a0c201fac9a" have entirely different histories.
5b5708c5cb
...
b026287a71
@ -3,22 +3,18 @@ import globals from 'globals';
|
|||||||
import tseslint from 'typescript-eslint';
|
import tseslint from 'typescript-eslint';
|
||||||
import eslintPluginVue from 'eslint-plugin-vue';
|
import eslintPluginVue from 'eslint-plugin-vue';
|
||||||
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
||||||
import eslintPluginReact from 'eslint-plugin-react';
|
|
||||||
|
|
||||||
export default tseslint.config(
|
export default tseslint.config(
|
||||||
{
|
{
|
||||||
ignores: ['node_modules', 'dist', 'public']
|
ignores: ['node_modules', 'dist', 'public']
|
||||||
},
|
},
|
||||||
|
|
||||||
eslint.configs.recommended,
|
eslint.configs.recommended,
|
||||||
...tseslint.configs.recommended,
|
...tseslint.configs.recommended,
|
||||||
...eslintPluginVue.configs['flat/recommended'],
|
...eslintPluginVue.configs['flat/recommended'],
|
||||||
eslintPluginPrettierRecommended,
|
|
||||||
{
|
{
|
||||||
files: ['**/*.{js,mjs,cjs,vue}'],
|
files: ['**/*.{js,mjs,cjs,vue}'],
|
||||||
rules: {
|
rules: {
|
||||||
'no-console': 'warn',
|
'no-console': 'warn'
|
||||||
eqeqeq: ['error', 'always']
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -51,9 +47,6 @@ export default tseslint.config(
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
files: ['**/*.{ts,tsx,vue}'],
|
files: ['**/*.{ts,tsx,vue}'],
|
||||||
plugins: {
|
|
||||||
react: eslintPluginReact
|
|
||||||
},
|
|
||||||
rules: {
|
rules: {
|
||||||
'@typescript-eslint/no-empty-object-type': 'off',
|
'@typescript-eslint/no-empty-object-type': 'off',
|
||||||
'@typescript-eslint/no-explicit-any': 'off',
|
'@typescript-eslint/no-explicit-any': 'off',
|
||||||
@ -72,9 +65,8 @@ export default tseslint.config(
|
|||||||
'@typescript-eslint/no-namespace': 'off',
|
'@typescript-eslint/no-namespace': 'off',
|
||||||
'@typescript-eslint/no-this-alias': 'off',
|
'@typescript-eslint/no-this-alias': 'off',
|
||||||
'no-console': 'warn',
|
'no-console': 'warn',
|
||||||
'vue/multi-word-component-names': 'off',
|
'vue/multi-word-component-names': 'off'
|
||||||
eqeqeq: ['error', 'always'],
|
|
||||||
'react/jsx-boolean-value': ['error', 'never']
|
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
eslintPluginPrettierRecommended
|
||||||
);
|
);
|
||||||
|
@ -63,7 +63,6 @@
|
|||||||
"concurrently": "^9.1.2",
|
"concurrently": "^9.1.2",
|
||||||
"eslint": "^9.22.0",
|
"eslint": "^9.22.0",
|
||||||
"eslint-plugin-prettier": "^5.5.0",
|
"eslint-plugin-prettier": "^5.5.0",
|
||||||
"eslint-plugin-react": "^7.37.5",
|
|
||||||
"eslint-plugin-vue": "^9.33.0",
|
"eslint-plugin-vue": "^9.33.0",
|
||||||
"fontmin": "^0.9.9",
|
"fontmin": "^0.9.9",
|
||||||
"form-data": "^4.0.2",
|
"form-data": "^4.0.2",
|
||||||
|
@ -5,7 +5,6 @@ import {
|
|||||||
} from '@motajs/render-core';
|
} from '@motajs/render-core';
|
||||||
import { SpriteProps } from '@motajs/render-vue';
|
import { SpriteProps } from '@motajs/render-vue';
|
||||||
import { defineComponent, ref, watch } from 'vue';
|
import { defineComponent, ref, watch } from 'vue';
|
||||||
import { SetupComponentOptions } from '@motajs/system-ui';
|
|
||||||
|
|
||||||
export interface ThumbnailProps extends SpriteProps {
|
export interface ThumbnailProps extends SpriteProps {
|
||||||
loc: ElementLocator;
|
loc: ElementLocator;
|
||||||
@ -16,25 +15,8 @@ export interface ThumbnailProps extends SpriteProps {
|
|||||||
// configs
|
// configs
|
||||||
damage?: boolean;
|
damage?: boolean;
|
||||||
all?: 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 => {
|
export const Thumbnail = defineComponent<ThumbnailProps>(props => {
|
||||||
const spriteRef = ref<Sprite>();
|
const spriteRef = ref<Sprite>();
|
||||||
|
|
||||||
@ -43,16 +25,15 @@ export const Thumbnail = defineComponent<ThumbnailProps>(props => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const drawThumbnail = (canvas: MotaOffscreenCanvas2D) => {
|
const drawThumbnail = (canvas: MotaOffscreenCanvas2D) => {
|
||||||
const ctx = canvas.ctx;
|
|
||||||
const hero = props.hero;
|
const hero = props.hero;
|
||||||
const options: Partial<DrawThumbnailConfig> = {
|
const options: Partial<DrawThumbnailConfig> = {
|
||||||
damage: props.damage,
|
damage: props.damage,
|
||||||
ctx: ctx,
|
ctx: canvas.ctx,
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 0,
|
y: 0,
|
||||||
size: props.size ?? 1,
|
size: 1,
|
||||||
all: props.all,
|
all: props.all,
|
||||||
noHD: props.noHD,
|
noHD: false,
|
||||||
v2: true,
|
v2: true,
|
||||||
inFlyMap: false
|
inFlyMap: false
|
||||||
};
|
};
|
||||||
@ -63,11 +44,7 @@ export const Thumbnail = defineComponent<ThumbnailProps>(props => {
|
|||||||
options.centerX = hero.loc.x;
|
options.centerX = hero.loc.x;
|
||||||
options.centerY = hero.loc.y;
|
options.centerY = hero.loc.y;
|
||||||
}
|
}
|
||||||
ctx.save();
|
|
||||||
ctx.fillStyle = props.padStyle;
|
|
||||||
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
||||||
core.drawThumbnail(props.floorId, props.map, options);
|
core.drawThumbnail(props.floorId, props.map, options);
|
||||||
ctx.restore();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
watch(props, update);
|
watch(props, update);
|
||||||
@ -75,4 +52,4 @@ export const Thumbnail = defineComponent<ThumbnailProps>(props => {
|
|||||||
return () => (
|
return () => (
|
||||||
<sprite ref={spriteRef} loc={props.loc} render={drawThumbnail} />
|
<sprite ref={spriteRef} loc={props.loc} render={drawThumbnail} />
|
||||||
);
|
);
|
||||||
}, thumbnailProps);
|
});
|
||||||
|
@ -407,10 +407,6 @@ export class HeroRenderer
|
|||||||
this.animateTick(time);
|
this.animateTick(time);
|
||||||
this.moveTick(time);
|
this.moveTick(time);
|
||||||
});
|
});
|
||||||
if (core.status.hero) {
|
|
||||||
const image = core.status.hero.image;
|
|
||||||
this.setImage(core.material.images.images[image]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onDestroy(layer: Layer): void {
|
onDestroy(layer: Layer): void {
|
||||||
|
@ -7,12 +7,10 @@ import {
|
|||||||
SetupComponentOptions,
|
SetupComponentOptions,
|
||||||
UIComponentProps
|
UIComponentProps
|
||||||
} from '@motajs/system-ui';
|
} from '@motajs/system-ui';
|
||||||
import { defineComponent, ref, computed, watch, nextTick } from 'vue';
|
import { defineComponent, ref, computed } from 'vue';
|
||||||
import { Page, PageExpose } from '../components';
|
import { Page, PageExpose } from '../components';
|
||||||
import { useKey } from '../use';
|
import { useKey } from '../use';
|
||||||
import { MAP_WIDTH, MAP_HEIGHT } from '../shared';
|
import { MAP_WIDTH, MAP_HEIGHT } from '../shared';
|
||||||
import { getSave, SaveData } from '../utils';
|
|
||||||
import { Thumbnail } from '../components/thumbnail';
|
|
||||||
|
|
||||||
export interface SaveProps extends UIComponentProps, DefaultProps {
|
export interface SaveProps extends UIComponentProps, DefaultProps {
|
||||||
loc: ElementLocator;
|
loc: ElementLocator;
|
||||||
@ -34,11 +32,6 @@ export type SaveEmits = {
|
|||||||
exit: () => void;
|
exit: () => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type SaveBtnEmits = {
|
|
||||||
/** 读取数据 */
|
|
||||||
updateData: (isValid: boolean) => void;
|
|
||||||
};
|
|
||||||
|
|
||||||
const saveProps = {
|
const saveProps = {
|
||||||
props: ['loc', 'controller', 'instance'],
|
props: ['loc', 'controller', 'instance'],
|
||||||
emits: ['delete', 'emit', 'exit']
|
emits: ['delete', 'emit', 'exit']
|
||||||
@ -48,24 +41,10 @@ const saveBtnProps = {
|
|||||||
props: ['loc', 'index', 'isSelected', 'isDelete']
|
props: ['loc', 'index', 'isSelected', 'isDelete']
|
||||||
} satisfies SetupComponentOptions<SaveBtnProps>;
|
} satisfies SetupComponentOptions<SaveBtnProps>;
|
||||||
|
|
||||||
export const SaveBtn = defineComponent<
|
export const SaveBtn = defineComponent<SaveBtnProps>(props => {
|
||||||
SaveBtnProps,
|
|
||||||
SaveBtnEmits,
|
|
||||||
keyof SaveBtnEmits
|
|
||||||
>((props, { emit }) => {
|
|
||||||
const w = props.loc[2] ?? 200;
|
const w = props.loc[2] ?? 200;
|
||||||
const font = new Font('normal', 18);
|
const font = new Font('normal', 18);
|
||||||
const statusFont = new Font('normal', 14);
|
const statusFont = new Font('normal', 14);
|
||||||
const data = ref<SaveData | null>(null);
|
|
||||||
const mapBlocks = computed(() => {
|
|
||||||
if (data.value === null) return void 0;
|
|
||||||
else {
|
|
||||||
const currData = data.value?.data;
|
|
||||||
const map = core.maps.loadMap(currData.maps, currData.floorId);
|
|
||||||
core.extractBlocksForUI(map, currData.hero.flags); // 这一步会向map写入blocks
|
|
||||||
return map.blocks;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const text = computed(() =>
|
const text = computed(() =>
|
||||||
props.index === -1 ? '自动存档' : `存档${props.index + 1}`
|
props.index === -1 ? '自动存档' : `存档${props.index + 1}`
|
||||||
);
|
);
|
||||||
@ -74,18 +53,6 @@ export const SaveBtn = defineComponent<
|
|||||||
else return 'white';
|
else return 'white';
|
||||||
});
|
});
|
||||||
const lineWidth = computed(() => (props.isSelected ? 2 : 1));
|
const lineWidth = computed(() => (props.isSelected ? 2 : 1));
|
||||||
|
|
||||||
watch(
|
|
||||||
() => props.index,
|
|
||||||
newIndex => {
|
|
||||||
getSave(newIndex + 1).then(value => {
|
|
||||||
data.value = value;
|
|
||||||
emit('updateData', value != null);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
{ immediate: true }
|
|
||||||
);
|
|
||||||
|
|
||||||
return () => (
|
return () => (
|
||||||
<container loc={props.loc}>
|
<container loc={props.loc}>
|
||||||
<text
|
<text
|
||||||
@ -102,17 +69,6 @@ export const SaveBtn = defineComponent<
|
|||||||
lineWidth={lineWidth.value}
|
lineWidth={lineWidth.value}
|
||||||
lineJoin="miter"
|
lineJoin="miter"
|
||||||
/>
|
/>
|
||||||
<Thumbnail
|
|
||||||
hidden={data.value === null}
|
|
||||||
loc={[3, 26, w - 6, w - 4]}
|
|
||||||
padStyle="gray"
|
|
||||||
floorId={data.value?.data.floorId || 'MT0'}
|
|
||||||
map={mapBlocks.value}
|
|
||||||
hero={data.value?.data.hero as HeroStatus}
|
|
||||||
all
|
|
||||||
noHD
|
|
||||||
size={w / MAP_WIDTH}
|
|
||||||
/>
|
|
||||||
<text
|
<text
|
||||||
text="placeholder"
|
text="placeholder"
|
||||||
fillStyle="yellow"
|
fillStyle="yellow"
|
||||||
@ -132,26 +88,14 @@ export const Save = defineComponent<SaveProps, SaveEmits, keyof SaveEmits>(
|
|||||||
const font = new Font('normal', 18);
|
const font = new Font('normal', 18);
|
||||||
const pageFont = new Font('normal', 14);
|
const pageFont = new Font('normal', 14);
|
||||||
|
|
||||||
/** 各个存档是否有数据 */
|
|
||||||
const saveValidArr = Array(pageCap).fill(false);
|
|
||||||
/** 这里参数是存档在当前页的索引posIndex */
|
|
||||||
const updateValid = (index: number) => (isValid: boolean) => {
|
|
||||||
saveValidArr[index] = isValid;
|
|
||||||
};
|
|
||||||
|
|
||||||
const isDelete = ref(false);
|
const isDelete = ref(false);
|
||||||
const pageRef = ref<PageExpose>();
|
const pageRef = ref<PageExpose>();
|
||||||
/** 当前页上被选中的存档的序号 只会是0到5 */
|
/** 当前页上被选中的存档的序号 只会是0到5 */
|
||||||
const pickIndex = ref(1);
|
const pickIndex = ref(1);
|
||||||
const getPosIndex = (index: number) => {
|
|
||||||
if (index === -1) return 0;
|
|
||||||
return index - pageCap * (pageRef.value?.now() || 0) + 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
const emitSave = (index: number) => {
|
const emitSave = (index: number) => {
|
||||||
const posIndex = getPosIndex(index);
|
if (isDelete.value) emit('delete', index);
|
||||||
if (isDelete.value) emit('delete', index, saveValidArr[posIndex]);
|
else emit('emit', index);
|
||||||
else emit('emit', index, saveValidArr[posIndex]);
|
|
||||||
pickIndex.value = (index % pageCap) + 1;
|
pickIndex.value = (index % pageCap) + 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -173,11 +117,10 @@ export const Save = defineComponent<SaveProps, SaveEmits, keyof SaveEmits>(
|
|||||||
props.controller.close(props.instance);
|
props.controller.close(props.instance);
|
||||||
};
|
};
|
||||||
|
|
||||||
// #region 按键实现
|
|
||||||
const [key] = useKey();
|
const [key] = useKey();
|
||||||
key.realize('confirm', () => {
|
key.realize('confirm', () => {
|
||||||
const currPage = pageRef.value?.now();
|
const currPage = pageRef.value?.now();
|
||||||
if (currPage === void 0) return;
|
if (currPage == null) return;
|
||||||
emitSave(pageCap * currPage + pickIndex.value);
|
emitSave(pageCap * currPage + pickIndex.value);
|
||||||
})
|
})
|
||||||
.realize('exit', exit)
|
.realize('exit', exit)
|
||||||
@ -217,9 +160,9 @@ export const Save = defineComponent<SaveProps, SaveEmits, keyof SaveEmits>(
|
|||||||
.realize(
|
.realize(
|
||||||
'@save_down',
|
'@save_down',
|
||||||
() => {
|
() => {
|
||||||
if (pickIndex.value <= pageCap - row) {
|
if (pickIndex.value <= pageCap - row)
|
||||||
pickIndex.value += column;
|
pickIndex.value += column;
|
||||||
} else {
|
else {
|
||||||
pickIndex.value += column - pageCap - 1;
|
pickIndex.value += column - pageCap - 1;
|
||||||
pageRef.value?.movePage(1);
|
pageRef.value?.movePage(1);
|
||||||
}
|
}
|
||||||
@ -245,16 +188,14 @@ export const Save = defineComponent<SaveProps, SaveEmits, keyof SaveEmits>(
|
|||||||
.realize(
|
.realize(
|
||||||
'@save_right',
|
'@save_right',
|
||||||
() => {
|
() => {
|
||||||
if (pickIndex.value < pageCap) {
|
if (pickIndex.value < pageCap) pickIndex.value++;
|
||||||
pickIndex.value++;
|
else {
|
||||||
} else {
|
|
||||||
pickIndex.value = 0;
|
pickIndex.value = 0;
|
||||||
pageRef.value?.movePage(1);
|
pageRef.value?.movePage(1);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ type: 'down-repeat' }
|
{ type: 'down-repeat' }
|
||||||
);
|
);
|
||||||
// #endregion
|
|
||||||
|
|
||||||
return () => (
|
return () => (
|
||||||
<container loc={props.loc} zIndex={10}>
|
<container loc={props.loc} zIndex={10}>
|
||||||
@ -273,7 +214,6 @@ export const Save = defineComponent<SaveProps, SaveEmits, keyof SaveEmits>(
|
|||||||
isSelected={pickIndex.value === 0}
|
isSelected={pickIndex.value === 0}
|
||||||
isDelete={isDelete.value}
|
isDelete={isDelete.value}
|
||||||
onClick={() => emitSave(-1)}
|
onClick={() => emitSave(-1)}
|
||||||
onUpdateData={updateValid(0)}
|
|
||||||
cursor="pointer"
|
cursor="pointer"
|
||||||
/>
|
/>
|
||||||
<SaveBtn
|
<SaveBtn
|
||||||
@ -282,7 +222,6 @@ export const Save = defineComponent<SaveProps, SaveEmits, keyof SaveEmits>(
|
|||||||
isSelected={pickIndex.value === 1}
|
isSelected={pickIndex.value === 1}
|
||||||
isDelete={isDelete.value}
|
isDelete={isDelete.value}
|
||||||
onClick={() => emitSave(page * pageCap)}
|
onClick={() => emitSave(page * pageCap)}
|
||||||
onUpdateData={updateValid(1)}
|
|
||||||
cursor="pointer"
|
cursor="pointer"
|
||||||
/>
|
/>
|
||||||
<SaveBtn
|
<SaveBtn
|
||||||
@ -291,7 +230,6 @@ export const Save = defineComponent<SaveProps, SaveEmits, keyof SaveEmits>(
|
|||||||
isSelected={pickIndex.value === 2}
|
isSelected={pickIndex.value === 2}
|
||||||
isDelete={isDelete.value}
|
isDelete={isDelete.value}
|
||||||
onClick={() => emitSave(page * pageCap + 1)}
|
onClick={() => emitSave(page * pageCap + 1)}
|
||||||
onUpdateData={updateValid(2)}
|
|
||||||
cursor="pointer"
|
cursor="pointer"
|
||||||
/>
|
/>
|
||||||
<SaveBtn
|
<SaveBtn
|
||||||
@ -300,7 +238,6 @@ export const Save = defineComponent<SaveProps, SaveEmits, keyof SaveEmits>(
|
|||||||
isSelected={pickIndex.value === 3}
|
isSelected={pickIndex.value === 3}
|
||||||
isDelete={isDelete.value}
|
isDelete={isDelete.value}
|
||||||
onClick={() => emitSave(page * pageCap + 2)}
|
onClick={() => emitSave(page * pageCap + 2)}
|
||||||
onUpdateData={updateValid(3)}
|
|
||||||
cursor="pointer"
|
cursor="pointer"
|
||||||
/>
|
/>
|
||||||
<SaveBtn
|
<SaveBtn
|
||||||
@ -309,7 +246,6 @@ export const Save = defineComponent<SaveProps, SaveEmits, keyof SaveEmits>(
|
|||||||
isSelected={pickIndex.value === 4}
|
isSelected={pickIndex.value === 4}
|
||||||
isDelete={isDelete.value}
|
isDelete={isDelete.value}
|
||||||
onClick={() => emitSave(page * pageCap + 3)}
|
onClick={() => emitSave(page * pageCap + 3)}
|
||||||
onUpdateData={updateValid(4)}
|
|
||||||
cursor="pointer"
|
cursor="pointer"
|
||||||
/>
|
/>
|
||||||
<SaveBtn
|
<SaveBtn
|
||||||
@ -318,7 +254,6 @@ export const Save = defineComponent<SaveProps, SaveEmits, keyof SaveEmits>(
|
|||||||
isSelected={pickIndex.value === 5}
|
isSelected={pickIndex.value === 5}
|
||||||
isDelete={isDelete.value}
|
isDelete={isDelete.value}
|
||||||
onClick={() => emitSave(page * pageCap + 4)}
|
onClick={() => emitSave(page * pageCap + 4)}
|
||||||
onUpdateData={updateValid(5)}
|
|
||||||
cursor="pointer"
|
cursor="pointer"
|
||||||
/>
|
/>
|
||||||
</container>
|
</container>
|
||||||
@ -423,9 +358,8 @@ export async function saveSave(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
const index = await selectSave(controller, loc, validate, props);
|
const index = await selectSave(controller, loc, validate, props);
|
||||||
if (index === -2) return false;
|
if (index === -2) return;
|
||||||
core.doSL(index + 1, 'save');
|
core.doSL(index, 'save');
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function saveLoad(
|
export async function saveLoad(
|
||||||
@ -437,11 +371,10 @@ export async function saveLoad(
|
|||||||
return { message: '无效的存档!', valid: exist };
|
return { message: '无效的存档!', valid: exist };
|
||||||
};
|
};
|
||||||
const index = await selectSave(controller, loc, validate, props);
|
const index = await selectSave(controller, loc, validate, props);
|
||||||
if (index === -2) return false;
|
if (index === -2) return;
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
core.doSL('autosave', 'load');
|
core.doSL('autosave', 'load');
|
||||||
} else {
|
} else {
|
||||||
core.doSL(index + 1, 'load');
|
core.doSL(index, 'load');
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ import {
|
|||||||
import { defineComponent, nextTick, onMounted, ref } from 'vue';
|
import { defineComponent, nextTick, onMounted, ref } from 'vue';
|
||||||
import { MAIN_HEIGHT, MAIN_WIDTH } from '../shared';
|
import { MAIN_HEIGHT, MAIN_WIDTH } from '../shared';
|
||||||
import {
|
import {
|
||||||
ElementLocator,
|
|
||||||
IActionEvent,
|
IActionEvent,
|
||||||
MotaOffscreenCanvas2D,
|
MotaOffscreenCanvas2D,
|
||||||
Shader,
|
Shader,
|
||||||
@ -170,13 +169,8 @@ export const GameTitle = defineComponent<GameTitleProps>(props => {
|
|||||||
buttonsAlpha.set(1);
|
buttonsAlpha.set(1);
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadGame = async () => {
|
const loadGame = () => {
|
||||||
const loc: ElementLocator = [0, 0, MAIN_WIDTH, MAIN_HEIGHT];
|
saveLoad(props.controller, [0, 0, MAIN_WIDTH, MAIN_HEIGHT]);
|
||||||
const success = await saveLoad(props.controller, loc);
|
|
||||||
if (success) {
|
|
||||||
props.controller.close(props.instance);
|
|
||||||
props.controller.open(MainSceneUI, {});
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const replay = () => {
|
const replay = () => {
|
||||||
|
@ -21,7 +21,7 @@ import { KeyCode } from '@motajs/client-base';
|
|||||||
import { Progress } from '../components/misc';
|
import { Progress } from '../components/misc';
|
||||||
import { generateBinary } from '@motajs/legacy-common';
|
import { generateBinary } from '@motajs/legacy-common';
|
||||||
import { SetupComponentOptions } from '@motajs/system-ui';
|
import { SetupComponentOptions } from '@motajs/system-ui';
|
||||||
import { saveSave, saveLoad } from './save';
|
import { saveSave } from './save';
|
||||||
import { mainUIController } from './controller';
|
import { mainUIController } from './controller';
|
||||||
import { MAIN_WIDTH, MAIN_HEIGHT } from '../shared';
|
import { MAIN_WIDTH, MAIN_HEIGHT } from '../shared';
|
||||||
|
|
||||||
@ -90,9 +90,7 @@ export const PlayingToolbar = defineComponent<
|
|||||||
const save = () => {
|
const save = () => {
|
||||||
saveSave(mainUIController, [0, 0, MAIN_WIDTH, MAIN_HEIGHT]);
|
saveSave(mainUIController, [0, 0, MAIN_WIDTH, MAIN_HEIGHT]);
|
||||||
};
|
};
|
||||||
const load = () => {
|
const load = () => core.load(true);
|
||||||
saveLoad(mainUIController, [0, 0, MAIN_WIDTH, MAIN_HEIGHT]);
|
|
||||||
};
|
|
||||||
const equip = () => core.openEquipbox(true);
|
const equip = () => core.openEquipbox(true);
|
||||||
const shop = () => core.openQuickShop(true);
|
const shop = () => core.openQuickShop(true);
|
||||||
const key = () => {
|
const key = () => {
|
||||||
|
947
pnpm-lock.yaml
947
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
@ -2147,7 +2147,7 @@ control.prototype._doSL_load_afterGet = function (id, data) {
|
|||||||
Mota.r(() => {
|
Mota.r(() => {
|
||||||
Mota.require('@user/legacy-plugin-client').end(false);
|
Mota.require('@user/legacy-plugin-client').end(false);
|
||||||
});
|
});
|
||||||
// core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
core.loadData(data, function () {
|
core.loadData(data, function () {
|
||||||
core.removeFlag('__fromLoad__');
|
core.removeFlag('__fromLoad__');
|
||||||
core.drawTip('读档成功');
|
core.drawTip('读档成功');
|
||||||
|
5
src/types/declaration/map.d.ts
vendored
5
src/types/declaration/map.d.ts
vendored
@ -280,11 +280,6 @@ interface ResolvedFloor<T extends FloorIds = FloorIds> extends FloorBase<T> {
|
|||||||
* 每次到达事件
|
* 每次到达事件
|
||||||
*/
|
*/
|
||||||
eachArrive?: MotaEvent;
|
eachArrive?: MotaEvent;
|
||||||
|
|
||||||
/**
|
|
||||||
* 图块列表
|
|
||||||
*/
|
|
||||||
blocks?: Block[];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BlockInfo<T extends keyof NumberToId = keyof NumberToId> {
|
interface BlockInfo<T extends keyof NumberToId = keyof NumberToId> {
|
||||||
|
Loading…
Reference in New Issue
Block a user