[TEST ONLY PLEASE]Floating Messages 2, the sequel. (#3781)

* Squashed commit of the following:

commit d249b39f27
Author: nevimer <foxmail@protonmail.com>
Date:   Tue Sep 14 17:52:17 2021 -0400

    lil patch

commit d93d156cdc
Merge: c369a1f16 579f026e4
Author: nevimer <foxmail@protonmail.com>
Date:   Tue Sep 14 17:41:34 2021 -0400

    Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13-RP into atom_say

    # Conflicts:
    #	code/game/atoms.dm
    #	code/modules/mob/typing_indicator.dm

commit c369a1f16d
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Wed Jun 16 19:54:57 2021 -0400

    fixes whispers returning oopsie

commit 479e1fcb3f
Merge: 2185394be 3dfc5a831
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Wed Jun 16 01:40:25 2021 -0400

    Merge branch 'master' into atom_say

commit 2185394bea
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Wed Jun 16 00:05:01 2021 -0400

    might fix aghost and adds tts devices

commit f51e4c9e39
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Wed Jun 9 20:41:09 2021 -0700

    fmissed this

commit cee32f19f6
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Wed Jun 9 20:34:10 2021 -0700

    finally?

commit 434bca6725
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Wed Jun 9 22:54:47 2021 -0400

    trying again

commit ac8a1e90f7
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Wed Jun 9 22:11:55 2021 -0400

    scream

commit 12f528519d
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Wed Jun 9 21:38:18 2021 -0400

    e? maybe

commit 3003ba9c8a
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Wed Jun 9 21:14:57 2021 -0400

    ok this should fix it

    grr

commit 24cc8a48ca
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Wed Jun 9 00:40:09 2021 -0400

    update, fixes

commit 284823424f
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Thu May 27 18:22:57 2021 -0400

    fixes whispers and emphasis

commit 676f1fdee9
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Thu May 27 05:02:37 2021 -0400

    Update floating_message.dm

commit a6a56bd33e
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Thu May 27 04:35:12 2021 -0400

    bugfix

commit 940869f9b8
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Thu May 27 04:07:57 2021 -0400

    Update floating_message.dm

commit ee5bc05014
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Wed May 26 21:12:22 2021 -0400

    Working preference toggle & chat message parsing. Ready for testing.

    Let's goooo

commit dcdf68ffe2
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Wed May 26 07:16:48 2021 -0400

    disables the say portion for the sake of the PR

    not ready yet, but the rest if fine for testing.

commit 0fbbede014
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Wed May 26 07:15:08 2021 -0400

    atom_say, working runechat checkpoint

    a lot of work, ports from both vorestation and nebula

commit 0fa68bcc9d
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Tue May 25 07:51:35 2021 -0400

    adds atom_say

    starting point, working build

commit 60c64ba49e
Author: Changelogs <action@github.com>
Date:   Sat May 22 00:38:31 2021 +0000

    Automatic changelog compile [ci skip]

commit a252c25d08
Merge: f050edf05 edd16301d
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Thu May 20 22:09:18 2021 -0400

    Merge remote-tracking branch 'upstream/master'

commit f050edf052
Author: Changelogs <action@github.com>
Date:   Fri May 21 00:38:27 2021 +0000

    Automatic changelog compile [ci skip]

commit ad49b8a353
Merge: 3fa931fe8 eb7cc7495
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Thu May 20 18:59:13 2021 -0400

    Merge remote-tracking branch 'upstream/master'

commit 3fa931fe88
Author: Changelogs <action@github.com>
Date:   Thu May 20 00:35:02 2021 +0000

    Automatic changelog compile [ci skip]

commit ed4f37002e
Author: Changelogs <action@github.com>
Date:   Tue May 18 00:40:36 2021 +0000

    Automatic changelog compile [ci skip]

commit 02ce64268a
Author: Changelogs <action@github.com>
Date:   Mon May 17 00:36:31 2021 +0000

    Automatic changelog compile [ci skip]

commit dfe942dee2
Author: Changelogs <action@github.com>
Date:   Sun May 16 00:40:06 2021 +0000

    Automatic changelog compile [ci skip]

commit 283aa9bbf3
Merge: 18e1bc317 74e4ac2ae
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Sat May 15 18:11:30 2021 -0400

    Merge remote-tracking branch 'upstream/master'

commit 18e1bc317d
Author: Changelogs <action@github.com>
Date:   Sat May 15 00:36:18 2021 +0000

    Automatic changelog compile [ci skip]

commit 45f1758215
Merge: 0ee283079 524c9bf09
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Fri May 14 09:25:57 2021 -0700

    Merge branch 'master' of https://github.com/nevimer/Citadel-Station-13-RP

commit 0ee283079c
Merge: 731b6c840 7e78914de
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Fri May 14 09:21:27 2021 -0700

    Merge remote-tracking branch 'upstream/master'

commit 524c9bf090
Author: Changelogs <action@github.com>
Date:   Fri May 14 00:38:42 2021 +0000

    Automatic changelog compile [ci skip]

commit b49c70a2e4
Author: Changelogs <action@github.com>
Date:   Thu May 13 00:38:08 2021 +0000

    Automatic changelog compile [ci skip]

commit f7c2793d48
Author: Changelogs <action@github.com>
Date:   Tue May 11 00:27:49 2021 +0000

    Automatic changelog compile [ci skip]

commit 731b6c840a
Merge: f5118623b b08a4592c
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Mon May 10 11:04:15 2021 -0700

    Merge remote-tracking branch 'upstream/master'

commit f5118623b3
Author: Changelogs <action@github.com>
Date:   Mon May 10 00:28:54 2021 +0000

    Automatic changelog compile [ci skip]

commit 845d763f73
Author: Changelogs <action@github.com>
Date:   Sun May 9 00:29:28 2021 +0000

    Automatic changelog compile [ci skip]

commit 8ce38a567f
Author: Changelogs <action@github.com>
Date:   Sat May 8 00:27:15 2021 +0000

    Automatic changelog compile [ci skip]

commit df14298791
Author: Changelogs <action@github.com>
Date:   Fri May 7 00:27:26 2021 +0000

    Automatic changelog compile [ci skip]

commit fa9e0c269c
Author: Changelogs <action@github.com>
Date:   Thu May 6 00:25:25 2021 +0000

    Automatic changelog compile [ci skip]

commit f3213a4081
Author: Changelogs <action@github.com>
Date:   Wed May 5 00:26:22 2021 +0000

    Automatic changelog compile [ci skip]

commit dab545149e
Author: Changelogs <action@github.com>
Date:   Tue May 4 00:31:19 2021 +0000

    Automatic changelog compile [ci skip]

commit d8145b94a5
Merge: c432f8e2c 8c6505935
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Mon May 3 03:44:34 2021 -0400

    Merge branch 'master' of https://github.com/nevimer/Citadel-Station-13-RP

commit c432f8e2c9
Merge: befa94c8d 1a6d61529
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Mon May 3 03:44:28 2021 -0400

    Merge remote-tracking branch 'upstream/master'

commit 8c6505935f
Author: Changelogs <action@github.com>
Date:   Mon May 3 00:36:22 2021 +0000

    Automatic changelog compile [ci skip]

commit ff0770b3cb
Author: Changelogs <action@github.com>
Date:   Sun May 2 00:39:51 2021 +0000

    Automatic changelog compile [ci skip]

commit befa94c8df
Merge: ad4f7d275 7e50e720f
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Sat May 1 00:06:38 2021 -0400

    Merge remote-tracking branch 'upstream/master'

commit ad4f7d275d
Author: Changelogs <action@github.com>
Date:   Sat May 1 00:35:51 2021 +0000

    Automatic changelog compile [ci skip]

commit 162d19bf12
Author: Changelogs <action@github.com>
Date:   Fri Apr 30 00:34:16 2021 +0000

    Automatic changelog compile [ci skip]

commit 08a4966a5d
Merge: fa900f273 bc9f6a34c
Author: nevimer <77420409+nevimer@users.noreply.github.com>
Date:   Thu Apr 29 04:32:54 2021 -0400

    Merge remote-tracking branch 'upstream/master'

commit fa900f2737
Author: Changelogs <action@github.com>
Date:   Thu Apr 29 00:41:22 2021 +0000

    Automatic changelog compile [ci skip]

commit 3a3731d7e6
Author: Changelogs <action@github.com>
Date:   Tue Apr 27 00:41:26 2021 +0000

    Automatic changelog compile [ci skip]

commit 6ea1b5ae9d
Author: Changelogs <action@github.com>
Date:   Sun Apr 25 00:44:15 2021 +0000

    Automatic changelog compile [ci skip]

commit 0bf27d747b
Author: Changelogs <action@github.com>
Date:   Sat Apr 24 00:42:50 2021 +0000

    Automatic changelog compile [ci skip]

commit 6cf2219f4a
Author: Changelogs <action@github.com>
Date:   Thu Apr 22 00:42:36 2021 +0000

    Automatic changelog compile [ci skip]

commit 1c7d64ce99
Author: Changelogs <action@github.com>
Date:   Wed Apr 21 00:41:04 2021 +0000

    Automatic changelog compile [ci skip]

commit c3e79344b8
Author: Changelogs <action@github.com>
Date:   Tue Apr 20 00:42:12 2021 +0000

    Automatic changelog compile [ci skip]

commit c3af5cbdf4
Author: Changelogs <action@github.com>
Date:   Sat Apr 17 00:40:41 2021 +0000

    Automatic changelog compile [ci skip]

commit 1473c88d4a
Author: Changelogs <action@github.com>
Date:   Fri Apr 16 00:40:07 2021 +0000

    Automatic changelog compile [ci skip]

commit 2421830491
Author: Changelogs <action@github.com>
Date:   Thu Apr 15 00:41:58 2021 +0000

    Automatic changelog compile [ci skip]

commit dae8a74fb8
Author: Changelogs <action@github.com>
Date:   Mon Apr 12 00:43:34 2021 +0000

    Automatic changelog compile [ci skip]

commit 49b4245638
Author: Changelogs <action@github.com>
Date:   Sun Apr 11 00:44:26 2021 +0000

    Automatic changelog compile [ci skip]

* Yeah....?

* ok we're good, colour bug remains

* Update commit, need help
This commit is contained in:
nevimer
2022-09-21 07:35:03 -04:00
committed by GitHub
parent 3373396b36
commit 5814661f08
16 changed files with 264 additions and 15 deletions

View File

@@ -207,6 +207,7 @@
#include "code\__HELPERS\_global_objects.dm"
#include "code\__HELPERS\_lists_tg.dm"
#include "code\__HELPERS\_logging.dm"
#include "code\__HELPERS\animations.dm"
#include "code\__HELPERS\areas.dm"
#include "code\__HELPERS\atom_movables.dm"
#include "code\__HELPERS\chat.dm"
@@ -2667,6 +2668,7 @@
#include "code\modules\mob\animations.dm"
#include "code\modules\mob\death.dm"
#include "code\modules\mob\emote.dm"
#include "code\modules\mob\floating_message.dm"
#include "code\modules\mob\gender.dm"
#include "code\modules\mob\health.dm"
#include "code\modules\mob\hear_say.dm"

View File

@@ -0,0 +1,49 @@
/proc/remove_images_from_clients(image/I, list/show_to)
for(var/client/C in show_to)
C.images -= I
qdel(I)
/proc/fade_out(image/I, list/show_to)
animate(I, alpha = 0, time = 0.5 SECONDS, easing = EASE_IN)
addtimer(CALLBACK(GLOBAL_PROC, .proc/remove_images_from_clients, I, show_to), 0.5 SECONDS)
/proc/animate_speech_bubble(image/I, list/show_to, duration)
var/matrix/M = matrix()
M.Scale(0,0)
I.transform = M
I.alpha = 0
for(var/client/C in show_to)
C.images += I
animate(I, transform = 0, alpha = 255, time = 0.2 SECONDS, easing = EASE_IN)
addtimer(CALLBACK(GLOBAL_PROC, .proc/fade_out, I, show_to), (duration - 0.5 SECONDS))
/proc/animate_receive_damage(atom/A)
var/pixel_x_diff = rand(-2,2)
var/pixel_y_diff = rand(-2,2)
animate(A, pixel_x = A.pixel_x + pixel_x_diff, pixel_y = A.pixel_y + pixel_y_diff, time = 2)
animate(pixel_x = initial(A.pixel_x), pixel_y = initial(A.pixel_y), time = 2)
/proc/animate_throw(atom/A)
var/ipx = A.pixel_x
var/ipy = A.pixel_y
var/mpx = 0
var/mpy = 0
if(A.dir & NORTH)
mpy += 3
else if(A.dir & SOUTH)
mpy -= 3
if(A.dir & EAST)
mpx += 3
else if(A.dir & WEST)
mpx -= 3
var/x = mpx + ipx
var/y = mpy + ipy
animate(A, pixel_x = x, pixel_y = y, time = 0.6, easing = EASE_OUT)
var/matrix/M = matrix(A.transform)
animate(transform = turn(A.transform, (mpx - mpy) * 4), time = 0.6, easing = EASE_OUT)
animate(pixel_x = ipx, pixel_y = ipy, time = 0.6, easing = EASE_IN)
animate(transform = M, time = 0.6, easing = EASE_IN)

View File

@@ -634,3 +634,54 @@ datum/projectile_data
min(list_y),
max(list_x),
max(list_y))
/proc/recursive_mob_check(var/atom/O, var/list/L = list(), var/recursion_limit = 3, var/client_check = 1, var/sight_check = 1, var/include_radio = 1)
//GLOB.debug_mob += O.contents.len
if(!recursion_limit)
return L
for(var/atom/A in O.contents)
if(ismob(A))
var/mob/M = A
if(client_check && !M.client)
L |= recursive_mob_check(A, L, recursion_limit - 1, client_check, sight_check, include_radio)
continue
if(sight_check && !isInSight(A, O))
continue
L |= M
//log_world("[recursion_limit] = [M] - [get_turf(M)] - ([M.x], [M.y], [M.z])")
else if(include_radio && istype(A, /obj/item/radio))
if(sight_check && !isInSight(A, O))
continue
L |= A
if(isobj(A) || ismob(A))
L |= recursive_mob_check(A, L, recursion_limit - 1, client_check, sight_check, include_radio)
return L
/proc/get_mobs_in_view(var/R, var/atom/source, var/include_clientless = FALSE)
// Returns a list of mobs in range of R from source. Used in radio and say code.
var/turf/T = get_turf(source)
var/list/hear = list()
if(!T)
return hear
var/list/range = hear(R, T)
for(var/atom/A in range)
if(ismob(A))
var/mob/M = A
if(M.client || include_clientless)
hear += M
//log_world("Start = [M] - [get_turf(M)] - ([M.x], [M.y], [M.z])")
else if(istype(A, /obj/item/radio))
hear += A
if(isobj(A) || ismob(A))
hear |= recursive_mob_check(A, hear, 3, 1, 0, 1)
return hear

View File

@@ -24,3 +24,6 @@
#define random_id(key,min_id,max_id) uniqueness_repository.Generate(/datum/uniqueness_generator/id_random, key, min_id, max_id)
#define ARGS_DEBUG log_debug("[__FILE__] - [__LINE__]") ; for(var/arg in args) { log_debug("\t[log_info_line(arg)]") }
#define JOINTEXT(X) jointext(X, null)
//thank you Kevin for not running checks again, now I have to update one file with a comment - Papalus

View File

@@ -769,7 +769,7 @@
for(var/mob in seeing_mobs)
var/mob/M = mob
if(self_message && (M == src))
M.show_message( self_message, 1, blind_message, 2)
M.show_message(self_message, 1, blind_message, 2)
else if((M.see_invisible >= invisibility) && MOB_CAN_SEE_PLANE(M, plane))
M.show_message(message, 1, blind_message, 2)
else if(blind_message)
@@ -787,7 +787,7 @@
var/list/hearing_mobs = hear["mobs"]
var/list/hearing_objs = hear["objs"]
var/list/heard_to_floating_message
for(var/obj in hearing_objs)
var/obj/O = obj
O.show_message(message, 2, deaf_message, 1)
@@ -796,6 +796,9 @@
var/mob/M = mob
var/msg = message
M.show_message(msg, 2, deaf_message, 1)
M += heard_to_floating_message
INVOKE_ASYNC(src, /atom/movable/proc/animate_chat, (message ? message : deaf_message), null, FALSE, heard_to_floating_message, 30)
/atom/movable/proc/dropInto(var/atom/destination)
while(istype(destination))
@@ -836,7 +839,7 @@
if(!message)
return
var/list/speech_bubble_hearers = list()
for(var/mob/M in get_hearers_in_view(7, src))
for(var/mob/M in get_hearers_in_view(MESSAGE_RANGE_COMBAT_LOUD, src))
M.show_message("<span class='game say'><span class='name'>[src]</span> [atom_say_verb], \"[message]\"</span>", 2, null, 1)
if(M.client)
speech_bubble_hearers += M.client
@@ -845,6 +848,18 @@
var/image/I = generate_speech_bubble(src, "[bubble_icon][say_test(message)]", FLY_LAYER)
I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
INVOKE_ASYNC(GLOBAL_PROC, /.proc/flick_overlay, I, speech_bubble_hearers, 30)
INVOKE_ASYNC(src, /atom/movable/proc/animate_chat, message, null, FALSE, speech_bubble_hearers, 30)
/atom/proc/say_overhead(var/message, whispering, message_range = 7, var/datum/language/speaking = null, var/list/passed_hearing_list)
var/list/speech_bubble_hearers = list()
var/italics
if(whispering)
italics = TRUE
for(var/mob/M in get_mobs_in_view(message_range, src))
if(M.client)
speech_bubble_hearers += M.client
if(length(speech_bubble_hearers))
INVOKE_ASYNC(src, /atom/movable/proc/animate_chat, message, speaking, italics, speech_bubble_hearers, 30)
/proc/generate_speech_bubble(var/bubble_loc, var/speech_state, var/set_layer = FLOAT_LAYER)
var/image/I = image('icons/mob/talk_vr.dmi', bubble_loc, speech_state, set_layer)
@@ -854,7 +869,6 @@
/atom/proc/speech_bubble(bubble_state = "", bubble_loc = src, list/bubble_recipients = list())
return
//! ## Atom Colour Priority System
/**
* A System that gives finer control over which atom colour to colour the atom with.

View File

@@ -26,6 +26,8 @@
if(message)
var/obj/item/text_to_speech/O = src
audible_message("[icon2html(thing = O, target = world)] \The [O.name] states, \"[message]\"")
user.say_overhead(message, FALSE, MESSAGE_RANGE_COMBAT_LOUD) // I don't like this, I wish I could just invoke what this calls directly!
/obj/item/text_to_speech/AltClick(mob/user) // QOL Change
attack_self(user)

View File

@@ -286,6 +286,12 @@ var/list/_client_preferences_by_type
/datum/client_preference/parallax/toggled(mob/preference_mob, enabled)
. = ..()
preference_mob?.client?.parallax_holder?.Reset()
/datum/client_preference/overhead_chat
description = "Overhead Chat"
key = "OVERHEAD_CHAT"
enabled_description = "Show"
disabled_description = "Hide"
enabled_by_default = TRUE
/********************
* Staff Preferences *

View File

@@ -292,6 +292,20 @@
to_chat(src, "You will now [(is_preference_enabled(/datum/client_preference/status_indicators)) ? "see" : "not see"] status indicators.")
feedback_add_details("admin_verb","TStatusIndicators")
/client/verb/toggle_overhead_chat()
set name = "Toggle Overhead Chat"
set category = "Preferences"
set desc = "Enable/Disable seeing overhead chat messages."
var/pref_path = /datum/client_preference/overhead_chat
toggle_preference(pref_path)
SScharacter_setup.queue_preferences_save(prefs)
to_chat(src, "You will now [(is_preference_enabled(/datum/client_preference/overhead_chat)) ? "see" : "not see"] overhead chat messages..")
feedback_add_details("admin_verb","TOHChat")
//Toggles for Staff
//Developers

View File

@@ -23,6 +23,8 @@
if (message)
message = say_emphasis(message)
var/overhead_message = ("** [message] **")
say_overhead(overhead_message, FALSE, range)
SEND_SIGNAL(src, COMSIG_MOB_CUSTOM_EMOTE, src, message)
// Hearing gasp and such every five seconds is not good emotes were not global for a reason.

View File

@@ -0,0 +1,74 @@
var/list/floating_chat_colors = list()
/atom/movable
var/list/stored_chat_text
/atom/movable/proc/animate_chat(message, var/datum/language/speaking = null, small, list/show_to, duration = 30)
set waitfor = FALSE
if(!speaking)
var/datum/language/noise/noise
speaking = noise
// Get rid of any URL schemes that might cause BYOND to automatically wrap something in an anchor tag
var/static/regex/url_scheme = new(@"[A-Za-z][A-Za-z0-9+-\.]*:\/\/", "g")
message = replacetext(message, url_scheme, "")
var/static/regex/html_metachars = new(@"&[A-Za-z]{1,7};", "g")
message = replacetext(message, html_metachars, "")
var/style //additional style params for the message
var/fontsize = 4
if(small)
fontsize = 2
var/limit = 160
if(copytext_char(message, length_char(message) - 1) == "!!")
fontsize = 8
limit = 160
style += "font-weight: bold;"
if(length_char(message) > limit)
message = "[copytext_char(message, 1, limit)]..."
if(!floating_chat_colors[src])
floating_chat_colors[src] = get_random_colour(0,160,230)
style += "color: [floating_chat_colors[src]];"
// create 2 messages, one that appears if you know the language, and one that appears when you don't know the language
var/image/understood = generate_floating_text(src, capitalize(message), style, fontsize, duration, show_to)
var/image/gibberish = speaking ? generate_floating_text(src, speaking.scramble(message), style, fontsize, duration, show_to) : understood
for(var/client/C in show_to)
if(!C.mob.is_deaf() && C.is_preference_enabled(/datum/client_preference/overhead_chat))
if(C.mob.say_understands(null, speaking))
C.images += understood
else
C.images += gibberish
#define MAPTEXT(text) {"<span class='maptext'>[##text]</span>"}
/proc/generate_floating_text(atom/movable/holder, message, style, size, duration, show_to)
var/image/I = image(null, holder)
var/mob/living/X
if(isliving(holder))
X = holder
I.plane = PLANE_PLAYER_HUD
I.layer = PLANE_PLAYER_HUD_ITEMS
I.alpha = 15
I.maptext_width = 160
I.maptext_height = 64
I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
I.pixel_x = -round(I.maptext_width/2) + 16
I.maptext = MAPTEXT("<span style=\"[style]\"><center>[message]</center></span>") // whoa calm down!!
animate(I, 1, alpha = 255, pixel_y = 24 * (X?.size_multiplier || 1))
for(var/image/old in holder.stored_chat_text)
animate(old, 2, pixel_y = old.pixel_y + 8)
LAZYADD(holder.stored_chat_text, I)
addtimer(CALLBACK(GLOBAL_PROC, .proc/remove_floating_text, holder, I), duration + 16)
addtimer(CALLBACK(GLOBAL_PROC, .proc/remove_images_from_clients, I, show_to), duration + 18)
return I
/proc/remove_floating_text(atom/movable/holder, image/I)
animate(I, 2, pixel_y = I.pixel_y + 10, alpha = 0)
LAZYREMOVE(holder.stored_chat_text, I)

View File

@@ -71,6 +71,7 @@
if(check_mentioned(message) && is_preference_enabled(/datum/client_preference/check_mention))
message_to_send = "<font size='3'><b>[message_to_send]</b></font>"
on_hear_say(message_to_send)
if (speech_sound && (get_dist(speaker, src) <= world.view && src.z == speaker.z))
@@ -126,6 +127,15 @@
input = replacetext_char(input, strikethrough, "<s>$1</s>")
return input
/mob/proc/say_emphasis_strip(input)
var/static/regex/italics = regex("\\|(?=\\S)(.*?)(?=\\S)\\|", "g")
input = replacetext_char(input, italics, "$1")
var/static/regex/bold = regex("\\+(?=\\S)(.*?)(?=\\S)\\+", "g")
input = replacetext_char(input, bold, "$1")
var/static/regex/underline = regex("_(?=\\S)(.*?)(?=\\S)_", "g")
input = replacetext_char(input, underline, "$1")
return input
/mob/proc/hear_radio(var/message, var/verb="says", var/datum/language/language=null, var/part_a, var/part_b, var/part_c, var/mob/speaker = null, var/hard_to_hear = 0, var/vname ="")
if(!client)

View File

@@ -287,7 +287,7 @@ proc/get_radio_key_from_channel(var/channel)
var/msg
if(!speaking || !(speaking.flags & NO_TALK_MSG))
msg = "<span class='notice'>\The [src] talks into \the [used_radios[1]]</span>"
for(var/mob/living/M in hearers(5, src))
for(var/mob/living/M in hearers(7, src))
if((M != src) && msg)
M.show_message(msg)
if (speech_sound)
@@ -380,6 +380,10 @@ proc/get_radio_key_from_channel(var/channel)
listening[item] = z_speech_bubble
listening_obj |= results["objs"]
above = above.shadow
var/atom/emitter = src
if(!isobserver(emitter) || !IsAdminGhost(emitter))
emitter.say_overhead(say_emphasis_strip(message), whispering, message_range, speaking)
//Main 'say' and 'whisper' message delivery
for(var/mob/M in listening)
@@ -395,12 +399,14 @@ proc/get_radio_key_from_channel(var/channel)
SEND_IMAGE(M, I1)
M.hear_say(message, verb, speaking, alt_name, italics, src, speech_sound, sound_vol)
if(whispering) //Don't even bother with these unless whispering
if(dst > message_range && dst <= w_scramble_range) //Inside whisper scramble range
if(M.client)
var/image/I2 = listening[M] || speech_bubble
images_to_clients[I2] |= M.client
SEND_IMAGE(M, I2)
M.hear_say(stars(message), verb, speaking, alt_name, italics, src, speech_sound, sound_vol*0.2)
if(dst > w_scramble_range && dst <= world.view) //Inside whisper 'visible' range
M.show_message("<span class='game say'><span class='name'>[src.name]</span> [w_not_heard].</span>", 2)

View File

@@ -611,3 +611,17 @@ var/list/global/organ_rel_size = list(
/mob/proc/can_see_reagents()
return stat == DEAD || issilicon(src) //Dead guys and silicons can always see reagents
//Ingnores the possibility of breaking tags.
/proc/stars_no_html(text, pr, re_encode)
text = html_decode(text) //We don't want to screw up escaped characters
. = list()
for(var/i = 1, i <= length_char(text), i++)
var/char = copytext_char(text, i, i+1)
if(char == " " || prob(pr))
. += char
else
. += "*"
. = JOINTEXT(.)
if(re_encode)
. = html_encode(.)

View File

@@ -1,6 +1,7 @@
/mob/proc/say(var/message, var/datum/language/speaking = null, var/verb="says", var/alt_name="", var/whispering = 0)
return
/mob/proc/whisper_wrapper()
var/message = input("","whisper (text)") as text|null
if(message)

View File

@@ -2,21 +2,21 @@ macro "default"
menu "menu"
elem
elem
name = "&File"
command = ""
saved-params = "is-checked"
elem
elem
name = "&Quick screenshot\tF2"
command = ".screenshot auto"
category = "&File"
saved-params = "is-checked"
elem
elem
name = "&Save screenshot as...\tShift+F2"
command = ".screenshot"
category = "&File"
saved-params = "is-checked"
elem
elem
name = ""
command = ""
category = "&File"
@@ -26,12 +26,12 @@ menu "menu"
command = ".reconnect"
category = "&File"
saved-params = "is-checked"
elem
elem
name = "&Quit\tAlt-F4"
command = ".quit"
category = "&File"
saved-params = "is-checked"
elem
elem
name = "&Icons"
command = ""
saved-params = "is-checked"
@@ -78,7 +78,7 @@ menu "menu"
can-check = true
group = "size"
saved-params = "is-checked"
elem
elem
name = ""
command = ""
category = "&Icons"
@@ -89,16 +89,16 @@ menu "menu"
category = "&Icons"
can-check = true
saved-params = "is-checked"
elem
elem
name = "&Help"
command = ""
saved-params = "is-checked"
elem
elem
name = "&Admin Help\tF1"
command = "adminhelp"
category = "&Help"
saved-params = "is-checked"
elem
elem
name = "&Hotkeys"
command = "hotkeys-help"
category = "&Help"

View File

@@ -254,5 +254,6 @@ h1.alert, h2.alert {color: #000000;}
.debug_info {}
.debug_debug {color:#0000FF;}
.debug_trace {color:#888888;}
.maptext { font-family: 'Small Fonts'; font-size: 7px; -dm-text-outline: 1px black; color: white; line-height: 1.1; text-align: center; }
</style>"}