From 6cdc1dcdee9b3f90a13e122c8e467b81eba64797 Mon Sep 17 00:00:00 2001 From: Pin-alternative Date: Wed, 25 Jan 2023 19:20:58 +1100 Subject: [PATCH] axe the code --- .../interactions/interaction_interface.dm | 4 + .../datums/genitals/genitals_interface.dm | 20 +- .../tgui/interfaces/GenitalConfig.tsx | 22 +- .../tgui/interfaces/MobInteraction.tsx | 213 +----------------- 4 files changed, 32 insertions(+), 227 deletions(-) diff --git a/modular_sand/code/datums/interactions/interaction_interface.dm b/modular_sand/code/datums/interactions/interaction_interface.dm index 2d7f794132..fefd107f8d 100644 --- a/modular_sand/code/datums/interactions/interaction_interface.dm +++ b/modular_sand/code/datums/interactions/interaction_interface.dm @@ -101,6 +101,7 @@ sent_interactions += list(interaction) .["interactions"] = sent_interactions + /* //Get their genitals var/list/genitals = list() var/mob/living/carbon/get_genitals = self @@ -184,6 +185,7 @@ genital_entry["equipments"] = equipment_names genital_interactibles += list(genital_entry) .["genital_interactibles"] = genital_interactibles + */ var/datum/preferences/prefs = self?.client.prefs if(prefs) @@ -237,6 +239,7 @@ o.do_action(usr, target) return TRUE return FALSE + /* if("genital") var/mob/living/carbon/self = usr if("visibility" in params) @@ -300,6 +303,7 @@ user.transferItemToLoc(get_turf(user)) return TRUE return FALSE + */ if("char_pref") var/datum/preferences/prefs = usr.client.prefs var/value = num_to_pref(params["value"]) diff --git a/modular_splurt/code/datums/genitals/genitals_interface.dm b/modular_splurt/code/datums/genitals/genitals_interface.dm index 2f4202afed..fa7f8f2df7 100644 --- a/modular_splurt/code/datums/genitals/genitals_interface.dm +++ b/modular_splurt/code/datums/genitals/genitals_interface.dm @@ -3,7 +3,7 @@ set name = "Genitals Menu" set desc = "Manage your genital, or someone else's." set category = "IC" - set src in oview(1) + set src in view(usr.client) if(!iscarbon(usr)) return @@ -37,9 +37,9 @@ /datum/genitals_menu/ui_data(mob/user) . = ..() - var/mob/living/carbon/genital_holder = target - var/user_is_target = target == self - .["isTargetSelf"] = user_is_target + var/mob/living/carbon/genital_holder = target || user + var/user_is_target = genital_holder == user + .["istargetself"] = user_is_target var/list/genitals = list() for(var/obj/item/organ/genital/genital in genital_holder.internal_organs) //Only get the genitals if(CHECK_BITFIELD(genital.genital_flags, GENITAL_INTERNAL)) //Not those though @@ -122,6 +122,8 @@ switch(action) if("genital") var/mob/living/carbon/self = usr + if(self != target) + return FALSE if("visibility" in params) if(params["genital"] == "anus") self.anus_toggle_visibility(params["visibility"]) @@ -164,15 +166,19 @@ else return FALSE if("equipment") + var/mob/living/carbon/actual_target = target || usr var/mob/living/carbon/self = usr - var/obj/item/organ/genital/genital = locate(params["genital"], self.internal_organs) - if(!(genital && (genital in self.internal_organs))) + if(get_dist(actual_target, self) > 1) + to_chat(self, span_warning("You're too far away!")) + return FALSE + var/obj/item/organ/genital/genital = locate(params["genital"], actual_target.internal_organs) + if(!(genital && (genital in actual_target.internal_organs))) return FALSE switch(params["equipment_action"]) if("remove") var/obj/item/selected_item = locate(params["equipment"], genital.contents) if(selected_item) - if(!do_mob(self, self, 5 SECONDS)) + if(!do_mob(self, actual_target, 5 SECONDS)) return FALSE if(!self.put_in_hands(selected_item)) self.transferItemToLoc(get_turf(self)) diff --git a/tgui/packages/tgui/interfaces/GenitalConfig.tsx b/tgui/packages/tgui/interfaces/GenitalConfig.tsx index 1c4e9b83c1..c02e148857 100644 --- a/tgui/packages/tgui/interfaces/GenitalConfig.tsx +++ b/tgui/packages/tgui/interfaces/GenitalConfig.tsx @@ -84,16 +84,18 @@ export const GenitalConfig = (props, context) => { /> - - - - - - - - - - + {data.istargetself ? + + + + + + + + + + : null + } diff --git a/tgui/packages/tgui/interfaces/MobInteraction.tsx b/tgui/packages/tgui/interfaces/MobInteraction.tsx index c82670b308..d38a606e22 100644 --- a/tgui/packages/tgui/interfaces/MobInteraction.tsx +++ b/tgui/packages/tgui/interfaces/MobInteraction.tsx @@ -23,41 +23,6 @@ type InteractionData = { type: number; } -type GenitalInfo = { - genitals: GenitalData[]; -} - -type GenitalData = { - name: string, - key: string, - visibility: string, - extras: string, - extra_choices: string[], - possible_choices: string[], - can_arouse: boolean, - arousal_state: boolean, - always_accessible: boolean, -} - -type GenitalManagerInfo = { - isTargetSelf: boolean; - genital_fluids: GenitalFluid[]; - genital_interactibles: GenitalInteractionInfos[]; -} - -type GenitalInteractionInfos = { - name: string, - key: string, - possible_choices: string[], - equipments: string[], -} - -type GenitalFluid = { - name: string, - key: string, - fluids: number, -} - type CharacterPrefsInfo = { erp_pref: number, noncon_pref: number, @@ -138,29 +103,19 @@ export const MobInteraction = (props, context) => { setTabIndex(0)}> Interactions - setTabIndex(1)}> - Genital Options - - setTabIndex(2)}> + setTabIndex(2)}> Character Prefs - setTabIndex(3)}> + setTabIndex(3)}> Preferences - setTabIndex(4)}> - Genital Manager - {tabIndex === 0 && ( ) || tabIndex === 1 && ( - - ) || tabIndex === 2 && ( - ) || tabIndex === 3 && ( + ) || tabIndex === 2 && ( - ) || tabIndex === 4 && ( - ) || ("Somehow, you've got into an invalid page, please report this.")} @@ -237,168 +192,6 @@ export const sortInteractions = (interactions, searchText = '') => { ])(interactions); }; -// Self explanatory -const ModeToIcon = { - "Always visible": "eye", - "Hidden by clothes": "tshirt", - "Hidden by underwear": "low-vision", - "Always hidden": "eye-slash", - "Allows egg stuffing": "egg", -}; - -/* - Greetings you, yes you, adding more stuff to actions, - To not have as much headache as i did, - do not attempt to make a sum of 100% with the buttons - as it will mess up math somewhere and overflow. - - Also this is adjusted only for the current size, - if anyone feels like shrinking, - their window it will overflow anyways. - Single items is fine. -*/ -const GenitalTab = (props, context) => { - const { act, data } = useBackend(context); - const genitals = data.genitals || []; - return ( - genitals.length ? ( - - {genitals.map(genital => ( -
- - - Visibility
- {genital.possible_choices.map(choice => ( -
-
- ))} -
- ) : ( -
- You don't seem to have any genitals... - Or any that you could modify. -
- ) - ); -}; - -const GenitalManagerTab = (props, context) => { - const { act, data } = useBackend(context); - const isTargetSelf = data.isTargetSelf; - const genital_fluids = data.genital_fluids || []; - const genital_interactibles = data.genital_interactibles || []; - return ( - genital_fluids.length || genital_interactibles.length ? ( - <> -
- - {genital_fluids.map(genital => ( - - - - ))} - -
-
- {genital_interactibles.map(genital => ( -
- { - genital.equipments.length ? ( - <> - Equipments: - - {genital.equipments.map(equipment => ( - - {equipment} - - ))} -
- - - ) : null - } - - {genital.possible_choices.map(choice => ( -
- ))} -
- - ) : ( -
- { - isTargetSelf - ? "You don't seem to have any genitals... Or any that you could do anything with" - : "They don't seem to have any genitals... Or any that you could do anything with" - } -
- ) - ); -}; - const CharacterPrefsTab = (props, context) => { const { act, data } = useBackend(context); const {