mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2025-01-09 17:53:50 +00:00
Add hover thing to suit page + fix library flickering for Intel HD graphics
This commit is contained in:
parent
7139be634f
commit
3cc83f1441
4 changed files with 47 additions and 0 deletions
|
@ -3170,3 +3170,4 @@ def getAttackTaunt(attackName, index = None):
|
||||||
|
|
||||||
|
|
||||||
SuitAttackTaunts = TTLocalizer.SuitAttackTaunts
|
SuitAttackTaunts = TTLocalizer.SuitAttackTaunts
|
||||||
|
DisabledAttacks = ('Gavel', 'SongAndDance', 'SandTrap', 'FloodTheMarket', 'FiveOClockShadow')
|
|
@ -16,8 +16,11 @@ class TTSafeZoneLoader(SafeZoneLoader.SafeZoneLoader):
|
||||||
'phase_4/audio/sfx/SZ_TC_bird2.ogg',
|
'phase_4/audio/sfx/SZ_TC_bird2.ogg',
|
||||||
'phase_4/audio/sfx/SZ_TC_bird3.ogg'])
|
'phase_4/audio/sfx/SZ_TC_bird3.ogg'])
|
||||||
bank = self.geom.find('**/*toon_landmark_TT_bank_DNARoot')
|
bank = self.geom.find('**/*toon_landmark_TT_bank_DNARoot')
|
||||||
|
library = self.geom.find('**/library/square_drop_shadow')
|
||||||
doorTrigger = bank.find('**/door_trigger*')
|
doorTrigger = bank.find('**/door_trigger*')
|
||||||
doorTrigger.setY(doorTrigger.getY() - 1.5)
|
doorTrigger.setY(doorTrigger.getY() - 1.5)
|
||||||
|
library.find('**/building_front').setY(0.3)
|
||||||
|
library.find('**/front_entrance_flag').setY(0.1)
|
||||||
|
|
||||||
def unload(self):
|
def unload(self):
|
||||||
SafeZoneLoader.SafeZoneLoader.unload(self)
|
SafeZoneLoader.SafeZoneLoader.unload(self)
|
||||||
|
|
|
@ -230,6 +230,7 @@ class SuitPage(ShtikerPage.ShtikerPage):
|
||||||
self.legalRadarButton.destroy()
|
self.legalRadarButton.destroy()
|
||||||
self.moneyRadarButton.destroy()
|
self.moneyRadarButton.destroy()
|
||||||
self.salesRadarButton.destroy()
|
self.salesRadarButton.destroy()
|
||||||
|
self.rolloverFrame.destroy()
|
||||||
for panel in self.panels:
|
for panel in self.panels:
|
||||||
panel.destroy()
|
panel.destroy()
|
||||||
del self.panels
|
del self.panels
|
||||||
|
@ -335,6 +336,9 @@ class SuitPage(ShtikerPage.ShtikerPage):
|
||||||
yStart = -0.18
|
yStart = -0.18
|
||||||
xOffset = 0.199
|
xOffset = 0.199
|
||||||
yOffset = 0.284
|
yOffset = 0.284
|
||||||
|
self.rolloverFrame = DirectFrame(parent=self.panelNode, relief=None, geom=DGG.getDefaultDialogGeom(), geom_color=(0.5, 0.5, 0.5, 1), geom_scale=(0.73, 0, 0.55), text_scale=0.05, text_pos=(0, 0.2), text='', text_fg=(1, 1, 1, 1), pos=(0.44, 0, 0))
|
||||||
|
self.rolloverFrame.setBin('gui-popup', 0)
|
||||||
|
self.rolloverFrame.hide()
|
||||||
for dept in xrange(0, len(SuitDNA.suitDepts)):
|
for dept in xrange(0, len(SuitDNA.suitDepts)):
|
||||||
row = []
|
row = []
|
||||||
color = PANEL_COLORS[dept]
|
color = PANEL_COLORS[dept]
|
||||||
|
@ -347,10 +351,21 @@ class SuitPage(ShtikerPage.ShtikerPage):
|
||||||
panel.shadow = None
|
panel.shadow = None
|
||||||
panel.count = 0
|
panel.count = 0
|
||||||
panel.summonButton = None
|
panel.summonButton = None
|
||||||
|
panel.hoverButton = DirectButton(parent=panel, relief=None, image_scale=(0.15, 0, 0.225), image='phase_3/maps/invisible.png')
|
||||||
|
panel.hoverButton.setTransparency(True)
|
||||||
|
panel.hoverButton.panel = panel
|
||||||
self.addCogRadarLabel(panel)
|
self.addCogRadarLabel(panel)
|
||||||
self.panels.append(panel)
|
self.panels.append(panel)
|
||||||
base.panels.append(panel)
|
base.panels.append(panel)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def showInfo(self, panel, text, extra):
|
||||||
|
self.rolloverFrame.reparentTo(panel)
|
||||||
|
self.rolloverFrame.show()
|
||||||
|
self.rolloverFrame['text'] = text
|
||||||
|
|
||||||
|
def hideInfo(self, extra):
|
||||||
|
self.rolloverFrame.hide()
|
||||||
|
|
||||||
def addQuotaLabel(self, panel):
|
def addQuotaLabel(self, panel):
|
||||||
index = self.panels.index(panel)
|
index = self.panels.index(panel)
|
||||||
|
@ -428,6 +443,9 @@ class SuitPage(ShtikerPage.ShtikerPage):
|
||||||
panel.shadow.hide()
|
panel.shadow.hide()
|
||||||
if panel.summonButton:
|
if panel.summonButton:
|
||||||
panel.summonButton.hide()
|
panel.summonButton.hide()
|
||||||
|
self.rolloverFrame.hide()
|
||||||
|
panel.hoverButton.unbind(DGG.ENTER)
|
||||||
|
panel.hoverButton.unbind(DGG.EXIT)
|
||||||
color = PANEL_COLORS[dept]
|
color = PANEL_COLORS[dept]
|
||||||
panel['image_color'] = color
|
panel['image_color'] = color
|
||||||
for button in self.radarButtons:
|
for button in self.radarButtons:
|
||||||
|
@ -467,6 +485,28 @@ class SuitPage(ShtikerPage.ShtikerPage):
|
||||||
panel['image_color'] = PANEL_COLORS_COMPLETE1[index / SuitDNA.suitsPerDept]
|
panel['image_color'] = PANEL_COLORS_COMPLETE1[index / SuitDNA.suitsPerDept]
|
||||||
elif status == COG_COMPLETE2:
|
elif status == COG_COMPLETE2:
|
||||||
panel['image_color'] = PANEL_COLORS_COMPLETE2[index / SuitDNA.suitsPerDept]
|
panel['image_color'] = PANEL_COLORS_COMPLETE2[index / SuitDNA.suitsPerDept]
|
||||||
|
if status in (COG_DEFEATED, COG_COMPLETE1, COG_COMPLETE2):
|
||||||
|
name = SuitDNA.suitHeadTypes[index]
|
||||||
|
attributes = SuitBattleGlobals.SuitAttributes[name]
|
||||||
|
attacks = sorted(attributes['attacks'], key=lambda x: x[0])
|
||||||
|
groupAttacks = []
|
||||||
|
singleAttacks = []
|
||||||
|
|
||||||
|
for attack in attacks:
|
||||||
|
if attack[0] in SuitBattleGlobals.DisabledAttacks:
|
||||||
|
continue
|
||||||
|
if SuitBattleGlobals.SuitAttacks[attack[0]][1] == SuitBattleGlobals.ATK_TGT_GROUP:
|
||||||
|
groupAttacks.append(attack)
|
||||||
|
else:
|
||||||
|
singleAttacks.append(attack)
|
||||||
|
|
||||||
|
info = TTLocalizer.SuitPageAttackFormat % (self.getAttackStrings(groupAttacks), self.getAttackStrings(singleAttacks))
|
||||||
|
panel.hoverButton.bind(DGG.ENTER, self.showInfo, extraArgs=[panel, info])
|
||||||
|
panel.hoverButton.bind(DGG.EXIT, self.hideInfo)
|
||||||
|
|
||||||
|
def getAttackStrings(self, attacks):
|
||||||
|
string = '\n'.join(['%s %s' % (TTLocalizer.SuitAttackNames[attack[0]], '-'.join(str(x) for x in attack[1])) for attack in attacks])
|
||||||
|
return string if string else TTLocalizer.SuitPageNoAttacks
|
||||||
|
|
||||||
def updateAllCogs(self, status):
|
def updateAllCogs(self, status):
|
||||||
for index in xrange(0, len(base.localAvatar.cogs)):
|
for index in xrange(0, len(base.localAvatar.cogs)):
|
||||||
|
|
|
@ -8726,6 +8726,9 @@ ShardPageTeleport = 'Teleport to\n%s'
|
||||||
|
|
||||||
TeleportButton = 'Teleport'
|
TeleportButton = 'Teleport'
|
||||||
|
|
||||||
|
SuitPageAttackFormat = '\x01androidGreen\x01Group attacks:\x02\n%s\n\n\x01androidGreen\x01Regular attacks:\x02\n%s'
|
||||||
|
SuitPageNoAttacks = 'None'
|
||||||
|
|
||||||
Blacklist = [
|
Blacklist = [
|
||||||
"$1ut",
|
"$1ut",
|
||||||
"$h1t",
|
"$h1t",
|
||||||
|
|
Loading…
Reference in a new issue