{
if (!e.target.id.startsWith('hotbar')) return
const slot = +e.target.id.split('-')[1]
this.reloadHotbarSelected(slot)
}}>
-
-
-
-
-
-
-
-
-
- ${miscUiState.currentTouch ? html`
{
+ ${Array.from({ length: 9 }).map((_, i) => html`
+
{
+ this.reloadHotbarSelected(i)
+ }}>
+
+
+
+ `)}
+ ${miscUiState.currentTouch ? html`
{
showModal({ reactType: 'inventory', })
}}>` : undefined}
diff --git a/src/menus/hud.js b/src/menus/hud.js
index 4906ed25f..590085a43 100644
--- a/src/menus/hud.js
+++ b/src/menus/hud.js
@@ -303,17 +303,6 @@ class Hud extends LitElement {
/** @param {boolean} bl */
showMobileControls (bl) {
this.shadowRoot.querySelector('#mobile-top').style.display = bl ? 'flex' : 'none'
- // this.shadowRoot.querySelector('#mobile-left').style.display = bl ? 'block' : 'none'
- // this.shadowRoot.querySelector('#mobile-right').style.display = bl ? 'flex' : 'none'
- }
-
- /**
- * @param {any} id
- * @param {boolean} action
- */
- mobileControl (e, id, action) {
- e.stopPropagation()
- this.bot.setControlState(id, action)
}
render () {
@@ -334,47 +323,6 @@ class Hud extends LitElement {
showModal(document.getElementById('pause-screen'))
}}>
-
diff --git a/src/optionsStorage.ts b/src/optionsStorage.ts
index 81f9b8232..51aeb35d5 100644
--- a/src/optionsStorage.ts
+++ b/src/optionsStorage.ts
@@ -24,6 +24,7 @@ const defaultOptions = {
fov: 75,
guiScale: 3,
autoRequestCompletions: true,
+ touchButtonsSize: 40,
frameLimit: false as number | false,
alwaysBackupWorldBeforeLoading: undefined as boolean | undefined | null,
@@ -39,6 +40,8 @@ const defaultOptions = {
askGuestName: true
}
+export type AppOptions = typeof defaultOptions
+
export const options = proxy(
mergeAny(defaultOptions, JSON.parse(localStorage.options || '{}'))
)
diff --git a/src/reactUi.jsx b/src/reactUi.jsx
index f686ac95a..efe49792e 100644
--- a/src/reactUi.jsx
+++ b/src/reactUi.jsx
@@ -4,12 +4,12 @@ import { renderToDom } from '@zardoy/react-util'
import { LeftTouchArea, RightTouchArea, useUsingTouch, useInterfaceState } from '@dimaka/interface'
import { css } from '@emotion/css'
import { activeModalStack, isGameActive, miscUiState } from './globalState'
-import { isProbablyIphone } from './menus/components/common'
// import DeathScreen from './react/DeathScreen'
import { useSnapshot } from 'valtio'
import { contro } from './controls'
import { QRCodeSVG } from 'qrcode.react'
import { createPortal } from 'react-dom'
+import { options, watchValue } from './optionsStorage'
// todo
useInterfaceState.setState({
@@ -40,6 +40,14 @@ useInterfaceState.setState({
}
})
+watchValue(options, (o) => {
+ useInterfaceState.setState({
+ uiCustomization: {
+ touchButtonSize: o.touchButtonsSize,
+ },
+ })
+})
+
const TouchControls = () => {
// todo setting
const usingTouch = useUsingTouch()
diff --git a/src/texturePack.ts b/src/texturePack.ts
index d0ecc18bd..0f54e2961 100644
--- a/src/texturePack.ts
+++ b/src/texturePack.ts
@@ -123,7 +123,7 @@ const applyTexturePackData = async (version: string, { blockSize }: TextureResol
const blockStates: BlockStates = await result.json()
const factor = blockSize / 16
- // this will be refactored with prerender refactor
+ // this will be refactored with generateTextures refactor
const processObj = (x) => {
if (typeof x !== 'object' || !x) return
if (Array.isArray(x)) {
diff --git a/tsconfig.json b/tsconfig.json
index d6ed70d8f..754ae40e4 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,18 +1,24 @@
{
"compilerOptions": {
- "target": "ES2022",
+ "target": "ESNext",
"moduleResolution": "Node",
- "module": "CommonJS",
+ "module": "ESNext",
"allowJs": true,
"jsx": "react-jsx",
"allowSyntheticDefaultImports": true,
"noEmit": true,
- "strictFunctionTypes": true,
"resolveJsonModule": true,
- "noFallthroughCasesInSwitch": true
+ "strictFunctionTypes": true,
+ "noImplicitAny": false,
+ "noFallthroughCasesInSwitch": true,
+ "allowUnreachableCode": true,
+ "forceConsistentCasingInFileNames": true,
+ "useUnknownInCatchVariables": false,
+ "skipLibCheck": true
// "strictNullChecks": true
},
"include": [
- "src"
+ "src",
+ "cypress"
]
}