mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-09 00:13:55 +00:00
PDA Alert Level Readout (#89173)
## About The Pull Request Adds an alert level notice on the main PDA screen. The notice starts out as simple colored text when the user is not in any danger or concern. If the user is in danger, it becomes black text on a colored background. If the user is called to fix the problem relevant to alert (ie. security to deal with red alert active threats) the notice becomes blinking text on a colored background. <!-- Please make sure to actually test your PRs. If you have not tested your PR mention it. --> ## Why It's Good For The Game The existing way to check current alert levels (look at a fire alarm) doesn't really make much sense for new players. Also, this way is more accessible because a player will usually always be able to intuit where their PDA is on their person, while the fire alarm location will always be dependant on what station is being played. ## Proof Of Testing <!-- Compile and run your code locally. Make sure it works. This is the place to show off your changes! We are not responsible for testing your features. --> <details> <summary>Screenshots/Videos</summary>  </details> ## Changelog 🆑 qol: Added a widget to the main menu of the modular computer screen, which will tell the user what the current alert level is and if they are needed to fix the problem. /🆑 <!-- By opening a pull request. You have read and understood the repository rules located on the main README.md on this project. --> --------- Co-authored-by: Ivory <distributivgesetz93@gmail.com> Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
@@ -986,6 +986,30 @@
|
||||
return stored_files
|
||||
return stored_files + inserted_disk.stored_files
|
||||
|
||||
/// Returns how relevant the current security level is:
|
||||
#define ALERT_RELEVANCY_SAFE 0 /// * 0: User is not in immediate danger and not needed for some station-critical task.
|
||||
#define ALERT_RELEVANCY_WARN 1 /// * 1: Danger is around, but the user is not directly needed to handle it.
|
||||
#define ALERT_RELEVANCY_PERTINENT 2/// * 2: Danger is around and the user is responsible for handling it.
|
||||
/obj/item/modular_computer/proc/get_security_level_relevancy()
|
||||
switch(SSsecurity_level.get_current_level_as_number())
|
||||
if(SEC_LEVEL_DELTA)
|
||||
return ALERT_RELEVANCY_PERTINENT
|
||||
if(SEC_LEVEL_RED) // all-hands-on-deck situations, everyone is responsible for combatting a threat
|
||||
return ALERT_RELEVANCY_PERTINENT
|
||||
if(SEC_LEVEL_BLUE) // suspected threat. security needs to be alert and possibly preparing for it, no further concerns
|
||||
if(ACCESS_SECURITY in computer_id_slot.access)
|
||||
return ALERT_RELEVANCY_PERTINENT
|
||||
else
|
||||
return ALERT_RELEVANCY_WARN
|
||||
if(SEC_LEVEL_GREEN) // no threats, no concerns
|
||||
return ALERT_RELEVANCY_SAFE
|
||||
|
||||
return 0
|
||||
|
||||
#undef ALERT_RELEVANCY_SAFE
|
||||
#undef ALERT_RELEVANCY_WARN
|
||||
#undef ALERT_RELEVANCY_PERTINENT
|
||||
|
||||
/**
|
||||
* Debug ModPC
|
||||
* Used to spawn all programs for Create and Destroy unit test.
|
||||
|
||||
@@ -120,6 +120,10 @@
|
||||
"alert" = program.alert_pending,
|
||||
))
|
||||
|
||||
data["alert_style"] = get_security_level_relevancy()
|
||||
data["alert_color"] = SSsecurity_level?.current_security_level?.announcement_color
|
||||
data["alert_name"] = SSsecurity_level?.current_security_level?.name_shortform
|
||||
|
||||
return data
|
||||
|
||||
// Handles user's GUI input
|
||||
|
||||
Reference in New Issue
Block a user