Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
OhRetro committed Mar 5, 2022
1 parent 4ba08b9 commit 913462b
Showing 1 changed file with 43 additions and 16 deletions.
59 changes: 43 additions & 16 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Roblox Tweaker
_version = "2.0" # WIP
_version = "2.0"

#Imports
from oreto_utils import Terminal
Expand All @@ -13,10 +13,7 @@ class RobloxTweaker():
def __init__(self):
Terminal.title(f"Roblox Tweaker v{_version}")
Terminal.clear()

self.dialog = Tk()
self.dialog.withdraw()


self.dectect_os()

_platform_content = "/PlatformContent/pc"
Expand All @@ -28,7 +25,7 @@ def __init__(self):
self.roblox_version_file = File("roblox-version-folder")

if not self.roblox_version_file.exists():
self.write_path_file()
self.write_rversion_path_file()
if self.roblox_version_file.exists:
self._rvf_r = self.roblox_version_file.read()

Expand All @@ -39,6 +36,7 @@ def menu(self):
print(f"Roblox Tweaker v{_version} | OS: {self.user_os}\n")
print("What do you want to do?\n")
print("[D]elete Textures\n[U]pdate Roblox Version Folder Path\n[E]xit\n")
if self.user_os == "Linux": print("Update [G]rapejuice Prefix\n")
print(f"Current Roblox Version Folder Path:\n{self._rvf_r}\n")
_selected_option = input(">")

Expand All @@ -47,8 +45,12 @@ def menu(self):
elif _selected_option in ["U", "u", "2"]:
self.update_rvf_path()
elif _selected_option in ["E", "e", "3"]:
Terminal.clear()
exit(0)

elif self.user_os == "Linux" and _selected_option in ["G", "g", 4]:
self.update_gjp()
else:
Terminal.clear()

def delete_textures(self):
if not self.roblox_version_file.exists():
Expand All @@ -68,32 +70,57 @@ def delete_textures(self):
print("[There is no textures available to delete.]\n")

def update_rvf_path(self):
_updated = self.write_path_file()
_updated = self.write_rversion_path_file()
Terminal.clear()
if _updated: print("[Updated]\n")
else: print("[Operation Canceled]\n")

def update_gjp(self):
_updated = self.write_prefix_file()
Terminal.clear()
if _updated: print("[Updated]\n")
else: print("[Operation Canceled]\n")

def dectect_os(self):
if os_name == "nt":
self._roblox_versions_path = os_environ["LocalAppData"]+"/Roblox/Versions"
self.user_os = "Windows"
self.select_directory_message = "Select the Version Folder of Roblox."
self._roblox_versions_path = os_environ["LocalAppData"]+"/Roblox/Versions"

elif os_name == "posix":
self._roblox_versions_path = os_environ["HOME"]+"/.local/share/grapejuice/prefixes"
self.user_os = "Linux"
self.select_directory_message = "Search within the roblox prefix you are using for the roblox version folder."
self._grapejuice_prefixes_path = os_environ["HOME"]+"/.local/share/grapejuice/prefixes"

self.grapejuice_prefix_file = File("grapejuice-prefix")

if not self.grapejuice_prefix_file.exists():
self.write_prefix_file()
if self.grapejuice_prefix_file.exists:
self._gjp_r = self.grapejuice_prefix_file.read()

self._roblox_versions_path = f"{self._gjp_r}/drive_c/Program Files (x86)/Roblox/Versions"

def select_directory(self, title, initialdir):
dialog = Tk()
dialog.withdraw()

def select_directory(self):
return filedialog.askdirectory(title=self.select_directory_message, initialdir=self._roblox_versions_path, parent=self.dialog)
return filedialog.askdirectory(title=title, initialdir=initialdir, parent=dialog)

def write_path_file(self):
self.roblox_version_path = self.select_directory()
def write_rversion_path_file(self):
self.roblox_version_path = self.select_directory("Select a Roblox Version Folder.", self._roblox_versions_path)
if type(self.roblox_version_path) == tuple:
return False

self.roblox_version_file.write(self.roblox_version_path)
return True

def write_prefix_file(self):
self._grapejuice_prefix_path = self.select_directory("Select a prefix", self._grapejuice_prefixes_path)
if type(self._grapejuice_prefix_path) == tuple:
return False

self.grapejuice_prefix_file.write(self._grapejuice_prefix_path)
return True


if __name__ == "__main__":
RobloxTweaker()

0 comments on commit 913462b

Please sign in to comment.