Skip to content

Commit

Permalink
fix: debug jump now working again
Browse files Browse the repository at this point in the history
  • Loading branch information
liana-p committed Aug 31, 2024
1 parent 3af08a9 commit 060e10b
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/narrat/src/components/debug/debug-jumping.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ onMounted(() => {
}
},
},
continue: {
confirm: {
press: () => {
if (
matches.value.length > 0 &&
Expand Down
2 changes: 1 addition & 1 deletion packages/narrat/src/components/game-splash/game-splash.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function goToStartMenu() {
}
onMounted(() => {
inputListener.value = useInputs().registerInputListener('game-splash', {
continue: {
confirm: {
press: () => {
goToStartMenu();
},
Expand Down
2 changes: 1 addition & 1 deletion packages/narrat/src/components/inventory/item-details.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function close() {
onMounted(() => {
listener.value = useInputs().registerInputListener('item-details', {
continue: {
confirm: {
press: () => {
if (canUse.value) {
use();
Expand Down
2 changes: 1 addition & 1 deletion packages/narrat/src/components/utils/alert-modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const inputListener = ref<InputListener | null>(
close();
},
},
continue: {
confirm: {
press: () => {
close();
},
Expand Down
2 changes: 1 addition & 1 deletion packages/narrat/src/components/utils/yes-no.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const listener = ref<InputListener | null>(
chosen(false);
},
},
continue: {
confirm: {
press: () => {
chosen(true);
},
Expand Down
8 changes: 4 additions & 4 deletions packages/narrat/src/inputs/useNavigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export function useNavigation(options: NavigationOptions) {
}
}

function buttonContinue() {
function buttonConfirm() {
if (options.onChosen) {
options.onChosen(selectedIndex.value);
}
Expand All @@ -199,7 +199,7 @@ export function useNavigation(options: NavigationOptions) {
delete options.listener.actions.down;
}
if (!options.noChoosing) {
delete options.listener.actions.continue;
delete options.listener.actions.confirm;
}
if (changeInputListener.value) {
inputs.removeEventListener('change-input', changeInputListener.value);
Expand Down Expand Up @@ -246,8 +246,8 @@ export function useNavigation(options: NavigationOptions) {
};
}
if (!options.noChoosing) {
options.listener.actions.continue = {
press: buttonContinue,
options.listener.actions.confirm = {
press: buttonConfirm,
};
}
select(0);
Expand Down
17 changes: 16 additions & 1 deletion packages/narrat/src/stores/inputs-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,29 @@ const defaultActions: Action[] = [
label: 'Continue',
keyboardIcon: 'img/ui/button-prompts/keyboard/key-space.png',
gamepadIcon: 'img/ui/button-prompts/gamepad/facebutton-down.png',
showInLegend: true,
showInLegend: false,
keybinds: [
{
keyboardKey: 'Space',
gamepadButton: 0,
},
],
},
{
id: 'confirm',
type: 'button',
action: 'press',
label: 'Confirm',
keyboardIcon: 'img/ui/button-prompts/keyboard/key-enter.png',
gamepadIcon: 'img/ui/button-prompts/gamepad/facebutton-down.png',
showInLegend: true,
keybinds: [
{
keyboardKey: 'Enter',
gamepadButton: 0,
},
],
},
{
id: 'cancel',
type: 'button',
Expand Down

0 comments on commit 060e10b

Please sign in to comment.