Exemple #1
0
    def on_load(self) -> None:
        LuaPluginManager.load_settings(self.settings)
        ObjectiveDistanceCache.set_theater(self.theater)

        # Save game compatibility.

        # TODO: Remove in 2.3.
        if not hasattr(self, "conditions"):
            self.conditions = self.generate_conditions()
Exemple #2
0
 def on_load(self, game_still_initializing: bool = False) -> None:
     if not hasattr(self, "name_generator"):
         self.name_generator = naming.namegen
     # Hack: Replace the global name generator state with the state from the save
     # game.
     #
     # We need to persist this state so that names generated after game load don't
     # conflict with those generated before exit.
     naming.namegen = self.name_generator
     LuaPluginManager.load_settings(self.settings)
     ObjectiveDistanceCache.set_theater(self.theater)
     self.compute_conflicts_position()
     if not game_still_initializing:
         self.compute_threat_zones()
     self.blue_faker = Faker(self.faction_for(player=True).locales)
     self.red_faker = Faker(self.faction_for(player=False).locales)
Exemple #3
0
    def on_load(self, game_still_initializing: bool = False) -> None:
        from .sim import GameUpdateEvents

        if not hasattr(self, "name_generator"):
            self.name_generator = naming.namegen
        # Hack: Replace the global name generator state with the state from the save
        # game.
        #
        # We need to persist this state so that names generated after game load don't
        # conflict with those generated before exit.
        naming.namegen = self.name_generator
        LuaPluginManager.load_settings(self.settings)
        ObjectiveDistanceCache.set_theater(self.theater)
        self.compute_unculled_zones()
        if not game_still_initializing:
            # We don't need to push events that happen during load. The UI will fully
            # reset when we're done.
            self.compute_threat_zones(GameUpdateEvents())
Exemple #4
0
 def on_load(self) -> None:
     LuaPluginManager.load_settings(self.settings)
     ObjectiveDistanceCache.set_theater(self.theater)
     self.compute_conflicts_position()
     self.compute_threat_zones()