feat(utils): useButtonConfirmation.onButtonClick -> onActivate
This commit is contained in:
@@ -46,7 +46,7 @@ const { selected, selectorPosition } = useButtonNavigation({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
initialButton: "github",
|
initialButton: "github",
|
||||||
onButtonClick: (button) => {
|
onActivate: (button) => {
|
||||||
actionateButton(button);
|
actionateButton(button);
|
||||||
},
|
},
|
||||||
disabled: computed(() => store.isIntro || store.isOutro),
|
disabled: computed(() => store.isIntro || store.isOutro),
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ const { selected, selectorPosition } = useButtonNavigation({
|
|||||||
achievements: [225, 167, 31, 26],
|
achievements: [225, 167, 31, 26],
|
||||||
},
|
},
|
||||||
initialButton: store.selectedButton,
|
initialButton: store.selectedButton,
|
||||||
onButtonClick: (button) => {
|
onActivate: (button) => {
|
||||||
if (button === "theme") throw new Error(`Not implemented: ${button}`);
|
if (button === "theme") throw new Error(`Not implemented: ${button}`);
|
||||||
|
|
||||||
if (button === "achievements") {
|
if (button === "achievements") {
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ const { select, selected, selectorPosition } = useButtonNavigation({
|
|||||||
touchScreen: [175, 119, 49, 49],
|
touchScreen: [175, 119, 49, 49],
|
||||||
},
|
},
|
||||||
initialButton: settingsStore.selectedButton,
|
initialButton: settingsStore.selectedButton,
|
||||||
onButtonClick: (buttonName) => {
|
onActivate: (buttonName) => {
|
||||||
if (isSubMenu(buttonName)) {
|
if (isSubMenu(buttonName)) {
|
||||||
settingsStore.openSubMenu(buttonName);
|
settingsStore.openSubMenu(buttonName);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ const { selected, selectorPosition } = useButtonNavigation({
|
|||||||
initialButton:
|
initialButton:
|
||||||
BUTTON_KEYS[locales.value.findIndex((l) => l.code === locale.value)] ??
|
BUTTON_KEYS[locales.value.findIndex((l) => l.code === locale.value)] ??
|
||||||
BUTTON_KEYS[0]!,
|
BUTTON_KEYS[0]!,
|
||||||
onButtonClick: () => handleActivateA(),
|
onActivate: () => handleActivateA(),
|
||||||
navigation: {
|
navigation: {
|
||||||
english: {
|
english: {
|
||||||
right: "german",
|
right: "german",
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ const { selected, selectorPosition } = useButtonNavigation({
|
|||||||
_2dMode: [11, 91, 233, 74],
|
_2dMode: [11, 91, 233, 74],
|
||||||
},
|
},
|
||||||
initialButton: app.settings.renderingMode === "3d" ? "_3dMode" : "_2dMode",
|
initialButton: app.settings.renderingMode === "3d" ? "_3dMode" : "_2dMode",
|
||||||
onButtonClick: () => handleActivateA(),
|
onActivate: () => handleActivateA(),
|
||||||
navigation: {
|
navigation: {
|
||||||
_3dMode: { down: "_2dMode" },
|
_3dMode: { down: "_2dMode" },
|
||||||
_2dMode: { up: "_3dMode" },
|
_2dMode: { up: "_3dMode" },
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export const useButtonNavigation = <T extends Record<string, Rect>>({
|
|||||||
buttons,
|
buttons,
|
||||||
initialButton,
|
initialButton,
|
||||||
canClickButton,
|
canClickButton,
|
||||||
onButtonClick,
|
onActivate,
|
||||||
navigation,
|
navigation,
|
||||||
disabled,
|
disabled,
|
||||||
selectorAnimation,
|
selectorAnimation,
|
||||||
@@ -12,7 +12,7 @@ export const useButtonNavigation = <T extends Record<string, Rect>>({
|
|||||||
buttons: T;
|
buttons: T;
|
||||||
initialButton: keyof T;
|
initialButton: keyof T;
|
||||||
canClickButton?: (buttonName: keyof T) => boolean;
|
canClickButton?: (buttonName: keyof T) => boolean;
|
||||||
onButtonClick?: (buttonName: keyof T) => void;
|
onActivate?: (buttonName: keyof T) => void;
|
||||||
navigation: Record<
|
navigation: Record<
|
||||||
keyof T,
|
keyof T,
|
||||||
{
|
{
|
||||||
@@ -201,7 +201,7 @@ export const useButtonNavigation = <T extends Record<string, Rect>>({
|
|||||||
if (canClickButton && !canClickButton(buttonName)) continue;
|
if (canClickButton && !canClickButton(buttonName)) continue;
|
||||||
|
|
||||||
if (selectedButton.value === buttonName) {
|
if (selectedButton.value === buttonName) {
|
||||||
onButtonClick?.(buttonName);
|
onActivate?.(buttonName);
|
||||||
} else {
|
} else {
|
||||||
const path = findPath(graph, selectedButton.value, buttonName);
|
const path = findPath(graph, selectedButton.value, buttonName);
|
||||||
|
|
||||||
@@ -305,7 +305,7 @@ export const useButtonNavigation = <T extends Record<string, Rect>>({
|
|||||||
|
|
||||||
case "NDS_START":
|
case "NDS_START":
|
||||||
case "NDS_A": {
|
case "NDS_A": {
|
||||||
onButtonClick?.(selectedButton.value);
|
onActivate?.(selectedButton.value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user