mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-06-28 13:17:59 +08:00
feat: 删除添加确认框
This commit is contained in:
parent
a2e0d818ea
commit
a2848679c8
@ -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 = () => {
|
||||||
|
@ -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) {
|
||||||
emit('delete', index, exist(posIndex));
|
const confirm = await getConfirm(
|
||||||
deleteData(posIndex);
|
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 {
|
} 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]}
|
||||||
|
@ -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>
|
||||||
))
|
))
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user