fix(play): quiz_carry embed bots pathfind clock + embed question strip
- botQuizCarryPathfindAfter must align with performance.now() in stepQuizCarryPreviewBots; avoid Date epoch after countdown - reset bot pathfind gate when embed countdown completes - add quiz-carry-embed-q-strip HUD for question text when map panel hidden in editor embed - bump play.js cache bust to v=0.088 Made-with: Cursor
This commit is contained in:
@@ -749,6 +749,32 @@
|
||||
panel.setAttribute('aria-hidden', 'false');
|
||||
}
|
||||
|
||||
/** เอดิเตอร์ embed quiz_carry: แผงทองทับกลางถูกปิด — แสดงคำถามแถบล่างแทน (ไม่บังจอ) */
|
||||
function syncQuizCarryEmbedQuestionStrip() {
|
||||
const wrap = document.getElementById('quiz-carry-embed-q-strip');
|
||||
const p = document.getElementById('quiz-carry-embed-q-strip-text');
|
||||
if (!wrap || !p) return;
|
||||
if (!(previewMode && editorEmbedReturn && isQuizCarry())) {
|
||||
wrap.classList.add('is-hidden');
|
||||
wrap.setAttribute('aria-hidden', 'true');
|
||||
return;
|
||||
}
|
||||
if (isQuizCarryEmbedCountdownBlockingMovement()) {
|
||||
wrap.classList.add('is-hidden');
|
||||
wrap.setAttribute('aria-hidden', 'true');
|
||||
return;
|
||||
}
|
||||
const t = (playQuizText || '').trim();
|
||||
if (!t) {
|
||||
wrap.classList.add('is-hidden');
|
||||
wrap.setAttribute('aria-hidden', 'true');
|
||||
return;
|
||||
}
|
||||
p.textContent = t;
|
||||
wrap.classList.remove('is-hidden');
|
||||
wrap.setAttribute('aria-hidden', 'false');
|
||||
}
|
||||
|
||||
function updatePlayQuizTimerDisplay() {
|
||||
const el = document.getElementById('quiz-game-timer');
|
||||
if (!el) return;
|
||||
@@ -1863,6 +1889,10 @@
|
||||
const qEl = document.getElementById('quiz-game-question');
|
||||
if (qEl) qEl.textContent = playQuizText;
|
||||
quizCarryRestoreEmbedPhaseLabel();
|
||||
others.forEach((o) => {
|
||||
if (!o) return;
|
||||
o.botQuizCarryPathfindAfter = 0;
|
||||
});
|
||||
return;
|
||||
}
|
||||
const elapsed = now - quizCarryEmbedCountdownStartAt;
|
||||
@@ -1900,7 +1930,8 @@
|
||||
if (!o) return;
|
||||
o.botPath = [];
|
||||
o.botPathStuckTicks = 0;
|
||||
o.botQuizCarryPathfindAfter = quizCarryEmbedCountdownEndAt + 50;
|
||||
/* ต้องใช้ performance.now() ช่วงกับ stepQuizCarryPreviewBots — ห้ามใช้ Date.now() epoch ไม่งั้นบอทค้าง pathfind ตลอด */
|
||||
o.botQuizCarryPathfindAfter = 0;
|
||||
});
|
||||
const qEl = document.getElementById('quiz-game-question');
|
||||
if (qEl) qEl.textContent = '…';
|
||||
@@ -7292,7 +7323,10 @@
|
||||
ctx.fillText('Space / คลิก = ปล่อย', 10, 44);
|
||||
}
|
||||
}
|
||||
if (isQuiz() || isQuizCarry() || isQuizBattle()) syncPlayQuizMapPanel();
|
||||
if (isQuiz() || isQuizCarry() || isQuizBattle()) {
|
||||
syncPlayQuizMapPanel();
|
||||
syncQuizCarryEmbedQuestionStrip();
|
||||
}
|
||||
if (previewFillBots && mapData && !useCyberPlayHud()) {
|
||||
const human = countPlayHumans();
|
||||
const bots = [...others.keys()].filter(isPreviewBotId).length;
|
||||
|
||||
@@ -121,6 +121,30 @@
|
||||
text-shadow: 0 0 48px rgba(255, 224, 102, 0.55), 0 4px 24px rgba(0, 0, 0, 0.65);
|
||||
letter-spacing: -0.04em;
|
||||
}
|
||||
#quiz-carry-embed-q-strip {
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
bottom: max(52px, calc(env(safe-area-inset-bottom) + 44px));
|
||||
transform: translateX(-50%);
|
||||
z-index: 10075;
|
||||
max-width: min(92vw, 640px);
|
||||
padding: 0.45rem 0.75rem 0.5rem;
|
||||
border-radius: 12px;
|
||||
background: rgba(12, 14, 28, 0.94);
|
||||
border: 1px solid rgba(122, 162, 247, 0.45);
|
||||
box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
|
||||
pointer-events: none;
|
||||
}
|
||||
#quiz-carry-embed-q-strip.is-hidden { display: none !important; }
|
||||
#quiz-carry-embed-q-strip-text {
|
||||
margin: 0;
|
||||
font: 600 clamp(0.78rem, 2.2vmin, 1.05rem) / 1.45 system-ui, "Kanit", sans-serif;
|
||||
color: #f1f5f9;
|
||||
text-align: center;
|
||||
text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
|
||||
max-height: 22vh;
|
||||
overflow: auto;
|
||||
}
|
||||
#play-quiz-scoreboard {
|
||||
position: fixed;
|
||||
top: max(56px, env(safe-area-inset-top));
|
||||
@@ -634,6 +658,9 @@
|
||||
<div id="quiz-carry-embed-countdown" class="is-hidden" role="alert" aria-live="assertive" aria-atomic="true" aria-hidden="true">
|
||||
<div id="quiz-carry-embed-countdown-inner"><span id="quiz-carry-embed-countdown-num">3</span></div>
|
||||
</div>
|
||||
<div id="quiz-carry-embed-q-strip" class="is-hidden" role="status" aria-live="polite" aria-atomic="true" aria-hidden="true">
|
||||
<p id="quiz-carry-embed-q-strip-text"></p>
|
||||
</div>
|
||||
<div id="quiz-game-overlay" class="is-hidden" role="status" aria-live="polite" aria-atomic="true">
|
||||
<div class="quiz-game-inner">
|
||||
<div class="quiz-game-phase" id="quiz-game-phase-label"></div>
|
||||
@@ -692,7 +719,7 @@
|
||||
</div>
|
||||
<script src="/Game/socket.io/socket.io.js"></script>
|
||||
<script src="js/version.js?v=0.0166"></script>
|
||||
<script src="js/play.js?v=0.087"></script>
|
||||
<script src="js/play.js?v=0.088"></script>
|
||||
<div class="version-tag">v —</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user