This repository has been archived by the owner on Jul 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
boot.py
148 lines (130 loc) ยท 4.63 KB
/
boot.py
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
from saveloader import detectSave, detectSettings, loadSystemSave, loadSettingsSave
from rich import print as rprint
from clear import clear
from checkbadge import calculateBadge
from player import startup
from lang import langset
import sys
import os
import random
# no touchy!!!
version = "0.2.3-rolling1"
compileDate = "07-09-2022"
# find systems and generate list
pathToOses = './oses/'
sys.path.insert(0, pathToOses)
sys.path.insert(0, './lang/')
osesDir = os.listdir(pathToOses)
# sanitize list
osArrayUnsorted = []
for x in osesDir:
if x == "__pycache__":
continue
else:
x = x.replace('.py', '')
osArrayUnsorted.append(x)
# import systems
for x in osArrayUnsorted:
globals()[x] = __import__(x)
# sort array into new array (this is probably inefficient but whatever)
finished = False
arrayCounter = 0
osArray = []
while finished == False:
arraySelect = random.randrange(0, len(osArrayUnsorted))
xobj = eval(osArrayUnsorted[arraySelect]).system()
if xobj.listinbootmenu == arrayCounter:
osArray.append(osArrayUnsorted[arraySelect])
osArrayUnsorted.pop(arraySelect)
arrayCounter +=1
else:
continue
if len(osArrayUnsorted) == 0:
finished = True
def loadSettings(system):
xsys = osArray[system]
xobj = eval(xsys).system()
x = loadSystemSave(xobj.shortname)
if x == False:
print()
else:
xlevel = x
xbadge = calculateBadge(xlevel, xobj.prolevel)
if hasattr(xobj, "systemunlock"):
xu = "system" + xobj.systemunlock
xun = osArray.index(xu)
xunlo = eval(osArray[xun]).system()
xunlock = xunlo.unlocklevel
xsystem = xobj.systemunlock
else:
xsystem = False
xunlock = False
systemarray = [xobj.shortname, xlevel, xobj.prolevel, xbadge, xobj.startupstring, xsystem, xunlock]
startup(systemarray)
def boot():
langobj = loadSettingsSave("lang")
if langobj == False:
langobj = langset()
try:
globals()[langobj] = __import__(langobj)
except:
langobj = "en_US"
globals()["en_US"] = __import__("en_US")
detectSettings()
detectSave()
global lang
lang = eval(langobj).language()
while True:
clear()
rprint(lang.sparrow)
rprint(lang.version.format(version, compileDate))
rprint(lang.dev)
bmc = 1 # boot menu counter
for x in osArray:
xobj = eval(x).system()
systemexists = loadSystemSave(xobj.shortname)
if systemexists == False:
rprint(lang.notUnlocked.format(bmc, xobj.name, xobj.unlocklevel, xobj.requiredstring))
bmc += 1
else:
systembadge = calculateBadge(systemexists, xobj.prolevel)
print(str(bmc) + '. ' + xobj.name, systembadge)
bmc += 1
choice = input()
if choice == "":
print()
elif choice == "credits":
clear()
rprint(lang.credits1)
print()
rprint("[#af005f]BurningInfern0[/#af005f]")
rprint("[#fff400]gamingwithpivin[/#fff400]")
rprint("[#6530ff]setapdede[/#6530ff]")
rprint("[#2fda00]5jiji[/#2fda00]")
rprint("[#edaf58]Dieguito0512[/#edaf58]")
rprint("[#d5e7ae]SevenSixteen[/#d5e7ae]")
print()
rprint(lang.credits2)
rprint("๐บ๐ธ American English (en_US) - [#af005f]BurningInfern0[/#af005f]")
rprint("๐ต๐ฑ Polish (pl_PL) - [#fff400]gamingwithpivin[/#fff400]")
rprint("๐ท๐ด Romanian (ro_RO) - [#6530ff]setapdede[/#6530ff], [#ff5045]AlexandruUnu[/#ff5045]")
rprint("๐ซ๐ท French (fr_FR) - [#2fda00]5jiji[/#2fda00]")
rprint("๐ง๐ท Brazilian Portuguese (pt_BR) - [#1462d9]Luihum[/#1462d9]")
rprint("๐ฎ๐น Italian (it_IT) - [#00459b]Christian230102[/#00459b]")
rprint("๐ง๐ฌ Bulgarian (bg_BG) - [#8a2be2]markverb1[/#8a2be2]")
rprint("๐น๐ท Turkish (tr_TR) - [#8cc443]UstaYussuf[/#8cc443]")
rprint("๐บ๐ฆ Ukrainian (uk_UA) - [#]NUBERT[/#]")
rprint("๐ท๐บ Russian (ru_RU) - [#fa8072]H8ther[/#fa8072]")
print()
input()
elif choice == "chlang":
langobj = langset()
globals()[langobj] = __import__(langobj)
lang = eval(langobj).language()
else:
if not choice.isdigit() or int(choice) > len(osArray):
clear()
boot()
choice = int(choice) - 1
loadSettings(choice)
boot()