示例#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
 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])
 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