added chunithm version selector in admin settings
This commit is contained in:
@ -1,11 +1,12 @@
|
||||
"use server";
|
||||
|
||||
import { getAuth } from "@/auth/queries/getauth";
|
||||
import { supportedVersionNumber } from "@/lib/helpers";
|
||||
import { getSupportedVersionNumber } from "@/lib/api";
|
||||
import { artemis } from "@/lib/prisma";
|
||||
|
||||
export async function getCurrentMapIcon() {
|
||||
const { user } = await getAuth();
|
||||
const supportedVersionNumber = await getSupportedVersionNumber();
|
||||
|
||||
if (!user || !user.accessCode) {
|
||||
throw new Error("User is not authenticated or accessCode is missing");
|
||||
@ -25,6 +26,7 @@ export async function getCurrentMapIcon() {
|
||||
|
||||
export async function updatePlayerMapIcon(mapIconId?: number) {
|
||||
const { user } = await getAuth();
|
||||
const supportedVersionNumber = await getSupportedVersionNumber();
|
||||
|
||||
if (!user || !user.accessCode) {
|
||||
throw new Error("User is not authenticated or accessCode is missing");
|
||||
|
@ -108,7 +108,7 @@ export const MapIconCustomization: FC<SystemVoiceSelectionProps> = ({
|
||||
mapIconId: {
|
||||
src: mapIconId
|
||||
? getTexture(
|
||||
form.watch("mapIconId"),
|
||||
mapIconId, // Use mapIconId directly
|
||||
`mapIcon/CHU_UI_MapIcon_${mapIconId.toString().padStart(8, "0")}.png`,
|
||||
)
|
||||
: `systemVoiceThumbnails/CHU_UI_SystemVoice_Default.png`,
|
||||
@ -121,7 +121,11 @@ export const MapIconCustomization: FC<SystemVoiceSelectionProps> = ({
|
||||
<div className="">
|
||||
{Object.entries(MapIconTextures).map(([key, { src }]) => (
|
||||
<div>
|
||||
<img className="w-[100px]" src={src} alt={""} />
|
||||
<img
|
||||
className="w-[100px]"
|
||||
src={MapIconTextures.mapIconId.src}
|
||||
alt={mapIconId ? `Map Icon ${mapIconId}` : "Default Map Icon"}
|
||||
/>{" "}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
@ -133,7 +137,7 @@ export const MapIconCustomization: FC<SystemVoiceSelectionProps> = ({
|
||||
name="mapIconId"
|
||||
render={({ field }) => (
|
||||
<FormItem className="flex flex-col">
|
||||
<FormLabel>Select Map Icon</FormLabel>
|
||||
<FormLabel className="pb-2">Select Map Icon</FormLabel>
|
||||
<Popover>
|
||||
<PopoverTrigger asChild>
|
||||
<FormControl>
|
||||
|
Reference in New Issue
Block a user