diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index ecff37c1f3..e1ecb81ab6 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -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 += "Fit Viewport: [auto_fit_viewport ? "Auto" : "Manual"]
" dat += "Sprint Key: [sprint_spacebar ? "Space" : "Shift"]
" dat += "Toggle Sprint: [sprint_toggle ? "Enabled" : "Disabled"]
" + dat += "HUD Button Flashes: [hud_toggle_flash ? "Enabled" : "Disabled"]
" + dat += "HUD Button Flash Color:     Change
" 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() diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 69b8b5685f..731b6b7725 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -200,6 +200,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car S["auto_fit_viewport"] >> auto_fit_viewport S["sprint_spacebar"] >> sprint_spacebar S["sprint_toggle"] >> sprint_toggle + S["hud_toggle_flash"] >> hud_toggle_flash + S["hud_toggle_color"] >> hud_toggle_color S["menuoptions"] >> menuoptions S["enable_tips"] >> enable_tips S["tip_delay"] >> tip_delay @@ -239,6 +241,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car auto_fit_viewport = sanitize_integer(auto_fit_viewport, 0, 1, initial(auto_fit_viewport)) sprint_spacebar = sanitize_integer(sprint_spacebar, 0, 1, initial(sprint_spacebar)) sprint_toggle = sanitize_integer(sprint_toggle, 0, 1, initial(sprint_toggle)) + hud_toggle_flash = sanitize_integer(hud_toggle_flash, 0, 1, initial(hud_toggle_flash)) + hud_toggle_color = sanitize_hexcolor(hud_toggle_color, 6, 1, initial(hud_toggle_color)) ghost_form = sanitize_inlist(ghost_form, GLOB.ghost_forms, initial(ghost_form)) ghost_orbit = sanitize_inlist(ghost_orbit, GLOB.ghost_orbits, initial(ghost_orbit)) ghost_accs = sanitize_inlist(ghost_accs, GLOB.ghost_accs_options, GHOST_ACCS_DEFAULT_OPTION) @@ -248,7 +252,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car pda_style = sanitize_inlist(pda_style, GLOB.pda_styles, initial(pda_style)) pda_color = sanitize_hexcolor(pda_color, 6, 1, initial(pda_color)) pda_skin = sanitize_inlist(pda_skin, GLOB.pda_reskins, PDA_SKIN_ALT) - screenshake = sanitize_integer(screenshake, 0, 800, initial(screenshake)) damagescreenshake = sanitize_integer(damagescreenshake, 0, 2, initial(damagescreenshake)) widescreenpref = sanitize_integer(widescreenpref, 0, 1, initial(widescreenpref)) @@ -301,6 +304,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car WRITE_FILE(S["auto_fit_viewport"], auto_fit_viewport) WRITE_FILE(S["sprint_spacebar"], sprint_spacebar) WRITE_FILE(S["sprint_toggle"], sprint_toggle) + WRITE_FILE(S["hud_toggle_flash"], hud_toggle_flash) + WRITE_FILE(S["hud_toggle_color"], hud_toggle_color) WRITE_FILE(S["menuoptions"], menuoptions) WRITE_FILE(S["enable_tips"], enable_tips) WRITE_FILE(S["tip_delay"], tip_delay) diff --git a/code/modules/mob/living/living_combat.dm b/code/modules/mob/living/living_combat.dm index 4cd2def5a8..493f2ffdff 100644 --- a/code/modules/mob/living/living_combat.dm +++ b/code/modules/mob/living/living_combat.dm @@ -43,7 +43,7 @@ /// Updates the combat mode HUD icon. /mob/living/proc/update_combat_mode_icon() var/obj/screen/combattoggle/T = locate() in hud_used?.static_inventory - T?.update_icon_state() + T?.update_icon() /// Enables intentionally being in combat mode. Please try not to use this proc for feedback whenever possible. /mob/living/proc/enable_intentional_combat_mode(silent = TRUE, visible = FALSE) diff --git a/code/modules/mob/living/living_sprint.dm b/code/modules/mob/living/living_sprint.dm index 66aa3ebc6f..55d5f3320c 100644 --- a/code/modules/mob/living/living_sprint.dm +++ b/code/modules/mob/living/living_sprint.dm @@ -4,7 +4,7 @@ /mob/living/proc/update_sprint_icon() var/obj/screen/sprintbutton/S = locate() in hud_used?.static_inventory - S?.update_icon_state() + S?.update_icon() /mob/living/proc/update_hud_sprint_bar() hud_used?.sprint_buffer?.update_to_mob(src) diff --git a/icons/mob/screen_gen.dmi b/icons/mob/screen_gen.dmi index f1fafb8946..ea946f60d9 100644 Binary files a/icons/mob/screen_gen.dmi and b/icons/mob/screen_gen.dmi differ diff --git a/modular_citadel/code/_onclick/hud/screen_objects.dm b/modular_citadel/code/_onclick/hud/screen_objects.dm index bcb44af84b..2101a6045f 100644 --- a/modular_citadel/code/_onclick/hud/screen_objects.dm +++ b/modular_citadel/code/_onclick/hud/screen_objects.dm @@ -12,6 +12,7 @@ name = "toggle combat mode" icon = 'modular_citadel/icons/ui/screen_midnight.dmi' icon_state = "combat_off" + var/mutable_appearance/flashy /obj/screen/combattoggle/Click() if(iscarbon(usr)) @@ -29,6 +30,19 @@ else icon_state = "combat_off" +/obj/screen/combattoggle/update_overlays() + . = ..() + var/mob/living/carbon/user = hud?.mymob + if(!istype(user) || !user.client) + return + + if((user.combat_flags & COMBAT_FLAG_COMBAT_ACTIVE) && user.client.prefs.hud_toggle_flash) + if(!flashy) + flashy = mutable_appearance('icons/mob/screen_gen.dmi', "togglefull_flash") + if(flashy.color != user.client.prefs.hud_toggle_color) + flashy.color = user.client.prefs.hud_toggle_color + . += flashy //TODO - beg lummox jr for the ability to force mutable appearances or images to be created rendering from their first frame of animation rather than being based entirely around the client's frame count + /obj/screen/voretoggle name = "toggle vore mode" icon = 'modular_citadel/icons/ui/screen_midnight.dmi' diff --git a/modular_citadel/code/_onclick/hud/sprint.dm b/modular_citadel/code/_onclick/hud/sprint.dm index 7199f0286e..89547c0feb 100644 --- a/modular_citadel/code/_onclick/hud/sprint.dm +++ b/modular_citadel/code/_onclick/hud/sprint.dm @@ -6,6 +6,7 @@ icon = 'modular_citadel/icons/ui/screen_midnight.dmi' icon_state = "act_sprint" layer = ABOVE_HUD_LAYER - 0.1 + var/mutable_appearance/flashy /obj/screen/sprintbutton/Click() if(ishuman(usr)) @@ -23,6 +24,19 @@ else icon_state = "act_sprint" +/obj/screen/sprintbutton/update_overlays() + . = ..() + var/mob/living/carbon/user = hud?.mymob + if(!istype(user) || !user.client) + return + + if((user.combat_flags & COMBAT_FLAG_SPRINT_ACTIVE) && user.client.prefs.hud_toggle_flash) + if(!flashy) + flashy = mutable_appearance('icons/mob/screen_gen.dmi', "togglehalf_flash") + if(flashy.color != user.client.prefs.hud_toggle_color) + flashy.color = user.client.prefs.hud_toggle_color + . += flashy + //Sprint buffer onscreen code. /datum/hud/var/obj/screen/sprint_buffer/sprint_buffer