V2 Cog GUI fix

This commit is contained in:
John 2015-08-27 23:29:14 +03:00
parent 0d1595417d
commit d906d45312
3 changed files with 9 additions and 19 deletions

View file

@ -255,17 +255,13 @@ def createSuitReviveTrack(suit, toon, battle, npcs = []):
if hasattr(suit, 'battleTrapProp') and suit.battleTrapProp and suit.battleTrapProp.getName() == 'traintrack' and not suit.battleTrapProp.isHidden():
suitTrack.append(createTrainTrackAppearTrack(suit, toon, battle, npcs))
deathSuit = suit.getLoseActor()
suitTrack.append(Func(notify.debug, 'before insertDeathSuit'))
suitTrack.append(Func(insertReviveSuit, suit, deathSuit, battle, suitPos, suitHpr))
suitTrack.append(Func(notify.debug, 'before actorInterval lose'))
suitTrack.append(ActorInterval(deathSuit, 'lose', duration=SUIT_LOSE_REVIVE_DURATION))
suitTrack.append(Func(notify.debug, 'before removeDeathSuit'))
suitTrack.append(Func(removeReviveSuit, suit, deathSuit, name='remove-death-suit'))
suitTrack.append(Func(notify.debug, 'after removeDeathSuit'))
suitTrack.append(ActorInterval(suit, 'slip-forward', startTime=2.48, duration=0.1))
suitTrack.append(ActorInterval(suit, 'slip-forward', startTime=2.58))
suitTrack.append(Func(suit.loop, 'neutral'))
suitTrack.append(Func(messenger.send, suit.uniqueName('hpChange')))
suitTrack.append(Func(suit.setHP, suit.getMaxHP()))
spinningSound = base.loadSfx('phase_3.5/audio/sfx/Cog_Death.ogg')
deathSound = base.loadSfx('phase_3.5/audio/sfx/ENC_cogfall_apart_%s.ogg' % random.randint(1, 6))
deathSoundTrack = Sequence(Wait(0.8), SoundInterval(spinningSound, duration=1.2, startTime=1.5, volume=0.2), SoundInterval(spinningSound, duration=3.0, startTime=0.6, volume=0.8), SoundInterval(deathSound, volume=0.32))

View file

@ -42,10 +42,7 @@ class TownBattle(StateData.StateData):
self.track = -1
self.level = -1
self.target = 0
self.toonAttacks = [(-1, 0, 0),
(-1, 0, 0),
(-1, 0, 0),
(-1, 0, 0)]
self.toonAttacks = [(-1, 0, 0)] * 4
self.fsm = ClassicFSM.ClassicFSM('TownBattle', [
State.State('Off',
self.enterOff,
@ -446,7 +443,7 @@ class TownBattle(StateData.StateData):
self.notify.debug('adjustCogsAndToons() numCogs: %s self.numCogs: %s' % (numCogs, self.numCogs))
self.notify.debug('adjustCogsAndToons() luredIndices: %s self.luredIndices: %s' % (luredIndices, self.luredIndices))
self.notify.debug('adjustCogsAndToons() trappedIndices: %s self.trappedIndices: %s' % (trappedIndices, self.trappedIndices))
toonIds = map(lambda toon: toon.doId, toons)
toonIds = [toon.doId for toon in toons]
self.notify.debug('adjustCogsAndToons() toonIds: %s self.toons: %s' % (toonIds, self.toons))
maxSuitLevel = 0
for cog in cogs:
@ -464,16 +461,17 @@ class TownBattle(StateData.StateData):
self.localNum = toons.index(base.localAvatar)
currStateName = self.fsm.getCurrentState().getName()
if settings['cogInterface']:
self.__enterCogPanels(self.numCogs)
for i in xrange(len(cogs)):
self.cogPanels[i].setSuit(cogs[i])
if resetActivateMode:
self.__enterPanels(self.numToons, self.localNum)
for i in xrange(len(toons)):
self.toonPanels[i].setLaffMeter(toons[i])
if settings['cogInterface']:
self.__enterCogPanels(self.numCogs)
for i in xrange(len(cogs)):
self.cogPanels[i].setSuit(cogs[i])
if currStateName == 'ChooseCog':
self.chooseCogPanel.adjustCogs(self.numCogs, self.luredIndices, self.trappedIndices, self.track)
elif currStateName == 'ChooseToon':

View file

@ -23,7 +23,6 @@ class TownBattleCogPanel(DirectFrame):
gui.removeNode()
def cleanup(self):
self.ignoreAll()
self.cleanupHead()
self.levelText.removeNode()
self.typeText.removeNode()
@ -42,17 +41,14 @@ class TownBattleCogPanel(DirectFrame):
def setSuit(self, suit):
if self.suit == suit:
messenger.send(self.suit.uniqueName('hpChange'))
return
self.ignoreAll()
self.cleanupHead()
self.suit = suit
self.generateSuitHead(suit.getStyleName())
self.updateHealthBar()
self.levelText['text'] = TTLocalizer.CogPanelLevel % suit.getActualLevel()
self.typeText['text'] = suit.getTypeText()
self.accept(suit.uniqueName('hpChange'), self.updateHealthBar)
self.updateRolloverBind()
def updateRolloverBind(self):