This repository was archived by the owner on May 4, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathpackmode_picker.py
More file actions
71 lines (60 loc) · 1.85 KB
/
packmode_picker.py
File metadata and controls
71 lines (60 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import shutil
from pathlib import Path
# ANSI color codes
GREEN = "\033[0;36m"
RESET = "\033[0m"
def print_banner():
print(f"{GREEN}")
print("=" * 55)
print()
print(" Star Technology Packmode Picker")
print()
print("=" * 55)
print(f"{RESET}")
def display_menu():
print("[D] Default - the standard experience")
print("[H] Hard - for the masochistic")
print("[A] Abydos - dehydration enjoyer")
print()
def get_user_choice():
choices = {
"D": ("Default", "default"),
"H": ("Hard", "hard"),
"A": ("Abydos", "abydos")
}
while True:
choice = input("Enter Packmode (D, H, or A): ").strip().upper()
if choice in choices:
return choices[choice]
else:
print("Invalid choice. Please select D, H, or A.")
def apply_packmode(selected_name, selected_folder):
script_dir = Path(__file__).resolve().parent
packmode_dir = script_dir / "packmode"
selected_path = packmode_dir / selected_folder
target_path = script_dir
chapters_path = target_path / "config" / "ftbquests" / "quests" / "chapters"
if chapters_path.exists() and chapters_path.is_dir():
shutil.rmtree(chapters_path)
for item in selected_path.iterdir():
destination = target_path / item.name
if item.is_dir():
shutil.copytree(item, destination, dirs_exist_ok=True)
else:
shutil.copy2(item, destination)
print()
print(f"Applying Packmode [{selected_name}]...")
print()
print("=" * 90)
print("=" * 90)
print()
print("Packmode switch complete!")
print()
def main():
print_banner()
display_menu()
selected_name, selected_folder = get_user_choice()
apply_packmode(selected_name, selected_folder)
input("Press Enter to exit...")
if __name__ == "__main__":
main()