Exemplo n.º 1
0
    def __init__(self, household_id, selectable_sims=None, zone_is_setup=None, household_npcs=None):  # pylint: disable=unused-argument
        self.household_id = household_id
        self.selectable_sims = selectable_sims
        self.household_npcs = household_npcs if household_npcs is not None else list()

        if self.selectable_sims is None or len(self.selectable_sims) == 0:
            self.update_selectable_sims()

        GameEvents.on_zone_teardown(self.on_zone_teardown)
        GameEvents.on_active_sim_changed(self.on_active_sim_changed)
Exemplo n.º 2
0
    def on_zone_teardown(self, _zone, _client):
        Logger.log('on_zone_teardown: tearing down SelectionGroupService')

        if not self.zone_is_setup:
            Logger.log("SelectionGroupService is already teared down")
            return

        self.persist_state()
        self.cleanup_sims()

        GameEvents.remove_zone_teardown(self.on_zone_teardown)

        self.zone_is_setup = False
        self.__class__.instance = None
Exemplo n.º 3
0
 def bootstrap(cls):
     GameEvents.on_add_sim(cls.inject_into_sim)
     GameEvents.on_add_sim(cls.inject_into_relationship_panel)