Skip to content

Commit

Permalink
Fix Ryujinx Ava, Ryujinx Switch, Add New buttons etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxLastBreath committed Nov 28, 2023
1 parent b924330 commit 84a19b5
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 20 deletions.
Binary file removed src/GUI/MasteruSwordu.png
Binary file not shown.
Binary file added src/GUI/support.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/GUI/support_active.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 24 additions & 4 deletions src/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ def select_yuzu_exe(self):
filetypes=[("Executable files", "*.exe"), ("All Files", "*.*")]
)
executable_name = yuzu_path
if executable_name.endswith("Ryujinx.exe"):
if executable_name.endswith("Ryujinx.exe") or executable_name.endswith("Ryujinx.Ava.exe"):
if self.mode == "Yuzu":
self.switchmode("true")
if executable_name.endswith("yuzu.exe"):
Expand Down Expand Up @@ -1043,10 +1043,30 @@ def run_tasks():
task
time.sleep(0.05)
progress_window.destroy()
message = (f"MODS HAVE BEEN APPLIED!\n\n"

message = (f"MODS HAVE BEEN APPLIED!\n"
f"If you like TOTK Optimizer\n"
f"And the UltraCam Mod.\n"
f"Feel free to check out my Kofi.\n"
)
dialog = CustomDialog(self, "TOTK Optimizer Tasks Completed", message, "Donate", "No Thanks", width=300, height=200)
# Kofi button.
element_1 = self.on_canvas.Photo_Image(
image_path="support.png",
width=70, height=48,
)

element_2 = self.on_canvas.Photo_Image(
image_path="support_active.png",
width=70, height=48,
)

dialog = CustomDialog(self, "TOTK Optimizer Tasks Completed",
message,
yes_img_1=element_1,
yes_img_2=element_2,
custom_no="No Thanks",
width=300,
height=200
)
dialog.wait_window()
if dialog.result:
self.open_browser("kofi")
Expand Down
38 changes: 22 additions & 16 deletions src/modules/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,6 @@ def image_Button(self, canvas,
image_path=new_item_path,
width=img_1.width(), height=img_1.height(),
)


return tag_1, tag_2

def set_image(self, canvas,
Expand Down Expand Up @@ -470,7 +468,7 @@ def effect(self, canvas, img_list=list):
break

class CustomDialog(ttk.Toplevel):
def __init__(self, parent, title, message, custom_yes, custom_no, width, height):
def __init__(self, parent, title, message, custom_yes = str, custom_no = str, yes_img_1 = None, yes_img_2=None, width = int, height = int):
super().__init__(parent)
self.result = None
self.title(title)
Expand Down Expand Up @@ -498,34 +496,42 @@ def __init__(self, parent, title, message, custom_yes, custom_no, width, height)
self.on_canvas.create_label(
master=self, canvas=canvas,
text=message, font=("bahnschrift", 15), color=textcolor,
row=65, cul=width // 2, anchor="c", justify="center",
row=10, anchor="nw", justify="center",
tags=["None"]
)

self.on_canvas.create_button(
master=self, canvas=canvas,
btn_text=custom_yes,
row=height-40, cul=20, width=8,
style="success",
tags=["Ask_Yes"],
command=self.on_yes
)
if (yes_img_1 is not None and yes_img_2 is not None):
self.on_canvas.image_Button(
canvas=canvas,
row=height - (yes_img_1.height()+50), cul=20,
img_1=yes_img_1, img_2=yes_img_2,
command=self.on_yes
)
else:
self.on_canvas.create_button(
master=self, canvas=canvas,
btn_text=custom_yes,
row=height-60, cul=20 - (20+80), width=8,
style="danger",
tags=["Ask_No"],
command=self.on_yes
)

self.on_canvas.create_button(
master=self, canvas=canvas,
btn_text=custom_no,
row=height-40, cul=width-(20+80), width=8,
style="danger",
row=height-60, cul=width-(20+80), width=8,
style="warning",
tags=["Ask_No"],
command=self.on_no
)

self.resizable(width=False, height=False)

def on_yes(self):
def on_yes(self, dummy=None):
self.destroy()
self.result = True

def on_no(self):
def on_no(self, dummy=None):
self.destroy()
self.result = False
2 changes: 2 additions & 0 deletions src/modules/checkpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ def checkpath(self, mode):
self.load_dir = os.path.join(f"{self.Globaldir}", "mods", "contents", "0100f2c0115b6000")
self.Yuzudir = os.path.join(home_directory, ".config", "Ryujinx", "mods", "contents",
"0100f2c0115b6000")
self.ryujinx_config = os.path.join(self.Globaldir, "Config.json")
return

self.configdir = None
self.TOTKconfig = None
self.nand_dir = os.path.join(f"{self.Globaldir}", "bis", "user", "save")
self.load_dir = os.path.join(f"{self.Globaldir}", "mods", "contents", "0100f2C0115B6000")
self.Yuzudir = os.path.join(home_directory, ".config", "Ryujinx", "mods", "contents", "0100f2C0115B6000")
self.ryujinx_config = os.path.join(self.Globaldir, "Config.json")
return
# Default Dir for Windows or user folder.
elif self.os_platform == "Windows":
Expand Down

0 comments on commit 84a19b5

Please sign in to comment.