Files
CHOMPStation2/code/modules/client/preference_setup/global/03_pai.dm
Zuhayr f93ea6a78f Tweaks to previous commits.
More tweaks to IPC fixes.
Merge resolution/compile fixes.

Further work on properly integrating, updating and fixing prosthetic options.

Repathed internal organs to organ/internal.

More work on full synthetics, changelings, overheating.

Working on getting organs to qdel properly and spawn properly when robotized.

Finalized some overheating values, added remaining prosthetic icons.

Finalizing the testing version of the full prosthetic bodies branch.

Added suit cyclers to the autolathe and map.

Fixing runtime errors.

Fixing errors.

Changelog.

Replacing limb and organ strings with constants.

Prevented brainless species from becoming full cyborgs.

Fixed issues with brain/MMIs renaming themselves inappropriately.

Various fixes and oversights.
2015-12-24 21:13:40 +10:30

58 lines
2.2 KiB
Plaintext

/datum/category_item/player_setup_item/player_global/pai
name = "pAI"
sort_order = 3
var/datum/paiCandidate/candidate
/datum/category_item/player_setup_item/player_global/pai/load_preferences(var/savefile/S)
if(!candidate)
candidate = new()
if(!preference_mob())
return
candidate.savefile_load(preference_mob())
/datum/category_item/player_setup_item/player_global/pai/save_preferences(var/savefile/S)
if(!candidate)
return
if(!preference_mob())
return
candidate.savefile_save(preference_mob())
/datum/category_item/player_setup_item/player_global/pai/content(var/mob/user)
. += "<b>pAI:</b><br>"
if(!candidate)
log_debug("[user] pAI prefs have a null candidate var.")
return .
. += "Name: <a href='?src=\ref[src];option=name'>[candidate.name ? candidate.name : "None Set"]</a><br>"
. += "Description: <a href='?src=\ref[src];option=desc'>[candidate.description ? TextPreview(candidate.description, 40) : "None Set"]</a><br>"
. += "Role: <a href='?src=\ref[src];option=role'>[candidate.role ? TextPreview(candidate.role, 40) : "None Set"]</a><br>"
. += "OOC Comments: <a href='?src=\ref[src];option=ooc'>[candidate.comments ? TextPreview(candidate.comments, 40) : "None Set"]</a><br>"
/datum/category_item/player_setup_item/player_global/pai/OnTopic(var/href,var/list/href_list, var/mob/user)
if(href_list["option"])
var/t
switch(href_list["option"])
if("name")
t = sanitizeName(input(user, "Enter a name for your pAI", "Global Preference", candidate.name) as text|null, MAX_NAME_LEN, 1)
if(t && CanUseTopic(user))
candidate.name = t
if("desc")
t = input(user, "Enter a description for your pAI", "Global Preference", html_decode(candidate.description)) as message|null
if(!isnull(t) && CanUseTopic(user))
candidate.description = sanitize(t)
if("role")
t = input(user, "Enter a role for your pAI", "Global Preference", html_decode(candidate.role)) as text|null
if(!isnull(t) && CanUseTopic(user))
candidate.role = sanitize(t)
if("ooc")
t = input(user, "Enter any OOC comments", "Global Preference", html_decode(candidate.comments)) as message
if(!isnull(t) && CanUseTopic(user))
candidate.comments = sanitize(t)
return TOPIC_REFRESH
return ..()