Autowhisper

This commit is contained in:
Casey
2023-07-17 01:52:46 -04:00
committed by CHOMPStation2
parent 9611cd70fc
commit 41175bcb8e
14 changed files with 139 additions and 2 deletions

View File

@@ -257,6 +257,20 @@
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
//VOREStation Addition begin
shadekin_display = new /obj/screen/shadekin()
shadekin_display.screen_loc = ui_shadekin_display

View File

@@ -90,6 +90,21 @@ var/obj/screen/robot_inventory
healths.screen_loc = ui_borg_health
other += 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:31,CENTER-3:13"
other |= 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:31,CENTER-3:13"
other |= aw
//Installed Module
hands = new /obj/screen()
hands.icon = HUD.ui_style

View File

@@ -454,6 +454,14 @@
if("drop")
if(usr.client)
usr.client.drop_item()
if("autowhisper")
if(isliving(usr))
var/mob/living/u = usr
u.toggle_autowhisper()
if("autowhisper mode")
if(isliving(usr))
var/mob/living/u = usr
u.autowhisper_mode()
if("module")
if(isrobot(usr))

View File

@@ -31,6 +31,9 @@
if(forced_psay)
pme(message)
return
if(autowhisper)
return me_verb_subtle(message)
//VOREStation Addition End
if(act == "help")

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

@@ -40,6 +40,23 @@
var/muzzled = is_muzzled()
if(m_type == 2 && muzzled) return
<<<<<<< HEAD
=======
var/subtle_mode
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)
if(message)
to_chat(src, "<span class='warning'>Subtle mode not selected. Your input has not been sent, but preserved:</span> [message]")
return
else
subtle_mode = "Adjacent Turfs (Default)"
>>>>>>> 662c7e356e... Merge pull request #15152 from Very-Soft/range
var/input
if(!message)
input = sanitize_or_reflect(tgui_input_text(src,"Choose an emote to display."), src)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -2872,6 +2872,7 @@
#include "code\modules\mining\ore_redemption_machine\mine_point_items.dm"
#include "code\modules\mining\ore_redemption_machine\survey_vendor.dm"
#include "code\modules\mob\animations.dm"
#include "code\modules\mob\autowhisper.dm"
#include "code\modules\mob\death.dm"
#include "code\modules\mob\emote.dm"
#include "code\modules\mob\gender.dm"