summary refs log tree commit diff
path: root/src/Menus.c
diff options
context:
space:
mode:
authorWlodekM <[email protected]>2025-01-26 13:41:50 +0200
committerWlodekM <[email protected]>2025-01-26 13:41:50 +0200
commit25d676545255d1f7a6814b869655ece61bcf87b5 (patch)
tree8ad1aca3766637478926f45f64d6d1b714fdafa0 /src/Menus.c
parentb359faa5b925f147886d1183e78a88aa893308c6 (diff)
wip rewrite to use override option in settings
Diffstat (limited to 'src/Menus.c')
-rw-r--r--src/Menus.c32
1 files changed, 25 insertions, 7 deletions
diff --git a/src/Menus.c b/src/Menus.c
index 7e18b78..5ba1a71 100644
--- a/src/Menus.c
+++ b/src/Menus.c
@@ -510,10 +510,21 @@ static struct Widget* pause_widgets[1 + 6 + 2];
 
 static void PauseScreen_CheckHacksAllowed(void* screen) {
 	struct PauseScreen* s = (struct PauseScreen*)screen;
+	//NOTE - WL
+	if (Options_GetBool(OPT_HACKS_OVERRIDE, true)) {
+		// i think this makes you able to do hax when u turn on override
+		Platform_Log("enabling buttonse", 18);
+		Widget_SetDisabled(&s->btns[1], false);
+		s->dirty = true;
+		return;
+	}
 	if (Gui.ClassicMenu) return;
 
 	Widget_SetDisabled(&s->btns[1],
 			!Entities.CurPlayer->Hacks.CanAnyHacks); /* select texture pack */
+	if(!Entities.CurPlayer->Hacks.CanAnyHacks) {
+		Platform_Log("disabling buttons", 18);
+	}
 	s->dirty = true;
 }
 
@@ -3189,6 +3200,13 @@ static void HacksSettingsScreen_SetWOMHacks(const cc_string* v) {
 	Entities.CurPlayer->Hacks.WOMStyleHacks = Menu_SetBool(v, OPT_WOM_STYLE_HACKS);
 }
 
+//a
+static void HacksSettingsScreen_GetOverride(cc_string* v) { Menu_GetBool(v, Entities.CurPlayer->Hacks.Override); }
+static void HacksSettingsScreen_SetOverride(const cc_string* v) {
+	HacksComp_RecheckFlags(&Entities.CurPlayer->Hacks);
+	Entities.CurPlayer->Hacks.Override = Menu_SetBool(v, OPT_HACKS_OVERRIDE);
+}
+
 static void HacksSettingsScreen_GetFullStep(cc_string* v) { Menu_GetBool(v, Entities.CurPlayer->Hacks.FullBlockStep); }
 static void HacksSettingsScreen_SetFullStep(const cc_string* v) {
 	Entities.CurPlayer->Hacks.FullBlockStep = Menu_SetBool(v, OPT_FULL_BLOCK_STEP);
@@ -3220,12 +3238,13 @@ static void HacksSettingsScreen_SetFOV(const cc_string* v) {
 }
 
 static void HacksSettingsScreen_CheckHacksAllowed(struct MenuOptionsScreen* s) {
+	PauseScreen_CheckHacksAllowed(s);
 	struct Widget** widgets = s->widgets;
 	struct LocalPlayer* p   = Entities.CurPlayer;
 	cc_bool disabled        = !p->Hacks.Enabled;
 
 	Widget_SetDisabled(widgets[3], disabled || !p->Hacks.CanSpeed);
-	Widget_SetDisabled(widgets[4], disabled || !p->Hacks.CanSpeed);
+	// Widget_SetDisabled(widgets[4], disabled || !p->Hacks.CanSpeed);
 	Widget_SetDisabled(widgets[5], disabled || !p->Hacks.CanSpeed);
 	Widget_SetDisabled(widgets[7], disabled || !p->Hacks.CanPushbackBlocks);
 	MenuInputOverlay_CheckStillValid(s);
@@ -3241,8 +3260,10 @@ static void HacksSettingsScreen_InitWidgets(struct MenuOptionsScreen* s) {
 			HacksSettingsScreen_GetClipping, HacksSettingsScreen_SetClipping },
 		{ -1,    0, "Jump height",      MenuOptionsScreen_Input,
 			HacksSettingsScreen_GetJump,     HacksSettingsScreen_SetJump },
-		{ -1,   50, "WoM style hacks",  MenuOptionsScreen_Bool,
-			HacksSettingsScreen_GetWOMHacks, HacksSettingsScreen_SetWOMHacks },
+		// { -1,   50, "WoM style hacks",  MenuOptionsScreen_Bool,
+		// 	HacksSettingsScreen_GetWOMHacks, HacksSettingsScreen_SetWOMHacks },
+		{ -1,   50, "Hack override",  MenuOptionsScreen_Bool,
+			HacksSettingsScreen_GetOverride, HacksSettingsScreen_SetOverride },
 	
 		{ 1, -150, "Full block stepping", MenuOptionsScreen_Bool,
 			HacksSettingsScreen_GetFullStep, HacksSettingsScreen_SetFullStep },
@@ -3263,10 +3284,7 @@ static void HacksSettingsScreen_InitWidgets(struct MenuOptionsScreen* s) {
 	s->descriptions[2] = "&eIf &fON&e, then the third person cameras will limit\n&etheir zoom distance if they hit a solid block.";
 	s->descriptions[3] = "&eSets how many blocks high you can jump up.\n&eNote: You jump much higher when holding down the Speed key binding.";
 	s->descriptions[4] = \
-		"&eIf &fON&e, gives you a triple jump which increases speed massively,\n" \
-		"&ealong with older noclip style. This is based on the \"World of Minecraft\"\n" \
-		"&eclassic client mod, which popularized hacks conventions and controls\n" \
-		"&ebefore ClassiCube was created.";
+		"&eIf &fON&e, overrides the server's hack settings and allows you to use hacks wherever\n";
 	s->descriptions[7] = \
 		"&eIf &fON&e, placing blocks that intersect your own position cause\n" \
 		"&ethe block to be placed, and you to be moved out of the way.\n" \