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 = []; renderable = [];
spriteElement.value?.requestBeforeFrame(() => {
typer.setConfig(props); typer.setConfig(props);
typer.setText(props.text ?? ''); typer.setText(props.text ?? '');
typer.type(); typer.type();
needUpdate = false; needUpdate = false;
updateLoc(); updateLoc();
});
}; };
const showAll = () => { const showAll = () => {

View File

@ -14,7 +14,7 @@ import {
onMounted, onMounted,
shallowReactive shallowReactive
} from 'vue'; } from 'vue';
import { Page, PageExpose } from '../components'; import { getConfirm, Page, PageExpose } from '../components';
import { useKey } from '../use'; import { useKey } from '../use';
import { MAP_WIDTH } from '../shared'; import { MAP_WIDTH } from '../shared';
import { getSave, SaveData } from '../utils'; import { getSave, SaveData } from '../utils';
@ -232,11 +232,20 @@ export const Save = defineComponent<SaveProps, SaveEmits, keyof SaveEmits>(
updateDataList(now.value); updateDataList(now.value);
}); });
const emitSave = (index: number) => { const emitSave = async (index: number) => {
const posIndex = getPosIndex(index); const posIndex = getPosIndex(index);
if (inDelete.value) { if (inDelete.value) {
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)); emit('delete', index, exist(posIndex));
deleteData(posIndex); deleteData(posIndex);
}
} else { } else {
emit('emit', index, exist(posIndex)); emit('emit', index, exist(posIndex));
} }
@ -364,7 +373,7 @@ export const Save = defineComponent<SaveProps, SaveEmits, keyof SaveEmits>(
); );
return () => ( return () => (
<container loc={props.loc} zIndex={10}> <container loc={props.loc}>
<Page <Page
ref={pageRef} ref={pageRef}
loc={[0, 0, width.value, height.value - 10]} loc={[0, 0, width.value, height.value - 10]}

View File

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