Android build v1.1.8
This commit is contained in:
+12
-3
@@ -150,6 +150,16 @@ function formatDualTime(seconds: number) {
|
||||
return `${Math.floor(total / 60)}:${String(total % 60).padStart(2, '0')}`
|
||||
}
|
||||
|
||||
function shouldRelayBottomAction(
|
||||
action: InputAction,
|
||||
state: DualScreenCombatState | null,
|
||||
) {
|
||||
if (!state) return false
|
||||
if (action === 'confirm' || action === 'toggleTouchLock') return false
|
||||
if (state.status === 'playing') return true
|
||||
return action === 'pause' || action === 'back'
|
||||
}
|
||||
|
||||
export function DualScreenProvider({ children }: { children: ReactNode }) {
|
||||
const [enabled, setEnabledState] = useState(
|
||||
() => localStorage.getItem(STORAGE_KEY) === 'true',
|
||||
@@ -404,8 +414,7 @@ export function DualScreenBottomDisplay() {
|
||||
}
|
||||
|
||||
useGameAction((action) => {
|
||||
if (!state || state.opponentParty) return
|
||||
if (action === 'confirm' || action === 'back' || action === 'toggleTouchLock') return
|
||||
if (!shouldRelayBottomAction(action, state)) return
|
||||
sendAction(action)
|
||||
})
|
||||
|
||||
@@ -458,7 +467,7 @@ export function DualScreenBottomDisplay() {
|
||||
return (
|
||||
<main
|
||||
className={`dual-bottom-display ${state.opponentParty ? 'pvp-opponent-bottom-display' : ''}`}
|
||||
data-combat-active={!state.opponentParty && state.status === 'playing' && !state.paused ? 'true' : 'false'}
|
||||
data-combat-active={state.status === 'playing' && !state.paused ? 'true' : 'false'}
|
||||
>
|
||||
<header className="dual-controls-header">
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user