Merge branch 'master' into hair-gradients

This commit is contained in:
dearmochi
2021-07-27 18:28:46 +02:00
812 changed files with 31957 additions and 47236 deletions
@@ -38,5 +38,6 @@
data["isAI"] = isAI(user)
data["crewmembers"] = GLOB.crew_repository.health_data(T)
data["critThreshold"] = HEALTH_THRESHOLD_CRIT
return data
@@ -0,0 +1,17 @@
GLOBAL_DATUM_INIT(generic_crew_manifest, /datum/ui_module/generic_crew_manifest, new)
/datum/ui_module/generic_crew_manifest
name = "Crew Manifest"
/datum/ui_module/generic_crew_manifest/ui_interact(user, ui_key = "GenericCrewManifest", datum/tgui/ui = null, datum/tgui/master_ui = null, state)
ui = SStgui.try_update_ui(user, src, ui_key, ui)
if(!ui)
ui = new(user, src, ui_key, "GenericCrewManifest", name, 588, 510, master_ui, state)
ui.set_autoupdate(FALSE)
ui.open()
/datum/ui_module/generic_crew_manifest/ui_data(user)
var/list/data = list()
GLOB.data_core.get_manifest_json()
data["manifest"] = GLOB.PDA_Manifest
return data
@@ -0,0 +1,73 @@
/// Stores an instance of [/datum/ui_module/ghost_hud_panel] so that ghosts can use this to open their HUD panel.
GLOBAL_DATUM_INIT(ghost_hud_panel, /datum/ui_module/ghost_hud_panel, new)
/**
* # Ghost HUD panel
*
* Allows ghosts to view a TGUI window which contains toggles for all HUD types available to them.
*/
/datum/ui_module/ghost_hud_panel
name = "Ghost HUD Panel"
/// Associative list to get the appropriate hud type based on the string passed from TGUI.
var/list/hud_type_lookup = list(
"medical" = DATA_HUD_MEDICAL_ADVANCED,
"security" = DATA_HUD_SECURITY_ADVANCED,
"diagnostic" = DATA_HUD_DIAGNOSTIC
)
/datum/ui_module/ghost_hud_panel/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.observer_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui)
if(!ui)
ui = new(user, src, ui_key, "GhostHudPanel", name, 250, 171, master_ui, state)
ui.set_autoupdate(FALSE)
ui.open()
/datum/ui_module/ghost_hud_panel/ui_data(mob/dead/observer/ghost)
var/list/data = list()
for(var/hud in hud_type_lookup)
data[hud] = (hud_type_lookup[hud] in ghost.data_hud_seen)
data["ahud"] = ghost.antagHUD
return data
/datum/ui_module/ghost_hud_panel/ui_act(action, list/params)
if(..())
return
var/mob/dead/observer/ghost = usr
. = TRUE
switch(action)
if("hud_on")
var/hud_type = hud_type_lookup[params["hud_type"]]
ghost.show_me_the_hud(hud_type)
if("hud_off")
var/hud_type = hud_type_lookup[params["hud_type"]]
ghost.remove_the_hud(hud_type)
if("ahud_on")
if(!GLOB.configuration.general.allow_antag_hud && !ghost.client.holder)
to_chat(ghost, "<span class='warning'>Admins have disabled this for this round.</span>")
return FALSE
if(jobban_isbanned(ghost, "AntagHUD"))
to_chat(ghost, "<span class='danger'>You have been banned from using this feature.</span>")
return FALSE
// Check if this is the first time they're turning on Antag HUD.
if(!check_rights(R_ADMIN | R_MOD, FALSE) && !ghost.has_enabled_antagHUD && GLOB.configuration.general.restrict_antag_hud_rejoin)
var/response = alert(ghost, "If you turn this on, you will not be able to take any part in the round.", "Are you sure you want to enable antag HUD?", "Yes", "No")
if(response == "No")
return FALSE
ghost.has_enabled_antagHUD = TRUE
ghost.can_reenter_corpse = FALSE
GLOB.respawnable_list -= ghost
ghost.antagHUD = TRUE
for(var/datum/atom_hud/antag/H in GLOB.huds)
H.add_hud_to(ghost)
if("ahud_off")
ghost.antagHUD = FALSE
for(var/datum/atom_hud/antag/H in GLOB.huds)
H.add_hud_to(ghost)
@@ -0,0 +1,30 @@
/datum/ui_module/robot_self_diagnosis
/// The robot who can use this UI to diagnose themselves.
var/mob/living/silicon/robot/owner
/datum/ui_module/robot_self_diagnosis/New(mob/living/silicon/S)
if(!istype(S))
CRASH("A [S.type] was passed to /datum/ui_module/robot_self_diagnosis/New().")
owner = S
/datum/ui_module/robot_self_diagnosis/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.always_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "RobotSelfDiagnosis", "Component Self Diagnosis", 280, 480, master_ui, state)
ui.set_autoupdate(FALSE)
ui.open()
/datum/ui_module/robot_self_diagnosis/ui_data(mob/user)
var/list/data = list()
for(var/c in owner.components)
var/datum/robot_component/C = owner.components[c]
data["component_data"] += list(list(
"name" = C.name,
"installed" = C.installed,
"brute_damage" = C.brute_damage,
"electronic_damage" = C.electronics_damage,
"max_damage" = C.max_damage,
"powered" = C.is_powered(),
"status" = C.toggled
))
return data
+1 -1
View File
@@ -113,6 +113,6 @@
return STATUS_CLOSE // Otherwise, we got nothing.
/mob/living/carbon/human/shared_living_ui_distance(atom/movable/src_object)
if(dna.GetSEState(GLOB.teleblock) && (get_dist(src, src_object) <= 2))
if(HAS_TRAIT(src, TRAIT_TELEKINESIS) && (get_dist(src, src_object) <= 2))
return STATUS_INTERACTIVE
return ..()