示例#1
0
    def __init__(self, root, game, config, serviceLocator):
        self.game = game
        self.columnSpan = 4
        self.currentRow = 0
        self.root = root
        self.window = tk.Toplevel(root, bg=Color.darkBackground)
        self.window.title("Game Launcher " + game)
        self.window.geometry("460x470")
        self.window.resizable(0, 0)
        config.setValue("appName", game)
        self.config = config
        self.serviceLocator = serviceLocator
        self.runner = RunnerFactory.getRunner(self.config)
        try:
            appTitle = config.getValue(["title"])
        except:
            appTitle = game

        gameName = Label(self.window, text=appTitle)
        Color.paintDark(gameName)
        self._addWidgetFullWidth(gameName)
        gameName.config(font=("Impact", 20))
        try:
            self.window.gameImage = getImageOrException(game)
            panel = tk.Label(self.window, image = self.window.gameImage)
        except AssetException:
            invisiblePixel = tk.PhotoImage(width=460, height=1)
            self.window.gameImage = invisiblePixel
            panel = tk.Label(self.window, image = self.window.gameImage)
        Color.paint(panel)
        panel.grid(column=0,row=self.currentRow, sticky='ns', columnspan=self.columnSpan)
        self.currentRow += 1

        try:
            appDescription = config.getValue(["description"])
            gameDescription = Label(self.window, heigh=5, text=appDescription)
            Color.paintBox(gameDescription)
            gameDescription.config(relief='flat', borderwidth=20)
            self._addWidgetFullWidth(gameDescription)
        except:
            pass
        self._createPlayButton()
        self._createTopBarButtons(self.window, game, config.getData())

        try:
            appTitle = config.getValue(["mods"])
            self._createModSelector(self.window, config.getData())
            self.currentRow += 1
        except:
            self._createEmptyModSelector(self.window, config.getData())
            self.currentRow += 1
        self.currentRow += 1
        self._createFooterButtons(self.window)
        self.currentRow += 1
示例#2
0
文件: style.py 项目: hhirsch/launcher
 def styleBox(widget):
     Color.paintBox(widget)
     Style._defaultButtonHighlight(widget)
     widget.config(font=("Impact", 20))