Adds Marking Order Changing at Character Creation (#5429)

* Adds Changing Order of Markings

Clicking the back button on a marking will trade its place with the previous marking or move it to the end of the list if it's the first marking.

Clicking the forward button on a marking will trade its place with the next marking or put it in first before all other markings if it's last in the list.

* Changelog

Adds changelog.

* Buttons Only for >1 Marking

Only renders the layer-swap buttons when there is more than one body marking.

* Changes Button Labels to Proper Up/Down Arrows

Thanks Atermonera!
This commit is contained in:
KasparoVv
2018-07-23 01:34:53 +00:00
committed by VirgoBot
parent 115bfa2dc3
commit 1f236a1d2e
2 changed files with 23 additions and 1 deletions
@@ -303,7 +303,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
. += "<br><a href='?src=\ref[src];marking_style=1'>Body Markings +</a><br>"
for(var/M in pref.body_markings)
. += "[M] <a href='?src=\ref[src];marking_remove=[M]'>-</a> <a href='?src=\ref[src];marking_color=[M]'>Color</a>"
. += "[M] [pref.body_markings.len > 1 ? "<a href='?src=\ref[src];marking_up=[M]'>&#708;</a> <a href='?src=\ref[src];marking_down=[M]'>&#709;</a> " : ""]<a href='?src=\ref[src];marking_remove=[M]'>-</a> <a href='?src=\ref[src];marking_color=[M]'>Color</a>"
. += "<font face='fixedsys' size='3' color='[pref.body_markings[M]]'><table style='display:inline;' bgcolor='[pref.body_markings[M]]'><tr><td>__</td></tr></table></font>"
. += "<br>"
@@ -500,6 +500,24 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
pref.body_markings[new_marking] = "#000000" //New markings start black
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["marking_up"])
var/M = href_list["marking_up"]
var/start = pref.body_markings.Find(M)
if(start != 1) //If we're not the beginning of the list, swap with the previous element.
moveElement(pref.body_markings, start, start-1)
else //But if we ARE, become the final element -ahead- of everything else.
moveElement(pref.body_markings, start, pref.body_markings.len+1)
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["marking_down"])
var/M = href_list["marking_down"]
var/start = pref.body_markings.Find(M)
if(start != pref.body_markings.len) //If we're not the end of the list, swap with the next element.
moveElement(pref.body_markings, start, start+2)
else //But if we ARE, become the first element -behind- everything else.
moveElement(pref.body_markings, start, 1)
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["marking_remove"])
var/M = href_list["marking_remove"]
pref.body_markings -= M
@@ -0,0 +1,4 @@
author: KasparoVv
delete-after: True
changes:
- rscadd: "You can now change the order of your body markings at character creation with the push of a button. Shift markings up or down layers at will to design the character you've always wanted, more easily than ever before."