From 924bca64d1daca73a6877da179edc9744a4d87de Mon Sep 17 00:00:00 2001
From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com>
Date: Mon, 16 May 2022 16:38:50 +0100
Subject: [PATCH 1/2] Update preferences.dm
---
code/modules/client/preferences.dm | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index dcfb199837..8cf74d038b 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -153,6 +153,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
//Quirk list
var/list/all_quirks = list()
+ //Quirk category currently selected
+ var/quirk_category = "Positive" // defaults to Positive, the first tab!
+
//Job preferences 2.0 - indexed by job title , no key or value implies never
var/list/job_preferences = list()
@@ -1465,6 +1468,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "
Current quirks: [all_quirks.len ? all_quirks.Join(", ") : "None"]"
dat += "[GetPositiveQuirkCount()] / [MAX_QUIRKS] max positive quirks
\
Quirk balance remaining: [GetQuirkBalance()]
"
+ dat += " Positive "
+ dat += " Neutral "
+ dat += " Negative "
for(var/V in SSquirks.quirks)
var/datum/quirk/T = SSquirks.quirks[V]
var/quirk_name = initial(T.name)
From 1c9f6077daf96bce1854b96acd44e5d763b1ca2f Mon Sep 17 00:00:00 2001
From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com>
Date: Mon, 16 May 2022 21:22:22 +0100
Subject: [PATCH 2/2] loadout organisation
---
code/__DEFINES/loadout.dm | 5 +++++
code/modules/client/preferences.dm | 23 +++++++++++++++++------
2 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/code/__DEFINES/loadout.dm b/code/__DEFINES/loadout.dm
index f9b4c36c9c..792708b5bb 100644
--- a/code/__DEFINES/loadout.dm
+++ b/code/__DEFINES/loadout.dm
@@ -91,3 +91,8 @@
#define LOADOUT_TAB 4
#define CONTENT_PREFERENCES_TAB 5
#define KEYBINDINGS_TAB 6
+
+//quirks
+#define QUIRK_POSITIVE "Positive"
+#define QUIRK_NEGATIVE "Negative"
+#define QUIRK_NEUTRAL "Neutral"
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index 8cf74d038b..c4733bcff9 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -154,7 +154,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/list/all_quirks = list()
//Quirk category currently selected
- var/quirk_category = "Positive" // defaults to Positive, the first tab!
+ var/quirk_category = QUIRK_POSITIVE // defaults to positive, the first tab!
//Job preferences 2.0 - indexed by job title , no key or value implies never
var/list/job_preferences = list()
@@ -1467,12 +1467,17 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "
"
dat += "Current quirks: [all_quirks.len ? all_quirks.Join(", ") : "None"]"
dat += "[GetPositiveQuirkCount()] / [MAX_QUIRKS] max positive quirks
\
- Quirk balance remaining: [GetQuirkBalance()]
"
- dat += " Positive "
- dat += " Neutral "
- dat += " Negative "
+ Quirk balance remaining: [GetQuirkBalance()]
"
+ dat += " [QUIRK_POSITIVE] "
+ dat += " [QUIRK_NEUTRAL] "
+ dat += " [QUIRK_NEGATIVE] "
+ dat += "
"
for(var/V in SSquirks.quirks)
var/datum/quirk/T = SSquirks.quirks[V]
+ var/value = initial(T.value)
+ if((value > 0 && quirk_category != QUIRK_POSITIVE) || (value < 0 && quirk_category != QUIRK_NEGATIVE) || (value == 0 && quirk_category != QUIRK_NEUTRAL))
+ continue
+
var/quirk_name = initial(T.name)
var/has_quirk
var/quirk_cost = initial(T.value) * -1
@@ -1494,7 +1499,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
quirk_cost = "+[quirk_cost]"
var/font_color = "#AAAAFF"
if(initial(T.value) != 0)
- font_color = initial(T.value) > 0 ? "#AAFFAA" : "#FFAAAA"
+ font_color = value > 0 ? "#AAFFAA" : "#FFAAAA"
if(quirk_conflict)
dat += "[quirk_name] - [initial(T.desc)] \
LOCKED: [lock_reason]
"
@@ -1624,6 +1629,12 @@ GLOBAL_LIST_EMPTY(preferences_datums)
SetQuirks(user)
return TRUE
+ else if(href_list["quirk_category"])
+ var/temp_quirk_category = href_list["quirk_category"]
+ if(temp_quirk_category == QUIRK_POSITIVE || temp_quirk_category == QUIRK_NEUTRAL || temp_quirk_category == QUIRK_NEGATIVE)
+ quirk_category = temp_quirk_category
+ SetQuirks(user)
+
switch(href_list["task"])
if("random")
switch(href_list["preference"])