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 {
|
export interface GameSettings {
|
||||||
leveling: LevelingConfig;
|
leveling: LevelingConfig;
|
||||||
economy: EconomyConfig;
|
economy: EconomyConfig;
|
||||||
@@ -70,6 +74,7 @@ export interface GameSettings {
|
|||||||
lootdrop: LootdropConfig;
|
lootdrop: LootdropConfig;
|
||||||
trivia: TriviaConfig;
|
trivia: TriviaConfig;
|
||||||
moderation: ModerationConfig;
|
moderation: ModerationConfig;
|
||||||
|
quest: QuestConfig;
|
||||||
commands: Record<string, boolean>;
|
commands: Record<string, boolean>;
|
||||||
system: Record<string, unknown>;
|
system: Record<string, unknown>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import {
|
|||||||
RotateCcw,
|
RotateCcw,
|
||||||
Server,
|
Server,
|
||||||
X,
|
X,
|
||||||
|
Scroll,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { cn } from "../lib/utils";
|
import { cn } from "../lib/utils";
|
||||||
import {
|
import {
|
||||||
@@ -35,6 +36,7 @@ type SettingsSection =
|
|||||||
| "lootdrop"
|
| "lootdrop"
|
||||||
| "trivia"
|
| "trivia"
|
||||||
| "moderation"
|
| "moderation"
|
||||||
|
| "quest"
|
||||||
| "commands";
|
| "commands";
|
||||||
|
|
||||||
const sections: {
|
const sections: {
|
||||||
@@ -49,6 +51,7 @@ const sections: {
|
|||||||
{ key: "lootdrop", label: "Lootdrops", icon: Gift },
|
{ key: "lootdrop", label: "Lootdrops", icon: Gift },
|
||||||
{ key: "trivia", label: "Trivia", icon: Brain },
|
{ key: "trivia", label: "Trivia", icon: Brain },
|
||||||
{ key: "moderation", label: "Moderation", icon: Shield },
|
{ key: "moderation", label: "Moderation", icon: Shield },
|
||||||
|
{ key: "quest", label: "Quests", icon: Scroll },
|
||||||
{ key: "commands", label: "Commands", icon: Terminal },
|
{ 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({
|
function CommandsSection({
|
||||||
commands,
|
commands,
|
||||||
onChange,
|
onChange,
|
||||||
@@ -1369,6 +1397,12 @@ export default function Settings() {
|
|||||||
onChange={(v) => updateGameSection("moderation", v)}
|
onChange={(v) => updateGameSection("moderation", v)}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{activeSection === "quest" && (
|
||||||
|
<QuestSection
|
||||||
|
data={gameDraft.quest}
|
||||||
|
onChange={(v) => updateGameSection("quest", v)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{activeSection === "commands" && (
|
{activeSection === "commands" && (
|
||||||
<CommandsSection
|
<CommandsSection
|
||||||
commands={gameDraft.commands}
|
commands={gameDraft.commands}
|
||||||
|
|||||||
Reference in New Issue
Block a user