changed form reset and fixed systemvoice
This commit is contained in:
@ -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`,
|
||||
},
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user