From c186b9daaecd008e66ec37efe973b78f3441dd66 Mon Sep 17 00:00:00 2001 From: Zattarra Date: Sat, 29 Jul 2023 18:39:00 -0700 Subject: [PATCH] Switches the pref to be a boolean, switches the checks to be booleans, adds stomptext to even display the thing, and also hopefully saves the pref. --- code/datums/elements/flavor_text.dm | 2 +- code/modules/client/preferences.dm | 11 ++++++----- modular_splurt/code/modules/client/preferences.dm | 3 ++- .../code/modules/client/preferences_savefile.dm | 5 +++++ modular_splurt/code/modules/resize/resizing.dm | 2 +- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/code/datums/elements/flavor_text.dm b/code/datums/elements/flavor_text.dm index 821092c217..af529e6f0a 100644 --- a/code/datums/elements/flavor_text.dm +++ b/code/datums/elements/flavor_text.dm @@ -105,7 +105,7 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code else content += "\n" - if(L.client.prefs.stomppref == "Yes") + if(L.client.prefs.stomppref == TRUE) content += " | Stomping Interactions: [L.client.prefs.stomppref]\n" else content += "\n" diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index c45bc90827..2a7bbb16da 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1524,7 +1524,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "? " dat += "Unholy ERP verbs : [unholypref]
" //https://www.youtube.com/watch?v=OHKARc-GObU dat += "? " - dat += "Stomping Interactions : [stomppref]
" + dat += "Stomping Interactions : [stomptext]
" //END OF SPLURT EDIT //SKYRAT EDIT dat += "? " //SPLURT Edit (wow! editception???) @@ -3515,10 +3515,11 @@ GLOBAL_LIST_EMPTY(preferences_datums) unholypref = "Yes" if("stomppref") // What the fuck is this? switch(stomppref) - if("Yes") - stomppref = "No" - if("No") - stomppref = "Yes" + if(TRUE) + stomptext = "No" + if(FALSE) + stomptext = "Yes" + stomppref = !stomppref //Skyrat edit - *someone* offered me actual money for this shit if("extremepref") //i hate myself for doing this switch(extremepref) //why the fuck did this need to use cycling instead of input from a list diff --git a/modular_splurt/code/modules/client/preferences.dm b/modular_splurt/code/modules/client/preferences.dm index 0c13ba15c3..230822467f 100644 --- a/modular_splurt/code/modules/client/preferences.dm +++ b/modular_splurt/code/modules/client/preferences.dm @@ -6,7 +6,8 @@ /datum/preferences max_save_slots = DEFAULT_SAVE_SLOTS var/unholypref = "No" //Goin 2 hell fo dis one - var/stomppref = "No" // Please step on me. + var/stomppref = FALSE // Please step on me. + var/stomptext = "No" // For displaying the pref. var/list/gfluid_blacklist = list() //Stuff you don't want people to cum into you var/new_character_creator = TRUE // old/new character creator var/show_in_directory = 1 //Show in Character Directory diff --git a/modular_splurt/code/modules/client/preferences_savefile.dm b/modular_splurt/code/modules/client/preferences_savefile.dm index deda14d0e1..cb79fb77be 100644 --- a/modular_splurt/code/modules/client/preferences_savefile.dm +++ b/modular_splurt/code/modules/client/preferences_savefile.dm @@ -10,6 +10,8 @@ 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. + stomppref = S["stomp_pref"] /datum/preferences/proc/splurt_character_pref_save(savefile/S) //TODO: modularize our other savefile edits... maybe? //Character directory @@ -18,6 +20,9 @@ WRITE_FILE(S["directory_erptag"], directory_erptag) WRITE_FILE(S["directory_ad"], directory_ad) + // Stomping preferences. + WRITE_FILE(S["stomp_pref"], stomppref) + /datum/preferences/update_preferences(current_version, savefile/S) . = ..() if(current_version < 57.01) //a diff --git a/modular_splurt/code/modules/resize/resizing.dm b/modular_splurt/code/modules/resize/resizing.dm index 1cfa1d617a..f10799ca77 100644 --- a/modular_splurt/code/modules/resize/resizing.dm +++ b/modular_splurt/code/modules/resize/resizing.dm @@ -1,6 +1,6 @@ /mob/living/handle_micro_bump_other(mob/living/target) // If the target has the preference off, stop the interaction. - if(target.client.prefs.stomppref == "No") + if(target.client.prefs.stomppref == FALSE) return FALSE // Do the rest of the function normally.