Added - confirmation when queue gets created

This commit is contained in:
jakub.salavec
2025-06-16 14:17:43 +02:00
parent eb71794f38
commit 3a48de002a

View File

@@ -443,56 +443,57 @@ var GempLotrHallUI = Class.extend({
},
createTournament: function() {
const type = $("#gameTypeSelect").val();
// Depending on the type, pick the correct format code from the formatSelect dropdown
const formatCode = $("#formatSelect").val();
var that = this;
// Assign the format codes based on the selected game type
let sealedFormatCode = null;
let soloDraftFormatCode = null;
let tableDraftFormatCode = null;
const type = $("#gameTypeSelect").val();
// Depending on the type, pick the correct format code from the formatSelect dropdown
const formatCode = $("#formatSelect").val();
if (type === "sealed") {
sealedFormatCode = formatCode;
} else if (type === "solodraft") {
soloDraftFormatCode = formatCode;
} else if (type === "table_draft") {
tableDraftFormatCode = formatCode;
}
// Assign the format codes based on the selected game type
let sealedFormatCode = null;
let soloDraftFormatCode = null;
let tableDraftFormatCode = null;
// Draft timer only applies to table draft
const tableDraftTimer = type === "table_draft" ? $("#draftTimer").val() : null;
if (type === "sealed") {
sealedFormatCode = formatCode;
} else if (type === "solodraft") {
soloDraftFormatCode = formatCode;
} else if (type === "table_draft") {
tableDraftFormatCode = formatCode;
}
const playoff = $("#pairingType").val();
const competitive = $("#competitiveSelect").val();
const startableEarly = $("#startableEarlySelect").val();
const readyCheck = $("#readyCheckSelect").val();
// Draft timer only applies to table draft
const tableDraftTimer = type === "table_draft" ? $("#draftTimer").val() : null;
const playoff = $("#pairingType").val();
const competitive = $("#competitiveSelect").val();
const startableEarly = $("#startableEarlySelect").val();
const readyCheck = $("#readyCheckSelect").val();
// Number input
const deckbuildingDuration = parseInt($("#deckDuration").val(), 10) || 15;
const maxPlayers = parseInt($("#numPlayers").val(), 10) || 4;
// Number input
const deckbuildingDuration = parseInt($("#deckDuration").val(), 10) || 15;
const maxPlayers = parseInt($("#numPlayers").val(), 10) || 4;
// Call the communication layer with all gathered values
this.comm.createTournament(
type,
maxPlayers,
sealedFormatCode,
soloDraftFormatCode,
tableDraftFormatCode,
tableDraftTimer,
playoff,
deckbuildingDuration,
competitive,
startableEarly,
readyCheck,
function(json) {
// Success callback — handle your response here
console.log("Tournament created successfully:", json);
// You can add preview or other logic here as needed
},
this.hallErrorMap()
);
// Call the communication layer with all gathered values
this.comm.createTournament(
type,
maxPlayers,
sealedFormatCode,
soloDraftFormatCode,
tableDraftFormatCode,
tableDraftTimer,
playoff,
deckbuildingDuration,
competitive,
startableEarly,
readyCheck,
function(json) {
// Success callback
that.showDialog("Tournament Update", "Tournament queue created successfully");
},
this.hallErrorMap()
);
},
initTable: function(displayed, headerID, tableID) {