[Semi-modular] Silicon flavor texts (#8788)

* it compiles \o/

* And now it actually works

* fixes flavor texts

* requested change, tested and working

Co-authored-by: Ranged <nickvanderkroon@gmail.com>
This commit is contained in:
NotRanged
2021-10-18 13:47:59 -04:00
committed by GitHub
co-authored by Ranged
parent d859141437
commit f8cd3e1246
6 changed files with 63 additions and 14 deletions
@@ -1,5 +1,5 @@
/datum/examine_panel
var/mob/living/carbon/human/holder //client of whoever is using this datum
var/mob/living/holder //client of whoever is using this datum
var/mob/living/carbon/human/dummy/dummy_holder
var/atom/movable/screen/examine_panel_dummy/examine_panel_screen
@@ -14,12 +14,17 @@
/datum/examine_panel/ui_interact(mob/user, datum/tgui/ui)
if(!examine_panel_screen)
dummy_holder = generate_dummy_lookalike(REF(holder), holder)
var/datum/job/job_ref = SSjob.GetJob(holder.job)
if(job_ref && job_ref.outfit)
var/datum/outfit/outfit_ref = new()
outfit_ref.copy_outfit_from_target(holder)
outfit_ref.equip(dummy_holder, visualsOnly=TRUE)
if(ishuman(holder))
dummy_holder = generate_dummy_lookalike(REF(holder), holder)
var/datum/job/job_ref = SSjob.GetJob(holder.job)
if(job_ref && job_ref.outfit)
var/datum/outfit/outfit_ref = new()
outfit_ref.copy_outfit_from_target(holder)
outfit_ref.equip(dummy_holder, visualsOnly=TRUE)
/*
else if(issilicon(holder))
dummy_holder = image('icons/mob/robots.dmi', icon_state = "robot", dir = SOUTH) // this doesn't work and just shows a black screen, idk a solution though feel free to pitch in
*/
examine_panel_screen = new
examine_panel_screen.vis_contents += dummy_holder
examine_panel_screen.name = "screen"
@@ -37,14 +42,13 @@
var/datum/preferences/preferences = holder.client?.prefs
var/obscured = (holder.wear_mask && (holder.wear_mask.flags_inv & HIDEFACE)) || (holder.head && (holder.head.flags_inv & HIDEFACE))
var/name = obscured ? "Unknown" : holder.name
var/flavor_text = obscured ? "Obscured" : holder.dna.features["flavor_text"]
var/custom_species = obscured ? "Obscured" : holder.dna.features["custom_species"]
var/custom_species_lore = obscured ? "Obscured" : holder.dna.features["custom_species_lore"]
var/flavor_text
var/custom_species
var/custom_species_lore
var/obscured
var/ooc_notes = ""
// Handle OOC notes first
if(preferences && preferences.read_preference(/datum/preference/toggle/master_erp_preferences))
var/e_prefs = preferences.read_preference(/datum/preference/choiced/erp_status)
var/e_prefs_nc = preferences.read_preference(/datum/preference/choiced/erp_status_nc)
@@ -54,7 +58,23 @@
ooc_notes += "Vore: [e_prefs_v]\n"
ooc_notes += "\n"
ooc_notes += holder.dna.features["ooc_notes"]
// Now we handle silicon and/or human, order doesn't really matter
// If other variants of mob/living need to be handled at some point, put them here
if(issilicon(holder))
flavor_text = preferences.read_preference(/datum/preference/text/silicon_flavor_text)
custom_species = "Silicon"
custom_species_lore = "A cyborg unit."
ooc_notes += preferences.read_preference(/datum/preference/text/ooc_notes)
if(ishuman(holder))
var/mob/living/carbon/human/holder_human = holder
obscured = (holder_human.wear_mask && (holder_human.wear_mask.flags_inv & HIDEFACE)) || (holder_human.head && (holder_human.head.flags_inv & HIDEFACE))
custom_species = obscured ? "Obscured" : holder_human.dna.features["custom_species"]
flavor_text = obscured ? "Obscured" : holder_human.dna.features["flavor_text"]
custom_species_lore = obscured ? "Obscured" : holder_human.dna.features["custom_species_lore"]
ooc_notes += holder_human.dna.features["ooc_notes"]
var/name = obscured ? "Unknown" : holder.name
data["obscured"] = obscured ? TRUE : FALSE
data["character_name"] = name
@@ -44,6 +44,13 @@
if(DEAD)
. += "<span class='deadsay'>It looks like its system is corrupted and requires a reset.</span>"
//SKYRAT EDIT ADDITION BEGIN - CUSTOMIZATION
var/line = span_notice("<a href='?src=[REF(src)];lookup_info=1'>Examine closely...</a>")
if(line)
. += line
if(client)
var/erp_status_pref = client.prefs.read_preference(/datum/preference/choiced/erp_status)
if(erp_status_pref && erp_status_pref != "disabled")
. += span_notice("ERP STATUS: [erp_status_pref]")
if(temporary_flavor_text)
if(length_char(temporary_flavor_text) <= 40)
. += "<span class='notice'>[temporary_flavor_text]</span>"
@@ -158,6 +158,12 @@
//Show alerts window if user clicked on "Show alerts" in chat
if(href_list["showalerts"])
alert_control.ui_interact(src)
// SKYRAT EDIT ADDITION -- Customization
if(href_list["lookup_info"])
tgui.holder = src
tgui.ui_interact(usr) //datum has a tgui component, here we open the window
// SKYRAT EDIT END
/mob/living/silicon/robot/get_cell()
return cell