feat: add quest settings tab to admin panel
Some checks failed
Deploy to Production / test (push) Failing after 33s
Some checks failed
Deploy to Production / test (push) Failing after 33s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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<string, boolean>;
|
||||
system: Record<string, unknown>;
|
||||
}
|
||||
|
||||
@@ -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 (
|
||||
<SectionCard title="Quests" icon={Scroll}>
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-5">
|
||||
<Field
|
||||
label="Max Active Quests"
|
||||
hint="How many incomplete quests a player can have at once"
|
||||
>
|
||||
<NumberInput
|
||||
value={data.maxActiveQuests}
|
||||
onChange={(v) => onChange({ ...data, maxActiveQuests: v })}
|
||||
min={1}
|
||||
/>
|
||||
</Field>
|
||||
</div>
|
||||
</SectionCard>
|
||||
);
|
||||
}
|
||||
|
||||
function CommandsSection({
|
||||
commands,
|
||||
onChange,
|
||||
@@ -1369,6 +1397,12 @@ export default function Settings() {
|
||||
onChange={(v) => updateGameSection("moderation", v)}
|
||||
/>
|
||||
)}
|
||||
{activeSection === "quest" && (
|
||||
<QuestSection
|
||||
data={gameDraft.quest}
|
||||
onChange={(v) => updateGameSection("quest", v)}
|
||||
/>
|
||||
)}
|
||||
{activeSection === "commands" && (
|
||||
<CommandsSection
|
||||
commands={gameDraft.commands}
|
||||
|
||||
Reference in New Issue
Block a user