예제 #1
0
def _OnStart (cause) -> None:
	Settings.RegisterOnUpdateCallback(_SettingsOnUpdatedCallback)
	Settings.RegisterOnLoadCallback(_SettingsOnLoadedCallback)

	_RollAllSimsExperiencesPMSValues()
	_HandleAllSimsExperiencePMSOverride()

	if services.current_zone() is not None:
		_SetupZoneHandling()
예제 #2
0
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)
예제 #3
0
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)
예제 #4
0
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
예제 #5
0
def _OnStop(cause) -> None:
    Settings.UnregisterOnUpdateCallback(_SettingsOnUpdatedCallback)
예제 #6
0
def _OnStart(cause) -> None:
    Settings.RegisterOnUpdateCallback(_SettingsOnUpdatedCallback)

    if cause != LoadingShared.LoadingCauses.Reloading:
        Patcher.Patch(GamePregnancyTracker.PregnancyTracker, "clear_pregnancy",
                      _GamePregnancyTrackerClearPregnancyPatch)
예제 #7
0
def GetListDialogSettings () -> typing.List[UISettingsShared.SettingStandardWrapper]:
	return [UISettingsShared.SettingStandardWrapper(setting) for setting in Settings.GetAllSettings()]
예제 #8
0
def _OnStop(cause) -> None:
    if cause:
        pass

    Settings.UnregisterOnUpdateCallback(_SettingsOnUpdateCallback)
예제 #9
0
def _OnStop (cause) -> None:
	Settings.UnregisterOnUpdateCallback(_SettingsOnUpdatedCallback)
	Settings.UnregisterOnLoadCallback(_SettingsOnLoadedCallback)

	if services.current_zone() is not None:
		_ResetZoneHandling()