def __init__(self, node):
     AnimatedProp.AnimatedProp.__init__(self, node)
     self.fish = Actor.Actor()
     self.fish.reparentTo(self.node.getParent())
     self.fish.setTransform(self.node.getTransform())
     self.node.clearMat()
     self.fish.prepareBundle(self.node)
     self.fish.loadAnims({
         'jump': 'phase_4/models/props/SZ_fish-jump',
         'swim': 'phase_4/models/props/SZ_fish-swim'
     })
     self.splashSfxList = (
         loader.loadSfx('phase_4/audio/sfx/TT_splash1.mp3'),
         loader.loadSfx('phase_4/audio/sfx/TT_splash2.mp3'))
     self.node = self.fish
     self.geom = self.fish.getGeomNode()
     self.exitRipples = Ripples(self.geom)
     self.exitRipples.setBin('fixed', 25, 1)
     self.exitRipples.setPosHprScale(-0.3, 0.0, 1.24, 0.0, 0.0, 0.0, 0.7,
                                     0.7, 0.7)
     self.splash = Splash(self.geom)
     self.splash.setPosHprScale(-1, 0.0, 1.23, 0.0, 0.0, 0.0, 0.7, 0.7, 0.7)
     randomSplash = random.choice(self.splashSfxList)
     self.track = Sequence(FunctionInterval(self.randomizePosition),
                           Parallel(
                               self.fish.actorInterval('jump'),
                               Sequence(Wait(0.25),
                                        Func(self.exitRipples.play, 0.75)),
                               Sequence(
                                   Wait(1.14), Func(self.splash.play),
                                   SoundInterval(randomSplash,
                                                 volume=0.8,
                                                 node=self.node))),
                           Wait(5 + 10 * random.random()),
                           name=self.uniqueName('Fish'))
    def load(self):
        self.notify.debug('load')
        DistributedMinigame.load(self)
        self.sky = loader.loadModel('phase_3.5/models/props/TT_sky')
        self.ground = loader.loadModel('phase_4/models/minigames/toon_cannon_gameground')
        self.tower = loader.loadModel('phase_4/models/minigames/toon_cannon_water_tower')
        self.cannon = loader.loadModel('phase_4/models/minigames/toon_cannon')
        self.dropShadow = loader.loadModel('phase_3/models/props/drop_shadow')
        self.hill = loader.loadModel('phase_4/models/minigames/cannon_hill')
        self.sky.setScale(WORLD_SCALE)
        self.ground.setScale(GROUND_SCALE)
        self.cannon.setScale(CANNON_SCALE)
        self.dropShadow.setColor(0, 0, 0, 0.5)
        self.ground.setColor(0.84999999999999998, 0.84999999999999998, 0.84999999999999998, 1.0)
        self.hill.setScale(1, 1, CANNON_Z / 20.0)
        self.dropShadow.setBin('fixed', 0, 1)
        self.splash = Splash.Splash(render)
        self.dustCloud = DustCloud.DustCloud(render)
        purchaseModels = loader.loadModel('phase_4/models/gui/purchase_gui')
        self.jarImage = purchaseModels.find('**/Jar')
        self.jarImage.reparentTo(hidden)
        self.rewardPanel = DirectLabel(parent = hidden, relief = None, pos = (1.1599999999999999, 0.0, 0.45000000000000001), scale = 0.65000000000000002, text = '', text_scale = 0.20000000000000001, text_fg = (0.94999999999999996, 0.94999999999999996, 0, 1), text_pos = (0, -0.13), text_font = ToontownGlobals.getSignFont(), image = self.jarImage)
        self.rewardPanelTitle = DirectLabel(parent = self.rewardPanel, relief = None, pos = (0, 0, 0.059999999999999998), scale = 0.080000000000000002, text = Localizer.CannonGameReward, text_fg = (0.94999999999999996, 0.94999999999999996, 0, 1), text_shadow = (0, 0, 0, 1))
        self.music = base.loadMusic('phase_4/audio/bgm/MG_cannon_game.mid')
        self.sndCannonMove = base.loadSfx('phase_4/audio/sfx/MG_cannon_adjust.mp3')
        self.sndCannonFire = base.loadSfx('phase_4/audio/sfx/MG_cannon_fire_alt.mp3')
        self.sndHitGround = base.loadSfx('phase_4/audio/sfx/MG_cannon_hit_dirt.mp3')
        self.sndHitTower = base.loadSfx('phase_4/audio/sfx/MG_cannon_hit_tower.mp3')
        self.sndHitWater = base.loadSfx('phase_4/audio/sfx/MG_cannon_splash.mp3')
        self.sndWhizz = base.loadSfx('phase_4/audio/sfx/MG_cannon_whizz.mp3')
        self.sndWin = base.loadSfx('phase_4/audio/sfx/MG_win.mp3')
        self.sndRewardTick = base.loadSfx('phase_3.5/audio/sfx/tick_counter.mp3')
        guiModel = 'phase_4/models/gui/cannon_game_gui'
        cannonGui = loader.loadModel(guiModel)
        self.aimPad = DirectFrame(image = cannonGui.find('**/CannonFire_PAD'), relief = None, pos = (0.69999999999999996, 0, -0.55333299999999996), scale = 0.80000000000000004)
        cannonGui.removeNode()
        self.aimPad.hide()
        self.fireButton = DirectButton(parent = self.aimPad, image = ((guiModel, '**/Fire_Btn_UP'), (guiModel, '**/Fire_Btn_DN'), (guiModel, '**/Fire_Btn_RLVR')), relief = None, pos = (0.0115741, 0, 0.0050505100000000002), scale = 1.0, command = self._DistributedCannonGame__firePressed)
        self.upButton = DirectButton(parent = self.aimPad, image = ((guiModel, '**/Cannon_Arrow_UP'), (guiModel, '**/Cannon_Arrow_DN'), (guiModel, '**/Cannon_Arrow_RLVR')), relief = None, pos = (0.0115741, 0, 0.221717))
        self.downButton = DirectButton(parent = self.aimPad, image = ((guiModel, '**/Cannon_Arrow_UP'), (guiModel, '**/Cannon_Arrow_DN'), (guiModel, '**/Cannon_Arrow_RLVR')), relief = None, pos = (0.0136112, 0, -0.21010100000000001), image_hpr = (0, 0, 180))
        self.leftButton = DirectButton(parent = self.aimPad, image = ((guiModel, '**/Cannon_Arrow_UP'), (guiModel, '**/Cannon_Arrow_DN'), (guiModel, '**/Cannon_Arrow_RLVR')), relief = None, pos = (-0.199352, 0, -0.00050526900000000003), image_hpr = (0, 0, 90))
        self.rightButton = DirectButton(parent = self.aimPad, image = ((guiModel, '**/Cannon_Arrow_UP'), (guiModel, '**/Cannon_Arrow_DN'), (guiModel, '**/Cannon_Arrow_RLVR')), relief = None, pos = (0.219167, 0, -0.0010102399999999999), image_hpr = (0, 0, -90))
        self.aimPad.setColor(1, 1, 1, 0.90000000000000002)
        
        def bindButton(button, upHandler, downHandler):
            button.bind(B1PRESS, lambda x, handler = upHandler: handler())
            button.bind(B1RELEASE, lambda x, handler = downHandler: handler())

        bindButton(self.upButton, self._DistributedCannonGame__upPressed, self._DistributedCannonGame__upReleased)
        bindButton(self.downButton, self._DistributedCannonGame__downPressed, self._DistributedCannonGame__downReleased)
        bindButton(self.leftButton, self._DistributedCannonGame__leftPressed, self._DistributedCannonGame__leftReleased)
        bindButton(self.rightButton, self._DistributedCannonGame__rightPressed, self._DistributedCannonGame__rightReleased)
        self.timer = ToontownTimer.ToontownTimer()
        self.timer.posInTopRightCorner()
        self.timer.hide()
        self.DEBUG_TOWER_RANGE = 0
        self.DEBUG_CANNON_FAR_LEFT = 0
        self.DEBUG_TOWER_NEAR = 1
        self.DEBUG_TOWER_FAR_LEFT = 1
        self.cheat = config.GetBool('cannon-game-cheat', 0)
    def __init__(self):
        super(Main, self).__init__(title="ArchLinux BetterLockScreen")
        self.set_border_width(10)
        self.set_default_size(700, 460)
        self.connect("delete-event", self.close)
        self.set_icon_from_file(
            fn.os.path.join(GUI.base_dir, 'images/archlinux.png'))
        self.set_position(Gtk.WindowPosition.CENTER)

        self.timeout_id = None
        self.image_path = None

        if not fn.os.path.isdir(fn.config):
            fn.os.mkdir(fn.config)

        if not fn.os.path.isfile(fn.config + fn.settings):
            with open(fn.config + fn.settings, "w") as f:
                f.write("path=")
                f.close()

        self.loc = Gtk.Entry()
        self.search = Gtk.Entry()
        self.status = Gtk.Label(label="")
        self.hbox3 = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL,
                             spacing=10)
        scrolled = Gtk.ScrolledWindow()
        scrolled.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)

        self.fb = Gtk.FlowBox()
        self.fb.set_valign(Gtk.Align.START)
        self.fb.set_max_children_per_line(6)
        self.fb.set_selection_mode(Gtk.SelectionMode.SINGLE)
        self.fb.connect("child-activated", self.on_item_clicked)
        # self.create_flowbox(fb)

        scrolled.add(self.fb)

        self.hbox3.pack_start(scrolled, True, True, 0)

        splScr = Splash.splashScreen()

        while Gtk.events_pending():
            Gtk.main_iteration()
        # self.create_flowbox(self.loc.get_text())
        t = th.Thread(target=self.create_flowbox,
                      args=(self.loc.get_text(), False))
        t.daemon = True
        t.start()
        t.join()

        splScr.destroy()

        GUI.GUI(self, Gtk, GdkPixbuf, Gdk, th, fn)

        with open("/tmp/archlinux-betterlock.lock", "w") as f:
            f.write("")
            f.close()
Example #4
0
    def __init__(self):
        if sys.platform == "darwin":
            if len(sys.argv) > 1 and sys.argv[1].startswith("-psn"):
                home = os.getenv("HOME")
                if home:
                    os.chdir(home)
        self.preffilepath = os.path.join("Python", "PythonIDE preferences")
        Wapplication.Application.__init__(self, 'Pide')
        from Carbon import AE
        from Carbon import AppleEvents

        AE.AEInstallEventHandler(AppleEvents.kCoreEventClass,
                                 AppleEvents.kAEOpenApplication,
                                 self.ignoreevent)
        AE.AEInstallEventHandler(AppleEvents.kCoreEventClass,
                                 AppleEvents.kAEReopenApplication,
                                 self.ignoreevent)
        AE.AEInstallEventHandler(AppleEvents.kCoreEventClass,
                                 AppleEvents.kAEPrintDocuments,
                                 self.ignoreevent)
        AE.AEInstallEventHandler(AppleEvents.kCoreEventClass,
                                 AppleEvents.kAEOpenDocuments,
                                 self.opendocsevent)
        AE.AEInstallEventHandler(AppleEvents.kCoreEventClass,
                                 AppleEvents.kAEQuitApplication,
                                 self.quitevent)
        import PyConsole, PyEdit
        Splash.wait()
        # With -D option (OSX command line only) keep stderr, for debugging the IDE
        # itself.
        debug_stderr = None
        if len(sys.argv) >= 2 and sys.argv[1] == '-D':
            debug_stderr = sys.stderr
            del sys.argv[1]
        PyConsole.installoutput()
        PyConsole.installconsole()
        if debug_stderr:
            sys.stderr = debug_stderr
        for path in sys.argv[1:]:
            if path.startswith("-p"):
                # process number added by the OS
                continue
            self.opendoc(path)
        self.mainloop()
 def playSplashEffect(self, x, y, z):
     import Splash
     if self.splash == None:
         self.splash = Splash.Splash(render)
     
     self.splash.setPos(x, y, z)
     self.splash.setScale(2)
     self.splash.play()
     place = toonbase.tcr.playGame.getPlace()
     base.playSfx(place.loader.submergeSound)
Example #6
0
    def OnInit(self):
        RotinasGlobais.Rotinas = RotinasGlobais()
        ConsultasSQL.ConsSQL = ConsultasSQL()
        Principal.fPrincipal = Principal.create(None)
        self.SetTopWindow(Principal.fPrincipal)

        if not RotinasGlobais.Rotinas.ConectaBanco("ACLivrus","",""):
          wxMessageBox(Resource.STR_NCONBANCO,"Erro", wxOK | wxICON_ERROR)
          return False
               
        fSplash = Splash.create(None)
        fSplash.Show()  
        return True
    def __init__(self):
        if sys.platform == "darwin":
            if len(sys.argv) > 1 and sys.argv[1].startswith("-psn"):
                home = os.getenv("HOME")
                if home:
                    os.chdir(home)
        self.preffilepath = os.path.join("Python", "PythonIDE preferences")
        Wapplication.Application.__init__(self, 'Pide')
        from Carbon import AE
        from Carbon import AppleEvents

        AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEOpenApplication,
                        self.ignoreevent)
        AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEReopenApplication,
                        self.ignoreevent)
        AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEPrintDocuments,
                        self.ignoreevent)
        AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEOpenDocuments,
                        self.opendocsevent)
        AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEQuitApplication,
                        self.quitevent)
        import PyConsole, PyEdit
        Splash.wait()
        # With -D option (OSX command line only) keep stderr, for debugging the IDE
        # itself.
        debug_stderr = None
        if len(sys.argv) >= 2 and sys.argv[1] == '-D':
            debug_stderr = sys.stderr
            del sys.argv[1]
        PyConsole.installoutput()
        PyConsole.installconsole()
        if debug_stderr:
            sys.stderr = debug_stderr
        for path in sys.argv[1:]:
            if path.startswith("-p"):
                # process number added by the OS
                continue
            self.opendoc(path)
        self.mainloop()
class FishAnimatedProp(AnimatedProp.AnimatedProp):
    
    def __init__(self, node):
        AnimatedProp.AnimatedProp.__init__(self, node)
        self.fish = Actor.Actor()
        self.fish.reparentTo(self.node.getParent())
        self.fish.setTransform(self.node.getTransform())
        self.node.clearMat()
        self.fish.prepareBundle(self.node)
        self.fish.loadAnims({
            'jump': 'phase_4/models/props/SZ_fish-jump',
            'swim': 'phase_4/models/props/SZ_fish-swim' })
        self.splashSfxList = (loader.loadSfx('phase_4/audio/sfx/TT_splash1.mp3'), loader.loadSfx('phase_4/audio/sfx/TT_splash2.mp3'))
        self.node = self.fish
        self.geom = self.fish.getGeomNode()
        self.exitRipples = Ripples(self.geom)
        self.exitRipples.setBin('fixed', 25, 1)
        self.exitRipples.setPosHprScale(-0.29999999999999999, 0.0, 1.24, 0.0, 0.0, 0.0, 0.69999999999999996, 0.69999999999999996, 0.69999999999999996)
        self.splash = Splash(self.geom)
        self.splash.setPosHprScale(-1, 0.0, 1.23, 0.0, 0.0, 0.0, 0.69999999999999996, 0.69999999999999996, 0.69999999999999996)
        randomSplash = random.choice(self.splashSfxList)
        self.track = Sequence(FunctionInterval(self.randomizePosition), Parallel(self.fish.actorInterval('jump'), Sequence(Wait(0.25), Func(self.exitRipples.play, 0.75)), Sequence(Wait(1.1399999999999999), Func(self.splash.play), SoundInterval(randomSplash, volume = 0.80000000000000004, node = self.node))), Wait(5 + 10 * random.random()), name = self.uniqueName('Fish'))

    
    def delete(self):
        self.exitRipples.destroy()
        del self.exitRipples
        self.splash.destroy()
        del self.splash
        del self.track
        self.fish.removeNode()
        del self.fish
        del self.node
        del self.geom

    
    def randomizePosition(self):
        x = 5 * (random.random() - 0.5)
        y = 5 * (random.random() - 0.5)
        h = 360 * random.random()
        self.geom.setPos(x, y, 0)
        self.geom.setHpr(h, 0, 0)

    
    def enter(self):
        AnimatedProp.AnimatedProp.enter(self)
        self.track.loop()

    
    def exit(self):
        AnimatedProp.AnimatedProp.exit(self)
        self.track.stop()
        self.splash.stop()
        self.exitRipples.stop()
Example #9
0
def main():
    LivrusApp = FXApp("Livrus", Resource.STR_TITULO)

    RotinasGlobais.Rotinas = RotinasGlobais()
    ConsultasSQL.ConsSQL = ConsultasSQL()
    Principal.fPrincipal = Principal.create(LivrusApp)
    Login.fLogin = Login.create(Principal.fPrincipal)
    Splash.fSplash = Splash.create(Principal.fPrincipal)

    LivrusApp.init(sys.argv)
    LivrusApp.create()

    if not RotinasGlobais.Rotinas.ConectaBanco("ACLivrus", "", ""):
        return False
    else:
        #Splash.fSplash.iniciaTimer()
        #Splash.fSplash.show(PLACEMENT_SCREEN)
        Principal.fPrincipal.show(PLACEMENT_SCREEN)

    LivrusApp.run()
Example #10
0
 def do_about(self, id, item, window, event):
     Splash.about()
Example #11
0
 def logout(self):
     log = Splash.Login(self.Frame2)
     AdminPage1.withdraw(self)
     messagebox.showinfo("Logged out", "You have successfully logged out..")
Example #12
0
class FishAnimatedProp(AnimatedProp.AnimatedProp):
    def __init__(self, node):
        AnimatedProp.AnimatedProp.__init__(self, node)
        self.fish = Actor.Actor()
        self.fish.reparentTo(self.node.getParent())
        self.fish.setTransform(self.node.getTransform())
        self.node.clearMat()
        self.fish.prepareBundle(self.node)
        self.fish.loadAnims({
            'jump': 'phase_4/models/props/SZ_fish-jump',
            'swim': 'phase_4/models/props/SZ_fish-swim'
        })
        self.splashSfxList = (
            loader.loadSfx('phase_4/audio/sfx/TT_splash1.mp3'),
            loader.loadSfx('phase_4/audio/sfx/TT_splash2.mp3'))
        self.node = self.fish
        self.geom = self.fish.getGeomNode()
        self.exitRipples = Ripples(self.geom)
        self.exitRipples.setBin('fixed', 25, 1)
        self.exitRipples.setPosHprScale(-0.29999999999999999, 0.0, 1.24, 0.0,
                                        0.0, 0.0, 0.69999999999999996,
                                        0.69999999999999996,
                                        0.69999999999999996)
        self.splash = Splash(self.geom)
        self.splash.setPosHprScale(-1, 0.0, 1.23, 0.0, 0.0, 0.0,
                                   0.69999999999999996, 0.69999999999999996,
                                   0.69999999999999996)
        randomSplash = random.choice(self.splashSfxList)
        self.track = Sequence(FunctionInterval(self.randomizePosition),
                              Parallel(
                                  self.fish.actorInterval('jump'),
                                  Sequence(Wait(0.25),
                                           Func(self.exitRipples.play, 0.75)),
                                  Sequence(
                                      Wait(1.1399999999999999),
                                      Func(self.splash.play),
                                      SoundInterval(randomSplash,
                                                    volume=0.80000000000000004,
                                                    node=self.node))),
                              Wait(5 + 10 * random.random()),
                              name=self.uniqueName('Fish'))

    def delete(self):
        self.exitRipples.destroy()
        del self.exitRipples
        self.splash.destroy()
        del self.splash
        del self.track
        self.fish.removeNode()
        del self.fish
        del self.node
        del self.geom

    def randomizePosition(self):
        x = 5 * (random.random() - 0.5)
        y = 5 * (random.random() - 0.5)
        h = 360 * random.random()
        self.geom.setPos(x, y, 0)
        self.geom.setHpr(h, 0, 0)

    def enter(self):
        AnimatedProp.AnimatedProp.enter(self)
        self.track.loop()

    def exit(self):
        AnimatedProp.AnimatedProp.exit(self)
        self.track.stop()
        self.splash.stop()
        self.exitRipples.stop()
 def do_about(self, id, item, window, event):
     Splash.about()