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