2020
2121windowSize = vars .WINDOW_GEOMETRY .split ("x" )
2222newUpdaterVersion = uCore .checkNewVersion ("Updater" )
23-
24- with open (vars .VERSION_PATH , 'r' ) as f :
25- versionString = json .loads (f .read ())[vars .APP_NAME ]
23+ versionString , _ = uCore .getVersionString (vars .APP_NAME )
2624
2725root = tk .Tk ()
2826root .title (vars .APP_NAME + " " + versionString )
@@ -352,8 +350,10 @@ def _fixed_map(style, style_name, option):
352350history .column (2 , anchor = "e" )
353351history .column (3 , anchor = "e" )
354352
353+ history .tag_configure ("none" , background = vars .NONE_BG_COLOR , foreground = vars .NONE_FG_COLOR )
355354history .tag_configure ("win" , background = vars .WIN_BG_COLOR , foreground = vars .WIN_FG_COLOR )
356355history .tag_configure ("loss" , background = vars .LOSS_BG_COLOR , foreground = vars .LOSS_FG_COLOR )
356+ history .tag_configure ("draw" , background = vars .DRAW_BG_COLOR , foreground = vars .DRAW_FG_COLOR )
357357history .tag_configure ("selected" , background = vars .SELECTED_BG_COLOR , foreground = vars .SELECTED_FG_COLOR )
358358
359359# Create history Scrollbar
@@ -702,7 +702,7 @@ def updateGoals(config, plot, collectedXP):
702702 goalContainers [i ].removeBtn .configure (command = lambda j = i : gcRemoveCallback (j ))
703703 goalContainers [i ].editBtn .configure (command = lambda j = i : gcEditCallback (j ))
704704
705- def updateGraph (config , epilogue , plot ):
705+ def updateGraph (config , epilogue , drawEpilogue , plot ):
706706 plot .clear ()
707707 timeAxis = []
708708
@@ -796,7 +796,7 @@ def updateGraph(config, epilogue, plot):
796796 if totalXPCollected >= neededXP : alpha = 0.05
797797 plot .axhline (neededXP , color = "limegreen" , alpha = alpha , linestyle = "-" )
798798
799- if epilogue :
799+ if epilogue or drawEpilogue :
800800 for i in range (1 , vars .NUM_EPLOGUE_LEVELS + 1 , 1 ):
801801 alpha = 0.5
802802 neededXP = core .cumulativeSum (vars .NUM_BPLEVELS , vars .LEVEL2_OFFSET , vars .NUM_XP_PER_LEVEL ) + i * vars .NUM_EPLOGUE_XP_PER_LEVEL
@@ -818,6 +818,7 @@ def updateGraph(config, epilogue, plot):
818818
819819def updateValues ():
820820 config = core .readConfig (vars .CONFIG_PATH )
821+ drawEpilogue = False
821822
822823 totalXPProgress , totalXPCollected , totalXPRemaining , totalXPTotal = core .calcTotalValues (config , 0 )
823824
@@ -827,17 +828,20 @@ def updateValues():
827828 for g in config ["goals" ]:
828829 if g ["remaining" ] + totalXPCollected > largestGoalRemaining : largestGoalRemaining = g ["remaining" ] + totalXPCollected
829830
830- if config ["activeBPLevel" ] > 50 or largestGoalRemaining > totalXPTotal :
831+ if config ["activeBPLevel" ] > 50 :
831832 epilogueCheck .config (state = DISABLED )
832833 epilogueVar .set (1 )
833834 else :
834835 epilogueCheck .config (state = NORMAL )
836+
837+ if largestGoalRemaining > totalXPTotal :
838+ drawEpilogue = True
835839
836840 dailyProgress , dailyCollected , dailyRemaining , dailyTotal = core .calcDailyValues (config , epilogueVar .get ())
837841 if (dailyProgress > 100 ): dailyProgress = 100
838842 if (dailyRemaining < 0 ): dailyRemaining = 0
839843
840- yAxisYou , yAxisIdeal , yAxisDailyIdeal = updateGraph (config , epilogueVar .get (), graphPlot )
844+ yAxisYou , yAxisIdeal , yAxisDailyIdeal = updateGraph (config , epilogueVar .get (), drawEpilogue , graphPlot )
841845
842846 dailyBar ["value" ] = dailyProgress
843847 dailyPercentageLabel ["text" ] = str (dailyProgress ) + "%"
0 commit comments