Adds a lfwb-inspired orbiting pixel + flashing outline animation to the sprint and combat buttons (toggleable via prefs) (#11623)

* Adds a flashing effect to the sprint and combat mode toggles (toggleable via prefs)

* Adds the ability to change the color of the hud toggle flash as well
This commit is contained in:
deathride58
2020-03-26 11:51:48 -04:00
committed by GitHub
parent 9ab89ddcea
commit 0bf2cf0484
7 changed files with 50 additions and 3 deletions
+14
View File
@@ -187,6 +187,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/sprint_spacebar = FALSE
var/sprint_toggle = FALSE
var/hud_toggle_flash = TRUE
var/hud_toggle_color = "#ffffff"
var/list/exp = list()
var/list/menuoptions
@@ -902,6 +905,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "<b>Fit Viewport:</b> <a href='?_src_=prefs;preference=auto_fit_viewport'>[auto_fit_viewport ? "Auto" : "Manual"]</a><br>"
dat += "<b>Sprint Key:</b> <a href='?_src_=prefs;preference=sprint_key'>[sprint_spacebar ? "Space" : "Shift"]</a><br>"
dat += "<b>Toggle Sprint:</b> <a href='?_src_=prefs;preference=sprint_toggle'>[sprint_toggle ? "Enabled" : "Disabled"]</a><br>"
dat += "<b>HUD Button Flashes:</b> <a href='?_src_=prefs;preference=hud_toggle_flash'>[hud_toggle_flash ? "Enabled" : "Disabled"]</a><br>"
dat += "<b>HUD Button Flash Color:</b> <span style='border: 1px solid #161616; background-color: [hud_toggle_color];'>&nbsp;&nbsp;&nbsp;</span> <a href='?_src_=prefs;preference=hud_toggle_color;task=input'>Change</a><br>"
if (CONFIG_GET(flag/maprotation) && CONFIG_GET(flag/tgstyle_maprotation))
var/p_map = preferred_map
@@ -2075,6 +2080,11 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(pickedPDASkin)
pda_skin = pickedPDASkin
if("hud_toggle_color")
var/new_toggle_color = input(user, "Choose your HUD toggle flash color:", "Game Preference",hud_toggle_color) as color|null
if(new_toggle_color)
hud_toggle_color = new_toggle_color
else
switch(href_list["preference"])
//CITADEL PREFERENCES EDIT - I can't figure out how to modularize these, so they have to go here. :c -Pooj
@@ -2278,6 +2288,10 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if("sprint_toggle")
sprint_toggle = !sprint_toggle
if("hud_toggle_flash")
hud_toggle_flash = !hud_toggle_flash
if("save")
save_preferences()
save_character()