feat(common): handleConfirm -> handleActivateA, handleCancel -> handleActivateB
This commit is contained in:
@@ -15,12 +15,12 @@ const handleActivateB = () => {
|
||||
bLabel: $t("common.no"),
|
||||
aLabel: $t("common.yes"),
|
||||
onClosed: async (choice) => {
|
||||
if (choice === "confirm") {
|
||||
if (choice === "A") {
|
||||
await animateOutro();
|
||||
store.closeSubMenu();
|
||||
}
|
||||
},
|
||||
keepButtonsDown: (choice) => choice === "confirm",
|
||||
keepButtonsDown: (choice) => choice === "A",
|
||||
});
|
||||
};
|
||||
|
||||
@@ -35,7 +35,7 @@ const handleActivateA = () => {
|
||||
bLabel: $t("common.no"),
|
||||
aLabel: $t("common.yes"),
|
||||
onClosed: (choice) => {
|
||||
if (choice === "confirm") {
|
||||
if (choice === "A") {
|
||||
resetBoard();
|
||||
}
|
||||
},
|
||||
@@ -116,9 +116,9 @@ let animating = false;
|
||||
const showRestartModal = () => {
|
||||
confirmationModal.open({
|
||||
text: $t("settings.options.2048.gameOver"),
|
||||
onConfirm: () => {},
|
||||
onActivateA: () => {},
|
||||
onClosed: (choice) => {
|
||||
if (choice === "confirm") {
|
||||
if (choice === "A") {
|
||||
resetBoard();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -135,13 +135,13 @@ onMounted(() => {
|
||||
animateIntro();
|
||||
});
|
||||
|
||||
const handleCancel = async () => {
|
||||
const handleActivateB = async () => {
|
||||
if (isAnimating.value) return;
|
||||
await animateOutro();
|
||||
store.closeSubMenu();
|
||||
};
|
||||
|
||||
const handleConfirm = () => {
|
||||
const handleActivateA = () => {
|
||||
if (isAnimating.value) return;
|
||||
const selectedLocale = locales.value[BUTTON_KEYS.indexOf(selected.value)]!;
|
||||
|
||||
@@ -206,8 +206,8 @@ defineOptions({
|
||||
:y-offset="confirmationModal.buttonsYOffset + store.submenuButtonsOffsetY"
|
||||
:b-label="$t('common.cancel')"
|
||||
:a-label="$t('common.confirm')"
|
||||
@activate-b="handleCancel"
|
||||
@activate-a="handleConfirm"
|
||||
@activate-b="handleActivateB"
|
||||
@activate-a="handleActivateA"
|
||||
/>
|
||||
|
||||
<CommonButtonSelector
|
||||
|
||||
@@ -89,13 +89,13 @@ const { selected, selectorPosition } = useButtonNavigation({
|
||||
},
|
||||
});
|
||||
|
||||
const handleCancel = async () => {
|
||||
const handleActivateB = async () => {
|
||||
if (isAnimating.value) return;
|
||||
await animateOutro();
|
||||
store.closeSubMenu();
|
||||
};
|
||||
|
||||
const handleConfirm = () => {
|
||||
const handleActivateA = () => {
|
||||
if (isAnimating.value) return;
|
||||
const mode = selected.value === "_3dMode" ? "3d" : "2d";
|
||||
app.setRenderingMode(mode);
|
||||
@@ -184,8 +184,8 @@ onRender((ctx) => {
|
||||
:y-offset="confirmationModal.buttonsYOffset + store.submenuButtonsOffsetY"
|
||||
:b-label="$t('common.cancel')"
|
||||
:a-label="$t('common.confirm')"
|
||||
@activate-b="handleCancel"
|
||||
@activate-a="handleConfirm"
|
||||
@activate-b="handleActivateB"
|
||||
@activate-a="handleActivateA"
|
||||
/>
|
||||
|
||||
<CommonButtonSelector
|
||||
|
||||
Reference in New Issue
Block a user