Merge branch 'release' of https://github.com/VOREStation/VOREStation into upstream-update

This commit is contained in:
izac112
2024-02-26 03:37:23 +01:00
1157 changed files with 778221 additions and 777841 deletions
@@ -1,173 +1,173 @@
/datum/category_item/player_setup_item/general/background
name = "Background"
sort_order = 5
/datum/category_item/player_setup_item/general/background/load_character(var/savefile/S)
S["med_record"] >> pref.med_record
S["sec_record"] >> pref.sec_record
S["gen_record"] >> pref.gen_record
S["home_system"] >> pref.home_system
S["birthplace"] >> pref.birthplace
S["citizenship"] >> pref.citizenship
S["faction"] >> pref.faction
S["religion"] >> pref.religion
S["economic_status"] >> pref.economic_status
/datum/category_item/player_setup_item/general/background/save_character(var/savefile/S)
S["med_record"] << pref.med_record
S["sec_record"] << pref.sec_record
S["gen_record"] << pref.gen_record
S["home_system"] << pref.home_system
S["birthplace"] << pref.birthplace
S["citizenship"] << pref.citizenship
S["faction"] << pref.faction
S["religion"] << pref.religion
S["economic_status"] << pref.economic_status
/datum/category_item/player_setup_item/general/background/sanitize_character()
if(!pref.home_system) pref.home_system = "Unset"
if(!pref.birthplace) pref.birthplace = "Unset"
if(!pref.citizenship) pref.citizenship = "None"
if(!pref.faction) pref.faction = "None"
if(!pref.religion) pref.religion = "None"
pref.economic_status = sanitize_inlist(pref.economic_status, ECONOMIC_CLASS, initial(pref.economic_status))
// Moved from /datum/preferences/proc/copy_to()
/datum/category_item/player_setup_item/general/background/copy_to_mob(var/mob/living/carbon/human/character)
character.med_record = pref.med_record
character.sec_record = pref.sec_record
character.gen_record = pref.gen_record
character.home_system = pref.home_system
character.birthplace = pref.birthplace
character.citizenship = pref.citizenship
character.personal_faction = pref.faction
character.religion = pref.religion
/datum/category_item/player_setup_item/general/background/content(var/mob/user)
. += "<b>Background Information</b><br>"
. += "Economic Status: <a href='?src=\ref[src];econ_status=1'>[pref.economic_status]</a><br/>"
. += "Home: <a href='?src=\ref[src];home_system=1'>[pref.home_system]</a><br/>"
. += "Birthplace: <a href='?src=\ref[src];birthplace=1'>[pref.birthplace]</a><br/>"
. += "Citizenship: <a href='?src=\ref[src];citizenship=1'>[pref.citizenship]</a><br/>"
. += "Faction: <a href='?src=\ref[src];faction=1'>[pref.faction]</a><br/>"
. += "Religion: <a href='?src=\ref[src];religion=1'>[pref.religion]</a><br/>"
. += "<br/><b>Records</b>:<br/>"
if(jobban_isbanned(user, "Records"))
. += "<span class='danger'>You are banned from using character records.</span><br>"
else
. += "Medical Records:<br>"
. += "<a href='?src=\ref[src];set_medical_records=1'>[TextPreview(pref.med_record,40)]</a><br>"
. += " (<a href='?src=\ref[src];reset_medrecord=1'>Reset</A>)<br><br>"
. += "Employment Records:<br>"
. += "<a href='?src=\ref[src];set_general_records=1'>[TextPreview(pref.gen_record,40)]</a><br>"
. += "(<a href='?src=\ref[src];reset_emprecord=1'>Reset</A>)<br><br>"
. += "Security Records:<br>"
. += "<a href='?src=\ref[src];set_security_records=1'>[TextPreview(pref.sec_record,40)]</a><br>"
. += "(<a href='?src=\ref[src];reset_secrecord=1'>Reset</A>)"
/datum/category_item/player_setup_item/general/background/OnTopic(var/href,var/list/href_list, var/mob/user)
if(href_list["econ_status"])
var/new_class = tgui_input_list(user, "Choose your economic status. This will affect the amount of money you will start with.", "Character Preference", ECONOMIC_CLASS, pref.economic_status)
if(new_class && CanUseTopic(user))
pref.economic_status = new_class
return TOPIC_REFRESH
else if(href_list["home_system"])
var/choice = tgui_input_list(user, "Please choose your home planet and/or system. This should be your current primary residence. Select \"Other\" to specify manually.", "Character Preference", home_system_choices + list("Unset","Other"), pref.home_system)
if(!choice || !CanUseTopic(user))
return TOPIC_NOACTION
if(choice == "Other")
var/raw_choice = strip_html_simple(tgui_input_text(user, "Please enter a home system.", "Character Preference", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(raw_choice && CanUseTopic(user))
pref.home_system = raw_choice
else
pref.home_system = choice
return TOPIC_REFRESH
else if(href_list["birthplace"])
var/choice = tgui_input_list(user, "Please choose the planet and/or system or other appropriate location that you were born/created. Select \"Other\" to specify manually.", "Character Preference", home_system_choices + list("Unset","Other"), pref.birthplace)
if(!choice || !CanUseTopic(user))
return TOPIC_NOACTION
if(choice == "Other")
var/raw_choice = strip_html_simple(tgui_input_text(user, "Please enter a birthplace.", "Character Preference", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(raw_choice && CanUseTopic(user))
pref.birthplace = raw_choice
else
pref.birthplace = choice
return TOPIC_REFRESH
else if(href_list["citizenship"])
var/choice = tgui_input_list(user, "Please select the faction or political entity with which you currently hold citizenship. Select \"Other\" to specify manually.", "Character Preference", citizenship_choices + list("None","Other"), pref.citizenship)
if(!choice || !CanUseTopic(user))
return TOPIC_NOACTION
if(choice == "Other")
var/raw_choice = strip_html_simple(tgui_input_text(user, "Please enter your current citizenship.", "Character Preference", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(raw_choice && CanUseTopic(user))
pref.citizenship = raw_choice
else
pref.citizenship = choice
return TOPIC_REFRESH
else if(href_list["faction"])
var/choice = tgui_input_list(user, "Please choose the faction you primarily work for, if you are not under the direct employ of NanoTrasen. Select \"Other\" to specify manually.", "Character Preference", faction_choices + list("None","Other"), pref.faction)
if(!choice || !CanUseTopic(user))
return TOPIC_NOACTION
if(choice == "Other")
var/raw_choice = strip_html_simple(tgui_input_text(user, "Please enter a faction.", "Character Preference", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(raw_choice)
pref.faction = raw_choice
else
pref.faction = choice
return TOPIC_REFRESH
else if(href_list["religion"])
var/choice = tgui_input_list(user, "Please choose a religion. Select \"Other\" to specify manually.", "Character Preference", religion_choices + list("None","Other"), pref.religion)
if(!choice || !CanUseTopic(user))
return TOPIC_NOACTION
if(choice == "Other")
var/raw_choice = strip_html_simple(tgui_input_text(user, "Please enter a religon.", "Character Preference", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(raw_choice)
pref.religion = sanitize(raw_choice)
else
pref.religion = choice
return TOPIC_REFRESH
else if(href_list["set_medical_records"])
var/new_medical = strip_html_simple(tgui_input_text(user,"Enter medical information here.","Character Preference", html_decode(pref.med_record), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH)
if(new_medical && !jobban_isbanned(user, "Records") && CanUseTopic(user))
pref.med_record = new_medical
return TOPIC_REFRESH
else if(href_list["set_general_records"])
var/new_general = strip_html_simple(tgui_input_text(user,"Enter employment information here.","Character Preference", html_decode(pref.gen_record), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH)
if(new_general && !jobban_isbanned(user, "Records") && CanUseTopic(user))
pref.gen_record = new_general
return TOPIC_REFRESH
else if(href_list["set_security_records"])
var/sec_medical = strip_html_simple(tgui_input_text(user,"Enter security information here.","Character Preference", html_decode(pref.sec_record), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH)
if(sec_medical && !jobban_isbanned(user, "Records") && CanUseTopic(user))
pref.sec_record = sec_medical
return TOPIC_REFRESH
else if(href_list["reset_medrecord"])
var/resetmed_choice = tgui_alert(usr, "Wipe your Medical Records? This cannot be reverted if you have not saved your character recently! You may wish to make a backup first.","Reset Records",list("Yes","No"))
if(resetmed_choice == "Yes")
pref.med_record = null
return TOPIC_REFRESH
else if(href_list["reset_emprecord"])
var/resetemp_choice = tgui_alert(usr, "Wipe your Employment Records? This cannot be reverted if you have not saved your character recently! You may wish to make a backup first.","Reset Records",list("Yes","No"))
if(resetemp_choice == "Yes")
pref.gen_record = null
return TOPIC_REFRESH
else if(href_list["reset_secrecord"])
var/resetsec_choice = tgui_alert(usr, "Wipe your Security Records? This cannot be reverted if you have not saved your character recently! You may wish to make a backup first.","Reset Records",list("Yes","No"))
if(resetsec_choice == "Yes")
pref.sec_record = null
return TOPIC_REFRESH
return ..()
/datum/category_item/player_setup_item/general/background
name = "Background"
sort_order = 5
/datum/category_item/player_setup_item/general/background/load_character(var/savefile/S)
S["med_record"] >> pref.med_record
S["sec_record"] >> pref.sec_record
S["gen_record"] >> pref.gen_record
S["home_system"] >> pref.home_system
S["birthplace"] >> pref.birthplace
S["citizenship"] >> pref.citizenship
S["faction"] >> pref.faction
S["religion"] >> pref.religion
S["economic_status"] >> pref.economic_status
/datum/category_item/player_setup_item/general/background/save_character(var/savefile/S)
S["med_record"] << pref.med_record
S["sec_record"] << pref.sec_record
S["gen_record"] << pref.gen_record
S["home_system"] << pref.home_system
S["birthplace"] << pref.birthplace
S["citizenship"] << pref.citizenship
S["faction"] << pref.faction
S["religion"] << pref.religion
S["economic_status"] << pref.economic_status
/datum/category_item/player_setup_item/general/background/sanitize_character()
if(!pref.home_system) pref.home_system = "Unset"
if(!pref.birthplace) pref.birthplace = "Unset"
if(!pref.citizenship) pref.citizenship = "None"
if(!pref.faction) pref.faction = "None"
if(!pref.religion) pref.religion = "None"
pref.economic_status = sanitize_inlist(pref.economic_status, ECONOMIC_CLASS, initial(pref.economic_status))
// Moved from /datum/preferences/proc/copy_to()
/datum/category_item/player_setup_item/general/background/copy_to_mob(var/mob/living/carbon/human/character)
character.med_record = pref.med_record
character.sec_record = pref.sec_record
character.gen_record = pref.gen_record
character.home_system = pref.home_system
character.birthplace = pref.birthplace
character.citizenship = pref.citizenship
character.personal_faction = pref.faction
character.religion = pref.religion
/datum/category_item/player_setup_item/general/background/content(var/mob/user)
. += "<b>Background Information</b><br>"
. += "Economic Status: <a href='?src=\ref[src];econ_status=1'>[pref.economic_status]</a><br/>"
. += "Home: <a href='?src=\ref[src];home_system=1'>[pref.home_system]</a><br/>"
. += "Birthplace: <a href='?src=\ref[src];birthplace=1'>[pref.birthplace]</a><br/>"
. += "Citizenship: <a href='?src=\ref[src];citizenship=1'>[pref.citizenship]</a><br/>"
. += "Faction: <a href='?src=\ref[src];faction=1'>[pref.faction]</a><br/>"
. += "Religion: <a href='?src=\ref[src];religion=1'>[pref.religion]</a><br/>"
. += "<br/><b>Records</b>:<br/>"
if(jobban_isbanned(user, "Records"))
. += "<span class='danger'>You are banned from using character records.</span><br>"
else
. += "Medical Records:<br>"
. += "<a href='?src=\ref[src];set_medical_records=1'>[TextPreview(pref.med_record,40)]</a><br>"
. += " (<a href='?src=\ref[src];reset_medrecord=1'>Reset</A>)<br><br>"
. += "Employment Records:<br>"
. += "<a href='?src=\ref[src];set_general_records=1'>[TextPreview(pref.gen_record,40)]</a><br>"
. += "(<a href='?src=\ref[src];reset_emprecord=1'>Reset</A>)<br><br>"
. += "Security Records:<br>"
. += "<a href='?src=\ref[src];set_security_records=1'>[TextPreview(pref.sec_record,40)]</a><br>"
. += "(<a href='?src=\ref[src];reset_secrecord=1'>Reset</A>)"
/datum/category_item/player_setup_item/general/background/OnTopic(var/href,var/list/href_list, var/mob/user)
if(href_list["econ_status"])
var/new_class = tgui_input_list(user, "Choose your economic status. This will affect the amount of money you will start with.", "Character Preference", ECONOMIC_CLASS, pref.economic_status)
if(new_class && CanUseTopic(user))
pref.economic_status = new_class
return TOPIC_REFRESH
else if(href_list["home_system"])
var/choice = tgui_input_list(user, "Please choose your home planet and/or system. This should be your current primary residence. Select \"Other\" to specify manually.", "Character Preference", home_system_choices + list("Unset","Other"), pref.home_system)
if(!choice || !CanUseTopic(user))
return TOPIC_NOACTION
if(choice == "Other")
var/raw_choice = strip_html_simple(tgui_input_text(user, "Please enter a home system.", "Character Preference", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(raw_choice && CanUseTopic(user))
pref.home_system = raw_choice
else
pref.home_system = choice
return TOPIC_REFRESH
else if(href_list["birthplace"])
var/choice = tgui_input_list(user, "Please choose the planet and/or system or other appropriate location that you were born/created. Select \"Other\" to specify manually.", "Character Preference", home_system_choices + list("Unset","Other"), pref.birthplace)
if(!choice || !CanUseTopic(user))
return TOPIC_NOACTION
if(choice == "Other")
var/raw_choice = strip_html_simple(tgui_input_text(user, "Please enter a birthplace.", "Character Preference", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(raw_choice && CanUseTopic(user))
pref.birthplace = raw_choice
else
pref.birthplace = choice
return TOPIC_REFRESH
else if(href_list["citizenship"])
var/choice = tgui_input_list(user, "Please select the faction or political entity with which you currently hold citizenship. Select \"Other\" to specify manually.", "Character Preference", citizenship_choices + list("None","Other"), pref.citizenship)
if(!choice || !CanUseTopic(user))
return TOPIC_NOACTION
if(choice == "Other")
var/raw_choice = strip_html_simple(tgui_input_text(user, "Please enter your current citizenship.", "Character Preference", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(raw_choice && CanUseTopic(user))
pref.citizenship = raw_choice
else
pref.citizenship = choice
return TOPIC_REFRESH
else if(href_list["faction"])
var/choice = tgui_input_list(user, "Please choose the faction you primarily work for, if you are not under the direct employ of NanoTrasen. Select \"Other\" to specify manually.", "Character Preference", faction_choices + list("None","Other"), pref.faction)
if(!choice || !CanUseTopic(user))
return TOPIC_NOACTION
if(choice == "Other")
var/raw_choice = strip_html_simple(tgui_input_text(user, "Please enter a faction.", "Character Preference", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(raw_choice)
pref.faction = raw_choice
else
pref.faction = choice
return TOPIC_REFRESH
else if(href_list["religion"])
var/choice = tgui_input_list(user, "Please choose a religion. Select \"Other\" to specify manually.", "Character Preference", religion_choices + list("None","Other"), pref.religion)
if(!choice || !CanUseTopic(user))
return TOPIC_NOACTION
if(choice == "Other")
var/raw_choice = strip_html_simple(tgui_input_text(user, "Please enter a religon.", "Character Preference", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(raw_choice)
pref.religion = sanitize(raw_choice)
else
pref.religion = choice
return TOPIC_REFRESH
else if(href_list["set_medical_records"])
var/new_medical = strip_html_simple(tgui_input_text(user,"Enter medical information here.","Character Preference", html_decode(pref.med_record), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH)
if(new_medical && !jobban_isbanned(user, "Records") && CanUseTopic(user))
pref.med_record = new_medical
return TOPIC_REFRESH
else if(href_list["set_general_records"])
var/new_general = strip_html_simple(tgui_input_text(user,"Enter employment information here.","Character Preference", html_decode(pref.gen_record), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH)
if(new_general && !jobban_isbanned(user, "Records") && CanUseTopic(user))
pref.gen_record = new_general
return TOPIC_REFRESH
else if(href_list["set_security_records"])
var/sec_medical = strip_html_simple(tgui_input_text(user,"Enter security information here.","Character Preference", html_decode(pref.sec_record), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH)
if(sec_medical && !jobban_isbanned(user, "Records") && CanUseTopic(user))
pref.sec_record = sec_medical
return TOPIC_REFRESH
else if(href_list["reset_medrecord"])
var/resetmed_choice = tgui_alert(usr, "Wipe your Medical Records? This cannot be reverted if you have not saved your character recently! You may wish to make a backup first.","Reset Records",list("Yes","No"))
if(resetmed_choice == "Yes")
pref.med_record = null
return TOPIC_REFRESH
else if(href_list["reset_emprecord"])
var/resetemp_choice = tgui_alert(usr, "Wipe your Employment Records? This cannot be reverted if you have not saved your character recently! You may wish to make a backup first.","Reset Records",list("Yes","No"))
if(resetemp_choice == "Yes")
pref.gen_record = null
return TOPIC_REFRESH
else if(href_list["reset_secrecord"])
var/resetsec_choice = tgui_alert(usr, "Wipe your Security Records? This cannot be reverted if you have not saved your character recently! You may wish to make a backup first.","Reset Records",list("Yes","No"))
if(resetsec_choice == "Yes")
pref.sec_record = null
return TOPIC_REFRESH
return ..()
@@ -1,154 +1,154 @@
/datum/category_item/player_setup_item/general/flavor
name = "Flavor"
sort_order = 6
/datum/category_item/player_setup_item/general/flavor/load_character(var/savefile/S)
S["flavor_texts_general"] >> pref.flavor_texts["general"]
S["flavor_texts_head"] >> pref.flavor_texts["head"]
S["flavor_texts_face"] >> pref.flavor_texts["face"]
S["flavor_texts_eyes"] >> pref.flavor_texts["eyes"]
S["flavor_texts_torso"] >> pref.flavor_texts["torso"]
S["flavor_texts_arms"] >> pref.flavor_texts["arms"]
S["flavor_texts_hands"] >> pref.flavor_texts["hands"]
S["flavor_texts_legs"] >> pref.flavor_texts["legs"]
S["flavor_texts_feet"] >> pref.flavor_texts["feet"]
S["custom_link"] >> pref.custom_link
//Flavour text for robots.
S["flavour_texts_robot_Default"] >> pref.flavour_texts_robot["Default"]
for(var/module in robot_module_types)
S["flavour_texts_robot_[module]"] >> pref.flavour_texts_robot[module]
/datum/category_item/player_setup_item/general/flavor/save_character(var/savefile/S)
S["flavor_texts_general"] << pref.flavor_texts["general"]
S["flavor_texts_head"] << pref.flavor_texts["head"]
S["flavor_texts_face"] << pref.flavor_texts["face"]
S["flavor_texts_eyes"] << pref.flavor_texts["eyes"]
S["flavor_texts_torso"] << pref.flavor_texts["torso"]
S["flavor_texts_arms"] << pref.flavor_texts["arms"]
S["flavor_texts_hands"] << pref.flavor_texts["hands"]
S["flavor_texts_legs"] << pref.flavor_texts["legs"]
S["flavor_texts_feet"] << pref.flavor_texts["feet"]
S["custom_link"] << pref.custom_link
S["flavour_texts_robot_Default"] << pref.flavour_texts_robot["Default"]
for(var/module in robot_module_types)
S["flavour_texts_robot_[module]"] << pref.flavour_texts_robot[module]
/datum/category_item/player_setup_item/general/flavor/sanitize_character()
return
// Moved from /datum/preferences/proc/copy_to()
/datum/category_item/player_setup_item/general/flavor/copy_to_mob(var/mob/living/carbon/human/character)
character.flavor_texts["general"] = pref.flavor_texts["general"]
character.flavor_texts["head"] = pref.flavor_texts["head"]
character.flavor_texts["face"] = pref.flavor_texts["face"]
character.flavor_texts["eyes"] = pref.flavor_texts["eyes"]
character.flavor_texts["torso"] = pref.flavor_texts["torso"]
character.flavor_texts["arms"] = pref.flavor_texts["arms"]
character.flavor_texts["hands"] = pref.flavor_texts["hands"]
character.flavor_texts["legs"] = pref.flavor_texts["legs"]
character.flavor_texts["feet"] = pref.flavor_texts["feet"]
character.ooc_notes = pref.metadata //VOREStation Add
character.ooc_notes_likes = pref.metadata_likes
character.ooc_notes_dislikes = pref.metadata_dislikes
character.custom_link = pref.custom_link
/datum/category_item/player_setup_item/general/flavor/content(var/mob/user)
. += "<b>Flavor:</b><br>"
. += "<a href='?src=\ref[src];flavor_text=open'>Set Flavor Text</a><br/>"
. += "<a href='?src=\ref[src];flavour_text_robot=open'>Set Robot Flavor Text</a><br/>"
. += "<a href='?src=\ref[src];custom_link=1'>Set Custom Link</a><br/>"
/datum/category_item/player_setup_item/general/flavor/OnTopic(var/href,var/list/href_list, var/mob/user)
if(href_list["flavor_text"])
switch(href_list["flavor_text"])
if("open")
if("general")
var/msg = strip_html_simple(tgui_input_text(usr,"Give a general description of your character. This will be shown regardless of clothings. Put in a single space to make blank.","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]]), multiline = TRUE, prevent_enter = TRUE)) //VOREStation Edit: separating out OOC notes
if(CanUseTopic(user) && msg)
pref.flavor_texts[href_list["flavor_text"]] = msg
else
var/msg = strip_html_simple(tgui_input_text(usr,"Set the flavor text for your [href_list["flavor_text"]]. Put in a single space to make blank.","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]]), multiline = TRUE, prevent_enter = TRUE))
if(CanUseTopic(user) && msg)
pref.flavor_texts[href_list["flavor_text"]] = msg
SetFlavorText(user)
return TOPIC_HANDLED
else if(href_list["flavour_text_robot"])
switch(href_list["flavour_text_robot"])
if("open")
if("Default")
var/msg = strip_html_simple(tgui_input_text(usr,"Set the default flavour text for your robot. It will be used for any module without individual setting. Put in a single space to make blank.","Flavour Text",html_decode(pref.flavour_texts_robot["Default"]), multiline = TRUE, prevent_enter = TRUE))
if(CanUseTopic(user) && msg)
pref.flavour_texts_robot[href_list["flavour_text_robot"]] = msg
else
var/msg = strip_html_simple(tgui_input_text(usr,"Set the flavour text for your robot with [href_list["flavour_text_robot"]] module. If you leave this blank, default flavour text will be used for this module. Put in a single space to make blank.","Flavour Text",html_decode(pref.flavour_texts_robot[href_list["flavour_text_robot"]]), multiline = TRUE, prevent_enter = TRUE))
if(CanUseTopic(user) && msg)
pref.flavour_texts_robot[href_list["flavour_text_robot"]] = msg
SetFlavourTextRobot(user)
return TOPIC_HANDLED
else if(href_list["custom_link"])
var/new_link = strip_html_simple(tgui_input_text(usr, "Enter a link to add on to your examine text! This should be a related image link/gallery, or things like your F-list. This is not the place for memes.", "Custom Link" , html_decode(pref.custom_link), max_length = 100, encode = TRUE, prevent_enter = TRUE))
if(new_link && CanUseTopic(usr))
if(length(new_link) > 100)
to_chat(usr, "<span class = 'warning'>Your entry is too long, it must be 100 characters or less.</span>")
return
pref.custom_link = new_link
log_admin("[usr]/[usr.ckey] set their custom link to [pref.custom_link]")
return ..()
/datum/category_item/player_setup_item/general/flavor/proc/SetFlavorText(mob/user)
var/HTML = "<body>"
HTML += "<tt><center>"
HTML += "<b>Set Flavor Text</b> <hr />"
HTML += "Note: This is not *literal* flavor of your character. This is visual description of what they look like. <hr />"
HTML += "<br></center>"
HTML += "<a href='?src=\ref[src];flavor_text=general'>General:</a> "
HTML += TextPreview(pref.flavor_texts["general"])
HTML += "<br>"
HTML += "<a href='?src=\ref[src];flavor_text=head'>Head:</a> "
HTML += TextPreview(pref.flavor_texts["head"])
HTML += "<br>"
HTML += "<a href='?src=\ref[src];flavor_text=face'>Face:</a> "
HTML += TextPreview(pref.flavor_texts["face"])
HTML += "<br>"
HTML += "<a href='?src=\ref[src];flavor_text=eyes'>Eyes:</a> "
HTML += TextPreview(pref.flavor_texts["eyes"])
HTML += "<br>"
HTML += "<a href='?src=\ref[src];flavor_text=torso'>Body:</a> "
HTML += TextPreview(pref.flavor_texts["torso"])
HTML += "<br>"
HTML += "<a href='?src=\ref[src];flavor_text=arms'>Arms:</a> "
HTML += TextPreview(pref.flavor_texts["arms"])
HTML += "<br>"
HTML += "<a href='?src=\ref[src];flavor_text=hands'>Hands:</a> "
HTML += TextPreview(pref.flavor_texts["hands"])
HTML += "<br>"
HTML += "<a href='?src=\ref[src];flavor_text=legs'>Legs:</a> "
HTML += TextPreview(pref.flavor_texts["legs"])
HTML += "<br>"
HTML += "<a href='?src=\ref[src];flavor_text=feet'>Feet:</a> "
HTML += TextPreview(pref.flavor_texts["feet"])
HTML += "<br>"
HTML += "<hr />"
HTML += "<tt>"
user << browse(HTML, "window=flavor_text;size=430x300")
return
/datum/category_item/player_setup_item/general/flavor/proc/SetFlavourTextRobot(mob/user)
var/HTML = "<body>"
HTML += "<tt><center>"
HTML += "<b>Set Robot Flavour Text</b> <hr />"
HTML += "<br></center>"
HTML += "<a href='?src=\ref[src];flavour_text_robot=Default'>Default:</a> "
HTML += TextPreview(pref.flavour_texts_robot["Default"])
HTML += "<hr />"
for(var/module in robot_module_types)
HTML += "<a href='?src=\ref[src];flavour_text_robot=[module]'>[module]:</a> "
HTML += TextPreview(pref.flavour_texts_robot[module])
HTML += "<br>"
HTML += "<hr />"
HTML += "<tt>"
user << browse(HTML, "window=flavour_text_robot;size=430x300")
return
/datum/category_item/player_setup_item/general/flavor
name = "Flavor"
sort_order = 6
/datum/category_item/player_setup_item/general/flavor/load_character(var/savefile/S)
S["flavor_texts_general"] >> pref.flavor_texts["general"]
S["flavor_texts_head"] >> pref.flavor_texts["head"]
S["flavor_texts_face"] >> pref.flavor_texts["face"]
S["flavor_texts_eyes"] >> pref.flavor_texts["eyes"]
S["flavor_texts_torso"] >> pref.flavor_texts["torso"]
S["flavor_texts_arms"] >> pref.flavor_texts["arms"]
S["flavor_texts_hands"] >> pref.flavor_texts["hands"]
S["flavor_texts_legs"] >> pref.flavor_texts["legs"]
S["flavor_texts_feet"] >> pref.flavor_texts["feet"]
S["custom_link"] >> pref.custom_link
//Flavour text for robots.
S["flavour_texts_robot_Default"] >> pref.flavour_texts_robot["Default"]
for(var/module in robot_module_types)
S["flavour_texts_robot_[module]"] >> pref.flavour_texts_robot[module]
/datum/category_item/player_setup_item/general/flavor/save_character(var/savefile/S)
S["flavor_texts_general"] << pref.flavor_texts["general"]
S["flavor_texts_head"] << pref.flavor_texts["head"]
S["flavor_texts_face"] << pref.flavor_texts["face"]
S["flavor_texts_eyes"] << pref.flavor_texts["eyes"]
S["flavor_texts_torso"] << pref.flavor_texts["torso"]
S["flavor_texts_arms"] << pref.flavor_texts["arms"]
S["flavor_texts_hands"] << pref.flavor_texts["hands"]
S["flavor_texts_legs"] << pref.flavor_texts["legs"]
S["flavor_texts_feet"] << pref.flavor_texts["feet"]
S["custom_link"] << pref.custom_link
S["flavour_texts_robot_Default"] << pref.flavour_texts_robot["Default"]
for(var/module in robot_module_types)
S["flavour_texts_robot_[module]"] << pref.flavour_texts_robot[module]
/datum/category_item/player_setup_item/general/flavor/sanitize_character()
return
// Moved from /datum/preferences/proc/copy_to()
/datum/category_item/player_setup_item/general/flavor/copy_to_mob(var/mob/living/carbon/human/character)
character.flavor_texts["general"] = pref.flavor_texts["general"]
character.flavor_texts["head"] = pref.flavor_texts["head"]
character.flavor_texts["face"] = pref.flavor_texts["face"]
character.flavor_texts["eyes"] = pref.flavor_texts["eyes"]
character.flavor_texts["torso"] = pref.flavor_texts["torso"]
character.flavor_texts["arms"] = pref.flavor_texts["arms"]
character.flavor_texts["hands"] = pref.flavor_texts["hands"]
character.flavor_texts["legs"] = pref.flavor_texts["legs"]
character.flavor_texts["feet"] = pref.flavor_texts["feet"]
character.ooc_notes = pref.metadata //VOREStation Add
character.ooc_notes_likes = pref.metadata_likes
character.ooc_notes_dislikes = pref.metadata_dislikes
character.custom_link = pref.custom_link
/datum/category_item/player_setup_item/general/flavor/content(var/mob/user)
. += "<b>Flavor:</b><br>"
. += "<a href='?src=\ref[src];flavor_text=open'>Set Flavor Text</a><br/>"
. += "<a href='?src=\ref[src];flavour_text_robot=open'>Set Robot Flavor Text</a><br/>"
. += "<a href='?src=\ref[src];custom_link=1'>Set Custom Link</a><br/>"
/datum/category_item/player_setup_item/general/flavor/OnTopic(var/href,var/list/href_list, var/mob/user)
if(href_list["flavor_text"])
switch(href_list["flavor_text"])
if("open")
if("general")
var/msg = strip_html_simple(tgui_input_text(usr,"Give a general description of your character. This will be shown regardless of clothings. Put in a single space to make blank.","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]]), multiline = TRUE, prevent_enter = TRUE)) //VOREStation Edit: separating out OOC notes
if(CanUseTopic(user) && msg)
pref.flavor_texts[href_list["flavor_text"]] = msg
else
var/msg = strip_html_simple(tgui_input_text(usr,"Set the flavor text for your [href_list["flavor_text"]]. Put in a single space to make blank.","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]]), multiline = TRUE, prevent_enter = TRUE))
if(CanUseTopic(user) && msg)
pref.flavor_texts[href_list["flavor_text"]] = msg
SetFlavorText(user)
return TOPIC_HANDLED
else if(href_list["flavour_text_robot"])
switch(href_list["flavour_text_robot"])
if("open")
if("Default")
var/msg = strip_html_simple(tgui_input_text(usr,"Set the default flavour text for your robot. It will be used for any module without individual setting. Put in a single space to make blank.","Flavour Text",html_decode(pref.flavour_texts_robot["Default"]), multiline = TRUE, prevent_enter = TRUE))
if(CanUseTopic(user) && msg)
pref.flavour_texts_robot[href_list["flavour_text_robot"]] = msg
else
var/msg = strip_html_simple(tgui_input_text(usr,"Set the flavour text for your robot with [href_list["flavour_text_robot"]] module. If you leave this blank, default flavour text will be used for this module. Put in a single space to make blank.","Flavour Text",html_decode(pref.flavour_texts_robot[href_list["flavour_text_robot"]]), multiline = TRUE, prevent_enter = TRUE))
if(CanUseTopic(user) && msg)
pref.flavour_texts_robot[href_list["flavour_text_robot"]] = msg
SetFlavourTextRobot(user)
return TOPIC_HANDLED
else if(href_list["custom_link"])
var/new_link = strip_html_simple(tgui_input_text(usr, "Enter a link to add on to your examine text! This should be a related image link/gallery, or things like your F-list. This is not the place for memes.", "Custom Link" , html_decode(pref.custom_link), max_length = 100, encode = TRUE, prevent_enter = TRUE))
if(new_link && CanUseTopic(usr))
if(length(new_link) > 100)
to_chat(usr, "<span class = 'warning'>Your entry is too long, it must be 100 characters or less.</span>")
return
pref.custom_link = new_link
log_admin("[usr]/[usr.ckey] set their custom link to [pref.custom_link]")
return ..()
/datum/category_item/player_setup_item/general/flavor/proc/SetFlavorText(mob/user)
var/HTML = "<body>"
HTML += "<tt><center>"
HTML += "<b>Set Flavor Text</b> <hr />"
HTML += "Note: This is not *literal* flavor of your character. This is visual description of what they look like. <hr />"
HTML += "<br></center>"
HTML += "<a href='?src=\ref[src];flavor_text=general'>General:</a> "
HTML += TextPreview(pref.flavor_texts["general"])
HTML += "<br>"
HTML += "<a href='?src=\ref[src];flavor_text=head'>Head:</a> "
HTML += TextPreview(pref.flavor_texts["head"])
HTML += "<br>"
HTML += "<a href='?src=\ref[src];flavor_text=face'>Face:</a> "
HTML += TextPreview(pref.flavor_texts["face"])
HTML += "<br>"
HTML += "<a href='?src=\ref[src];flavor_text=eyes'>Eyes:</a> "
HTML += TextPreview(pref.flavor_texts["eyes"])
HTML += "<br>"
HTML += "<a href='?src=\ref[src];flavor_text=torso'>Body:</a> "
HTML += TextPreview(pref.flavor_texts["torso"])
HTML += "<br>"
HTML += "<a href='?src=\ref[src];flavor_text=arms'>Arms:</a> "
HTML += TextPreview(pref.flavor_texts["arms"])
HTML += "<br>"
HTML += "<a href='?src=\ref[src];flavor_text=hands'>Hands:</a> "
HTML += TextPreview(pref.flavor_texts["hands"])
HTML += "<br>"
HTML += "<a href='?src=\ref[src];flavor_text=legs'>Legs:</a> "
HTML += TextPreview(pref.flavor_texts["legs"])
HTML += "<br>"
HTML += "<a href='?src=\ref[src];flavor_text=feet'>Feet:</a> "
HTML += TextPreview(pref.flavor_texts["feet"])
HTML += "<br>"
HTML += "<hr />"
HTML += "<tt>"
user << browse(HTML, "window=flavor_text;size=430x300")
return
/datum/category_item/player_setup_item/general/flavor/proc/SetFlavourTextRobot(mob/user)
var/HTML = "<body>"
HTML += "<tt><center>"
HTML += "<b>Set Robot Flavour Text</b> <hr />"
HTML += "<br></center>"
HTML += "<a href='?src=\ref[src];flavour_text_robot=Default'>Default:</a> "
HTML += TextPreview(pref.flavour_texts_robot["Default"])
HTML += "<hr />"
for(var/module in robot_module_types)
HTML += "<a href='?src=\ref[src];flavour_text_robot=[module]'>[module]:</a> "
HTML += TextPreview(pref.flavour_texts_robot[module])
HTML += "<br>"
HTML += "<hr />"
HTML += "<tt>"
user << browse(HTML, "window=flavour_text_robot;size=430x300")
return