SCREEE. fuck this. I'mma just revert at this point, but don't want to lose progress.
This commit is contained in:
@@ -3,11 +3,7 @@
|
||||
#define BACKPACK_SLOT_AMT 4
|
||||
|
||||
/datum/preferences
|
||||
//gear
|
||||
var/gear_points = 10
|
||||
var/list/gear_categories
|
||||
var/list/chosen_gear
|
||||
var/gear_tab
|
||||
|
||||
|
||||
//pref vars
|
||||
var/screenshake = 100
|
||||
@@ -261,58 +257,7 @@
|
||||
. += "<b>Egg Size:</b><a href='?_src_=prefs;preference=egg_size;task=input'>[features["eggsack_egg_size"]]\" Diameter</a>"
|
||||
. += "</td>"
|
||||
*/
|
||||
. += "</td></tr></table>"
|
||||
|
||||
if(current_tab == 3)
|
||||
if(!gear_tab)
|
||||
gear_tab = GLOB.loadout_items[1]
|
||||
. += "<table align='center' width='100%'>"
|
||||
. += "<tr><td colspan=4><center><b><font color='[gear_points == 0 ? "#E67300" : "#3366CC"]'>[gear_points]</font> loadout points remaining.</b> \[<a href='?_src_=prefs;preference=gear;clear_loadout=1'>Clear Loadout</a>\]</center></td></tr>"
|
||||
. += "<tr><td colspan=4><center>You can only choose one item per category, unless it's an item that spawns in your backpack or hands.</center></td></tr>"
|
||||
. += "<tr><td colspan=4><center><b>"
|
||||
var/firstcat = TRUE
|
||||
for(var/i in GLOB.loadout_items)
|
||||
if(firstcat)
|
||||
firstcat = FALSE
|
||||
else
|
||||
. += " |"
|
||||
if(i == gear_tab)
|
||||
. += " <span class='linkOn'>[i]</span> "
|
||||
else
|
||||
. += " <a href='?_src_=prefs;preference=gear;select_category=[i]'>[i]</a> "
|
||||
. += "</b></center></td></tr>"
|
||||
. += "<tr><td colspan=4><hr></td></tr>"
|
||||
. += "<tr><td colspan=4><b><center>[gear_tab]</center></b></td></tr>"
|
||||
. += "<tr><td colspan=4><hr></td></tr>"
|
||||
. += "<tr style='vertical-align:top;'><td width=15%><b>Name</b></td>"
|
||||
. += "<td width=5% style='vertical-align:top'><b>Cost</b></td>"
|
||||
. += "<td><font size=2><b>Restrictions</b></font></td>"
|
||||
. += "<td><font size=2><b>Description</b></font></td></tr>"
|
||||
for(var/j in GLOB.loadout_items[gear_tab])
|
||||
var/datum/gear/gear = GLOB.loadout_items[gear_tab][j]
|
||||
var/donoritem
|
||||
if(gear.ckeywhitelist && gear.ckeywhitelist.len)
|
||||
donoritem = TRUE
|
||||
if(user && user.client && user.client.ckey && !(gear.ckeywhitelist.Find(user.client.ckey)))
|
||||
continue
|
||||
var/class_link = ""
|
||||
if(gear.type in chosen_gear)
|
||||
class_link = "class='linkOn' href='?_src_=prefs;preference=gear;toggle_gear_path=[j];toggle_gear=0'"
|
||||
else if(donoritem)
|
||||
class_link = "class='linkOn' href='?_src_=prefs;preference=gear;toggle_gear_path=[j];toggle_gear=1'"
|
||||
else if(gear_points <= 0)
|
||||
class_link = "class='linkOff'"
|
||||
else
|
||||
class_link = "href='?_src_=prefs;preference=gear;toggle_gear_path=[j];toggle_gear=1'"
|
||||
. += "<tr style='vertical-align:top;'><td width=15%><a style='white-space:normal;' [class_link]>[j]</a></td>"
|
||||
. += "<td width = 5% style='vertical-align:top'>[gear.cost]</td><td>"
|
||||
if(islist(gear.restricted_roles))
|
||||
if(gear.restricted_roles.len)
|
||||
. += "<font size=2>"
|
||||
. += gear.restricted_roles.Join(";")
|
||||
. += "</font>"
|
||||
. += "</td><td><font size=2><i>[gear.description]</i></font></td></tr>"
|
||||
. += "</table>"
|
||||
. += "</td></tr></table>"
|
||||
|
||||
/datum/preferences/proc/process_citadel_prefs(mob/user, list/href_list)
|
||||
if(href_list["task"] == "input")
|
||||
@@ -726,35 +671,6 @@
|
||||
else
|
||||
user << "<span class='danger'>Invalid color. Your color is not bright enough.</span>"
|
||||
|
||||
if(href_list["preference"] == "gear")
|
||||
if(href_list["clear_loadout"])
|
||||
LAZYCLEARLIST(chosen_gear)
|
||||
gear_points = initial(gear_points)
|
||||
save_preferences()
|
||||
if(href_list["select_category"])
|
||||
for(var/i in GLOB.loadout_items)
|
||||
if(i == href_list["select_category"])
|
||||
gear_tab = i
|
||||
if(href_list["toggle_gear_path"])
|
||||
var/datum/gear/G = GLOB.loadout_items[gear_tab][href_list["toggle_gear_path"]]
|
||||
if(!G)
|
||||
return
|
||||
var/toggle = text2num(href_list["toggle_gear"])
|
||||
if(!toggle && (G.type in chosen_gear))//toggling off and the item effectively is in chosen gear)
|
||||
LAZYREMOVE(chosen_gear, G.type)
|
||||
gear_points += initial(G.cost)
|
||||
else if(toggle && (!(is_type_in_ref_list(G, chosen_gear))))
|
||||
if(G.ckeywhitelist && G.ckeywhitelist.len && !(user.ckey in G.ckeywhitelist))
|
||||
to_chat(user, "<span class='danger'>This is an item intended for donator use only. You are not authorized to use this item.</span>")
|
||||
return
|
||||
if(!is_loadout_slot_available(G.category))
|
||||
to_chat(user, "<span class='danger'>You cannot take this loadout, as you've already chosen too many of the same category!</span>")
|
||||
return
|
||||
if(gear_points >= initial(G.cost))
|
||||
LAZYADD(chosen_gear, G.type)
|
||||
gear_points -= initial(G.cost)
|
||||
|
||||
|
||||
/datum/preferences/proc/is_loadout_slot_available(slot)
|
||||
var/list/L
|
||||
LAZYINITLIST(L)
|
||||
|
||||
Reference in New Issue
Block a user