loadout organisation

This commit is contained in:
Timothy Teakettle
2022-05-16 21:22:22 +01:00
parent 924bca64d1
commit 1c9f6077da
2 changed files with 22 additions and 6 deletions
+5
View File
@@ -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"
+17 -6
View File
@@ -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 += "<hr>"
dat += "<center><b>Current quirks:</b> [all_quirks.len ? all_quirks.Join(", ") : "None"]</center>"
dat += "<center>[GetPositiveQuirkCount()] / [MAX_QUIRKS] max positive quirks<br>\
<b>Quirk balance remaining:</b> [GetQuirkBalance()]</center><br>"
dat += " <a href='?_src_=prefs;preference=OHGODTHISISAPLACEHOLDER'>Positive</a> "
dat += " <a href='?_src_=prefs;preference=OHGODTHISISAPLACEHOLDER'>Neutral</a> "
dat += " <a href='?_src_=prefs;preference=OHGODTHISISAPLACEHOLDER'>Negative</a> "
<b>Quirk balance remaining:</b> [GetQuirkBalance()]<br>"
dat += " <a href='?_src_=prefs;quirk_category=[QUIRK_POSITIVE]' [quirk_category == QUIRK_POSITIVE ? "class='linkOn'" : ""]>[QUIRK_POSITIVE]</a> "
dat += " <a href='?_src_=prefs;quirk_category=[QUIRK_NEUTRAL]' [quirk_category == QUIRK_NEUTRAL ? "class='linkOn'" : ""]>[QUIRK_NEUTRAL]</a> "
dat += " <a href='?_src_=prefs;quirk_category=[QUIRK_NEGATIVE]' [quirk_category == QUIRK_NEGATIVE ? "class='linkOn'" : ""]>[QUIRK_NEGATIVE]</a> "
dat += "</center><br>"
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 += "<font color='[font_color]'>[quirk_name]</font> - [initial(T.desc)] \
<font color='red'><b>LOCKED: [lock_reason]</b></font><br>"
@@ -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"])