Replaces some of the hardcoded HUD icons defined at mob level with a pair of mob procs throw_alert() and clear_alert(). Alerts will appear on the top-right side of the screen.
You can shift-click alerts to get a description of what's wrong and sometimes a tip on how to solve the alert.
Alerts can be given a master, which overlays the master on top of a box and forwards clicks of the alert to that master. Getting buckled will put an alert of what you're buckled to, for example. If it's a chair, you just click the alert and you're unbuckled. The idea I'm shooting for is to replace resist entirely with this kind of stuff.
Making a new alert and using it is a little complicated. This explanation will suck, but this is simpler than I'm making it sound, I promise. Throw_alert() has 4 args, category, id, severity, and obj/new_master. If you don't supply an id, category will be used as id. Only 1 alert per category is allowed; any duplicate will be replaced. Additionally clear_alert() clears alerts by category. Id MUST match a type path of /obj/screen/alert/[id]. That type path is where the alert's name and desc come from. The icon_state of the alert will either be "template" if new_master is set or [id][severity] otherwise. new_master is totally optional.
Examples:
throw_alert("oxy") -- takes name/desc of obj/screen/alert/oxy, icon_state = "oxy" -- clear_alert("oxy")
throw_alert("nutrition","fat") -- takes name/desc of obj/screen/alert/fat, icon_state = "fat" -- clear_alert("nutrition")
throw_alert("nutrition","starving") -- takes name/desc of obj/screen/alert/starving, icon_state = "starving" -- clear_alert("nutrition")
throw_alert("temp","cold",1) -- takes name/desc of obj/screen/alert/cold, icon_state = "cold1" -- clear_alert("temp")
throw_alert("temp","cold",3) -- takes name/desc of obj/screen/alert/cold, icon_state = "cold3" -- clear_alert("temp")
If you pass a new_master, id is only used to get name/desc and still must match a path, but the icon_state is "template" and icon is from the mob's ui preference instead of icons/mob/screen_alert.dmi.
Several unused icons removed, like borg oxygen and temperature alerts. Also some icons were used but now are not and were removed, like the nutrition icon for being well-fed and cyborg charge icon for being fully charged.
Add the incapacitated proc to mobs to check for stat, stun, weakened, paralysis, restrained. And replacing those checks by that new proc in some places.
Removed an unused client verb, changed a usr to src where they're the same mob, and changed a type == check to istype().
Allow turning on throw mode when clicking the UI button (hotkeys already allow you to do this).
Disallow throwing when not on a turf.
Fixes#4823
Make storage items close out the onscreen stuff when they get thrown.
Fixes#5296
- Both HUD procs broken in to several smaller procs.
- Added defines so the arguments to process_data_hud() are clear.
- Several other tweaks to data_huds.dm
- Made the sensor mode defines match the data hud ones.
- Gave borgies a HUD button for sensor modes instead a verb, to be in
line with the AI.
Makes the sensor augmentation check for silicon instead of one for both
the AI and Borgs, since they are not actually different procs.
Reverts an accidental removal of the borg camera function, thinking it
came from NT's code.
- The AI can now access both Security and Medical HUDs via a new button
on its UI. The Medical HUD is exactly equal to all others. The AI's
Security HUD cannot detect implants.
- Cyborg HUD modules have been removed in favor of an inbuilt command,
to make it less of a hassle to access them.
- HUD code has been given its own file such that it can be used by any
mob. In addition, HUD users are placed into a list instead of searching
for only humans and checking them for a HUD item. This is to make it
easier to expand.
- Security HUD messages can now be received by any mob using a SecHUD.
This allows you to click which ever intent you want in the four-color
intent system humans have.
Other/simple mobs' still use the old single intent button.
F/G macros still work as well.
continued from: #4473