Preferences HTML cleanup (#3301)

changes:

Changed a lot of string building to use lists & Join() - this should reduce the number of strings generated at runtime.
Fixed a bug where the incidents menu was not populated.
Changed color boxes to use CSS & divs instead of one-cell tables.
This commit is contained in:
Lohikar
2017-08-17 12:22:20 +03:00
committed by Erki
parent 901fbf0249
commit d5f7bc76a7
14 changed files with 854 additions and 578 deletions
@@ -61,27 +61,30 @@
infraction.felony = text2num(char_infraction_query.item[11])
pref.incidents.Add(infraction)
/datum/category_item/player_setup_item/other/incidents/content(var/mob/user)
pref.incidents = list()
. += "<b>Incident Information</b><br>"
. += "The following incidents are on file for your character<br>"
/datum/category_item/player_setup_item/other/incidents/content(mob/user)
var/list/dat = list(
"<b>Incident Information</b><br>",
"The following incidents are on file for your character<br>"
)
for (var/datum/char_infraction/I in pref.incidents)
. += "<hr>"
. += "UID: [I.UID]<br>"
. += "Date/Time: [I.datetime]<br>"
. += "Charges: "
dat += "<hr>"
dat += "UID: [I.UID]<br>"
dat += "Date/Time: [I.datetime]<br>"
dat += "Charges: "
for (var/L in I.charges)
. += "[L], "
dat += "[L], "
if (I.fine == 0)
. += "<br>Brig Sentence: [I.getBrigSentence()] <br>"
dat += "<br>Brig Sentence: [I.getBrigSentence()] <br>"
else
. += "Fine: [I.fine] Credits<br>"
. += "Notes: <br>"
dat += "Fine: [I.fine] Credits<br>"
dat += "Notes: <br>"
if (I.notes != "")
. += nl2br(I.notes)
dat += nl2br(I.notes)
else
. += "- No Summary Entered -"
. += "<br><a href='?src=\ref[src];details_sec_incident=[I.db_id]'>Show Details</a><br><a href='?src=\ref[src];del_sec_incident=[I.db_id]'>Delete Incident</a>"
dat += "- No Summary Entered -"
dat += "<br><a href='?src=\ref[src];details_sec_incident=[I.db_id]'>Show Details</a><br><a href='?src=\ref[src];del_sec_incident=[I.db_id]'>Delete Incident</a>"
. = dat.Join()
/datum/category_item/player_setup_item/other/incidents/OnTopic(var/href,var/list/href_list, var/mob/user)
if(href_list["del_sec_incident"])