Example #1
0
 def _createButtons(self, root, game, data):
     if "linux-tweaks" in data:
         detailData = data['linux-tweaks']
         for index, content in enumerate(detailData):
             if "title" in detailData[content]:
                 spaceItem = Label(self.window)
                 spaceItem.config(font=("Impact", 15))
                 Color.paint(spaceItem)
                 self._addWidget(spaceItem)
                 itemTitle = Label(self.window,
                                   text=detailData[content]["title"])
                 Color.paint(itemTitle)
                 itemTitle.config(font=("Impact", 15))
                 self._addWidget(itemTitle)
             runFunction = getRunFunction(game, detailData[content])
             button = tk.Button(self.window,
                                text=content,
                                command=runFunction)
             removeBorders(button)
             Style.styleButton(button)
             self._addWidget(button)
             if "description" in detailData[content]:
                 itemDescription = Label(
                     self.window, text=detailData[content]["description"])
                 Color.paint(itemDescription)
                 self._addWidget(itemDescription)
Example #2
0
 def _createFooterButtons(self, root):
     modLabel = Label(self.window)
     removeBorders(modLabel)
     Color.paintDark(modLabel)
     modLabel.grid(column=0,row=self.currentRow, sticky='nswe', columnspan=4)
     self.currentRow += 1
     button = tk.Button(self.window, text="Savegame Config")
     removeBorders(button)
     Color.paintDark(button)
     button.grid(column=0,row=self.currentRow, sticky='sw')
     if self.config.hasValue("linux-tweaks"):
         linuxTweaks = lambda: SettingWindow(self.window, self.game, self.config)
         button = tk.Button(self.window, text="Linux Tweaks", command=linuxTweaks)
     else:
         button = tk.Button(self.window, text="Linux Tweaks")
     removeBorders(button)
     Color.paintDark(button)
     button.grid(column=1,row=self.currentRow, sticky='sw')
     button = tk.Button(self.window, text="Game Tools")
     removeBorders(button)
     Color.paintDark(button)
     button.grid(column=2,row=self.currentRow, sticky='sw')
     button = tk.Button(self.window, text="Game Info")
     removeBorders(button)
     Color.paintDark(button)
     button.grid(column=3,row=self.currentRow, sticky='sw')
Example #3
0
 def _createPlayButton(self):
     self.playButtonText = tk.StringVar()
     self.playButtonText.set("▶ Play")
     playFunction = lambda: self._runAndLog()
     self.playButton = tk.Button(self.window, text="▶ Play", width=5, command=playFunction)
     removeBorders(self.playButton)
     Style.stylePrimaryButton(self.playButton)
     self.playButton.grid(rowspan=2, column=0,row=self.currentRow, sticky='nws')
Example #4
0
 def _createTopBarButtons(self, root, game, data):
     topBarColumn = 1
     if "top-bar" in data:
         topBarData = data['top-bar']
         for index, content in enumerate(topBarData):
             runFunction = getRunFunction(game, topBarData[content])
             button = tk.Button(self.window, text=content, command=runFunction)
             removeBorders(button)
             Style.styleButton(button)
             button.grid(column=topBarColumn,row=self.currentRow, sticky='nsw')
             topBarColumn += 1
     self.currentRow += 1
Example #5
0
 def _createModSelector(self, root, data):
     modLabel = Label(self.window)
     removeBorders(modLabel)
     Color.paintDark(modLabel)
     modLabel.grid(column=3,row=self.currentRow, sticky='nswe', columnspan=1)
     variable = StringVar(self.window)
     variable.set("Standard") # default value
     options = self.config.getValue(["mods"])
     option = OptionMenu(self.window, variable, *options , command=self.modSelected)
     option.config(relief='flat')
     removeBorders(option)
     Color.paintDark(option)
     Color.paintDark(option["menu"])
     option.grid(column=1,row=self.currentRow, sticky='nsw', columnspan=2)
Example #6
0
 def _createEmptyModSelector(self, root, data):
     modLabel = Label(self.window)
     removeBorders(modLabel)
     Color.paintDark(modLabel)
     modLabel.grid(column=1,row=self.currentRow, sticky='nswe', columnspan=4)