wip mission 2

This commit is contained in:
math-pixel
2026-05-11 16:46:22 +02:00
parent 32d644b09d
commit f7b968abe7
19 changed files with 449 additions and 94 deletions
+5
View File
@@ -0,0 +1,5 @@
import { useGameStore } from "@/stores/gameStore";
export function useActivityCity(): boolean {
return useGameStore((state) => state.activityCity);
}
+27
View File
@@ -0,0 +1,27 @@
import { useState } from "react";
interface DialogState {
message: string;
visible: boolean;
}
export function useDialog(): {
dialog: DialogState;
showDialog: (message: string) => void;
hideDialog: () => void;
} {
const [dialog, setDialog] = useState<DialogState>({
message: "",
visible: false,
});
const showDialog = (message: string): void => {
setDialog({ message, visible: true });
};
const hideDialog = (): void => {
setDialog((prev) => ({ ...prev, visible: false }));
};
return { dialog, showDialog, hideDialog };
}