mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-22 20:56:33 +01:00
Removes transform from speech bubbles when speaker is scaled at less than 2x. (#7927)
* Resets scaling and colour on the typing indicator. * Refactoring speech bubble generation.
This commit is contained in:
@@ -53,9 +53,7 @@
|
||||
return
|
||||
|
||||
if(!typing_indicator)
|
||||
typing_indicator = new
|
||||
typing_indicator.icon = 'icons/mob/talk.dmi'
|
||||
typing_indicator.icon_state = "[speech_bubble_appearance()]_typing"
|
||||
init_typing_indicator("[speech_bubble_appearance()]_typing")
|
||||
|
||||
if(state && !typing)
|
||||
loc.add_overlay(typing_indicator, TRUE)
|
||||
|
||||
@@ -292,7 +292,7 @@ proc/get_radio_key_from_channel(var/channel)
|
||||
//The 'post-say' static speech bubble
|
||||
var/speech_bubble_test = say_test(message)
|
||||
var/speech_type = speech_bubble_appearance()
|
||||
var/image/speech_bubble = image('icons/mob/talk.dmi',src,"[speech_type][speech_bubble_test]")
|
||||
var/image/speech_bubble = generate_speech_bubble(src, "[speech_type][speech_bubble_test]")
|
||||
var/sb_alpha = 255
|
||||
var/atom/loc_before_turf = src
|
||||
while(loc_before_turf && !isturf(loc_before_turf.loc))
|
||||
@@ -310,7 +310,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.dmi', above, "h[speech_bubble_test]")
|
||||
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))
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
if(comm)
|
||||
var/speech_bubble_test = say_test(message)
|
||||
var/speech_type = speech_bubble_appearance()
|
||||
var/image/speech_bubble = image('icons/mob/talk.dmi',comm,"[speech_type][speech_bubble_test]")
|
||||
var/image/speech_bubble = generate_speech_bubble(comm, "[speech_type][speech_bubble_test]")
|
||||
spawn(30)
|
||||
qdel(speech_bubble)
|
||||
|
||||
|
||||
@@ -1,13 +1,28 @@
|
||||
/proc/generate_speech_bubble(var/bubble_loc, var/speech_state, var/set_layer = FLOAT_LAYER)
|
||||
var/image/I = image('icons/mob/talk.dmi', bubble_loc, speech_state, set_layer)
|
||||
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.dmi'
|
||||
typing_indicator.icon_state = "[speech_bubble_appearance()]_typing"
|
||||
init_typing_indicator("[speech_bubble_appearance()]_typing")
|
||||
|
||||
if(state && !typing)
|
||||
add_overlay(typing_indicator, TRUE)
|
||||
|
||||
@@ -121,9 +121,7 @@
|
||||
|
||||
/mob/zshadow/set_typing_indicator(var/state)
|
||||
if(!typing_indicator)
|
||||
typing_indicator = new
|
||||
typing_indicator.icon = 'icons/mob/talk.dmi' // Looks better on the right with job icons.
|
||||
typing_indicator.icon_state = "typing"
|
||||
init_typing_indicator("typing")
|
||||
if(state && !typing)
|
||||
overlays += typing_indicator
|
||||
typing = 1
|
||||
|
||||
Reference in New Issue
Block a user