feat: 删除添加确认框

This commit is contained in:
unanmed 2025-06-24 22:41:51 +08:00
parent a2e0d818ea
commit a2848679c8
3 changed files with 22 additions and 13 deletions

View File

@ -135,13 +135,11 @@ export const TextContent = defineComponent<
}
renderable = [];
spriteElement.value?.requestBeforeFrame(() => {
typer.setConfig(props);
typer.setText(props.text ?? '');
typer.type();
needUpdate = false;
updateLoc();
});
typer.setConfig(props);
typer.setText(props.text ?? '');
typer.type();
needUpdate = false;
updateLoc();
};
const showAll = () => {

View File

@ -14,7 +14,7 @@ import {
onMounted,
shallowReactive
} from 'vue';
import { Page, PageExpose } from '../components';
import { getConfirm, Page, PageExpose } from '../components';
import { useKey } from '../use';
import { MAP_WIDTH } from '../shared';
import { getSave, SaveData } from '../utils';
@ -232,11 +232,20 @@ export const Save = defineComponent<SaveProps, SaveEmits, keyof SaveEmits>(
updateDataList(now.value);
});
const emitSave = (index: number) => {
const emitSave = async (index: number) => {
const posIndex = getPosIndex(index);
if (inDelete.value) {
emit('delete', index, exist(posIndex));
deleteData(posIndex);
const confirm = await getConfirm(
props.controller,
`确认要删除存档 ${index}`,
[420, 240, void 0, void 0, 0.5, 0.5],
240,
{ winskin: 'winskin2.png' }
);
if (confirm) {
emit('delete', index, exist(posIndex));
deleteData(posIndex);
}
} else {
emit('emit', index, exist(posIndex));
}
@ -364,7 +373,7 @@ export const Save = defineComponent<SaveProps, SaveEmits, keyof SaveEmits>(
);
return () => (
<container loc={props.loc} zIndex={10}>
<container loc={props.loc}>
<Page
ref={pageRef}
loc={[0, 0, width.value, height.value - 10]}

View File

@ -24,17 +24,19 @@ export const UIContainer = defineComponent<UIContainerProps>(props => {
instance={b}
key={b.key}
hidden={b.hidden && !b.alwaysShow}
zIndex={0}
></b.ui.component>
);
}
return elements.concat(
data.stack.map(v => (
data.stack.map((v, i) => (
<v.ui.component
{...v.vBind}
key={v.key}
controller={data}
instance={v}
hidden={v.hidden && !v.alwaysShow}
zIndex={i * 5}
></v.ui.component>
))
);