-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
237 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import tkinter as tk | ||
# We found two installations, choose your preferred installation for us to load custom maps to. | ||
def select_platform_dialog(): | ||
root = tk.Tk() | ||
root.withdraw() # Hide the main tkinter window | ||
|
||
# Create a custom Toplevel dialog | ||
dialog = tk.Toplevel(root) | ||
dialog.title("Select Platform") | ||
|
||
# Label with instructions | ||
label = tk.Label(dialog, text="We found two installations.\nChoose your preferred installation for us to load custom maps to.") | ||
label.pack(pady=10) | ||
|
||
# Variable to store the selected platform | ||
selected_platform = tk.StringVar() | ||
|
||
# Function to handle button click and return the platform | ||
def button_clicked(platform): | ||
selected_platform.set(platform) | ||
dialog.quit() # Breaks the mainloop | ||
dialog.destroy() # Close the dialog | ||
|
||
# Button for Steam | ||
btn_steam = tk.Button(dialog, text="Steam", width=10, | ||
command=lambda: button_clicked("Steam")) | ||
btn_steam.pack(pady=5) | ||
|
||
# Button for Epic Games | ||
btn_epic = tk.Button(dialog, text="Epic Games", width=10, | ||
command=lambda: button_clicked("Epic Games")) | ||
btn_epic.pack(pady=5) | ||
|
||
# Set minimum width of the dialog to fit the title and content | ||
dialog.update_idletasks() | ||
min_width = max(dialog.winfo_width(), 300) # Adjust 300 as needed | ||
dialog.minsize(min_width, dialog.winfo_height()) | ||
|
||
# Center the dialog on the screen | ||
width = dialog.winfo_width() | ||
height = dialog.winfo_height() | ||
x = (dialog.winfo_screenwidth() // 2) - (width // 2) | ||
y = (dialog.winfo_screenheight() // 2) - (height // 2) | ||
dialog.geometry(f'+{x}+{y}') | ||
|
||
# Run the tkinter main loop | ||
root.mainloop() | ||
|
||
# Return the selected platform after the dialog is closed | ||
return selected_platform.get() | ||
|
||
if __name__ == "__main__": | ||
platform = select_platform_dialog() | ||
print(f"Selected platform: {platform}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"versionNumber": "0.1.5" | ||
"versionNumber": "0.1.6" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
function openSettingsDialog() { | ||
var overlay = document.getElementById('overlay'); | ||
overlay.style.display = 'flex'; | ||
var dropdown = document.getElementById('platformSelect'); | ||
dropdown.innerHTML = ''; | ||
var option1 = document.createElement('option'); | ||
option1.value = 'steam'; | ||
option1.textContent = 'Steam'; | ||
dropdown.appendChild(option1); | ||
var option2 = document.createElement('option'); | ||
option2.value = 'epicgames'; | ||
option2.textContent = 'Epic Games'; | ||
dropdown.appendChild(option2); | ||
} | ||
|
||
function closeSettingsDialog() { | ||
var overlay = document.getElementById('overlay'); | ||
overlay.style.display = 'none'; // Hide overlay | ||
} | ||
|
||
function handleFileSelection(event) { | ||
const file = event.target.files[0]; | ||
if (file) { | ||
console.log("Selected file:", file.name); | ||
console.log("File path (not accessible due to browser security):", event.target.value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters