def commandChangeTod(self):
     tod = self.todVar.get()
     startHour = TODGlobals.getStateBeginTime(self.todMgr.cycleType, tod)
     if startHour == None:
         startHour = 0.0
     todStartHour = (startHour + TODGlobals.getStateTransitionTime(self.todMgr.cycleType, tod)) * PiratesGlobals.TOD_GAMEHOURS_IN_GAMEDAY
     cycleDuration = self.cycleDurationVar.get()
     self.changeTod(cycleDuration, todStartHour)
     self.setEnableDisable()
     self.checkButtonsForChange()
     return
示例#2
0
 def commandChangeTod(self):
     tod = self.todVar.get()
     startHour = TODGlobals.getStateBeginTime(self.todMgr.cycleType, tod)
     if startHour == None:
         startHour = 0.0
     
     todStartHour = (startHour + TODGlobals.getStateTransitionTime(self.todMgr.cycleType, tod)) * PiratesGlobals.TOD_GAMEHOURS_IN_GAMEDAY
     cycleDuration = self.cycleDurationVar.get()
     self.changeTod(cycleDuration, todStartHour)
     self.setEnableDisable()
     self.checkButtonsForChange()
 def commandChangeTodSpeed(self):
     tod = self.todVar.get()
     todStartHour = TODGlobals.getStateBeginTime(self.todMgr.cycleType, tod)
     cycleDuration = self.cycleDurationVar.get()
     self.changeTod(cycleDuration)
     self.setEnableDisable()
     self.checkButtonsForChange()
示例#4
0
 def commandChangeTodSpeed(self):
     tod = self.todVar.get()
     todStartHour = TODGlobals.getStateBeginTime(self.todMgr.cycleType, tod)
     cycleDuration = self.cycleDurationVar.get()
     self.changeTod(cycleDuration)
     self.setEnableDisable()
     self.checkButtonsForChange()
示例#5
0
    def holdData(self):
        holdChanges = self.changesEnabled
        self.changesEnabled = 1
        stateId = self.todMgr.currentState
        fogColor = TODGlobals.getTodEnvSetting(stateId,
                                               self.todMgr.environment,
                                               'FogColor')
        fogRange = TODGlobals.getTodEnvSetting(stateId,
                                               self.todMgr.environment,
                                               'FogExp')
        linearFogOnSet = self.todMgr.linearFog.getLinearOnsetPoint()
        linearFogPeak = self.todMgr.linearFog.getLinearOpaquePoint()
        ambientColor = TODGlobals.getTodEnvSetting(stateId,
                                                   self.todMgr.environment,
                                                   'AmbientColor')
        self.fogColor.set((fogColor[0], fogColor[1], fogColor[2]))
        self.fogRange.set((fogRange, ))
        self.ambientColor.set(
            (ambientColor[0], ambientColor[1], ambientColor[2]))
        self.fogLinearRange.set((linearFogOnSet[1], linearFogPeak[1]))
        sunDirection = self.todMgr.skyGroup.boundSunAngle(
            TODGlobals.getTodEnvSetting(stateId, self.todMgr.environment,
                                        'Direction'))
        self.sunDirection.set(
            (sunDirection[0], sunDirection[1], sunDirection[2]))
        directionalColor = None
        if self.todMgr.dlight:
            directionalColor = TODGlobals.getTodEnvSetting(
                stateId, self.todMgr.environment, 'FrontColor')
            self.holdDirectionColor = directionalColor
            self.directionalColor.set(
                (directionalColor[0], directionalColor[1],
                 directionalColor[2]))

        backLightColor = None
        if self.todMgr.shadowLight:
            backLightColor = TODGlobals.getTodEnvSetting(
                stateId, self.todMgr.environment, 'BackColor')
            self.holdBackColor = backLightColor
            self.backLightColor.set(
                (backLightColor[0], backLightColor[1], backLightColor[2]))

        if self.selectedCycleDuration == 0:
            pass
        1
        self.holdFogColor = fogColor
        self.holdFogExp = fogRange
        self.holdLinearRanges = (linearFogOnSet[1], linearFogPeak[1])
        self.holdAmbientColor = ambientColor
        self.holdDirectionColor = directionalColor
        self.holdBackColor = backLightColor
        self.holdSunDirection = sunDirection
        self.changesEnabled = holdChanges
 def holdData(self):
     holdChanges = self.changesEnabled
     self.changesEnabled = 1
     stateId = self.todMgr.currentState
     fogColor = TODGlobals.getTodEnvSetting(stateId, self.todMgr.environment, 'FogColor')
     fogRange = TODGlobals.getTodEnvSetting(stateId, self.todMgr.environment, 'FogExp')
     linearFogOnSet = self.todMgr.linearFog.getLinearOnsetPoint()
     linearFogPeak = self.todMgr.linearFog.getLinearOpaquePoint()
     ambientColor = TODGlobals.getTodEnvSetting(stateId, self.todMgr.environment, 'AmbientColor')
     self.fogColor.set((fogColor[0], fogColor[1], fogColor[2]))
     self.fogRange.set((fogRange,))
     self.ambientColor.set((ambientColor[0], ambientColor[1], ambientColor[2]))
     self.fogLinearRange.set((linearFogOnSet[1], linearFogPeak[1]))
     sunDirection = self.todMgr.skyGroup.boundSunAngle(TODGlobals.getTodEnvSetting(stateId, self.todMgr.environment, 'Direction'))
     self.sunDirection.set((sunDirection[0], sunDirection[1], sunDirection[2]))
     directionalColor = None
     if self.todMgr.dlight:
         directionalColor = TODGlobals.getTodEnvSetting(stateId, self.todMgr.environment, 'FrontColor')
         self.holdDirectionColor = directionalColor
         self.directionalColor.set((directionalColor[0], directionalColor[1], directionalColor[2]))
     
     backLightColor = None
     if self.todMgr.shadowLight:
         backLightColor = TODGlobals.getTodEnvSetting(stateId, self.todMgr.environment, 'BackColor')
         self.holdBackColor = backLightColor
         self.backLightColor.set((backLightColor[0], backLightColor[1], backLightColor[2]))
     
     if self.selectedCycleDuration == 0:
         pass
     1
     self.holdFogColor = fogColor
     self.holdFogExp = fogRange
     self.holdLinearRanges = (linearFogOnSet[1], linearFogPeak[1])
     self.holdAmbientColor = ambientColor
     self.holdDirectionColor = directionalColor
     self.holdBackColor = backLightColor
     self.holdSunDirection = sunDirection
     self.changesEnabled = holdChanges
 def commandChangeTodOff(self):
     tod = self.todVar.get()
     todStartHour = TODGlobals.getStateBeginTime(self.todMgr.cycleType, tod)
     cycleDuration = self.cycleDurationVar.get()
     self.selectedCycleDuration = -1
     self.changeTod(self.todMgr.cycleSpeed, todStartHour)
示例#8
0
 def commandChangeTodOff(self):
     tod = self.todVar.get()
     todStartHour = TODGlobals.getStateBeginTime(self.todMgr.cycleType, tod)
     cycleDuration = self.cycleDurationVar.get()
     self.selectedCycleDuration = -1
     self.changeTod(self.todMgr.cycleSpeed, todStartHour)