コード例 #1
0
 def toggleRandomWeather(self, force=None):
     if force is not None:
         turningOff = not force
     else:
         turningOff = self.randomWeatherCallback is not None
     stateChanged = False
     wasOn = self.randomWeatherCallback is not None
     if turningOff and self.randomWeatherCallback is not None:
         BigWorld.cancelCallback(self.randomWeatherCallback)
         self.randomWeatherCallback = None
         stateChanged = wasOn
     elif not turningOff:
         self._randomWeather(True)
         stateChanged = not wasOn
     if stateChanged:
         Personality.addChatMsg(-1, 'Random weather turned ' + ('on', 'off')[turningOff])
     return
コード例 #2
0
ファイル: weather.py プロジェクト: wotmods/WOTDecompiled
 def toggleRandomWeather(self, force = None):
     """
     This method chooses a random weather system every 60 seconds.
     """
     if force != None:
         turningOff = not force
     else:
         turningOff = self.randomWeatherCallback != None
     stateChanged = False
     wasOn = self.randomWeatherCallback != None
     if turningOff and self.randomWeatherCallback != None:
         BigWorld.cancelCallback(self.randomWeatherCallback)
         self.randomWeatherCallback = None
         stateChanged = wasOn
     elif not turningOff:
         self._randomWeather(True)
         stateChanged = not wasOn
     if stateChanged:
         Personality.addChatMsg(-1, 'Random weather turned ' + ('on', 'off')[turningOff])
コード例 #3
0
 def toggleRandomWeather(self, force = None):
     """
     This method chooses a random weather system every 60 seconds.
     """
     if force != None:
         turningOff = not force
     else:
         turningOff = self.randomWeatherCallback != None
     stateChanged = False
     wasOn = self.randomWeatherCallback != None
     if turningOff and self.randomWeatherCallback != None:
         BigWorld.cancelCallback(self.randomWeatherCallback)
         self.randomWeatherCallback = None
         stateChanged = wasOn
     elif not turningOff:
         self._randomWeather(True)
         stateChanged = not wasOn
     if stateChanged:
         Personality.addChatMsg(-1, 'Random weather turned ' + ('on', 'off')[turningOff])
     return