def getCUserConfig(ctype, fileName): defaultConfig = fileio.readJson("defaults/" + ctype + ".json") configPath = "config/" + fileName + ".json" if os.path.exists(configPath): userConfig = fileio.readJson(configPath) else: userConfig = {} config = mergeConfigs(defaultConfig, userConfig) return config
def getUserConfig(): defaultConfig = fileio.readJson("defaults/global.json") setDefaultHotkeys(defaultConfig) if os.path.exists("config/global.json"): userConfig = fileio.readJson("config/global.json") else: userConfig = {} config = mergeConfigs(defaultConfig, userConfig) return config
def __init__(self,parent,state,rootWindow): config = fileio.readJson("defaults/controlButtons.json") super().__init__(parent,state,config) self.rootWindow = rootWindow bg = config["colours"]["bg"] fg = config["colours"]["text"] font = config["font"] button1 = tk.Button(self, bg=bg, font=font, text="Split", fg=fg,command=rootWindow.onSplitEnd) button2 = tk.Button(self, bg=bg, font=font, text="Restart", fg=fg, command=rootWindow.restart) button3 = tk.Button(self, bg=bg, font=font, text="Start", fg=fg, command=rootWindow.start) button4 = tk.Button(self, bg=bg, font=font, text="Finish", fg=fg, command=rootWindow.finish) button1.grid(row=0,column=0,columnspan=6,sticky='WE') button2.grid(row=0,column=6,columnspan=6,sticky='WE') button3.grid(row=1,column=0,columnspan=6,sticky='WE') button4.grid(row=1,column=6,columnspan=6,sticky='WE') self.buttons.extend([button1,button2,button3,button4])
def __init__(self, parent, state): config = fileio.readJson("defaults/segmentTimes.json") super().__init__(parent, state, config) fg = config["colours"]["text"] bg = config["colours"]["bg"] self.configure(bg=bg) self.leftFrame = tk.Frame(self, bg=bg) self.rightFrame = tk.Frame(self, bg=bg) self.goldHeader = tk.Label(self.leftFrame, fg=fg, bg=bg) self.goldTime = tk.Label(self.rightFrame, fg=fg, bg=bg) self.updateGoldHeader() self.updateGoldTime() self.leftFrame.pack(side="left", padx=state.config["padx"]) self.rightFrame.pack(side="left", padx=state.config["padx"]) self.goldHeader.pack(side="bottom", anchor="sw") self.goldTime.pack(side="bottom", anchor="se")
def __init__(self, app, state, rootWindow): self.app = app self.state = state self.rootWindow = rootWindow self.configDict = fileio.readJson("Widgets/widgetList.json") self.configKeys = self.configDict.keys()
def loadSave(self): saved = fileio.readJson(self.saveFile) self.setRun(saved["game"], saved["category"], saved["split"])
def loadSave(self): saved = fileio.readJson(self.saveFile) self.setRun(saved["game"], saved["category"]) self.setLayout(saved["layoutName"])
def resolveLayout(name): if name == "System Default": return fileio.readJson("defaults/layout.json") return fileio.readJson("layouts/" + name + ".json")