Files
alttpr-python/gui/randomize/generation.py
Mike A. Trethewey 03431f0b83 Implement save system
Add to .gitignore
Add to default CLI args
Add to each page that needs it
* Rom Adjuster
* Seed
* Generation attempts
* Enemizer CLI path
* Base ROM
* Multiworld worlds
* Multiworld names
2020-02-08 19:01:15 -08:00

41 lines
1.7 KiB
Python

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):
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