Skip to content

Commit 3ac953a

Browse files
committed
Secret Setting Menu
1 parent 92a5333 commit 3ac953a

3 files changed

Lines changed: 28 additions & 7 deletions

File tree

Applications/Setting/Setting.cpp

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ void Setting::SystemSetting() {
88
// Conspiracy exists?) Also assume at least 4x4
99
UI systemSetting;
1010
systemSetting.SetName("Setting");
11-
systemSetting.SetColor(Color(0x00FFFF));
11+
systemSetting.SetColor(Color(0xFFFFFF));
1212
systemSetting.SetKeyEventHandler([this](KeyEvent* keyEvent) -> bool { return CustomKeyEvent(keyEvent); });
1313

1414
// Brightness Control
@@ -116,14 +116,31 @@ void Setting::SystemSetting() {
116116
uiAnimationToggle.OnPress([]() -> void { MatrixOS::UserVar::ui_animation.Save(); });
117117
systemSetting.AddUIComponent(uiAnimationToggle, Point(7, 0));
118118

119+
UIButton secretMenuBtn;
120+
secretMenuBtn.SetName("Secret Menu");
121+
secretMenuBtn.SetColorFunc([]() -> Color { return ColorEffects::Rainbow(3000); });
122+
secretMenuBtn.SetSize(Dimension(4, 1));
123+
secretMenuBtn.OnPress([&]() -> void { SecretMenu(); });
124+
secretMenuBtn.SetEnableFunc([]() -> bool {return MatrixOS::UserVar::secret_menu_en;});
125+
systemSetting.AddUIComponent(secretMenuBtn, Point(2, 0));
126+
127+
systemSetting.Start();
128+
}
129+
130+
void Setting::SecretMenu()
131+
{
132+
UI secretMenu;
133+
secretMenu.SetName("Secret Menu");
134+
secretMenu.SetColor(Color(0xFFFFFF));
135+
119136
UIToggle fastScrollToggle;
120137
fastScrollToggle.SetName("Fast Text");
121138
fastScrollToggle.SetColor(Color(0x5A39BD));
122139
fastScrollToggle.SetValuePointer(&MatrixOS::UserVar::fast_scroll);
123140
fastScrollToggle.OnPress([]() -> void { MatrixOS::UserVar::fast_scroll.Save(); });
124-
systemSetting.AddUIComponent(fastScrollToggle, Point(6, 0));
141+
secretMenu.AddUIComponent(fastScrollToggle, Point(0, 0));
125142

126-
systemSetting.Start();
143+
secretMenu.Start();
127144
}
128145

129146
bool Setting::CustomKeyEvent(KeyEvent* keyEvent) {;
@@ -160,6 +177,7 @@ bool Setting::CustomKeyEvent(KeyEvent* keyEvent) {;
160177
aBtn.OnPress([&]() -> void {
161178
if (konami == 9)
162179
{
180+
MatrixOS::UserVar::secret_menu_en = true;
163181
MatrixOS::SYS::ExecuteAPP("203 Systems", "REDACTED");
164182
}
165183
else

Applications/Setting/Setting.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ class Setting {
1313

1414
void SystemSetting();
1515

16-
static void RotateClockwise(Direction rotation);
17-
static void NextBrightness();
18-
static void ResetConfirm();
16+
static void RotateClockwise(Direction rotation);
17+
static void NextBrightness();
18+
static void ResetConfirm();
1919

20-
bool CustomKeyEvent(KeyEvent* keyEvent);
20+
bool CustomKeyEvent(KeyEvent* keyEvent);
2121

2222
private:
23+
void SecretMenu();
2324
uint8_t konami = 0;
2425
};

OS/System/UserVariables.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ namespace MatrixOS::UserVar
1414
UserVar(rotation, Direction, TOP);
1515
UserVar(brightness, uint8_t, 64);
1616
UserVar(ui_animation, bool, true);
17+
UserVar(secret_menu_en, bool, false);
18+
1719
UserVar(fast_scroll, bool, false);
1820
}

0 commit comments

Comments
 (0)