From d12da443e6aab58c47a59d4f94ee144fb71a4f1b Mon Sep 17 00:00:00 2001 From: CHOMPStation2 <58959929+CHOMPStation2@users.noreply.github.com> Date: Fri, 17 Nov 2023 15:47:30 -0700 Subject: [PATCH] [MIRROR] Scaling Center Up-port (#7232) Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Co-authored-by: Selis --- .../client/preference_setup/vore/02_size.dm | 14 +++++++------- code/modules/mob/living/carbon/human/human.dm | 2 +- .../living/carbon/human/species/species_vr.dm | 2 +- .../carbon/human/species/station/teshari.dm | 2 +- .../mob/living/carbon/human/update_icons.dm | 14 +++++++------- code/modules/mob/living/living.dm | 16 +++++++++++----- code/modules/mob/living/login.dm | 2 +- code/modules/vore/eating/living_vr.dm | 4 ++-- code/modules/vore/resizing/resize_vr.dm | 12 ++++++------ 9 files changed, 37 insertions(+), 31 deletions(-) diff --git a/code/modules/client/preference_setup/vore/02_size.dm b/code/modules/client/preference_setup/vore/02_size.dm index 567d17c87b..c047003b50 100644 --- a/code/modules/client/preference_setup/vore/02_size.dm +++ b/code/modules/client/preference_setup/vore/02_size.dm @@ -14,7 +14,7 @@ var/weight_gain = 100 // Weight gain rate. var/weight_loss = 50 // Weight loss rate. var/fuzzy = 0 // Preference toggle for sharp/fuzzy icon. Default sharp. - var/offset_override = FALSE //CHOMPEdit + var/offset_override = FALSE var/voice_freq = 42500 //CHOMPEdit - Why was the default 0 var/voice_sound = "goon speak 1" //CHOMPEdit - Changed the default voice to one less jarring var/custom_speech_bubble = "default" @@ -31,7 +31,7 @@ S["weight_gain"] >> pref.weight_gain S["weight_loss"] >> pref.weight_loss S["fuzzy"] >> pref.fuzzy - S["offset_override"] >> pref.offset_override //CHOMPEdit + S["offset_override"] >> pref.offset_override S["voice_freq"] >> pref.voice_freq S["voice_sound"] >> pref.voice_sound S["custom_speech_bubble"] >> pref.custom_speech_bubble @@ -43,7 +43,7 @@ S["weight_gain"] << pref.weight_gain S["weight_loss"] << pref.weight_loss S["fuzzy"] << pref.fuzzy - S["offset_override"] << pref.offset_override //CHOMPEdit + S["offset_override"] << pref.offset_override S["voice_freq"] << pref.voice_freq S["voice_sound"] << pref.voice_sound S["custom_speech_bubble"] << pref.custom_speech_bubble @@ -55,7 +55,7 @@ pref.weight_gain = sanitize_integer(pref.weight_gain, WEIGHT_CHANGE_MIN, WEIGHT_CHANGE_MAX, initial(pref.weight_gain)) pref.weight_loss = sanitize_integer(pref.weight_loss, WEIGHT_CHANGE_MIN, WEIGHT_CHANGE_MAX, initial(pref.weight_loss)) pref.fuzzy = sanitize_integer(pref.fuzzy, 0, 1, initial(pref.fuzzy)) - pref.offset_override = sanitize_integer(pref.offset_override, 0, 1, initial(pref.offset_override)) //CHOMPEdit + pref.offset_override = sanitize_integer(pref.offset_override, 0, 1, initial(pref.offset_override)) if(pref.voice_freq != 0) pref.voice_freq = sanitize_integer(pref.voice_freq, MIN_VOICE_FREQ, MAX_VOICE_FREQ, initial(pref.voice_freq)) //CHOMPEdit if(pref.size_multiplier == null || pref.size_multiplier < RESIZE_TINY || pref.size_multiplier > RESIZE_HUGE) @@ -71,7 +71,7 @@ character.weight_gain = pref.weight_gain character.weight_loss = pref.weight_loss character.fuzzy = pref.fuzzy - character.offset_override = pref.offset_override //CHOMPEdit + character.offset_override = pref.offset_override character.voice_freq = pref.voice_freq character.resize(pref.size_multiplier, animate = FALSE, ignore_prefs = TRUE) @@ -119,7 +119,7 @@ . += "
" . += "Scale: [round(pref.size_multiplier*100)]%
" . += "Scaled Appearance: [pref.fuzzy ? "Fuzzy" : "Sharp"]
" - . += "Scaling Center: [pref.offset_override ? "Odd" : "Even"]
" //CHOMPEdit + . += "Scaling Center: [pref.offset_override ? "Odd" : "Even"]
" . += "
" // CHOMPEdit: Fancy:tm: . += "Mob Speech/Noise Customization" // CHOMPEdit: Fancy:tm: . += "
" // CHOMPEdit @@ -159,7 +159,7 @@ pref.fuzzy = pref.fuzzy ? 0 : 1; return TOPIC_REFRESH_UPDATE_PREVIEW - else if(href_list["toggle_offset_override"]) //CHOMPEdit + else if(href_list["toggle_offset_override"]) pref.offset_override = pref.offset_override ? 0 : 1; return TOPIC_REFRESH_UPDATE_PREVIEW diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 7356c85277..087365e093 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1254,7 +1254,7 @@ default_pixel_y = initial(pixel_y) + species.pixel_offset_y pixel_x = default_pixel_x pixel_y = default_pixel_y - center_offset = species.center_offset //CHOMPEdit + center_offset = species.center_offset if(LAZYLEN(descriptors)) descriptors = null diff --git a/code/modules/mob/living/carbon/human/species/species_vr.dm b/code/modules/mob/living/carbon/human/species/species_vr.dm index d3bf41bce5..c6986f2048 100644 --- a/code/modules/mob/living/carbon/human/species/species_vr.dm +++ b/code/modules/mob/living/carbon/human/species/species_vr.dm @@ -38,7 +38,7 @@ var/micro_size_mod = 0 // How different is our size for interactions that involve us being small? var/macro_size_mod = 0 // How different is our size for interactions that involve us being big? var/digestion_nutrition_modifier = 1 - var/center_offset = 0.5 //CHOMPEdit + var/center_offset = 0.5 var/can_climb = FALSE var/climbing_delay = 1.5 // We climb with a quarter delay diff --git a/code/modules/mob/living/carbon/human/species/station/teshari.dm b/code/modules/mob/living/carbon/human/species/station/teshari.dm index 4931596e52..ad1e1a3639 100644 --- a/code/modules/mob/living/carbon/human/species/station/teshari.dm +++ b/code/modules/mob/living/carbon/human/species/station/teshari.dm @@ -29,8 +29,8 @@ //CHOMPStation Add. Y'know I should probably just put this upstream. // male_scream_sound = 'sound/effects/mob_effects/teshariscream.ogg' // female_scream_sound = 'sound/effects/mob_effects/teshariscream.ogg' - center_offset = 0 //CHOMPEdit //CHOMPStation Add End + center_offset = 0 blood_color = "#D514F7" flesh_color = "#5F7BB0" diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 42459323f3..cbdf80c1eb 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -125,7 +125,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() //Do any species specific layering updates, such as when hiding. update_icon_special() -/mob/living/carbon/human/update_transform(var/instant = FALSE) //CHOMPEdit +/mob/living/carbon/human/update_transform(var/instant = FALSE) /* VOREStation Edit START // First, get the correct size. var/desired_scale_x = icon_scale_x @@ -144,9 +144,9 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() var/desired_scale_y = size_multiplier * icon_scale_y desired_scale_x *= species.icon_scale_x desired_scale_y *= species.icon_scale_y - var/cent_offset = species.center_offset //CHOMPEdit - if(fuzzy || offset_override || dir == EAST || dir == WEST) //CHOMPEdit - cent_offset = 0 //CHOMPEdit + var/cent_offset = species.center_offset + if(fuzzy || offset_override || dir == EAST || dir == WEST) + cent_offset = 0 vis_height = species.icon_height appearance_flags |= PIXEL_SCALE if(fuzzy) @@ -182,15 +182,15 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() layer = MOB_LAYER -0.01 // Fix for a byond bug where turf entry order no longer matters else M.Scale(desired_scale_x, desired_scale_y)//VOREStation Edit - M.Translate(cent_offset * desired_scale_x, (vis_height/2)*(desired_scale_y-1)) //CHOMPEdit + M.Translate(cent_offset * desired_scale_x, (vis_height/2)*(desired_scale_y-1)) if(tail_style?.can_loaf) // VOREStation Edit: Taur Loafing update_tail_showing() // VOREStation Edit: Taur Loafing layer = MOB_LAYER // Fix for a byond bug where turf entry order no longer matters - if(instant) //CHOMPEdit Start + if(instant) transform = M else - animate(src, transform = M, time = anim_time) //CHOMPEdit End + animate(src, transform = M, time = anim_time) update_icon_special() //May contain transform-altering things //DAMAGE OVERLAYS diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 396e5b6e16..f861987de7 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1035,17 +1035,18 @@ if(!isnull(M.icon_scale_y_percent)) . *= M.icon_scale_y_percent -/mob/living/update_transform(var/instant = FALSE) //CHOMPEdit +/mob/living/update_transform(var/instant = FALSE) // First, get the correct size. var/desired_scale_x = size_multiplier * icon_scale_x //VOREStation edit var/desired_scale_y = size_multiplier * icon_scale_y //VOREStation edit - var/cent_offset = center_offset //CHOMPEdit + var/cent_offset = center_offset + // Now for the regular stuff. - if(fuzzy || offset_override || dir == EAST || dir == WEST) //CHOMPEdit - cent_offset = 0 //CHOMPEdit + if(fuzzy || offset_override || dir == EAST || dir == WEST) + cent_offset = 0 var/matrix/M = matrix() M.Scale(desired_scale_x, desired_scale_y) - M.Translate(cent_offset * desired_scale_x, (vis_height/2)*(desired_scale_y-1)) //CHOMPEdit + M.Translate(cent_offset * desired_scale_x, (vis_height/2)*(desired_scale_y-1)) src.transform = M //VOREStation edit handle_status_indicators() @@ -1330,3 +1331,8 @@ icon = 'icons/mob/screen/midnight.dmi' icon_state = "character" screen_loc = ui_smallquad + +/mob/living/set_dir(var/new_dir) + . = ..() + if(size_multiplier != 1 || icon_scale_x != 1 && center_offset > 0) + update_transform(TRUE) diff --git a/code/modules/mob/living/login.dm b/code/modules/mob/living/login.dm index 062bc6c800..c00f3d6b5b 100644 --- a/code/modules/mob/living/login.dm +++ b/code/modules/mob/living/login.dm @@ -19,8 +19,8 @@ verbs |= /mob/living/proc/lick verbs |= /mob/living/proc/smell verbs |= /mob/living/proc/switch_scaling + verbs |= /mob/living/proc/center_offset verbs |= /mob/living/proc/mute_entry //CHOMPEdit - verbs |= /mob/living/proc/center_offset //CHOMPEdit verbs |= /mob/living/proc/liquidbelly_visuals //CHOMPEdit verbs |= /mob/living/proc/fix_vore_effects //CHOMPedit diff --git a/code/modules/vore/eating/living_vr.dm b/code/modules/vore/eating/living_vr.dm index 3607582b0f..7c66961ab3 100644 --- a/code/modules/vore/eating/living_vr.dm +++ b/code/modules/vore/eating/living_vr.dm @@ -1064,9 +1064,9 @@ set desc = "Switch sharp/fuzzy scaling for current mob." appearance_flags ^= PIXEL_SCALE fuzzy = !fuzzy - update_transform() //CHOMPEdit + update_transform() -/mob/living/proc/center_offset() //CHOMPAdd +/mob/living/proc/center_offset() set name = "Switch center offset mode" set category = "Preferences" set desc = "Switch sprite center offset to fix even/odd symmetry." diff --git a/code/modules/vore/resizing/resize_vr.dm b/code/modules/vore/resizing/resize_vr.dm index 5f108ed7dc..6fb4e1a73d 100644 --- a/code/modules/vore/resizing/resize_vr.dm +++ b/code/modules/vore/resizing/resize_vr.dm @@ -3,12 +3,12 @@ /mob var/step_mechanics_pref = TRUE // Allow participation in macro-micro step mechanics var/pickup_pref = TRUE // Allow participation in macro-micro pickup mechanics + var/center_offset = 0.5 // Center offset for uneven scaling symmetry. + var/offset_override = FALSE // Pref toggle for center offset. /mob/living var/holder_default var/pickup_active = TRUE // Toggle whether your help intent picks up micros or pets them - var/center_offset = 0.5 // Center offset for uneven scaling symmetry. //CHOMPEdit - var/offset_override = FALSE // Pref toggle for center offset. //CHOMPEdit // Define holder_type on types we want to be scoop-able /mob/living/carbon/human @@ -32,12 +32,12 @@ /mob/living/update_icons() . = ..() ASSERT(!ishuman(src)) - var/cent_offset = center_offset //ChompEDIT - if(fuzzy || offset_override || dir == EAST || dir == WEST) //CHOMPEdit - cent_offset = 0 //CHOMPEdit + var/cent_offset = center_offset + if(fuzzy || offset_override || dir == EAST || dir == WEST) + cent_offset = 0 var/matrix/M = matrix() M.Scale(size_multiplier * icon_scale_x, size_multiplier * icon_scale_y) - M.Translate(cent_offset * size_multiplier * icon_scale_x, (vis_height/2)*(size_multiplier-1)) //CHOMPEdit + M.Translate(cent_offset * size_multiplier * icon_scale_x, (vis_height/2)*(size_multiplier-1)) transform = M /**