Merge pull request #45 from VOREStation/tailsnears-4

Issue #4 - Implement custom tails, ears, and taurs.
This commit is contained in:
Arokha Sieyes
2016-05-11 23:40:27 -04:00
15 changed files with 799 additions and 10 deletions

View File

@@ -0,0 +1,121 @@
// Super Global Stuff
/datum/category_collection/player_setup_collection/proc/copy_to_mob(var/mob/living/carbon/human/C)
for(var/datum/category_group/player_setup_category/PS in categories)
PS.copy_to_mob(C)
/datum/category_group/player_setup_category/proc/copy_to_mob(var/mob/living/carbon/human/C)
for(var/datum/category_item/player_setup_item/PI in items)
PI.copy_to_mob(C)
/datum/category_item/player_setup_item/proc/copy_to_mob(var/mob/living/carbon/human/C)
return
// Global stuff that will put us on the map
/datum/category_group/player_setup_category/vore
name = "VORE"
sort_order = 7
category_item_type = /datum/category_item/player_setup_item/vore
// Definition of the stuff for Ears
/datum/category_item/player_setup_item/vore/ears
name = "Ears"
sort_order = 1
/datum/category_item/player_setup_item/vore/ears/load_character(var/savefile/S)
S["ear_style"] >> pref.ear_style
S["tail_style"] >> pref.tail_style
S["r_tail"] >> pref.r_tail
S["g_tail"] >> pref.g_tail
S["b_tail"] >> pref.b_tail
/datum/category_item/player_setup_item/vore/ears/save_character(var/savefile/S)
S["ear_style"] << pref.ear_style
S["tail_style"] << pref.tail_style
S["r_tail"] << pref.r_tail
S["g_tail"] << pref.g_tail
S["b_tail"] << pref.b_tail
/datum/category_item/player_setup_item/vore/ears/sanitize_character()
pref.r_tail = sanitize_integer(pref.r_tail, 0, 255, initial(pref.r_tail))
pref.g_tail = sanitize_integer(pref.g_tail, 0, 255, initial(pref.g_tail))
pref.b_tail = sanitize_integer(pref.b_tail, 0, 255, initial(pref.b_tail))
if(pref.ear_style)
pref.ear_style = sanitize_inlist(pref.ear_style, ear_styles_list, initial(pref.ear_style))
if(pref.tail_style)
pref.tail_style = sanitize_inlist(pref.tail_style, tail_styles_list, initial(pref.tail_style))
/datum/category_item/player_setup_item/vore/ears/copy_to_mob(var/mob/living/carbon/human/character)
character.ear_style = ear_styles_list[pref.ear_style]
character.tail_style = tail_styles_list[pref.tail_style]
character.r_tail = pref.r_tail
character.b_tail = pref.b_tail
character.g_tail = pref.g_tail
/datum/category_item/player_setup_item/vore/ears/content(var/mob/user)
. += "<h2>VORE Station Settings</h2>"
pref.update_preview_icon()
if(pref.preview_icon_front && pref.preview_icon_side)
user << browse_rsc(pref.preview_icon_front, "preview_icon.png")
user << browse_rsc(pref.preview_icon_side, "preview_icon2.png")
. += "<b>Preview</b><br>"
. += "<img src=preview_icon.png height=64 width=64><img src=preview_icon2.png height=64 width=64><br>"
. += "<b>Ears</b><br>"
. += " Style: <a href='?src=\ref[src];ear_style=1'>[pref.ear_style ? "Custom" : "Normal"]</a><br>"
. += "<b>Tail</b><br>"
. += " Style: <a href='?src=\ref[src];tail_style=1'>[pref.tail_style ? "Custom" : "Normal"]</a><br>"
if(tail_styles_list[pref.tail_style])
var/datum/sprite_accessory/tail/T = tail_styles_list[pref.tail_style]
if (T.do_colouration)
. += "<a href='?src=\ref[src];tail_color=1'>Change Color</a> \
<font face='fixedsys' size='3' color='\
#[num2hex(pref.r_tail, 2)][num2hex(pref.g_tail, 2)][num2hex(pref.b_tail, 2)]'>\
<table style='display:inline;' bgcolor='\
#[num2hex(pref.r_tail, 2)][num2hex(pref.g_tail, 2)][num2hex(pref.b_tail)]'>\
<tr><td>__</td></tr></table> </font> "
/datum/category_item/player_setup_item/vore/ears/OnTopic(var/href,var/list/href_list, var/mob/user)
if(href_list["ear_style"])
// Construct the list of names allowed for this user.
var/list/pretty_ear_styles = list("Normal")
for(var/path in ear_styles_list)
var/datum/sprite_accessory/ears/instance = ear_styles_list[path]
if((!instance.ckeys_allowed) || (usr.ckey in instance.ckeys_allowed))
pretty_ear_styles[instance.name] = path
// Present choice to user
var/selection = input(user, "Pick ears", "Character Preference") as null|anything in pretty_ear_styles
if(selection && selection != "Normal")
pref.ear_style = pretty_ear_styles[selection]
else
pref.ear_style = null
return TOPIC_REFRESH
else if(href_list["tail_style"])
// Construct the list of names allowed for this user.
var/list/pretty_tail_styles = list("Normal")
for(var/path in tail_styles_list)
var/datum/sprite_accessory/tail/instance = tail_styles_list[path]
if((!instance.ckeys_allowed) || (user.ckey in instance.ckeys_allowed))
pretty_tail_styles[instance.name] = path
// Present choice to user
var/selection = input(user, "Pick tails", "Character Preference") as null|anything in pretty_tail_styles
if(selection && selection != "Normal")
pref.tail_style = pretty_tail_styles[selection]
else
pref.tail_style = null
return TOPIC_REFRESH
else if(href_list["tail_color"])
var/new_tailc = input(user, "Choose your character's tail/taur colour:", "Character Preference",
rgb(pref.r_tail, pref.g_tail, pref.b_tail)) as color|null
if(new_tailc)
pref.r_tail = hex2num(copytext(new_tailc, 2, 4))
pref.g_tail = hex2num(copytext(new_tailc, 4, 6))
pref.b_tail = hex2num(copytext(new_tailc, 6, 8))
return TOPIC_REFRESH
return ..()