mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-01-25 17:02:04 +00:00
Merge branch 'master' into ghost-rad-hud
This commit is contained in:
@@ -55,14 +55,14 @@ GLOBAL_DATUM_INIT(ghost_hud_panel, /datum/ui_module/ghost_hud_panel, new)
|
||||
ghost.set_radiation_view(FALSE)
|
||||
|
||||
if("ahud_on")
|
||||
if(!config.antag_hud_allowed && !ghost.client.holder)
|
||||
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 && config.antag_hud_restricted)
|
||||
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
|
||||
|
||||
30
code/modules/tgui/modules/robot_self_diagnosis.dm
Normal file
30
code/modules/tgui/modules/robot_self_diagnosis.dm
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user