Adjuster gui tweaks
Make the help button and output directory button available regardless of selected tab. Make controls on both tabs share underlying state where it makes sense to do so.
This commit is contained in:
parent
b36723f2dd
commit
2286adf289
63
Gui.py
63
Gui.py
|
@ -22,6 +22,25 @@ def guiMain(args=None):
|
||||||
notebook.add(adjustWindow, text='Adjust')
|
notebook.add(adjustWindow, text='Adjust')
|
||||||
notebook.pack()
|
notebook.pack()
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
topFrame = Frame(randomizerWindow)
|
topFrame = Frame(randomizerWindow)
|
||||||
rightHalfFrame = Frame(topFrame)
|
rightHalfFrame = Frame(topFrame)
|
||||||
checkBoxFrame = Frame(rightHalfFrame)
|
checkBoxFrame = Frame(rightHalfFrame)
|
||||||
|
@ -177,7 +196,6 @@ def guiMain(args=None):
|
||||||
heartbeepFrame.pack(expand=True, anchor=E)
|
heartbeepFrame.pack(expand=True, anchor=E)
|
||||||
|
|
||||||
bottomFrame = Frame(randomizerWindow)
|
bottomFrame = Frame(randomizerWindow)
|
||||||
farBottomFrame = Frame(randomizerWindow)
|
|
||||||
|
|
||||||
seedLabel = Label(bottomFrame, text='Seed #')
|
seedLabel = Label(bottomFrame, text='Seed #')
|
||||||
seedVar = StringVar()
|
seedVar = StringVar()
|
||||||
|
@ -226,17 +244,6 @@ def guiMain(args=None):
|
||||||
|
|
||||||
generateButton = Button(bottomFrame, text='Generate Patched Rom', command=generateRom)
|
generateButton = Button(bottomFrame, text='Generate Patched Rom', command=generateRom)
|
||||||
|
|
||||||
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)
|
|
||||||
|
|
||||||
seedLabel.pack(side=LEFT)
|
seedLabel.pack(side=LEFT)
|
||||||
seedEntry.pack(side=LEFT)
|
seedEntry.pack(side=LEFT)
|
||||||
countLabel.pack(side=LEFT, padx=(5,0))
|
countLabel.pack(side=LEFT, padx=(5,0))
|
||||||
|
@ -248,19 +255,17 @@ def guiMain(args=None):
|
||||||
drowDownFrame.pack(side=LEFT)
|
drowDownFrame.pack(side=LEFT)
|
||||||
rightHalfFrame.pack(side=RIGHT)
|
rightHalfFrame.pack(side=RIGHT)
|
||||||
topFrame.pack(side=TOP)
|
topFrame.pack(side=TOP)
|
||||||
farBottomFrame.pack(side=BOTTOM, fill=X, padx=5, pady=5)
|
|
||||||
bottomFrame.pack(side=BOTTOM)
|
bottomFrame.pack(side=BOTTOM)
|
||||||
|
|
||||||
|
# Adjuster Controls
|
||||||
|
|
||||||
topFrame2 = Frame(adjustWindow)
|
topFrame2 = Frame(adjustWindow)
|
||||||
rightHalfFrame2 = Frame(topFrame2)
|
rightHalfFrame2 = Frame(topFrame2)
|
||||||
checkBoxFrame2 = Frame(rightHalfFrame2)
|
checkBoxFrame2 = Frame(rightHalfFrame2)
|
||||||
|
|
||||||
quickSwapVar2 = IntVar()
|
quickSwapCheckbutton2 = Checkbutton(checkBoxFrame2, text="Enabled L/R Item quickswapping", variable=quickSwapVar)
|
||||||
quickSwapCheckbutton2 = Checkbutton(checkBoxFrame2, text="Enabled L/R Item quickswapping", variable=quickSwapVar2)
|
fastMenuCheckbutton2 = Checkbutton(checkBoxFrame2, text="Enable instant menu", variable=fastMenuVar)
|
||||||
fastMenuVar2 = IntVar()
|
disableMusicCheckbutton2 = Checkbutton(checkBoxFrame2, text="Disable game music", variable=disableMusicVar)
|
||||||
fastMenuCheckbutton2 = Checkbutton(checkBoxFrame2, text="Enable instant menu", variable=fastMenuVar2)
|
|
||||||
disableMusicVar2 = IntVar()
|
|
||||||
disableMusicCheckbutton2 = Checkbutton(checkBoxFrame2, text="Disable game music", variable=disableMusicVar2)
|
|
||||||
|
|
||||||
quickSwapCheckbutton2.pack(expand=True, anchor=W)
|
quickSwapCheckbutton2.pack(expand=True, anchor=W)
|
||||||
fastMenuCheckbutton2.pack(expand=True, anchor=W)
|
fastMenuCheckbutton2.pack(expand=True, anchor=W)
|
||||||
|
@ -284,12 +289,11 @@ def guiMain(args=None):
|
||||||
|
|
||||||
spriteDialogFrame2 = Frame(fileDialogFrame2)
|
spriteDialogFrame2 = Frame(fileDialogFrame2)
|
||||||
baseSpriteLabel2 = Label(spriteDialogFrame2, text='Link Sprite')
|
baseSpriteLabel2 = Label(spriteDialogFrame2, text='Link Sprite')
|
||||||
spriteVar2 = StringVar()
|
spriteEntry2 = Entry(spriteDialogFrame2, textvariable=spriteVar)
|
||||||
spriteEntry2 = Entry(spriteDialogFrame2, textvariable=spriteVar2)
|
|
||||||
|
|
||||||
def SpriteSelect2():
|
def SpriteSelect2():
|
||||||
sprite = filedialog.askopenfilename()
|
sprite = filedialog.askopenfilename()
|
||||||
spriteVar2.set(sprite)
|
spriteVar.set(sprite)
|
||||||
|
|
||||||
spriteSelectButton2 = Button(spriteDialogFrame2, text='Select Sprite', command=SpriteSelect2)
|
spriteSelectButton2 = Button(spriteDialogFrame2, text='Select Sprite', command=SpriteSelect2)
|
||||||
|
|
||||||
|
@ -304,11 +308,8 @@ def guiMain(args=None):
|
||||||
fileDialogFrame2.pack()
|
fileDialogFrame2.pack()
|
||||||
|
|
||||||
drowDownFrame2 = Frame(topFrame2)
|
drowDownFrame2 = Frame(topFrame2)
|
||||||
|
|
||||||
heartbeepFrame2 = Frame(drowDownFrame2)
|
heartbeepFrame2 = Frame(drowDownFrame2)
|
||||||
heartbeepVar2 = StringVar()
|
heartbeepOptionMenu2 = OptionMenu(heartbeepFrame2, heartbeepVar, 'normal', 'half', 'quarter', 'off')
|
||||||
heartbeepVar2.set('normal')
|
|
||||||
heartbeepOptionMenu2 = OptionMenu(heartbeepFrame2, heartbeepVar2, 'normal', 'half', 'quarter', 'off')
|
|
||||||
heartbeepOptionMenu2.pack(side=RIGHT)
|
heartbeepOptionMenu2.pack(side=RIGHT)
|
||||||
heartbeepLabel2 = Label(heartbeepFrame2, text='Heartbeep sound rate')
|
heartbeepLabel2 = Label(heartbeepFrame2, text='Heartbeep sound rate')
|
||||||
heartbeepLabel2.pack(side=LEFT)
|
heartbeepLabel2.pack(side=LEFT)
|
||||||
|
@ -319,12 +320,12 @@ def guiMain(args=None):
|
||||||
|
|
||||||
def adjustRom():
|
def adjustRom():
|
||||||
guiargs = Namespace
|
guiargs = Namespace
|
||||||
guiargs.heartbeep = heartbeepVar2.get()
|
guiargs.heartbeep = heartbeepVar.get()
|
||||||
guiargs.fastmenu = bool(fastMenuVar2.get())
|
guiargs.fastmenu = bool(fastMenuVar.get())
|
||||||
guiargs.quickswap = bool(quickSwapVar2.get())
|
guiargs.quickswap = bool(quickSwapVar.get())
|
||||||
guiargs.disablemusic = bool(disableMusicVar2.get())
|
guiargs.disablemusic = bool(disableMusicVar.get())
|
||||||
guiargs.rom = romVar2.get()
|
guiargs.rom = romVar2.get()
|
||||||
guiargs.sprite = spriteVar2.get() if spriteVar2.get() else None
|
guiargs.sprite = spriteVar.get() if spriteVar.get() else None
|
||||||
try:
|
try:
|
||||||
adjust(args=guiargs)
|
adjust(args=guiargs)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
Loading…
Reference in New Issue