Merge pull request #6594 from CHOMPStation2/upstream-merge-15152

[MIRROR] Autowhisper
This commit is contained in:
Raeschen
2023-07-17 11:28:10 +02:00
committed by GitHub
14 changed files with 126 additions and 3 deletions

View File

@@ -0,0 +1,45 @@
/mob/living/verb/toggle_autowhisper()
set name = "Autowhisper Toggle"
set desc = "Toggle whether you will automatically whisper/subtle"
set category = "IC"
autowhisper = !autowhisper
if(autowhisper_display)
autowhisper_display.icon_state = "[autowhisper ? "autowhisper1" : "autowhisper"]"
if(autowhisper_mode == "Psay/Pme")
if(isbelly(loc) && absorbed)
var/obj/belly/b = loc
if(b.mode_flags & DM_FLAG_FORCEPSAY)
var/mes = "but you are affected by forced psay right now, so you will automatically use psay/pme instead of any other option."
to_chat(src, "<span class='notice'>Autowhisper has been [autowhisper ? "enabled, [mes]" : "disabled, [mes]"].</span>")
return
else
forced_psay = autowhisper
to_chat(src, "<span class='notice'>Autowhisper has been [autowhisper ? "enabled. You will now automatically psay/pme when using say/me. As a note, this option will only work if you are in a situation where you can send psay/pme messages! Otherwise it will work as default whisper/subtle" : "disabled"].</span>")
else
to_chat(src, "<span class='notice'>Autowhisper has been [autowhisper ? "enabled. You will now automatically whisper/subtle when using say/me" : "disabled"].</span>")
/mob/living/verb/autowhisper_mode()
set name = "Autowhisper Mode"
set desc = "Set the mode your emotes will default to while using Autowhisper"
set category = "IC"
var/choice = tgui_input_list(src, "Select Custom Subtle Mode", "Custom Subtle Mode", list("Adjacent Turfs (Default)", "My Turf", "My Table", "Current Belly (Prey)", "Specific Belly (Pred)", "Specific Person", "Psay/Pme"))
if(!choice || choice == "Adjacent Turfs (Default)")
autowhisper_mode = null
to_chat(src, "<span class='notice'>Your subtles have returned to the default setting.</span>")
return
if(choice == "Psay/Pme")
if(autowhisper)
if(isbelly(loc) && absorbed)
var/obj/belly/b = loc
if(b.mode_flags & DM_FLAG_FORCEPSAY)
to_chat(src, "<span class='warning'>You can't set that mode right now, as you appear to be absorbed in a belly using forced psay!</span>")
return
forced_psay = TRUE
to_chat(src, "<span class='notice'>As a note, this option will only work if you are in a situation where you can send psay/pme messages! Otherwise it will work as default whisper/subtle.</span>")
autowhisper_mode = choice
to_chat(src, "<span class='notice'>Your subtles have been set to <b>[autowhisper_mode]</b>.</span>")

View File

@@ -1,7 +1,8 @@
/mob
var/muffled = FALSE // Used by muffling belly
var/forced_psay = FALSE // If true will prevent the user from speaking with normal say/emotes, and instead redirect these to a private speech mode with their predator.
var/autowhisper = FALSE // Automatically whisper
var/autowhisper_mode = null // Mode to use with autowhisper
/mob/living
var/ooc_notes = null
appearance_flags = TILE_BOUND|PIXEL_SCALE|KEEP_TOGETHER|LONG_GLIDE

View File

@@ -167,6 +167,8 @@ var/list/channel_to_radio_key = new
if(forced_psay)
psay(message)
return
if(autowhisper)
whispering = 1
//VOREStation Addition End
//Parse the mode
var/message_mode = parse_message_mode(message, "headset")

View File

@@ -325,6 +325,21 @@
using.alpha = ui_alpha
other |= using
autowhisper_display = new /obj/screen()
autowhisper_display.icon = 'icons/mob/screen/minimalist.dmi'
autowhisper_display.icon_state = "autowhisper"
autowhisper_display.name = "autowhisper"
autowhisper_display.screen_loc = "EAST-1:28,CENTER-2:13"
hud_elements |= autowhisper_display
var/obj/screen/aw = new /obj/screen()
aw.icon = 'icons/mob/screen/minimalist.dmi'
aw.icon_state = "aw-select"
aw.name = "autowhisper mode"
aw.screen_loc = "EAST-1:28,CENTER-2:13"
hud_elements |= aw
if(client)
client.screen = list()
client.screen += hud_elements

View File

@@ -158,6 +158,19 @@
healths.screen_loc = ui_health
hud_elements |= healths
autowhisper_display = new /obj/screen()
autowhisper_display.icon = 'icons/mob/screen/minimalist.dmi'
autowhisper_display.icon_state = "autowhisper"
autowhisper_display.name = "autowhisper"
autowhisper_display.screen_loc = "EAST-1:28,CENTER-2:13"
hud_elements |= autowhisper_display
var/obj/screen/aw = new /obj/screen()
aw.icon = 'icons/mob/screen/minimalist.dmi'
aw.icon_state = "aw-select"
aw.name = "autowhisper mode"
aw.screen_loc = "EAST-1:28,CENTER-2:13"
hud_elements |= aw
pain = new /obj/screen( null )

View File

@@ -31,6 +31,7 @@
var/obj/screen/ling/chems/ling_chem_display = null
var/obj/screen/wizard/energy/wiz_energy_display = null
var/obj/screen/wizard/instability/wiz_instability_display = null
var/obj/screen/autowhisper_display = null
var/datum/plane_holder/plane_holder = null
var/list/vis_enabled = null // List of vision planes that should be graphically visible (list of their VIS_ indexes).

View File

@@ -40,6 +40,8 @@
//VOREStation Edit Start
if(muffled)
return me_verb_subtle(message)
if(autowhisper)
return me_verb_subtle(message)
message = sanitize_or_reflect(message,src) //VOREStation Edit - Reflect too-long messages (within reason)
//VOREStation Edit End

View File

@@ -61,7 +61,10 @@
if(m_type == 2 && muzzled) return
var/subtle_mode
if(mode_selection)
if(autowhisper && autowhisper_mode && !mode_selection)
if(autowhisper_mode != "Psay/Pme") //This isn't actually a custom subtle mode, so we shouldn't use it!
subtle_mode = autowhisper_mode
if(mode_selection && !subtle_mode)
subtle_mode = tgui_input_list(src, "Select Custom Subtle Mode", "Custom Subtle Mode", list("Adjacent Turfs (Default)", "My Turf", "My Table", "Current Belly (Prey)", "Specific Belly (Pred)", "Specific Person"))
if(!subtle_mode)
if(mode_selection)