Skip to content

Commit

Permalink
Merge pull request #3268 from ARF-SS13/do-what-fenny-couldnt
Browse files Browse the repository at this point in the history
Add fuzzy scaling
  • Loading branch information
Tk420634 authored Oct 4, 2023
2 parents bfd74ec + 657d448 commit 9f333b4
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 0 deletions.
7 changes: 7 additions & 0 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
/// Versioning hack! Versioning hack! Versioning hack!
var/list/current_version = list()

var/fuzzy = FALSE //Fuzzy scaling


/datum/preferences/New(client/C)
parent = C
Expand Down Expand Up @@ -635,6 +637,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "<b>Sprite Size:</b> <a href='?_src_=prefs;preference=body_size;task=input'>[features["body_size"]*100]%</a><br>"
if (CONFIG_GET(number/body_width_min) != CONFIG_GET(number/body_width_max))
dat += "<b>Sprite Width:</b> <a href='?_src_=prefs;preference=body_width;task=input'>[features["body_width"]*100]%</a><br>"
dat += "<b>Scaled Appearance:</b> <a href='?_src_=prefs;preference=toggle_fuzzy;task=input'>[fuzzy ? "Fuzzy" : "Sharp"]</a><br>"

if(!(NOEYES in pref_species.species_traits))
dat += "<h3>Eye Type</h3>"
Expand Down Expand Up @@ -3343,6 +3346,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(dorfy != "No")
features["body_size"] = new_body_size

if("toggle_fuzzy")
fuzzy = !fuzzy

if("body_width")
var/min = CONFIG_GET(number/body_width_min)
var/max = CONFIG_GET(number/body_width_max)
Expand Down Expand Up @@ -3911,6 +3917,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
character.special_i = special_i
character.special_a = special_a
character.special_l = special_l
character.fuzzy = fuzzy

character.left_eye_color = left_eye_color
character.right_eye_color = right_eye_color
Expand Down
8 changes: 8 additions & 0 deletions code/modules/client/preferences_savefile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,10 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["body_model"] >> features["body_model"]
S["body_size"] >> features["body_size"]
S["body_width"] >> features["body_width"]

//Fuzzy scaling
S["feature_fuzzy"] >> fuzzy

S["age"] >> age
S["hair_color"] >> hair_color
S["facial_hair_color"] >> facial_hair_color
Expand Down Expand Up @@ -951,6 +955,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
width_max = CONFIG_GET(number/body_width_max)
features["body_width"] = sanitize_num_clamp(features["body_width"], width_min, width_max, RESIZE_DEFAULT_SIZE, 0.01)

fuzzy = sanitize_integer(fuzzy, 0, 1, initial(fuzzy))

var/static/list/B_sizes
if(!B_sizes)
var/list/L = CONFIG_GET(keyed_list/breasts_cups_prefs)
Expand Down Expand Up @@ -1119,6 +1125,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
"Mobility - Can not Run",
)
WRITE_FILE(S["all_quirks"], debug_oldies)

WRITE_FILE(S["feature_fuzzy"], fuzzy)

matchmaking_prefs = sanitize_matchmaking_prefs(matchmaking_prefs)

Expand Down
7 changes: 7 additions & 0 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1561,3 +1561,10 @@
ghostize()
qdel(src)
//End Coyote Add

/mob/living/verb/switch_scaling()
set name = "Switch scaling mode"
set category = "IC"
set desc = "Switch sharp/fuzzy scaling for current mob."
appearance_flags ^= PIXEL_SCALE
fuzzy = !fuzzy
2 changes: 2 additions & 0 deletions code/modules/mob/living/living_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,5 @@
//---End

var/disconnect_time //how long have we been dc'd for

var/fuzzy = FALSE
2 changes: 2 additions & 0 deletions code/modules/mob/living/update_icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
var/changed = 0

appearance_flags |= PIXEL_SCALE
if(fuzzy)
appearance_flags &= ~PIXEL_SCALE

if(lying != lying_prev && rotate_on_lying)
changed++
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/transform_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@
if(R.mmi.brainmob)
R.mmi.brainmob.real_name = real_name //the name of the brain inside the cyborg is the robotized human's name.
R.mmi.brainmob.name = real_name
R.fuzzy = fuzzy //SPLURT ADD - FUZZY

R.job = "Cyborg"
R.notify_ai(NEW_BORG)
Expand Down

0 comments on commit 9f333b4

Please sign in to comment.