Document stuff, add a couple things
Add Retro World State (Open & Retro on) Add SpriteSomething plug to sprite selector Fix Custom Item Pool loading to use disct instead of list
This commit is contained in:
@@ -1,25 +1,27 @@
|
||||
from tkinter import ttk, Frame, N, LEFT, VERTICAL, Y
|
||||
from tkinter import ttk, Frame, N, E, W, LEFT, X, VERTICAL, Y
|
||||
import gui.widgets as widgets
|
||||
import json
|
||||
import os
|
||||
|
||||
import classes.constants as CONST
|
||||
|
||||
|
||||
def custom_page(top, parent):
|
||||
def custom_page(top,parent):
|
||||
# Custom Item Pool
|
||||
self = ttk.Frame(parent)
|
||||
|
||||
# Create uniform list columns
|
||||
def create_list_frame(parent, framename):
|
||||
parent.frames[framename] = Frame(parent)
|
||||
parent.frames[framename].pack(side=LEFT, padx=(0,0), anchor=N)
|
||||
parent.frames[framename].thisRow = 0
|
||||
parent.frames[framename].thisCol = 0
|
||||
|
||||
# Create a vertical rule to help with splitting columns visually
|
||||
def create_vertical_rule(num=1):
|
||||
for i in range(0,num):
|
||||
for _ in range(0,num):
|
||||
ttk.Separator(self, orient=VERTICAL).pack(side=LEFT, anchor=N, fill=Y)
|
||||
|
||||
# This was in here, I have no idea what it was but I left it just in case: MikeT
|
||||
def validation(P):
|
||||
if str.isdigit(P) or P == "":
|
||||
return True
|
||||
@@ -32,6 +34,7 @@ def custom_page(top, parent):
|
||||
|
||||
# Custom Item Pool option sections
|
||||
self.frames = {}
|
||||
# Create 5 columns with 2 vertical rules in between each
|
||||
create_list_frame(self, "itemList1")
|
||||
create_vertical_rule(2)
|
||||
create_list_frame(self, "itemList2")
|
||||
@@ -42,6 +45,8 @@ def custom_page(top, parent):
|
||||
create_vertical_rule(2)
|
||||
create_list_frame(self, "itemList5")
|
||||
|
||||
# Load Custom option widgets as defined by JSON file
|
||||
# Defns include frame name, widget type, widget options, widget placement attributes
|
||||
with open(os.path.join("resources", "app", "gui", "custom", "overview", "widgets.json")) as widgetDefns:
|
||||
myDict = json.load(widgetDefns)
|
||||
for framename,theseWidgets in myDict.items():
|
||||
@@ -49,7 +54,8 @@ def custom_page(top, parent):
|
||||
for key in dictWidgets:
|
||||
self.customWidgets[key] = dictWidgets[key]
|
||||
|
||||
for i, key in enumerate(CONST.CUSTOMITEMS):
|
||||
self.customWidgets[key].storageVar.set(top.settings["customitemarray"][i])
|
||||
# Load Custom Item Pool settings from settings file
|
||||
for key in CONST.CUSTOMITEMS:
|
||||
self.customWidgets[key].storageVar.set(top.settings["customitemarray"][key])
|
||||
|
||||
return self
|
||||
|
||||
Reference in New Issue
Block a user