Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
585345e
hmm
ToasterBiome Mar 16, 2022
ceb08c0
use nmajask's stuff
ToasterBiome Mar 16, 2022
1eef169
Update say.dm
ToasterBiome Mar 16, 2022
35c16f3
Update talk.dmi
ToasterBiome Mar 16, 2022
4909d6c
Update say.dm
ToasterBiome Mar 16, 2022
bc1f33b
Update yogstation/code/modules/mob/say.dm
nmajask Mar 17, 2022
4879c4e
Update yogstation/code/modules/mob/say.dm
ToasterBiome Mar 18, 2022
b7dc7b5
thanks jamie!
ToasterBiome Mar 28, 2022
9195cc7
preferences
ToasterBiome Mar 28, 2022
e2f87e1
Update say.dm
ToasterBiome Mar 28, 2022
591f19d
fix fix if x
ToasterBiome Mar 29, 2022
ebf58b1
stupid
ToasterBiome Mar 29, 2022
f1a0195
Revert "stupid"
ToasterBiome Mar 29, 2022
df9e10c
Update preferences_savefile.dm
ToasterBiome Mar 29, 2022
fa9d5da
Update say.dm
ToasterBiome Mar 30, 2022
a6b811d
Update say.dm
ToasterBiome Mar 30, 2022
6d0a2d1
Update say.dm
ToasterBiome Apr 7, 2022
5bf4506
Update say.dm
ToasterBiome Apr 7, 2022
5d284e2
Update say.dm
ToasterBiome Apr 9, 2022
94653a1
holy fark
ToasterBiome Apr 9, 2022
e0ae873
Update life.dm
ToasterBiome Apr 15, 2022
b6faa9f
Update life.dm
ToasterBiome Apr 15, 2022
99de25c
Update life.dm
ToasterBiome Apr 15, 2022
992dac3
modularization
ToasterBiome Apr 15, 2022
64f7642
on jod
ToasterBiome Apr 15, 2022
97a4489
Update preferences.dm
ToasterBiome Apr 15, 2022
1cb9611
Update preferences.dm
ToasterBiome Apr 15, 2022
2f49a41
preferences
ToasterBiome Apr 15, 2022
c1dc34b
Update preferences_savefile.dm
ToasterBiome Apr 15, 2022
34405f2
modular
ToasterBiome Apr 15, 2022
4cc76e4
THIS should work
ToasterBiome Apr 15, 2022
1ad29b5
Update preferences_toggles.dm
ToasterBiome Apr 16, 2022
b4f3cd8
fuckin uhhhhhhhh
ToasterBiome Apr 16, 2022
8fbbd7b
fixes yeah whatever shit
ToasterBiome Apr 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions code/__DEFINES/{yogs_defines}/preferences.dm
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#define DONOR_CHARACTER_SLOTS 6


#define CHAT_LOOC (1<<10)

#define CHAT_LOOC (1<<11)
#define GHOST_CKEY (1<<12)
#define CHAT_TYPING_INDICATOR (1<<13)
#undef TOGGLES_DEFAULT_CHAT
#define TOGGLES_DEFAULT_CHAT (CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|CHAT_PULLR|CHAT_GHOSTWHISPER|CHAT_GHOSTPDA|CHAT_GHOSTRADIO|CHAT_LOOC)
#define TOGGLES_DEFAULT_CHAT (CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|CHAT_PULLR|CHAT_GHOSTWHISPER|CHAT_GHOSTPDA|CHAT_GHOSTRADIO|CHAT_BANKCARD|CHAT_LOOC|GHOST_CKEY|CHAT_TYPING_INDICATOR)


#define GHOST_CKEY (1<<11)


//YOGS pref.yogstoggles enum's
Expand Down
4 changes: 3 additions & 1 deletion code/modules/client/preferences_savefile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// You do not need to raise this if you are adding new values that have sane defaults.
// Only raise this value when changing the meaning/format/name/layout of an existing value
// where you would want the updater procs below to run
#define SAVEFILE_VERSION_MAX 35
#define SAVEFILE_VERSION_MAX 37

/*
SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn
Expand Down Expand Up @@ -49,6 +49,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
be_special += "Ragin Mages"
if (current_version < 35)
toggles |= SOUND_ALT
if (current_version < 37)
chat_toggles |= CHAT_TYPING_INDICATOR
return

/datum/preferences/proc/update_character(current_version, savefile/S)
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
if (QDELETED(src))
return

// yogs start -- typing indicators, look in yogstation specific folder for proc
handle_typing_indicator()
//yogs end

if(.) //not dead
handle_blood()

Expand Down
Binary file modified icons/mob/talk.dmi
Binary file not shown.
3 changes: 2 additions & 1 deletion yogstation/code/_globalvars/configuration.dm
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
GLOBAL_VAR_INIT(looc_allowed, TRUE)
GLOBAL_VAR_INIT(dlooc_allowed, FALSE)
GLOBAL_VAR_INIT(dlooc_allowed, FALSE)
GLOBAL_VAR_INIT(typing_indicators,TRUE)
8 changes: 8 additions & 0 deletions yogstation/code/modules/client/preferences_toggles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,11 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings, ghost_ckey)()
usr.client.prefs.chat_toggles ^= GHOST_CKEY
usr.client.prefs.save_preferences()
to_chat(usr, "Your ckey is [(usr.client.prefs.chat_toggles & GHOST_CKEY) ? "no longer" : "now"] visible in deadchat.")

TOGGLE_CHECKBOX(/datum/verbs/menu/Settings, typing_indicators)()
set name = "Show/Hide typing indicators"
set category = "Preferences"
set desc = "Toggle typing indicators"
usr.client.prefs.chat_toggles ^= CHAT_TYPING_INDICATOR
usr.client.prefs.save_preferences()
to_chat(usr, "You will [(usr.client.prefs.chat_toggles & CHAT_TYPING_INDICATOR) ? "now" : "no longer"] see typing indicators.")
85 changes: 84 additions & 1 deletion yogstation/code/modules/mob/say.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,86 @@
#define TYPING_INDICATOR_RANGE 7

/mob/proc/get_say()
create_typing_indicator()
window_typing = TRUE
var/msg = input(src, null, "say \"text\"") as text|null
say_verb(msg)
window_typing = FALSE
remove_typing_indicator()
say_verb(msg)

/mob
var/image/typing_overlay
var/list/speech_bubble_recipients
var/last_typed
var/last_typed_time
var/window_typing = FALSE
var/bar_typing = FALSE

/mob/proc/handle_typing_indicator()
INVOKE_ASYNC(src,.proc/typing_indicator_process)

/mob/proc/typing_indicator_process()
if(!GLOB.typing_indicators)
return
if(client)
var/temp = winget(client, "input", "text")
if(temp != last_typed)
last_typed = temp
last_typed_time = world.time
if(world.time > last_typed_time + 10 SECONDS)
bar_typing = FALSE
remove_typing_indicator()
return
if(length(temp) > 5 && findtext(temp, "Say \"", 1, 7))
create_typing_indicator()
bar_typing = TRUE
else if(length(temp) > 3 && findtext(temp, "Me ", 1, 5))
//set_typing_indicator(1)
else
bar_typing = FALSE
remove_typing_indicator()


/mob/proc/create_typing_indicator()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend a blanking overwrite of this for /mob/camera, since otherwise things like the AI camera eye and the Eminence have a visible typing indicator, despite them needing to be invisible:

/mob/camera/create_typing_indicator()
  return
/mob/camera/remove_typing_indicator()
  return

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend a blanking overwrite of this for /mob/camera, since otherwise things like the AI camera eye and the Eminence have a visible typing indicator, despite them needing to be invisible:

/mob/camera/create_typing_indicator()
  return
/mob/camera/remove_typing_indicator()
  return

This is solved by the overlays inheriting the invisibility of the mob they are attached to in regards to the wrong people seeing them.

On one hand I like the idea that the people who can see them can also see if they're typing

if(typing_overlay)
return
if(stat)
return
var/list/listening = get_hearers_in_view(TYPING_INDICATOR_RANGE, src)
speech_bubble_recipients = list()
for(var/mob/M in listening)
if(M.client && M.client.prefs.chat_toggles & CHAT_TYPING_INDICATOR)
speech_bubble_recipients.Add(M.client)
var/bubble = "default"
if(isliving(src))
var/mob/living/L = src
bubble = L.bubble_icon
typing_overlay = image('yogstation/icons/mob/talk.dmi', src, "[bubble]_talking", FLY_LAYER)
typing_overlay.appearance_flags = APPEARANCE_UI
typing_overlay.invisibility = invisibility
typing_overlay.alpha = alpha
for(var/client/C in speech_bubble_recipients)
C.images += typing_overlay


/mob/proc/remove_typing_indicator()
if(!typing_overlay)
return
if(window_typing || bar_typing)
return
for(var/client/C in speech_bubble_recipients)
C.images -= typing_overlay
typing_overlay = null
speech_bubble_recipients = list()

/mob/camera/handle_typing_indicator() //RIP in piece camera mobs
return

/mob/camera/create_typing_indicator()
return

/mob/camera/remove_typing_indicator()
return


#undef TYPING_INDICATOR_RANGE
Binary file added yogstation/icons/mob/talk.dmi
Binary file not shown.