Skip to content

Commit

Permalink
Merge pull request #968 from SPLURT-Station/macro-supremacy
Browse files Browse the repository at this point in the history
Ports the sharp/fuzzy character scaling option
  • Loading branch information
MosleyTheMalO authored Oct 3, 2023
2 parents ad78330 + 35352aa commit d479eb2
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 2 deletions.
4 changes: 4 additions & 0 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
mutant_colors = TRUE

dat += "<b>Sprite Size:</b> <a href='?_src_=prefs;preference=body_size;task=input'>[features["body_size"]*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 @@ -3219,6 +3220,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(new_body_size)
features["body_size"] = clamp(new_body_size * 0.01, CONFIG_GET(number/body_size_min), CONFIG_GET(number/body_size_max))

if("toggle_fuzzy")
fuzzy = !fuzzy

if("tongue")
var/selected_custom_tongue = input(user, "Choose your desired tongue (none means your species tongue)", "Character Preference") as null|anything in GLOB.roundstart_tongues
if(selected_custom_tongue)
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/transform_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@
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
6 changes: 6 additions & 0 deletions modular_splurt/code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
var/directory_tag = "Unset" //Sorting tag to use in character directory
var/directory_erptag = "Unset" //ditto, but for non-vore scenes
var/directory_ad = "" //Advertisement stuff to show in character directory.
var/fuzzy = FALSE //Fuzzy scaling

/datum/preferences/New(client/C)
// Check if readable fluids list exists
Expand All @@ -35,6 +36,10 @@

. = ..()

/datum/preferences/copy_to(mob/living/carbon/human/character, icon_updates, roundstart_checks, initial_spawn)
character.fuzzy = fuzzy
. = ..()

/datum/preferences/ShowChoices(mob/user)
//check if the player wants to use the new character creation menu
if(new_character_creator)
Expand Down Expand Up @@ -262,6 +267,7 @@
mutant_colors = TRUE

dat += "<b>Sprite Size:</b> <a href='?_src_=prefs;preference=body_size;task=input'>[features["body_size"]*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
13 changes: 11 additions & 2 deletions modular_splurt/code/modules/client/preferences_savefile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@
S["directory_erptag"] >> directory_erptag
S["directory_ad"] >> directory_ad

// Get stomping preferences.
S["stomp_pref"] >> stomppref

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

//sanitize data
show_in_directory = sanitize_integer(show_in_directory, 0, 1, initial(show_in_directory))
directory_tag = sanitize_inlist(directory_tag, GLOB.char_directory_tags, initial(directory_tag))
directory_erptag = sanitize_inlist(directory_erptag, GLOB.char_directory_erptags, initial(directory_erptag))
directory_ad = strip_html_simple(directory_ad, MAX_FLAVOR_LEN)
// Get stomping preferences.
S["stomp_pref"] >> stomppref
stomppref = sanitize_integer(stomppref, 0, 1, initial(stomppref))
fuzzy = sanitize_integer(fuzzy, 0, 1, initial(fuzzy))

/datum/preferences/proc/splurt_character_pref_save(savefile/S) //TODO: modularize our other savefile edits... maybe?
//Character directory
Expand All @@ -23,6 +29,9 @@
// Stomping preferences.
WRITE_FILE(S["stomp_pref"], stomppref)

//Fuzzy scaling
WRITE_FILE(S["feature_fuzzy"] , fuzzy)

/datum/preferences/update_preferences(current_version, savefile/S)
. = ..()
if(current_version < 57.01) //a
Expand Down
6 changes: 6 additions & 0 deletions modular_splurt/code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,9 @@
to_chat(src, "<span class='danger'>I break free off [pulledby]'s grip!</span>")
return TRUE

/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
1 change: 1 addition & 0 deletions modular_splurt/code/modules/mob/living/living_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
// Admin CC
var/admin_frozen = FALSE
var/admin_sleeping = FALSE
var/fuzzy = FALSE
5 changes: 5 additions & 0 deletions modular_splurt/code/modules/mob/living/update_icons.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/mob/living/update_transform(do_animate)
appearance_flags |= PIXEL_SCALE
if(fuzzy)
appearance_flags &= ~PIXEL_SCALE
. = ..()
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -4807,6 +4807,7 @@
#include "modular_splurt\code\modules\mob\living\logout.dm"
#include "modular_splurt\code\modules\mob\living\navigation.dm"
#include "modular_splurt\code\modules\mob\living\say.dm"
#include "modular_splurt\code\modules\mob\living\update_icons.dm"
#include "modular_splurt\code\modules\mob\living\brain\brain_item.dm"
#include "modular_splurt\code\modules\mob\living\carbon\carbon.dm"
#include "modular_splurt\code\modules\mob\living\carbon\carbon_defense.dm"
Expand Down

0 comments on commit d479eb2

Please sign in to comment.