fix runechat offset (#17510)

* don't double this

* .

* urg

* always use if defined

* eh

* tgui window from tg

* skip on char select

* rh

* .

* move to config
This commit is contained in:
Kashargul
2025-04-11 17:10:37 +02:00
committed by GitHub
parent 55306c47c3
commit a97ded5b3b
10 changed files with 78 additions and 41 deletions
+10 -12
View File
@@ -86,19 +86,17 @@
* * ignore_prefs - CHANGE_ME. Default: FALSE
* * aura_animation - CHANGE_ME. Default: TRUE
*/
//#define USE_DIRECT_MULTIPLIERS //Uncomment to use old resize calculations.
/mob/living/proc/resize(var/new_size, var/animate = TRUE, var/uncapped = FALSE, var/ignore_prefs = FALSE, var/aura_animation = TRUE)
if(!uncapped)
#ifdef USE_DIRECT_MULTIPLIERS
new_size = clamp(new_size, RESIZE_MINIMUM, RESIZE_MAXIMUM)
#else
var/size_diff = ((runechat_y_offset() / size_multiplier) * new_size) // This returns 32 multiplied with the new size
var/size_cap = world.icon_size * (RESIZE_MAXIMUM+(ishuman(src)?0:0.5)) //Grace for non-humanoids so they don't get forcibly shrunk.
if(size_diff - size_cap > 0)
var/real_diff = size_cap / size_diff // Returns our diff based on the offset to world size
new_size *= real_diff // Applies our diff to the new size
new_size = clamp(new_size, RESIZE_MINIMUM, RESIZE_MAXIMUM) //If the sprite is below 32, we clamp it to only go to the resize max.
#endif
if((z in using_map.station_levels) && CONFIG_GET(flag/pixel_size_limit))
var/size_diff = ((runechat_y_offset() / size_multiplier) * new_size) // This returns 32 multiplied with the new size
var/size_cap = world.icon_size * RESIZE_MAXIMUM //Grace for non-humanoids so they don't get forcibly shrunk.
if(size_diff - size_cap > 0)
var/real_diff = size_cap / size_diff // Returns our diff based on the offset to world size
new_size *= real_diff // Applies our diff to the new size
new_size = clamp(new_size, RESIZE_MINIMUM, RESIZE_MAXIMUM) //If the sprite is below 32, we clamp it to only go to the resize max.
else
new_size = clamp(new_size, RESIZE_MINIMUM, RESIZE_MAXIMUM)
var/datum/component/resize_guard/guard = GetComponent(/datum/component/resize_guard)
if(guard)
qdel(guard)
@@ -140,7 +138,7 @@
animate_aura(src, color = aura_color, offset = aura_offset, anim_duration = aura_anim_duration, loops = aura_loops, grow_to = aura_grow_to)
else
update_transform() //Lame way
//#undef USE_DIRECT_MULTIPLIERS //Uncomment to use old resize calculations.
/mob/living/carbon/human/resize(var/new_size, var/animate = TRUE, var/uncapped = FALSE, var/ignore_prefs = FALSE, var/aura_animation = TRUE)
if(!resizable && !ignore_prefs)
return 1