Add Void difficulty and publish changelogs
Some checks failed
Deploy MineGeo to Dokploy / deploy (push) Failing after 3m40s

This commit is contained in:
2026-10-20 14:05:01 +05:00
parent 3ba398a838
commit de0e891b62
37 changed files with 995 additions and 65 deletions

View File

@@ -56,6 +56,7 @@ export function TournamentIndex({
const [clock, setClock] = useState(0);
const [timerMode, setTimerMode] = useState<"shared" | "perMini">("shared");
const [roundSeconds, setRoundSeconds] = useState(450);
const [difficulty, setDifficulty] = useState("normal");
const offset = useRef(0);
const load = useCallback(async () => {
try {
@@ -115,8 +116,8 @@ export function TournamentIndex({
difficulty: form.get("difficulty"),
playerLimit: Number(form.get("limit")),
roundCount: Number(form.get("rounds")),
roundTimeSeconds: Number(form.get("seconds")),
timerMode: form.get("timerMode"),
roundTimeSeconds: difficulty === "void" ? 10 : roundSeconds,
timerMode: difficulty === "void" ? "perMini" : timerMode,
startsAt: serverLocalToIso(
String(form.get("start")),
events.serverTimezone,
@@ -211,10 +212,15 @@ export function TournamentIndex({
</label>
<label>
{t("Difficulty")}
<select name="difficulty" defaultValue="normal">
<select
name="difficulty"
value={difficulty}
onChange={(event) => setDifficulty(event.target.value)}
>
<option value="easy">{t("Easy")}</option>
<option value="normal">{t("Normal")}</option>
<option value="hard">{t("Hard")}</option>
<option value="void">{t("Void")}</option>
{presets.map((preset) => (
<option key={preset.id} value={preset.id}>
{preset.name}
@@ -248,7 +254,8 @@ export function TournamentIndex({
{t("Timer mode")}
<select
name="timerMode"
value={timerMode}
value={difficulty === "void" ? "perMini" : timerMode}
disabled={difficulty === "void"}
onChange={(e) => {
const mode = e.target.value as "shared" | "perMini";
setTimerMode(mode);
@@ -265,17 +272,18 @@ export function TournamentIndex({
</label>
<label>
{t(
timerMode === "shared"
difficulty !== "void" && timerMode === "shared"
? "Seconds per tournament round"
: "Seconds per mini-round",
)}
<input
name="seconds"
type="number"
min={15}
min={difficulty === "void" ? 10 : 15}
max={timerMode === "shared" ? 3000 : 600}
step={15}
value={roundSeconds}
step={difficulty === "void" ? 5 : 15}
value={difficulty === "void" ? 10 : roundSeconds}
disabled={difficulty === "void"}
onChange={(e) => setRoundSeconds(Number(e.target.value))}
required
/>