mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 06:29:23 +01:00
Merge pull request #13437 from neersighted/clickable_stats
Refactor MC/Failsafe/add Subsystems
This commit is contained in:
@@ -182,7 +182,7 @@
|
||||
if(TRAITS & TRAIT_THIEVING)
|
||||
slyness = 75
|
||||
|
||||
SSbp.insertBot(src)
|
||||
SSnpc.insertBot(src)
|
||||
|
||||
|
||||
/mob/living/carbon/human/interactive/attack_hand(mob/living/carbon/human/M)
|
||||
|
||||
@@ -858,4 +858,4 @@
|
||||
return
|
||||
if(!isturf(M.loc) && M.loc != src)
|
||||
return
|
||||
return 1
|
||||
return 1
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/mob/living/carbon/human/whisper(message as text)
|
||||
if(!IsVocal())
|
||||
return
|
||||
if(!message)
|
||||
return
|
||||
if(!message)
|
||||
return
|
||||
|
||||
if(say_disabled) //This is here to try to identify lag problems
|
||||
usr << "<span class='danger'>Speech is currently admin-disabled.</span>"
|
||||
|
||||
@@ -7,12 +7,17 @@ var/const/CHUNK_SIZE = 16 // Only chunk sizes that are to the power of 2. E.g: 2
|
||||
var/datum/cameranet/cameranet = new()
|
||||
|
||||
/datum/cameranet
|
||||
var/name = "Camera Net" // Name to show for VV and stat()
|
||||
|
||||
// The cameras on the map, no matter if they work or not. Updated in obj/machinery/camera.dm by New() and Del().
|
||||
var/list/cameras = list()
|
||||
// The chunks of the map, mapping the areas that the cameras can see.
|
||||
var/list/chunks = list()
|
||||
var/ready = 0
|
||||
|
||||
// The object used for the clickable stat() button.
|
||||
var/obj/effect/statclick/statclick
|
||||
|
||||
// Checks if a chunk has been Generated in x, y, z.
|
||||
/datum/cameranet/proc/chunkGenerated(x, y, z)
|
||||
x &= ~(CHUNK_SIZE - 1)
|
||||
@@ -142,6 +147,11 @@ var/datum/cameranet/cameranet = new()
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/cameranet/proc/stat_entry()
|
||||
if(!statclick)
|
||||
statclick = new/obj/effect/statclick/debug("Initializing...", src)
|
||||
|
||||
stat(name, statclick.update("Cameras: [cameranet.cameras.len] | Chunks: [cameranet.chunks.len]"))
|
||||
|
||||
// Debug verb for VVing the chunk that the turf is in.
|
||||
/*
|
||||
@@ -151,4 +161,4 @@ var/datum/cameranet/cameranet = new()
|
||||
if(cameranet.chunkGenerated(x, y, z))
|
||||
var/datum/camerachunk/chunk = cameranet.getCameraChunk(x, y, z)
|
||||
usr.client.debug_variables(chunk)
|
||||
*/
|
||||
*/
|
||||
+18
-11
@@ -651,18 +651,25 @@ var/list/slot_equipment_priority = list( \
|
||||
|
||||
if(client && client.holder)
|
||||
if(statpanel("MC"))
|
||||
stat("Location:","([x], [y], [z])")
|
||||
stat("CPU:","[world.cpu]")
|
||||
stat("Instances:","[world.contents.len]")
|
||||
|
||||
if(master_controller)
|
||||
stat("MasterController:","[round(master_controller.cost,0.001)]ds (Interval:[master_controller.processing_interval] | Iteration:[master_controller.iteration])")
|
||||
stat("Subsystem cost per second:","[round(master_controller.SSCostPerSecond,0.001)]ds")
|
||||
for(var/datum/subsystem/SS in master_controller.subsystems)
|
||||
if(SS.can_fire)
|
||||
SS.stat_entry()
|
||||
stat("Location:", "([x], [y], [z])")
|
||||
stat("CPU:", "[world.cpu]")
|
||||
stat("Instances:", "[world.contents.len]")
|
||||
config.stat_entry()
|
||||
stat(null)
|
||||
if(Master)
|
||||
Master.stat_entry()
|
||||
else
|
||||
stat("MasterController:","ERROR")
|
||||
stat("Master Controller:", "ERROR")
|
||||
if(Failsafe)
|
||||
Failsafe.stat_entry()
|
||||
else
|
||||
stat("Failsafe Controller:", "ERROR")
|
||||
if(Master)
|
||||
stat("Subsystems:", "[round(Master.subsystem_cost, 0.001)]ds")
|
||||
stat(null)
|
||||
for(var/datum/subsystem/SS in Master.subsystems)
|
||||
SS.stat_entry()
|
||||
cameranet.stat_entry()
|
||||
|
||||
if(listed_turf && client)
|
||||
if(!TurfAdjacent(listed_turf))
|
||||
|
||||
@@ -155,7 +155,7 @@ eventually results in broadcast_message() being called.
|
||||
Broadcast_message() does NOT call say() on radios, but rather calls Hear() on everyone in range of a radio.
|
||||
This is because the system does not like repeating says.
|
||||
|
||||
Furthermore, I changed radios to not be in the radio_controller. Instead, they are in a global list called all_radios.
|
||||
Furthermore, I changed radios to not be in the SSradio. Instead, they are in a global list called all_radios.
|
||||
This is an associative list, and the numbers as strings are the keys. The values are lists of radios that can hear said frequency.
|
||||
|
||||
To add a radio, simply use add_radio(radio, frequency). To remove a radio, use remove_radio(radio, frequency).
|
||||
|
||||
Reference in New Issue
Block a user