else:
                                    print("=============================")
                                    print("[ ! ] Unrecognized Command.")
                                    print("=============================")
                                    print("\n")
                                    print("=============================")
                                    print("\n")
                                    continue
                            if file_name >= 'a':

                                print(
                                    "[ ! ] Enter a number or < x > to finish.")
                                continue
                            else:
                                _pk = pk.Pokemon()
                                sb.StatusBar()

                                if int(option) == 0:
                                    _pk.get_stats_hp()
                                elif int(option) == 1:
                                    _pk.get_stats_attack()
                                elif int(option) == 2:
                                    _pk.get_stats_defence()

                        else:

                            if os.stat(files[int(file_name)]).st_size != 0:

                                _wc = wc.WordsCounter(files[int(file_name)])
                                _wc.show_name()
Example #2
0
        Ignored unless useStateTags True at instantiation.
        """
        for state in (RO.Constants.sevWarning, RO.Constants.sevError):
            self.tag_configure(state,
                               color=self._sevPrefDict[state].getValue())


if __name__ == "__main__":
    from RO.Wdg.PythonTk import PythonTk
    import StatusBar
    root = PythonTk()

    text1 = Text(root, "text widget", height=5, width=20)
    text2 = Text(root,
                 readOnly=True,
                 helpText="read only text widget",
                 height=5,
                 width=20)
    statusBar = StatusBar.StatusBar(root)
    text1.grid(row=0, column=0, sticky="nsew")
    text2.grid(row=1, column=0, sticky="nsew")
    statusBar.grid(row=2, column=0, sticky="ew")
    root.grid_rowconfigure(0, weight=1)
    root.grid_rowconfigure(1, weight=1)
    root.grid_columnconfigure(0, weight=1)

    text1.insert("end", "this is an editable text widget\n")
    text2.insert("end", "this is a read-only text widget\n")

    root.mainloop()
Example #3
0
    def __init__(self, master, name, dispatcher=None, **kargs):
        Tkinter.Frame.__init__(self, master, **kargs)

        srArgs = self._getScriptFuncs(isFirst=True)
        helpURL = srArgs.pop("HelpURL", None)

        row = 0

        self.scriptFrame = Tkinter.Frame(self)
        self.scriptFrame.grid(row=row, column=0, sticky="news")
        self.scriptFrameRow = row
        self.rowconfigure(row, weight=1)
        self.columnconfigure(0, weight=1)
        row += 1

        scriptStatusBar = StatusBar.StatusBar(
            master=self,
            helpURL=helpURL,
            helpText="script status and messages",
        )
        scriptStatusBar.grid(row=row, column=0, sticky="ew")
        row += 1

        cmdStatusBar = StatusBar.StatusBar(
            master=self,
            dispatcher=dispatcher,
            summaryLen=30,
            playCmdSounds=False,
            helpURL=helpURL,
        )
        cmdStatusBar.grid(row=row, column=0, sticky="ew")
        row += 1

        buttonFrame = Tkinter.Frame(self)
        startButton = Button.Button(
            master=buttonFrame,
            text="Start",
            helpText="Start the script",
            helpURL=helpURL,
        )
        startButton.pack(side="left")
        pauseButton = Button.Button(
            master=buttonFrame,
            helpURL=helpURL,
        )
        pauseButton.pack(side="left")
        cancelButton = Button.Button(
            master=buttonFrame,
            text="Cancel",
            helpText="Halt the script",
            helpURL=helpURL,
        )
        cancelButton.pack(side="left")
        buttonFrame.grid(row=row, column=0, sticky="w")
        row += 1

        # set up contextual menu functions for all widgets
        # (except script frame, which is handled in reload)
        startButton.ctxSetConfigFunc(self._setCtxMenu)
        pauseButton.ctxSetConfigFunc(self._setCtxMenu)
        cancelButton.ctxSetConfigFunc(self._setCtxMenu)
        scriptStatusBar.ctxSetConfigFunc(self._setCtxMenu)
        cmdStatusBar.ctxSetConfigFunc(self._setCtxMenu)

        BasicScriptWdg.__init__(self,
                                master=self.scriptFrame,
                                name=name,
                                dispatcher=dispatcher,
                                statusBar=scriptStatusBar,
                                cmdStatusBar=cmdStatusBar,
                                startButton=startButton,
                                pauseButton=pauseButton,
                                cancelButton=cancelButton,
                                **srArgs)
Example #4
0
    def __init__(self):

        #Game states, tells the game what code to run depending on the current state
        self.__states = {const.GAME_STATE_MENU : self.stateMainMenu,
          const.GAME_STATE_RUNNING           : self.stateGameRunning,
          const.GAME_STATE_PLAYER_DEAD       : self.statePlayerDead,
          const.GAME_STATE_PLAYER_WINS       : self.statePlayerWins,
          const.GAME_STATE_QUITTING          : self.stateQuitting,
          const.GAME_STATE_HIGHSCORES        : self.stateHighScores}

        #Initialize pygame
        pygame.init()

        #Setup music and sound
        self.musicFile = str(Path.cwd() / "sounds" / "music1.mp3")
        pygame.mixer.pre_init(44100, -16, 2, 2048)
        pygame.mixer.init()
        pygame.mixer.music.load(self.musicFile)

        self.explodeSound = pygame.mixer.Sound(str(Path.cwd() / "sounds" / "bomb.wav"))
        self.deathSound = pygame.mixer.Sound(str(Path.cwd() / "sounds" / "yell.wav"))
        self.bossDieSound = pygame.mixer.Sound(str(Path.cwd() / "sounds" / "boss_no.wav"))

        #Setup misc pygame settings such as clock for timers and font for text
        self.__clock = pygame.time.Clock()
        self.start_ticks = 0.0
        self.font = pygame.font.Font(None, const.FONT_SIZE)

        #Setup game progression booleans
        self.gameRunning = True
        self.gameOver = False
        self.playerWins = False
        self.exitingToMenu = False
        self.musicOn = True
        self.soundOn = True

        #Makes game start in main menu
        self.gameState = const.GAME_STATE_MENU

        #Setup screen parameters and the pygame window
        self.__screenWidth = const.MAP_WIDTH * const.TILE_SIZE + const.SCREEN_OFFSET_X_LEFT + const.SCREEN_OFFSET_X_RIGHT
        self.__screenHeight = const.MAP_HEIGHT * const.TILE_SIZE + const.SCREEN_OFFSET_Y_TOP + const.SCREEN_OFFSET_Y_BOTTOM
        self.__screenSize = self.__screenWidth, self.__screenHeight
        self.__screen = pygame.display.set_mode(self.screenSize)
        pygame.display.set_caption("BomberDude")
        self.screenImage = pygame.Surface(self.screenSize)    #used to store the screen to an image, useful for semi-transparent screens 

        #Setup the MainMenu and High scores Screen
        self.theMainMenu = MainMenu.MainMenu(self.screen, self.__screenWidth, self.__screenHeight)
        self.highScores = HighScore.HighScore(self.screen, self.__screenWidth, self.__screenHeight)

        #Load starting level
        self.levelNum = 1
        self.level, self.player, self.enemies, self.boss = Level.startNewLevel(self.levelNum)

        #Retreive total number of levels stored in data directory, requires levels to be numbered sequentially
        self.numLevels = 0
        dataDir = Path.cwd() / "data"
        for f in dataDir.glob("level*.csv"):
            self.numLevels += 1

        #Create sprite groups for all game sprite objects
        self.spritePlayer = pygame.sprite.Group()
        self.spritePlayer.add(self.player)
        self.spriteEnemies = pygame.sprite.Group()
        self.spriteEnemies.add(self.enemies)
        self.spriteBombs = pygame.sprite.Group()
        self.spriteBombBlasts = pygame.sprite.Group()
        self.spriteBossBombBlasts = pygame.sprite.Group()
        self.spritePowerups = pygame.sprite.Group()

        #Create status bar for displaying player information at top of screen
        self.statusBar = StatusBar.StatusBar(0, 0)
        self.statusBar.addIcon("Down.png", 0, True)
        self.statusBar.addIcon("powerup_boot.png", 2, False, const.ICON_SCALE + 5)  #This is offset because the graphic is a little smaller than the icons
        self.statusBar.addIcon("powerup_range.png", 3, False)
        self.statusBar.addIcon("powerup_count.png", 4, False)

        #Player death screen
        imageFile = str(Path.cwd() / "graphics" / "death_screen.png")
        self.deathScreen = pygame.image.load(imageFile).convert_alpha()
        self.smallScreenRect = self.deathScreen.get_rect()
        self.smallScreenRect.x = int(self.__screenWidth / 2 - self.smallScreenRect.width / 2)
        self.smallScreenRect.y = int(self.__screenHeight / 2 - self.smallScreenRect.height / 2)

        #Game over screen image
        imageFile = str(Path.cwd() / "graphics" / "game_over_screen.png")    
        self.gameOverImage = pygame.image.load(imageFile).convert_alpha()

        #Player win screen image
        imageFile = str(Path.cwd() / "graphics" / "you_win_screen.png")
        self.playerWinsImage = pygame.image.load(imageFile).convert_alpha()

        #Screen border image
        imageFile = str(Path.cwd() / "graphics" / "border.png")
        self.borderImage = pygame.image.load(imageFile).convert()

        #Debug mode allows cheats, only for developer use
        self.__debugMode = True
Example #5
0
        return self._projectView().JB

    def FV(self):
        return self._projectView().FV


if __name__ == '__main__':
    root = tk.Tk()

    root.grid_propagate(0)
    root.rowconfigure(0, weight=1)
    root.columnconfigure(0, weight=1)
    root.configure(width=800, height=600)

    pv = ProjectViewer(root)
    sb = StatusBar(root)
    pv.grid(sticky=tkSticky.fill)
    sb.grid(sticky=tkSticky.horizontal + tkSticky.bottom)
    '''
	Add an app icon
	Taken from:
	http://stackoverflow.com/questions/16081201/setting-application-icon-in-my-python-tk-base-application-on-ubuntu

	This works on Windows and Ubuntu only
	'''
    # img = tk.Image("photo", file="icon_appicon.gif")
    img = Icon.appIcon()
    root.tk.call('wm', 'iconphoto', root._w, img)

    root.iconify()
    root.update()
Example #6
0
def beforeTriggerExec():
    # (Line 77) sca.Exec();
    EUDTraceLog(77)
    sca.Exec()
    # (Line 80) sys.AllyCheck();
    EUDTraceLog(80)
    sys.AllyCheck()
    # (Line 81) foreach (cp : EUDLoopPlayer()) {
    for cp in EUDLoopPlayer():
        # (Line 82) setcurpl(cp);
        EUDTraceLog(82)
        f_setcurpl(cp)
        # (Line 83) bgm.Play();
        EUDTraceLog(83)
        bgm.Play()
        # (Line 84) sys.GetDeath();
        EUDTraceLog(84)
        sys.GetDeath()
        # (Line 85) sys.GetMousePos();
        EUDTraceLog(85)
        sys.GetMousePos()
        # (Line 86) cheat.Cheat();
        EUDTraceLog(86)
        cheat.Cheat()
        # (Line 88) if(user.isAlive[cp] == 1) {
        _t1 = EUDIf()
        EUDTraceLog(88)
        if _t1(user.isAlive[cp] == 1):
            # (Line 89) user.posX[cp], user.posY[cp] = dwbreak(dwread_epd(user.character[cp] + 0x28 / 4))[[0,1]];
            EUDTraceLog(89)
            _SV([_ARRW(user.posX, cp), _ARRW(user.posY, cp)], [_SRET(f_dwbreak(f_dwread_epd(user.character[cp] + 0x28 // 4)), [0, 1])])
            # (Line 90) }
            # (Line 97) if(user.isAlive[cp] == 1) {
        EUDEndIf()
        _t2 = EUDIf()
        EUDTraceLog(97)
        if _t2(user.isAlive[cp] == 1):
            # (Line 98) if(MemoryXEPD(user.character[cp] + 0x4D / 4, Exactly, 3 << 8, 0xFF00)) {
            _t3 = EUDIf()
            EUDTraceLog(98)
            if _t3(MemoryXEPD(user.character[cp] + 0x4D // 4, Exactly, _LSH(3,8), 0xFF00)):
                # (Line 99) SetMemoryXEPD(user.character[cp] + 0x4D / 4, SetTo, 107 << 8 , 0xFF00);
                # (Line 100) }
                EUDTraceLog(99)
                DoActions(SetMemoryXEPD(user.character[cp] + 0x4D // 4, SetTo, _LSH(107,8), 0xFF00))
                # (Line 101) }
            EUDEndIf()
            # (Line 103) guard.Guard();
        EUDEndIf()
        EUDTraceLog(103)
        guard.Guard()
        # (Line 105) status.StatusBar(); // 상태바
        EUDTraceLog(105)
        status.StatusBar()
        # (Line 106) screen.LightCheck(); // 밝기 조절
        EUDTraceLog(106)
        screen.LightCheck()
        # (Line 107) potal.PotalCheck(); // 포탈 이동
        EUDTraceLog(107)
        potal.PotalCheck()
        # (Line 108) sys.PlayerLoc(); // 플레이어 로케이션
        EUDTraceLog(108)
        sys.PlayerLoc()
        # (Line 109) sys.ExpCheck(); // 경험치 변동 체크
        EUDTraceLog(109)
        sys.ExpCheck()
        # (Line 110) kill.KillCheck(); // 플레이어 킬 체크
        EUDTraceLog(110)
        kill.KillCheck()
        # (Line 112) inven.Inventory(); // 인벤토리
        EUDTraceLog(112)
        inven.Inventory()
        # (Line 113) equip.Equip(); // 장비
        EUDTraceLog(113)
        equip.Equip()
        # (Line 116) memory.MemoryCrystal(); // 저장 크리스탈
        EUDTraceLog(116)
        memory.MemoryCrystal()
        # (Line 117) save.SaveCheck(); // 저장
        EUDTraceLog(117)
        save.SaveCheck()
        # (Line 119) key.KeyDetect(cp);
        EUDTraceLog(119)
        key.KeyDetect(cp)
        # (Line 120) chat.ChatDetect(cp);
        EUDTraceLog(120)
        chat.ChatDetect(cp)
        # (Line 121) screen.WideCheckExec();
        EUDTraceLog(121)
        screen.WideCheckExec()
        # (Line 124) }
        # (Line 125) unit.clickedUnit();

    EUDTraceLog(125)
    unit.f_clickedUnit()
    # (Line 136) SetMemory(0x5124F0, SetTo, 28);
    # (Line 137) }
    EUDTraceLog(136)
    DoActions(SetMemory(0x5124F0, SetTo, 28))
Example #7
0
    menu3.grid(row=1, column=1, sticky="w")

    menu4 = OptionMenu(root,
        items = items,
        defValue = "MmmmmNnnnn A",
        callFunc = callFunc,
        defMenu = "Default",
        indicatoron = False,
        helpText = "indicatoron=False",
    )
    menu4.grid(row=0, column=2, sticky="w")

    menu5 = OptionMenu(root,
        items = items,
        defValue = "MmmmmNnnnn A",
        callFunc = callFunc,
        defMenu = "Default",
        indicatoron = False,
        helpText = "width=12 via ['width'], indicatoron=False",
    )
    menu5["width"] = 12
    menu5.grid(row=1, column=2, sticky="w")

    label = Label.Label(root, width=20, anchor="w", helpText="most recently selected value")
    label.grid(row=2, column=0, columnspan=4, sticky="w")
    
    statusBar = StatusBar.StatusBar(root, width=20)
    statusBar.grid(row=3, column=0, columnspan=4, sticky="ew")

    root.mainloop()