-
-
Notifications
You must be signed in to change notification settings - Fork 456
Adds Typing Indicator and also animated bubbles??? #13435
Changes from all commits
585345e
ceb08c0
1eef169
35c16f3
4909d6c
bc1f33b
4879c4e
b7dc7b5
9195cc7
e2f87e1
591f19d
ebf58b1
f1a0195
df9e10c
fa9d5da
a6b811d
6d0a2d1
5bf4506
5d284e2
94653a1
e0ae873
b6faa9f
99de25c
992dac3
64f7642
97a4489
1cb9611
2f49a41
c1dc34b
34405f2
4cc76e4
1ad29b5
b4f3cd8
8fbbd7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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) |
| 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() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would recommend a blanking overwrite of this for /mob/camera/create_typing_indicator()
return
/mob/camera/remove_typing_indicator()
return
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
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 | ||
ToasterBiome marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| /mob/camera/create_typing_indicator() | ||
| return | ||
|
|
||
| /mob/camera/remove_typing_indicator() | ||
| return | ||
|
|
||
|
|
||
| #undef TYPING_INDICATOR_RANGE | ||
Uh oh!
There was an error while loading. Please reload this page.