From 88a3074e742e8f85b297e94c9041ee2bf5162ea8 Mon Sep 17 00:00:00 2001 From: "Mike A. Trethewey" Date: Sun, 16 Feb 2020 23:43:59 -0800 Subject: [PATCH] Dictify remainder of Custom options --- gui/custom/overview.py | 1196 +++++++++++++++++++++++----------------- 1 file changed, 696 insertions(+), 500 deletions(-) diff --git a/gui/custom/overview.py b/gui/custom/overview.py index bcc638a5..259a7d50 100644 --- a/gui/custom/overview.py +++ b/gui/custom/overview.py @@ -212,515 +212,711 @@ def custom_page(top,parent): currentList = itemList2 - # Flute - key = "flute" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Flute", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,58)}, "textbox": {"side": RIGHT}, "default": 1} - ) - self.customWidgets[key].pack() - - # Bug Net - key = "bugnet" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Bug Net", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,41)}, "textbox": {"side": RIGHT}, "default": 1} - ) - self.customWidgets[key].pack() - - # Book of Mudora - key = "book" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Book", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,57)}, "textbox": {"side": RIGHT}, "default": 1} - ) - self.customWidgets[key].pack() - - # Bottle - key = "bottle" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Bottle", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,53)}, "textbox": {"side": RIGHT}, "default": 4} - ) - self.customWidgets[key].pack() - - # Cane of Somaria - key = "somaria" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "C.Somaria", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,30)}, "textbox": {"side": RIGHT}, "default": 1} - ) - self.customWidgets[key].pack() - - # Cane of Byrna - key = "byrna" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "C.Byrna", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,43)}, "textbox": {"side": RIGHT}, "default": 1} - ) - self.customWidgets[key].pack() - - # Magic Cape - key = "cape" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Magic Cape", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,21)}, "textbox": {"side": RIGHT}, "default": 1} - ) - self.customWidgets[key].pack() - - # Magic Mirror - key = "mirror" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Magic Mirror", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,15)}, "textbox": {"side": RIGHT}, "default": 1} - ) - self.customWidgets[key].pack() - - # Pegasus Boots - key = "boots" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Pegasus Boots", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,8)}, "textbox": {"side": RIGHT}, "default": 1} - ) - self.customWidgets[key].pack() - - # Power Glove - key = "powerglove" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Power Glove", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,18)}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Titan's Mitt - key = "titansmitt" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Titan\'s Mitt", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,24)}, "textbox": {"side": RIGHT}, "default": 1} - ) - self.customWidgets[key].pack() - - # Progressive Glove - key = "progressiveglove" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Prog.Glove", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,26)}, "textbox": {"side": RIGHT}, "default": 2} - ) - self.customWidgets[key].pack() - - # Flippers - key = "flippers" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Flippers", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,43)}, "textbox": {"side": RIGHT}, "default": 1} - ) - self.customWidgets[key].pack() - - # Moon Pearl - key = "pearl" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Moon Pearl", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,23)}, "textbox": {"side": RIGHT}, "default": 1} - ) - self.customWidgets[key].pack() - - # Piece of Heart - key = "heartpiece" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Piece of Heart", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,10)}, "textbox": {"side": RIGHT}, "default": 24} - ) - self.customWidgets[key].pack() + myDict = { + # Flute + "flute": { + "type": "textbox", + "label": { + "text": "Flute" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,58) }, + "textbox": { "side": RIGHT }, + "default": 1 + } + }, + # Bug Net + "bugnet": { + "type": "textbox", + "label": { + "text": "Bug Net" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,41) }, + "textbox": { "side": RIGHT }, + "default": 1 + } + }, + # Book of Mudora + "book": { + "type": "textbox", + "label": { + "text": "Book" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,57) }, + "textbox": { "side": RIGHT }, + "default": 1 + } + }, + # Bottle + "bottle": { + "type": "textbox", + "label": { + "text": "Bottle" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,53) }, + "textbox": { "side": RIGHT }, + "default": 4 + } + }, + # Cane of Somaria + "somaria": { + "type": "textbox", + "label": { + "text": "C.Somaria" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,30) }, + "textbox": { "side": RIGHT }, + "default": 1 + } + }, + # Cane of Byrna + "byrna": { + "type": "textbox", + "label": { + "text": "C.Byrna" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,43) }, + "textbox": { "side": RIGHT }, + "default": 1 + } + }, + # Magic Cape + "cape": { + "type": "textbox", + "label": { + "text": "Magic Cape" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,21) }, + "textbox": { "side": RIGHT }, + "default": 1 + } + }, + # Magic Mirror + "mirror": { + "type": "textbox", + "label": { + "text": "Magic Mirror" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,15) }, + "textbox": { "side": RIGHT }, + "default": 1 + } + }, + # Pegasus Boots + "boots": { + "type": "textbox", + "label": { + "text": "Pegasus Boots" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,8) }, + "textbox": { "side": RIGHT }, + "default": 1 + } + }, + # Power Glove + "powerglove": { + "type": "textbox", + "label": { + "text": "Power Glove" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,18) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Titan's Mitt + "titansmitt": { + "type": "textbox", + "label": { + "text": "Titan\'s Mitt" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,25) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Progressive Glove + "progressiveglove": { + "type": "textbox", + "label": { + "text": "Prog.Glove" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,26) }, + "textbox": { "side": RIGHT }, + "default": 2 + } + }, + # Flippers + "flippers": { + "type": "textbox", + "label": { + "text": "Flippers" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,43) }, + "textbox": { "side": RIGHT }, + "default": 1 + } + }, + # Moon Pearl + "pearl": { + "type": "textbox", + "label": { + "text": "Moon Pearl" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,23) }, + "textbox": { "side": RIGHT }, + "default": 1 + } + }, + # Piece of Heart + "heartpiece": { + "type": "textbox", + "label": { + "text": "Piece of Heart" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,10) }, + "textbox": { "side": RIGHT }, + "default": 24 + } + } + } + dictWidgets = widgets.make_widgets_from_dict(self, myDict, currentList) + for key in dictWidgets: + self.customWidgets[key] = dictWidgets[key] + self.customWidgets[key].pack() currentList = itemList3 - # Heart Container - key = "heartcontainer" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Heart Container", - None, - {"label": {"anchor": W, "side": LEFT}, "textbox": {"side": RIGHT}, "default": 10} - ) - self.customWidgets[key].pack() - - # Sanctuary Heart - key = "sancheart" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Sanctuary Heart", - None, - {"label": {"anchor": W, "side": LEFT}, "textbox": {"side": RIGHT}, "default": 1} - ) - self.customWidgets[key].pack() - - # Fighters' Sword - key = "sword1" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Sword 1", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,42)}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Master Sword - key = "sword2" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Sword 2", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,42)}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Tempered Sword - key = "sword3" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Sword 3", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,42)}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Gold Sword - key = "sword4" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Sword 4", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,42)}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Progressive Sword - key = "progressivesword" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Prog.Sword", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,23)}, "textbox": {"side": RIGHT}, "default": 4} - ) - self.customWidgets[key].pack() - - # Fighters' Shield - key = "shield1" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Shield 1", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,43)}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Fire Shield - key = "shield2" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Shield 2", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,43)}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Mirror Shield - key = "shield3" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Shield 3", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,43)}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Progressive Shield - key = "progressiveshield" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Prog.Shield", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,24)}, "textbox": {"side": RIGHT}, "default": 3} - ) - self.customWidgets[key].pack() - - # Blue Mail - key = "mail2" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Blue Mail", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,35)}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Red Mail - key = "mail3" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Red Mail", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,38)}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Progressive Mail - key = "progressivemail" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Prog.Mail", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,33)}, "textbox": {"side": RIGHT}, "default": 2} - ) - self.customWidgets[key].pack() - - # Half Magic - key = "halfmagic" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Half Magic", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,26)}, "textbox": {"side": RIGHT}, "default": 1} - ) - self.customWidgets[key].pack() + myDict = { + # Heart Container + "heartcontainer": { + "type": "textbox", + "label": { + "text": "Heart Container" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT }, + "textbox": { "side": RIGHT }, + "default": 10 + } + }, + # Sanctuary Heart + "sancheart": { + "type": "textbox", + "label": { + "text": "Sanctuary Heart" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT }, + "textbox": { "side": RIGHT }, + "default": 1 + } + }, + # Fighters' Sword + "sword1": { + "type": "textbox", + "label": { + "text": "Sword 1" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,42) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Master Sword + "sword2": { + "type": "textbox", + "label": { + "text": "Sword 2" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,42) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Tempered Sword + "sword3": { + "type": "textbox", + "label": { + "text": "Sword 3" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,42) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Gold Sword + "sword4": { + "type": "textbox", + "label": { + "text": "Sword 4" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,42) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Progressive Sword + "progressivesword": { + "type": "textbox", + "label": { + "text": "Prog.Sword" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,23) }, + "textbox": { "side": RIGHT }, + "default": 4 + } + }, + # Fighters' Shield + "shield1": { + "type": "textbox", + "label": { + "text": "Shield 1" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,43) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Fire Shield + "shield2": { + "type": "textbox", + "label": { + "text": "Shield 2" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,43) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Mirror Shield + "shield3": { + "type": "textbox", + "label": { + "text": "Shield 3" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,43) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Progressive Shield + "progressiveshield": { + "type": "textbox", + "label": { + "text": "Prog.Shield" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,24) }, + "textbox": { "side": RIGHT }, + "default": 3 + } + }, + # Blue Mail + "mail2": { + "type": "textbox", + "label": { + "text": "Blue Mail" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,35) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Red Mail + "mail3": { + "type": "textbox", + "label": { + "text": "Red Mail" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,38) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Progressive Mail + "progressivemail": { + "type": "textbox", + "label": { + "text": "Prog.Mail" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,33) }, + "textbox": { "side": RIGHT }, + "default": 2 + } + }, + # Half Magic + "halfmagic": { + "type": "textbox", + "label": { + "text": "Half Magic" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,26) }, + "textbox": { "side": RIGHT }, + "default": 1 + } + } + } + dictWidgets = widgets.make_widgets_from_dict(self, myDict, currentList) + for key in dictWidgets: + self.customWidgets[key] = dictWidgets[key] + self.customWidgets[key].pack() currentList = itemList4 - # Quarter Magic - key = "quartermagic" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Quarter Magic", - None, - {"label": {"anchor": W, "side": LEFT}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Bomb Capacity +5 - key = "bombsplus5" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Bomb C.+5", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,16)}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Bomb Capacity +10 - key = "bombsplus10" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Bomb C.+10", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,10)}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Arrow Capacity +5 - key = "arrowsplus5" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Arrow C.+5", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,16)}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Arrow Capacity +10 - key = "arrowsplus10" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Arrow C.+10", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,10)}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Arrow (1) - key = "arrow1" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Arrow (1)", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,27)}, "textbox": {"side": RIGHT}, "default": 1} - ) - self.customWidgets[key].pack() - - # Arrow (10) - key = "arrow10" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Arrow (10)", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,21)}, "textbox": {"side": RIGHT}, "default": 12} - ) - self.customWidgets[key].pack() - - # Bomb (1) - key = "bomb1" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Bomb (1)", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,26)}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Bomb (3) - key = "bomb3" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Bomb (3)", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,25)}, "textbox": {"side": RIGHT}, "default": 13} - ) - self.customWidgets[key].pack() - - # Bomb (10) - key = "bomb10" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Bomb (10)", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,20)}, "textbox": {"side": RIGHT}, "default": 1} - ) - self.customWidgets[key].pack() - - # Rupee (1) - key = "rupee1" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Rupee (1)", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,24)}, "textbox": {"side": RIGHT}, "default": 2} - ) - self.customWidgets[key].pack() - - # Rupee (5) - key = "rupee5" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Rupee (5)", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,24)}, "textbox": {"side": RIGHT}, "default": 4} - ) - self.customWidgets[key].pack() - - # Rupee (20) - key = "rupee20" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Rupee (20)", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,18)}, "textbox": {"side": RIGHT}, "default": 28} - ) - self.customWidgets[key].pack() - - # Rupee (50) - key = "rupee50" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Rupee (50)", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,18)}, "textbox": {"side": RIGHT}, "default": 7} - ) - self.customWidgets[key].pack() - - # Rupee (100) - key = "rupee100" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Rupee (100)", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,12)}, "textbox": {"side": RIGHT}, "default": 1} - ) - self.customWidgets[key].pack() + myDict = { + # Quarter Magic + "quartermagic": { + "type": "textbox", + "label": { + "text": "Quarter Magic" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Bomb Capacity +5 + "bombsplus5": { + "type": "textbox", + "label": { + "text": "Bomb C.+5" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (1,15) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Bomb Capacity +10 + "bombsplus10": { + "type": "textbox", + "label": { + "text": "Bomb C.+10" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,10) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Arrow Capacity + 5 + "arrowsplus5": { + "type": "textbox", + "label": { + "text": "Arrow C.+5" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,16) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Arrow Capacity +10 + "arrowsplus10": { + "type": "textbox", + "label": { + "text": "Arrow C.+10" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,10) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Arrow (1) + "arrow1": { + "type": "textbox", + "label": { + "text": "Arrow (1)" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,27) }, + "textbox": { "side": RIGHT }, + "default": 1 + } + }, + # Arrow (10) + "arrow10": { + "type": "textbox", + "label": { + "text": "Arrow (10)" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,21) }, + "textbox": { "side": RIGHT }, + "default": 12 + } + }, + # Bomb (1) + "bomb1": { + "type": "textbox", + "label": { + "text": "Bomb (1)" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,27) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Bomb (3) + "bomb3": { + "type": "textbox", + "label": { + "text": "Bomb (3)" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,27) }, + "textbox": { "side": RIGHT }, + "default": 13 + } + }, + # Bomb (10) + "bomb10": { + "type": "textbox", + "label": { + "text": "Bomb (10)" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,21) }, + "textbox": { "side": RIGHT }, + "default": 1 + } + }, + # Rupee (1) + "rupee1": { + "type": "textbox", + "label": { + "text": "Rupee (1)" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,25) }, + "textbox": { "side": RIGHT }, + "default": 2 + } + }, + # Rupee (5) + "rupee5": { + "type": "textbox", + "label": { + "text": "Rupee (5)" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,25) }, + "textbox": { "side": RIGHT }, + "default": 4 + } + }, + # Rupee (20) + "rupee20": { + "type": "textbox", + "label": { + "text": "Rupee (20)" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,19) }, + "textbox": { "side": RIGHT }, + "default": 28 + } + }, + # Rupee (50) + "rupee50": { + "type": "textbox", + "label": { + "text": "Rupee (50)" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,19) }, + "textbox": { "side": RIGHT }, + "default": 7 + } + }, + # Rupee (100) + "rupee100": { + "type": "textbox", + "label": { + "text": "Rupee (100)" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,13) }, + "textbox": { "side": RIGHT }, + "default": 1 + } + } + } + dictWidgets = widgets.make_widgets_from_dict(self, myDict, currentList) + for key in dictWidgets: + self.customWidgets[key] = dictWidgets[key] + self.customWidgets[key].pack() currentList = itemList5 - # Rupee (300) - key = "rupee300" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Rupee (300)", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,54)}, "textbox": {"side": RIGHT}, "default": 5} - ) - self.customWidgets[key].pack() - - # Blue Clock - key = "blueclock" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Blue Clock", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,60)}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Green Clock - key = "greenclock" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Green Clock", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,52)}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Red Clock - key = "redclock" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Red Clock", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,63)}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Silver Arrows Upgrade - key = "silversupgrade" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Silver Arrows Upgrade", - None, - {"label": {"anchor": W, "side": LEFT}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Generic Keys - key = "generickeys" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Generic Keys", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,49)}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Triforce Pieces - key = "triforcepieces" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Triforce Pieces", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,40)}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Triforce Pieces Required - key = "triforcepiecesgoal" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Triforce Pieces Required", - None, - {"label": {"anchor": W, "side": LEFT}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Triforce (win game) - key = "triforce" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Triforce (win game)", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,13)}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Rupoor - key = "rupoor" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Rupoor", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,77)}, "textbox": {"side": RIGHT}, "default": 0} - ) - self.customWidgets[key].pack() - - # Rupoor Cost - key = "rupoorcost" - self.customWidgets[key] = widgets.make_widget(self,"textbox",currentList, - "Rupoor Cost", - None, - {"label": {"anchor": W, "side": LEFT, "padx": (0,50)}, "textbox": {"side": RIGHT}, "default": 10} - ) - self.customWidgets[key].pack() + myDict = { + # Rupee (300) + "rupee300": { + "type": "textbox", + "label": { + "text": "Rupee (300)" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,54) }, + "textbox": { "side": RIGHT }, + "default": 5 + } + }, + # Blue Clock + "blueclock": { + "type": "textbox", + "label": { + "text": "Blue Clock" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,60) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Green Clock + "greenclock": { + "type": "textbox", + "label": { + "text": "Green Clock" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,52) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Red Clock + "redclock": { + "type": "textbox", + "label": { + "text": "Red Clock" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,63) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Silver Arrows Upgrade + "silversupgrade": { + "type": "textbox", + "label": { + "text": "Silver Arrows Upgrade" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Generic Keys + "generickeys": { + "type": "textbox", + "label": { + "text": "Generic Keys" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,49) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Triforce Pieces + "triforcepieces": { + "type": "textbox", + "label": { + "text": "Triforce Pieces" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,40) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Triforce Pieces Goal + "triforcepiecesgoal": { + "type": "textbox", + "label": { + "text": "Triforce Pieces Goal" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,13) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Triforce (win game) + "triforce": { + "type": "textbox", + "label": { + "text": "Triforce (win game)" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,13) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Rupoor + "rupoor": { + "type": "textbox", + "label": { + "text": "Rupoor" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,77) }, + "textbox": { "side": RIGHT }, + "default": 0 + } + }, + # Rupoor Cost + "rupoorcost": { + "type": "textbox", + "label": { + "text": "Rupoor Cost" + }, + "packAttrs": { + "label": { "anchor": W, "side": LEFT, "padx": (0,50) }, + "textbox": { "side": RIGHT }, + "default": 10 + } + } + } + dictWidgets = widgets.make_widgets_from_dict(self, myDict, currentList) + for key in dictWidgets: + self.customWidgets[key] = dictWidgets[key] + self.customWidgets[key].pack() itemList1.pack(side=LEFT, padx=(0,0)) itemList2.pack(side=LEFT, padx=(0,0))