diff --git a/baystation12.dme b/baystation12.dme index 6640c37988..64bb7f88d5 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -100,6 +100,7 @@ #include "code\datums\computerfiles.dm" #include "code\datums\datacore.dm" #include "code\datums\datumvars.dm" +#include "code\datums\descriptions.dm" #include "code\datums\disease.dm" #include "code\datums\mind.dm" #include "code\datums\mixed.dm" diff --git a/code/datums/descriptions.dm b/code/datums/descriptions.dm new file mode 100644 index 0000000000..b6812d0576 --- /dev/null +++ b/code/datums/descriptions.dm @@ -0,0 +1,22 @@ +/* +This is what is supplied to the examine tab. Everything has a 'descriptions' variable, which is null by default. When it is not null, +it contains this datum. To add this datum to something, all you do is add this to the thing.. + + descriptions = new/datum/descriptions("I am some helpful blue text","I have backstory text about this obj.","You can use this to kill everyone.") + +First string is the 'info' var, second is the 'fluff' var, and third is the 'antag' var. All are optional. Just add it to the object you want to have it. + +If you are wondering, BYOND does not let you do desc = new/datum/descriptions . + +More strings can be added easily, but you will need to add a proc to retrieve it from the atom. The procs are defined in atoms.dm. + +*/ +/datum/descriptions + var/info + var/fluff + var/antag + +/datum/descriptions/New(var/info, var/fluff, var/antag) + src.info = info + src.fluff = fluff + src.antag = antag \ No newline at end of file diff --git a/code/game/atoms.dm b/code/game/atoms.dm index bd0c9cdb54..64ebc0caf7 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -12,6 +12,9 @@ var/throwpass = 0 var/germ_level = GERM_LEVEL_AMBIENT // The higher the germ level, the more germ on the atom. + //Examine tab + var/datum/descriptions/descriptions = null //See code/datums/descriptions.dm for details. + ///Chemistry. var/datum/reagents/reagents = null @@ -202,11 +205,47 @@ its easier to just keep the beam vertical. user << "\icon[src] That's [f_name] [suffix]" + var/datum/descriptions/D = descriptions + if(istype(D)) + user.description_holders["info"] = get_descriptions_info() + user.description_holders["fluff"] = get_descriptions_fluff() + if(user.mind.special_role) + user.description_holders["antag"] = get_descriptions_antag() + else + user.description_holders["info"] = null + user.description_holders["fluff"] = null + user.description_holders["antag"] = null + + 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. return distance == -1 || (get_dist(src, user) <= distance) +//Override these if you need special behaviour for a specific type. + +/atom/proc/get_descriptions_info() + if(descriptions && descriptions.info) + return descriptions.info + return + +/atom/proc/get_descriptions_fluff() + if(descriptions && descriptions.fluff) + return descriptions.fluff + return + +/atom/proc/get_descriptions_antag() + if(descriptions && descriptions.antag) + return descriptions.antag + return + // called by mobs when e.g. having the atom as their machine, pulledby, loc (AKA mob being inside the atom) or buckled var set. // see code/modules/mob/mob_movement.dm for more. /atom/proc/relaymove() diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index c50b69d779..bb468eaa6c 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -451,6 +451,7 @@ 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/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 5d882774a4..3af8c2bdc6 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1239,7 +1239,7 @@ // Might need re-wording. user << "There is no exposed flesh or thin material [target_zone == "head" ? "on their head" : "on their body"] to inject into." -/mob/living/carbon/human/print_flavor_text() +/mob/living/carbon/human/print_flavor_text(var/shrink = 1) var/list/equipment = list(src.head,src.wear_mask,src.glasses,src.w_uniform,src.wear_suit,src.gloves,src.shoes) var/head_exposed = 1 var/face_exposed = 1 @@ -1275,7 +1275,13 @@ if((T == "head" && head_exposed) || (T == "face" && face_exposed) || (T == "eyes" && eyes_exposed) || (T == "torso" && torso_exposed) || (T == "arms" && arms_exposed) || (T == "hands" && hands_exposed) || (T == "legs" && legs_exposed) || (T == "feet" && feet_exposed)) flavor_text += flavor_texts[T] flavor_text += "\n\n" - return ..() + if(!shrink) + return flavor_text + else + return ..() + +/mob/living/carbon/human/get_descriptions_fluff() + return print_flavor_text(0) /mob/living/carbon/human/getDNA() if(species.flags & NO_SCAN) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 5d2e1aa504..a7cdf1af71 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -172,6 +172,12 @@ // ++++ROCKDTBEN++++ MOB PROCS //END +/mob/living/get_descriptions_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/proc/get_contents() diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index bd89b867ee..1fa357ec79 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -3,6 +3,13 @@ real_name = "drone" icon = 'icons/mob/robots.dmi' icon_state = "repairbot" + descriptions = new/datum/descriptions("Drones are player-controlled synthetics which are lawed to maintain the station and not \ + 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 Electromagnetic Sequencer can be used to subvert the drone to your cause.") + //desc_fluff is already provided with flavor_text. maxHealth = 35 health = 35 universal_speak = 0 diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 73623ac043..342f61d946 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -834,6 +834,17 @@ note dizziness decrements automatically in the mob's Life() proc. statpanel("Spells","[S.charge_counter]/[S.charge_max]",S) if("holdervar") statpanel("Spells","[S.holder_var_type] [S.holder_var_amount]",S) + 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. + if(description_holders["info"]) + stat(null,"[description_holders["info"]]") //Blue, informative text. + if(description_holders["fluff"]) + stat(null,"[description_holders["fluff"]]") //Yellow, fluff-related text. + if(mind.special_role) + if(description_holders["antag"]) + stat(null,"[description_holders["antag"]]") //Red, malicious antag-related text + diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index c4b190c49e..35c1107ca7 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -223,3 +223,8 @@ var/list/shouldnt_see = list() //list of objects that this mob shouldn't see in the stat panel. this silliness is needed because of AI alt+click and cult blood runes var/list/active_genes=list() + + //Examine tab vars + //These hold the descriptions and other info, to relay to the actual tab. + var/description_holders[0] + diff --git a/interface/skin.dmf b/interface/skin.dmf index a8ae16d887..7ba4d10788 100644 --- a/interface/skin.dmf +++ b/interface/skin.dmf @@ -1828,7 +1828,7 @@ window "infowindow" elem "info" type = INFO pos = 0,0 - size = 638x475 + size = 636x451 anchor1 = 0,0 anchor2 = 100,100 font-family = "" @@ -1851,7 +1851,7 @@ window "infowindow" tab-font-family = "" tab-font-size = 0 tab-font-style = "" - allow-html = false + allow-html = true multi-line = true on-show = ".winset\"rpane.infob.is-visible=true;rpane.browseb.is-visible=true?rpane.infob.pos=130,0:rpane.infob.pos=65,0 rpane.textb.is-visible=true rpane.infob.is-checked=true rpane.rpanewindow.pos=0,30 rpane.rpanewindow.size=0x0 rpane.rpanewindow.left=infowindow\"" on-hide = ".winset\"rpane.infob.is-visible=false;rpane.browseb.is-visible=true?rpane.browseb.is-checked=true rpane.rpanewindow.left=browserwindow:rpane.textb.is-visible=true rpane.rpanewindow.pos=0,30 rpane.rpanewindow.size=0x0 rpane.rpanewindow.left=\""