changed form reset and fixed systemvoice

This commit is contained in:
Polaris
2024-08-26 20:06:33 -04:00
parent bfe2403076
commit e22708f98a
9 changed files with 19 additions and 79 deletions

View File

@ -87,22 +87,15 @@ export const SystemVoiceCustomization: FC<SystemVoiceSelectionProps> = ({
updatePlayerSystemVoiceId(newSystemVoiceId).then(() => {
setSytemVoiceId(newSystemVoiceId);
});
resetFormValues();
toast({
title: "You submitted the following values:",
description: (
<pre className="mt-2 w-[340px] rounded-md bg-slate-950 p-4">
<code className="text-white">{JSON.stringify(data, null, 2)}</code>
<pre className="rounded-mdp-4 mt-2 w-[340px]">
<code className="text-white">System voice updated</code>
</pre>
),
});
function resetFormValues() {
form.reset({
PlayerSystemVoice: undefined,
});
}
}
const getTexture = (id: number | undefined, defaultSrc: string) => {
@ -116,7 +109,7 @@ export const SystemVoiceCustomization: FC<SystemVoiceSelectionProps> = ({
form.watch("PlayerSystemVoice"),
`systemVoiceThumbnails/CHU_UI_SystemVoice_${systemVoiceId.toString().padStart(8, "0")}.png`,
)
: `systemVoiceThumbnails/CHU_UI_SystemVoice_Default.png`, // Provide a default texture or handle the case when systemVoiceId is undefined
: `systemVoiceThumbnails/CHU_UI_SystemVoice_Default.png`,
},
};