コード例 #1
0
ファイル: ShtikerBook.py プロジェクト: Grant11/mf0DJnN
    def exit(self):
        if not self.entered:
            return
        self.entered = 0
        messenger.send('stickerBookExited')
        base.playSfx(self.closeSound)
        self.pages[self.currPageIndex].exit()
        base.render.show()
        setBlackBackground = 0
        for obj in base.cr.doId2do.values():
            if isinstance(obj, DistributedFireworkShow.DistributedFireworkShow) or isinstance(obj, DistributedPartyFireworksActivity.DistributedPartyFireworksActivity):
                setBlackBackground = 1

        if setBlackBackground:
            base.setBackgroundColor(Vec4(0, 0, 0, 1))
        else:
            base.setBackgroundColor(ToontownGlobals.DefaultBackgroundColor)
        gsg = base.win.getGsg()
        if gsg:
            base.render.prepareScene(gsg)
        NametagGlobals.setMin2dAlpha(self.oldMin2dAlpha)
        NametagGlobals.setMax2dAlpha(self.oldMax2dAlpha)
        base.setCellsAvailable([base.rightCells[0]], 1)
        self.__isOpen = 0
        self.hide()
        self.hideButton()
        cleanupDialog('globalDialog')
        self.pageTabFrame.hide()
        self.ignore('shtiker-page-done')
        self.ignore(ToontownGlobals.StickerBookHotkey)
        self.ignore(ToontownGlobals.OptionsPageHotkey)
        self.ignore('arrow_right')
        self.ignore('arrow_left')
        if config.GetBool('want-qa-regression', 0):
            self.notify.info('QA-REGRESSION: SHTICKERBOOK: Close')
コード例 #2
0
ファイル: ShtikerBook.py プロジェクト: Grant11/mf0DJnN
 def enter(self):
     if config.GetBool('want-qa-regression', 0):
         self.notify.info('QA-REGRESSION: SHTICKERBOOK: Open')
     if self.entered:
         return
     self.entered = 1
     messenger.send('releaseDirector')
     messenger.send('stickerBookEntered')
     base.playSfx(self.openSound)
     base.disableMouse()
     base.render.hide()
     base.setBackgroundColor(0.05, 0.15, 0.4)
     base.setCellsAvailable([base.rightCells[0]], 0)
     self.oldMin2dAlpha = NametagGlobals.getMin2dAlpha()
     self.oldMax2dAlpha = NametagGlobals.getMax2dAlpha()
     NametagGlobals.setMin2dAlpha(0.8)
     NametagGlobals.setMax2dAlpha(1.0)
     self.__isOpen = 1
     self.__setButtonVisibility()
     self.show()
     self.showPageArrows()
     if not self.safeMode:
         self.accept('shtiker-page-done', self.__pageDone)
         self.accept(ToontownGlobals.StickerBookHotkey, self.__close)
         self.accept(ToontownGlobals.OptionsPageHotkey, self.__close)
         self.pageTabFrame.show()
     self.pages[self.currPageIndex].enter()
     if hasattr(localAvatar, 'newsButtonMgr') and localAvatar.newsButtonMgr:
         localAvatar.newsButtonMgr.hideNewIssueButton()