Files
Bubberstation/code/game/objects/structures
MrPerson 8ffbc1be14 On screen alert system
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.
2015-03-01 17:31:26 -08:00
..
2015-03-01 17:31:26 -08:00
2015-02-24 15:32:58 -08:00
2015-02-01 06:13:21 -08:00