From 7c4508f6c31a9cb31fc67d97f9ebbd51da9a3964 Mon Sep 17 00:00:00 2001 From: Novacat <35587478+Novacat@users.noreply.github.com> Date: Tue, 9 Mar 2021 17:40:51 -0500 Subject: [PATCH] Merge pull request #9815 from VOREStation/upstream-merge-7927 [MIRROR] Removes transform from speech bubbles when speaker is scaled at less than 2x. --- code/game/atoms.dm | 2 +- code/modules/mob/living/carbon/brain/brain.dm | 4 +-- code/modules/mob/living/say.dm | 4 +-- code/modules/mob/living/voice/voice.dm | 2 +- code/modules/mob/typing_indicator.dm | 25 ++++++++++++++----- code/modules/multiz/zshadow.dm | 4 +-- 6 files changed, 25 insertions(+), 16 deletions(-) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 5ec5af0e6b..c20c29be7b 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -627,7 +627,7 @@ speech_bubble_hearers += M.client if(length(speech_bubble_hearers)) - var/image/I = image('icons/mob/talk.dmi', src, "[bubble_icon][say_test(message)]", FLY_LAYER) + 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) diff --git a/code/modules/mob/living/carbon/brain/brain.dm b/code/modules/mob/living/carbon/brain/brain.dm index 52d0a839e2..89ff4151fb 100644 --- a/code/modules/mob/living/carbon/brain/brain.dm +++ b/code/modules/mob/living/carbon/brain/brain.dm @@ -54,9 +54,7 @@ return if(!typing_indicator) - typing_indicator = new - typing_indicator.icon = 'icons/mob/talk_vr.dmi' //VOREStation Edit - talk_vr.dmi instead of talk.dmi for right-side icons - typing_indicator.icon_state = "[speech_bubble_appearance()]_typing" + init_typing_indicator("[speech_bubble_appearance()]_typing") if(state && !typing) loc.add_overlay(typing_indicator, TRUE) diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index c6a3eac1ef..bcbfebd05d 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -325,7 +325,7 @@ proc/get_radio_key_from_channel(var/channel) var/speech_bubble_test = say_test(message) //var/image/speech_bubble = image('icons/mob/talk_vr.dmi',src,"h[speech_bubble_test]") //VOREStation Edit. Commented this out in case we need to reenable. var/speech_type = speech_bubble_appearance() - var/image/speech_bubble = image('icons/mob/talk_vr.dmi',src,"[speech_type][speech_bubble_test]") //VOREStation Edit - talk_vr.dmi instead of talk.dmi for right-side icons + var/image/speech_bubble = generate_speech_bubble(src, "[speech_type][speech_bubble_test]") var/sb_alpha = 255 var/atom/loc_before_turf = src //VOREStation Add @@ -347,7 +347,7 @@ proc/get_radio_key_from_channel(var/channel) var/turf/ST = get_turf(above) if(ST) var/list/results = get_mobs_and_objs_in_view_fast(ST, world.view) - var/image/z_speech_bubble = image('icons/mob/talk_vr.dmi', above, "h[speech_bubble_test]") //VOREStation Edit - talk_vr.dmi instead of talk.dmi for right-side icons + var/image/z_speech_bubble = generate_speech_bubble(above, "h[speech_bubble_test]") images_to_clients[z_speech_bubble] = list() for(var/item in results["mobs"]) if(item != above && !(item in listening)) diff --git a/code/modules/mob/living/voice/voice.dm b/code/modules/mob/living/voice/voice.dm index 8b9491d902..2d070d1a29 100644 --- a/code/modules/mob/living/voice/voice.dm +++ b/code/modules/mob/living/voice/voice.dm @@ -110,7 +110,7 @@ var/speech_bubble_test = say_test(message) //var/image/speech_bubble = image('icons/mob/talk_vr.dmi',comm,"h[speech_bubble_test]") //VOREStation Edit - Commented out in case of needed reenable. var/speech_type = speech_bubble_appearance() - var/image/speech_bubble = image('icons/mob/talk_vr.dmi',comm,"[speech_type][speech_bubble_test]") //VOREStation Edit - talk_vr.dmi instead of talk.dmi for right-side icons + var/image/speech_bubble = generate_speech_bubble(comm, "[speech_type][speech_bubble_test]") spawn(30) qdel(speech_bubble) diff --git a/code/modules/mob/typing_indicator.dm b/code/modules/mob/typing_indicator.dm index a260c878fc..7f65e4e510 100644 --- a/code/modules/mob/typing_indicator.dm +++ b/code/modules/mob/typing_indicator.dm @@ -1,15 +1,28 @@ +/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) //VOREStation Edit - talk_vr.dmi instead of talk.dmi for right-side icons + I.appearance_flags |= (KEEP_APART|RESET_COLOR|PIXEL_SCALE) + if(istype(bubble_loc, /atom/movable)) + var/atom/movable/AM = bubble_loc + var/x_scale = AM.get_icon_scale_x() + if(abs(x_scale) < 2) // reset transform on bubbles, except for the Very Large + I.pixel_z = (AM.icon_expected_height * (x_scale-1)) + I.appearance_flags |= RESET_TRANSFORM + return I + +/mob/proc/init_typing_indicator(var/set_state = "typing") + typing_indicator = new + typing_indicator.appearance = generate_speech_bubble(null, set_state) + typing_indicator.appearance_flags |= (KEEP_APART|RESET_COLOR|RESET_TRANSFORM|PIXEL_SCALE) + /mob/proc/set_typing_indicator(var/state) //Leaving this here for mobs. if(!is_preference_enabled(/datum/client_preference/show_typing_indicator)) - cut_overlay(typing_indicator, TRUE) + if(typing_indicator) + cut_overlay(typing_indicator, TRUE) return if(!typing_indicator) - typing_indicator = new - //typing_indicator.icon = 'icons/mob/talk_vr.dmi' //VOREStation Edit - Looks better on the right with job icons. - //typing_indicator.icon_state = "typing" - typing_indicator.icon = 'icons/mob/talk_vr.dmi' //VOREStation Edit - talk_vr.dmi instead of talk.dmi for right-side icons - typing_indicator.icon_state = "[speech_bubble_appearance()]_typing" + init_typing_indicator("[speech_bubble_appearance()]_typing") if(state && !typing) add_overlay(typing_indicator, TRUE) diff --git a/code/modules/multiz/zshadow.dm b/code/modules/multiz/zshadow.dm index b3e37c6b76..fcc5ecad65 100644 --- a/code/modules/multiz/zshadow.dm +++ b/code/modules/multiz/zshadow.dm @@ -121,9 +121,7 @@ /mob/zshadow/set_typing_indicator(var/state) if(!typing_indicator) - typing_indicator = new - typing_indicator.icon = 'icons/mob/talk_vr.dmi' // Looks better on the right with job icons. //VOREStation Edit - talk_vr.dmi instead of talk.dmi for right-side icons - typing_indicator.icon_state = "typing" + init_typing_indicator("typing") if(state && !typing) overlays += typing_indicator typing = 1