From 7b772c105c3ad084709f540b4f9cf51ed0c5b0bb Mon Sep 17 00:00:00 2001 From: Oleg Lokhvitsky Date: Sun, 1 Dec 2024 10:19:55 -0800 Subject: [PATCH] Prevent revert icon from showing up for overridden fields --- src/renderer/react/settings/ModSettingsField.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/renderer/react/settings/ModSettingsField.tsx b/src/renderer/react/settings/ModSettingsField.tsx index 5639e0b..461c89e 100644 --- a/src/renderer/react/settings/ModSettingsField.tsx +++ b/src/renderer/react/settings/ModSettingsField.tsx @@ -21,6 +21,14 @@ export default function ModSettingsField({ field, mod, }: Props): JSX.Element | null { + const overrideValue = + field.overrideValue == null + ? null + : parseBinding( + field.overrideValue, + mod.config, + ) ?? null; + const setModConfig = useSetModConfig(); const onChangeConfig = useCallback( @@ -102,7 +110,8 @@ export default function ModSettingsField({ }} > {JSON.stringify(mod.config[field.id]) === - JSON.stringify(field.defaultValue) ? null : ( + JSON.stringify(field.defaultValue) || + overrideValue != null ? null : (