Skip to content

Commit

Permalink
Added uninstaller button
Browse files Browse the repository at this point in the history
  • Loading branch information
robbyz512 committed Sep 3, 2022
1 parent 1760aa3 commit 41a8098
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bin/modpaths/urls.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ update_url=https://github.com/robbyz512/dota2-minify/releases
discord_url=https://discord.gg/2YDnqpbcKM
patreon_url=https://www.patreon.com/minify
help_url=https://github.com/robbyz512/dota2-minify#rocket-installation
latest_version_url=1.01.22
latest_version_url=1.02.22
dev_version=https://github.com/robbyz512/dota2-minify#books-developing-your-own-mods
16 changes: 13 additions & 3 deletions gui.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import mpaths
import validatefiles
import helper

version = "1.01.22"
version = "1.02.22"

# button size
btnXpad = 5
Expand Down Expand Up @@ -118,14 +118,16 @@ class App():
self.updateBtn = tk.Button(self.buttonsFrame, text='Update', state=tk.NORMAL, width=btnW, takefocus=False, command=lambda:threading.Thread(target=helper.urlDispatcher(mpaths.update_url), daemon=True).start())
self.updateBtn.grid(row=11, column=0, pady=btnYpad, padx=btnXpad)
self.updateBtnTip = Hovertip(self.updateBtn, text='')
self.exitBtn = tk.Button(self.buttonsFrame, text='Exit', width=btnW, takefocus=False, command=self.exit)
self.exitBtn.grid(row=11, column=1, pady=btnYpad, padx=btnXpad)
self.uninstallBtn = tk.Button(self.buttonsFrame, text='Uninstall', width=btnW, takefocus=False, command=lambda:threading.Thread(target=self.uninstaller, daemon=True).start())
self.uninstallBtn.grid(row=11, column=1, pady=btnYpad, padx=btnXpad)
self.versionLabel = tk.Label(self.buttonsFrame, font=("None", 8), width=20)
self.versionLabel.grid(row=12, column=0)
self.patreonBtn = tk.Button(self.buttonsFrame, text='Patreon', width=btnW, takefocus=False, command=lambda:threading.Thread(target=helper.urlDispatcher(mpaths.patreon_url), daemon=True).start())
self.patreonBtn.grid(row=14, column=0, pady=btnYpad, padx=btnXpad)
self.discordBtn = tk.Button(self.buttonsFrame, text='Discord', width=btnW, takefocus=False, command=lambda:threading.Thread(target=helper.urlDispatcher(mpaths.discord_url), daemon=True).start())
self.discordBtn.grid(row=14, column=1, pady=btnYpad, padx=btnXpad)
self.exitBtn = tk.Button(self.buttonsFrame, text='Exit', width=btnW, takefocus=False, command=self.exit)
self.exitBtn.grid(row=15, column=0, pady=btnYpad, padx=btnXpad)

# Other Widget
self.consoleText = tk.Text(self.consoleFrame, wrap=tk.WORD, state=tk.DISABLED, width=78, borderwidth=2, bg="#FFFFF7", relief="groove")
Expand Down Expand Up @@ -182,6 +184,14 @@ class App():
self.versionLabel.config(text="New version available!")
self.updateBtnTip.text = ''
self.updateBtnTip.hover_delay = 500000 # .text='' showing pixelated whitespace, just set hover delay to forever

def uninstaller(self):
fullPath = os.path.join(mpaths.dota_minify, 'pak01_dir.vpk')
if os.path.exists(fullPath):
os.remove(fullPath)
print("All Minify mods have been removed from '{}'".format(fullPath))
else:
print("No Minify mods are installed.")
# ---------------------------------------------------------------------------- #
# Main #
# ---------------------------------------------------------------------------- #
Expand Down
2 changes: 1 addition & 1 deletion helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def toggleFrameOff(frame_checkbox, frame_buttons):
widget.configure(state='disable')

def getAppHeight(mods_folders):
height = 420
height = 465

num_of_mods = len(mods_folders)
i = 10
Expand Down

0 comments on commit 41a8098

Please sign in to comment.