From 39222b363cadca82505c8e214ea3108c570f4939 Mon Sep 17 00:00:00 2001 From: Iajret Creature <122297233+Steals-The-PRs@users.noreply.github.com> Date: Thu, 15 Feb 2024 01:33:26 +0300 Subject: [PATCH] [MIRROR] Operand Swap for QuirksPage.tsx (#1971) * Operand Swap for QuirksPage.tsx (#81438) ## About The Pull Request The changes included in this PR were requested by maintainers of [Nova Sector](https://github.com/NovaSector/NovaSector). - Changed the input operand of `getValueClass`, replacing the `value` number with the full `quirk` object. - Renamed `getValueClass` to `getColorValueClass`. ## Why It's Good For The Game A downstream repository has requested that I make this change, so they can easily maintain their own changes to it. The change should allow them to add more heading colors for quirks on the Character Preferences page. This change is purely semantic, and there are no visible changes to the game, * Operand Swap for QuirksPage.tsx --------- Co-authored-by: NovaBot <154629622+NovaBot13@users.noreply.github.com> Co-authored-by: Dani Glore --- .../tgui/interfaces/PreferencesMenu/QuirksPage.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/QuirksPage.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/QuirksPage.tsx index d7dbf8f13d6..1474149a864 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/QuirksPage.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/QuirksPage.tsx @@ -8,10 +8,10 @@ import { getRandomization, PreferenceList } from './MainPage'; import { ServerPreferencesFetcher } from './ServerPreferencesFetcher'; import { useRandomToggleState } from './useRandomToggleState'; -function getValueClass(value: number) { - if (value > 0) { +function getColorValueClass(quirk: Quirk) { + if (quirk.value > 0) { return 'positive'; - } else if (value < 0) { + } else if (quirk.value < 0) { return 'negative'; } else { return 'neutral'; @@ -131,7 +131,7 @@ function QuirkDisplay(props: QuirkDisplayProps) { >