Merge pull request #9815 from VOREStation/upstream-merge-7927

[MIRROR] Removes transform from speech bubbles when speaker is scaled at less than 2x.
This commit is contained in:
Novacat
2021-03-09 17:40:51 -05:00
committed by Chompstation Bot
parent 4dafc3196e
commit 7c4508f6c3
6 changed files with 25 additions and 16 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -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))

View File

@@ -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)

View File

@@ -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)

View File

@@ -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