Skip to content

Commit

Permalink
fix: default font size fix + reenabled debug on game splash screen (#129
Browse files Browse the repository at this point in the history
)
  • Loading branch information
liana-p committed Jul 15, 2023
1 parent fa2a9f4 commit 3b945a3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/narrat/examples/games/default/data/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ settings:
defaultValue: Someone
description: The name of the player. (not actually used, this is just to test custom settings)
layout:
defaultFontSize: 16
backgrounds:
# Default was 880 x 720
width: 1280
Expand Down
6 changes: 3 additions & 3 deletions packages/narrat/src/components/game-splash/game-splash.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ onMounted(() => {
},
},
});
// if (main.options.debug) {
// goToMainMenu();
// }
if (main.options.debug) {
goToMainMenu();
}
});
onUnmounted(() => {
if (inputListener.value) {
Expand Down
7 changes: 5 additions & 2 deletions packages/narrat/src/stores/rendering-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { aspectRatioFit } from '@/utils/helpers';
import { acceptHMRUpdate, defineStore } from 'pinia';
import { getConfig, getDialogPanelWidth } from '../config';
import { useMain } from './main-store';
import { useSettings } from './settings-store';

export interface RenderingState {
screenWidth: number;
Expand All @@ -22,10 +23,12 @@ export const useRenderingStore = defineStore('rendering', {
this.screenWidth = width;
if (width < getConfig().layout.verticalLayoutThreshold) {
this.layoutMode = 'vertical';
document.querySelector('html')!.style.fontSize = '40px';
document.querySelector('html')!.style.fontSize =
`${useSettings().baseSettings.fontSize}px` ?? '40px';
} else {
this.layoutMode = 'horizontal';
document.querySelector('html')!.style.fontSize = '16px';
document.querySelector('html')!.style.fontSize =
`${useSettings().baseSettings.fontSize}px` ?? '16px';
}
},
},
Expand Down

0 comments on commit 3b945a3

Please sign in to comment.