mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-12 15:47:04 +01:00
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:
@@ -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]'>˄</a> <a href='?src=\ref[src];marking_down=[M]'>˅</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
|
||||
|
||||
Reference in New Issue
Block a user