mirror of
https://github.com/Such-Software/wownerogue.git
synced 2026-12-03 12:24:29 +01:00
feat(entry): START GAME shows the wait-vs-drop-in choice for free games too
Previously the timing-choice modal (Start Now / Wait for Next Block) only appeared for paid-credits players; free players got a silent immediate drop-in. Now it shows whenever the game would start instantly: - Server getGameModeInfo exposes freePlayEnabled (was server-only) so the client knows free play is available even on a paid instance. - Client (inputHandler) gates the modal on free-play-available OR paid-credits-with-credits; the modal is purely a TIMING pick (auto_start vs join_queue) — payment method is unchanged. - Modal cost text reflects free play. Both waiting animations are untouched: they render on the ROT display via WaitingScreenAnimator using the base GameTiles, independent of the render-kit packs (which are disabled for SP anyway), so they work regardless of visualization style. Suite 62/435 green.
This commit is contained in:
@@ -201,20 +201,22 @@ const InputHandler = {
|
||||
setupClickHandlers: function() {
|
||||
// Add click handling for the HTML START button
|
||||
$('#startButton').click(function(e) {
|
||||
// If early entry is available and user has credits, show choice modal
|
||||
// Show the wait-vs-drop-in TIMING choice whenever the game would start instantly (no
|
||||
// upfront payment): free play (this instance allows it), a FREE instance, or paid-credits
|
||||
// with credits in hand. The chosen payment method flows through auto_start / join_queue
|
||||
// unchanged — this modal only picks WHEN you enter.
|
||||
if (typeof SocketHandlers !== 'undefined') {
|
||||
var isPaidCredits = SocketHandlers._gameMode === 'PAID_CREDITS';
|
||||
var mode = SocketHandlers._gameMode;
|
||||
var freeAvailable = SocketHandlers._freePlayEnabled || mode === 'FREE';
|
||||
var hasCredits = SocketHandlers._creditsBalance >= (SocketHandlers._creditsPerGame || 1);
|
||||
var earlyAllowed = SocketHandlers._earlyEntryConfig &&
|
||||
SocketHandlers._earlyEntryConfig.enabled &&
|
||||
SocketHandlers._earlyEntryConfig.allowInCreditsMode;
|
||||
if (isPaidCredits && hasCredits && earlyAllowed) {
|
||||
SocketHandlers.showEntryChoiceModal();
|
||||
var instantStart = freeAvailable || (mode === 'PAID_CREDITS' && hasCredits);
|
||||
if (instantStart) {
|
||||
SocketHandlers.showEntryChoiceModal({ freeAvailable: freeAvailable, hasCredits: hasCredits });
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Default: attempt immediate start
|
||||
// Default: attempt immediate start (payment-required modes go through their own flow)
|
||||
socket.emit('auto_start');
|
||||
|
||||
// Check if we should show waiting screen
|
||||
|
||||
Reference in New Issue
Block a user