minigame 4 add more design 1.7
This commit is contained in:
@@ -1840,6 +1840,8 @@
|
||||
let quizTfScorePlusImg = null;
|
||||
/** คะแนนต่อคำตอบที่ถูกเมื่อส่งป้ายที่ฮับ/โซนส่ง — quiz_carry เท่านั้น */
|
||||
const QUIZ_CARRY_POINTS_PER_CORRECT = 10;
|
||||
/** ครบเซสชัน (แมปสรุปภารกิจ): โชว์ result-complete / gameover กี่ ms ก่อนแผงสรุปผล */
|
||||
const QUIZ_CARRY_SESSION_END_SPLASH_MS = 3000;
|
||||
/** quiz_carry: หยิบตัวเลือกมาวางโซนกลาง — เล่นพร้อมกัน (ไม่สลับตา) */
|
||||
let quizCarryPool = [];
|
||||
let quizCarryCurrent = null;
|
||||
@@ -1866,6 +1868,8 @@
|
||||
let quizCarryResultEndTimer = null;
|
||||
/** หลังโชว์ result-end (embed preview): รอ 5s แล้วกลับ room-lobby — ใช้ร่วม quiz_carry + crown */
|
||||
let embedPreviewLobbyReturnTimer = null;
|
||||
/** ครบเซสชัน (mission summary แมป): รอ splash แล้วเปิด #quiz-carry-mission-overlay */
|
||||
let quizCarrySessionCompleteResultToSummaryT = null;
|
||||
/** embed พรีวิว: รอ Ready / START ของโฮสต์ก่อนนับ 3–2–1 */
|
||||
let quizCarryPregameActive = false;
|
||||
let playHostId = null;
|
||||
@@ -7113,6 +7117,13 @@
|
||||
cancelEmbedPreviewLobbyReturnTimer();
|
||||
}
|
||||
|
||||
function cancelQuizCarrySessionCompleteResultToSummary() {
|
||||
if (quizCarrySessionCompleteResultToSummaryT != null) {
|
||||
clearTimeout(quizCarrySessionCompleteResultToSummaryT);
|
||||
quizCarrySessionCompleteResultToSummaryT = null;
|
||||
}
|
||||
}
|
||||
|
||||
function cancelQuizCarryAnswerRoundTimeupAuto() {
|
||||
if (quizCarryAnswerRoundTimeupAutoT != null) {
|
||||
clearTimeout(quizCarryAnswerRoundTimeupAutoT);
|
||||
@@ -7409,12 +7420,9 @@
|
||||
const btn = document.getElementById('btn-quiz-carry-mission-done');
|
||||
if (btn) {
|
||||
btn.onclick = function () {
|
||||
cancelQuizCarrySessionCompleteResultToSummary();
|
||||
overlay.classList.add('is-hidden');
|
||||
if (previewMode && editorEmbedReturn) {
|
||||
showQuizCarryTimeupOnDeskLayer();
|
||||
} else {
|
||||
window.location.href = 'room-lobby.html?space=' + encodeURIComponent(spaceId) + '&nick=' + encodeURIComponent(nick);
|
||||
}
|
||||
window.location.href = 'room-lobby.html?space=' + encodeURIComponent(spaceId) + '&nick=' + encodeURIComponent(nick);
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -7446,9 +7454,22 @@
|
||||
if (phaseEl) phaseEl.textContent = 'ครบ ' + String(quizCarryRoundsCompleted) + ' ข้อ';
|
||||
const missionOv = document.getElementById('quiz-carry-mission-overlay');
|
||||
if (missionOv && quizCarryUseMissionSummaryOverlay) {
|
||||
showQuizCarryMissionSummaryOverlay({
|
||||
forceGradeF: !!(playQuizPlayerLocal && playQuizPlayerLocal.eliminated),
|
||||
});
|
||||
cancelQuizCarrySessionCompleteResultToSummary();
|
||||
hideQuizCarryResultEndLayer();
|
||||
const summaryOpts = { forceGradeF: !!(playQuizPlayerLocal && playQuizPlayerLocal.eliminated) };
|
||||
const splashRanks = quizCarryBuildMissionRankList();
|
||||
const splashParts = splashRanks.map((r) => Math.max(0, Number(r.score) || 0));
|
||||
const splashTotal = splashParts.reduce((a, b) => a + b, 0);
|
||||
const splashN = splashRanks.length;
|
||||
const splashAvg = splashN ? Math.min(100, Math.max(0, Math.round(splashTotal / splashN))) : 0;
|
||||
const splashGrade = summaryOpts.forceGradeF ? 'F' : quizCarryGradeFromTeamAverage(splashAvg);
|
||||
const useCompleteSplash = splashGrade !== 'F';
|
||||
showQuizCarryResultEndLayer(useCompleteSplash);
|
||||
quizCarrySessionCompleteResultToSummaryT = setTimeout(function () {
|
||||
quizCarrySessionCompleteResultToSummaryT = null;
|
||||
hideQuizCarryResultEndLayer();
|
||||
showQuizCarryMissionSummaryOverlay(summaryOpts);
|
||||
}, QUIZ_CARRY_SESSION_END_SPLASH_MS);
|
||||
renderPlayQuizScoreboard(playLiveQuizScores);
|
||||
return;
|
||||
}
|
||||
@@ -7727,6 +7748,9 @@
|
||||
}
|
||||
|
||||
function resetQuizCarryPlayState() {
|
||||
cancelQuizCarrySessionCompleteResultToSummary();
|
||||
const qcmo = document.getElementById('quiz-carry-mission-overlay');
|
||||
if (qcmo) qcmo.classList.add('is-hidden');
|
||||
quizCarryPregameActive = false;
|
||||
hideQuizCarryPregameOverlay();
|
||||
quizCarryPool = [];
|
||||
@@ -7798,6 +7822,7 @@
|
||||
}
|
||||
|
||||
async function loadQuizCarryPoolAndStart() {
|
||||
cancelQuizCarrySessionCompleteResultToSummary();
|
||||
quizCarryEmbedPreOptionCountdownStartAt = 0;
|
||||
quizCarryEmbedPreOptionCountdownEndAt = 0;
|
||||
quizCarryRoundsCompleted = 0;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ทุกครั้งที่มีการเพิ่มหรือเปลี่ยน ให้เพิ่ม v +0.0001
|
||||
// หลังแก้ค่าแล้วต้อง copy ไป path ที่ Nginx ชี้ (หรือรัน copy-frogger-files-only.sh) ถึงจะเห็นบนเว็บ
|
||||
window.APP_VERSION = '0.0298';
|
||||
window.APP_VERSION = '0.0299';
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
var t = document.querySelector('.version-tag');
|
||||
if (t) t.textContent = 'v ' + window.APP_VERSION;
|
||||
|
||||
@@ -3021,8 +3021,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<script src="/Game/socket.io/socket.io.js"></script>
|
||||
<script src="js/version.js?v=0.0298"></script>
|
||||
<script src="js/play.js?v=0.0298"></script>
|
||||
<script src="js/version.js?v=0.0299"></script>
|
||||
<script src="js/play.js?v=0.0299"></script>
|
||||
<div class="version-tag">v —</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user