/
powerMenu.c
94 lines (80 loc) · 2.35 KB
/
powerMenu.c
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
#include "homeMenu.h"
#include "clock.h"
#include "screenshot.h"
#include "powerMenu.h"
#include "lockScreen.h"
#include "recoveryMenu.h"
#include "settingsMenu.h"
#include "include/utils.h"
#include "prx/scepower.h"
void powermenu()
{
power = oslLoadImageFilePNG("system/home/menu/powerMenu.png", OSL_IN_RAM, OSL_PF_8888);
powerSelection = oslLoadImageFilePNG("system/home/menu/powerSelection.png", OSL_IN_RAM, OSL_PF_8888);
recoverySelection = oslLoadImageFilePNG("system/home/menu/recoverySelection.png", OSL_IN_RAM, OSL_PF_8888);
if (!power || !powerSelection || !recoverySelection)
debugDisplay();
while (!osl_quit)
{
LowMemExit();
oslStartDrawing();
controls();
oslClearScreen(RGB(0,0,0));
oslDrawImage(background);
oslDrawImageXY(ic_launcher_apollo, 105, 190);
oslDrawImageXY(ic_launcher_browser, 276, 190);
oslDrawImageXY(ic_launcher_settings, 331, 190);
oslDrawImageXY(ic_launcher_messenger, 160, 190);
navbarButtons(0);
oslDrawImageXY(power, 100, 61);
battery(370,2,1);
digitaltime(420,4,0,hrTime);
oslIntraFontSetStyle(Roboto, 0.75f, BLACK, 0, 0);
oslDrawStringf(165, 100, "Power off");
oslDrawStringf(165, 165, "Recovery");
if (cursor->x >= 116 && cursor->x <= 364 && cursor->y >= 55 && cursor->y <= 125)
{
oslDrawImageXY(powerSelection, 100, 60);
oslDrawStringf(165, 100, "Power off");
oslDrawStringf(165, 165, "Recovery");
if (osl_keys->pressed.cross)
{
oslPlaySound(KeypressStandard, 1);
sceKernelExitGame();
}
/*else if (osl_pad.held.cross)
{
scePowerRequestColdReset(0);
scePowerRequestColdReset(50000);
}*/
}
if (cursor->x >= 116 && cursor->x <= 364 && cursor->y >= 126 && cursor->y <= 200)
{
oslDrawImageXY(recoverySelection, 100, 60);
oslDrawStringf(165, 100, "Power off");
oslDrawStringf(165, 165, "Recovery");
if (osl_keys->pressed.cross)
{
oslPlaySound(KeypressStandard, 1);
oslSyncFrame();
sceKernelDelayThread(3*1000000);
oslDeleteImage(power);
oslDeleteImage(powerSelection);
oslDeleteImage(recoverySelection);
mainRecoveryMenu();
}
}
oslDrawImage(cursor);
if (osl_keys->pressed.circle)
{
oslDeleteImage(power);
oslDeleteImage(powerSelection);
oslDeleteImage(recoverySelection);
return;
}
captureScreenshot();
oslEndDrawing();
oslEndFrame();
oslSyncFrame();
}
}