From 0195caad1646ac9e6422e65584b778b8d5e2e62e Mon Sep 17 00:00:00 2001 From: Pete Goodfellow Date: Wed, 18 Sep 2013 23:04:08 +0100 Subject: [PATCH] Ported and improved Sayu's awesome alt-click stat panel. Alt-clicking a tile will bring up a list of the objects on it in a stat panel- these can be interacted with normally, with both left and right clicks. This is particularly useful for getting specific items from lockers. --- code/ATMOSPHERICS/components/unary/vent_pump.dm | 11 ++++++----- code/_onclick/click.dm | 7 +++++++ code/modules/mob/mob.dm | 9 +++++++++ code/modules/mob/mob_defines.dm | 4 +++- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm index cbdbc03932c..bd9ce4f3304 100644 --- a/code/ATMOSPHERICS/components/unary/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm @@ -345,8 +345,9 @@ I am sorry, I don't know why. */ /obj/machinery/atmospherics/unary/vent_pump/AltClick(var/mob/living/carbon/ML) - if(!istype(ML)) - return - var/list/ventcrawl_verbs = list(/mob/living/carbon/monkey/verb/ventcrawl, /mob/living/carbon/alien/verb/ventcrawl, /mob/living/carbon/slime/verb/ventcrawl) - if(length(ML.verbs & ventcrawl_verbs)) // alien queens have this removed, an istype would be complicated - ML.handle_ventcrawl(src) + if(istype(ML)) + var/list/ventcrawl_verbs = list(/mob/living/carbon/monkey/verb/ventcrawl, /mob/living/carbon/alien/verb/ventcrawl, /mob/living/carbon/slime/verb/ventcrawl) + if(length(ML.verbs & ventcrawl_verbs)) // alien queens have this removed, an istype would be complicated + ML.handle_ventcrawl(src) + return + ..() diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index f66bd303e94..b3200951708 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -241,6 +241,13 @@ return /atom/proc/AltClick(var/mob/user) + var/turf/T = get_turf(src) + if(T && T.Adjacent(user)) + if(user.listed_turf == T) + user.listed_turf = null + else + user.listed_turf = T + user.client.statpanel = T.name return /* diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index c48ba8dca22..d1331a4e860 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -655,6 +655,15 @@ note dizziness decrements automatically in the mob's Life() proc. else stat(null,"MasterController-ERROR") + if(listed_turf && client) + if(get_dist(listed_turf,src) > 1) + listed_turf = null + else + statpanel(listed_turf.name, null, listed_turf) + for(var/atom/A in listed_turf) + if(A.invisibility > see_invisible) + continue + statpanel(listed_turf.name, null, A) if(spell_list.len) for(var/obj/effect/proc_holder/spell/S in spell_list) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 5f0bcf31668..b1208cdbdd5 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -170,4 +170,6 @@ //Whether or not mobs can understand other mobtypes. These stay in /mob so that ghosts can hear everything. var/universal_speak = 0 // Set to 1 to enable the mob to speak to everyone -- TLE var/robot_talk_understand = 0 - var/alien_talk_understand = 0 \ No newline at end of file + var/alien_talk_understand = 0 + + var/turf/listed_turf = null //the current turf being examined in the stat panel \ No newline at end of file