Sort Generation Options
Fix a couple Dungeon Shuffle things Coming back to implement working dirs
This commit is contained in:
80
Gui.py
80
Gui.py
@@ -18,6 +18,7 @@ from gui.randomize.enemizer import enemizer_page
|
|||||||
from gui.randomize.dungeon import dungeon_page
|
from gui.randomize.dungeon import dungeon_page
|
||||||
from gui.randomize.multiworld import multiworld_page
|
from gui.randomize.multiworld import multiworld_page
|
||||||
from gui.randomize.gameoptions import gameoptions_page
|
from gui.randomize.gameoptions import gameoptions_page
|
||||||
|
from gui.randomize.generation import generation_page
|
||||||
from GuiUtils import ToolTips, set_icon, BackgroundTaskProgress
|
from GuiUtils import ToolTips, set_icon, BackgroundTaskProgress
|
||||||
from Main import main, __version__ as ESVersion
|
from Main import main, __version__ as ESVersion
|
||||||
from Rom import Sprite
|
from Rom import Sprite
|
||||||
@@ -34,11 +35,9 @@ def guiMain(args=None):
|
|||||||
randomizerWindow = ttk.Frame(notebook)
|
randomizerWindow = ttk.Frame(notebook)
|
||||||
adjustWindow = ttk.Frame(notebook)
|
adjustWindow = ttk.Frame(notebook)
|
||||||
customWindow = ttk.Frame(notebook)
|
customWindow = ttk.Frame(notebook)
|
||||||
sortWindow = ttk.Frame(notebook)
|
|
||||||
notebook.add(randomizerWindow, text='Randomize')
|
notebook.add(randomizerWindow, text='Randomize')
|
||||||
notebook.add(adjustWindow, text='Adjust')
|
notebook.add(adjustWindow, text='Adjust')
|
||||||
notebook.add(customWindow, text='Custom')
|
notebook.add(customWindow, text='Custom')
|
||||||
notebook.add(sortWindow, text='SORT')
|
|
||||||
notebook.pack()
|
notebook.pack()
|
||||||
|
|
||||||
# Shared Controls
|
# Shared Controls
|
||||||
@@ -99,62 +98,12 @@ def guiMain(args=None):
|
|||||||
randomizerNotebook.add(gameOptionsWindow, text="Game Options")
|
randomizerNotebook.add(gameOptionsWindow, text="Game Options")
|
||||||
|
|
||||||
# Generation Setup
|
# Generation Setup
|
||||||
generationSetupWindow = ttk.Frame(randomizerNotebook)
|
generationSetupWindow = generation_page(randomizerNotebook)
|
||||||
randomizerNotebook.add(generationSetupWindow, text="Generation Setup")
|
randomizerNotebook.add(generationSetupWindow, text="Generation Setup")
|
||||||
|
|
||||||
# add randomizer notebook to main window
|
# add randomizer notebook to main window
|
||||||
randomizerNotebook.pack()
|
randomizerNotebook.pack()
|
||||||
|
|
||||||
topFrame = Frame(sortWindow)
|
|
||||||
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)
|
|
||||||
customVar = IntVar()
|
|
||||||
customCheckbutton = Checkbutton(checkBoxFrame, text="Use custom item pool", variable=customVar)
|
|
||||||
|
|
||||||
createSpoilerCheckbutton.pack(expand=True, anchor=W)
|
|
||||||
suppressRomCheckbutton.pack(expand=True, anchor=W)
|
|
||||||
customCheckbutton.pack(expand=True, anchor=W)
|
|
||||||
|
|
||||||
romOptionsFrame = LabelFrame(rightHalfFrame, text="Rom options")
|
|
||||||
romOptionsFrame.columnconfigure(0, weight=1)
|
|
||||||
romOptionsFrame.columnconfigure(1, weight=1)
|
|
||||||
for i in range(5):
|
|
||||||
romOptionsFrame.rowconfigure(i, weight=1)
|
|
||||||
|
|
||||||
romDialogFrame = Frame(romOptionsFrame)
|
|
||||||
romDialogFrame.grid(row=4, column=0, columnspan=2, sticky=W+E)
|
|
||||||
|
|
||||||
baseRomLabel = Label(romDialogFrame, text='Base Rom: ')
|
|
||||||
romVar = StringVar(value="Zelda no Densetsu - Kamigami no Triforce (Japan).sfc")
|
|
||||||
romEntry = Entry(romDialogFrame, textvariable=romVar)
|
|
||||||
|
|
||||||
def RomSelect():
|
|
||||||
rom = filedialog.askopenfilename(filetypes=[("Rom Files", (".sfc", ".smc")), ("All Files", "*")])
|
|
||||||
romVar.set(rom)
|
|
||||||
romSelectButton = Button(romDialogFrame, text='Select Rom', command=RomSelect)
|
|
||||||
|
|
||||||
baseRomLabel.pack(side=LEFT)
|
|
||||||
romEntry.pack(side=LEFT, expand=True, fill=X)
|
|
||||||
romSelectButton.pack(side=LEFT)
|
|
||||||
|
|
||||||
checkBoxFrame.pack(side=TOP, anchor=W, padx=5, pady=10)
|
|
||||||
romOptionsFrame.pack(expand=True, fill=BOTH, padx=3)
|
|
||||||
|
|
||||||
drowDownFrame = Frame(topFrame)
|
|
||||||
|
|
||||||
doorShuffleFrame = Frame(drowDownFrame)
|
|
||||||
doorShuffleVar = StringVar()
|
|
||||||
doorShuffleVar.set('basic')
|
|
||||||
doorShuffleOptionMenu = OptionMenu(doorShuffleFrame, doorShuffleVar, 'vanilla', 'basic', 'crossed', 'experimental')
|
|
||||||
doorShuffleOptionMenu.pack(side=RIGHT)
|
|
||||||
doorShuffleLabel = Label(doorShuffleFrame, text='Door shuffle algorithm')
|
|
||||||
doorShuffleLabel.pack(side=LEFT)
|
|
||||||
|
|
||||||
bottomFrame = Frame(randomizerWindow, pady=5)
|
bottomFrame = Frame(randomizerWindow, pady=5)
|
||||||
|
|
||||||
seedLabel = Label(farBottomFrame, text='Seed #')
|
seedLabel = Label(farBottomFrame, text='Seed #')
|
||||||
@@ -184,13 +133,13 @@ def guiMain(args=None):
|
|||||||
guiargs.accessibility = itemWindow.accessibilityVar.get()
|
guiargs.accessibility = itemWindow.accessibilityVar.get()
|
||||||
guiargs.algorithm = itemWindow.algorithmVar.get()
|
guiargs.algorithm = itemWindow.algorithmVar.get()
|
||||||
guiargs.shuffle = entrandoWindow.shuffleVar.get()
|
guiargs.shuffle = entrandoWindow.shuffleVar.get()
|
||||||
guiargs.door_shuffle = doorShuffleVar.get()
|
guiargs.door_shuffle = dungeonRandoWindow.doorShuffleVar.get()
|
||||||
guiargs.heartbeep = gameOptionsWindow.heartbeepVar.get()
|
guiargs.heartbeep = gameOptionsWindow.heartbeepVar.get()
|
||||||
guiargs.heartcolor = gameOptionsWindow.heartcolorVar.get()
|
guiargs.heartcolor = gameOptionsWindow.heartcolorVar.get()
|
||||||
guiargs.fastmenu = gameOptionsWindow.fastMenuVar.get()
|
guiargs.fastmenu = gameOptionsWindow.fastMenuVar.get()
|
||||||
guiargs.create_spoiler = bool(createSpoilerVar.get())
|
guiargs.create_spoiler = bool(generationSetupWindow.createSpoilerVar.get())
|
||||||
guiargs.skip_playthrough = not bool(createSpoilerVar.get())
|
guiargs.skip_playthrough = not bool(generationSetupWindow.createSpoilerVar.get())
|
||||||
guiargs.suppress_rom = bool(suppressRomVar.get())
|
guiargs.suppress_rom = bool(generationSetupWindow.suppressRomVar.get())
|
||||||
guiargs.openpyramid = bool(entrandoWindow.openpyramidVar.get())
|
guiargs.openpyramid = bool(entrandoWindow.openpyramidVar.get())
|
||||||
guiargs.mapshuffle = bool(dungeonRandoWindow.mapshuffleVar.get())
|
guiargs.mapshuffle = bool(dungeonRandoWindow.mapshuffleVar.get())
|
||||||
guiargs.compassshuffle = bool(dungeonRandoWindow.compassshuffleVar.get())
|
guiargs.compassshuffle = bool(dungeonRandoWindow.compassshuffleVar.get())
|
||||||
@@ -209,7 +158,7 @@ def guiMain(args=None):
|
|||||||
guiargs.enemy_health = enemizerWindow.enemizerHealthVar.get()
|
guiargs.enemy_health = enemizerWindow.enemizerHealthVar.get()
|
||||||
guiargs.enemy_damage = enemizerWindow.enemizerDamageVar.get()
|
guiargs.enemy_damage = enemizerWindow.enemizerDamageVar.get()
|
||||||
guiargs.shufflepots = bool(enemizerWindow.potShuffleVar.get())
|
guiargs.shufflepots = bool(enemizerWindow.potShuffleVar.get())
|
||||||
guiargs.custom = bool(customVar.get())
|
guiargs.custom = bool(generationSetupWindow.customVar.get())
|
||||||
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()),
|
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(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(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()),
|
||||||
@@ -219,7 +168,7 @@ def guiMain(args=None):
|
|||||||
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(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()), int(bomb10Var.get()), int(triforcepieceVar.get()),
|
int(rupee300Var.get()), int(rupoorVar.get()), int(blueclockVar.get()), int(greenclockVar.get()), int(redclockVar.get()), int(progbowVar.get()), int(bomb10Var.get()), int(triforcepieceVar.get()),
|
||||||
int(triforcecountVar.get()), int(triforceVar.get()), int(rupoorcostVar.get()), int(universalkeyVar.get())]
|
int(triforcecountVar.get()), int(triforceVar.get()), int(rupoorcostVar.get()), int(universalkeyVar.get())]
|
||||||
guiargs.rom = romVar.get()
|
guiargs.rom = generationSetupWindow.romVar.get()
|
||||||
# guiargs.sprite = gameOptionsWindow.sprite
|
# guiargs.sprite = gameOptionsWindow.sprite
|
||||||
guiargs.outputpath = args.outputpath if args else None
|
guiargs.outputpath = args.outputpath if args else None
|
||||||
# get default values for missing parameters
|
# get default values for missing parameters
|
||||||
@@ -252,9 +201,6 @@ def guiMain(args=None):
|
|||||||
|
|
||||||
openOutputButton.pack(side=RIGHT)
|
openOutputButton.pack(side=RIGHT)
|
||||||
|
|
||||||
drowDownFrame.pack(side=LEFT)
|
|
||||||
rightHalfFrame.pack(side=RIGHT)
|
|
||||||
topFrame.pack(side=TOP)
|
|
||||||
bottomFrame.pack(side=BOTTOM)
|
bottomFrame.pack(side=BOTTOM)
|
||||||
|
|
||||||
# Adjuster Controls
|
# Adjuster Controls
|
||||||
@@ -354,7 +300,7 @@ def guiMain(args=None):
|
|||||||
guiargs.quickswap = bool(gameOptionsWindow.quickSwapVar.get())
|
guiargs.quickswap = bool(gameOptionsWindow.quickSwapVar.get())
|
||||||
guiargs.disablemusic = bool(gameOptionsWindow.disableMusicVar.get())
|
guiargs.disablemusic = bool(gameOptionsWindow.disableMusicVar.get())
|
||||||
guiargs.rom = romVar2.get()
|
guiargs.rom = romVar2.get()
|
||||||
guiargs.baserom = romVar.get()
|
guiargs.baserom = generationSetupWindow.romVar.get()
|
||||||
# guiargs.sprite = sprite
|
# guiargs.sprite = sprite
|
||||||
try:
|
try:
|
||||||
adjust(args=guiargs)
|
adjust(args=guiargs)
|
||||||
@@ -970,8 +916,8 @@ def guiMain(args=None):
|
|||||||
if type(v) is dict:
|
if type(v) is dict:
|
||||||
setattr(args, k, v[1]) # only get values for player 1 for now
|
setattr(args, k, v[1]) # only get values for player 1 for now
|
||||||
# load values from commandline args
|
# load values from commandline args
|
||||||
createSpoilerVar.set(int(args.create_spoiler))
|
generationSetupWindow.createSpoilerVar.set(int(args.create_spoiler))
|
||||||
suppressRomVar.set(int(args.suppress_rom))
|
generationSetupWindow.suppressRomVar.set(int(args.suppress_rom))
|
||||||
dungeonRandoWindow.mapshuffleVar.set(args.mapshuffle)
|
dungeonRandoWindow.mapshuffleVar.set(args.mapshuffle)
|
||||||
dungeonRandoWindow.compassshuffleVar.set(args.compassshuffle)
|
dungeonRandoWindow.compassshuffleVar.set(args.compassshuffle)
|
||||||
dungeonRandoWindow.keyshuffleVar.set(args.keyshuffle)
|
dungeonRandoWindow.keyshuffleVar.set(args.keyshuffle)
|
||||||
@@ -998,12 +944,12 @@ def guiMain(args=None):
|
|||||||
itemWindow.crystalsGanonVar.set(args.crystals_ganon)
|
itemWindow.crystalsGanonVar.set(args.crystals_ganon)
|
||||||
itemWindow.algorithmVar.set(args.algorithm)
|
itemWindow.algorithmVar.set(args.algorithm)
|
||||||
entrandoWindow.shuffleVar.set(args.shuffle)
|
entrandoWindow.shuffleVar.set(args.shuffle)
|
||||||
doorShuffleVar.set(args.door_shuffle)
|
dungeonRandoWindow.doorShuffleVar.set(args.door_shuffle)
|
||||||
gameOptionsWindow.heartcolorVar.set(args.heartcolor)
|
gameOptionsWindow.heartcolorVar.set(args.heartcolor)
|
||||||
gameOptionsWindow.heartbeepVar.set(args.heartbeep)
|
gameOptionsWindow.heartbeepVar.set(args.heartbeep)
|
||||||
gameOptionsWindow.fastMenuVar.set(args.fastmenu)
|
gameOptionsWindow.fastMenuVar.set(args.fastmenu)
|
||||||
itemWindow.logicVar.set(args.logic)
|
itemWindow.logicVar.set(args.logic)
|
||||||
romVar.set(args.rom)
|
generationSetupWindow.romVar.set(args.rom)
|
||||||
entrandoWindow.shuffleGanonVar.set(args.shuffleganon)
|
entrandoWindow.shuffleGanonVar.set(args.shuffleganon)
|
||||||
gameOptionsWindow.hintsVar.set(args.hints)
|
gameOptionsWindow.hintsVar.set(args.hints)
|
||||||
enemizerWindow.enemizerCLIpathVar.set(args.enemizercli)
|
enemizerWindow.enemizerCLIpathVar.set(args.enemizercli)
|
||||||
|
|||||||
41
gui/randomize/generation.py
Normal file
41
gui/randomize/generation.py
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
import os
|
||||||
|
from tkinter import ttk, filedialog, IntVar, StringVar, Button, Checkbutton, Entry, Frame, Label, E, W, LEFT, RIGHT, X
|
||||||
|
|
||||||
|
def generation_page(parent):#,working_dirs):
|
||||||
|
self = ttk.Frame(parent)
|
||||||
|
|
||||||
|
# Generation Setup options
|
||||||
|
## Generate Spoiler
|
||||||
|
self.createSpoilerVar = IntVar()
|
||||||
|
createSpoilerCheckbutton = Checkbutton(self, text="Create Spoiler Log", variable=self.createSpoilerVar)
|
||||||
|
createSpoilerCheckbutton.pack(anchor=W)
|
||||||
|
## Don't make ROM
|
||||||
|
self.suppressRomVar = IntVar()
|
||||||
|
suppressRomCheckbutton = Checkbutton(self, text="Do not create patched Rom", variable=self.suppressRomVar)
|
||||||
|
suppressRomCheckbutton.pack(anchor=W)
|
||||||
|
## Use Custom Item Pool as defined in Custom tab
|
||||||
|
self.customVar = IntVar()
|
||||||
|
customCheckbutton = Checkbutton(self, text="Use custom item pool", variable=self.customVar)
|
||||||
|
customCheckbutton.pack(anchor=W)
|
||||||
|
## Locate base ROM
|
||||||
|
baseRomFrame = Frame(self)
|
||||||
|
baseRomLabel = Label(baseRomFrame, text='Base Rom: ')
|
||||||
|
self.romVar = StringVar()
|
||||||
|
def saveBaseRom(caller,_,mode):
|
||||||
|
pass
|
||||||
|
# working_dirs["rom.base"] = self.romVar.get()
|
||||||
|
self.romVar.trace_add("write",saveBaseRom)
|
||||||
|
romEntry = Entry(baseRomFrame, textvariable=self.romVar)
|
||||||
|
# self.romVar.set(working_dirs["rom.base"])
|
||||||
|
|
||||||
|
def RomSelect():
|
||||||
|
rom = filedialog.askopenfilename(filetypes=[("Rom Files", (".sfc", ".smc")), ("All Files", "*")], initialdir=os.path.join("."))
|
||||||
|
self.romVar.set(rom)
|
||||||
|
romSelectButton = Button(baseRomFrame, text='Select Rom', command=RomSelect)
|
||||||
|
|
||||||
|
baseRomLabel.pack(side=LEFT)
|
||||||
|
romEntry.pack(side=LEFT, fill=X, expand=True)
|
||||||
|
romSelectButton.pack(side=LEFT)
|
||||||
|
baseRomFrame.pack(fill=X, expand=True)
|
||||||
|
|
||||||
|
return self#,working_dirs
|
||||||
Reference in New Issue
Block a user