diff --git a/bin/modpaths/Hide Ranks/blacklist.txt b/bin/modpaths/Hide Ranks/blacklist.txt deleted file mode 100644 index 17b9741..0000000 --- a/bin/modpaths/Hide Ranks/blacklist.txt +++ /dev/null @@ -1,23 +0,0 @@ -panorama\images\rank_tier_icons\pip1_psd.vtex_c -panorama\images\rank_tier_icons\pip2_psd.vtex_c -panorama\images\rank_tier_icons\pip3_psd.vtex_c -panorama\images\rank_tier_icons\pip4_psd.vtex_c -panorama\images\rank_tier_icons\pip5_psd.vtex_c -panorama\images\rank_tier_icons\pip6_psd.vtex_c -panorama\images\rank_tier_icons\pip7_psd.vtex_c -panorama\images\rank_tier_icons\rank0_psd.vtex_c -panorama\images\rank_tier_icons\rank1_psd.vtex_c -panorama\images\rank_tier_icons\rank2_psd.vtex_c -panorama\images\rank_tier_icons\rank3_psd.vtex_c -panorama\images\rank_tier_icons\rank4_psd.vtex_c -panorama\images\rank_tier_icons\rank5_psd.vtex_c -panorama\images\rank_tier_icons\rank6_psd.vtex_c -panorama\images\rank_tier_icons\rank7_psd.vtex_c -panorama\images\rank_tier_icons\rank8b_mini_psd.vtex_c -panorama\images\rank_tier_icons\rank8b_psd.vtex_c -panorama\images\rank_tier_icons\rank8c_mini_psd.vtex_c -panorama\images\rank_tier_icons\rank8c_psd.vtex_c -panorama\images\rank_tier_icons\rank8_mini_psd.vtex_c -panorama\images\rank_tier_icons\rank8_psd.vtex_c -panorama\images\rank_tier_icons\star_shadow_png.vtex_c -panorama\images\rank_tier_icons\star_yellow_png.vtex_c \ No newline at end of file diff --git a/bin/modpaths/Hide Ranks/styling.txt b/bin/modpaths/Hide Ranks/styling.txt deleted file mode 100644 index e0dd7dd..0000000 --- a/bin/modpaths/Hide Ranks/styling.txt +++ /dev/null @@ -1,8 +0,0 @@ -panorama\styles\play @@ #RankDisplayContainer {visibility: collapse;} -panorama\styles\hud\dota_hud_hero_picking_player @@ #PlayerRank {width: 0%;} -panorama\styles\dashboard_page_profile_hero_stats @@ #RankBox{visibility: collapse;} -panorama\styles\ui_rank_badge @@ .HasLeaderboardRank #RankLeaderboard{visibility: collapse;} #BackgroundFX {visibility: collapse;} -panorama\styles\dashboard_page_post_game @@ .HasLeaderboardRank #RankLeaderboard{visibility: collapse;} -panorama\styles\profile_card @@ DOTAProfileCard #RankTierContainer{visibility: collapse;} -panorama\styles\watch_live_game_row @@ .HasLeaderboardRank #RankLeaderboard{visibility: collapse;} -panorama\styles\dashboard_page_watch_live @@ .HasLeaderboardRank .RankTierContainer{visibility: collapse;} \ No newline at end of file diff --git a/bin/modpaths/Ink Shader/blacklist.txt b/bin/modpaths/Ink Shader/blacklist.txt new file mode 100644 index 0000000..e69de29 diff --git a/bin/modpaths/Ink Shader/styling.txt b/bin/modpaths/Ink Shader/styling.txt new file mode 100644 index 0000000..e69de29 diff --git a/bin/modpaths/Misc Optimization/blacklist.txt b/bin/modpaths/Misc Optimization/blacklist.txt index 760a70e..80fd155 100644 --- a/bin/modpaths/Misc Optimization/blacklist.txt +++ b/bin/modpaths/Misc Optimization/blacklist.txt @@ -64,6 +64,7 @@ particles\world_outpost\world_outpost_radiant_ambient_debris.vpcf_c particles\world_outpost\world_outpost_radiant_ambient_embers.vpcf_c particles\world_outpost\world_outpost_radiant_ambient_light.vpcf_c particles\world_outpost\world_outpost_radiant_ambient_mist.vpcf_c + #minified-illusions particles\generic_gameplay\illusion_killed_c.vpcf_c particles\generic_gameplay\illusion_killed_dust.vpcf_c diff --git a/bin/modpaths/Terrain - Sanctum of the Divine/blacklist.txt b/bin/modpaths/Terrain - Sanctum of the Divine/blacklist.txt new file mode 100644 index 0000000..e69de29 diff --git a/bin/modpaths/Terrain - Sanctum of the Divine/styling.txt b/bin/modpaths/Terrain - Sanctum of the Divine/styling.txt new file mode 100644 index 0000000..e69de29 diff --git a/gui.pyw b/gui.pyw index 2e26926..296d9f5 100644 --- a/gui.pyw +++ b/gui.pyw @@ -14,6 +14,7 @@ import traceback import threading import subprocess import tkinter as tk +from tkinter.messagebox import askyesno from functools import partial from idlelib.tooltip import Hovertip from shutil import copytree, ignore_patterns @@ -22,12 +23,13 @@ import mpaths import validatefiles import helper -version = "1.04.22" +version = "1.05.22" -# button size -btnXpad = 5 +# widget vars +btnXpad = 8 btnYpad = 8 btnW = 8 +hoverDelay = 250 patching = False checkboxes = {} @@ -91,7 +93,7 @@ class App(): # -------------------------------- widgets -------------------------------- # self.checkboxesFrame = tk.Frame(self.root) - self.checkboxesFrame.grid(row=0, column=0, sticky='w') + self.checkboxesFrame.grid(row=0, column=0, padx=btnXpad, sticky='w') self.buttonsFrame = tk.Frame(self.root) self.buttonsFrame.grid(row=1, column=0, pady=13, sticky='nsew') @@ -108,6 +110,7 @@ class App(): self.current_box.grid(row=index, column=0, sticky='w') checkboxes[self.current_box] = self.name # so checkbutton object is the key and value is string + # details label mod_path = os.path.join(mpaths.mods_dir, self.name) notes_txt = os.path.join(mod_path, 'notes.txt') if os.path.exists(notes_txt) and os.stat(notes_txt).st_size != 0: @@ -118,34 +121,52 @@ class App(): self.modLabel.bind("", partial(helper.modInfo, self.modLabel, self.name, mod_path)) self.modLabel.grid(row=index, column=1, sticky='w') + # patreon mods + color = '#E5BA78' + patreon_txt = os.path.join(mod_path, 'files\patreon.txt') + self.patreonTip = Hovertip(self.current_box, text='') + if self.name in mpaths.patreon_mods: + self.current_box.config(fg=color, activeforeground=color) + if not os.path.exists(patreon_txt): + helper.patreon_enabled = False + self.current_box.config(state='disable', disabledforeground=color) + self.patreonTip.text = 'If you are a Patreon member go download your ZIP file on #downloads in discord to enable this.' + self.patreonTip.hover_delay = hoverDelay + else: + self.patreonTip.hover_delay = 500000 + else: + self.patreonTip.hover_delay = 500000 + # Buttons self.patchBtn = tk.Button(self.buttonsFrame, text='Patch', state=tk.NORMAL, width=btnW, takefocus=False, command=lambda:threading.Thread(target=self.patcher, daemon=True).start()) - self.patchBtn.grid(row=10, column=0, pady=btnYpad, padx=btnXpad) + self.patchBtn.grid(row=10, column=0, pady=btnYpad, padx=btnXpad, sticky='w') self.helpBtn = tk.Button(self.buttonsFrame, text='Help', state=tk.NORMAL, width=btnW, takefocus=False, command=lambda:threading.Thread(target=helper.urlDispatcher(mpaths.help_url), daemon=True).start()) - self.helpBtn.grid(row=10, column=1, pady=btnYpad, padx=btnXpad) + self.helpBtn.grid(row=10, column=1, pady=btnYpad, padx=btnXpad, sticky='w') 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.updateBtn.grid(row=11, column=0, pady=btnYpad, padx=btnXpad, sticky='w') self.updateBtnTip = Hovertip(self.updateBtn, text='') 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.uninstallBtn.grid(row=11, column=1, pady=btnYpad, padx=btnXpad, sticky='w') self.versionLabel = tk.Label(self.buttonsFrame, font=("None", 8), width=20) - self.versionLabel.grid(row=12, column=0) + self.versionLabel.grid(row=12, column=0, sticky='w') + self.newVersionLabel = tk.Label(self.buttonsFrame, font=("None", 8), width=20) + self.newVersionLabel.grid(row=13, column=0, sticky='w') 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.patreonBtn.grid(row=14, column=0, pady=btnYpad, padx=btnXpad, sticky='w') 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.discordBtn.grid(row=14, column=1, pady=btnYpad, padx=btnXpad, sticky='w') 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) + self.exitBtn.grid(row=15, column=0, pady=btnYpad, padx=btnXpad, sticky='w') # Other Widget - self.consoleText = tk.Text(self.consoleFrame, wrap=tk.WORD, state=tk.DISABLED, width=72, borderwidth=2, bg="#FFFFF7", relief="groove") + self.consoleText = tk.Text(self.consoleFrame, wrap=tk.WORD, state=tk.DISABLED, width=65, borderwidth=2, bg="#FFFFF7", relief="groove") self.consoleText.grid(row=0,column=0) self.consoleText.configure(font=("Fixedsys")) - self.devLabel = tk.Label(self.consoleFrame, font=("Tahoma", 8), width=40) + self.devLabel = tk.Label(self.consoleFrame, font=("Tahoma", 8)) self.devLabel.config(text="Want to create Dota2 mods with Minify?") - self.devLabel.place(x=340,y=390) + self.devLabel.grid(row=1, column=0, sticky='e') self.devbtn = tk.Button(self.consoleFrame, text='Download Developer Version', width=22, height=1, font=("None", 7), takefocus=False, command=lambda:threading.Thread(target=helper.urlDispatcher(mpaths.dev_version), daemon=True).start()) - self.devbtn.place(x=420,y=412) + self.devbtn.grid(row=2, column=0, sticky='e') # redirects stdout and stderror to text box widget, which means print statements will not appear in the gui until these two lines are ran sys.stdout = TextRedirector(self.consoleText, "stdout") @@ -154,7 +175,7 @@ class App(): welcomeMsg() def setupSystem(self): - x = validatefiles.MyClass(checkboxes) + x = validatefiles.MyClass(checkboxes, self.root) public_methods = [method for method in dir(x) if callable(getattr(x, method)) if not method.startswith('_')] # private methods start with _ try: for method in public_methods: @@ -185,25 +206,36 @@ class App(): self.versionLabel.config(fg="#0cb6b3") self.versionLabel.config(text=f"Latest version {version}") self.updateBtnTip.text = 'You are using the latest version' - self.updateBtnTip.hover_delay = 250 + self.updateBtnTip.hover_delay = hoverDelay else: - self.updateBtn.config(state='normal') - self.versionLabel.config(fg="#DE3163") - self.versionLabel.config(text="New version available!") + self.updateBtn.config(state='normal', fg='#0cb6b3', activeforeground='#0cb6b3') self.updateBtnTip.text = '' self.updateBtnTip.hover_delay = 500000 # .text='' showing pixelated whitespace, just set hover delay to forever + + self.newVersionLabel.config(fg='red') + self.newVersionLabel.config(text=f"New version! {mpaths.latest_version_url}") + + self.versionLabel.config(fg="#0cb6b3") + self.versionLabel.config(text=f"Your version {version}") def uninstaller(self): - with open(mpaths.gameinfo_dir, "r") as file: - contents = file.readlines() - with open(mpaths.gameinfo_dir, 'w') as file: - for line in contents: - if 'minify' not in line: - file.write(line) - - 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.") + + root = tk.Tk() + root.title('Tkinter Yes/No Dialog') + root.geometry('300x150') + answer = askyesno(title='confirmation', + message='Remove all mods?') + if answer: + with open(mpaths.gameinfo_dir, "r") as file: + contents = file.readlines() + with open(mpaths.gameinfo_dir, 'w') as file: + for line in contents: + if 'minify' not in line: + file.write(line) + + 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.") # ---------------------------------------------------------------------------- # # Main # # ---------------------------------------------------------------------------- # @@ -224,6 +256,10 @@ class App(): try: # clean up previous patching data helper.cleanFolders(mpaths.build_dir, mpaths.logs_dir, mpaths.content_dir, mpaths.game_dir, mpaths.minify_dir) + + # patch playXML warning + helper.patchPlayXML(mpaths.build_dir) + styling_dictionary = {} # blacklist_dictionary = {} helper.warnings = [] @@ -231,7 +267,7 @@ class App(): blank_file_extensions = helper.getBlankFileExtensions(mpaths.blank_files_dir) # list of extensions in bin/blank-files blacklist_data = [] # path from every blacklist.txt styling_data = [] # path and style from every styling.txt - + for folder in mpaths.mods_folders: try: mod_path = os.path.join(mpaths.mods_dir, folder) @@ -242,6 +278,21 @@ class App(): for box in checkboxes: if box.var.get() == 1 and checkboxes[box] == folder: # step into folders that have ticked checkboxes only print("→ Installing " + folder) + + # temporary workaround to install patreon mods, will be refactored later. + if helper.isSanctumChecked(checkboxes): + if checkboxes[box] == 'Dark Terrain': + shutil.copytree(os.path.join(mpaths.mods_dir, 'Terrain - Sanctum of the Divine\\Dark Terrain'), mpaths.game_dir, dirs_exist_ok=True) + continue + if checkboxes[box] == 'Misc Optimization': + shutil.copytree(os.path.join(mpaths.mods_dir, 'Terrain - Sanctum of the Divine\\Misc Optimization'), mpaths.game_dir, dirs_exist_ok=True) + continue + if checkboxes[box] == 'Remove Foilage': + shutil.copytree(os.path.join(mpaths.mods_dir, 'Terrain - Sanctum of the Divine\\Remove Foilage'), mpaths.game_dir, dirs_exist_ok=True) + continue + if checkboxes[box] == 'Tree Mod': + shutil.copytree(os.path.join(mpaths.mods_dir, 'Terrain - Sanctum of the Divine\\Tree Mod'), mpaths.game_dir, dirs_exist_ok=True) + continue # ----------------------------------- files ---------------------------------- # # if files_total == 0: pass # elif files_total == 1: print(f" files: Found {files_total} file") @@ -378,7 +429,7 @@ class App(): newpak.save(os.path.join(mpaths.dota_minify, 'pak01_dir.vpk')) patching = False - helper.toggleFrameOn(self.checkboxesFrame, self.buttonsFrame, mpaths.mods_dir, mpaths.mods_folders, checkboxes) + helper.toggleFrameOn(self.checkboxesFrame, self.buttonsFrame, mpaths.mods_dir, mpaths.mods_folders, mpaths.patreon_mods, checkboxes) print("→ Done!") print("-------------------------------------------------") print("→ Remember to use dota2patcher and patch gameinfo") diff --git a/helper.py b/helper.py index be0ea87..109d3f5 100644 --- a/helper.py +++ b/helper.py @@ -7,11 +7,12 @@ from urllib.request import urlopen workshop_installed = False +patreon_enabled = None # ---------------------------------------------------------------------------- # # Warnings # # ---------------------------------------------------------------------------- # -# Output can be passed here to display as warnings at the end of patching. +# Output can be passed here to display as warnings at the end of patching. warnings = [] @@ -44,10 +45,36 @@ def patchGameInfo(gameinfo_dir): with open(gameinfo_dir, "w") as file: file.writelines(contents) break + +def patchPlayXML(build_dir): + data = [] + path = os.path.join(build_dir, 'panorama\\layout') + url = "https://raw.githubusercontent.com/SteamDatabase/GameTracking-Dota2/master/game/dota/pak01_dir/panorama/layout/play.xml" + + for line in urlopen(url): + line = line.decode('utf-8').strip() + + if '#DOTA_VAC_Verification_Header' in line: + new_line = line.replace('title', 'body').replace('#DOTA_VAC_Verification_Header', 'Minify') + data.append(new_line) + continue + + if '#dota_play_disabled_local_mods' in line: + new_line = line.replace('#dota_play_disabled_local_mods', 'Gameinfo outdated. Close Dota2 and patch gameinfo with dota2patcher.') + data.append(new_line) + continue + + data.append(line) + + if not os.path.exists(path): os.makedirs(path) + + with open(os.path.join(path, 'play.xml'), 'w') as file: + for line in data: + file.write(line) # ---------------------------------------------------------------------------- # # GUI # # ---------------------------------------------------------------------------- # -# when you add new arguments to bind in tkinter event must be the last parameter. +# when you add new arguments to bind function tkinter seems to expect event as the last argument. def modLabelColorConfig(widget, color, event): widget.configure(foreground=color) @@ -77,7 +104,21 @@ def disableWorkshopMods(mods_dir, mods_folders, checkboxes): if os.stat(styling_txt).st_size != 0: box.configure(state='disable') -def toggleFrameOn(frame_checkbox, frame_buttons, mods_dir, mods_folders, checkboxes): +# this has become a mess with redundant loops and individual checks +# next version will be focused on refactoring into a state machine + +def isSanctumChecked(checkboxes): + for box in checkboxes: + if box.var.get() == 1 and checkboxes[box] == 'Terrain - Sanctum of the Divine': + return True + +def disablePatreonMods(patreon_mods, checkboxes): + for box in checkboxes: + for mod in patreon_mods: + if checkboxes[box] == mod: + box.configure(state='disable') + +def toggleFrameOn(frame_checkbox, frame_buttons, mods_dir, mods_folders, patreon_mods, checkboxes): for widget in frame_checkbox.winfo_children(): widget.configure(state='normal') @@ -89,6 +130,9 @@ def toggleFrameOn(frame_checkbox, frame_buttons, mods_dir, mods_folders, checkbo if workshop_installed == False: disableWorkshopMods(mods_dir, mods_folders, checkboxes) + + if patreon_enabled == False: + disablePatreonMods(patreon_mods, checkboxes) def toggleFrameOff(frame_checkbox, frame_buttons): for widget in frame_checkbox.winfo_children(): @@ -101,7 +145,7 @@ def toggleFrameOff(frame_checkbox, frame_buttons): widget.configure(state='disable') def getAppHeight(mods_folders): - height = 445 + height = 460 num_of_mods = len(mods_folders) i = 10 diff --git a/logs/resourcecompiler.txt b/logs/resourcecompiler.txt index 8010feb..e69de29 100644 --- a/logs/resourcecompiler.txt +++ b/logs/resourcecompiler.txt @@ -1,6 +0,0 @@ -NvAPI initialized: NVidia Complete Version 1.10 -NVIDIA Driver Version: 516.59 r515_00 ------------------------------------------------------------------ - WARNING: 0 compiled, 0 failed, 0 skipped, 0m:00s ------------------------------------------------------------------ -ID3D11Device has 2 outstanding references indicating leaked D3D11 resources. diff --git a/mods/Dark Terrain/notes.txt b/mods/Dark Terrain/notes.txt index 472c0a8..cd7a6b5 100644 --- a/mods/Dark Terrain/notes.txt +++ b/mods/Dark Terrain/notes.txt @@ -1,4 +1,4 @@ Makes the entire floor dark tiles. -- ONLY works on default terrain you cannot use a custom terrain like desert, immortal gardens..etc +- ONLY works on default terrain and Sanctum of Divine. - You can turn on "Normal Maps" in graphics settings to make the tiles look like a grid. \ No newline at end of file diff --git a/mods/Ink Shader/blacklist.txt b/mods/Ink Shader/blacklist.txt new file mode 100644 index 0000000..e69de29 diff --git a/mods/Ink Shader/files/materials/dev/deferred_post_process.vmat_c b/mods/Ink Shader/files/materials/dev/deferred_post_process.vmat_c new file mode 100644 index 0000000..a128e0a Binary files /dev/null and b/mods/Ink Shader/files/materials/dev/deferred_post_process.vmat_c differ diff --git a/mods/Ink Shader/notes.txt b/mods/Ink Shader/notes.txt new file mode 100644 index 0000000..d2c4d34 --- /dev/null +++ b/mods/Ink Shader/notes.txt @@ -0,0 +1,3 @@ +Black outline for more detailed map and models. Check 'preview.jpg' in mods/Ink Shader + +Does not lower your FPS or affect the interface such as 3rd party software like ReShade do because I created this using Steams post processing materials. \ No newline at end of file diff --git a/mods/Ink Shader/preview.jpg b/mods/Ink Shader/preview.jpg new file mode 100644 index 0000000..0396ac5 Binary files /dev/null and b/mods/Ink Shader/preview.jpg differ diff --git a/mods/Ink Shader/styling.txt b/mods/Ink Shader/styling.txt new file mode 100644 index 0000000..e69de29 diff --git a/mods/READ_BEFORE_EDITING.txt b/mods/READ_BEFORE_EDITING.txt index 7f87907..3696888 100644 --- a/mods/READ_BEFORE_EDITING.txt +++ b/mods/READ_BEFORE_EDITING.txt @@ -1,4 +1,4 @@ -Editing files in this folder is NOT recommended because you are using the Stable version of Minify. -The Stable version is designed for patching default mods smoothly. +Editing files in this folder is not recommended because you are using the Stable version of Minify. +The Stable version is designed for patching default mods smoothly, it doesn't handle errors if you move things around. If you want to edit and create mods you can use the developer version when it's released. \ No newline at end of file diff --git a/mods/Terrain - Sanctum of the Divine/blacklist.txt b/mods/Terrain - Sanctum of the Divine/blacklist.txt new file mode 100644 index 0000000..e69de29 diff --git a/mods/Terrain - Sanctum of the Divine/notes.txt b/mods/Terrain - Sanctum of the Divine/notes.txt new file mode 100644 index 0000000..b355469 --- /dev/null +++ b/mods/Terrain - Sanctum of the Divine/notes.txt @@ -0,0 +1,5 @@ +Lets you play with Sanctum of the Divine terrain but have Minify mods applied to it (Dark Terrain + Remove Foilage + Tree Mod + Ink Shader + Misc Optimization) The result is a very minimal, clean and high performance terrain. + +To preview this terrain click the Discord button below and go to #mods channel + +To use this mod have default terrain equipped. In dota2 go to Store tab then Browse>World>Terrain and unequip any custom terrain. \ No newline at end of file diff --git a/mods/Terrain - Sanctum of the Divine/styling.txt b/mods/Terrain - Sanctum of the Divine/styling.txt new file mode 100644 index 0000000..e69de29 diff --git a/mods/Tree Mod/files/materials/default/default_color_tga_41192599.vtex_c b/mods/Tree Mod/files/materials/default/default_color_tga_41192599.vtex_c new file mode 100644 index 0000000..73ccd97 Binary files /dev/null and b/mods/Tree Mod/files/materials/default/default_color_tga_41192599.vtex_c differ diff --git a/mods/Tree Mod/files/materials/default/default_mask_tga_4528a0a9.vtex_c b/mods/Tree Mod/files/materials/default/default_mask_tga_4528a0a9.vtex_c deleted file mode 100644 index 56823ed..0000000 Binary files a/mods/Tree Mod/files/materials/default/default_mask_tga_4528a0a9.vtex_c and /dev/null differ diff --git a/mods/Tree Mod/files/materials/default/default_refl_tga_c1b9c83e.vtex_c b/mods/Tree Mod/files/materials/default/default_refl_tga_c1b9c83e.vtex_c index 392601f..8b85cbc 100644 Binary files a/mods/Tree Mod/files/materials/default/default_refl_tga_c1b9c83e.vtex_c and b/mods/Tree Mod/files/materials/default/default_refl_tga_c1b9c83e.vtex_c differ diff --git a/mods/Tree Mod/files/materials/edited_png_447c23a5.vtex_c b/mods/Tree Mod/files/materials/edited_png_447c23a5.vtex_c new file mode 100644 index 0000000..50c98b4 Binary files /dev/null and b/mods/Tree Mod/files/materials/edited_png_447c23a5.vtex_c differ diff --git a/mods/Tree Mod/files/materials/models/props_tree/topiary/tree_topiary001.vmat_c b/mods/Tree Mod/files/materials/models/props_tree/topiary/tree_topiary001.vmat_c deleted file mode 100644 index ad83b7c..0000000 Binary files a/mods/Tree Mod/files/materials/models/props_tree/topiary/tree_topiary001.vmat_c and /dev/null differ diff --git a/mods/Tree Mod/files/materials/models/props_tree/topiary/tree_topiary002_block.vmat_c b/mods/Tree Mod/files/materials/models/props_tree/topiary/tree_topiary002_block.vmat_c deleted file mode 100644 index beb48c7..0000000 Binary files a/mods/Tree Mod/files/materials/models/props_tree/topiary/tree_topiary002_block.vmat_c and /dev/null differ diff --git a/mods/Tree Mod/files/materials/tree_topiary001_color_png_a9fb0b4d.vtex_c b/mods/Tree Mod/files/materials/tree_topiary001_color_png_a9fb0b4d.vtex_c deleted file mode 100644 index 8c3dbf5..0000000 Binary files a/mods/Tree Mod/files/materials/tree_topiary001_color_png_a9fb0b4d.vtex_c and /dev/null differ diff --git a/mods/Tree Mod/files/materials/tree_topiary002.vmat_c b/mods/Tree Mod/files/materials/tree_topiary002.vmat_c new file mode 100644 index 0000000..aa8cb3f Binary files /dev/null and b/mods/Tree Mod/files/materials/tree_topiary002.vmat_c differ diff --git a/mods/Tree Mod/files/materials/tree_topiary002_block.vmat_c b/mods/Tree Mod/files/materials/tree_topiary002_block.vmat_c new file mode 100644 index 0000000..8148277 Binary files /dev/null and b/mods/Tree Mod/files/materials/tree_topiary002_block.vmat_c differ diff --git a/mods/Tree Mod/files/materials/tree_topiary002_block_color_psd_714a26b3_png_1eb56d73.vtex_c b/mods/Tree Mod/files/materials/tree_topiary002_block_color_psd_714a26b3_png_1eb56d73.vtex_c deleted file mode 100644 index e9f57e8..0000000 Binary files a/mods/Tree Mod/files/materials/tree_topiary002_block_color_psd_714a26b3_png_1eb56d73.vtex_c and /dev/null differ diff --git a/mods/Tree Mod/files/materials/tree_topiary001_normal_png_53934e1e.vtex_c b/mods/Tree Mod/files/materials/tree_topiary002_normal_psd_3f233e11_png_462c3b4b.vtex_c similarity index 99% rename from mods/Tree Mod/files/materials/tree_topiary001_normal_png_53934e1e.vtex_c rename to mods/Tree Mod/files/materials/tree_topiary002_normal_psd_3f233e11_png_462c3b4b.vtex_c index 9c2b4a4..a59dac4 100644 Binary files a/mods/Tree Mod/files/materials/tree_topiary001_normal_png_53934e1e.vtex_c and b/mods/Tree Mod/files/materials/tree_topiary002_normal_psd_3f233e11_png_462c3b4b.vtex_c differ diff --git a/mods/Tree Mod/files/materials/two_channel_noise_psd_93f8d443_png_4880cd83.vtex_c b/mods/Tree Mod/files/materials/two_channel_noise_psd_93f8d443_png_4880cd83.vtex_c deleted file mode 100644 index ef0f9da..0000000 Binary files a/mods/Tree Mod/files/materials/two_channel_noise_psd_93f8d443_png_4880cd83.vtex_c and /dev/null differ diff --git a/mods/Tree Mod/files/models/props_tree/dire_tree004.vmdl_c b/mods/Tree Mod/files/models/props_tree/dire_tree004.vmdl_c index 747c036..7fb45b8 100644 Binary files a/mods/Tree Mod/files/models/props_tree/dire_tree004.vmdl_c and b/mods/Tree Mod/files/models/props_tree/dire_tree004.vmdl_c differ diff --git a/mods/Tree Mod/files/models/props_tree/dire_tree004.vmesh_c b/mods/Tree Mod/files/models/props_tree/dire_tree004.vmesh_c index 4346552..516ad11 100644 Binary files a/mods/Tree Mod/files/models/props_tree/dire_tree004.vmesh_c and b/mods/Tree Mod/files/models/props_tree/dire_tree004.vmesh_c differ diff --git a/mods/Tree Mod/files/models/props_tree/dire_tree004b.vmdl_c b/mods/Tree Mod/files/models/props_tree/dire_tree004b.vmdl_c index 7bee487..d7e35ea 100644 Binary files a/mods/Tree Mod/files/models/props_tree/dire_tree004b.vmdl_c and b/mods/Tree Mod/files/models/props_tree/dire_tree004b.vmdl_c differ diff --git a/mods/Tree Mod/files/models/props_tree/dire_tree004b.vmesh_c b/mods/Tree Mod/files/models/props_tree/dire_tree004b.vmesh_c index 4346552..516ad11 100644 Binary files a/mods/Tree Mod/files/models/props_tree/dire_tree004b.vmesh_c and b/mods/Tree Mod/files/models/props_tree/dire_tree004b.vmesh_c differ diff --git a/mods/Tree Mod/files/models/props_tree/dire_tree007.vmdl_c b/mods/Tree Mod/files/models/props_tree/dire_tree007.vmdl_c index fccc8d2..6a92759 100644 Binary files a/mods/Tree Mod/files/models/props_tree/dire_tree007.vmdl_c and b/mods/Tree Mod/files/models/props_tree/dire_tree007.vmdl_c differ diff --git a/mods/Tree Mod/files/models/props_tree/dire_tree007.vmesh_c b/mods/Tree Mod/files/models/props_tree/dire_tree007.vmesh_c index 0dad22c..516ad11 100644 Binary files a/mods/Tree Mod/files/models/props_tree/dire_tree007.vmesh_c and b/mods/Tree Mod/files/models/props_tree/dire_tree007.vmesh_c differ diff --git a/mods/Tree Mod/files/models/props_tree/dire_tree008.vmdl_c b/mods/Tree Mod/files/models/props_tree/dire_tree008.vmdl_c index 9480555..ff4b8a1 100644 Binary files a/mods/Tree Mod/files/models/props_tree/dire_tree008.vmdl_c and b/mods/Tree Mod/files/models/props_tree/dire_tree008.vmdl_c differ diff --git a/mods/Tree Mod/files/models/props_tree/dire_tree008.vmesh_c b/mods/Tree Mod/files/models/props_tree/dire_tree008.vmesh_c index 4346552..516ad11 100644 Binary files a/mods/Tree Mod/files/models/props_tree/dire_tree008.vmesh_c and b/mods/Tree Mod/files/models/props_tree/dire_tree008.vmesh_c differ diff --git a/mods/Tree Mod/files/models/props_tree/tree_bamboo_01.vmdl_c b/mods/Tree Mod/files/models/props_tree/tree_bamboo_01.vmdl_c index 02b6903..d72e0d3 100644 Binary files a/mods/Tree Mod/files/models/props_tree/tree_bamboo_01.vmdl_c and b/mods/Tree Mod/files/models/props_tree/tree_bamboo_01.vmdl_c differ diff --git a/mods/Tree Mod/files/models/props_tree/tree_bamboo_01.vmesh_c b/mods/Tree Mod/files/models/props_tree/tree_bamboo_01.vmesh_c index 4ef0212..89e89fd 100644 Binary files a/mods/Tree Mod/files/models/props_tree/tree_bamboo_01.vmesh_c and b/mods/Tree Mod/files/models/props_tree/tree_bamboo_01.vmesh_c differ diff --git a/mods/Tree Mod/files/models/props_tree/tree_bamboo_02.vmdl_c b/mods/Tree Mod/files/models/props_tree/tree_bamboo_02.vmdl_c index 7b4eb15..9b566e5 100644 Binary files a/mods/Tree Mod/files/models/props_tree/tree_bamboo_02.vmdl_c and b/mods/Tree Mod/files/models/props_tree/tree_bamboo_02.vmdl_c differ diff --git a/mods/Tree Mod/files/models/props_tree/tree_bamboo_02.vmesh_c b/mods/Tree Mod/files/models/props_tree/tree_bamboo_02.vmesh_c index 4346552..516ad11 100644 Binary files a/mods/Tree Mod/files/models/props_tree/tree_bamboo_02.vmesh_c and b/mods/Tree Mod/files/models/props_tree/tree_bamboo_02.vmesh_c differ diff --git a/mods/Tree Mod/files/models/props_tree/tree_cine_00_low.vmdl_c b/mods/Tree Mod/files/models/props_tree/tree_cine_00_low.vmdl_c index 3c45718..4464c05 100644 Binary files a/mods/Tree Mod/files/models/props_tree/tree_cine_00_low.vmdl_c and b/mods/Tree Mod/files/models/props_tree/tree_cine_00_low.vmdl_c differ diff --git a/mods/Tree Mod/files/models/props_tree/tree_cine_00_low.vmesh_c b/mods/Tree Mod/files/models/props_tree/tree_cine_00_low.vmesh_c index 2d0c527..516ad11 100644 Binary files a/mods/Tree Mod/files/models/props_tree/tree_cine_00_low.vmesh_c and b/mods/Tree Mod/files/models/props_tree/tree_cine_00_low.vmesh_c differ diff --git a/mods/Tree Mod/files/models/props_tree/tree_cine_02_low.vmdl_c b/mods/Tree Mod/files/models/props_tree/tree_cine_02_low.vmdl_c index 666c2d6..c2e55fa 100644 Binary files a/mods/Tree Mod/files/models/props_tree/tree_cine_02_low.vmdl_c and b/mods/Tree Mod/files/models/props_tree/tree_cine_02_low.vmdl_c differ diff --git a/mods/Tree Mod/files/models/props_tree/tree_cine_02_low.vmesh_c b/mods/Tree Mod/files/models/props_tree/tree_cine_02_low.vmesh_c index 49dcc6e..d4aaa7a 100644 Binary files a/mods/Tree Mod/files/models/props_tree/tree_cine_02_low.vmesh_c and b/mods/Tree Mod/files/models/props_tree/tree_cine_02_low.vmesh_c differ diff --git a/mods/Tree Mod/files/models/props_tree/tree_oak_01.vmdl_c b/mods/Tree Mod/files/models/props_tree/tree_oak_01.vmdl_c index d16c858..37dcaeb 100644 Binary files a/mods/Tree Mod/files/models/props_tree/tree_oak_01.vmdl_c and b/mods/Tree Mod/files/models/props_tree/tree_oak_01.vmdl_c differ diff --git a/mods/Tree Mod/files/models/props_tree/tree_oak_01.vmesh_c b/mods/Tree Mod/files/models/props_tree/tree_oak_01.vmesh_c index 2d0c527..ab0f7e0 100644 Binary files a/mods/Tree Mod/files/models/props_tree/tree_oak_01.vmesh_c and b/mods/Tree Mod/files/models/props_tree/tree_oak_01.vmesh_c differ diff --git a/mods/Tree Mod/files/models/props_tree/tree_oak_01b.vmdl_c b/mods/Tree Mod/files/models/props_tree/tree_oak_01b.vmdl_c index 8212cf5..ee1fbc4 100644 Binary files a/mods/Tree Mod/files/models/props_tree/tree_oak_01b.vmdl_c and b/mods/Tree Mod/files/models/props_tree/tree_oak_01b.vmdl_c differ diff --git a/mods/Tree Mod/files/models/props_tree/tree_oak_01b.vmesh_c b/mods/Tree Mod/files/models/props_tree/tree_oak_01b.vmesh_c index c6294b8..ab0f7e0 100644 Binary files a/mods/Tree Mod/files/models/props_tree/tree_oak_01b.vmesh_c and b/mods/Tree Mod/files/models/props_tree/tree_oak_01b.vmesh_c differ diff --git a/mods/Tree Mod/files/models/props_tree/tree_oak_02.vmdl_c b/mods/Tree Mod/files/models/props_tree/tree_oak_02.vmdl_c index 0435bf0..611f543 100644 Binary files a/mods/Tree Mod/files/models/props_tree/tree_oak_02.vmdl_c and b/mods/Tree Mod/files/models/props_tree/tree_oak_02.vmdl_c differ diff --git a/mods/Tree Mod/files/models/props_tree/tree_oak_02.vmesh_c b/mods/Tree Mod/files/models/props_tree/tree_oak_02.vmesh_c index 2d0c527..ab0f7e0 100644 Binary files a/mods/Tree Mod/files/models/props_tree/tree_oak_02.vmesh_c and b/mods/Tree Mod/files/models/props_tree/tree_oak_02.vmesh_c differ diff --git a/mods/Tree Mod/files/models/props_tree/tree_pine_01.vmdl_c b/mods/Tree Mod/files/models/props_tree/tree_pine_01.vmdl_c index 781e0c4..7a81320 100644 Binary files a/mods/Tree Mod/files/models/props_tree/tree_pine_01.vmdl_c and b/mods/Tree Mod/files/models/props_tree/tree_pine_01.vmdl_c differ diff --git a/mods/Tree Mod/files/models/props_tree/tree_pine_01.vmesh_c b/mods/Tree Mod/files/models/props_tree/tree_pine_01.vmesh_c index 4346552..516ad11 100644 Binary files a/mods/Tree Mod/files/models/props_tree/tree_pine_01.vmesh_c and b/mods/Tree Mod/files/models/props_tree/tree_pine_01.vmesh_c differ diff --git a/mods/Tree Mod/files/models/props_tree/tree_pine_02.vmdl_c b/mods/Tree Mod/files/models/props_tree/tree_pine_02.vmdl_c index 5192ccc..43f4d7b 100644 Binary files a/mods/Tree Mod/files/models/props_tree/tree_pine_02.vmdl_c and b/mods/Tree Mod/files/models/props_tree/tree_pine_02.vmdl_c differ diff --git a/mods/Tree Mod/files/models/props_tree/tree_pine_02.vmesh_c b/mods/Tree Mod/files/models/props_tree/tree_pine_02.vmesh_c index 4346552..516ad11 100644 Binary files a/mods/Tree Mod/files/models/props_tree/tree_pine_02.vmesh_c and b/mods/Tree Mod/files/models/props_tree/tree_pine_02.vmesh_c differ diff --git a/mods/Tree Mod/files/models/props_tree/tree_pine_03b.vmdl_c b/mods/Tree Mod/files/models/props_tree/tree_pine_03b.vmdl_c index fafa6c7..8ee93d1 100644 Binary files a/mods/Tree Mod/files/models/props_tree/tree_pine_03b.vmdl_c and b/mods/Tree Mod/files/models/props_tree/tree_pine_03b.vmdl_c differ diff --git a/mods/Tree Mod/files/models/props_tree/tree_pine_03b.vmesh_c b/mods/Tree Mod/files/models/props_tree/tree_pine_03b.vmesh_c index 4346552..516ad11 100644 Binary files a/mods/Tree Mod/files/models/props_tree/tree_pine_03b.vmesh_c and b/mods/Tree Mod/files/models/props_tree/tree_pine_03b.vmesh_c differ diff --git a/mods/Tree Mod/notes.txt b/mods/Tree Mod/notes.txt index 8e5b2d9..bc80680 100644 --- a/mods/Tree Mod/notes.txt +++ b/mods/Tree Mod/notes.txt @@ -1,6 +1,6 @@ -Turns all trees to small green square bushes +Turns all trees to small circle bushes -- ONLY works on default terrain you cannot use a custom terrain like desert, immortal gardens..etc -- shows juke paths and improves GPU performance since these trees don't use as much geometry as default ones. +- ONLY works on default terrain and Sanctum of the Divine +- shows juke paths and improves GPU performance since these trees use far less geometry then original ones. I plan to add tree mod to all maps in the future. \ No newline at end of file diff --git a/mpaths.py b/mpaths.py index 6d167d9..684ab44 100644 --- a/mpaths.py +++ b/mpaths.py @@ -3,7 +3,6 @@ import traceback from urllib.request import urlopen -# get steam installation from registry try: hkey = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\WOW6432Node\Valve\Steam") except Exception as exception: @@ -23,6 +22,30 @@ except: steam_dir = "" +# when dota2 is not inside Steam folder then set new steam directory from 'dota2path_minify.txt +# this text file is created and set by the user in validatefiles.py during startup +if not os.path.exists(os.path.join(steam_dir, 'common\dota 2 beta\game\bin\win64\dota2.exe')): + documents = os.path.join(os.path.expanduser('~'), 'Documents') + path_file = os.path.join(documents, 'dota2path_minify.txt') + + # make sure the text file exists + if not os.path.exists(path_file): + with open(path_file,'a+') as file: + file.write('') + + # load the path from text file + with open(path_file, 'r') as file: + for line in file: + steam_dir = line.strip() + +# minify project paths +minify_dir = os.getcwd() +bin_dir = os.path.join(minify_dir, "bin") +blank_files_dir = os.path.join(bin_dir, "blank-files") +build_dir = os.path.join(minify_dir, "build") +mods_dir = os.path.join(minify_dir, "mods") +logs_dir = os.path.join(minify_dir, "logs") + # configure urls remotely urls = [] for line in urlopen('https://raw.githubusercontent.com/robbyz512/dota2-minify/master/bin/modpaths/urls.txt'): @@ -36,14 +59,6 @@ latest_version_url = urls[4][1] dev_version = urls[5][1] -# minify project paths -minify_dir = os.getcwd() -bin_dir = os.path.join(minify_dir, "bin") -blank_files_dir = os.path.join(bin_dir, "blank-files") -build_dir = os.path.join(minify_dir, "build") -mods_dir = os.path.join(minify_dir, "mods") -logs_dir = os.path.join(minify_dir, "logs") - # dota2 paths content_dir = os.path.join(steam_dir, "steamapps\\common\\dota 2 beta\\content\\dota_addons\\minify") game_dir = os.path.join(steam_dir, "steamapps\\common\\dota 2 beta\\game\\dota_addons\\minify") @@ -56,17 +71,20 @@ enabled_mods = ['Auto Accept Match', 'Dark Terrain', 'Default Menu Background', - # 'Hide Ranks', + 'Ink Shader', 'Minify HUD', 'Minify Spells & Items', 'Misc Optimization', 'Remove Battlepass Sounds', 'Remove Foilage', 'Remove Pinging', - 'Remove Sprays', - # 'Testing', - 'Tree Mod'] + 'Remove Sprays', + 'Terrain - Sanctum of the Divine', + 'Tree Mod', + ] + +patreon_mods = ['Terrain - Sanctum of the Divine'] mods_folders = [] -for mod in os.listdir(mods_dir): mods_folders.append(mod) +for mod in os.listdir(mods_dir): mods_folders.append(mod) mods_folders = [p for p in mods_folders if p in enabled_mods] \ No newline at end of file diff --git a/validatefiles.py b/validatefiles.py index 9b2373b..5b8cd96 100644 --- a/validatefiles.py +++ b/validatefiles.py @@ -2,45 +2,69 @@ import psutil import helper import mpaths +import tkinter as tk +from tkinter import messagebox +from tkinter import filedialog + +def setFolder(main_window): + dialog_root = tk.Tk() + dialog_root.withdraw() + folder = filedialog.askdirectory() + with open(mpaths.path_file, 'w') as file: file.write(folder) + messagebox.showinfo("","Path saved, go start Minify again.") + main_window.destroy() # this class is called with getattr method and calls all functions here alphabetically # use naming convention (a_, b_, c_ ...etc) to run this class top to bottom if order mattters class MyClass: - def __init__(self, checkboxes): + def __init__(self, checkboxes, main_window): self.checkboxes = checkboxes self.toggle_flag = False + self.main_window = main_window def a_isSteamFound(self): if mpaths.steam_dir == "": mpaths.toggle_flag = True print("Error: 'Steam is not installed on this system.") + + def b_isDotaInstallFound(self): + dota2path = os.path.join(mpaths.steam_dir, "steamapps\\common\\dota 2 beta\\game\\bin\\win64\\dota2.exe") + + if not os.path.exists(dota2path): + self.toggle_flag = True + + message_root = tk.Tk() + message_root.withdraw() + messagebox.showinfo("",f"Dota2 not found in '{dota2path}' ---- Select where your 'SteamLibrary' folder is. For example 'D:\SteamLibrary'") + message_root.destroy() + setFolder(self.main_window) - def b_isMinifyFolderPresent(self): + def c_isMinifyFolderPresent(self): if not os.path.exists(mpaths.dota_minify): os.makedirs(mpaths.dota_minify) - def c_isGameinfoPatched(self): + def d_isGameinfoPatched(self): with open(mpaths.gameinfo_dir, 'r') as file: if helper.l1 and helper.l2 not in file.read(): helper.patchGameInfo(mpaths.gameinfo_dir) - def d_isDotaRunning(self): + def e_isDotaRunning(self): if "dota2.exe" in (p.name() for p in psutil.process_iter()): self.toggle_flag = True print("Error: Please close Dota 2 and restart Minify.") - def e_isDecompilerFound(self): + def f_isDecompilerFound(self): if not os.path.exists(os.path.join(mpaths.minify_dir, 'Decompiler.exe')): self.toggle_flag = True print("Error: 'Decompiler.exe' not found, click Help for instructions.") - def f_isDllFound(self): + def g_isDllFound(self): if not os.path.exists(os.path.join(mpaths.minify_dir, 'libSkiaSharp.dll')): self.toggle_flag = True print("Error: 'libSkiaSharp.dll' not found, click Help for instructions.") - def g_isCompillerFound(self): + def h_isCompillerFound(self): if not os.path.exists(mpaths.resource_compiler): helper.workshop_installed == False print("Styling mods have been disabled.") @@ -48,7 +72,7 @@ def g_isCompillerFound(self): else: helper.workshop_installed = True - def h_verifyMods(self): + def i_verifyMods(self): for folder in mpaths.mods_folders: mod_path = os.path.join(mpaths.mods_dir, folder)