def _OnStart (cause) -> None: Settings.RegisterOnUpdateCallback(_SettingsOnUpdatedCallback) Settings.RegisterOnLoadCallback(_SettingsOnLoadedCallback) _RollAllSimsExperiencesPMSValues() _HandleAllSimsExperiencePMSOverride() if services.current_zone() is not None: _SetupZoneHandling()
def _OnStart(cause) -> None: if cause: pass Patcher.Patch(pregnancy_tracker.PregnancyTracker, "start_pregnancy", _StartPregnancy) Patcher.Patch(pregnancy_tracker.PregnancyTracker, "clear_pregnancy", _ClearPregnancy) Settings.RegisterOnUpdateCallback(_SettingsOnUpdateCallback)
def _ShowDialog (key: str, _connection: int = None) -> None: try: allSettings = Settings.GetAllSettings() for setting in allSettings: # type: SettingsBase.Setting if setting.Key.lower() == key: setting.ShowDialog() return except Exception as e: commands.cheat_output("Failed to show dialog for setting '" + key + "'.", _connection) Debug.Log("Failed to show dialog for setting '" + key + "'.", This.Mod.Namespace, Debug.LogLevels.Exception, group = This.Mod.Namespace, owner = __name__, exception = e) return commands.cheat_output("Cannot find setting '" + key + "'.\n", _connection)
def _PrintNames (_connection: int = None) -> None: try: allSettings = Settings.GetAllSettings() settingKeysString = "" for setting in allSettings: # type: SettingsBase.Setting if len(settingKeysString) == 0: settingKeysString += setting.Key else: settingKeysString += "\n" + setting.Key commands.cheat_output(settingKeysString + "\n", _connection) except Exception as e: commands.cheat_output("Failed to print setting names.", _connection) Debug.Log("Failed to print setting names.", This.Mod.Namespace, Debug.LogLevels.Exception, group = This.Mod.Namespace, owner = __name__, exception = e) return
def _OnStop(cause) -> None: Settings.UnregisterOnUpdateCallback(_SettingsOnUpdatedCallback)
def _OnStart(cause) -> None: Settings.RegisterOnUpdateCallback(_SettingsOnUpdatedCallback) if cause != LoadingShared.LoadingCauses.Reloading: Patcher.Patch(GamePregnancyTracker.PregnancyTracker, "clear_pregnancy", _GamePregnancyTrackerClearPregnancyPatch)
def GetListDialogSettings () -> typing.List[UISettingsShared.SettingStandardWrapper]: return [UISettingsShared.SettingStandardWrapper(setting) for setting in Settings.GetAllSettings()]
def _OnStop(cause) -> None: if cause: pass Settings.UnregisterOnUpdateCallback(_SettingsOnUpdateCallback)
def _OnStop (cause) -> None: Settings.UnregisterOnUpdateCallback(_SettingsOnUpdatedCallback) Settings.UnregisterOnLoadCallback(_SettingsOnLoadedCallback) if services.current_zone() is not None: _ResetZoneHandling()