|
95 | 95 | /mob/proc/has_alert(category)
|
96 | 96 | return !isnull(alerts[category])
|
97 | 97 |
|
| 98 | +// PRIVATE = only edit, use, or override these if you're editing the system as a whole |
| 99 | + |
| 100 | +// Re-render all alerts - also called in /datum/hud/show_hud() because it's needed there |
| 101 | +/datum/hud/proc/reorganize_alerts(mob/viewmob) |
| 102 | + var/mob/screenmob = viewmob || mymob |
| 103 | + if(!screenmob.client) |
| 104 | + return |
| 105 | + var/list/alerts = mymob.alerts |
| 106 | + if(!hud_shown) |
| 107 | + for(var/i in 1 to alerts.len) |
| 108 | + screenmob.client.screen -= alerts[alerts[i]] |
| 109 | + return 1 |
| 110 | + for(var/i in 1 to alerts.len) |
| 111 | + var/atom/movable/screen/alert/alert = alerts[alerts[i]] |
| 112 | + if(alert.icon_state == "template") |
| 113 | + alert.icon = ui_style |
| 114 | + switch(i) |
| 115 | + if(1) |
| 116 | + . = ui_alert1 |
| 117 | + if(2) |
| 118 | + . = ui_alert2 |
| 119 | + if(3) |
| 120 | + . = ui_alert3 |
| 121 | + if(4) |
| 122 | + . = ui_alert4 |
| 123 | + if(5) |
| 124 | + . = ui_alert5 // Right now there's 5 slots |
| 125 | + else |
| 126 | + . = "" |
| 127 | + alert.screen_loc = . |
| 128 | + screenmob.client.screen |= alert |
| 129 | + if(!viewmob) |
| 130 | + for(var/M in mymob.observers) |
| 131 | + reorganize_alerts(M) |
| 132 | + return 1 |
| 133 | + |
98 | 134 | /atom/movable/screen/alert
|
99 | 135 | icon = 'icons/hud/screen_alert.dmi'
|
100 | 136 | icon_state = "default"
|
|
110 | 146 | /// Boolean. If TRUE, the Click() proc will attempt to Click() on the master first if there is a master.
|
111 | 147 | var/click_master = TRUE
|
112 | 148 |
|
| 149 | +/atom/movable/screen/alert/Destroy() |
| 150 | + severity = 0 |
| 151 | + master_ref = null |
| 152 | + owner = null |
| 153 | + screen_loc = "" |
| 154 | + return ..() |
| 155 | + |
113 | 156 | /atom/movable/screen/alert/can_usr_use(mob/user)
|
114 | 157 | return owner == usr
|
115 | 158 |
|
| 159 | +/atom/movable/screen/alert/Click(location, control, params) |
| 160 | + . = ..() |
| 161 | + if(.) |
| 162 | + return FALSE |
| 163 | + |
| 164 | + if(usr != owner) |
| 165 | + return FALSE |
| 166 | + var/list/modifiers = params2list(params) |
| 167 | + if(LAZYACCESS(modifiers, SHIFT_CLICK)) // screen objects don't do the normal Click() stuff so we'll cheat |
| 168 | + to_chat(usr, span_boldnotice("[name]</span> - <span class='info'>[desc]")) |
| 169 | + return FALSE |
| 170 | + var/datum/our_master = master_ref?.resolve() |
| 171 | + if(our_master && click_master) |
| 172 | + return usr.client.Click(our_master, location, control, params) |
| 173 | + |
| 174 | + return TRUE |
| 175 | + |
116 | 176 | /atom/movable/screen/alert/MouseEntered(location,control,params)
|
117 | 177 | . = ..()
|
118 | 178 | if(!QDELETED(src))
|
@@ -852,62 +912,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
|
852 | 912 | var/mob/living/living_owner = owner
|
853 | 913 | living_owner.set_resting(FALSE)
|
854 | 914 |
|
855 |
| -// PRIVATE = only edit, use, or override these if you're editing the system as a whole |
856 |
| - |
857 |
| -// Re-render all alerts - also called in /datum/hud/show_hud() because it's needed there |
858 |
| -/datum/hud/proc/reorganize_alerts(mob/viewmob) |
859 |
| - var/mob/screenmob = viewmob || mymob |
860 |
| - if(!screenmob.client) |
861 |
| - return |
862 |
| - var/list/alerts = mymob.alerts |
863 |
| - if(!hud_shown) |
864 |
| - for(var/i in 1 to alerts.len) |
865 |
| - screenmob.client.screen -= alerts[alerts[i]] |
866 |
| - return 1 |
867 |
| - for(var/i in 1 to alerts.len) |
868 |
| - var/atom/movable/screen/alert/alert = alerts[alerts[i]] |
869 |
| - if(alert.icon_state == "template") |
870 |
| - alert.icon = ui_style |
871 |
| - switch(i) |
872 |
| - if(1) |
873 |
| - . = ui_alert1 |
874 |
| - if(2) |
875 |
| - . = ui_alert2 |
876 |
| - if(3) |
877 |
| - . = ui_alert3 |
878 |
| - if(4) |
879 |
| - . = ui_alert4 |
880 |
| - if(5) |
881 |
| - . = ui_alert5 // Right now there's 5 slots |
882 |
| - else |
883 |
| - . = "" |
884 |
| - alert.screen_loc = . |
885 |
| - screenmob.client.screen |= alert |
886 |
| - if(!viewmob) |
887 |
| - for(var/M in mymob.observers) |
888 |
| - reorganize_alerts(M) |
889 |
| - return 1 |
890 |
| - |
891 |
| -/atom/movable/screen/alert/Click(location, control, params) |
892 |
| - . = ..() |
893 |
| - if(.) |
894 |
| - return FALSE |
895 |
| - |
896 |
| - if(usr != owner) |
897 |
| - return FALSE |
898 |
| - var/list/modifiers = params2list(params) |
899 |
| - if(LAZYACCESS(modifiers, SHIFT_CLICK)) // screen objects don't do the normal Click() stuff so we'll cheat |
900 |
| - to_chat(usr, span_boldnotice("[name]</span> - <span class='info'>[desc]")) |
901 |
| - return FALSE |
902 |
| - var/datum/our_master = master_ref?.resolve() |
903 |
| - if(our_master && click_master) |
904 |
| - return usr.client.Click(our_master, location, control, params) |
905 |
| - |
906 |
| - return TRUE |
907 |
| - |
908 |
| -/atom/movable/screen/alert/Destroy() |
909 |
| - severity = 0 |
910 |
| - master_ref = null |
911 |
| - owner = null |
912 |
| - screen_loc = "" |
913 |
| - return ..() |
| 915 | +/atom/movable/screen/alert/shock |
| 916 | + name = "Traumatic Shock" |
| 917 | + desc = "You've endured a significant amount of pain." |
| 918 | + icon_state = "convulsing" |
0 commit comments