From e5a9b686aa1c3a7558affeed8c97aa2634c7deca Mon Sep 17 00:00:00 2001 From: mwerezak Date: Mon, 9 Mar 2015 02:02:10 -0400 Subject: [PATCH 1/3] Fixes human examine Fixes issues introduced with the examine tab system by decoupling the examine() proc from the code that updates a mob's description holders. Puts a few things in more logical places. --- code/modules/examine/examine.dm | 56 ++++++++----------- .../mob/living/carbon/human/examine.dm | 1 - code/modules/mob/mob.dm | 3 + 3 files changed, 27 insertions(+), 33 deletions(-) diff --git a/code/modules/examine/examine.dm b/code/modules/examine/examine.dm index 392f897c68..6f797f5cb9 100644 --- a/code/modules/examine/examine.dm +++ b/code/modules/examine/examine.dm @@ -11,26 +11,7 @@ var/description_fluff = null //Green text about the atom's fluff, if any exists. var/description_antag = null //Malicious red text, for the antags. -/atom/examine(mob/user, var/distance = -1, var/infix = "", var/suffix = "") - . = ..() - user.description_holders["info"] = get_description_info() - user.description_holders["fluff"] = get_description_fluff() - if(user.mind && user.mind.special_role || isobserver(user)) //Runtime prevention, as ghosts don't have minds. - user.description_holders["antag"] = get_description_antag() - - if(name) //This shouldn't be needed but I'm paranoid. - user.description_holders["name"] = "[src.name]" //\icon[src] - - user.description_holders["icon"] = "\icon[src]" - - if(desc) - user << desc - user.description_holders["desc"] = src.desc - else - user.description_holders["desc"] = null //This is needed, or else if you examine one thing with a desc, then another without, the panel will retain the first examined's desc. - //Override these if you need special behaviour for a specific type. - /atom/proc/get_description_info() if(description_info) return description_info @@ -46,10 +27,30 @@ return description_antag return -/mob/ - var/description_holders[0] +/mob/living/get_description_fluff() + if(flavor_text) //Get flavor text for the green text. + return flavor_text + else //No flavor text? Try for hardcoded fluff instead. + return ..() -/mob/Stat() +/mob/living/carbon/human/get_description_fluff() + return print_flavor_text(0) + +/* The examine panel itself */ + +/client/var/description_holders[0] + +/client/proc/update_description_holders(atom/A) + description_holders["info"] = A.get_description_info() + description_holders["fluff"] = A.get_description_fluff() + if(mob.mind && mob.mind.special_role || isobserver(src)) //ghosts don't have minds. + description_holders["antag"] = A.get_description_antag() + + description_holders["name"] = "[A.name]" + description_holders["icon"] = "\icon[A]" + description_holders["desc"] = A.desc + +/client/Stat() ..() if(statpanel("Examine")) stat(null,"[description_holders["icon"]] [description_holders["name"]]") //The name, written in big letters. @@ -59,13 +60,4 @@ if(description_holders["fluff"]) stat(null,"[description_holders["fluff"]]") //Yellow, fluff-related text. if(description_holders["antag"]) - stat(null,"[description_holders["antag"]]") //Red, malicious antag-related text - -/mob/living/get_description_fluff() - if(flavor_text) //Get flavor text for the green text. - return flavor_text - else //No flavor text? Try for hardcoded fluff instead. - return ..() - -/mob/living/carbon/human/get_description_fluff() - return print_flavor_text(0) + stat(null,"[description_holders["antag"]]") //Red, malicious antag-related text \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 277f88c809..3630d609a3 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -451,7 +451,6 @@ msg += "\n[t_He] is [pose]" user << msg - ..() //Helper procedure. Called by /mob/living/carbon/human/examine() and /mob/living/carbon/human/Topic() to determine HUD access to security and medical records. /proc/hasHUD(mob/M as mob, hudtype) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 61959ab49c..c3e5fbf90b 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -232,6 +232,9 @@ var/list/slot_equipment_priority = list( \ face_atom(A) A.examine(src) + + if(client) + client.update_description_holders(A) /mob/verb/pointed(atom/A as mob|obj|turf in view()) set name = "Point To" From 0b5575897dfb10673e6f6e525359f6de6e7ba2d4 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Mon, 9 Mar 2015 02:34:21 -0400 Subject: [PATCH 2/3] Updates maint drone helptext --- code/modules/examine/descriptions/mobs.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/examine/descriptions/mobs.dm b/code/modules/examine/descriptions/mobs.dm index 8197e6f3d1..8961b9f367 100644 --- a/code/modules/examine/descriptions/mobs.dm +++ b/code/modules/examine/descriptions/mobs.dm @@ -3,6 +3,6 @@ interact with anyone else, except for other drones. They hold a wide array of tools to build, repair, maintain, and clean. \ They fuction similarly to other synthetics, in that they require recharging regularly, have laws, and are resilient to many hazards, \ such as fire, radiation, vacuum, and more. Ghosts can join the round as a maintenance drone by using the appropriate verb in the 'ghost' tab. \ - An inactive drone can be rebooted by swiping an ID card on it with engineering or robotics access." + An inactive drone can be rebooted by swiping an ID card on it with engineering or robotics access, and an active drone can be shut down in the same manner." description_antag = "An Electromagnetic Sequencer can be used to subvert the drone to your cause." \ No newline at end of file From 385ff4f2fa93973cbf3c40df302d38b4529b663c Mon Sep 17 00:00:00 2001 From: mwerezak Date: Mon, 9 Mar 2015 11:51:41 -0400 Subject: [PATCH 3/3] Examine tab modularity Also fixes antag info text sticking around if antag/observer status is lost --- code/game/atoms.dm | 1 + code/modules/examine/examine.dm | 18 +++++++++++++----- code/modules/mob/mob.dm | 5 +---- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 6900a2e030..63c309bb0b 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -201,6 +201,7 @@ its easier to just keep the beam vertical. f_name += "oil-stained [name][infix]." user << "\icon[src] That's [f_name] [suffix]" + user << desc return distance == -1 || (get_dist(src, user) <= distance) diff --git a/code/modules/examine/examine.dm b/code/modules/examine/examine.dm index 6f797f5cb9..3f15fa22d4 100644 --- a/code/modules/examine/examine.dm +++ b/code/modules/examine/examine.dm @@ -40,18 +40,17 @@ /client/var/description_holders[0] -/client/proc/update_description_holders(atom/A) +/client/proc/update_description_holders(atom/A, update_antag_info=0) description_holders["info"] = A.get_description_info() description_holders["fluff"] = A.get_description_fluff() - if(mob.mind && mob.mind.special_role || isobserver(src)) //ghosts don't have minds. - description_holders["antag"] = A.get_description_antag() + description_holders["antag"] = (update_antag_info)? A.get_description_antag() : "" description_holders["name"] = "[A.name]" description_holders["icon"] = "\icon[A]" description_holders["desc"] = A.desc /client/Stat() - ..() + . = ..() if(statpanel("Examine")) stat(null,"[description_holders["icon"]] [description_holders["name"]]") //The name, written in big letters. stat(null,"[description_holders["desc"]]") //the default examine text. @@ -60,4 +59,13 @@ if(description_holders["fluff"]) stat(null,"[description_holders["fluff"]]") //Yellow, fluff-related text. if(description_holders["antag"]) - stat(null,"[description_holders["antag"]]") //Red, malicious antag-related text \ No newline at end of file + stat(null,"[description_holders["antag"]]") //Red, malicious antag-related text + +//override examinate verb to update description holders when things are examined +/mob/examinate(atom/A as mob|obj|turf in view()) + if(..()) + return 1 + + var/is_antag = ((mind && mind.special_role) || isobserver(src)) //ghosts don't have minds + if(client) + client.update_description_holders(A, is_antag) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index c3e5fbf90b..16ff11ea9b 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -228,13 +228,10 @@ var/list/slot_equipment_priority = list( \ if((is_blind(src) || usr.stat) && !isobserver(src)) src << "Something is there but you can't see it." - return + return 1 face_atom(A) A.examine(src) - - if(client) - client.update_description_holders(A) /mob/verb/pointed(atom/A as mob|obj|turf in view()) set name = "Point To"