mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2025-12-09 19:23:52 +00:00
[TEST ONLY PLEASE]Floating Messages 2, the sequel. (#3781)
* Squashed commit of the following: commitd249b39f27Author: nevimer <foxmail@protonmail.com> Date: Tue Sep 14 17:52:17 2021 -0400 lil patch commitd93d156cdcMerge:c369a1f16579f026e4Author: 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 commitc369a1f16dAuthor: nevimer <77420409+nevimer@users.noreply.github.com> Date: Wed Jun 16 19:54:57 2021 -0400 fixes whispers returning oopsie commit479e1fcb3fMerge:2185394be3dfc5a831Author: nevimer <77420409+nevimer@users.noreply.github.com> Date: Wed Jun 16 01:40:25 2021 -0400 Merge branch 'master' into atom_say commit2185394beaAuthor: nevimer <77420409+nevimer@users.noreply.github.com> Date: Wed Jun 16 00:05:01 2021 -0400 might fix aghost and adds tts devices commitf51e4c9e39Author: nevimer <77420409+nevimer@users.noreply.github.com> Date: Wed Jun 9 20:41:09 2021 -0700 fmissed this commitcee32f19f6Author: nevimer <77420409+nevimer@users.noreply.github.com> Date: Wed Jun 9 20:34:10 2021 -0700 finally? commit434bca6725Author: nevimer <77420409+nevimer@users.noreply.github.com> Date: Wed Jun 9 22:54:47 2021 -0400 trying again commitac8a1e90f7Author: nevimer <77420409+nevimer@users.noreply.github.com> Date: Wed Jun 9 22:11:55 2021 -0400 scream commit12f528519dAuthor: nevimer <77420409+nevimer@users.noreply.github.com> Date: Wed Jun 9 21:38:18 2021 -0400 e? maybe commit3003ba9c8aAuthor: nevimer <77420409+nevimer@users.noreply.github.com> Date: Wed Jun 9 21:14:57 2021 -0400 ok this should fix it grr commit24cc8a48caAuthor: nevimer <77420409+nevimer@users.noreply.github.com> Date: Wed Jun 9 00:40:09 2021 -0400 update, fixes commit284823424fAuthor: nevimer <77420409+nevimer@users.noreply.github.com> Date: Thu May 27 18:22:57 2021 -0400 fixes whispers and emphasis commit676f1fdee9Author: nevimer <77420409+nevimer@users.noreply.github.com> Date: Thu May 27 05:02:37 2021 -0400 Update floating_message.dm commita6a56bd33eAuthor: nevimer <77420409+nevimer@users.noreply.github.com> Date: Thu May 27 04:35:12 2021 -0400 bugfix commit940869f9b8Author: nevimer <77420409+nevimer@users.noreply.github.com> Date: Thu May 27 04:07:57 2021 -0400 Update floating_message.dm commitee5bc05014Author: 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 commitdcdf68ffe2Author: 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. commit0fbbede014Author: 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 commit0fa68bcc9dAuthor: nevimer <77420409+nevimer@users.noreply.github.com> Date: Tue May 25 07:51:35 2021 -0400 adds atom_say starting point, working build commit60c64ba49eAuthor: Changelogs <action@github.com> Date: Sat May 22 00:38:31 2021 +0000 Automatic changelog compile [ci skip] commita252c25d08Merge:f050edf05edd16301dAuthor: nevimer <77420409+nevimer@users.noreply.github.com> Date: Thu May 20 22:09:18 2021 -0400 Merge remote-tracking branch 'upstream/master' commitf050edf052Author: Changelogs <action@github.com> Date: Fri May 21 00:38:27 2021 +0000 Automatic changelog compile [ci skip] commitad49b8a353Merge:3fa931fe8eb7cc7495Author: nevimer <77420409+nevimer@users.noreply.github.com> Date: Thu May 20 18:59:13 2021 -0400 Merge remote-tracking branch 'upstream/master' commit3fa931fe88Author: Changelogs <action@github.com> Date: Thu May 20 00:35:02 2021 +0000 Automatic changelog compile [ci skip] commited4f37002eAuthor: Changelogs <action@github.com> Date: Tue May 18 00:40:36 2021 +0000 Automatic changelog compile [ci skip] commit02ce64268aAuthor: Changelogs <action@github.com> Date: Mon May 17 00:36:31 2021 +0000 Automatic changelog compile [ci skip] commitdfe942dee2Author: Changelogs <action@github.com> Date: Sun May 16 00:40:06 2021 +0000 Automatic changelog compile [ci skip] commit283aa9bbf3Merge:18e1bc31774e4ac2aeAuthor: nevimer <77420409+nevimer@users.noreply.github.com> Date: Sat May 15 18:11:30 2021 -0400 Merge remote-tracking branch 'upstream/master' commit18e1bc317dAuthor: Changelogs <action@github.com> Date: Sat May 15 00:36:18 2021 +0000 Automatic changelog compile [ci skip] commit45f1758215Merge:0ee283079524c9bf09Author: 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 commit0ee283079cMerge:731b6c8407e78914deAuthor: nevimer <77420409+nevimer@users.noreply.github.com> Date: Fri May 14 09:21:27 2021 -0700 Merge remote-tracking branch 'upstream/master' commit524c9bf090Author: Changelogs <action@github.com> Date: Fri May 14 00:38:42 2021 +0000 Automatic changelog compile [ci skip] commitb49c70a2e4Author: Changelogs <action@github.com> Date: Thu May 13 00:38:08 2021 +0000 Automatic changelog compile [ci skip] commitf7c2793d48Author: Changelogs <action@github.com> Date: Tue May 11 00:27:49 2021 +0000 Automatic changelog compile [ci skip] commit731b6c840aMerge:f5118623bb08a4592cAuthor: nevimer <77420409+nevimer@users.noreply.github.com> Date: Mon May 10 11:04:15 2021 -0700 Merge remote-tracking branch 'upstream/master' commitf5118623b3Author: Changelogs <action@github.com> Date: Mon May 10 00:28:54 2021 +0000 Automatic changelog compile [ci skip] commit845d763f73Author: Changelogs <action@github.com> Date: Sun May 9 00:29:28 2021 +0000 Automatic changelog compile [ci skip] commit8ce38a567fAuthor: Changelogs <action@github.com> Date: Sat May 8 00:27:15 2021 +0000 Automatic changelog compile [ci skip] commitdf14298791Author: Changelogs <action@github.com> Date: Fri May 7 00:27:26 2021 +0000 Automatic changelog compile [ci skip] commitfa9e0c269cAuthor: Changelogs <action@github.com> Date: Thu May 6 00:25:25 2021 +0000 Automatic changelog compile [ci skip] commitf3213a4081Author: Changelogs <action@github.com> Date: Wed May 5 00:26:22 2021 +0000 Automatic changelog compile [ci skip] commitdab545149eAuthor: Changelogs <action@github.com> Date: Tue May 4 00:31:19 2021 +0000 Automatic changelog compile [ci skip] commitd8145b94a5Merge:c432f8e2c8c6505935Author: 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 commitc432f8e2c9Merge:befa94c8d1a6d61529Author: nevimer <77420409+nevimer@users.noreply.github.com> Date: Mon May 3 03:44:28 2021 -0400 Merge remote-tracking branch 'upstream/master' commit8c6505935fAuthor: Changelogs <action@github.com> Date: Mon May 3 00:36:22 2021 +0000 Automatic changelog compile [ci skip] commitff0770b3cbAuthor: Changelogs <action@github.com> Date: Sun May 2 00:39:51 2021 +0000 Automatic changelog compile [ci skip] commitbefa94c8dfMerge:ad4f7d2757e50e720fAuthor: nevimer <77420409+nevimer@users.noreply.github.com> Date: Sat May 1 00:06:38 2021 -0400 Merge remote-tracking branch 'upstream/master' commitad4f7d275dAuthor: Changelogs <action@github.com> Date: Sat May 1 00:35:51 2021 +0000 Automatic changelog compile [ci skip] commit162d19bf12Author: Changelogs <action@github.com> Date: Fri Apr 30 00:34:16 2021 +0000 Automatic changelog compile [ci skip] commit08a4966a5dMerge:fa900f273bc9f6a34cAuthor: nevimer <77420409+nevimer@users.noreply.github.com> Date: Thu Apr 29 04:32:54 2021 -0400 Merge remote-tracking branch 'upstream/master' commitfa900f2737Author: Changelogs <action@github.com> Date: Thu Apr 29 00:41:22 2021 +0000 Automatic changelog compile [ci skip] commit3a3731d7e6Author: Changelogs <action@github.com> Date: Tue Apr 27 00:41:26 2021 +0000 Automatic changelog compile [ci skip] commit6ea1b5ae9dAuthor: Changelogs <action@github.com> Date: Sun Apr 25 00:44:15 2021 +0000 Automatic changelog compile [ci skip] commit0bf27d747bAuthor: Changelogs <action@github.com> Date: Sat Apr 24 00:42:50 2021 +0000 Automatic changelog compile [ci skip] commit6cf2219f4aAuthor: Changelogs <action@github.com> Date: Thu Apr 22 00:42:36 2021 +0000 Automatic changelog compile [ci skip] commit1c7d64ce99Author: Changelogs <action@github.com> Date: Wed Apr 21 00:41:04 2021 +0000 Automatic changelog compile [ci skip] commitc3e79344b8Author: Changelogs <action@github.com> Date: Tue Apr 20 00:42:12 2021 +0000 Automatic changelog compile [ci skip] commitc3af5cbdf4Author: Changelogs <action@github.com> Date: Sat Apr 17 00:40:41 2021 +0000 Automatic changelog compile [ci skip] commit1473c88d4aAuthor: Changelogs <action@github.com> Date: Fri Apr 16 00:40:07 2021 +0000 Automatic changelog compile [ci skip] commit2421830491Author: Changelogs <action@github.com> Date: Thu Apr 15 00:41:58 2021 +0000 Automatic changelog compile [ci skip] commitdae8a74fb8Author: Changelogs <action@github.com> Date: Mon Apr 12 00:43:34 2021 +0000 Automatic changelog compile [ci skip] commit49b4245638Author: 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:
@@ -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"
|
||||
|
||||
49
code/__HELPERS/animations.dm
Normal file
49
code/__HELPERS/animations.dm
Normal 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)
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 *
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
74
code/modules/mob/floating_message.dm
Normal file
74
code/modules/mob/floating_message.dm
Normal 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)
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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(.)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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>"}
|
||||
|
||||
Reference in New Issue
Block a user