From 47ea6d862043c2a621a0e57fcab4cf4daf43ad8e Mon Sep 17 00:00:00 2001 From: syntaxbullet Date: Sat, 28 Mar 2026 16:33:44 +0100 Subject: [PATCH] feat: add quest settings tab to admin panel Co-Authored-By: Claude Opus 4.6 (1M context) --- panel/src/lib/useSettings.ts | 5 +++++ panel/src/pages/Settings.tsx | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/panel/src/lib/useSettings.ts b/panel/src/lib/useSettings.ts index 34be1fc..02af6ec 100644 --- a/panel/src/lib/useSettings.ts +++ b/panel/src/lib/useSettings.ts @@ -63,6 +63,10 @@ export interface ModerationConfig { }; } +export interface QuestConfig { + maxActiveQuests: number; +} + export interface GameSettings { leveling: LevelingConfig; economy: EconomyConfig; @@ -70,6 +74,7 @@ export interface GameSettings { lootdrop: LootdropConfig; trivia: TriviaConfig; moderation: ModerationConfig; + quest: QuestConfig; commands: Record; system: Record; } diff --git a/panel/src/pages/Settings.tsx b/panel/src/pages/Settings.tsx index e1e36ca..d766333 100644 --- a/panel/src/pages/Settings.tsx +++ b/panel/src/pages/Settings.tsx @@ -14,6 +14,7 @@ import { RotateCcw, Server, X, + Scroll, } from "lucide-react"; import { cn } from "../lib/utils"; import { @@ -35,6 +36,7 @@ type SettingsSection = | "lootdrop" | "trivia" | "moderation" + | "quest" | "commands"; const sections: { @@ -49,6 +51,7 @@ const sections: { { key: "lootdrop", label: "Lootdrops", icon: Gift }, { key: "trivia", label: "Trivia", icon: Brain }, { key: "moderation", label: "Moderation", icon: Shield }, + { key: "quest", label: "Quests", icon: Scroll }, { key: "commands", label: "Commands", icon: Terminal }, ]; @@ -1055,6 +1058,31 @@ function ModerationSection({ ); } +function QuestSection({ + data, + onChange, +}: { + data: GameSettings["quest"]; + onChange: (d: GameSettings["quest"]) => void; +}) { + return ( + +
+ + onChange({ ...data, maxActiveQuests: v })} + min={1} + /> + +
+
+ ); +} + function CommandsSection({ commands, onChange, @@ -1369,6 +1397,12 @@ export default function Settings() { onChange={(v) => updateGameSection("moderation", v)} /> )} + {activeSection === "quest" && ( + updateGameSection("quest", v)} + /> + )} {activeSection === "commands" && (