Recreating History p11
This commit is contained in:
parent
4ca445a55c
commit
b17ad3f259
1 changed files with 22 additions and 12 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
# Burning Wheel - Spell Burner
|
# Burning Wheel - Spell Burner
|
||||||
# By 2Shirt (Alan Mason)
|
# By 2Shirt (Alan Mason)
|
||||||
#
|
#
|
||||||
# Version 0.11a
|
# Version 0.12a
|
||||||
from tkinter import *
|
from tkinter import *
|
||||||
from tkinter import ttk
|
from tkinter import ttk
|
||||||
from math import ceil, floor, log
|
from math import ceil, floor, log
|
||||||
|
|
@ -487,14 +487,21 @@ class WeaponStats():
|
||||||
self.spell = {}
|
self.spell = {}
|
||||||
self.tmp = {}
|
self.tmp = {}
|
||||||
for f in self.frame.facets:
|
for f in self.frame.facets:
|
||||||
if f.getOption == '':
|
if f.getOption() == '':
|
||||||
self.enabled = False
|
pass
|
||||||
break
|
elif f.getType() in self.spell:
|
||||||
try:
|
if f.getOption() in self.spell[f.getType()]:
|
||||||
self.spell[f.getType()][f.getOption()] = 0
|
self.spell[f.getType()][f.getOption()] += 1
|
||||||
except KeyError:
|
else:
|
||||||
|
self.spell[f.getType()][f.getOption()] = 1
|
||||||
|
else:
|
||||||
self.spell[f.getType()] = {}
|
self.spell[f.getType()] = {}
|
||||||
self.spell[f.getType()][f.getOption()] = 0
|
self.spell[f.getType()][f.getOption()] = 1
|
||||||
|
try:
|
||||||
|
if self.spell[f.getType()][f.getOption()] > 1:
|
||||||
|
self.frame.valid = False
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
|
||||||
# Enable/Disable
|
# Enable/Disable
|
||||||
if self.enabled:
|
if self.enabled:
|
||||||
|
|
@ -660,15 +667,17 @@ class App(ttk.Frame):
|
||||||
else:
|
else:
|
||||||
self.finalOb.set(self.postOb)
|
self.finalOb.set(self.postOb)
|
||||||
self.finalActions.set(self.postAct)
|
self.finalActions.set(self.postAct)
|
||||||
if self.valid:
|
|
||||||
self.warningLabelText.set(' ')
|
|
||||||
else:
|
|
||||||
self.warningLabelText.set('[HOUSE RULED]')
|
|
||||||
|
|
||||||
### Weapon Stats ###
|
### Weapon Stats ###
|
||||||
self.weapon.updateStats()
|
self.weapon.updateStats()
|
||||||
self.configureGrid()
|
self.configureGrid()
|
||||||
|
|
||||||
|
### Validity ###
|
||||||
|
if self.valid:
|
||||||
|
self.warningLabelText.set(' ')
|
||||||
|
else:
|
||||||
|
self.warningLabelText.set('[HOUSE RULED]')
|
||||||
|
|
||||||
def createWidgets(self):
|
def createWidgets(self):
|
||||||
# 1st Distillation
|
# 1st Distillation
|
||||||
self.facets.append(Facet(self, 0, 'Element'))
|
self.facets.append(Facet(self, 0, 'Element'))
|
||||||
|
|
@ -789,6 +798,7 @@ class App(ttk.Frame):
|
||||||
|
|
||||||
root = Tk()
|
root = Tk()
|
||||||
root.title('Spell Burner')
|
root.title('Spell Burner')
|
||||||
|
root.iconbitmap("SpellBurner.ico")
|
||||||
#root.resizable(0, 0) # disable window resizing
|
#root.resizable(0, 0) # disable window resizing
|
||||||
root.resizable(width=FALSE, height=FALSE) # disable window resizing
|
root.resizable(width=FALSE, height=FALSE) # disable window resizing
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue