{
// Prevent toggling when clicking the input
if (
(e.target as HTMLElement).tagName.toLowerCase() ===
"input"
)
return;
this.maxTimer = !this.maxTimer;
if (!this.maxTimer) {
this.maxTimerValue = undefined;
} else {
// Set default value when enabling if not already set or invalid
if (!this.maxTimerValue || this.maxTimerValue <= 0) {
this.maxTimerValue = 30;
}
// Focus the input after render
setTimeout(() => {
const input = this.getEndTimerInput();
if (input) {
input.focus();
input.select();
}
}, 0);
}
}}
>
${this.maxTimer
? html``
: ""}
${this.maxTimer
? html``
: html``}
${translateText("single_modal.max_timer")}
{
if (
(e.target as HTMLElement).tagName.toLowerCase() ===
"input"
)
return;
this.goldMultiplier = !this.goldMultiplier;
if (!this.goldMultiplier) {
this.goldMultiplierValue = undefined;
} else {
if (
!this.goldMultiplierValue ||
this.goldMultiplierValue <= 0
) {
this.goldMultiplierValue = 2;
}
setTimeout(() => {
const input = this.renderRoot.querySelector(
"#gold-multiplier-value",
) as HTMLInputElement;
if (input) {
input.focus();
input.select();
}
}, 0);
}
}}
>
${this.goldMultiplier
? html``
: ""}
${this.goldMultiplier
? html``
: html``}
${translateText("single_modal.gold_multiplier")}
{
if (
(e.target as HTMLElement).tagName.toLowerCase() ===
"input"
)
return;
this.startingGold = !this.startingGold;
if (!this.startingGold) {
this.startingGoldValue = undefined;
} else {
if (
!this.startingGoldValue ||
this.startingGoldValue < 0
) {
this.startingGoldValue = 5000000;
}
setTimeout(() => {
const input = this.renderRoot.querySelector(
"#starting-gold-value",
) as HTMLInputElement;
if (input) {
input.focus();
input.select();
}
}, 0);
}
}}
>