Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit e3d261d

Browse files
committed
TGS Test merge #13435
2 parents 88196a0 + 8fbbd7b commit e3d261d

8 files changed

Lines changed: 106 additions & 7 deletions

File tree

code/__DEFINES/{yogs_defines}/preferences.dm

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#define DONOR_CHARACTER_SLOTS 6
22

33

4-
#define CHAT_LOOC (1<<10)
5-
4+
#define CHAT_LOOC (1<<11)
5+
#define GHOST_CKEY (1<<12)
6+
#define CHAT_TYPING_INDICATOR (1<<13)
67
#undef TOGGLES_DEFAULT_CHAT
7-
#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)
8+
#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)
9+
810

9-
#define GHOST_CKEY (1<<11)
1011

1112

1213
//YOGS pref.yogstoggles enum's

code/modules/client/preferences_savefile.dm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// You do not need to raise this if you are adding new values that have sane defaults.
66
// Only raise this value when changing the meaning/format/name/layout of an existing value
77
// where you would want the updater procs below to run
8-
#define SAVEFILE_VERSION_MAX 35
8+
#define SAVEFILE_VERSION_MAX 37
99

1010
/*
1111
SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn
@@ -49,6 +49,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
4949
be_special += "Ragin Mages"
5050
if (current_version < 35)
5151
toggles |= SOUND_ALT
52+
if (current_version < 37)
53+
chat_toggles |= CHAT_TYPING_INDICATOR
5254
return
5355

5456
/datum/preferences/proc/update_character(current_version, savefile/S)

code/modules/mob/living/carbon/life.dm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
if (QDELETED(src))
1919
return
2020

21+
// yogs start -- typing indicators, look in yogstation specific folder for proc
22+
handle_typing_indicator()
23+
//yogs end
24+
2125
if(.) //not dead
2226
handle_blood()
2327

icons/mob/talk.dmi

2.75 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
GLOBAL_VAR_INIT(looc_allowed, TRUE)
2-
GLOBAL_VAR_INIT(dlooc_allowed, FALSE)
2+
GLOBAL_VAR_INIT(dlooc_allowed, FALSE)
3+
GLOBAL_VAR_INIT(typing_indicators,TRUE)

yogstation/code/modules/client/preferences_toggles.dm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,11 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings, ghost_ckey)()
1616
usr.client.prefs.chat_toggles ^= GHOST_CKEY
1717
usr.client.prefs.save_preferences()
1818
to_chat(usr, "Your ckey is [(usr.client.prefs.chat_toggles & GHOST_CKEY) ? "no longer" : "now"] visible in deadchat.")
19+
20+
TOGGLE_CHECKBOX(/datum/verbs/menu/Settings, typing_indicators)()
21+
set name = "Show/Hide typing indicators"
22+
set category = "Preferences"
23+
set desc = "Toggle typing indicators"
24+
usr.client.prefs.chat_toggles ^= CHAT_TYPING_INDICATOR
25+
usr.client.prefs.save_preferences()
26+
to_chat(usr, "You will [(usr.client.prefs.chat_toggles & CHAT_TYPING_INDICATOR) ? "now" : "no longer"] see typing indicators.")

yogstation/code/modules/mob/say.dm

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,86 @@
1+
#define TYPING_INDICATOR_RANGE 7
2+
13
/mob/proc/get_say()
4+
create_typing_indicator()
5+
window_typing = TRUE
26
var/msg = input(src, null, "say \"text\"") as text|null
3-
say_verb(msg)
7+
window_typing = FALSE
8+
remove_typing_indicator()
9+
say_verb(msg)
10+
11+
/mob
12+
var/image/typing_overlay
13+
var/list/speech_bubble_recipients
14+
var/last_typed
15+
var/last_typed_time
16+
var/window_typing = FALSE
17+
var/bar_typing = FALSE
18+
19+
/mob/proc/handle_typing_indicator()
20+
INVOKE_ASYNC(src,.proc/typing_indicator_process)
21+
22+
/mob/proc/typing_indicator_process()
23+
if(!GLOB.typing_indicators)
24+
return
25+
if(client)
26+
var/temp = winget(client, "input", "text")
27+
if(temp != last_typed)
28+
last_typed = temp
29+
last_typed_time = world.time
30+
if(world.time > last_typed_time + 10 SECONDS)
31+
bar_typing = FALSE
32+
remove_typing_indicator()
33+
return
34+
if(length(temp) > 5 && findtext(temp, "Say \"", 1, 7))
35+
create_typing_indicator()
36+
bar_typing = TRUE
37+
else if(length(temp) > 3 && findtext(temp, "Me ", 1, 5))
38+
//set_typing_indicator(1)
39+
else
40+
bar_typing = FALSE
41+
remove_typing_indicator()
42+
43+
44+
/mob/proc/create_typing_indicator()
45+
if(typing_overlay)
46+
return
47+
if(stat)
48+
return
49+
var/list/listening = get_hearers_in_view(TYPING_INDICATOR_RANGE, src)
50+
speech_bubble_recipients = list()
51+
for(var/mob/M in listening)
52+
if(M.client && M.client.prefs.chat_toggles & CHAT_TYPING_INDICATOR)
53+
speech_bubble_recipients.Add(M.client)
54+
var/bubble = "default"
55+
if(isliving(src))
56+
var/mob/living/L = src
57+
bubble = L.bubble_icon
58+
typing_overlay = image('yogstation/icons/mob/talk.dmi', src, "[bubble]_talking", FLY_LAYER)
59+
typing_overlay.appearance_flags = APPEARANCE_UI
60+
typing_overlay.invisibility = invisibility
61+
typing_overlay.alpha = alpha
62+
for(var/client/C in speech_bubble_recipients)
63+
C.images += typing_overlay
64+
65+
66+
/mob/proc/remove_typing_indicator()
67+
if(!typing_overlay)
68+
return
69+
if(window_typing || bar_typing)
70+
return
71+
for(var/client/C in speech_bubble_recipients)
72+
C.images -= typing_overlay
73+
typing_overlay = null
74+
speech_bubble_recipients = list()
75+
76+
/mob/camera/handle_typing_indicator() //RIP in piece camera mobs
77+
return
78+
79+
/mob/camera/create_typing_indicator()
80+
return
81+
82+
/mob/camera/remove_typing_indicator()
83+
return
84+
85+
86+
#undef TYPING_INDICATOR_RANGE

yogstation/icons/mob/talk.dmi

8.78 KB
Binary file not shown.

0 commit comments

Comments
 (0)