Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/defaultOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ export const defaultOptions = {
singleplayerAutoSave: false,
alwaysBackupWorldBeforeLoading: undefined as boolean | undefined | null,
alwaysShowMobileControls: false,
/** Never enable touch controls, even if the device reports a touchscreen (e.g. laptops with mouse & keyboard). */
forceDisableTouchControls: false,
/** Portrait viewport: apply `body.rotated` landscape layout without tapping the rotate button. */
autoDisplayRotation: false,
excludeCommunicationDebugEvents: [] as string[],
Expand Down
5 changes: 5 additions & 0 deletions src/optionsGuiScheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,11 @@ export const guiOptionsScheme: {
},
alwaysShowMobileControls: {
text: 'Always Mobile Controls',
disableIf: ['forceDisableTouchControls', true],
},
forceDisableTouchControls: {
text: 'Force Disable Touch Controls',
tooltip: 'Never show touch controls, even if your device has a touchscreen. Useful for touch laptops used with mouse and keyboard.',
},
autoDisplayRotation: {
text: 'Auto Landscape Rotation',
Expand Down
2 changes: 1 addition & 1 deletion src/watchOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ watchValue(options, o => {
// gui scale is set in scaleInterface.ts
})
const updateTouch = (o) => {
miscUiState.currentTouch = o.alwaysShowMobileControls || isMobile()
miscUiState.currentTouch = !o.forceDisableTouchControls && (o.alwaysShowMobileControls || isMobile())
}
watchValue(options, updateTouch)
window.matchMedia('(pointer: coarse)').addEventListener('change', (e) => {
Expand Down
Loading