Skip to content

Commit 3424e09

Browse files
authored
Merge pull request #1 from BitTim/v1.6
v1.6
2 parents 6ed3d0d + e86abef commit 3424e09

File tree

15 files changed

+912
-264
lines changed

15 files changed

+912
-264
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# VexTrack
22

3-
![Status badge](https://img.shields.io/badge/Status-Stable-green?style=for-the-badge "Development Status") [![Language badge](https://img.shields.io/badge/Language-Python_3.8.2-inactive?logo=python&logoColor=ffffff&style=for-the-badge)](https://python.org "Language")
3+
![Status badge](https://img.shields.io/badge/Status-Stable-green?style=for-the-badge "Development Status") [![Language badge](https://img.shields.io/badge/Language-Python_3.9.6-inactive?logo=python&logoColor=ffffff&style=for-the-badge)](https://python.org "Language")
44
![GitHub License](https://img.shields.io/github/license/BitTim/ValorantXPCalc?logo=github&style=for-the-badge "License")
55
![GitHub repo size](https://img.shields.io/github/repo-size/BitTim/ValorantXPCalc?logo=github&style=for-the-badge) ![GitHub contributors](https://img.shields.io/github/contributors/BitTim/ValorantXPCalc?logo=github&style=for-the-badge "Contributors") ![GitHub last commit (branch)](https://img.shields.io/github/last-commit/BitTim/ValorantXPCalc?logo=github&style=for-the-badge "Last commit")
66

VexTrack.png

264 KB
Loading

src/VexTrack.py

Lines changed: 514 additions & 179 deletions
Large diffs are not rendered by default.

src/vars.py

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
NUM_EPLOGUE_XP_PER_LEVEL = 36500
66

77
LEVEL2_OFFSET = 500
8-
BUFFER_DAYS = 8
98

10-
CONFIG_PATH = "dat/config.json"
9+
DATA_PATH = "dat/data.json"
10+
SETTINGS_PATH = "dat/settings.json"
11+
OLD_DATA_PATH = "dat/config.json"
12+
1113
UPDATER_PATH = "Updater.exe"
1214
VERSION_PATH = "version.json"
1315
OLD_VERSION_PATH = "version"
@@ -23,13 +25,22 @@
2325
LEGACY_LAST_APP = 1.4
2426
LEGACY_LAST_UPDATER = 1.15
2527

26-
NONE_BG_COLOR = "#939393"
27-
NONE_FG_COLOR = "#000000"
28-
WIN_BG_COLOR = "#AFE0D2"
29-
WIN_FG_COLOR = "#000000"
30-
LOSS_BG_COLOR = "#F7AAA8"
31-
LOSS_FG_COLOR = "#000000"
32-
DRAW_BG_COLOR = "#C3C3C3"
33-
DRAW_FG_COLOR = "#000000"
34-
SELECTED_BG_COLOR = "#0078D7"
35-
SELECTED_FG_COLOR = "#FFFFFF"
28+
# ================================
29+
# Default Settings
30+
# ================================
31+
32+
DEFAULT_BUFFER_DAYS = 8
33+
DEFAULT_USE_HISTORY_COLORS = 1
34+
DEFAULT_IGNORE_INACTIVE_DAYS = 0
35+
36+
DEFAULT_NONE_BG_COLOR = "#939393"
37+
DEFAULT_WIN_BG_COLOR = "#AFE0D2"
38+
DEFAULT_LOSS_BG_COLOR = "#F7AAA8"
39+
DEFAULT_DRAW_BG_COLOR = "#C3C3C3"
40+
DEFAULT_SELECTED_BG_COLOR = "#0078D7"
41+
42+
DEFAULT_NONE_FG_COLOR = "#000000"
43+
DEFAULT_WIN_FG_COLOR = "#000000"
44+
DEFAULT_LOSS_FG_COLOR = "#000000"
45+
DEFAULT_DRAW_FG_COLOR = "#000000"
46+
DEFAULT_SELECTED_FG_COLOR = "#FFFFFF"

src/vextrackLib/aboutDiag.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from tkinter import *
2+
from tkinter import ttk
3+
from vars import *
4+
5+
class AboutDiag(Toplevel):
6+
def __init__(self, parent, title, versionString, updaterVersionString):
7+
super().__init__(parent)
8+
self.title(title)
9+
self.transient()
10+
self.iconbitmap("VexTrack.exe")
11+
self.resizable(False, False)
12+
13+
self.img = PhotoImage(file="VexTrack.png")
14+
self.img = self.img.subsample(4, 4)
15+
Label(self, image=self.img).grid(padx=8, pady=8, row=0, sticky="nswe", columnspan=2)
16+
17+
ttk.Label(self, text="VexTrack", font=('TkDefaultFont', 16,'bold')).grid(columnspan=2, row=1)
18+
19+
ttk.Label(self, text="Version:").grid(column=0, row=2)
20+
ttk.Label(self, text=versionString).grid(column=1, row=2)
21+
ttk.Label(self, text="Updater Version:").grid(column=0, row=3)
22+
ttk.Label(self, text=updaterVersionString).grid(column=1, row=3)
23+
24+
ttk.Label(self, text="").grid(columnspan=2, row=4)
25+
ttk.Label(self, text="Created by BitTim").grid(columnspan=2, row=5)
26+
ttk.Label(self, text="https://github.com/BitTim/VexTrack").grid(columnspan=2, row=6)
27+
ttk.Label(self, text="").grid(columnspan=2, row=7)

src/vextrackLib/addGoalDiag.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from tkinter import *
2-
from tkinter import simpledialog, messagebox, ttk, colorchooser
2+
from tkinter import simpledialog, messagebox, ttk
3+
from vextrackLib import colorButton
34

45
class AddGoalDiag(simpledialog.Dialog):
56
def __init__(self, parent, title, name=None, amount=None, color="#FF0000", edit=False):
@@ -11,8 +12,7 @@ def __init__(self, parent, title, name=None, amount=None, color="#FF0000", edit=
1112
super().__init__(parent, title)
1213

1314
def changeColor(self):
14-
self.color = colorchooser.askcolor(title="Choose Color", color=self.color)[1]
15-
self.colorPreview.configure(bg=self.color)
15+
self.color = self.colorBtn.color
1616

1717
def body(self, frame):
1818
self.iconbitmap("VexTrack.exe")
@@ -30,11 +30,9 @@ def body(self, frame):
3030
if self.xpAmount != None: self.xpAmountBox.insert(0, self.xpAmount)
3131

3232
ttk.Label(frame, text="Color").grid(padx=8, pady=4, column=0, row=2, sticky="w")
33-
self.colorPreview = Frame(frame, width=16, height=16, bg=self.color)
34-
self.colorPreview.grid(padx=8, pady=4, column=1, row=2, sticky="w")
3533

36-
colorBtn = ttk.Button(frame, text="Change Color", command=self.changeColor)
37-
colorBtn.grid(padx=8, pady=4, column=2, row=2, sticky="e")
34+
self.colorBtn = colorButton.ColorButton(frame, color=self.color, command=self.changeColor)
35+
self.colorBtn.grid(padx=8, pady=4, column=2, row=2, sticky="we")
3836

3937
self.changeStartXPVar = IntVar()
4038

src/vextrackLib/colorButton.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
from tkinter import *
2+
from tkinter import colorchooser
3+
4+
class ColorButton(Frame):
5+
def __init__(self, container, color="#ff0000", command=None, *args, **kwargs):
6+
super().__init__(container, *args, **kwargs)
7+
self.color = color
8+
self.command = command
9+
self.hovering = False
10+
self.configure(bg=self.color)
11+
12+
self.configure(width=16, height=16)
13+
14+
self.bind("<Button-1>", self.onClick)
15+
self.bind("<Enter>", lambda event: self.setHover(True))
16+
self.bind("<Leave>", lambda event: self.setHover(False))
17+
18+
def setHover(self, state):
19+
self.hovering = state
20+
21+
def onClick(self, event):
22+
color = colorchooser.askcolor(title="Select Color", color=self.color)[1]
23+
if color != None:
24+
self.color = color
25+
self.configure(bg=self.color)
26+
27+
if self.command != None: self.command()
28+
29+
def setValues(self, color=None, command=None):
30+
if command != None: self.command = command
31+
if color != None:
32+
self.color = color
33+
self.configure(bg=self.color)

0 commit comments

Comments
 (0)