From db33fb6425b6f406af5fb7c5c935bcf384e95bda Mon Sep 17 00:00:00 2001 From: Ccomp5950 Date: Sun, 16 Feb 2014 02:22:49 -0600 Subject: [PATCH] ZAS_Debug verb. Applys a client side only layer of colors over the various zones to show if they are connected or not. Green is your current zone Blue is adjacent zones that are connected. yellow is zones that are connected but not adjacent to your current zone. Red is for zones that aren't connected at all. --- code/modules/admin/verbs/mapping.dm | 79 +++++++++++++++++++++++++++- icons/misc/debug_group.dmi | Bin 225 -> 400 bytes 2 files changed, 78 insertions(+), 1 deletion(-) diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index 2c8657e82b1..7d7be13a38f 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -159,6 +159,8 @@ var/list/debug_verbs = list ( ,/client/proc/ZoneTick ,/client/proc/TestZASRebuild ,/client/proc/hide_debug_verbs + ,/client/proc/testZAScolors + ,/client/proc/testZAScolors_remove ) @@ -183,6 +185,81 @@ var/list/debug_verbs = list ( feedback_add_details("admin_verb","hDV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! +/client/var/list/testZAScolors_turfs = list() +/client/var/list/testZAScolors_zones = list() +/client/var/usedZAScolors = 0 +/client/var/list/image/ZAScolors = list() + +/client/proc/recurse_zone(var/zone/Z, var/recurse_level =1) + testZAScolors_zones += Z + if(recurse_level > 10) + return + var/icon/yellow = new('icons/misc/debug_group.dmi', "yellow") + + for(var/turf/T in Z.contents) + images += image(yellow, T, "zasdebug", TURF_LAYER) + testZAScolors_turfs += T + for(var/zone/connected in Z.connected_zones) + if(connected in testZAScolors_zones) + continue + recurse_zone(connected,recurse_level+1) + + +/client/proc/testZAScolors() + set category = "ZAS" + set name = "Check ZAS connections" + + if(!check_rights(R_DEBUG)) return + testZAScolors_remove() + + var/turf/location = get_turf(usr) + + var/icon/red = new('icons/misc/debug_group.dmi', "red") //created here so we don't have to make thousands of these. + var/icon/green = new('icons/misc/debug_group.dmi', "green") + var/icon/blue = new('icons/misc/debug_group.dmi', "blue") + + if(!usedZAScolors) + usr << "ZAS Test Colors" + usr << "Green = Zone you are standing in" + usr << "Blue = Connected zone to the zone you are standing in" + usr << "Yellow = A zone that is connected but not one adjacent to your connected zone" + usr << "Red = Not connected" + usedZAScolors = 1 + + testZAScolors_zones += location.zone + for(var/turf/T in location.zone.contents) + images += image(green, T,"zasdebug", TURF_LAYER) + testZAScolors_turfs += T + for(var/zone/Z in location.zone.connected_zones) + testZAScolors_zones += Z + for(var/turf/T in Z.contents) + images += image(blue, T,"zasdebug",TURF_LAYER) + testZAScolors_turfs += T + for(var/zone/connected in Z.connected_zones) + if(connected in testZAScolors_zones) + continue + recurse_zone(connected,1) + + for(var/turf/T in range(25,location)) + if(!istype(T)) + continue + if(T in testZAScolors_turfs) + continue + images += image(red, T, "zasdebug", TURF_LAYER) + testZAScolors_turfs += T + +/client/proc/testZAScolors_remove() + set category = "ZAS" + set name = "Remove ZAS connection colors" + + testZAScolors_turfs.Cut() + testZAScolors_zones.Cut() + + if(images.len) + for(var/image/i in images) + if(i.icon_state == "zasdebug") + images.Remove(i) + /client/proc/count_objects_on_z_level() set category = "Mapping" @@ -198,7 +275,7 @@ var/list/debug_verbs = list ( var/type_path = text2path(type_text) if(!type_path) return - var/count = 0 + var/count = 1 var/list/atom/atom_list = list() diff --git a/icons/misc/debug_group.dmi b/icons/misc/debug_group.dmi index 2c87c66010c26de26720ce84703287190b34c7b6..a9cf3ee8ab5bff7d289cbbb00010b7bd95ce3d51 100644 GIT binary patch literal 400 zcmeAS@N?(olHy`uVBq!ia0vp^2|(xIMJ|u31;2pIdr1NNJMeeaDkmS%O+;Z@IMny+Voh&2x?Gk1c-vmcuxr zYV(o}`4=+u!-L!lZaOdCIr)=J*!=UJm8W=mS1CPhQpvdEp=)IO^NqYfnXB<}aq){< zXQBgZEsp*DaXhPJaigS8E#o{MC*d!jZiWF}bkx(uF{EP7+glrXnH&XJ4%)i7d{9(W z6nq`;<1X>EMAg78dvEOfVms!$ud7b}&Cav5=ifDtDTDO@SA!^nHbWT08iokQ4NM87 x2)x<3zx&_w_sZAPzeU;ayw6IKW-RvIkk|RnxlOi`uMFrR22WQ%mvv4FO#p)ejj#X! literal 225 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJ%&L%x5|`BCkOrgvg-0Y)*SYD zb9$kwhmP?^k