From e2980a5c4802278b74f1d1aebc568d6889f6d9bb Mon Sep 17 00:00:00 2001 From: Cameron Lennox Date: Mon, 7 Apr 2025 05:10:40 -0400 Subject: [PATCH] Resizing & better runechat (#17384) * Resizing & better runechat Sprite decals also adjusted. Now get generated BEFORE tummies, so they don't overlay over stomachs. * no world * Update resize_vr.dm * else * n dent * Update resize_vr.dm * always allow 100% size * no breaking the cap without admin intervention --- code/datums/chat_message.dm | 10 +++++++++- code/modules/mob/living/login.dm | 3 +-- code/modules/mob/living/silicon/robot/robot.dm | 14 +++++++------- .../mob/living/silicon/robot/robot_ui_module.dm | 1 + code/modules/vore/resizing/resize_vr.dm | 12 +++++++++++- 5 files changed, 29 insertions(+), 11 deletions(-) diff --git a/code/datums/chat_message.dm b/code/datums/chat_message.dm index bbf9a35a72b..8b15ba87a60 100644 --- a/code/datums/chat_message.dm +++ b/code/datums/chat_message.dm @@ -459,9 +459,17 @@ var/list/runechat_image_cache = list() return (width - bound_width) * -0.5 */ -/mob/runechat_y_offset() +/mob/runechat_y_offset(var/consider_height) + if(consider_height) + return ..() return ..()*size_multiplier +/mob/living/runechat_y_offset(var/consider_height) + var/size_diff = vis_height - world.icon_size + if(size_diff > 0) + return (..(TRUE) + size_diff) * size_multiplier + return ..(FALSE) + // Allows you to specify a different attachment point for messages from yourself /atom/proc/runechat_holder(datum/chatmessage/CM) return src diff --git a/code/modules/mob/living/login.dm b/code/modules/mob/living/login.dm index 16d7589bdbe..2ed3503585b 100644 --- a/code/modules/mob/living/login.dm +++ b/code/modules/mob/living/login.dm @@ -38,13 +38,12 @@ add_verb(src,/mob/proc/nme_vore_ch) add_verb(src,/mob/proc/enter_soulcatcher) - //VOREStation Add Start if(!voice_sounds_list.len || !voice_sounds_list) if(client.prefs.voice_sound) var/prefsound = client.prefs.voice_sound voice_sounds_list = get_talk_sound(prefsound) else voice_sounds_list = talk_sound - //VOREStation Add End + resize(size_multiplier, animate = FALSE, uncapped = has_large_resize_bounds(), ignore_prefs = TRUE, aura_animation = FALSE) return . diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index c270e623f8c..360503baf6f 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -992,6 +992,13 @@ add_overlay(mutable_appearance(sprite_datum.sprite_icon, sprite_datum.get_glow_overlay(src))) add_overlay(emissive_appearance(sprite_datum.sprite_icon, sprite_datum.get_glow_overlay(src))) + if(robotdecal_on.len && LAZYLEN(sprite_datum.sprite_decals)) + if(!shell || deployed) // Shell borgs that are not deployed will have no eyes. + for(var/enabled_decal in robotdecal_on) + var/robotdecal_overlay = sprite_datum.get_robotdecal_overlay(src, enabled_decal) + if(robotdecal_overlay) + add_overlay(robotdecal_overlay) + if(stat == CONSCIOUS) update_fullness() for(var/belly_class in vore_fullness_ex) @@ -1037,13 +1044,6 @@ if(eyes_overlay) add_overlay(eyes_overlay) - if(robotdecal_on.len && LAZYLEN(sprite_datum.sprite_decals)) - if(!shell || deployed) // Shell borgs that are not deployed will have no eyes. - for(var/enabled_decal in robotdecal_on) - var/robotdecal_overlay = sprite_datum.get_robotdecal_overlay(src, enabled_decal) - if(robotdecal_overlay) - add_overlay(robotdecal_overlay) - if(lights_on && sprite_datum.has_eye_light_sprites) if(!shell || deployed) // Shell borgs that are not deployed will have no eyes. var/eyes_overlay = sprite_datum.get_eye_light_overlay(src) diff --git a/code/modules/mob/living/silicon/robot/robot_ui_module.dm b/code/modules/mob/living/silicon/robot/robot_ui_module.dm index 20d2bde47e3..d7397831c4e 100644 --- a/code/modules/mob/living/silicon/robot/robot_ui_module.dm +++ b/code/modules/mob/living/silicon/robot/robot_ui_module.dm @@ -171,6 +171,7 @@ sprite_type = sprite_datum.name /mob/living/silicon/robot/proc/transform_module() + resize(size_multiplier, animate = FALSE) //Gets the size down to a normal size. transform_with_anim() var/tempheight = vis_height update_icon() diff --git a/code/modules/vore/resizing/resize_vr.dm b/code/modules/vore/resizing/resize_vr.dm index 93f28b3cd82..4a4ad92b973 100644 --- a/code/modules/vore/resizing/resize_vr.dm +++ b/code/modules/vore/resizing/resize_vr.dm @@ -86,9 +86,19 @@ * * 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 var/datum/component/resize_guard/guard = GetComponent(/datum/component/resize_guard) if(guard) qdel(guard) @@ -130,7 +140,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