Skip to content

Commit

Permalink
Adjusted GUI text
Browse files Browse the repository at this point in the history
Also changed credits to match my new username
  • Loading branch information
Mode8fx committed Oct 5, 2021
1 parent 82a7055 commit b36cf39
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
12 changes: 11 additions & 1 deletion classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,17 @@ def setSide(self, side):

class Ruleset:
def __init__(self, name=None, description=None, rules=[], must_be_enabled=[], must_be_disabled=[]):
self.name = name
tempFullStr = ""
tempWordArr = name.split(" ")
lineLenCounter = 0
for word in tempWordArr:
if (lineLenCounter + len(word) + 1 <= (25 + 1)):
tempFullStr += word + " "
lineLenCounter += len(word) + 1
else:
tempFullStr += '\n' + word + " "
lineLenCounter = 0
self.name = tempFullStr.strip()
self.description = description
self.rules = rules
if must_be_enabled is None:
Expand Down
16 changes: 12 additions & 4 deletions srm.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ def __init__(self, top=None):
self.style.map('.',background=
[('selected', _compcolor), ('active',_ana2color)])
self.font = tkFont.Font(family='TkDefaultFont')
self.fontHeight = self.font.metrics('linespace') / 500
self.tooltip_font = "TkDefaultFont"

self.top = top
Expand Down Expand Up @@ -674,7 +675,9 @@ def getMaxColumnWidth(self, num):
upper = lower + 5
sizeArr = []
for i in range(lower, min(upper, len(Optional_Rulesets))):
sizeArr.append(self.getTextLength(Optional_Rulesets[i].name)-.03)
# sizeArr.append(self.getTextLength(Optional_Rulesets[i].name)-.03)
for j in range(Optional_Rulesets[i].name.count('\n') + 1):
sizeArr.append(self.getTextLength(Optional_Rulesets[i].name.split('\n')[j])-.03)
if len(sizeArr) == 0:
return self.getTextLength("# of Seeds")-.03
return max(sizeArr)
Expand Down Expand Up @@ -734,11 +737,16 @@ def setDisplayedRulesets(self):
yShiftArray = spaceOut(min(numOptRulesets+1, 5), .09, numDecimalPlaces=3)
optRulesetNum = 0
for i in range(len(Optional_Rulesets)):
tempMaxLen = 0
tempNumLines = 0
for line in Optional_Rulesets[i].name.split('\n'):
tempMaxLen = max(tempMaxLen, self.getTextLength(line))
tempNumLines += 1
if firstIndex <= i < lastIndex:
self.CheckButtons[i].place(relx=.475-self.getMaxColumnWidth(optRulesetNum)/2+xShiftArray[optRulesetNum//5], rely=(.40+yShiftArray[optRulesetNum%5])*vMult, relheight=.05*vMult, relwidth=self.getTextLength(Optional_Rulesets[i].name)+.03)
self.CheckButtons[i].place(relx=.475-self.getMaxColumnWidth(optRulesetNum)/2+xShiftArray[optRulesetNum//5], rely=(.40+yShiftArray[optRulesetNum%5])*vMult, relheight=max(self.fontHeight*tempNumLines*vMult, 0.05), relwidth=tempMaxLen+.03)
optRulesetNum += 1
else:
self.CheckButtons[i].place(relx=10, rely=10, relheight=.05*vMult, relwidth=self.getTextLength(Optional_Rulesets[i].name)+.03)
self.CheckButtons[i].place(relx=10, rely=10, relheight=max(self.fontHeight*tempNumLines*vMult, 0.05), relwidth=tempMaxLen+.03)

if optRulesetNum < 15:
# Number of Seeds Label
Expand Down Expand Up @@ -821,7 +829,7 @@ def showAboutPopup(self):
showinfo("About", About_Page_Text)

def showSRMPopup(self):
showinfo("Simple Randomizer Maker v1.25", "This was made using\nGateGuy's Simple Randomizer Maker.\n\nhttps://github.com/GateGuy/SimpleRandomizerMaker")
showinfo("Simple Randomizer Maker v1.26", "This was made using\nMips96's Simple Randomizer Maker.\n\nhttps://github.com/Mips96/SimpleRandomizerMaker")

# ======================================================
# Support code for Balloon Help (also called tooltips).
Expand Down

0 comments on commit b36cf39

Please sign in to comment.