remove environment parameter and pass it via initialisation
This commit is contained in:
@@ -11,22 +11,22 @@ class command():
|
||||
def __init__(self):
|
||||
pass
|
||||
def initialize(self, environment):
|
||||
pass
|
||||
def shutdown(self, environment):
|
||||
pass
|
||||
def getDescription(self, environment):
|
||||
self.env = environment
|
||||
def shutdown(self):
|
||||
pass
|
||||
def getDescription(self):
|
||||
return 'decrease sound volume'
|
||||
|
||||
def run(self, environment):
|
||||
def run(self):
|
||||
|
||||
value = environment['runtime']['settingsManager'].getSettingAsFloat(environment, 'sound', 'volume')
|
||||
value = self.env['runtime']['settingsManager'].getSettingAsFloat('sound', 'volume')
|
||||
|
||||
value = round((math.ceil(10 * value) / 10) - 0.1, 2)
|
||||
if value < 0.1:
|
||||
value = 0.1
|
||||
environment['runtime']['settingsManager'].setSetting(environment, 'sound', 'volume', str(value))
|
||||
self.env['runtime']['settingsManager'].setSetting('sound', 'volume', str(value))
|
||||
|
||||
environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent sound volume", soundIcon='SoundOff', interrupt=True)
|
||||
self.env['runtime']['outputManager'].presentText(str(int(value * 100)) + " percent sound volume", soundIcon='SoundOff', interrupt=True)
|
||||
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user