turns stuff testings

This commit is contained in:
legop3
2026-05-12 14:45:03 -04:00
parent 53ca7aca0a
commit c4f470b329
8 changed files with 202 additions and 147 deletions
@@ -19,6 +19,7 @@ function HudOverlay({
mobileHud = false,
mapPosition = 'top-center',
turnTimerText = null,
turnTimerFlashActive = false,
labelScale = 1,
}) {
const isMobile = mobileHud;
@@ -147,7 +148,9 @@ function HudOverlay({
</div>
{turnTimerText ? (
<div
className={`absolute left-1/2 top-0.5 -translate-x-1/2 rounded bg-black/70 text-slate-100 ${timerPadClass} ${timerTextClass}`}
className={`absolute left-1/2 top-0.5 -translate-x-1/2 rounded transition-colors ${
turnTimerFlashActive ? 'bg-red-900/80 text-red-100' : 'bg-black/70 text-slate-100'
} ${timerPadClass} ${timerTextClass}`}
>
{turnTimerText}
</div>
+11
View File
@@ -47,6 +47,8 @@ export default function VideoTile({
turnTimerText = null,
isActiveDriver = false,
idleSkipSeconds = null,
showNotTurnNotice = false,
notTurnFlashAt = 0,
}) {
const discordUrl = useSessionSelector((state) => {
const socials = state.session?.socials || [];
@@ -72,6 +74,7 @@ export default function VideoTile({
const [restartToken, setRestartToken] = useState(0);
const [audioRestartToken, setAudioRestartToken] = useState(0);
const [muted, setMuted] = useState(true);
const [noticeFlashActive, setNoticeFlashActive] = useState(false);
const hasDedicatedAudio = Boolean(audioSessionInfo?.url);
const usingSnapshot = videoMode === 'snapshot';
const sensors = telemetryFrame?.sensors;
@@ -298,6 +301,13 @@ export default function VideoTile({
[],
);
useEffect(() => {
if (!showNotTurnNotice || !notTurnFlashAt) return undefined;
setNoticeFlashActive(true);
const timer = setTimeout(() => setNoticeFlashActive(false), 650);
return () => clearTimeout(timer);
}, [showNotTurnNotice, notTurnFlashAt]);
useEffect(() => {
if (status === 'playing') {
attemptUnmute(0);
@@ -634,6 +644,7 @@ export default function VideoTile({
mobileHud={mobileHud}
mapPosition={effectiveHudMapPosition}
turnTimerText={turnTimerText}
turnTimerFlashActive={noticeFlashActive}
labelScale={hudLabelScale}
/>
) : null}