mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-19 11:05:50 +01:00
Adds ability to customize discomfort
Both pre-made and custom species may now choose up to 10 messages each for warnings while overheated or cold. If there are no custom messages, game falls back to defaults (which, if the pre-baked species lacks fluff, uses human) There is a way to reset to defaults. It is possible to go back and edit any of the 10 messages. The editor shows you the previously set message with an option to cancel out (this avoids over-writing the previous message).
This commit is contained in:
@@ -15,6 +15,9 @@
|
||||
var/custom_ask = null
|
||||
var/custom_exclaim = null
|
||||
|
||||
var/list/custom_heat = list()
|
||||
var/list/custom_cold = list()
|
||||
|
||||
var/list/pos_traits = list() // What traits they've selected for their custom species
|
||||
var/list/neu_traits = list()
|
||||
var/list/neg_traits = list()
|
||||
@@ -47,6 +50,9 @@
|
||||
S["custom_ask"] >> pref.custom_ask
|
||||
S["custom_exclaim"] >> pref.custom_exclaim
|
||||
|
||||
S["custom_heat"] >> pref.custom_heat
|
||||
S["custom_cold"] >> pref.custom_cold
|
||||
|
||||
/datum/category_item/player_setup_item/vore/traits/save_character(var/savefile/S)
|
||||
S["custom_species"] << pref.custom_species
|
||||
S["custom_base"] << pref.custom_base
|
||||
@@ -64,6 +70,9 @@
|
||||
S["custom_ask"] << pref.custom_ask
|
||||
S["custom_exclaim"] << pref.custom_exclaim
|
||||
|
||||
S["custom_heat"] << pref.custom_heat
|
||||
S["custom_cold"] << pref.custom_cold
|
||||
|
||||
/datum/category_item/player_setup_item/vore/traits/sanitize_character()
|
||||
if(!pref.pos_traits) pref.pos_traits = list()
|
||||
if(!pref.neu_traits) pref.neu_traits = list()
|
||||
@@ -137,6 +146,9 @@
|
||||
character.custom_ask = lowertext(trim(pref.custom_ask))
|
||||
character.custom_whisper = lowertext(trim(pref.custom_whisper))
|
||||
character.custom_exclaim = lowertext(trim(pref.custom_exclaim))
|
||||
character.custom_heat = pref.custom_heat
|
||||
character.custom_cold = pref.custom_cold
|
||||
|
||||
|
||||
if(character.isSynthetic()) //Checking if we have a synth on our hands, boys.
|
||||
pref.dirty_synth = 1
|
||||
@@ -159,6 +171,8 @@
|
||||
var/english_traits = english_list(new_S.traits, and_text = ";", comma_text = ";")
|
||||
log_game("TRAITS [pref.client_ckey]/([character]) with: [english_traits]") //Terrible 'fake' key_name()... but they aren't in the same entity yet
|
||||
|
||||
|
||||
|
||||
/datum/category_item/player_setup_item/vore/traits/content(var/mob/user)
|
||||
. += "<b>Custom Species Name:</b> "
|
||||
. += "<a href='?src=\ref[src];custom_species=1'>[pref.custom_species ? pref.custom_species : "-Input Name-"]</a><br>"
|
||||
@@ -223,6 +237,14 @@
|
||||
. += "<a href='?src=\ref[src];custom_exclaim=1'>Set Exclaim Verb</a>"
|
||||
. += "(<a href='?src=\ref[src];reset_exclaim=1'>Reset</A>)"
|
||||
. += "<br>"
|
||||
. += "<b>Custom heat Discomfort: </b>"
|
||||
. += "<a href='?src=\ref[src];custom_heat=1'>Set Heat Messages</a>"
|
||||
. += "(<a href='?src=\ref[src];reset_heat=1'>Reset</A>)"
|
||||
. += "<br>"
|
||||
. += "<b>Custom Cold Discomfort: </b>"
|
||||
. += "<a href='?src=\ref[src];custom_cold=1'>Set Cold Messages</a>"
|
||||
. += "(<a href='?src=\ref[src];reset_cold=1'>Reset</A>)"
|
||||
. += "<br>"
|
||||
|
||||
/datum/category_item/player_setup_item/vore/traits/OnTopic(var/href,var/list/href_list, var/mob/user)
|
||||
if(!CanUseTopic(user))
|
||||
@@ -313,6 +335,63 @@
|
||||
pref.custom_exclaim = exclaim_choice
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["custom_heat"])
|
||||
var/numMessages = pref.custom_heat.len
|
||||
if(numMessages > 0)
|
||||
var/alert = tgui_alert(user, "Edit current messages or add a new one?","Selection",list("Edit","Add", "Cancel"))
|
||||
switch(alert)
|
||||
if("Edit")
|
||||
var/list/indices = list()
|
||||
var/i
|
||||
for(i=1, i<= numMessages, i++)
|
||||
indices.Add(i)
|
||||
var/index = tgui_input_list(user,"Select a message to edit:","Select Message", indices)
|
||||
var/new_message = sanitize(tgui_input_text(usr, "Currently editing : [pref.custom_heat[index]]","Heat Discomfort", null, 300), 300)
|
||||
if(new_message)
|
||||
pref.custom_heat[index] = new_message
|
||||
if("Add")
|
||||
if(numMessages >= 10)
|
||||
tgui_alert_async(usr, "Can't add more messages!", "Error")
|
||||
return TOPIC_REFRESH
|
||||
else
|
||||
var/new_message = sanitize(tgui_input_text(usr, "Adding a new heat discomfort message", "Heat Discomfort", null, 300), 300)
|
||||
if(new_message)
|
||||
pref.custom_heat.Add(new_message)
|
||||
else
|
||||
var/new_message = sanitize(tgui_input_text(usr, "Adding a custom heat discomfort message !!!Overrides defaults!!!", "Heat Discomfort", null, 300), 300)
|
||||
if(new_message)
|
||||
pref.custom_heat.Add(new_message)
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["custom_cold"])
|
||||
var/numMessages = pref.custom_cold.len
|
||||
if(numMessages > 0)
|
||||
var/alert = tgui_alert(user, "Edit current messages or add a new one?","Selection",list("Edit","Add", "Cancel"))
|
||||
switch(alert)
|
||||
if("Edit")
|
||||
var/list/indices = list()
|
||||
var/i
|
||||
for(i=1, i<= numMessages, i++)
|
||||
indices.Add(i)
|
||||
var/index = tgui_input_list(user,"Select a message to edit:","Select Message", indices)
|
||||
var/new_message = sanitize(tgui_input_text(usr, "Currently editing : [pref.custom_cold[index]]", "Custom Cold Discomfort", null, 300), 300)
|
||||
if(new_message)
|
||||
pref.custom_cold[index] = new_message
|
||||
if("Add")
|
||||
if(numMessages >= 10)
|
||||
tgui_alert_async(usr, "Can't add more messages!", "Error")
|
||||
return TOPIC_REFRESH
|
||||
else
|
||||
var/new_message = sanitize(tgui_input_text(usr, "Adding a new cold discomfort message", "Cold Discomfort", null, 300), 300)
|
||||
if(new_message)
|
||||
pref.custom_cold.Add(new_message)
|
||||
else
|
||||
var/new_message = sanitize(tgui_input_text(usr, "Adding a custom cold discomfort message !!!Overrides Defaults!!!","Cold Discomfort", null, 300), 300)
|
||||
if(new_message)
|
||||
pref.custom_cold.Add(new_message)
|
||||
return TOPIC_REFRESH
|
||||
|
||||
|
||||
else if(href_list["reset_say"])
|
||||
var/say_choice = tgui_alert(usr, "Reset your Custom Say Verb?","Reset Verb",list("Yes","No"))
|
||||
if(say_choice == "Yes")
|
||||
@@ -337,6 +416,18 @@
|
||||
pref.custom_exclaim = null
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["reset_cold"])
|
||||
var/cold_choice = tgui_alert(usr, "Reset your Custom Cold Discomfort messages?", "Reset Discomfort",list("Yes","No"))
|
||||
if(cold_choice == "Yes")
|
||||
pref.custom_cold = list()
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["reset_heat"])
|
||||
var/heat_choice = tgui_alert(usr, "Reset your Custom Heat Discomfort messages?", "Reset Discomfort",list("Yes","No"))
|
||||
if(heat_choice == "Yes")
|
||||
pref.custom_heat = list()
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["add_trait"])
|
||||
var/mode = text2num(href_list["add_trait"])
|
||||
var/list/picklist
|
||||
|
||||
Reference in New Issue
Block a user