Advertisement
Xtraeme

Uncompyle6 of tunable_handler.py

Jul 4th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 8.83 KB | None | 0 0
  1. # uncompyle6 version 2.9.4
  2. # Python bytecode 3.3 (3230)
  3. # Decompiled from: Python 3.3.4 (v3.3.4:7ff62415e426, Feb 10 2014, 18:13:51) [MSC v.1600 64 bit (AMD64)]
  4. # Embedded file name: .\WickedWhims 2.2.3.102.3\wickedwoohoo\exhibitionism\tunable_handler.py
  5. # Compiled at: 2017-04-27 04:10:18
  6. # Size of source mod 2**32: 9956 bytes
  7. import services
  8. from event_testing.test_variants import SimInfoTest, UserRunningInteractionTest
  9. from event_testing.tests import CompoundTestList, TestList
  10. from interactions import ParticipantType
  11. from sims.phone_tuning import PhoneTuning
  12. from sims.sim_info_types import Age
  13. from sims4.collections import make_immutable_slots_class, ListSet
  14. from sims4.localization import TunableLocalizedStringFactory
  15. from sims4.resources import Types, get_resource_key
  16. from sims4.tuning.instance_manager import InstanceManager
  17. from wickedwoohoo.global_manager import register_game_load_listener
  18. from wickedwoohoo.utils_enums import SimInteraction
  19. from wickedwoohoo.utils_injector import injector
  20. from wickedwoohoo.utils_tunings import get_sim_info_age_test, create_impossible_sim_info_age_test
  21. NUDE_CLOTHING_BUFF = 128807
  22. NUDE_TEENS_TEST_SETS = (129064)
  23. NUDITY_AFFORDANCE_LIST = (120455, 120453, 128625, 129163, 117339, 26878)
  24. ALL_SIMS_AFFORDANCE_LIST = (125127, 125129)
  25. DISABLE_AFFORDANCE_LIST = (128922, 129168, 128960, 142210)
  26.  
  27. @register_game_load_listener()
  28. def _add_test_to_phone_tuning(is_first_load):
  29.     if is_first_load is False:
  30.         return
  31.     affordance_manager = services.get_instance_manager(Types.INTERACTION)
  32.     affordances = {
  33.      affordance_manager.get(get_resource_key(SimInteraction.WW_SEX_INTERACTION, Types.INTERACTION)), affordance_manager.get(get_resource_key(SimInteraction.WW_SETUP_SEX, Types.INTERACTION)),
  34.      affordance_manager.get(get_resource_key(SimInteraction.WW_WAIT_FOR_SEX_PARTNER, Types.INTERACTION)), affordance_manager.get(get_resource_key(SimInteraction.WW_GO_TO_GROUP_SEX_DESTINATION, Types.INTERACTION)),
  35.      affordance_manager.get(get_resource_key(SimInteraction.WW_GO_TO_JOIN_GROUP_SEX_DESTINATION, Types.INTERACTION)), affordance_manager.get(get_resource_key(SimInteraction.WW_GO_TO_SEX_DESTINATION, Types.INTERACTION))}
  36.     test = UserRunningInteractionTest(participant=ParticipantType.Actor, affordances=affordances, affordance_lists=list(), test_for_not_running=False, all_participants_running=False)
  37.     immutable_slots_class = make_immutable_slots_class([
  38.      'test', 'tooltip'])
  39.     immutable_slots = immutable_slots_class(dict(test=test, tooltip=TunableLocalizedStringFactory._Wrapper(1181912093)))
  40.     items_list = list(PhoneTuning.DISABLE_PHONE_TESTS)
  41.     items_list.append(immutable_slots)
  42.     PhoneTuning.DISABLE_PHONE_TESTS = ListSet(items_list)
  43.  
  44.  
  45. @injector(InstanceManager, 'load_data_into_class_instances')
  46. def _wickedwoohoo_load_data_and_disable_interactions(original, self, *args, **kwargs):
  47.     global ALL_SIMS_AFFORDANCE_LIST
  48.     result = original(self, *args, **kwargs)
  49.     if self.TYPE != Types.INTERACTION:
  50.         return result
  51.     else:
  52.         for affordance_id in ALL_SIMS_AFFORDANCE_LIST:
  53.             affordance_key = get_resource_key(affordance_id, Types.INTERACTION)
  54.             affordance_instance = self._tuned_classes.get(affordance_key)
  55.             if affordance_instance is None:
  56.                 continue
  57.             if hasattr(affordance_instance, 'test_globals') and affordance_instance.test_globals:
  58.                 affordance_tests_list = []
  59.                 for test in affordance_instance.test_globals:
  60.                     test = get_sim_info_age_test(test, add_age=(Age(2), Age(4),
  61.                      Age(8), Age(16), Age(32), Age(64)))
  62.                     affordance_tests_list.append(test)
  63.  
  64.                 affordance_instance.test_globals = TestList(affordance_tests_list)
  65.                 continue
  66.  
  67.         return result
  68.  
  69.  
  70. @injector(InstanceManager, 'load_data_into_class_instances')
  71. def _wickedwoohoo_load_data_and_disable_interactions(original, self, *args, **kwargs):
  72.     global DISABLE_AFFORDANCE_LIST
  73.     result = original(self, *args, **kwargs)
  74.     if self.TYPE != Types.INTERACTION:
  75.         return result
  76.     else:
  77.         for affordance_id in DISABLE_AFFORDANCE_LIST:
  78.             affordance_key = get_resource_key(affordance_id, Types.INTERACTION)
  79.             affordance_instance = self._tuned_classes.get(affordance_key)
  80.             if affordance_instance is None:
  81.                 continue
  82.             if hasattr(affordance_instance, 'test_globals') and affordance_instance.test_globals:
  83.                 affordance_tests_list = []
  84.                 has_age_test = False
  85.                 for test in affordance_instance.test_globals:
  86.                     if isinstance(test, SimInfoTest):
  87.                         test = create_impossible_sim_info_age_test()
  88.                         has_age_test = True
  89.                     affordance_tests_list.append(test)
  90.  
  91.                 if has_age_test is False:
  92.                     affordance_tests_list.append(create_impossible_sim_info_age_test())
  93.                 affordance_instance.test_globals = TestList(affordance_tests_list)
  94.                 continue
  95.  
  96.         return result
  97.  
  98.  
  99. @injector(InstanceManager, 'load_data_into_class_instances')
  100. def _wickedwoohoo_load_data_into_nudity_buff(original, self, *args, **kwargs):
  101.     global NUDE_CLOTHING_BUFF
  102.     result = original(self, *args, **kwargs)
  103.     if self.TYPE != Types.BUFF:
  104.         return result
  105.     else:
  106.         key = get_resource_key(NUDE_CLOTHING_BUFF, Types.BUFF)
  107.         buff_instance = self._tuned_classes.get(key)
  108.         if buff_instance is None:
  109.             return result
  110.         buff_instance.broadcaster = None
  111.         return result
  112.  
  113.  
  114. @injector(InstanceManager, 'load_data_into_class_instances')
  115. def _wickedwoohoo_load_data_into_nudity_testsets(original, self, *args, **kwargs):
  116.     global NUDE_TEENS_TEST_SETS
  117.     result = original(self, *args, **kwargs)
  118.     if self.TYPE != Types.SNIPPET:
  119.         return result
  120.     else:
  121.         for snippet_id in NUDE_TEENS_TEST_SETS:
  122.             snippet_key = get_resource_key(snippet_id, Types.SNIPPET)
  123.             snippet_instance = self._tuned_classes.get(snippet_key)
  124.             if snippet_instance is None:
  125.                 continue
  126.             testset_groups_list = []
  127.             for test_group in snippet_instance.test:
  128.                 testset_tests_list = []
  129.                 for test in test_group:
  130.                     test = get_sim_info_age_test(test, add_age=(Age(1), Age(2), Age(4), Age(8)))
  131.                     testset_tests_list.append(test)
  132.  
  133.                 testset_groups_list.append(tuple(testset_tests_list))
  134.  
  135.             snippet_instance.test = CompoundTestList(list(testset_groups_list))
  136.  
  137.         return result
  138.  
  139.  
  140. @injector(InstanceManager, 'load_data_into_class_instances')
  141. def _wickedwoohoo_load_data_into_nudity_interactions(original, self, *args, **kwargs):
  142.     global NUDITY_AFFORDANCE_LIST
  143.     result = original(self, *args, **kwargs)
  144.     if self.TYPE != Types.INTERACTION:
  145.         return result
  146.     else:
  147.         for affordance_id in NUDITY_AFFORDANCE_LIST:
  148.             affordance_key = get_resource_key(affordance_id, Types.INTERACTION)
  149.             affordance_instance = self._tuned_classes.get(affordance_key)
  150.             if affordance_instance is None:
  151.                 continue
  152.             if hasattr(affordance_instance, 'test_globals') and affordance_instance.test_globals:
  153.                 affordance_tests_list = []
  154.                 for test in affordance_instance.test_globals:
  155.                     test = get_sim_info_age_test(test, add_age=(Age(8),))
  156.                     affordance_tests_list.append(test)
  157.  
  158.                 affordance_instance.test_globals = TestList(affordance_tests_list)
  159.             if hasattr(affordance_instance, 'sim_tests') and affordance_instance.sim_tests:
  160.                 simtests_group_list = []
  161.                 for test_group in affordance_instance.sim_tests:
  162.                     simtest_tests_list = []
  163.                     for test in test_group:
  164.                         test = get_sim_info_age_test(test, add_age=(Age(8),))
  165.                         simtest_tests_list.append(test)
  166.  
  167.                     simtests_group_list.append(tuple(simtest_tests_list))
  168.  
  169.                 affordance_instance.sim_tests = CompoundTestList(simtests_group_list)
  170.             if hasattr(affordance_instance, 'tests') and affordance_instance.tests:
  171.                 tests_group_list = []
  172.                 for test_group in affordance_instance.tests:
  173.                     test_tests_list = []
  174.                     for test in test_group:
  175.                         test = get_sim_info_age_test(test, add_age=(Age(8),))
  176.                         test_tests_list.append(test)
  177.  
  178.                     tests_group_list.append(tuple(test_tests_list))
  179.  
  180.                 affordance_instance.tests = CompoundTestList(tests_group_list)
  181.                 continue
  182.  
  183.         return result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement