Adds a new tab, which displays additional information about possibly anything you examine, assuming someone adds text to it. Additional info on the PR.

This commit is contained in:
Neerti
2015-02-13 02:26:45 -05:00
parent 837d2ad7c8
commit d289997a0c
8 changed files with 72 additions and 5 deletions

View File

@@ -12,6 +12,11 @@
var/throwpass = 0
var/germ_level = GERM_LEVEL_AMBIENT // The higher the germ level, the more germ on the atom.
//Examine tab vars
var/desc_info = null //Blue 'tutorial' text, which details how this atom works, and perhaps some tips and tricks.
var/desc_fluff = null //Yellow text, with quotes, to tell a short blurb or a paragraph about this atom's place in the fluff, should one exist.
///Chemistry.
var/datum/reagents/reagents = null
@@ -202,11 +207,36 @@ its easier to just keep the beam vertical.
user << "\icon[src] That's [f_name] [suffix]"
if(name) //This shouldn't be needed but I'm paranoid.
user.desc_name_holder = "[src.name]" //\icon[src]
user.desc_icon_holder = "\icon[src]"
if(desc)
user << desc
user.desc_holder = src.desc
else
user.desc_holder = 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.
user.desc_info_holder = get_desc_info()
user.desc_fluff_holder = get_desc_fluff()
return distance == -1 || (get_dist(src, user) <= distance)
//Override these if you need special behaviour for a specific type.
/atom/proc/get_desc_info()
if(desc_info)
return desc_info
else
return
/atom/proc/get_desc_fluff()
if(desc_fluff)
return src.desc_fluff
else
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()

View File

@@ -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)

View File

@@ -1236,7 +1236,7 @@
// Might need re-wording.
user << "<span class='alert'>There is no exposed flesh or thin material [target_zone == "head" ? "on their head" : "on their body"] to inject into.</span>"
/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
@@ -1272,7 +1272,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_desc_fluff()
return print_flavor_text(0)
/mob/living/carbon/human/getDNA()
if(species.flags & NO_SCAN)

View File

@@ -172,6 +172,14 @@
// ++++ROCKDTBEN++++ MOB PROCS //END
/mob/living/get_desc_fluff()
if(flavor_text) //Get flavor text for the yellow text.
return flavor_text
else if(desc_fluff) //No flavor text? Try for hardcoded fluff instead.
return desc_fluff
else
return
/mob/proc/get_contents()

View File

@@ -3,6 +3,11 @@
real_name = "drone"
icon = 'icons/mob/robots.dmi'
icon_state = "repairbot"
desc_info = "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, vaccum, and more. Ghosts can join the round as a maintenance drone by using the appropiate verb in the 'ghost' tab."
//desc_fluff is already provided with flavor_text.
maxHealth = 35
health = 35
universal_speak = 0

View File

@@ -833,6 +833,15 @@ 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(client)
statpanel("Examine")
stat(null,"[desc_icon_holder] <font size='5'>[desc_name_holder]</font>") //The name, written in big letters.
stat(null,"[desc_holder]") //the default examine text.
if(desc_info_holder)
stat(null,"<font color='#086A87'><b>[desc_info_holder]</b></font>") //Blue, informative text.
if(desc_fluff_holder)
stat(null,"<font color='#298A08'><b>[desc_fluff_holder]</b></font>") //Yellow, fluff-related text.
@@ -1210,4 +1219,4 @@ mob/proc/yank_out_object()
/mob/verb/westfaceperm()
set hidden = 1
facing_dir = null
set_face_dir(WEST)
set_face_dir(WEST)

View File

@@ -223,3 +223,11 @@
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/desc_name_holder = null
var/desc_holder = null
var/desc_info_holder = null
var/desc_fluff_holder = null
var/desc_icon_holder = null

View File

@@ -1820,7 +1820,7 @@ window "infowindow"
elem "info"
type = INFO
pos = 0,0
size = 638x475
size = 636x451
anchor1 = 0,0
anchor2 = 100,100
font-family = ""
@@ -1843,7 +1843,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=\""