' +
'
' +
'
' +
@@ -59,6 +64,11 @@ const Leaderboard = {
self._updateTabs();
self._fetchAndRender();
});
+ $(document).on('click', '.lb-board', function() {
+ self._currentBoard = $(this).data('board');
+ self._updateTabs();
+ self._fetchAndRender();
+ });
this._updateTabs();
},
@@ -72,6 +82,15 @@ const Leaderboard = {
$(this).css({ background: '#1a1a2e', color: '#aaa', borderColor: '#555' });
}
});
+ var board = this._currentBoard;
+ $('.lb-board').each(function() {
+ if ($(this).data('board') === board) {
+ $(this).css({ background: '#92400e', color: '#fff', borderColor: '#f59e0b' });
+ } else {
+ $(this).css({ background: '#1a1a2e', color: '#aaa', borderColor: '#555' });
+ }
+ });
+ $('#leaderboard-title').text(board === 'pleb' ? '🪙 Pleb Board' : '🏅 Hall of Champions');
},
_fetchAndRender: function() {
@@ -80,7 +99,7 @@ const Leaderboard = {
$('#leaderboard-content').html('
Loading...
');
var self = this;
- $.getJSON('/api/leaderboard?period=' + this._currentPeriod + '&limit=20')
+ $.getJSON('/api/leaderboard?period=' + this._currentPeriod + '&board=' + this._currentBoard + '&limit=20')
.done(function(data) {
self._render(data.leaderboard || []);
})
diff --git a/html/js/ui/paymentUI.js b/html/js/ui/paymentUI.js
index dfedd27..03e988a 100644
--- a/html/js/ui/paymentUI.js
+++ b/html/js/ui/paymentUI.js
@@ -260,13 +260,17 @@ const PaymentUI = {
`);
}
- // === FREE mode (only if payments disabled) ===
- if (!this.config.paymentsEnabled) {
+ // === FREE play === shown when the instance is free-only OR offers free as a choice
+ // alongside paid (freePlayEnabled). Free games go to the Pleb leaderboard.
+ if (this.config.freePlayEnabled) {
+ const note = this.config.paymentsEnabled
+ ? 'No payout • Pleb leaderboard'
+ : 'No payments required';
$container.append(`
`);
}
@@ -278,7 +282,9 @@ const PaymentUI = {
if (mode === 'FREE') {
$('#payment-ui').hide();
if (window.socket) {
- window.socket.emit('enter_game');
+ // play_free records the game as FREE (Pleb leaderboard, no payout) even on
+ // an instance that also sells credits/entry.
+ window.socket.emit('play_free');
}
return;
}
diff --git a/src/game/gameModeManager.js b/src/game/gameModeManager.js
index efcbbec..cb9d38c 100644
--- a/src/game/gameModeManager.js
+++ b/src/game/gameModeManager.js
@@ -1149,6 +1149,7 @@ class GameModeManager {
creditPackages: creditPackages,
creditsPayoutBaseValue: this.creditsPayoutBaseValue,
paymentsEnabled: this.paymentsEnabled,
+ freePlayEnabled: this.freePlayEnabled,
directModeEnabled: this.directModeEnabled,
creditsModeEnabled: this.creditsModeEnabled,
directPayoutsEnabled: this.directPayoutMultipliers.escape > 0,