| 
									
										
										
										
											2018-01-01 13:11:11 -05:00
										 |  |  | #!/usr/bin/env python3 | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  | from argparse import Namespace | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  | from glob import glob | 
					
						
							| 
									
										
										
										
											2017-11-18 12:22:06 -05:00
										 |  |  | import json | 
					
						
							| 
									
										
										
										
											2019-12-10 02:15:03 +01:00
										 |  |  | import logging | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  | import random | 
					
						
							| 
									
										
										
										
											2017-11-25 21:49:36 -05:00
										 |  |  | import os | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  | import shutil | 
					
						
							| 
									
										
										
										
											2019-05-30 01:10:16 +02:00
										 |  |  | from tkinter import Checkbutton, OptionMenu, Toplevel, LabelFrame, PhotoImage, Tk, LEFT, RIGHT, BOTTOM, TOP, StringVar, IntVar, Frame, Label, W, E, X, BOTH, Entry, Spinbox, Button, filedialog, messagebox, ttk | 
					
						
							| 
									
										
										
										
											2017-11-18 12:22:06 -05:00
										 |  |  | from urllib.parse import urlparse | 
					
						
							|  |  |  | from urllib.request import urlopen | 
					
						
							| 
									
										
										
										
											2020-09-06 18:09:11 +02:00
										 |  |  | from concurrent.futures import ThreadPoolExecutor, as_completed | 
					
						
							| 
									
										
										
										
											2017-12-08 17:33:59 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-02-02 22:09:10 +01:00
										 |  |  | import ModuleUpdate | 
					
						
							|  |  |  | ModuleUpdate.update() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-24 05:38:56 +02:00
										 |  |  | from worlds.alttp.EntranceRandomizer import parse_arguments | 
					
						
							| 
									
										
										
										
											2017-12-10 11:10:04 -05:00
										 |  |  | from GuiUtils import ToolTips, set_icon, BackgroundTaskProgress | 
					
						
							| 
									
										
										
										
											2021-02-21 20:17:24 +01:00
										 |  |  | from Main import main, get_seed, __version__ as MWVersion | 
					
						
							| 
									
										
										
										
											2020-10-24 05:38:56 +02:00
										 |  |  | from worlds.alttp.Rom import Sprite | 
					
						
							| 
									
										
										
										
											2021-02-19 19:08:11 +01:00
										 |  |  | from Utils import local_path, output_path, open_file | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def guiMain(args=None): | 
					
						
							|  |  |  |     mainWindow = Tk() | 
					
						
							| 
									
										
										
										
											2021-01-03 14:32:32 +01:00
										 |  |  |     mainWindow.wm_title("Archipelago %s" % MWVersion) | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-25 21:49:36 -05:00
										 |  |  |     set_icon(mainWindow) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-16 19:13:21 -05:00
										 |  |  |     notebook = ttk.Notebook(mainWindow) | 
					
						
							|  |  |  |     randomizerWindow = ttk.Frame(notebook) | 
					
						
							| 
									
										
										
										
											2018-01-21 20:43:44 -06:00
										 |  |  |     customWindow = ttk.Frame(notebook) | 
					
						
							| 
									
										
										
										
											2017-12-16 19:13:21 -05:00
										 |  |  |     notebook.add(randomizerWindow, text='Randomize') | 
					
						
							| 
									
										
										
										
											2020-11-11 19:34:18 +01:00
										 |  |  |     notebook.add(customWindow, text='Custom Items') | 
					
						
							| 
									
										
										
										
											2017-12-12 08:17:52 -06:00
										 |  |  |     notebook.pack() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-16 15:41:24 -05:00
										 |  |  |     # Shared Controls | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     farBottomFrame = Frame(mainWindow) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def open_output(): | 
					
						
							|  |  |  |         open_file(output_path('')) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     openOutputButton = Button(farBottomFrame, text='Open Output Directory', command=open_output) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if os.path.exists(local_path('README.html')): | 
					
						
							|  |  |  |         def open_readme(): | 
					
						
							|  |  |  |             open_file(local_path('README.html')) | 
					
						
							|  |  |  |         openReadmeButton = Button(farBottomFrame, text='Open Documentation', command=open_readme) | 
					
						
							|  |  |  |         openReadmeButton.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     farBottomFrame.pack(side=BOTTOM, fill=X, padx=5, pady=5) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # randomizer controls | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-12 08:17:52 -06:00
										 |  |  |     topFrame = Frame(randomizerWindow) | 
					
						
							| 
									
										
										
										
											2021-02-19 19:08:11 +01:00
										 |  |  |     romFrame, romVar = get_rom_frame(topFrame) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     rightHalfFrame = Frame(topFrame) | 
					
						
							|  |  |  |     checkBoxFrame = Frame(rightHalfFrame) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     createSpoilerVar = IntVar() | 
					
						
							|  |  |  |     createSpoilerCheckbutton = Checkbutton(checkBoxFrame, text="Create Spoiler Log", variable=createSpoilerVar) | 
					
						
							|  |  |  |     suppressRomVar = IntVar() | 
					
						
							|  |  |  |     suppressRomCheckbutton = Checkbutton(checkBoxFrame, text="Do not create patched Rom", variable=suppressRomVar) | 
					
						
							| 
									
										
										
										
											2021-01-29 13:27:42 -08:00
										 |  |  |     openpyramidFrame = Frame(checkBoxFrame) | 
					
						
							|  |  |  |     openpyramidVar = StringVar() | 
					
						
							|  |  |  |     openpyramidVar.set('auto') | 
					
						
							|  |  |  |     openpyramidOptionMenu = OptionMenu(openpyramidFrame, openpyramidVar, 'auto', 'goal', 'yes', 'no') | 
					
						
							|  |  |  |     openpyramidLabel = Label(openpyramidFrame, text='Pre-open Pyramid Hole') | 
					
						
							|  |  |  |     openpyramidLabel.pack(side=LEFT) | 
					
						
							|  |  |  |     openpyramidOptionMenu.pack(side=LEFT) | 
					
						
							| 
									
										
										
										
											2019-12-13 22:37:52 +01:00
										 |  |  |     mcsbshuffleFrame = Frame(checkBoxFrame) | 
					
						
							|  |  |  |     mcsbLabel = Label(mcsbshuffleFrame, text="Shuffle: ") | 
					
						
							| 
									
										
										
										
											2020-08-20 20:13:00 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-13 22:37:52 +01:00
										 |  |  |     mapshuffleVar = IntVar() | 
					
						
							|  |  |  |     mapshuffleCheckbutton = Checkbutton(mcsbshuffleFrame, text="Maps", variable=mapshuffleVar) | 
					
						
							| 
									
										
										
										
											2020-08-20 20:13:00 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-13 22:37:52 +01:00
										 |  |  |     compassshuffleVar = IntVar() | 
					
						
							|  |  |  |     compassshuffleCheckbutton = Checkbutton(mcsbshuffleFrame, text="Compasses", variable=compassshuffleVar) | 
					
						
							| 
									
										
										
										
											2020-08-20 20:13:00 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-13 22:37:52 +01:00
										 |  |  |     bigkeyshuffleVar = IntVar() | 
					
						
							| 
									
										
										
										
											2020-08-23 21:38:21 +02:00
										 |  |  |     bigkeyshuffleCheckbutton = Checkbutton(mcsbshuffleFrame, text="Big Keys", variable=bigkeyshuffleVar) | 
					
						
							| 
									
										
										
										
											2020-08-20 20:13:00 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     keyshuffleFrame = Frame(checkBoxFrame) | 
					
						
							|  |  |  |     keyshuffleVar = StringVar() | 
					
						
							|  |  |  |     keyshuffleVar.set('off') | 
					
						
							|  |  |  |     modeOptionMenu = OptionMenu(keyshuffleFrame, keyshuffleVar, 'off', 'universal', 'on') | 
					
						
							| 
									
										
										
										
											2020-08-23 21:38:21 +02:00
										 |  |  |     modeLabel = Label(keyshuffleFrame, text='Small Key Shuffle') | 
					
						
							| 
									
										
										
										
											2020-08-20 20:13:00 +02:00
										 |  |  |     modeLabel.pack(side=LEFT) | 
					
						
							| 
									
										
										
										
											2020-08-27 15:16:13 -07:00
										 |  |  |     modeOptionMenu.pack(side=LEFT) | 
					
						
							| 
									
										
										
										
											2020-08-20 20:13:00 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-14 13:31:36 -05:00
										 |  |  |     retroVar = IntVar() | 
					
						
							| 
									
										
										
										
											2020-08-20 20:13:00 +02:00
										 |  |  |     retroCheckbutton = Checkbutton(checkBoxFrame, text="Retro mode", variable=retroVar) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-17 22:28:29 +02:00
										 |  |  |     shuffleGanonVar = IntVar() | 
					
						
							| 
									
										
										
										
											2020-08-20 03:41:37 +02:00
										 |  |  |     shuffleGanonVar.set(1)  # set default | 
					
						
							|  |  |  |     shuffleGanonCheckbutton = Checkbutton(checkBoxFrame, text="Include Ganon's Tower and Pyramid Hole in shuffle pool", | 
					
						
							|  |  |  |                                           variable=shuffleGanonVar) | 
					
						
							| 
									
										
										
										
											2019-01-23 03:04:42 -06:00
										 |  |  |     hintsVar = IntVar() | 
					
						
							| 
									
										
										
										
											2020-08-20 03:41:37 +02:00
										 |  |  |     hintsVar.set(1)  # set default | 
					
						
							| 
									
										
										
										
											2019-01-23 03:04:42 -06:00
										 |  |  |     hintsCheckbutton = Checkbutton(checkBoxFrame, text="Include Helpful Hints", variable=hintsVar) | 
					
						
							| 
									
										
										
										
											2020-11-11 19:34:18 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-29 19:59:20 +01:00
										 |  |  |     tileShuffleVar = IntVar() | 
					
						
							|  |  |  |     tileShuffleButton = Checkbutton(checkBoxFrame, text="Tile shuffle", variable=tileShuffleVar) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     createSpoilerCheckbutton.pack(expand=True, anchor=W) | 
					
						
							|  |  |  |     suppressRomCheckbutton.pack(expand=True, anchor=W) | 
					
						
							| 
									
										
										
										
											2021-01-29 13:27:42 -08:00
										 |  |  |     openpyramidFrame.pack(expand=True, anchor=W) | 
					
						
							| 
									
										
										
										
											2019-12-13 22:37:52 +01:00
										 |  |  |     mcsbshuffleFrame.pack(expand=True, anchor=W) | 
					
						
							|  |  |  |     mcsbLabel.grid(row=0, column=0) | 
					
						
							|  |  |  |     mapshuffleCheckbutton.grid(row=0, column=1) | 
					
						
							|  |  |  |     compassshuffleCheckbutton.grid(row=0, column=2) | 
					
						
							|  |  |  |     bigkeyshuffleCheckbutton.grid(row=0, column=4) | 
					
						
							| 
									
										
										
										
											2020-08-20 20:13:00 +02:00
										 |  |  |     keyshuffleFrame.pack(expand=True, anchor=W) | 
					
						
							| 
									
										
										
										
											2018-03-14 13:31:36 -05:00
										 |  |  |     retroCheckbutton.pack(expand=True, anchor=W) | 
					
						
							| 
									
										
										
										
											2017-07-17 22:28:29 +02:00
										 |  |  |     shuffleGanonCheckbutton.pack(expand=True, anchor=W) | 
					
						
							| 
									
										
										
										
											2019-01-23 03:04:42 -06:00
										 |  |  |     hintsCheckbutton.pack(expand=True, anchor=W) | 
					
						
							| 
									
										
										
										
											2020-12-29 19:59:20 +01:00
										 |  |  |     tileShuffleButton.pack(expand=True, anchor=W) | 
					
						
							| 
									
										
										
										
											2017-11-04 14:23:57 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-08 03:43:48 +01:00
										 |  |  |     checkBoxFrame.pack(side=TOP, anchor=W, padx=5, pady=10) | 
					
						
							| 
									
										
										
										
											2020-11-11 19:34:18 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-19 19:08:11 +01:00
										 |  |  |     romOptionsFrame, rom_vars, set_sprite = get_rom_options_frame(rightHalfFrame) | 
					
						
							| 
									
										
										
										
											2020-01-08 03:43:48 +01:00
										 |  |  |     romOptionsFrame.pack(expand=True, fill=BOTH, padx=3) | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     drowDownFrame = Frame(topFrame) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     modeFrame = Frame(drowDownFrame) | 
					
						
							|  |  |  |     modeVar = StringVar() | 
					
						
							| 
									
										
										
										
											2017-08-03 11:15:07 -07:00
										 |  |  |     modeVar.set('open') | 
					
						
							| 
									
										
										
										
											2019-08-04 12:32:35 -04:00
										 |  |  |     modeOptionMenu = OptionMenu(modeFrame, modeVar, 'standard', 'open', 'inverted') | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     modeOptionMenu.pack(side=RIGHT) | 
					
						
							| 
									
										
										
										
											2019-10-23 20:46:09 -05:00
										 |  |  |     modeLabel = Label(modeFrame, text='Game mode') | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     modeLabel.pack(side=LEFT) | 
					
						
							| 
									
										
										
										
											2017-11-04 14:23:57 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     logicFrame = Frame(drowDownFrame) | 
					
						
							|  |  |  |     logicVar = StringVar() | 
					
						
							|  |  |  |     logicVar.set('noglitches') | 
					
						
							| 
									
										
										
										
											2020-01-02 23:59:28 -04:00
										 |  |  |     logicOptionMenu = OptionMenu(logicFrame, logicVar, 'noglitches', 'minorglitches', 'owglitches', 'nologic') | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     logicOptionMenu.pack(side=RIGHT) | 
					
						
							|  |  |  |     logicLabel = Label(logicFrame, text='Game logic') | 
					
						
							|  |  |  |     logicLabel.pack(side=LEFT) | 
					
						
							| 
									
										
										
										
											2017-11-04 14:23:57 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-07 19:51:46 +02:00
										 |  |  |     darklogicFrame = Frame(drowDownFrame) | 
					
						
							|  |  |  |     darklogicVar = StringVar() | 
					
						
							|  |  |  |     darklogicVar.set('Lamp') | 
					
						
							|  |  |  |     darklogicOptionMenu = OptionMenu(darklogicFrame, darklogicVar, 'Lamp', 'Lamp or easy Fire Rod torches', | 
					
						
							|  |  |  |                                      'dark traversal') | 
					
						
							|  |  |  |     darklogicOptionMenu.pack(side=RIGHT) | 
					
						
							|  |  |  |     darklogicLabel = Label(darklogicFrame, text='Dark Room Logic') | 
					
						
							|  |  |  |     darklogicLabel.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     goalFrame = Frame(drowDownFrame) | 
					
						
							|  |  |  |     goalVar = StringVar() | 
					
						
							|  |  |  |     goalVar.set('ganon') | 
					
						
							| 
									
										
										
										
											2021-03-14 08:38:02 +01:00
										 |  |  |     goalOptionMenu = OptionMenu(goalFrame, goalVar, 'ganon', 'pedestal', 'bosses', 'triforcehunt', | 
					
						
							| 
									
										
										
										
											2020-10-15 15:24:52 -07:00
										 |  |  |                                 'localtriforcehunt', 'ganontriforcehunt', 'localganontriforcehunt', 'crystals', 'ganonpedestal') | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     goalOptionMenu.pack(side=RIGHT) | 
					
						
							|  |  |  |     goalLabel = Label(goalFrame, text='Game goal') | 
					
						
							|  |  |  |     goalLabel.pack(side=LEFT) | 
					
						
							| 
									
										
										
										
											2017-11-04 14:23:57 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-23 20:46:09 -05:00
										 |  |  |     crystalsGTFrame = Frame(drowDownFrame) | 
					
						
							|  |  |  |     crystalsGTVar = StringVar() | 
					
						
							|  |  |  |     crystalsGTVar.set('7') | 
					
						
							|  |  |  |     crystalsGTOptionMenu = OptionMenu(crystalsGTFrame, crystalsGTVar, '0', '1', '2', '3', '4', '5', '6', '7', 'random') | 
					
						
							|  |  |  |     crystalsGTOptionMenu.pack(side=RIGHT) | 
					
						
							|  |  |  |     crystalsGTLabel = Label(crystalsGTFrame, text='Crystals to open Ganon\'s Tower') | 
					
						
							|  |  |  |     crystalsGTLabel.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     crystalsGanonFrame = Frame(drowDownFrame) | 
					
						
							|  |  |  |     crystalsGanonVar = StringVar() | 
					
						
							|  |  |  |     crystalsGanonVar.set('7') | 
					
						
							|  |  |  |     crystalsGanonOptionMenu = OptionMenu(crystalsGanonFrame, crystalsGanonVar, '0', '1', '2', '3', '4', '5', '6', '7', 'random') | 
					
						
							|  |  |  |     crystalsGanonOptionMenu.pack(side=RIGHT) | 
					
						
							|  |  |  |     crystalsGanonLabel = Label(crystalsGanonFrame, text='Crystals to fight Ganon') | 
					
						
							|  |  |  |     crystalsGanonLabel.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     swordFrame = Frame(drowDownFrame) | 
					
						
							|  |  |  |     swordVar = StringVar() | 
					
						
							|  |  |  |     swordVar.set('random') | 
					
						
							|  |  |  |     swordOptionMenu = OptionMenu(swordFrame, swordVar, 'random', 'assured', 'swordless', 'vanilla') | 
					
						
							|  |  |  |     swordOptionMenu.pack(side=RIGHT) | 
					
						
							|  |  |  |     swordLabel = Label(swordFrame, text='Sword availability') | 
					
						
							|  |  |  |     swordLabel.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     difficultyFrame = Frame(drowDownFrame) | 
					
						
							|  |  |  |     difficultyVar = StringVar() | 
					
						
							|  |  |  |     difficultyVar.set('normal') | 
					
						
							| 
									
										
										
										
											2020-08-01 16:49:46 +02:00
										 |  |  |     difficultyOptionMenu = OptionMenu(difficultyFrame, difficultyVar, 'easy', 'normal', 'hard', 'expert') | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     difficultyOptionMenu.pack(side=RIGHT) | 
					
						
							| 
									
										
										
										
											2019-10-23 20:46:09 -05:00
										 |  |  |     difficultyLabel = Label(difficultyFrame, text='Difficulty: item pool') | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     difficultyLabel.pack(side=LEFT) | 
					
						
							| 
									
										
										
										
											2017-11-04 14:23:57 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-23 20:46:09 -05:00
										 |  |  |     itemfunctionFrame = Frame(drowDownFrame) | 
					
						
							|  |  |  |     itemfunctionVar = StringVar() | 
					
						
							|  |  |  |     itemfunctionVar.set('normal') | 
					
						
							| 
									
										
										
										
											2020-09-18 10:01:12 -07:00
										 |  |  |     itemfunctionOptionMenu = OptionMenu(itemfunctionFrame, itemfunctionVar, 'easy', 'normal', 'hard', 'expert') | 
					
						
							| 
									
										
										
										
											2019-10-23 20:46:09 -05:00
										 |  |  |     itemfunctionOptionMenu.pack(side=RIGHT) | 
					
						
							|  |  |  |     itemfunctionLabel = Label(itemfunctionFrame, text='Difficulty: item functionality') | 
					
						
							|  |  |  |     itemfunctionLabel.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-12 15:46:32 -07:00
										 |  |  |     dungeonCounterFrame = Frame(drowDownFrame) | 
					
						
							|  |  |  |     dungeonCounterVar = StringVar() | 
					
						
							|  |  |  |     dungeonCounterVar.set('auto') | 
					
						
							|  |  |  |     dungeonCounterOptionMenu = OptionMenu(dungeonCounterFrame, dungeonCounterVar, 'auto', 'off', 'on', 'on_compass_pickup') | 
					
						
							|  |  |  |     dungeonCounterOptionMenu.pack(side=RIGHT) | 
					
						
							|  |  |  |     dungeonCounterLabel = Label(dungeonCounterFrame, text='Dungeon Chest Counters') | 
					
						
							|  |  |  |     dungeonCounterLabel.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-10 04:18:39 -06:00
										 |  |  |     progressiveFrame = Frame(drowDownFrame) | 
					
						
							|  |  |  |     progressiveVar = StringVar() | 
					
						
							|  |  |  |     progressiveVar.set('on') | 
					
						
							|  |  |  |     progressiveOptionMenu = OptionMenu(progressiveFrame, progressiveVar, 'on', 'off', 'random') | 
					
						
							|  |  |  |     progressiveOptionMenu.pack(side=RIGHT) | 
					
						
							|  |  |  |     progressiveLabel = Label(progressiveFrame, text='Progressive equipment') | 
					
						
							|  |  |  |     progressiveLabel.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-23 20:46:09 -05:00
										 |  |  |     accessibilityFrame = Frame(drowDownFrame) | 
					
						
							|  |  |  |     accessibilityVar = StringVar() | 
					
						
							|  |  |  |     accessibilityVar.set('items') | 
					
						
							|  |  |  |     accessibilityOptionMenu = OptionMenu(accessibilityFrame, accessibilityVar, 'items', 'locations', 'none') | 
					
						
							|  |  |  |     accessibilityOptionMenu.pack(side=RIGHT) | 
					
						
							|  |  |  |     accessibilityLabel = Label(accessibilityFrame, text='Item accessibility') | 
					
						
							|  |  |  |     accessibilityLabel.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     algorithmFrame = Frame(drowDownFrame) | 
					
						
							|  |  |  |     algorithmVar = StringVar() | 
					
						
							| 
									
										
										
										
											2017-11-11 15:28:34 -06:00
										 |  |  |     algorithmVar.set('balanced') | 
					
						
							| 
									
										
										
										
											2020-08-25 17:44:03 +02:00
										 |  |  |     algorithmOptionMenu = OptionMenu(algorithmFrame, algorithmVar, 'flood', 'vt25', 'vt26', 'balanced') | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     algorithmOptionMenu.pack(side=RIGHT) | 
					
						
							|  |  |  |     algorithmLabel = Label(algorithmFrame, text='Item distribution algorithm') | 
					
						
							|  |  |  |     algorithmLabel.pack(side=LEFT) | 
					
						
							| 
									
										
										
										
											2017-11-04 14:23:57 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     shuffleFrame = Frame(drowDownFrame) | 
					
						
							|  |  |  |     shuffleVar = StringVar() | 
					
						
							| 
									
										
										
										
											2020-06-21 03:52:19 +02:00
										 |  |  |     shuffleVar.set('vanilla') | 
					
						
							| 
									
										
										
										
											2020-08-23 15:03:06 +02:00
										 |  |  |     shuffleOptionMenu = OptionMenu(shuffleFrame, shuffleVar, 'vanilla', 'simple', 'restricted', 'full', 'crossed', | 
					
						
							|  |  |  |                                    'insanity', 'restricted_legacy', 'full_legacy', 'madness_legacy', 'insanity_legacy', | 
					
						
							| 
									
										
										
										
											2021-02-20 02:30:55 +01:00
										 |  |  |                                    'dungeonsfull', 'dungeonssimple', "same simple", "same restricted", "same full", | 
					
						
							|  |  |  |                                    "same crossed", "same insanity", "same dungeonsfull", "same dungeonssimple") | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     shuffleOptionMenu.pack(side=RIGHT) | 
					
						
							| 
									
										
										
										
											2020-09-20 04:35:45 +02:00
										 |  |  |     shuffleLabel = Label(shuffleFrame, text='Entrance shuffle') | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     shuffleLabel.pack(side=LEFT) | 
					
						
							| 
									
										
										
										
											2017-11-04 14:23:57 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-20 04:35:45 +02:00
										 |  |  |     prizeFrame = Frame(drowDownFrame) | 
					
						
							|  |  |  |     prizeVar = StringVar() | 
					
						
							|  |  |  |     prizeVar.set('general') | 
					
						
							|  |  |  |     prizeOptionMenu = OptionMenu(prizeFrame, prizeVar, 'none', 'general', 'bonk', 'both') | 
					
						
							|  |  |  |     prizeOptionMenu.pack(side=RIGHT) | 
					
						
							| 
									
										
										
										
											2020-10-07 23:19:16 +02:00
										 |  |  |     prizeLabel = Label(prizeFrame, text='Shuffle Prizes/Drops') | 
					
						
							| 
									
										
										
										
											2020-09-20 04:35:45 +02:00
										 |  |  |     prizeLabel.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-23 15:03:06 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     modeFrame.pack(expand=True, anchor=E) | 
					
						
							|  |  |  |     logicFrame.pack(expand=True, anchor=E) | 
					
						
							| 
									
										
										
										
											2020-10-07 19:51:46 +02:00
										 |  |  |     darklogicFrame.pack(expand=True, anchor=E) | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     goalFrame.pack(expand=True, anchor=E) | 
					
						
							| 
									
										
										
										
											2019-10-23 20:46:09 -05:00
										 |  |  |     crystalsGTFrame.pack(expand=True, anchor=E) | 
					
						
							|  |  |  |     crystalsGanonFrame.pack(expand=True, anchor=E) | 
					
						
							|  |  |  |     swordFrame.pack(expand=True, anchor=E) | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     difficultyFrame.pack(expand=True, anchor=E) | 
					
						
							| 
									
										
										
										
											2019-10-23 20:46:09 -05:00
										 |  |  |     itemfunctionFrame.pack(expand=True, anchor=E) | 
					
						
							| 
									
										
										
										
											2020-04-12 15:46:32 -07:00
										 |  |  |     dungeonCounterFrame.pack(expand=True, anchor=E) | 
					
						
							| 
									
										
										
										
											2017-11-10 04:18:39 -06:00
										 |  |  |     progressiveFrame.pack(expand=True, anchor=E) | 
					
						
							| 
									
										
										
										
											2019-10-23 20:46:09 -05:00
										 |  |  |     accessibilityFrame.pack(expand=True, anchor=E) | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     algorithmFrame.pack(expand=True, anchor=E) | 
					
						
							|  |  |  |     shuffleFrame.pack(expand=True, anchor=E) | 
					
						
							| 
									
										
										
										
											2020-09-20 04:35:45 +02:00
										 |  |  |     prizeFrame.pack(expand=True, anchor=E) | 
					
						
							| 
									
										
										
										
											2017-11-04 14:23:57 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-08 03:43:48 +01:00
										 |  |  |     enemizerFrame = LabelFrame(randomizerWindow, text="Enemizer", padx=5, pady=2) | 
					
						
							| 
									
										
										
										
											2020-06-10 19:57:01 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-30 01:10:16 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     enemizerPathFrame = Frame(enemizerFrame) | 
					
						
							| 
									
										
										
										
											2020-08-19 23:24:17 +02:00
										 |  |  |     enemizerPathFrame.grid(row=0, column=0, columnspan=4, sticky=W + E, padx=3) | 
					
						
							| 
									
										
										
										
											2019-05-30 01:10:16 +02:00
										 |  |  |     enemizerCLIlabel = Label(enemizerPathFrame, text="EnemizerCLI path: ") | 
					
						
							|  |  |  |     enemizerCLIlabel.pack(side=LEFT) | 
					
						
							| 
									
										
										
										
											2020-01-06 18:39:18 +01:00
										 |  |  |     enemizerCLIpathVar = StringVar(value="EnemizerCLI/EnemizerCLI.Core") | 
					
						
							| 
									
										
										
										
											2020-01-08 03:43:48 +01:00
										 |  |  |     enemizerCLIpathEntry = Entry(enemizerPathFrame, textvariable=enemizerCLIpathVar) | 
					
						
							|  |  |  |     enemizerCLIpathEntry.pack(side=LEFT, expand=True, fill=X) | 
					
						
							| 
									
										
										
										
											2020-08-19 23:24:17 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-30 01:10:16 +02:00
										 |  |  |     def EnemizerSelectPath(): | 
					
						
							|  |  |  |         path = filedialog.askopenfilename(filetypes=[("EnemizerCLI executable", "*EnemizerCLI*")]) | 
					
						
							|  |  |  |         if path: | 
					
						
							|  |  |  |             enemizerCLIpathVar.set(path) | 
					
						
							| 
									
										
										
										
											2020-08-19 23:24:17 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-30 01:10:16 +02:00
										 |  |  |     enemizerCLIbrowseButton = Button(enemizerPathFrame, text='...', command=EnemizerSelectPath) | 
					
						
							|  |  |  |     enemizerCLIbrowseButton.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-08 03:43:48 +01:00
										 |  |  |     enemizerEnemyFrame = Frame(enemizerFrame) | 
					
						
							|  |  |  |     enemizerEnemyFrame.grid(row=1, column=0, pady=5) | 
					
						
							| 
									
										
										
										
											2020-08-19 23:24:17 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     enemyShuffleVar = IntVar() | 
					
						
							|  |  |  |     enemizerEnemyButton = Checkbutton(enemizerEnemyFrame, text="Enemy shuffle", variable=enemyShuffleVar) | 
					
						
							|  |  |  |     enemizerEnemyButton.pack(side=LEFT) | 
					
						
							| 
									
										
										
										
											2019-05-30 01:10:16 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     enemizerBossFrame = Frame(enemizerFrame) | 
					
						
							| 
									
										
										
										
											2020-01-08 03:43:48 +01:00
										 |  |  |     enemizerBossFrame.grid(row=1, column=1) | 
					
						
							| 
									
										
										
										
											2019-05-30 01:10:16 +02:00
										 |  |  |     enemizerBossVar = StringVar() | 
					
						
							|  |  |  |     enemizerBossVar.set('none') | 
					
						
							| 
									
										
										
										
											2020-07-31 00:07:55 +02:00
										 |  |  |     enemizerBossOption = OptionMenu(enemizerBossFrame, enemizerBossVar, 'none', 'basic', 'normal', 'chaos', | 
					
						
							| 
									
										
										
										
											2020-08-19 21:10:02 +02:00
										 |  |  |                                     "singularity") | 
					
						
							| 
									
										
										
										
											2020-08-19 23:24:17 +02:00
										 |  |  |     enemizerBossLabel = Label(enemizerBossFrame, text='Boss shuffle') | 
					
						
							|  |  |  |     enemizerBossLabel.pack(side=LEFT) | 
					
						
							| 
									
										
										
										
											2020-08-27 15:16:13 -07:00
										 |  |  |     enemizerBossOption.pack(side=LEFT) | 
					
						
							| 
									
										
										
										
											2019-05-30 01:10:16 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     enemizerDamageFrame = Frame(enemizerFrame) | 
					
						
							| 
									
										
										
										
											2020-01-08 03:43:48 +01:00
										 |  |  |     enemizerDamageFrame.grid(row=1, column=2) | 
					
						
							| 
									
										
										
										
											2019-05-30 01:10:16 +02:00
										 |  |  |     enemizerDamageVar = StringVar() | 
					
						
							|  |  |  |     enemizerDamageVar.set('default') | 
					
						
							|  |  |  |     enemizerDamageOption = OptionMenu(enemizerDamageFrame, enemizerDamageVar, 'default', 'shuffled', 'chaos') | 
					
						
							| 
									
										
										
										
											2020-08-19 23:24:17 +02:00
										 |  |  |     enemizerDamageLabel = Label(enemizerDamageFrame, text='Enemy damage') | 
					
						
							|  |  |  |     enemizerDamageLabel.pack(side=LEFT) | 
					
						
							| 
									
										
										
										
											2020-08-27 15:16:13 -07:00
										 |  |  |     enemizerDamageOption.pack(side=LEFT) | 
					
						
							| 
									
										
										
										
											2019-05-30 01:10:16 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     enemizerHealthFrame = Frame(enemizerFrame) | 
					
						
							| 
									
										
										
										
											2020-01-08 03:43:48 +01:00
										 |  |  |     enemizerHealthFrame.grid(row=1, column=3) | 
					
						
							| 
									
										
										
										
											2019-05-30 01:10:16 +02:00
										 |  |  |     enemizerHealthVar = StringVar() | 
					
						
							|  |  |  |     enemizerHealthVar.set('default') | 
					
						
							| 
									
										
										
										
											2020-08-19 23:24:17 +02:00
										 |  |  |     enemizerHealthOption = OptionMenu(enemizerHealthFrame, enemizerHealthVar, 'default', 'easy', 'normal', 'hard', | 
					
						
							|  |  |  |                                       'expert') | 
					
						
							|  |  |  |     enemizerHealthLabel = Label(enemizerHealthFrame, text='Enemy health') | 
					
						
							|  |  |  |     enemizerHealthLabel.pack(side=LEFT) | 
					
						
							| 
									
										
										
										
											2020-08-27 15:16:13 -07:00
										 |  |  |     enemizerHealthOption.pack(side=LEFT) | 
					
						
							| 
									
										
										
										
											2019-05-30 01:10:16 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-19 23:24:17 +02:00
										 |  |  |     potShuffleVar = IntVar() | 
					
						
							|  |  |  |     potShuffleButton = Checkbutton(enemizerFrame, text="Pot shuffle", variable=potShuffleVar) | 
					
						
							|  |  |  |     potShuffleButton.grid(row=2, column=0, sticky=W) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     bushShuffleVar = IntVar() | 
					
						
							|  |  |  |     bushShuffleButton = Checkbutton(enemizerFrame, text="Bush shuffle", variable=bushShuffleVar) | 
					
						
							| 
									
										
										
										
											2020-12-29 19:59:20 +01:00
										 |  |  |     bushShuffleButton.grid(row=2, column=1, sticky=W) | 
					
						
							| 
									
										
										
										
											2020-08-19 23:24:17 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     killableThievesVar = IntVar() | 
					
						
							|  |  |  |     killable_thievesShuffleButton = Checkbutton(enemizerFrame, text="Killable Thieves", variable=killableThievesVar) | 
					
						
							| 
									
										
										
										
											2020-12-29 19:59:20 +01:00
										 |  |  |     killable_thievesShuffleButton.grid(row=2, column=2, sticky=W) | 
					
						
							| 
									
										
										
										
											2020-08-19 23:24:17 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-23 21:38:21 +02:00
										 |  |  |     shopframe = LabelFrame(randomizerWindow, text="Shops", padx=5, pady=2) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     shopPriceShuffleVar = IntVar() | 
					
						
							|  |  |  |     shopPriceShuffleButton = Checkbutton(shopframe, text="Random Prices", variable=shopPriceShuffleVar) | 
					
						
							|  |  |  |     shopPriceShuffleButton.grid(row=0, column=0, sticky=W) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     shopShuffleVar = IntVar() | 
					
						
							|  |  |  |     shopShuffleButton = Checkbutton(shopframe, text="Shuffle Inventories", variable=shopShuffleVar) | 
					
						
							|  |  |  |     shopShuffleButton.grid(row=0, column=1, sticky=W) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     shopUpgradeShuffleVar = IntVar() | 
					
						
							|  |  |  |     shopUpgradeShuffleButton = Checkbutton(shopframe, text="Lootable Upgrades", variable=shopUpgradeShuffleVar) | 
					
						
							|  |  |  |     shopUpgradeShuffleButton.grid(row=0, column=2, sticky=W) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-24 21:58:26 +01:00
										 |  |  |     shopInventoryShuffleVar = IntVar() | 
					
						
							|  |  |  |     shopInventoryShuffleButton = Checkbutton(shopframe, text="New Inventories", variable=shopInventoryShuffleVar) | 
					
						
							|  |  |  |     shopInventoryShuffleButton.grid(row=1, column=0, sticky=W) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     shopPoolShuffleVar = IntVar() | 
					
						
							|  |  |  |     shopPoolShuffleButton = Checkbutton(shopframe, text="Itempool in Shops", variable=shopPoolShuffleVar) | 
					
						
							|  |  |  |     shopPoolShuffleButton.grid(row=1, column=1, sticky=W) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     shopWitchShuffleVar = IntVar() | 
					
						
							|  |  |  |     shopWitchShuffleButton = Checkbutton(shopframe, text="Custom Potion Shop", variable=shopWitchShuffleVar) | 
					
						
							|  |  |  |     shopWitchShuffleButton.grid(row=1, column=2, sticky=W) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-19 23:24:17 +02:00
										 |  |  |     multiworldframe = LabelFrame(randomizerWindow, text="Multiworld", padx=5, pady=2) | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-29 19:59:20 +01:00
										 |  |  |     worldLabel = Label(multiworldframe, text='Players per Team') | 
					
						
							| 
									
										
										
										
											2019-04-18 11:23:24 +02:00
										 |  |  |     worldVar = StringVar() | 
					
						
							| 
									
										
										
										
											2020-06-10 19:57:01 +02:00
										 |  |  |     worldSpinbox = Spinbox(multiworldframe, from_=1, to=255, width=5, textvariable=worldVar) | 
					
						
							|  |  |  |     namesLabel = Label(multiworldframe, text='Player names') | 
					
						
							| 
									
										
										
										
											2019-12-09 19:27:56 +01:00
										 |  |  |     namesVar = StringVar() | 
					
						
							| 
									
										
										
										
											2020-06-10 19:57:01 +02:00
										 |  |  |     namesEntry = Entry(multiworldframe, textvariable=namesVar) | 
					
						
							|  |  |  |     seedLabel = Label(multiworldframe, text='Seed #') | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     seedVar = StringVar() | 
					
						
							| 
									
										
										
										
											2020-06-28 00:24:45 +02:00
										 |  |  |     seedEntry = Entry(multiworldframe, width=20, textvariable=seedVar) | 
					
						
							| 
									
										
										
										
											2020-12-29 19:59:20 +01:00
										 |  |  |     countLabel = Label(multiworldframe, text='Amount of Multiworlds') | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     countVar = StringVar() | 
					
						
							| 
									
										
										
										
											2020-06-10 19:57:01 +02:00
										 |  |  |     countSpinbox = Spinbox(multiworldframe, from_=1, to=100, width=5, textvariable=countVar) | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-29 19:59:20 +01:00
										 |  |  |     balancingVar = IntVar() | 
					
						
							|  |  |  |     balancingVar.set(1)  # set default | 
					
						
							|  |  |  |     balancingCheckbutton = Checkbutton(multiworldframe, text="Progression Balancing", variable=balancingVar) | 
					
						
							|  |  |  |     patchesVar = IntVar() | 
					
						
							|  |  |  |     patchesVar.set(1)  # set default | 
					
						
							|  |  |  |     patchesCheckbutton = Checkbutton(multiworldframe, text="Create Delta Patches", variable=patchesVar) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     def generateRom(): | 
					
						
							| 
									
										
										
										
											2019-12-17 21:14:20 +01:00
										 |  |  |         guiargs = Namespace() | 
					
						
							| 
									
										
										
										
											2019-04-18 11:23:24 +02:00
										 |  |  |         guiargs.multi = int(worldVar.get()) | 
					
						
							| 
									
										
										
										
											2019-12-09 19:27:56 +01:00
										 |  |  |         guiargs.names = namesVar.get() | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |         guiargs.seed = int(seedVar.get()) if seedVar.get() else None | 
					
						
							|  |  |  |         guiargs.count = int(countVar.get()) if countVar.get() != '1' else None | 
					
						
							|  |  |  |         guiargs.mode = modeVar.get() | 
					
						
							|  |  |  |         guiargs.logic = logicVar.get() | 
					
						
							| 
									
										
										
										
											2020-10-07 19:51:46 +02:00
										 |  |  |         guiargs.dark_room_logic = {"Lamp": "lamp", | 
					
						
							|  |  |  |                                    "Lamp or easy Fire Rod torches": "torches", | 
					
						
							|  |  |  |                                    "dark traversal": "none"}[darklogicVar.get()] | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |         guiargs.goal = goalVar.get() | 
					
						
							| 
									
										
										
										
											2019-10-23 20:46:09 -05:00
										 |  |  |         guiargs.crystals_gt = crystalsGTVar.get() | 
					
						
							|  |  |  |         guiargs.crystals_ganon = crystalsGanonVar.get() | 
					
						
							|  |  |  |         guiargs.swords = swordVar.get() | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |         guiargs.difficulty = difficultyVar.get() | 
					
						
							| 
									
										
										
										
											2019-10-23 20:46:09 -05:00
										 |  |  |         guiargs.item_functionality = itemfunctionVar.get() | 
					
						
							| 
									
										
										
										
											2017-11-10 04:18:39 -06:00
										 |  |  |         guiargs.timer = timerVar.get() | 
					
						
							| 
									
										
										
										
											2020-10-28 16:20:59 -07:00
										 |  |  |         guiargs.countdown_start_time = timerCountdownVar.get() | 
					
						
							|  |  |  |         guiargs.red_clock_time = timerRedVar.get() | 
					
						
							|  |  |  |         guiargs.blue_clock_time = timerBlueVar.get() | 
					
						
							|  |  |  |         guiargs.green_clock_time = timerGreenVar.get() | 
					
						
							| 
									
										
										
										
											2020-05-11 02:17:18 +02:00
										 |  |  |         guiargs.skip_progression_balancing = not balancingVar.get() | 
					
						
							| 
									
										
										
										
											2020-03-04 13:55:03 +01:00
										 |  |  |         if guiargs.timer == "none": | 
					
						
							|  |  |  |             guiargs.timer = False | 
					
						
							| 
									
										
										
										
											2020-04-12 15:46:32 -07:00
										 |  |  |         guiargs.dungeon_counters = dungeonCounterVar.get() | 
					
						
							|  |  |  |         if guiargs.dungeon_counters == "on_compass_pickup": | 
					
						
							|  |  |  |             guiargs.dungeon_counters = "pickup" | 
					
						
							|  |  |  |         elif guiargs.dungeon_counters == "on": | 
					
						
							|  |  |  |             guiargs.dungeon_counters = True | 
					
						
							|  |  |  |         elif guiargs.dungeon_counters == "off": | 
					
						
							|  |  |  |             guiargs.dungeon_counters = False | 
					
						
							| 
									
										
										
										
											2017-11-10 04:18:39 -06:00
										 |  |  |         guiargs.progressive = progressiveVar.get() | 
					
						
							| 
									
										
										
										
											2019-10-23 20:46:09 -05:00
										 |  |  |         guiargs.accessibility = accessibilityVar.get() | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |         guiargs.algorithm = algorithmVar.get() | 
					
						
							|  |  |  |         guiargs.shuffle = shuffleVar.get() | 
					
						
							| 
									
										
										
										
											2021-02-20 02:30:55 +01:00
										 |  |  |         if "same " in guiargs.shuffle: | 
					
						
							|  |  |  |             guiargs.shuffle = guiargs.shuffle[5:] + "-" + str(seedVar.get() if seedVar.get() else | 
					
						
							|  |  |  |                                                               random.randint(0, 2**64)) | 
					
						
							| 
									
										
										
										
											2021-02-19 19:08:11 +01:00
										 |  |  |         guiargs.heartbeep = rom_vars.heartbeepVar.get() | 
					
						
							|  |  |  |         guiargs.heartcolor = rom_vars.heartcolorVar.get() | 
					
						
							|  |  |  |         guiargs.fastmenu = rom_vars.fastMenuVar.get() | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |         guiargs.create_spoiler = bool(createSpoilerVar.get()) | 
					
						
							| 
									
										
										
										
											2020-08-30 16:46:47 +02:00
										 |  |  |         guiargs.skip_playthrough = not bool(createSpoilerVar.get()) | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |         guiargs.suppress_rom = bool(suppressRomVar.get()) | 
					
						
							| 
									
										
										
										
											2021-01-29 13:27:42 -08:00
										 |  |  |         guiargs.open_pyramid = openpyramidVar.get() | 
					
						
							| 
									
										
										
										
											2019-12-13 22:37:52 +01:00
										 |  |  |         guiargs.mapshuffle = bool(mapshuffleVar.get()) | 
					
						
							|  |  |  |         guiargs.compassshuffle = bool(compassshuffleVar.get()) | 
					
						
							| 
									
										
										
										
											2020-08-20 20:13:00 +02:00
										 |  |  |         guiargs.keyshuffle = {"on": True, "universal": "universal", "off": False}[keyshuffleVar.get()] | 
					
						
							| 
									
										
										
										
											2019-12-13 22:37:52 +01:00
										 |  |  |         guiargs.bigkeyshuffle = bool(bigkeyshuffleVar.get()) | 
					
						
							| 
									
										
										
										
											2018-03-14 13:31:36 -05:00
										 |  |  |         guiargs.retro = bool(retroVar.get()) | 
					
						
							| 
									
										
										
										
											2021-02-19 19:08:11 +01:00
										 |  |  |         guiargs.quickswap = bool(rom_vars.quickSwapVar.get()) | 
					
						
							|  |  |  |         guiargs.disablemusic = bool(rom_vars.disableMusicVar.get()) | 
					
						
							|  |  |  |         guiargs.reduceflashing = bool(rom_vars.disableFlashingVar.get()) | 
					
						
							|  |  |  |         guiargs.ow_palettes = rom_vars.owPalettesVar.get() | 
					
						
							|  |  |  |         guiargs.uw_palettes = rom_vars.uwPalettesVar.get() | 
					
						
							|  |  |  |         guiargs.hud_palettes = rom_vars.hudPalettesVar.get() | 
					
						
							|  |  |  |         guiargs.sword_palettes = rom_vars.swordPalettesVar.get() | 
					
						
							|  |  |  |         guiargs.shield_palettes = rom_vars.shieldPalettesVar.get() | 
					
						
							| 
									
										
										
										
											2017-07-17 22:28:29 +02:00
										 |  |  |         guiargs.shuffleganon = bool(shuffleGanonVar.get()) | 
					
						
							| 
									
										
										
										
											2019-01-23 03:04:42 -06:00
										 |  |  |         guiargs.hints = bool(hintsVar.get()) | 
					
						
							| 
									
										
										
										
											2019-05-30 01:10:16 +02:00
										 |  |  |         guiargs.enemizercli = enemizerCLIpathVar.get() | 
					
						
							|  |  |  |         guiargs.shufflebosses = enemizerBossVar.get() | 
					
						
							| 
									
										
										
										
											2020-08-19 23:24:17 +02:00
										 |  |  |         guiargs.enemy_shuffle = enemyShuffleVar.get() | 
					
						
							|  |  |  |         guiargs.bush_shuffle = bushShuffleVar.get() | 
					
						
							|  |  |  |         guiargs.tile_shuffle = tileShuffleVar.get() | 
					
						
							|  |  |  |         guiargs.killable_thieves = killableThievesVar.get() | 
					
						
							| 
									
										
										
										
											2019-05-30 01:10:16 +02:00
										 |  |  |         guiargs.enemy_health = enemizerHealthVar.get() | 
					
						
							|  |  |  |         guiargs.enemy_damage = enemizerDamageVar.get() | 
					
						
							|  |  |  |         guiargs.shufflepots = bool(potShuffleVar.get()) | 
					
						
							| 
									
										
										
										
											2018-01-21 20:43:44 -06:00
										 |  |  |         guiargs.custom = bool(customVar.get()) | 
					
						
							| 
									
										
										
										
											2020-08-16 12:04:04 +02:00
										 |  |  |         guiargs.triforce_pieces_required = min(90, int(triforcecountVar.get())) | 
					
						
							|  |  |  |         guiargs.triforce_pieces_available = min(90, int(triforcepieceVar.get())) | 
					
						
							| 
									
										
										
										
											2020-08-23 21:38:21 +02:00
										 |  |  |         guiargs.shop_shuffle = "" | 
					
						
							|  |  |  |         if shopShuffleVar.get(): | 
					
						
							|  |  |  |             guiargs.shop_shuffle += "i" | 
					
						
							|  |  |  |         if shopPriceShuffleVar.get(): | 
					
						
							|  |  |  |             guiargs.shop_shuffle += "p" | 
					
						
							|  |  |  |         if shopUpgradeShuffleVar.get(): | 
					
						
							|  |  |  |             guiargs.shop_shuffle += "u" | 
					
						
							| 
									
										
										
										
											2021-01-24 21:58:26 +01:00
										 |  |  |         if shopInventoryShuffleVar.get(): | 
					
						
							|  |  |  |             guiargs.shop_shuffle += "f" | 
					
						
							|  |  |  |         if shopWitchShuffleVar.get(): | 
					
						
							|  |  |  |             guiargs.shop_shuffle += "w" | 
					
						
							|  |  |  |         if shopPoolShuffleVar.get(): | 
					
						
							|  |  |  |             guiargs.shop_shuffle_slots = 30 | 
					
						
							| 
									
										
										
										
											2020-09-20 04:35:45 +02:00
										 |  |  |         guiargs.shuffle_prizes = {"none": "", | 
					
						
							|  |  |  |                                   "bonk": "b", | 
					
						
							|  |  |  |                                   "general": "g", | 
					
						
							|  |  |  |                                   "both": "bg"}[prizeVar.get()] | 
					
						
							| 
									
										
										
										
											2020-10-06 13:22:03 -07:00
										 |  |  |         guiargs.sprite_pool = [] | 
					
						
							| 
									
										
										
										
											2020-08-16 12:04:04 +02:00
										 |  |  |         guiargs.customitemarray = [int(bowVar.get()), int(silverarrowVar.get()), int(boomerangVar.get()), | 
					
						
							|  |  |  |                                    int(magicboomerangVar.get()), int(hookshotVar.get()), int(mushroomVar.get()), | 
					
						
							|  |  |  |                                    int(magicpowderVar.get()), int(firerodVar.get()), | 
					
						
							|  |  |  |                                    int(icerodVar.get()), int(bombosVar.get()), int(etherVar.get()), int(quakeVar.get()), | 
					
						
							|  |  |  |                                    int(lampVar.get()), int(hammerVar.get()), int(shovelVar.get()), int(fluteVar.get()), | 
					
						
							|  |  |  |                                    int(bugnetVar.get()), | 
					
						
							|  |  |  |                                    int(bookVar.get()), int(bottleVar.get()), int(somariaVar.get()), int(byrnaVar.get()), | 
					
						
							|  |  |  |                                    int(capeVar.get()), int(mirrorVar.get()), int(bootsVar.get()), | 
					
						
							|  |  |  |                                    int(powergloveVar.get()), int(titansmittVar.get()), | 
					
						
							|  |  |  |                                    int(proggloveVar.get()), int(flippersVar.get()), int(pearlVar.get()), | 
					
						
							|  |  |  |                                    int(heartpieceVar.get()), int(fullheartVar.get()), int(sancheartVar.get()), | 
					
						
							|  |  |  |                                    int(sword1Var.get()), int(sword2Var.get()), | 
					
						
							|  |  |  |                                    int(sword3Var.get()), int(sword4Var.get()), int(progswordVar.get()), | 
					
						
							|  |  |  |                                    int(shield1Var.get()), int(shield2Var.get()), int(shield3Var.get()), | 
					
						
							|  |  |  |                                    int(progshieldVar.get()), int(bluemailVar.get()), | 
					
						
							|  |  |  |                                    int(redmailVar.get()), int(progmailVar.get()), int(halfmagicVar.get()), | 
					
						
							|  |  |  |                                    int(quartermagicVar.get()), int(bcap5Var.get()), int(bcap10Var.get()), | 
					
						
							|  |  |  |                                    int(acap5Var.get()), int(acap10Var.get()), | 
					
						
							|  |  |  |                                    int(arrow1Var.get()), int(arrow10Var.get()), int(bomb1Var.get()), | 
					
						
							|  |  |  |                                    int(bomb3Var.get()), int(rupee1Var.get()), int(rupee5Var.get()), | 
					
						
							|  |  |  |                                    int(rupee20Var.get()), int(rupee50Var.get()), int(rupee100Var.get()), | 
					
						
							|  |  |  |                                    int(rupee300Var.get()), int(rupoorVar.get()), int(blueclockVar.get()), | 
					
						
							|  |  |  |                                    int(greenclockVar.get()), int(redclockVar.get()), int(progbowVar.get()), | 
					
						
							| 
									
										
										
										
											2020-09-16 18:18:17 -04:00
										 |  |  |                                    int(bomb10Var.get()), int(universalkeyVar.get()), | 
					
						
							|  |  |  |                                    int(rupoorcostVar.get()), int(triforceVar.get())] | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |         guiargs.rom = romVar.get() | 
					
						
							| 
									
										
										
										
											2020-08-20 03:41:37 +02:00
										 |  |  |         guiargs.create_diff = patchesVar.get() | 
					
						
							| 
									
										
										
										
											2021-02-19 19:08:11 +01:00
										 |  |  |         guiargs.sprite = rom_vars.sprite | 
					
						
							| 
									
										
										
										
											2019-12-15 18:10:12 +01:00
										 |  |  |         # get default values for missing parameters | 
					
						
							| 
									
										
										
										
											2019-12-31 01:16:41 +01:00
										 |  |  |         for k,v in vars(parse_arguments(['--multi', str(guiargs.multi)])).items(): | 
					
						
							| 
									
										
										
										
											2019-12-15 18:10:12 +01:00
										 |  |  |             if k not in vars(guiargs): | 
					
						
							|  |  |  |                 setattr(guiargs, k, v) | 
					
						
							| 
									
										
										
										
											2019-12-17 21:14:20 +01:00
										 |  |  |             elif type(v) is dict: # use same settings for every player | 
					
						
							|  |  |  |                 setattr(guiargs, k, {player: getattr(guiargs, k) for player in range(1, guiargs.multi + 1)}) | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |         try: | 
					
						
							| 
									
										
										
										
											2020-03-30 07:46:40 +02:00
										 |  |  |             if not guiargs.suppress_rom and not os.path.exists(guiargs.rom): | 
					
						
							|  |  |  |                 raise FileNotFoundError(f"Could not find specified rom file {guiargs.rom}") | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |             if guiargs.count is not None: | 
					
						
							|  |  |  |                 seed = guiargs.seed | 
					
						
							| 
									
										
										
										
											2017-12-17 00:25:46 -05:00
										 |  |  |                 for _ in range(guiargs.count): | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |                     main(seed=seed, args=guiargs) | 
					
						
							| 
									
										
										
										
											2020-06-28 00:24:45 +02:00
										 |  |  |                     seed = get_seed() | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |             else: | 
					
						
							|  |  |  |                 main(seed=guiargs.seed, args=guiargs) | 
					
						
							|  |  |  |         except Exception as e: | 
					
						
							| 
									
										
										
										
											2019-12-10 02:15:03 +01:00
										 |  |  |             logging.exception(e) | 
					
						
							| 
									
										
										
										
											2020-08-23 21:38:21 +02:00
										 |  |  |             messagebox.showerror(title="Error while creating multiworld", message=str(e)) | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |         else: | 
					
						
							| 
									
										
										
										
											2020-08-23 21:38:21 +02:00
										 |  |  |             messagebox.showinfo(title="Success", message="Multiworld created successfully") | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-29 19:59:20 +01:00
										 |  |  |     generateButton = Button(farBottomFrame, text='Generate Multiworld', command=generateRom) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     worldLabel.grid(row=0, column=0, sticky=W) | 
					
						
							|  |  |  |     worldSpinbox.grid(row=0, column=1, sticky=W) | 
					
						
							|  |  |  |     namesLabel.grid(row=0, column=2, sticky=W) | 
					
						
							|  |  |  |     namesEntry.grid(row=0, column=3, sticky=W + E) | 
					
						
							|  |  |  |     multiworldframe.grid_columnconfigure(3, weight=1)  # stretch name field | 
					
						
							|  |  |  |     seedLabel.grid(row=0, column=4, sticky=W) | 
					
						
							|  |  |  |     seedEntry.grid(row=0, column=5, sticky=W) | 
					
						
							|  |  |  |     countLabel.grid(row=1, column=0, sticky=W) | 
					
						
							|  |  |  |     countSpinbox.grid(row=1, column=1, sticky=W) | 
					
						
							|  |  |  |     balancingCheckbutton.grid(row=1, column=2, sticky=W, columnspan=2) | 
					
						
							|  |  |  |     patchesCheckbutton.grid(row=1, column=4, sticky=W, columnspan=2) | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-10 19:57:01 +02:00
										 |  |  |     generateButton.pack(side=RIGHT, padx=(5, 0)) | 
					
						
							| 
									
										
										
										
											2017-11-25 21:49:36 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-10 19:57:01 +02:00
										 |  |  |     openOutputButton.pack(side=LEFT) | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     drowDownFrame.pack(side=LEFT) | 
					
						
							|  |  |  |     rightHalfFrame.pack(side=RIGHT) | 
					
						
							|  |  |  |     topFrame.pack(side=TOP) | 
					
						
							| 
									
										
										
										
											2020-06-10 19:57:01 +02:00
										 |  |  |     multiworldframe.pack(side=BOTTOM, expand=True, fill=X) | 
					
						
							| 
									
										
										
										
											2019-05-30 01:10:16 +02:00
										 |  |  |     enemizerFrame.pack(side=BOTTOM, fill=BOTH) | 
					
						
							| 
									
										
										
										
											2020-08-23 21:38:21 +02:00
										 |  |  |     shopframe.pack(side=BOTTOM, expand=True, fill=X) | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-21 20:43:44 -06:00
										 |  |  |     # Custom Controls | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     topFrame3 = Frame(customWindow) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def validation(P): | 
					
						
							|  |  |  |         if str.isdigit(P) or P == "": | 
					
						
							|  |  |  |             return True | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             return False | 
					
						
							|  |  |  |     vcmd=(topFrame3.register(validation), '%P') | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-11 19:34:18 +01:00
										 |  |  |     timerOptionsFrame = LabelFrame(topFrame3, text="Timer options") | 
					
						
							|  |  |  |     for i in range(3): | 
					
						
							|  |  |  |         timerOptionsFrame.columnconfigure(i, weight=1) | 
					
						
							|  |  |  |         timerOptionsFrame.rowconfigure(i, weight=1) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     timerModeFrame = Frame(timerOptionsFrame) | 
					
						
							|  |  |  |     timerModeFrame.grid(row=0, column=0, columnspan=3, sticky=E, padx=3) | 
					
						
							|  |  |  |     timerVar = StringVar() | 
					
						
							|  |  |  |     timerVar.set('none') | 
					
						
							|  |  |  |     timerModeMenu = OptionMenu(timerModeFrame, timerVar, 'none', 'display', 'timed', 'timed-ohko', 'ohko', 'timed-countdown') | 
					
						
							|  |  |  |     timerLabel = Label(timerModeFrame, text='Timer setting') | 
					
						
							|  |  |  |     timerLabel.pack(side=LEFT) | 
					
						
							|  |  |  |     timerModeMenu.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     timerCountdownFrame = Frame(timerOptionsFrame) | 
					
						
							|  |  |  |     timerCountdownFrame.grid(row=1, column=0, columnspan=3, sticky=E, padx=3) | 
					
						
							|  |  |  |     timerCountdownLabel = Label(timerCountdownFrame, text='Countdown starting time') | 
					
						
							|  |  |  |     timerCountdownLabel.pack(side=LEFT) | 
					
						
							|  |  |  |     timerCountdownVar = IntVar(value=10) | 
					
						
							|  |  |  |     timerCountdownSpinbox = Spinbox(timerCountdownFrame, from_=0, to=480, width=3, textvariable=timerCountdownVar) | 
					
						
							|  |  |  |     timerCountdownSpinbox.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     timerRedFrame = Frame(timerOptionsFrame) | 
					
						
							|  |  |  |     timerRedFrame.grid(row=2, column=0, sticky=E, padx=3) | 
					
						
							|  |  |  |     timerRedLabel = Label(timerRedFrame, text='Clock adjustments: Red') | 
					
						
							|  |  |  |     timerRedLabel.pack(side=LEFT) | 
					
						
							|  |  |  |     timerRedVar = IntVar(value=-2) | 
					
						
							|  |  |  |     timerRedSpinbox = Spinbox(timerRedFrame, from_=-60, to=60, width=3, textvariable=timerRedVar) | 
					
						
							|  |  |  |     timerRedSpinbox.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     timerBlueFrame = Frame(timerOptionsFrame) | 
					
						
							|  |  |  |     timerBlueFrame.grid(row=2, column=1, sticky=E, padx=3) | 
					
						
							|  |  |  |     timerBlueLabel = Label(timerBlueFrame, text='Blue') | 
					
						
							|  |  |  |     timerBlueLabel.pack(side=LEFT) | 
					
						
							|  |  |  |     timerBlueVar = IntVar(value=2) | 
					
						
							|  |  |  |     timerBlueSpinbox = Spinbox(timerBlueFrame, from_=-60, to=60, width=3, textvariable=timerBlueVar) | 
					
						
							|  |  |  |     timerBlueSpinbox.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     timerGreenFrame = Frame(timerOptionsFrame) | 
					
						
							|  |  |  |     timerGreenFrame.grid(row=2, column=2, sticky=E, padx=3) | 
					
						
							|  |  |  |     timerGreenLabel = Label(timerGreenFrame, text='Green') | 
					
						
							|  |  |  |     timerGreenLabel.pack(side=LEFT) | 
					
						
							|  |  |  |     timerGreenVar = IntVar(value=4) | 
					
						
							|  |  |  |     timerGreenSpinbox = Spinbox(timerGreenFrame, from_=-60, to=60, width=3, textvariable=timerGreenVar) | 
					
						
							|  |  |  |     timerGreenSpinbox.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     timerOptionsFrame.pack(expand=True, fill=BOTH, padx=3) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-21 20:43:44 -06:00
										 |  |  |     itemList1 = Frame(topFrame3) | 
					
						
							|  |  |  |     itemList2 = Frame(topFrame3) | 
					
						
							|  |  |  |     itemList3 = Frame(topFrame3) | 
					
						
							|  |  |  |     itemList4 = Frame(topFrame3) | 
					
						
							|  |  |  |     itemList5 = Frame(topFrame3) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-11 19:34:18 +01:00
										 |  |  |     customVar = IntVar() | 
					
						
							|  |  |  |     customCheckbutton = Checkbutton(topFrame3, text="Use custom item pool", variable=customVar) | 
					
						
							|  |  |  |     customCheckbutton.pack(expand=True, anchor=W) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-21 20:43:44 -06:00
										 |  |  |     bowFrame = Frame(itemList1) | 
					
						
							|  |  |  |     bowLabel = Label(bowFrame, text='Bow') | 
					
						
							| 
									
										
										
										
											2019-10-23 21:31:02 -05:00
										 |  |  |     bowVar = StringVar(value='0') | 
					
						
							| 
									
										
										
										
											2018-01-21 20:43:44 -06:00
										 |  |  |     bowEntry = Entry(bowFrame, textvariable=bowVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     bowFrame.pack() | 
					
						
							|  |  |  |     bowLabel.pack(anchor=W, side=LEFT, padx=(0,53)) | 
					
						
							|  |  |  |     bowEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-23 21:31:02 -05:00
										 |  |  |     progbowFrame = Frame(itemList1) | 
					
						
							|  |  |  |     progbowLabel = Label(progbowFrame, text='Prog.Bow') | 
					
						
							|  |  |  |     progbowVar = StringVar(value='2') | 
					
						
							|  |  |  |     progbowEntry = Entry(progbowFrame, textvariable=progbowVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     progbowFrame.pack() | 
					
						
							|  |  |  |     progbowLabel.pack(anchor=W, side=LEFT, padx=(0,25)) | 
					
						
							|  |  |  |     progbowEntry.pack(anchor=E) | 
					
						
							| 
									
										
										
										
											2018-01-21 20:43:44 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  |     boomerangFrame = Frame(itemList1) | 
					
						
							|  |  |  |     boomerangLabel = Label(boomerangFrame, text='Boomerang') | 
					
						
							|  |  |  |     boomerangVar = StringVar(value='1') | 
					
						
							|  |  |  |     boomerangEntry = Entry(boomerangFrame, textvariable=boomerangVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     boomerangFrame.pack() | 
					
						
							|  |  |  |     boomerangLabel.pack(anchor=W, side=LEFT, padx=(0,14)) | 
					
						
							|  |  |  |     boomerangEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     magicboomerangFrame = Frame(itemList1) | 
					
						
							|  |  |  |     magicboomerangLabel = Label(magicboomerangFrame, text='M.Boomerang') | 
					
						
							|  |  |  |     magicboomerangVar = StringVar(value='1') | 
					
						
							|  |  |  |     magicboomerangEntry = Entry(magicboomerangFrame, textvariable=magicboomerangVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     magicboomerangFrame.pack() | 
					
						
							|  |  |  |     magicboomerangLabel.pack(anchor=W, side=LEFT) | 
					
						
							|  |  |  |     magicboomerangEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     hookshotFrame = Frame(itemList1) | 
					
						
							|  |  |  |     hookshotLabel = Label(hookshotFrame, text='Hookshot') | 
					
						
							|  |  |  |     hookshotVar = StringVar(value='1') | 
					
						
							|  |  |  |     hookshotEntry = Entry(hookshotFrame, textvariable=hookshotVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     hookshotFrame.pack() | 
					
						
							|  |  |  |     hookshotLabel.pack(anchor=W, side=LEFT, padx=(0,24)) | 
					
						
							|  |  |  |     hookshotEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     mushroomFrame = Frame(itemList1) | 
					
						
							|  |  |  |     mushroomLabel = Label(mushroomFrame, text='Mushroom') | 
					
						
							|  |  |  |     mushroomVar = StringVar(value='1') | 
					
						
							|  |  |  |     mushroomEntry = Entry(mushroomFrame, textvariable=mushroomVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     mushroomFrame.pack() | 
					
						
							|  |  |  |     mushroomLabel.pack(anchor=W, side=LEFT, padx=(0,17)) | 
					
						
							|  |  |  |     mushroomEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     magicpowderFrame = Frame(itemList1) | 
					
						
							|  |  |  |     magicpowderLabel = Label(magicpowderFrame, text='Magic Powder') | 
					
						
							|  |  |  |     magicpowderVar = StringVar(value='1') | 
					
						
							|  |  |  |     magicpowderEntry = Entry(magicpowderFrame, textvariable=magicpowderVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     magicpowderFrame.pack() | 
					
						
							|  |  |  |     magicpowderLabel.pack(anchor=W, side=LEFT) | 
					
						
							|  |  |  |     magicpowderEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     firerodFrame = Frame(itemList1) | 
					
						
							|  |  |  |     firerodLabel = Label(firerodFrame, text='Fire Rod') | 
					
						
							|  |  |  |     firerodVar = StringVar(value='1') | 
					
						
							|  |  |  |     firerodEntry = Entry(firerodFrame, textvariable=firerodVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     firerodFrame.pack() | 
					
						
							|  |  |  |     firerodLabel.pack(anchor=W, side=LEFT, padx=(0,33)) | 
					
						
							|  |  |  |     firerodEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     icerodFrame = Frame(itemList1) | 
					
						
							|  |  |  |     icerodLabel = Label(icerodFrame, text='Ice Rod') | 
					
						
							|  |  |  |     icerodVar = StringVar(value='1') | 
					
						
							|  |  |  |     icerodEntry = Entry(icerodFrame, textvariable=icerodVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     icerodFrame.pack() | 
					
						
							|  |  |  |     icerodLabel.pack(anchor=W, side=LEFT, padx=(0,37)) | 
					
						
							|  |  |  |     icerodEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     bombosFrame = Frame(itemList1) | 
					
						
							|  |  |  |     bombosLabel = Label(bombosFrame, text='Bombos') | 
					
						
							|  |  |  |     bombosVar = StringVar(value='1') | 
					
						
							|  |  |  |     bombosEntry = Entry(bombosFrame, textvariable=bombosVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     bombosFrame.pack() | 
					
						
							|  |  |  |     bombosLabel.pack(anchor=W, side=LEFT, padx=(0,32)) | 
					
						
							|  |  |  |     bombosEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     etherFrame = Frame(itemList1) | 
					
						
							|  |  |  |     etherLabel = Label(etherFrame, text='Ether') | 
					
						
							|  |  |  |     etherVar = StringVar(value='1') | 
					
						
							|  |  |  |     etherEntry = Entry(etherFrame, textvariable=etherVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     etherFrame.pack() | 
					
						
							|  |  |  |     etherLabel.pack(anchor=W, side=LEFT, padx=(0,49)) | 
					
						
							|  |  |  |     etherEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     quakeFrame = Frame(itemList1) | 
					
						
							|  |  |  |     quakeLabel = Label(quakeFrame, text='Quake') | 
					
						
							|  |  |  |     quakeVar = StringVar(value='1') | 
					
						
							|  |  |  |     quakeEntry = Entry(quakeFrame, textvariable=quakeVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     quakeFrame.pack() | 
					
						
							|  |  |  |     quakeLabel.pack(anchor=W, side=LEFT, padx=(0,42)) | 
					
						
							|  |  |  |     quakeEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     lampFrame = Frame(itemList1) | 
					
						
							|  |  |  |     lampLabel = Label(lampFrame, text='Lamp') | 
					
						
							|  |  |  |     lampVar = StringVar(value='1') | 
					
						
							|  |  |  |     lampEntry = Entry(lampFrame, textvariable=lampVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     lampFrame.pack() | 
					
						
							|  |  |  |     lampLabel.pack(anchor=W, side=LEFT, padx=(0,46)) | 
					
						
							|  |  |  |     lampEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     hammerFrame = Frame(itemList1) | 
					
						
							|  |  |  |     hammerLabel = Label(hammerFrame, text='Hammer') | 
					
						
							|  |  |  |     hammerVar = StringVar(value='1') | 
					
						
							|  |  |  |     hammerEntry = Entry(hammerFrame, textvariable=hammerVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     hammerFrame.pack() | 
					
						
							|  |  |  |     hammerLabel.pack(anchor=W, side=LEFT, padx=(0,29)) | 
					
						
							|  |  |  |     hammerEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     shovelFrame = Frame(itemList1) | 
					
						
							|  |  |  |     shovelLabel = Label(shovelFrame, text='Shovel') | 
					
						
							|  |  |  |     shovelVar = StringVar(value='1') | 
					
						
							|  |  |  |     shovelEntry = Entry(shovelFrame, textvariable=shovelVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     shovelFrame.pack() | 
					
						
							|  |  |  |     shovelLabel.pack(anchor=W, side=LEFT, padx=(0,41)) | 
					
						
							|  |  |  |     shovelEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     fluteFrame = Frame(itemList1) | 
					
						
							|  |  |  |     fluteLabel = Label(fluteFrame, text='Flute') | 
					
						
							|  |  |  |     fluteVar = StringVar(value='1') | 
					
						
							|  |  |  |     fluteEntry = Entry(fluteFrame, textvariable=fluteVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     fluteFrame.pack() | 
					
						
							|  |  |  |     fluteLabel.pack(anchor=W, side=LEFT, padx=(0,50)) | 
					
						
							|  |  |  |     fluteEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     bugnetFrame = Frame(itemList2) | 
					
						
							|  |  |  |     bugnetLabel = Label(bugnetFrame, text='Bug Net') | 
					
						
							|  |  |  |     bugnetVar = StringVar(value='1') | 
					
						
							|  |  |  |     bugnetEntry = Entry(bugnetFrame, textvariable=bugnetVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     bugnetFrame.pack() | 
					
						
							|  |  |  |     bugnetLabel.pack(anchor=W, side=LEFT, padx=(0,41)) | 
					
						
							|  |  |  |     bugnetEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     bookFrame = Frame(itemList2) | 
					
						
							|  |  |  |     bookLabel = Label(bookFrame, text='Book') | 
					
						
							|  |  |  |     bookVar = StringVar(value='1') | 
					
						
							|  |  |  |     bookEntry = Entry(bookFrame, textvariable=bookVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     bookFrame.pack() | 
					
						
							|  |  |  |     bookLabel.pack(anchor=W, side=LEFT, padx=(0,57)) | 
					
						
							|  |  |  |     bookEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     bottleFrame = Frame(itemList2) | 
					
						
							|  |  |  |     bottleLabel = Label(bottleFrame, text='Bottle') | 
					
						
							|  |  |  |     bottleVar = StringVar(value='4') | 
					
						
							|  |  |  |     bottleEntry = Entry(bottleFrame, textvariable=bottleVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     bottleFrame.pack() | 
					
						
							|  |  |  |     bottleLabel.pack(anchor=W, side=LEFT, padx=(0,53)) | 
					
						
							|  |  |  |     bottleEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     somariaFrame = Frame(itemList2) | 
					
						
							|  |  |  |     somariaLabel = Label(somariaFrame, text='C.Somaria') | 
					
						
							|  |  |  |     somariaVar = StringVar(value='1') | 
					
						
							|  |  |  |     somariaEntry = Entry(somariaFrame, textvariable=somariaVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     somariaFrame.pack() | 
					
						
							|  |  |  |     somariaLabel.pack(anchor=W, side=LEFT, padx=(0,30)) | 
					
						
							|  |  |  |     somariaEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     byrnaFrame = Frame(itemList2) | 
					
						
							|  |  |  |     byrnaLabel = Label(byrnaFrame, text='C.Byrna') | 
					
						
							|  |  |  |     byrnaVar = StringVar(value='1') | 
					
						
							|  |  |  |     byrnaEntry = Entry(byrnaFrame, textvariable=byrnaVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     byrnaFrame.pack() | 
					
						
							|  |  |  |     byrnaLabel.pack(anchor=W, side=LEFT, padx=(0,43)) | 
					
						
							|  |  |  |     byrnaEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     capeFrame = Frame(itemList2) | 
					
						
							|  |  |  |     capeLabel = Label(capeFrame, text='Magic Cape') | 
					
						
							|  |  |  |     capeVar = StringVar(value='1') | 
					
						
							|  |  |  |     capeEntry = Entry(capeFrame, textvariable=capeVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     capeFrame.pack() | 
					
						
							|  |  |  |     capeLabel.pack(anchor=W, side=LEFT, padx=(0,21)) | 
					
						
							|  |  |  |     capeEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     mirrorFrame = Frame(itemList2) | 
					
						
							|  |  |  |     mirrorLabel = Label(mirrorFrame, text='Magic Mirror') | 
					
						
							|  |  |  |     mirrorVar = StringVar(value='1') | 
					
						
							|  |  |  |     mirrorEntry = Entry(mirrorFrame, textvariable=mirrorVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     mirrorFrame.pack() | 
					
						
							|  |  |  |     mirrorLabel.pack(anchor=W, side=LEFT, padx=(0,15)) | 
					
						
							|  |  |  |     mirrorEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     bootsFrame = Frame(itemList2) | 
					
						
							|  |  |  |     bootsLabel = Label(bootsFrame, text='Pegasus Boots') | 
					
						
							|  |  |  |     bootsVar = StringVar(value='1') | 
					
						
							|  |  |  |     bootsEntry = Entry(bootsFrame, textvariable=bootsVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     bootsFrame.pack() | 
					
						
							|  |  |  |     bootsLabel.pack(anchor=W, side=LEFT, padx=(0,8)) | 
					
						
							|  |  |  |     bootsEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     powergloveFrame = Frame(itemList2) | 
					
						
							|  |  |  |     powergloveLabel = Label(powergloveFrame, text='Power Glove') | 
					
						
							|  |  |  |     powergloveVar = StringVar(value='0') | 
					
						
							|  |  |  |     powergloveEntry = Entry(powergloveFrame, textvariable=powergloveVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     powergloveFrame.pack() | 
					
						
							|  |  |  |     powergloveLabel.pack(anchor=W, side=LEFT, padx=(0,18)) | 
					
						
							|  |  |  |     powergloveEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     titansmittFrame = Frame(itemList2) | 
					
						
							|  |  |  |     titansmittLabel = Label(titansmittFrame, text='Titan\'s Mitt') | 
					
						
							|  |  |  |     titansmittVar = StringVar(value='0') | 
					
						
							|  |  |  |     titansmittEntry = Entry(titansmittFrame, textvariable=titansmittVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     titansmittFrame.pack() | 
					
						
							|  |  |  |     titansmittLabel.pack(anchor=W, side=LEFT, padx=(0,24)) | 
					
						
							|  |  |  |     titansmittEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     proggloveFrame = Frame(itemList2) | 
					
						
							|  |  |  |     proggloveLabel = Label(proggloveFrame, text='Prog.Glove') | 
					
						
							|  |  |  |     proggloveVar = StringVar(value='2') | 
					
						
							|  |  |  |     proggloveEntry = Entry(proggloveFrame, textvariable=proggloveVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     proggloveFrame.pack() | 
					
						
							|  |  |  |     proggloveLabel.pack(anchor=W, side=LEFT, padx=(0,26)) | 
					
						
							|  |  |  |     proggloveEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     flippersFrame = Frame(itemList2) | 
					
						
							|  |  |  |     flippersLabel = Label(flippersFrame, text='Flippers') | 
					
						
							|  |  |  |     flippersVar = StringVar(value='1') | 
					
						
							|  |  |  |     flippersEntry = Entry(flippersFrame, textvariable=flippersVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     flippersFrame.pack() | 
					
						
							|  |  |  |     flippersLabel.pack(anchor=W, side=LEFT, padx=(0,43)) | 
					
						
							|  |  |  |     flippersEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     pearlFrame = Frame(itemList2) | 
					
						
							|  |  |  |     pearlLabel = Label(pearlFrame, text='Moon Pearl') | 
					
						
							|  |  |  |     pearlVar = StringVar(value='1') | 
					
						
							|  |  |  |     pearlEntry = Entry(pearlFrame, textvariable=pearlVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     pearlFrame.pack() | 
					
						
							|  |  |  |     pearlLabel.pack(anchor=W, side=LEFT, padx=(0,23)) | 
					
						
							|  |  |  |     pearlEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     heartpieceFrame = Frame(itemList2) | 
					
						
							|  |  |  |     heartpieceLabel = Label(heartpieceFrame, text='Piece of Heart') | 
					
						
							|  |  |  |     heartpieceVar = StringVar(value='24') | 
					
						
							|  |  |  |     heartpieceEntry = Entry(heartpieceFrame, textvariable=heartpieceVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     heartpieceFrame.pack() | 
					
						
							|  |  |  |     heartpieceLabel.pack(anchor=W, side=LEFT, padx=(0,10)) | 
					
						
							|  |  |  |     heartpieceEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     fullheartFrame = Frame(itemList2) | 
					
						
							|  |  |  |     fullheartLabel = Label(fullheartFrame, text='Heart Container') | 
					
						
							|  |  |  |     fullheartVar = StringVar(value='10') | 
					
						
							|  |  |  |     fullheartEntry = Entry(fullheartFrame, textvariable=fullheartVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     fullheartFrame.pack() | 
					
						
							|  |  |  |     fullheartLabel.pack(anchor=W, side=LEFT) | 
					
						
							|  |  |  |     fullheartEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     sancheartFrame = Frame(itemList2) | 
					
						
							|  |  |  |     sancheartLabel = Label(sancheartFrame, text='Sanctuary Heart') | 
					
						
							|  |  |  |     sancheartVar = StringVar(value='1') | 
					
						
							|  |  |  |     sancheartEntry = Entry(sancheartFrame, textvariable=sancheartVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     sancheartFrame.pack() | 
					
						
							|  |  |  |     sancheartLabel.pack(anchor=W, side=LEFT) | 
					
						
							|  |  |  |     sancheartEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     sword1Frame = Frame(itemList3) | 
					
						
							|  |  |  |     sword1Label = Label(sword1Frame, text='Sword 1') | 
					
						
							|  |  |  |     sword1Var = StringVar(value='0') | 
					
						
							|  |  |  |     sword1Entry = Entry(sword1Frame, textvariable=sword1Var, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     sword1Frame.pack() | 
					
						
							|  |  |  |     sword1Label.pack(anchor=W, side=LEFT, padx=(0,34)) | 
					
						
							|  |  |  |     sword1Entry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     sword2Frame = Frame(itemList3) | 
					
						
							|  |  |  |     sword2Label = Label(sword2Frame, text='Sword 2') | 
					
						
							|  |  |  |     sword2Var = StringVar(value='0') | 
					
						
							|  |  |  |     sword2Entry = Entry(sword2Frame, textvariable=sword2Var, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     sword2Frame.pack() | 
					
						
							|  |  |  |     sword2Label.pack(anchor=W, side=LEFT, padx=(0,34)) | 
					
						
							|  |  |  |     sword2Entry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     sword3Frame = Frame(itemList3) | 
					
						
							|  |  |  |     sword3Label = Label(sword3Frame, text='Sword 3') | 
					
						
							|  |  |  |     sword3Var = StringVar(value='0') | 
					
						
							|  |  |  |     sword3Entry = Entry(sword3Frame, textvariable=sword3Var, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     sword3Frame.pack() | 
					
						
							|  |  |  |     sword3Label.pack(anchor=W, side=LEFT, padx=(0,34)) | 
					
						
							|  |  |  |     sword3Entry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     sword4Frame = Frame(itemList3) | 
					
						
							|  |  |  |     sword4Label = Label(sword4Frame, text='Sword 4') | 
					
						
							|  |  |  |     sword4Var = StringVar(value='0') | 
					
						
							|  |  |  |     sword4Entry = Entry(sword4Frame, textvariable=sword4Var, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     sword4Frame.pack() | 
					
						
							|  |  |  |     sword4Label.pack(anchor=W, side=LEFT, padx=(0,34)) | 
					
						
							|  |  |  |     sword4Entry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     progswordFrame = Frame(itemList3) | 
					
						
							|  |  |  |     progswordLabel = Label(progswordFrame, text='Prog.Sword') | 
					
						
							|  |  |  |     progswordVar = StringVar(value='4') | 
					
						
							|  |  |  |     progswordEntry = Entry(progswordFrame, textvariable=progswordVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     progswordFrame.pack() | 
					
						
							|  |  |  |     progswordLabel.pack(anchor=W, side=LEFT, padx=(0,15)) | 
					
						
							|  |  |  |     progswordEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     shield1Frame = Frame(itemList3) | 
					
						
							|  |  |  |     shield1Label = Label(shield1Frame, text='Shield 1') | 
					
						
							|  |  |  |     shield1Var = StringVar(value='0') | 
					
						
							|  |  |  |     shield1Entry = Entry(shield1Frame, textvariable=shield1Var, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     shield1Frame.pack() | 
					
						
							|  |  |  |     shield1Label.pack(anchor=W, side=LEFT, padx=(0,35)) | 
					
						
							|  |  |  |     shield1Entry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     shield2Frame = Frame(itemList3) | 
					
						
							|  |  |  |     shield2Label = Label(shield2Frame, text='Shield 2') | 
					
						
							|  |  |  |     shield2Var = StringVar(value='0') | 
					
						
							|  |  |  |     shield2Entry = Entry(shield2Frame, textvariable=shield2Var, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     shield2Frame.pack() | 
					
						
							|  |  |  |     shield2Label.pack(anchor=W, side=LEFT, padx=(0,35)) | 
					
						
							|  |  |  |     shield2Entry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     shield3Frame = Frame(itemList3) | 
					
						
							|  |  |  |     shield3Label = Label(shield3Frame, text='Shield 3') | 
					
						
							|  |  |  |     shield3Var = StringVar(value='0') | 
					
						
							|  |  |  |     shield3Entry = Entry(shield3Frame, textvariable=shield3Var, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     shield3Frame.pack() | 
					
						
							|  |  |  |     shield3Label.pack(anchor=W, side=LEFT, padx=(0,35)) | 
					
						
							|  |  |  |     shield3Entry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     progshieldFrame = Frame(itemList3) | 
					
						
							|  |  |  |     progshieldLabel = Label(progshieldFrame, text='Prog.Shield') | 
					
						
							|  |  |  |     progshieldVar = StringVar(value='3') | 
					
						
							|  |  |  |     progshieldEntry = Entry(progshieldFrame, textvariable=progshieldVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     progshieldFrame.pack() | 
					
						
							|  |  |  |     progshieldLabel.pack(anchor=W, side=LEFT, padx=(0,16)) | 
					
						
							|  |  |  |     progshieldEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     bluemailFrame = Frame(itemList3) | 
					
						
							|  |  |  |     bluemailLabel = Label(bluemailFrame, text='Blue Mail') | 
					
						
							|  |  |  |     bluemailVar = StringVar(value='0') | 
					
						
							|  |  |  |     bluemailEntry = Entry(bluemailFrame, textvariable=bluemailVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     bluemailFrame.pack() | 
					
						
							|  |  |  |     bluemailLabel.pack(anchor=W, side=LEFT, padx=(0,27)) | 
					
						
							|  |  |  |     bluemailEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     redmailFrame = Frame(itemList3) | 
					
						
							|  |  |  |     redmailLabel = Label(redmailFrame, text='Red Mail') | 
					
						
							|  |  |  |     redmailVar = StringVar(value='0') | 
					
						
							|  |  |  |     redmailEntry = Entry(redmailFrame, textvariable=redmailVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     redmailFrame.pack() | 
					
						
							|  |  |  |     redmailLabel.pack(anchor=W, side=LEFT, padx=(0,30)) | 
					
						
							|  |  |  |     redmailEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     progmailFrame = Frame(itemList3) | 
					
						
							|  |  |  |     progmailLabel = Label(progmailFrame, text='Prog.Mail') | 
					
						
							|  |  |  |     progmailVar = StringVar(value='2') | 
					
						
							|  |  |  |     progmailEntry = Entry(progmailFrame, textvariable=progmailVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     progmailFrame.pack() | 
					
						
							|  |  |  |     progmailLabel.pack(anchor=W, side=LEFT, padx=(0,25)) | 
					
						
							|  |  |  |     progmailEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     halfmagicFrame = Frame(itemList3) | 
					
						
							|  |  |  |     halfmagicLabel = Label(halfmagicFrame, text='Half Magic') | 
					
						
							|  |  |  |     halfmagicVar = StringVar(value='1') | 
					
						
							|  |  |  |     halfmagicEntry = Entry(halfmagicFrame, textvariable=halfmagicVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     halfmagicFrame.pack() | 
					
						
							|  |  |  |     halfmagicLabel.pack(anchor=W, side=LEFT, padx=(0,18)) | 
					
						
							|  |  |  |     halfmagicEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     quartermagicFrame = Frame(itemList3) | 
					
						
							|  |  |  |     quartermagicLabel = Label(quartermagicFrame, text='Quarter Magic') | 
					
						
							|  |  |  |     quartermagicVar = StringVar(value='0') | 
					
						
							|  |  |  |     quartermagicEntry = Entry(quartermagicFrame, textvariable=quartermagicVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     quartermagicFrame.pack() | 
					
						
							|  |  |  |     quartermagicLabel.pack(anchor=W, side=LEFT) | 
					
						
							|  |  |  |     quartermagicEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     bcap5Frame = Frame(itemList3) | 
					
						
							|  |  |  |     bcap5Label = Label(bcap5Frame, text='Bomb C.+5') | 
					
						
							| 
									
										
										
										
											2019-10-23 21:31:02 -05:00
										 |  |  |     bcap5Var = StringVar(value='0') | 
					
						
							| 
									
										
										
										
											2018-01-21 20:43:44 -06:00
										 |  |  |     bcap5Entry = Entry(bcap5Frame, textvariable=bcap5Var, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     bcap5Frame.pack() | 
					
						
							|  |  |  |     bcap5Label.pack(anchor=W, side=LEFT, padx=(0,16)) | 
					
						
							|  |  |  |     bcap5Entry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     bcap10Frame = Frame(itemList3) | 
					
						
							|  |  |  |     bcap10Label = Label(bcap10Frame, text='Bomb C.+10') | 
					
						
							| 
									
										
										
										
											2019-10-23 21:31:02 -05:00
										 |  |  |     bcap10Var = StringVar(value='0') | 
					
						
							| 
									
										
										
										
											2018-01-21 20:43:44 -06:00
										 |  |  |     bcap10Entry = Entry(bcap10Frame, textvariable=bcap10Var, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     bcap10Frame.pack() | 
					
						
							|  |  |  |     bcap10Label.pack(anchor=W, side=LEFT, padx=(0,10)) | 
					
						
							|  |  |  |     bcap10Entry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     acap5Frame = Frame(itemList4) | 
					
						
							|  |  |  |     acap5Label = Label(acap5Frame, text='Arrow C.+5') | 
					
						
							| 
									
										
										
										
											2019-10-23 21:31:02 -05:00
										 |  |  |     acap5Var = StringVar(value='0') | 
					
						
							| 
									
										
										
										
											2018-01-21 20:43:44 -06:00
										 |  |  |     acap5Entry = Entry(acap5Frame, textvariable=acap5Var, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     acap5Frame.pack() | 
					
						
							|  |  |  |     acap5Label.pack(anchor=W, side=LEFT, padx=(0,7)) | 
					
						
							|  |  |  |     acap5Entry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     acap10Frame = Frame(itemList4) | 
					
						
							|  |  |  |     acap10Label = Label(acap10Frame, text='Arrow C.+10') | 
					
						
							| 
									
										
										
										
											2019-10-23 21:31:02 -05:00
										 |  |  |     acap10Var = StringVar(value='0') | 
					
						
							| 
									
										
										
										
											2018-01-21 20:43:44 -06:00
										 |  |  |     acap10Entry = Entry(acap10Frame, textvariable=acap10Var, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     acap10Frame.pack() | 
					
						
							|  |  |  |     acap10Label.pack(anchor=W, side=LEFT, padx=(0,1)) | 
					
						
							|  |  |  |     acap10Entry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     arrow1Frame = Frame(itemList4) | 
					
						
							|  |  |  |     arrow1Label = Label(arrow1Frame, text='Arrow (1)') | 
					
						
							|  |  |  |     arrow1Var = StringVar(value='1') | 
					
						
							|  |  |  |     arrow1Entry = Entry(arrow1Frame, textvariable=arrow1Var, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     arrow1Frame.pack() | 
					
						
							|  |  |  |     arrow1Label.pack(anchor=W, side=LEFT, padx=(0,18)) | 
					
						
							|  |  |  |     arrow1Entry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     arrow10Frame = Frame(itemList4) | 
					
						
							|  |  |  |     arrow10Label = Label(arrow10Frame, text='Arrows (10)') | 
					
						
							| 
									
										
										
										
											2019-10-23 21:31:02 -05:00
										 |  |  |     arrow10Var = StringVar(value='12') | 
					
						
							| 
									
										
										
										
											2018-01-21 20:43:44 -06:00
										 |  |  |     arrow10Entry = Entry(arrow10Frame, textvariable=arrow10Var, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     arrow10Frame.pack() | 
					
						
							|  |  |  |     arrow10Label.pack(anchor=W, side=LEFT, padx=(0,7)) | 
					
						
							|  |  |  |     arrow10Entry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     bomb1Frame = Frame(itemList4) | 
					
						
							|  |  |  |     bomb1Label = Label(bomb1Frame, text='Bomb (1)') | 
					
						
							|  |  |  |     bomb1Var = StringVar(value='0') | 
					
						
							|  |  |  |     bomb1Entry = Entry(bomb1Frame, textvariable=bomb1Var, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     bomb1Frame.pack() | 
					
						
							|  |  |  |     bomb1Label.pack(anchor=W, side=LEFT, padx=(0,18)) | 
					
						
							|  |  |  |     bomb1Entry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     bomb3Frame = Frame(itemList4) | 
					
						
							|  |  |  |     bomb3Label = Label(bomb3Frame, text='Bombs (3)') | 
					
						
							| 
									
										
										
										
											2019-10-23 21:31:02 -05:00
										 |  |  |     bomb3Var = StringVar(value='16') | 
					
						
							| 
									
										
										
										
											2018-01-21 20:43:44 -06:00
										 |  |  |     bomb3Entry = Entry(bomb3Frame, textvariable=bomb3Var, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     bomb3Frame.pack() | 
					
						
							|  |  |  |     bomb3Label.pack(anchor=W, side=LEFT, padx=(0,13)) | 
					
						
							|  |  |  |     bomb3Entry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-23 21:31:02 -05:00
										 |  |  |     bomb10Frame = Frame(itemList4) | 
					
						
							|  |  |  |     bomb10Label = Label(bomb10Frame, text='Bombs (10)') | 
					
						
							|  |  |  |     bomb10Var = StringVar(value='1') | 
					
						
							|  |  |  |     bomb10Entry = Entry(bomb10Frame, textvariable=bomb10Var, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     bomb10Frame.pack() | 
					
						
							|  |  |  |     bomb10Label.pack(anchor=W, side=LEFT, padx=(0,7)) | 
					
						
							|  |  |  |     bomb10Entry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-21 20:43:44 -06:00
										 |  |  |     rupee1Frame = Frame(itemList4) | 
					
						
							|  |  |  |     rupee1Label = Label(rupee1Frame, text='Rupee (1)') | 
					
						
							|  |  |  |     rupee1Var = StringVar(value='2') | 
					
						
							|  |  |  |     rupee1Entry = Entry(rupee1Frame, textvariable=rupee1Var, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     rupee1Frame.pack() | 
					
						
							|  |  |  |     rupee1Label.pack(anchor=W, side=LEFT, padx=(0,17)) | 
					
						
							|  |  |  |     rupee1Entry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     rupee5Frame = Frame(itemList4) | 
					
						
							|  |  |  |     rupee5Label = Label(rupee5Frame, text='Rupees (5)') | 
					
						
							|  |  |  |     rupee5Var = StringVar(value='4') | 
					
						
							|  |  |  |     rupee5Entry = Entry(rupee5Frame, textvariable=rupee5Var, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     rupee5Frame.pack() | 
					
						
							|  |  |  |     rupee5Label.pack(anchor=W, side=LEFT, padx=(0,12)) | 
					
						
							|  |  |  |     rupee5Entry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     rupee20Frame = Frame(itemList4) | 
					
						
							|  |  |  |     rupee20Label = Label(rupee20Frame, text='Rupees (20)') | 
					
						
							|  |  |  |     rupee20Var = StringVar(value='28') | 
					
						
							|  |  |  |     rupee20Entry = Entry(rupee20Frame, textvariable=rupee20Var, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     rupee20Frame.pack() | 
					
						
							|  |  |  |     rupee20Label.pack(anchor=W, side=LEFT, padx=(0,6)) | 
					
						
							|  |  |  |     rupee20Entry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     rupee50Frame = Frame(itemList4) | 
					
						
							|  |  |  |     rupee50Label = Label(rupee50Frame, text='Rupees (50)') | 
					
						
							|  |  |  |     rupee50Var = StringVar(value='7') | 
					
						
							|  |  |  |     rupee50Entry = Entry(rupee50Frame, textvariable=rupee50Var, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     rupee50Frame.pack() | 
					
						
							|  |  |  |     rupee50Label.pack(anchor=W, side=LEFT, padx=(0,6)) | 
					
						
							|  |  |  |     rupee50Entry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     rupee100Frame = Frame(itemList4) | 
					
						
							|  |  |  |     rupee100Label = Label(rupee100Frame, text='Rupees (100)') | 
					
						
							|  |  |  |     rupee100Var = StringVar(value='1') | 
					
						
							|  |  |  |     rupee100Entry = Entry(rupee100Frame, textvariable=rupee100Var, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     rupee100Frame.pack() | 
					
						
							|  |  |  |     rupee100Label.pack(anchor=W, side=LEFT, padx=(0,0)) | 
					
						
							|  |  |  |     rupee100Entry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     rupee300Frame = Frame(itemList4) | 
					
						
							|  |  |  |     rupee300Label = Label(rupee300Frame, text='Rupees (300)') | 
					
						
							|  |  |  |     rupee300Var = StringVar(value='5') | 
					
						
							|  |  |  |     rupee300Entry = Entry(rupee300Frame, textvariable=rupee300Var, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     rupee300Frame.pack() | 
					
						
							|  |  |  |     rupee300Label.pack(anchor=W, side=LEFT, padx=(0,0)) | 
					
						
							|  |  |  |     rupee300Entry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     blueclockFrame = Frame(itemList4) | 
					
						
							|  |  |  |     blueclockLabel = Label(blueclockFrame, text='Blue Clock') | 
					
						
							|  |  |  |     blueclockVar = StringVar(value='0') | 
					
						
							|  |  |  |     blueclockEntry = Entry(blueclockFrame, textvariable=blueclockVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     blueclockFrame.pack() | 
					
						
							|  |  |  |     blueclockLabel.pack(anchor=W, side=LEFT, padx=(0,11)) | 
					
						
							|  |  |  |     blueclockEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     greenclockFrame = Frame(itemList4) | 
					
						
							|  |  |  |     greenclockLabel = Label(greenclockFrame, text='Green Clock') | 
					
						
							|  |  |  |     greenclockVar = StringVar(value='0') | 
					
						
							|  |  |  |     greenclockEntry = Entry(greenclockFrame, textvariable=greenclockVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     greenclockFrame.pack() | 
					
						
							|  |  |  |     greenclockLabel.pack(anchor=W, side=LEFT, padx=(0,3)) | 
					
						
							|  |  |  |     greenclockEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     redclockFrame = Frame(itemList4) | 
					
						
							|  |  |  |     redclockLabel = Label(redclockFrame, text='Red Clock') | 
					
						
							|  |  |  |     redclockVar = StringVar(value='0') | 
					
						
							|  |  |  |     redclockEntry = Entry(redclockFrame, textvariable=redclockVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     redclockFrame.pack() | 
					
						
							|  |  |  |     redclockLabel.pack(anchor=W, side=LEFT, padx=(0,14)) | 
					
						
							|  |  |  |     redclockEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-23 21:31:02 -05:00
										 |  |  |     silverarrowFrame = Frame(itemList5) | 
					
						
							|  |  |  |     silverarrowLabel = Label(silverarrowFrame, text='Silver Arrow') | 
					
						
							|  |  |  |     silverarrowVar = StringVar(value='0') | 
					
						
							|  |  |  |     silverarrowEntry = Entry(silverarrowFrame, textvariable=silverarrowVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     silverarrowFrame.pack() | 
					
						
							|  |  |  |     silverarrowLabel.pack(anchor=W, side=LEFT, padx=(0,64)) | 
					
						
							|  |  |  |     silverarrowEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-15 16:53:42 -05:00
										 |  |  |     universalkeyFrame = Frame(itemList5) | 
					
						
							|  |  |  |     universalkeyLabel = Label(universalkeyFrame, text='Universal Key') | 
					
						
							|  |  |  |     universalkeyVar = StringVar(value='0') | 
					
						
							|  |  |  |     universalkeyEntry = Entry(universalkeyFrame, textvariable=universalkeyVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     universalkeyFrame.pack() | 
					
						
							|  |  |  |     universalkeyLabel.pack(anchor=W, side=LEFT, padx=(0,57)) | 
					
						
							|  |  |  |     universalkeyEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-21 20:43:44 -06:00
										 |  |  |     triforcepieceFrame = Frame(itemList5) | 
					
						
							|  |  |  |     triforcepieceLabel = Label(triforcepieceFrame, text='Triforce Piece') | 
					
						
							| 
									
										
										
										
											2020-08-16 16:49:48 +02:00
										 |  |  |     triforcepieceVar = StringVar(value='30') | 
					
						
							| 
									
										
										
										
											2018-01-21 20:43:44 -06:00
										 |  |  |     triforcepieceEntry = Entry(triforcepieceFrame, textvariable=triforcepieceVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     triforcepieceFrame.pack() | 
					
						
							|  |  |  |     triforcepieceLabel.pack(anchor=W, side=LEFT, padx=(0,55)) | 
					
						
							|  |  |  |     triforcepieceEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     triforcecountFrame = Frame(itemList5) | 
					
						
							|  |  |  |     triforcecountLabel = Label(triforcecountFrame, text='Triforce Pieces Required') | 
					
						
							| 
									
										
										
										
											2020-08-16 16:49:48 +02:00
										 |  |  |     triforcecountVar = StringVar(value='20') | 
					
						
							| 
									
										
										
										
											2018-01-21 20:43:44 -06:00
										 |  |  |     triforcecountEntry = Entry(triforcecountFrame, textvariable=triforcecountVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     triforcecountFrame.pack() | 
					
						
							|  |  |  |     triforcecountLabel.pack(anchor=W, side=LEFT, padx=(0,0)) | 
					
						
							|  |  |  |     triforcecountEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     triforceFrame = Frame(itemList5) | 
					
						
							|  |  |  |     triforceLabel = Label(triforceFrame, text='Triforce (win game)') | 
					
						
							|  |  |  |     triforceVar = StringVar(value='0') | 
					
						
							|  |  |  |     triforceEntry = Entry(triforceFrame, textvariable=triforceVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     triforceFrame.pack() | 
					
						
							|  |  |  |     triforceLabel.pack(anchor=W, side=LEFT, padx=(0,23)) | 
					
						
							|  |  |  |     triforceEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-23 21:31:02 -05:00
										 |  |  |     rupoorFrame = Frame(itemList5) | 
					
						
							|  |  |  |     rupoorLabel = Label(rupoorFrame, text='Rupoor') | 
					
						
							|  |  |  |     rupoorVar = StringVar(value='0') | 
					
						
							|  |  |  |     rupoorEntry = Entry(rupoorFrame, textvariable=rupoorVar, width=3, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     rupoorFrame.pack() | 
					
						
							|  |  |  |     rupoorLabel.pack(anchor=W, side=LEFT, padx=(0,87)) | 
					
						
							|  |  |  |     rupoorEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-21 20:43:44 -06:00
										 |  |  |     rupoorcostFrame = Frame(itemList5) | 
					
						
							|  |  |  |     rupoorcostLabel = Label(rupoorcostFrame, text='Rupoor Cost') | 
					
						
							|  |  |  |     rupoorcostVar = StringVar(value='10') | 
					
						
							|  |  |  |     rupoorcostEntry = Entry(rupoorcostFrame, textvariable=rupoorcostVar, width=6, validate='all', vcmd=vcmd) | 
					
						
							|  |  |  |     rupoorcostFrame.pack() | 
					
						
							|  |  |  |     rupoorcostLabel.pack(anchor=W, side=LEFT, padx=(0,43)) | 
					
						
							|  |  |  |     rupoorcostEntry.pack(anchor=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     itemList1.pack(side=LEFT, padx=(0,0)) | 
					
						
							|  |  |  |     itemList2.pack(side=LEFT, padx=(0,0)) | 
					
						
							|  |  |  |     itemList3.pack(side=LEFT, padx=(0,0)) | 
					
						
							|  |  |  |     itemList4.pack(side=LEFT, padx=(0,0)) | 
					
						
							|  |  |  |     itemList5.pack(side=LEFT, padx=(0,0)) | 
					
						
							| 
									
										
										
										
											2018-02-27 20:26:33 -06:00
										 |  |  |     topFrame3.pack(side=TOP, pady=(17,0)) | 
					
						
							| 
									
										
										
										
											2018-01-21 20:43:44 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |     if args is not None: | 
					
						
							| 
									
										
										
										
											2019-12-18 21:34:57 +01:00
										 |  |  |         for k,v in vars(args).items(): | 
					
						
							|  |  |  |             if type(v) is dict: | 
					
						
							|  |  |  |                 setattr(args, k, v[1]) # only get values for player 1 for now | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |         # load values from commandline args | 
					
						
							|  |  |  |         createSpoilerVar.set(int(args.create_spoiler)) | 
					
						
							|  |  |  |         suppressRomVar.set(int(args.suppress_rom)) | 
					
						
							| 
									
										
										
										
											2019-12-13 22:37:52 +01:00
										 |  |  |         mapshuffleVar.set(args.mapshuffle) | 
					
						
							|  |  |  |         compassshuffleVar.set(args.compassshuffle) | 
					
						
							|  |  |  |         keyshuffleVar.set(args.keyshuffle) | 
					
						
							|  |  |  |         bigkeyshuffleVar.set(args.bigkeyshuffle) | 
					
						
							| 
									
										
										
										
											2018-03-14 13:31:36 -05:00
										 |  |  |         retroVar.set(args.retro) | 
					
						
							| 
									
										
										
										
											2021-02-19 19:08:11 +01:00
										 |  |  |         rom_vars.quickSwapVar.set(int(args.quickswap)) | 
					
						
							|  |  |  |         rom_vars.disableMusicVar.set(int(args.disablemusic)) | 
					
						
							|  |  |  |         rom_vars.disableFlashingVar.set(int(args.reduceflashing)) | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |         if args.count: | 
					
						
							|  |  |  |             countVar.set(str(args.count)) | 
					
						
							|  |  |  |         if args.seed: | 
					
						
							|  |  |  |             seedVar.set(str(args.seed)) | 
					
						
							|  |  |  |         modeVar.set(args.mode) | 
					
						
							| 
									
										
										
										
											2019-10-23 20:46:09 -05:00
										 |  |  |         swordVar.set(args.swords) | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |         difficultyVar.set(args.difficulty) | 
					
						
							| 
									
										
										
										
											2019-10-23 20:46:09 -05:00
										 |  |  |         itemfunctionVar.set(args.item_functionality) | 
					
						
							| 
									
										
										
										
											2017-11-10 04:18:39 -06:00
										 |  |  |         timerVar.set(args.timer) | 
					
						
							| 
									
										
										
										
											2020-10-28 16:20:59 -07:00
										 |  |  |         timerCountdownVar.set(args.countdown_start_time) | 
					
						
							|  |  |  |         timerRedVar.set(args.red_clock_time) | 
					
						
							|  |  |  |         timerBlueVar.set(args.blue_clock_time) | 
					
						
							|  |  |  |         timerGreenVar.set(args.green_clock_time) | 
					
						
							| 
									
										
										
										
											2017-11-10 04:18:39 -06:00
										 |  |  |         progressiveVar.set(args.progressive) | 
					
						
							| 
									
										
										
										
											2019-10-23 20:46:09 -05:00
										 |  |  |         accessibilityVar.set(args.accessibility) | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |         goalVar.set(args.goal) | 
					
						
							| 
									
										
										
										
											2019-10-23 20:46:09 -05:00
										 |  |  |         crystalsGTVar.set(args.crystals_gt) | 
					
						
							|  |  |  |         crystalsGanonVar.set(args.crystals_ganon) | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |         algorithmVar.set(args.algorithm) | 
					
						
							|  |  |  |         shuffleVar.set(args.shuffle) | 
					
						
							| 
									
										
										
										
											2021-02-19 19:08:11 +01:00
										 |  |  |         rom_vars.heartbeepVar.set(args.heartbeep) | 
					
						
							|  |  |  |         rom_vars.fastMenuVar.set(args.fastmenu) | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |         logicVar.set(args.logic) | 
					
						
							| 
									
										
										
										
											2021-02-19 19:08:11 +01:00
										 |  |  |         rom_vars.romVar.set(args.rom) | 
					
						
							| 
									
										
										
										
											2017-07-17 22:28:29 +02:00
										 |  |  |         shuffleGanonVar.set(args.shuffleganon) | 
					
						
							| 
									
										
										
										
											2019-01-23 03:04:42 -06:00
										 |  |  |         hintsVar.set(args.hints) | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  |         if args.sprite is not None: | 
					
						
							| 
									
										
										
										
											2017-12-08 19:28:22 -05:00
										 |  |  |             set_sprite(Sprite(args.sprite)) | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     mainWindow.mainloop() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-19 19:08:11 +01:00
										 |  |  | def get_rom_frame(parent=None): | 
					
						
							|  |  |  |     romFrame = Frame(parent) | 
					
						
							|  |  |  |     baseRomLabel = Label(romFrame, text='LttP Base Rom: ') | 
					
						
							|  |  |  |     romVar = StringVar(value="Zelda no Densetsu - Kamigami no Triforce (Japan).sfc") | 
					
						
							|  |  |  |     romEntry = Entry(romFrame, textvariable=romVar) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def RomSelect(): | 
					
						
							|  |  |  |         rom = filedialog.askopenfilename(filetypes=[("Rom Files", (".sfc", ".smc")), ("All Files", "*")]) | 
					
						
							|  |  |  |         import Patch | 
					
						
							|  |  |  |         try: | 
					
						
							|  |  |  |             Patch.get_base_rom_bytes(rom)  # throws error on checksum fail | 
					
						
							|  |  |  |         except Exception as e: | 
					
						
							|  |  |  |             logging.exception(e) | 
					
						
							|  |  |  |             messagebox.showerror(title="Error while reading ROM", message=str(e)) | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             romVar.set(rom) | 
					
						
							|  |  |  |             romSelectButton['state'] = "disabled" | 
					
						
							|  |  |  |             romSelectButton["text"] = "ROM verified" | 
					
						
							|  |  |  |     romSelectButton = Button(romFrame, text='Select Rom', command=RomSelect) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     baseRomLabel.pack(side=LEFT) | 
					
						
							|  |  |  |     romEntry.pack(side=LEFT, expand=True, fill=X) | 
					
						
							|  |  |  |     romSelectButton.pack(side=LEFT) | 
					
						
							|  |  |  |     romFrame.pack(side=TOP, expand=True, fill=X) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return romFrame, romVar | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def get_rom_options_frame(parent=None): | 
					
						
							|  |  |  |     romOptionsFrame = LabelFrame(parent, text="Rom options") | 
					
						
							|  |  |  |     romOptionsFrame.columnconfigure(0, weight=1) | 
					
						
							|  |  |  |     romOptionsFrame.columnconfigure(1, weight=1) | 
					
						
							|  |  |  |     for i in range(5): | 
					
						
							|  |  |  |         romOptionsFrame.rowconfigure(i, weight=1) | 
					
						
							|  |  |  |     vars = Namespace() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     vars.disableMusicVar = IntVar() | 
					
						
							|  |  |  |     disableMusicCheckbutton = Checkbutton(romOptionsFrame, text="Disable music", variable=vars.disableMusicVar) | 
					
						
							|  |  |  |     disableMusicCheckbutton.grid(row=0, column=0, sticky=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     vars.disableFlashingVar = IntVar(value=1) | 
					
						
							|  |  |  |     disableFlashingCheckbutton = Checkbutton(romOptionsFrame, text="Disable flashing (anti-epilepsy)", variable=vars.disableFlashingVar) | 
					
						
							|  |  |  |     disableFlashingCheckbutton.grid(row=6, column=0, sticky=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     spriteDialogFrame = Frame(romOptionsFrame) | 
					
						
							|  |  |  |     spriteDialogFrame.grid(row=0, column=1) | 
					
						
							|  |  |  |     baseSpriteLabel = Label(spriteDialogFrame, text='Sprite:') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     vars.spriteNameVar = StringVar() | 
					
						
							|  |  |  |     vars.sprite = None | 
					
						
							|  |  |  |     def set_sprite(sprite_param): | 
					
						
							|  |  |  |         nonlocal vars | 
					
						
							|  |  |  |         if isinstance(sprite_param, str): | 
					
						
							|  |  |  |             vars.sprite = sprite_param | 
					
						
							|  |  |  |             vars.spriteNameVar.set(sprite_param) | 
					
						
							|  |  |  |         elif sprite_param is None or not sprite_param.valid: | 
					
						
							|  |  |  |             vars.sprite = None | 
					
						
							|  |  |  |             vars.spriteNameVar.set('(unchanged)') | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             vars.sprite = sprite_param | 
					
						
							|  |  |  |             vars.spriteNameVar.set(vars.sprite.name) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     set_sprite(None) | 
					
						
							|  |  |  |     vars.spriteNameVar.set('(unchanged)') | 
					
						
							|  |  |  |     spriteEntry = Label(spriteDialogFrame, textvariable=vars.spriteNameVar) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def SpriteSelect(): | 
					
						
							|  |  |  |         SpriteSelector(parent, set_sprite) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     spriteSelectButton = Button(spriteDialogFrame, text='...', command=SpriteSelect) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     baseSpriteLabel.pack(side=LEFT) | 
					
						
							|  |  |  |     spriteEntry.pack(side=LEFT) | 
					
						
							|  |  |  |     spriteSelectButton.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     vars.quickSwapVar = IntVar(value=1) | 
					
						
							|  |  |  |     quickSwapCheckbutton = Checkbutton(romOptionsFrame, text="L/R Quickswapping", variable=vars.quickSwapVar) | 
					
						
							|  |  |  |     quickSwapCheckbutton.grid(row=1, column=0, sticky=E) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     fastMenuFrame = Frame(romOptionsFrame) | 
					
						
							|  |  |  |     fastMenuFrame.grid(row=1, column=1, sticky=E) | 
					
						
							|  |  |  |     fastMenuLabel = Label(fastMenuFrame, text='Menu speed') | 
					
						
							|  |  |  |     fastMenuLabel.pack(side=LEFT) | 
					
						
							|  |  |  |     vars.fastMenuVar = StringVar() | 
					
						
							|  |  |  |     vars.fastMenuVar.set('normal') | 
					
						
							|  |  |  |     fastMenuOptionMenu = OptionMenu(fastMenuFrame, vars.fastMenuVar, 'normal', 'instant', 'double', 'triple', 'quadruple', 'half') | 
					
						
							|  |  |  |     fastMenuOptionMenu.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     heartcolorFrame = Frame(romOptionsFrame) | 
					
						
							|  |  |  |     heartcolorFrame.grid(row=2, column=0, sticky=E) | 
					
						
							|  |  |  |     heartcolorLabel = Label(heartcolorFrame, text='Heart color') | 
					
						
							|  |  |  |     heartcolorLabel.pack(side=LEFT) | 
					
						
							|  |  |  |     vars.heartcolorVar = StringVar() | 
					
						
							|  |  |  |     vars.heartcolorVar.set('red') | 
					
						
							|  |  |  |     heartcolorOptionMenu = OptionMenu(heartcolorFrame, vars.heartcolorVar, 'red', 'blue', 'green', 'yellow', 'random') | 
					
						
							|  |  |  |     heartcolorOptionMenu.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     heartbeepFrame = Frame(romOptionsFrame) | 
					
						
							|  |  |  |     heartbeepFrame.grid(row=2, column=1, sticky=E) | 
					
						
							|  |  |  |     heartbeepLabel = Label(heartbeepFrame, text='Heartbeep') | 
					
						
							|  |  |  |     heartbeepLabel.pack(side=LEFT) | 
					
						
							|  |  |  |     vars.heartbeepVar = StringVar() | 
					
						
							|  |  |  |     vars.heartbeepVar.set('normal') | 
					
						
							|  |  |  |     heartbeepOptionMenu = OptionMenu(heartbeepFrame, vars.heartbeepVar, 'double', 'normal', 'half', 'quarter', 'off') | 
					
						
							|  |  |  |     heartbeepOptionMenu.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     owPalettesFrame = Frame(romOptionsFrame) | 
					
						
							|  |  |  |     owPalettesFrame.grid(row=3, column=0, sticky=E) | 
					
						
							|  |  |  |     owPalettesLabel = Label(owPalettesFrame, text='Overworld palettes') | 
					
						
							|  |  |  |     owPalettesLabel.pack(side=LEFT) | 
					
						
							|  |  |  |     vars.owPalettesVar = StringVar() | 
					
						
							|  |  |  |     vars.owPalettesVar.set('default') | 
					
						
							|  |  |  |     owPalettesOptionMenu = OptionMenu(owPalettesFrame, vars.owPalettesVar, 'default', 'random', 'blackout', 'grayscale', 'negative', 'classic', 'dizzy', 'sick', 'puke') | 
					
						
							|  |  |  |     owPalettesOptionMenu.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     uwPalettesFrame = Frame(romOptionsFrame) | 
					
						
							|  |  |  |     uwPalettesFrame.grid(row=3, column=1, sticky=E) | 
					
						
							|  |  |  |     uwPalettesLabel = Label(uwPalettesFrame, text='Dungeon palettes') | 
					
						
							|  |  |  |     uwPalettesLabel.pack(side=LEFT) | 
					
						
							|  |  |  |     vars.uwPalettesVar = StringVar() | 
					
						
							|  |  |  |     vars.uwPalettesVar.set('default') | 
					
						
							|  |  |  |     uwPalettesOptionMenu = OptionMenu(uwPalettesFrame, vars.uwPalettesVar, 'default', 'random', 'blackout', 'grayscale', 'negative', 'classic', 'dizzy', 'sick', 'puke') | 
					
						
							|  |  |  |     uwPalettesOptionMenu.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     hudPalettesFrame = Frame(romOptionsFrame) | 
					
						
							|  |  |  |     hudPalettesFrame.grid(row=4, column=0, sticky=E) | 
					
						
							|  |  |  |     hudPalettesLabel = Label(hudPalettesFrame, text='HUD palettes') | 
					
						
							|  |  |  |     hudPalettesLabel.pack(side=LEFT) | 
					
						
							|  |  |  |     vars.hudPalettesVar = StringVar() | 
					
						
							|  |  |  |     vars.hudPalettesVar.set('default') | 
					
						
							|  |  |  |     hudPalettesOptionMenu = OptionMenu(hudPalettesFrame, vars.hudPalettesVar, 'default', 'random', 'blackout', 'grayscale', 'negative', 'classic', 'dizzy', 'sick', 'puke') | 
					
						
							|  |  |  |     hudPalettesOptionMenu.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     swordPalettesFrame = Frame(romOptionsFrame) | 
					
						
							|  |  |  |     swordPalettesFrame.grid(row=4, column=1, sticky=E) | 
					
						
							|  |  |  |     swordPalettesLabel = Label(swordPalettesFrame, text='Sword palettes') | 
					
						
							|  |  |  |     swordPalettesLabel.pack(side=LEFT) | 
					
						
							|  |  |  |     vars.swordPalettesVar = StringVar() | 
					
						
							|  |  |  |     vars.swordPalettesVar.set('default') | 
					
						
							|  |  |  |     swordPalettesOptionMenu = OptionMenu(swordPalettesFrame, vars.swordPalettesVar, 'default', 'random', 'blackout', 'grayscale', 'negative', 'classic', 'dizzy', 'sick', 'puke') | 
					
						
							|  |  |  |     swordPalettesOptionMenu.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     shieldPalettesFrame = Frame(romOptionsFrame) | 
					
						
							|  |  |  |     shieldPalettesFrame.grid(row=5, column=0, sticky=E) | 
					
						
							|  |  |  |     shieldPalettesLabel = Label(shieldPalettesFrame, text='Shield palettes') | 
					
						
							|  |  |  |     shieldPalettesLabel.pack(side=LEFT) | 
					
						
							|  |  |  |     vars.shieldPalettesVar = StringVar() | 
					
						
							|  |  |  |     vars.shieldPalettesVar.set('default') | 
					
						
							|  |  |  |     shieldPalettesOptionMenu = OptionMenu(shieldPalettesFrame, vars.shieldPalettesVar, 'default', 'random', 'blackout', 'grayscale', 'negative', 'classic', 'dizzy', 'sick', 'puke') | 
					
						
							|  |  |  |     shieldPalettesOptionMenu.pack(side=LEFT) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return romOptionsFrame, vars, set_sprite | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-11 13:45:21 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | class SpriteSelector(): | 
					
						
							| 
									
										
										
										
											2018-01-05 00:42:35 -05:00
										 |  |  |     def __init__(self, parent, callback, adjuster=False): | 
					
						
							| 
									
										
										
										
											2021-02-19 19:08:11 +01:00
										 |  |  |         self.deploy_icons() | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  |         self.parent = parent | 
					
						
							| 
									
										
										
										
											2017-11-18 12:22:06 -05:00
										 |  |  |         self.window = Toplevel(parent) | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  |         self.callback = callback | 
					
						
							| 
									
										
										
										
											2018-01-05 00:42:35 -05:00
										 |  |  |         self.adjuster = adjuster | 
					
						
							| 
									
										
										
										
											2017-11-18 12:22:06 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |         self.window.wm_title("TAKE ANY ONE YOU WANT") | 
					
						
							|  |  |  |         self.window['padx'] = 5 | 
					
						
							|  |  |  |         self.window['pady'] = 5 | 
					
						
							| 
									
										
										
										
											2018-01-07 20:10:23 -05:00
										 |  |  |         self.all_sprites = [] | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-31 19:45:10 +02:00
										 |  |  |         def open_custom_sprite_dir(_evt): | 
					
						
							|  |  |  |             open_file(self.custom_sprite_dir) | 
					
						
							| 
									
										
										
										
											2018-01-01 12:59:20 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-31 19:45:10 +02:00
										 |  |  |         alttpr_frametitle = Label(self.window, text='ALTTPR Sprites') | 
					
						
							| 
									
										
										
										
											2018-01-01 12:59:20 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-31 19:45:10 +02:00
										 |  |  |         custom_frametitle = Frame(self.window) | 
					
						
							|  |  |  |         title_text = Label(custom_frametitle, text="Custom Sprites") | 
					
						
							|  |  |  |         title_link = Label(custom_frametitle, text="(open)", fg="blue", cursor="hand2") | 
					
						
							| 
									
										
										
										
											2018-01-01 12:59:20 -05:00
										 |  |  |         title_text.pack(side=LEFT) | 
					
						
							|  |  |  |         title_link.pack(side=LEFT) | 
					
						
							| 
									
										
										
										
											2020-07-31 19:45:10 +02:00
										 |  |  |         title_link.bind("<Button-1>", open_custom_sprite_dir) | 
					
						
							| 
									
										
										
										
											2018-01-01 12:59:20 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-05 23:15:39 +01:00
										 |  |  |         self.icon_section(alttpr_frametitle, self.alttpr_sprite_dir, 'ALTTPR sprites not found. Click "Update alttpr sprites" to download them.') | 
					
						
							|  |  |  |         self.icon_section(custom_frametitle, self.custom_sprite_dir, 'Put sprites in the custom sprites folder (see open link above) to have them appear here.') | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-18 12:22:06 -05:00
										 |  |  |         frame = Frame(self.window) | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  |         frame.pack(side=BOTTOM, fill=X, pady=5) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         button = Button(frame, text="Browse for file...", command=self.browse_for_sprite) | 
					
						
							| 
									
										
										
										
											2017-11-18 12:22:06 -05:00
										 |  |  |         button.pack(side=RIGHT, padx=(5, 0)) | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-31 19:45:10 +02:00
										 |  |  |         button = Button(frame, text="Update alttpr sprites", command=self.update_alttpr_sprites) | 
					
						
							| 
									
										
										
										
											2017-11-18 12:22:06 -05:00
										 |  |  |         button.pack(side=RIGHT, padx=(5, 0)) | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-07 20:10:23 -05:00
										 |  |  |         button = Button(frame, text="Default Link sprite", command=self.use_default_link_sprite) | 
					
						
							|  |  |  |         button.pack(side=LEFT, padx=(0, 5)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-04 10:57:30 -07:00
										 |  |  |         self.randomButtonText = StringVar() | 
					
						
							|  |  |  |         button = Button(frame, textvariable=self.randomButtonText, command=self.use_random_sprite) | 
					
						
							|  |  |  |         button.pack(side=LEFT, padx=(0, 5)) | 
					
						
							|  |  |  |         self.randomButtonText.set("Random") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         self.randomOnEventText = StringVar() | 
					
						
							|  |  |  |         self.randomOnHitVar = IntVar() | 
					
						
							|  |  |  |         self.randomOnEnterVar = IntVar() | 
					
						
							|  |  |  |         self.randomOnExitVar = IntVar() | 
					
						
							|  |  |  |         self.randomOnSlashVar = IntVar() | 
					
						
							|  |  |  |         self.randomOnItemVar = IntVar() | 
					
						
							| 
									
										
										
										
											2020-10-07 16:13:42 -07:00
										 |  |  |         self.randomOnBonkVar = IntVar() | 
					
						
							| 
									
										
										
										
											2020-10-04 10:57:30 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |         button = Checkbutton(frame, text="Hit", command=self.update_random_button, variable=self.randomOnHitVar) | 
					
						
							|  |  |  |         button.pack(side=LEFT, padx=(0, 5)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         button = Checkbutton(frame, text="Enter", command=self.update_random_button, variable=self.randomOnEnterVar) | 
					
						
							|  |  |  |         button.pack(side=LEFT, padx=(0, 5)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         button = Checkbutton(frame, text="Exit", command=self.update_random_button, variable=self.randomOnExitVar) | 
					
						
							|  |  |  |         button.pack(side=LEFT, padx=(0, 5)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         button = Checkbutton(frame, text="Slash", command=self.update_random_button, variable=self.randomOnSlashVar) | 
					
						
							|  |  |  |         button.pack(side=LEFT, padx=(0, 5)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         button = Checkbutton(frame, text="Item", command=self.update_random_button, variable=self.randomOnItemVar) | 
					
						
							| 
									
										
										
										
											2018-01-05 00:42:35 -05:00
										 |  |  |         button.pack(side=LEFT, padx=(0, 5)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-07 16:13:42 -07:00
										 |  |  |         button = Checkbutton(frame, text="Bonk", command=self.update_random_button, variable=self.randomOnBonkVar) | 
					
						
							|  |  |  |         button.pack(side=LEFT, padx=(0, 5)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-05 00:42:35 -05:00
										 |  |  |         if adjuster: | 
					
						
							| 
									
										
										
										
											2018-01-07 20:10:23 -05:00
										 |  |  |             button = Button(frame, text="Current sprite from rom", command=self.use_default_sprite) | 
					
						
							| 
									
										
										
										
											2018-01-05 00:42:35 -05:00
										 |  |  |             button.pack(side=LEFT, padx=(0, 5)) | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-18 12:22:06 -05:00
										 |  |  |         set_icon(self.window) | 
					
						
							| 
									
										
										
										
											2017-12-10 11:10:04 -05:00
										 |  |  |         self.window.focus() | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-29 04:31:16 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  |     def icon_section(self, frame_label, path, no_results_label): | 
					
						
							| 
									
										
										
										
											2018-01-01 12:59:20 -05:00
										 |  |  |         frame = LabelFrame(self.window, labelwidget=frame_label, padx=5, pady=5) | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  |         frame.pack(side=TOP, fill=X) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-07 01:31:56 -05:00
										 |  |  |         sprites = [] | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-05 23:15:39 +01:00
										 |  |  |         for file in os.listdir(path): | 
					
						
							|  |  |  |             sprites.append((file, Sprite(os.path.join(path, file)))) | 
					
						
							| 
									
										
										
										
											2018-01-07 01:31:56 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-05 23:15:39 +01:00
										 |  |  |         sprites.sort(key=lambda s: str.lower(s[1].name or "").strip()) | 
					
						
							| 
									
										
										
										
											2018-01-07 01:31:56 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-29 04:31:16 +02:00
										 |  |  |         frame.buttons = [] | 
					
						
							| 
									
										
										
										
											2020-12-05 23:15:39 +01:00
										 |  |  |         for file, sprite in sprites: | 
					
						
							| 
									
										
										
										
											2017-12-08 17:33:59 -05:00
										 |  |  |             image = get_image_for_sprite(sprite) | 
					
						
							| 
									
										
										
										
											2017-12-17 00:25:46 -05:00
										 |  |  |             if image is None: | 
					
						
							|  |  |  |                 continue | 
					
						
							| 
									
										
										
										
											2018-01-07 20:10:23 -05:00
										 |  |  |             self.all_sprites.append(sprite) | 
					
						
							| 
									
										
										
										
											2017-12-17 00:25:46 -05:00
										 |  |  |             button = Button(frame, image=image, command=lambda spr=sprite: self.select_sprite(spr)) | 
					
						
							| 
									
										
										
										
											2020-12-05 23:15:39 +01:00
										 |  |  |             ToolTips.register(button, sprite.name + | 
					
						
							|  |  |  |                               ("\nBy: %s" % sprite.author_name if sprite.author_name else "") + | 
					
						
							|  |  |  |                               f"\nFrom: {file}") | 
					
						
							| 
									
										
										
										
											2017-11-18 12:22:06 -05:00
										 |  |  |             button.image = image | 
					
						
							| 
									
										
										
										
											2020-07-29 04:31:16 +02:00
										 |  |  |             frame.buttons.append(button) | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-29 04:31:16 +02:00
										 |  |  |         if not frame.buttons: | 
					
						
							| 
									
										
										
										
											2017-12-17 00:25:46 -05:00
										 |  |  |             label = Label(frame, text=no_results_label) | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  |             label.pack() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-29 04:31:16 +02:00
										 |  |  |         def update_sprites(event): | 
					
						
							|  |  |  |             sprites_per_row = (event.width - 10) // 38 | 
					
						
							|  |  |  |             self.grid_fill_sprites(frame, sprites_per_row) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         self.grid_fill_sprites(frame, 32) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         frame.bind("<Configure>", update_sprites) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def grid_fill_sprites(self, frame, sprites_per_row): | 
					
						
							|  |  |  |         for i, button in enumerate(frame.buttons): | 
					
						
							|  |  |  |             button.grid(row=i // sprites_per_row, column=i % sprites_per_row) | 
					
						
							| 
									
										
										
										
											2017-11-18 12:22:06 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-31 19:45:10 +02:00
										 |  |  |     def update_alttpr_sprites(self): | 
					
						
							| 
									
										
										
										
											2017-11-18 12:22:06 -05:00
										 |  |  |         # need to wrap in try catch. We don't want errors getting the json or downloading the files to break us. | 
					
						
							|  |  |  |         self.window.destroy() | 
					
						
							| 
									
										
										
										
											2017-12-10 11:10:04 -05:00
										 |  |  |         self.parent.update() | 
					
						
							| 
									
										
										
										
											2020-07-29 04:31:16 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-11 13:45:21 +01:00
										 |  |  |         def on_finish(successful, resultmessage): | 
					
						
							| 
									
										
										
										
											2017-12-10 11:10:04 -05:00
										 |  |  |             if successful: | 
					
						
							| 
									
										
										
										
											2020-11-11 13:45:21 +01:00
										 |  |  |                 messagebox.showinfo("Sprite Updater", resultmessage) | 
					
						
							|  |  |  |             else: | 
					
						
							|  |  |  |                 logging.error(resultmessage) | 
					
						
							|  |  |  |                 messagebox.showerror("Sprite Updater", resultmessage) | 
					
						
							|  |  |  |             SpriteSelector(self.parent, self.callback, self.adjuster) | 
					
						
							| 
									
										
										
										
											2017-12-10 11:10:04 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-11 13:45:21 +01:00
										 |  |  |         BackgroundTaskProgress(self.parent, update_sprites, "Updating Sprites", on_finish) | 
					
						
							| 
									
										
										
										
											2017-11-18 12:22:06 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  |     def browse_for_sprite(self): | 
					
						
							| 
									
										
										
										
											2018-01-07 01:31:56 -05:00
										 |  |  |         sprite = filedialog.askopenfilename( | 
					
						
							|  |  |  |             filetypes=[("All Sprite Sources", (".zspr", ".spr", ".sfc", ".smc")), | 
					
						
							|  |  |  |                        ("ZSprite files", ".zspr"), | 
					
						
							|  |  |  |                        ("Sprite files", ".spr"), | 
					
						
							|  |  |  |                        ("Rom Files", (".sfc", ".smc")), | 
					
						
							|  |  |  |                        ("All Files", "*")]) | 
					
						
							| 
									
										
										
										
											2017-12-08 19:28:22 -05:00
										 |  |  |         try: | 
					
						
							|  |  |  |             self.callback(Sprite(sprite)) | 
					
						
							| 
									
										
										
										
											2017-12-17 00:25:46 -05:00
										 |  |  |         except Exception: | 
					
						
							| 
									
										
										
										
											2017-12-08 19:28:22 -05:00
										 |  |  |             self.callback(None) | 
					
						
							| 
									
										
										
										
											2017-11-18 12:22:06 -05:00
										 |  |  |         self.window.destroy() | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-08 19:28:22 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  |     def use_default_sprite(self): | 
					
						
							| 
									
										
										
										
											2017-12-08 19:28:22 -05:00
										 |  |  |         self.callback(None) | 
					
						
							| 
									
										
										
										
											2017-11-18 12:22:06 -05:00
										 |  |  |         self.window.destroy() | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-05 00:42:35 -05:00
										 |  |  |     def use_default_link_sprite(self): | 
					
						
							|  |  |  |         self.callback(Sprite.default_link_sprite()) | 
					
						
							|  |  |  |         self.window.destroy() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-04 10:57:30 -07:00
										 |  |  |     def update_random_button(self): | 
					
						
							|  |  |  |         randomon = "-hit" if self.randomOnHitVar.get() else "" | 
					
						
							|  |  |  |         randomon += "-enter" if self.randomOnEnterVar.get() else "" | 
					
						
							|  |  |  |         randomon += "-exit" if self.randomOnExitVar.get() else "" | 
					
						
							|  |  |  |         randomon += "-slash" if self.randomOnSlashVar.get() else "" | 
					
						
							|  |  |  |         randomon += "-item" if self.randomOnItemVar.get() else "" | 
					
						
							| 
									
										
										
										
											2020-10-07 16:13:42 -07:00
										 |  |  |         randomon += "-bonk" if self.randomOnBonkVar.get() else "" | 
					
						
							| 
									
										
										
										
											2020-10-04 10:57:30 -07:00
										 |  |  |         self.randomOnEventText.set(f"randomon{randomon}" if randomon else None) | 
					
						
							|  |  |  |         self.randomButtonText.set("Random On Event" if randomon else "Random") | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-07 20:10:23 -05:00
										 |  |  |     def use_random_sprite(self): | 
					
						
							| 
									
										
										
										
											2020-10-04 10:57:30 -07:00
										 |  |  |         randomon = self.randomOnEventText.get() | 
					
						
							|  |  |  |         self.callback(randomon if randomon else (random.choice(self.all_sprites) if self.all_sprites else None)) | 
					
						
							| 
									
										
										
										
											2018-01-07 20:10:23 -05:00
										 |  |  |         self.window.destroy() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  |     def select_sprite(self, spritename): | 
					
						
							|  |  |  |         self.callback(spritename) | 
					
						
							| 
									
										
										
										
											2017-11-18 12:22:06 -05:00
										 |  |  |         self.window.destroy() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  |     def deploy_icons(self): | 
					
						
							| 
									
										
										
										
											2020-07-31 19:45:10 +02:00
										 |  |  |         if not os.path.exists(self.custom_sprite_dir): | 
					
						
							|  |  |  |             os.makedirs(self.custom_sprite_dir) | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |     @property | 
					
						
							| 
									
										
										
										
											2020-07-31 19:45:10 +02:00
										 |  |  |     def alttpr_sprite_dir(self): | 
					
						
							| 
									
										
										
										
											2020-08-25 13:22:47 +02:00
										 |  |  |         return local_path("data", "sprites", "alttpr") | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |     @property | 
					
						
							| 
									
										
										
										
											2020-07-31 19:45:10 +02:00
										 |  |  |     def custom_sprite_dir(self): | 
					
						
							| 
									
										
										
										
											2020-08-25 13:22:47 +02:00
										 |  |  |         return local_path("data", "sprites", "custom") | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-07 19:44:08 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-11 13:45:21 +01:00
										 |  |  | def update_sprites(task, on_finish=None): | 
					
						
							|  |  |  |     resultmessage = "" | 
					
						
							|  |  |  |     successful = True | 
					
						
							|  |  |  |     sprite_dir = local_path("data", "sprites", "alttpr") | 
					
						
							| 
									
										
										
										
											2020-11-30 21:34:40 +01:00
										 |  |  |     os.makedirs(sprite_dir, exist_ok=True) | 
					
						
							| 
									
										
										
										
											2020-11-11 13:45:21 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def finished(): | 
					
						
							|  |  |  |         task.close_window() | 
					
						
							|  |  |  |         if on_finish: | 
					
						
							|  |  |  |             on_finish(successful, resultmessage) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     try: | 
					
						
							|  |  |  |         task.update_status("Downloading alttpr sprites list") | 
					
						
							|  |  |  |         with urlopen('https://alttpr.com/sprites') as response: | 
					
						
							|  |  |  |             sprites_arr = json.loads(response.read().decode("utf-8")) | 
					
						
							|  |  |  |     except Exception as e: | 
					
						
							|  |  |  |         resultmessage = "Error getting list of alttpr sprites. Sprites not updated.\n\n%s: %s" % (type(e).__name__, e) | 
					
						
							|  |  |  |         successful = False | 
					
						
							|  |  |  |         task.queue_event(finished) | 
					
						
							|  |  |  |         return | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     try: | 
					
						
							|  |  |  |         task.update_status("Determining needed sprites") | 
					
						
							|  |  |  |         current_sprites = [os.path.basename(file) for file in glob(sprite_dir + '/*')] | 
					
						
							|  |  |  |         alttpr_sprites = [(sprite['file'], os.path.basename(urlparse(sprite['file']).path)) for sprite in sprites_arr] | 
					
						
							|  |  |  |         needed_sprites = [(sprite_url, filename) for (sprite_url, filename) in alttpr_sprites if filename not in current_sprites] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         alttpr_filenames = [filename for (_, filename) in alttpr_sprites] | 
					
						
							|  |  |  |         obsolete_sprites = [sprite for sprite in current_sprites if sprite not in alttpr_filenames] | 
					
						
							|  |  |  |     except Exception as e: | 
					
						
							|  |  |  |         resultmessage = "Error Determining which sprites to update. Sprites not updated.\n\n%s: %s" % (type(e).__name__, e) | 
					
						
							|  |  |  |         successful = False | 
					
						
							|  |  |  |         task.queue_event(finished) | 
					
						
							|  |  |  |         return | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def dl(sprite_url, filename): | 
					
						
							|  |  |  |         target = os.path.join(sprite_dir, filename) | 
					
						
							|  |  |  |         with urlopen(sprite_url) as response, open(target, 'wb') as out: | 
					
						
							|  |  |  |             shutil.copyfileobj(response, out) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def rem(sprite): | 
					
						
							|  |  |  |         os.remove(os.path.join(sprite_dir, sprite)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     with ThreadPoolExecutor() as pool: | 
					
						
							|  |  |  |         dl_tasks = [] | 
					
						
							|  |  |  |         rem_tasks = [] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         for (sprite_url, filename) in needed_sprites: | 
					
						
							|  |  |  |             dl_tasks.append(pool.submit(dl, sprite_url, filename)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         for sprite in obsolete_sprites: | 
					
						
							|  |  |  |             rem_tasks.append(pool.submit(rem, sprite)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         deleted = 0 | 
					
						
							|  |  |  |         updated = 0 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         for dl_task in as_completed(dl_tasks): | 
					
						
							|  |  |  |             updated += 1 | 
					
						
							|  |  |  |             task.update_status("Downloading needed sprite %g/%g" % (updated, len(needed_sprites))) | 
					
						
							|  |  |  |             try: | 
					
						
							|  |  |  |                 dl_task.result() | 
					
						
							|  |  |  |             except Exception as e: | 
					
						
							|  |  |  |                 logging.exception(e) | 
					
						
							|  |  |  |                 resultmessage = "Error downloading sprite. Not all sprites updated.\n\n%s: %s" % ( | 
					
						
							|  |  |  |                 type(e).__name__, e) | 
					
						
							|  |  |  |                 successful = False | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         for rem_task in as_completed(rem_tasks): | 
					
						
							|  |  |  |             deleted += 1 | 
					
						
							|  |  |  |             task.update_status("Removing obsolete sprite %g/%g" % (deleted, len(obsolete_sprites))) | 
					
						
							|  |  |  |             try: | 
					
						
							|  |  |  |                 rem_task.result() | 
					
						
							|  |  |  |             except Exception as e: | 
					
						
							|  |  |  |                 logging.exception(e) | 
					
						
							|  |  |  |                 resultmessage = "Error removing obsolete sprite. Not all sprites updated.\n\n%s: %s" % ( | 
					
						
							|  |  |  |                 type(e).__name__, e) | 
					
						
							|  |  |  |                 successful = False | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if successful: | 
					
						
							|  |  |  |         resultmessage = "alttpr sprites updated successfully" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     task.queue_event(finished) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-31 23:17:33 -04:00
										 |  |  | def get_image_for_sprite(sprite, gif_only: bool = False): | 
					
						
							| 
									
										
										
										
											2017-12-07 19:44:08 -05:00
										 |  |  |     if not sprite.valid: | 
					
						
							|  |  |  |         return None | 
					
						
							|  |  |  |     height = 24 | 
					
						
							|  |  |  |     width = 16 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw_sprite_into_gif(add_palette_color, set_pixel_color_index): | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         def drawsprite(spr, pal_as_colors, offset): | 
					
						
							| 
									
										
										
										
											2017-12-17 00:25:46 -05:00
										 |  |  |             for y, row in enumerate(spr): | 
					
						
							|  |  |  |                 for x, pal_index in enumerate(row): | 
					
						
							| 
									
										
										
										
											2017-12-07 19:44:08 -05:00
										 |  |  |                     if pal_index: | 
					
						
							|  |  |  |                         color = pal_as_colors[pal_index - 1] | 
					
						
							|  |  |  |                         set_pixel_color_index(x + offset[0], y + offset[1], color) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         add_palette_color(16, (40, 40, 40)) | 
					
						
							|  |  |  |         shadow = [ | 
					
						
							|  |  |  |             [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0], | 
					
						
							|  |  |  |             [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], | 
					
						
							|  |  |  |             [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], | 
					
						
							|  |  |  |             [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], | 
					
						
							|  |  |  |             [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], | 
					
						
							|  |  |  |             [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0], | 
					
						
							|  |  |  |         ] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         drawsprite(shadow, [16], (2, 17)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         palettes = sprite.decode_palette() | 
					
						
							|  |  |  |         for i in range(15): | 
					
						
							|  |  |  |             add_palette_color(i + 1, palettes[0][i]) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         body = sprite.decode16(0x4C0) | 
					
						
							|  |  |  |         drawsprite(body, list(range(1, 16)), (0, 8)) | 
					
						
							|  |  |  |         head = sprite.decode16(0x40) | 
					
						
							|  |  |  |         drawsprite(head, list(range(1, 16)), (0, 0)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def make_gif(callback): | 
					
						
							|  |  |  |         gif_header = b'GIF89a' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         gif_lsd = bytearray(7) | 
					
						
							|  |  |  |         gif_lsd[0] = width | 
					
						
							|  |  |  |         gif_lsd[2] = height | 
					
						
							|  |  |  |         gif_lsd[4] = 0xF4  # 32 color palette follows.  transparant + 15 for sprite + 1 for shadow=17 which rounds up to 32 as nearest power of 2 | 
					
						
							|  |  |  |         gif_lsd[5] = 0  # background color is zero | 
					
						
							|  |  |  |         gif_lsd[6] = 0  # aspect raio not specified | 
					
						
							|  |  |  |         gif_gct = bytearray(3 * 32) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         gif_gce = bytearray(8) | 
					
						
							|  |  |  |         gif_gce[0] = 0x21  # start of extention blocked | 
					
						
							|  |  |  |         gif_gce[1] = 0xF9  # identifies this as the Graphics Control extension | 
					
						
							|  |  |  |         gif_gce[2] = 4  # we are suppling only the 4 four bytes | 
					
						
							|  |  |  |         gif_gce[3] = 0x01  # this gif includes transparency | 
					
						
							|  |  |  |         gif_gce[4] = gif_gce[5] = 0  # animation frrame delay (unused) | 
					
						
							|  |  |  |         gif_gce[6] = 0  # transparent color is index 0 | 
					
						
							|  |  |  |         gif_gce[7] = 0  # end of gif_gce | 
					
						
							|  |  |  |         gif_id = bytearray(10) | 
					
						
							|  |  |  |         gif_id[0] = 0x2c | 
					
						
							|  |  |  |         # byte 1,2 are image left. 3,4 are image top both are left as zerosuitsamus | 
					
						
							|  |  |  |         gif_id[5] = width | 
					
						
							|  |  |  |         gif_id[7] = height | 
					
						
							|  |  |  |         gif_id[9] = 0  # no local color table | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         gif_img_minimum_code_size = bytes([7])  # we choose 7 bits, so that each pixel is represented by a byte, for conviennce. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         clear = 0x80 | 
					
						
							|  |  |  |         stop = 0x81 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         unchunked_image_data = bytearray(height * (width + 1) + 1) | 
					
						
							|  |  |  |         # we technically need a Clear code once every 125 bytes, but we do it at the start of every row for simplicity | 
					
						
							|  |  |  |         for row in range(height): | 
					
						
							|  |  |  |             unchunked_image_data[row * (width + 1)] = clear | 
					
						
							|  |  |  |         unchunked_image_data[-1] = stop | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         def add_palette_color(index, color): | 
					
						
							|  |  |  |             gif_gct[3 * index] = color[0] | 
					
						
							|  |  |  |             gif_gct[3 * index + 1] = color[1] | 
					
						
							|  |  |  |             gif_gct[3 * index + 2] = color[2] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         def set_pixel_color_index(x, y, color): | 
					
						
							|  |  |  |             unchunked_image_data[y * (width + 1) + x + 1] = color | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         callback(add_palette_color, set_pixel_color_index) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         def chunk_image(img): | 
					
						
							|  |  |  |             for i in range(0, len(img), 255): | 
					
						
							|  |  |  |                 chunk = img[i:i + 255] | 
					
						
							|  |  |  |                 yield bytes([len(chunk)]) | 
					
						
							|  |  |  |                 yield chunk | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         gif_img = b''.join([gif_img_minimum_code_size] + list(chunk_image(unchunked_image_data)) + [b'\x00']) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         gif = b''.join([gif_header, gif_lsd, gif_gct, gif_gce, gif_id, gif_img, b'\x3b']) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         return gif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     gif_data = make_gif(draw_sprite_into_gif) | 
					
						
							| 
									
										
										
										
											2020-08-31 23:17:33 -04:00
										 |  |  |     if gif_only: | 
					
						
							|  |  |  |         return gif_data | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-07 19:44:08 -05:00
										 |  |  |     image = PhotoImage(data=gif_data) | 
					
						
							| 
									
										
										
										
											2017-11-13 00:29:42 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |     return image.zoom(2) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-14 14:34:33 +02:00
										 |  |  | if __name__ == '__main__': | 
					
						
							| 
									
										
										
										
											2020-11-11 13:45:21 +01:00
										 |  |  |     import sys | 
					
						
							|  |  |  |     if "update_sprites" in sys.argv: | 
					
						
							|  |  |  |         import threading | 
					
						
							|  |  |  |         done = threading.Event() | 
					
						
							|  |  |  |         top = Tk() | 
					
						
							|  |  |  |         top.withdraw() | 
					
						
							|  |  |  |         BackgroundTaskProgress(top, update_sprites, "Updating Sprites", lambda succesful, resultmessage: done.set()) | 
					
						
							|  |  |  |         while not done.isSet(): | 
					
						
							|  |  |  |             top.update() | 
					
						
							|  |  |  |         print("Done updating sprites") | 
					
						
							|  |  |  |     else: | 
					
						
							| 
									
										
										
										
											2021-01-27 02:32:38 +01:00
										 |  |  |         logging.basicConfig(level=logging.INFO) | 
					
						
							| 
									
										
										
										
											2020-11-11 13:45:21 +01:00
										 |  |  |         guiMain() |