mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-07-13 17:22:41 +01:00
cleanup of alt titles handling, made sechuds able to see icons for the real job if players have an alt title, made custom job titles via id computer into alt titles
Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
@@ -91,7 +91,7 @@ datum/preferences
|
||||
// will probably not be able to do this for head and torso ;)
|
||||
var/list/organ_data = list()
|
||||
|
||||
var/list/job_alt_titles = new() // the default name of a job like "Medical Doctor"
|
||||
var/list/player_alt_titles = new() // the default name of a job like "Medical Doctor"
|
||||
|
||||
var/flavor_text = ""
|
||||
var/med_record = ""
|
||||
@@ -425,7 +425,7 @@ datum/preferences
|
||||
else
|
||||
HTML += " <font color=red>\[NEVER]</font>"
|
||||
if(job.alt_titles)
|
||||
HTML += "</a><br> <a href=\"byond://?src=\ref[user];preference=job;task=alt_title;job=\ref[job]\">\[[GetAltTitle(job)]\]</a></td></tr>"
|
||||
HTML += "</a><br> <a href=\"byond://?src=\ref[user];preference=job;task=alt_title;job=\ref[job]\">\[[GetPlayerAltTitle(job)]\]</a></td></tr>"
|
||||
HTML += "</a></td></tr>"
|
||||
|
||||
HTML += "</td'></tr></table>"
|
||||
@@ -487,18 +487,18 @@ datum/preferences
|
||||
user << browse(HTML, "window=records;size=350x300")
|
||||
return
|
||||
|
||||
proc/GetAltTitle(datum/job/job)
|
||||
return job_alt_titles.Find(job.title) > 0 \
|
||||
? job_alt_titles[job.title] \
|
||||
proc/GetPlayerAltTitle(datum/job/job)
|
||||
return player_alt_titles.Find(job.title) > 0 \
|
||||
? player_alt_titles[job.title] \
|
||||
: job.title
|
||||
|
||||
proc/SetAltTitle(datum/job/job, new_title)
|
||||
proc/SetPlayerAltTitle(datum/job/job, new_title)
|
||||
// remove existing entry
|
||||
if(job_alt_titles.Find(job.title))
|
||||
job_alt_titles -= job.title
|
||||
if(player_alt_titles.Find(job.title))
|
||||
player_alt_titles -= job.title
|
||||
// add one if it's not default
|
||||
if(job.title != new_title)
|
||||
job_alt_titles[job.title] = new_title
|
||||
player_alt_titles[job.title] = new_title
|
||||
|
||||
proc/SetJob(mob/user, role)
|
||||
var/datum/job/job = job_master.GetJob(role)
|
||||
@@ -638,9 +638,9 @@ datum/preferences
|
||||
var/datum/job/job = locate(href_list["job"])
|
||||
if (job)
|
||||
var/choices = list(job.title) + job.alt_titles
|
||||
var/choice = input("Pick a title for [job.title].", "Character Generation", GetAltTitle(job)) as anything in choices | null
|
||||
var/choice = input("Pick a title for [job.title].", "Character Generation", GetPlayerAltTitle(job)) as anything in choices | null
|
||||
if(choice)
|
||||
SetAltTitle(job, choice)
|
||||
SetPlayerAltTitle(job, choice)
|
||||
SetChoices(user)
|
||||
if("input")
|
||||
SetJob(user, href_list["text"])
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
S["sec_record"] >> sec_record
|
||||
S["be_special"] >> be_special
|
||||
S["disabilities"] >> disabilities
|
||||
S["job_alt_titles"] >> job_alt_titles
|
||||
S["player_alt_titles"] >> player_alt_titles
|
||||
S["used_skillpoints"] >> used_skillpoints
|
||||
S["skills"] >> skills
|
||||
S["skill_specialization"] >> skill_specialization
|
||||
@@ -182,7 +182,7 @@
|
||||
if(!skills) skills = list()
|
||||
if(!used_skillpoints) used_skillpoints= 0
|
||||
if(isnull(disabilities)) disabilities = 0
|
||||
if(!job_alt_titles) job_alt_titles = new()
|
||||
if(!player_alt_titles) player_alt_titles = new()
|
||||
if(!organ_data) src.organ_data = list()
|
||||
//if(!skin_style) skin_style = "Default"
|
||||
|
||||
@@ -232,7 +232,7 @@
|
||||
S["flavor_text"] << flavor_text
|
||||
S["med_record"] << med_record
|
||||
S["sec_record"] << sec_record
|
||||
S["job_alt_titles"] << job_alt_titles
|
||||
S["player_alt_titles"] << player_alt_titles
|
||||
S["be_special"] << be_special
|
||||
S["used_skillpoints"] << used_skillpoints
|
||||
S["skills"] << skills
|
||||
|
||||
@@ -83,14 +83,13 @@
|
||||
var/icon/tempHud = 'icons/mob/hud.dmi'
|
||||
for(var/mob/living/carbon/human/perp in view(M))
|
||||
if(!C) continue
|
||||
var/perpname = "wot"
|
||||
var/perpname = perp.name
|
||||
if(perp.wear_id)
|
||||
var/obj/item/weapon/card/id/I = perp.wear_id.GetID()
|
||||
if(I)
|
||||
C.images += image(tempHud, perp, "hud[ckey(I.GetJobName())]")
|
||||
C.images += image(tempHud, perp, "hud[ckey(I.GetJobRealName())]")
|
||||
perpname = I.registered_name
|
||||
else
|
||||
perpname = perp.name
|
||||
C.images += image(tempHud, perp, "hudunknown")
|
||||
|
||||
for(var/datum/data/record/E in data_core.general)
|
||||
|
||||
@@ -629,7 +629,7 @@ Radar-related things
|
||||
var/mob/living/M = A
|
||||
if(ishuman(M))
|
||||
if(M:wear_id)
|
||||
var/job = M:wear_id:GetJobName()
|
||||
var/job = M:wear_id:GetJobRealName()
|
||||
if(job == "Security Officer")
|
||||
blip.icon_state = "secblip"
|
||||
blip.name = "Security Officer"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
var/turf/T = get_turf_or_move(src.loc)
|
||||
for(var/mob/living/carbon/human/perp in view(T))
|
||||
if(perp.wear_id)
|
||||
client.images += image(tempHud,perp,"hud[ckey(perp:wear_id:GetJobName())]")
|
||||
client.images += image(tempHud,perp,"hud[ckey(perp:wear_id:GetJobRealName())]")
|
||||
var/perpname = "wot"
|
||||
if(istype(perp.wear_id,/obj/item/weapon/card/id))
|
||||
perpname = perp.wear_id:registered_name
|
||||
|
||||
Reference in New Issue
Block a user