-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOS.lua
More file actions
66 lines (54 loc) · 2.11 KB
/
OS.lua
File metadata and controls
66 lines (54 loc) · 2.11 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
--[[pod_format="raw",created="2024-06-11 03:41:20",modified="2024-06-13 23:29:36",revision=1133]]
--I know, you can just gui:draw_all(), and I didn't knew it when I started learning the PT gui
--but believe it or not... all these crazy if statements help with the cpu usage! you're welcome to make it better!
function drawOS()
if currentPage!="sleep" then --If phone is not in low usage mode, do stuff
-- if powerState=="OFF" then --if phone just woke up and is not installer page
-- powerState="ON"
if firstTimeEver==true and currentPage!="installer" then
bootPhone() --turn phone ON (we only need to initialize vars one time here)
firstTimeEver=false
end
-- end
if currentPage=="menu" then -- Draw menu
menuGUI:draw_all()
if firstTimeMenu==true then
bootMenu() --initialize menu
firstTimeMenu=false
end
elseif currentPage=="colors" then drawFunctions.colors()
elseif currentPage=="specialChar" then drawFunctions.specialChars()
elseif currentPage=="midi2pico" then drawMidi()
elseif currentPage=="calculator" then drawCalc()
elseif currentPage=="chat" then drawChat()
elseif currentPage=="cPanel" then
cPanelGUI:draw_all()
if cPanelGUI.firstTime==true then
bootCPanel()--turn that on
cPanelGUI.firstTime=false
end
elseif currentPage=="settings" then
settingsGUI:draw_all()
if firstTimeSettings==true then
bootSettings()--turn that on
firstTimeSettings=false
end
elseif currentPage=="market" then
marketGUI:draw_all()
if firstTimeMarket==true then
bootMarket()
firstTimeMarket=false
end
elseif currentPage=="marketTool" then
marketToolGUI:draw_all()
if firstTimeToolMarket == true then
bootMarketTool()
firstTimeToolMarket=false
end
gui:draw_all()
else
drawFunctions.sleep(phoneDisplay.y2)
end
if currentPage=="installer" then updatePhone.drawInstall()
elseif currentPage=="installComplete" then installComplete() end
end