mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-17 19:45:23 -04:00
add option to turn off 'noclip is disabled' etc messages
This commit is contained in:
parent
09ad246cde
commit
6fb446f8f0
@ -29,6 +29,7 @@ namespace ClassicalSharp.Entities {
|
||||
internal SoundComponent sound;
|
||||
internal LocalInterpComponent interp;
|
||||
internal TiltComponent tilt;
|
||||
bool hackPermMsgs;
|
||||
bool warnedRespawn, warnedFly, warnedNoclip;
|
||||
|
||||
public LocalPlayer(Game game) : base(game) {
|
||||
@ -146,6 +147,7 @@ namespace ClassicalSharp.Entities {
|
||||
Hacks.FullBlockStep = Options.GetBool(OptionsKey.FullBlockStep, false);
|
||||
physics.userJumpVel = Options.GetFloat(OptionsKey.JumpVelocity, 0.0f, 52.0f, 0.42f);
|
||||
physics.jumpVel = physics.userJumpVel;
|
||||
hackPermMsgs = Options.GetBool(OptionsKey.HackPermMsgs, true);
|
||||
}
|
||||
|
||||
void IGameComponent.Ready(Game game) { }
|
||||
@ -209,7 +211,7 @@ namespace ClassicalSharp.Entities {
|
||||
return true;
|
||||
} else if (!warnedRespawn) {
|
||||
warnedRespawn = true;
|
||||
if (!game.ClassicMode) game.Chat.Add("&cRespawning is currently disabled");
|
||||
if (!hackPermMsgs) game.Chat.Add("&cRespawning is currently disabled");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -231,7 +233,7 @@ namespace ClassicalSharp.Entities {
|
||||
return true;
|
||||
} else if (!warnedFly) {
|
||||
warnedFly = true;
|
||||
if (!game.ClassicMode) game.Chat.Add("&cFlying is currently disabled");
|
||||
if (!hackPermMsgs) game.Chat.Add("&cFlying is currently disabled");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -245,7 +247,7 @@ namespace ClassicalSharp.Entities {
|
||||
return true;
|
||||
} else if (!warnedNoclip) {
|
||||
warnedNoclip = true;
|
||||
if (!game.ClassicMode) game.Chat.Add("&cNoclip is currently disabled");
|
||||
if (!hackPermMsgs) game.Chat.Add("&cNoclip is currently disabled");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ namespace ClassicalSharp {
|
||||
public const string CameraClipping = "hacks-cameraclipping";
|
||||
public const string WOMStyleHacks = "hacks-womstylehacks";
|
||||
public const string FullBlockStep = "hacks-fullblockstep";
|
||||
public const string HackPermMsgs = "hacks-perm-msgs";
|
||||
|
||||
public const string TabAutocomplete = "gui-tab-autocomplete";
|
||||
public const string ShowBlockInHand = "gui-blockinhand";
|
||||
|
@ -766,6 +766,7 @@ static void Player_Init(struct Entity* e) {
|
||||
*------------------------------------------------------LocalPlayer--------------------------------------------------------*
|
||||
*#########################################################################################################################*/
|
||||
struct LocalPlayer LocalPlayer_Instance;
|
||||
static bool hackPermMsgs;
|
||||
float LocalPlayer_JumpHeight(void) {
|
||||
struct LocalPlayer* p = &LocalPlayer_Instance;
|
||||
return (float)PhysicsComp_GetMaxHeight(p->Physics.JumpVel);
|
||||
@ -901,6 +902,7 @@ static void LocalPlayer_Init(void) {
|
||||
hacks->FullBlockStep = Options_GetBool(OPT_FULL_BLOCK_STEP, false);
|
||||
p->Physics.UserJumpVel = Options_GetFloat(OPT_JUMP_VELOCITY, 0.0f, 52.0f, 0.42f);
|
||||
p->Physics.JumpVel = p->Physics.UserJumpVel;
|
||||
hackPermMsgs = Options_GetBool(OPT_HACK_PERM_MSGS, true);
|
||||
}
|
||||
|
||||
static void LocalPlayer_Reset(void) {
|
||||
@ -970,7 +972,7 @@ static bool LocalPlayer_HandleRespawn(void) {
|
||||
return true;
|
||||
} else if (!p->_WarnedRespawn) {
|
||||
p->_WarnedRespawn = true;
|
||||
if (!Game_ClassicMode) Chat_AddRaw("&cRespawning is currently disabled");
|
||||
if (hackPermMsgs) Chat_AddRaw("&cRespawning is currently disabled");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -994,7 +996,7 @@ static bool LocalPlayer_HandleFly(void) {
|
||||
return true;
|
||||
} else if (!p->_WarnedFly) {
|
||||
p->_WarnedFly = true;
|
||||
if (!Game_ClassicMode) Chat_AddRaw("&cFlying is currently disabled");
|
||||
if (hackPermMsgs) Chat_AddRaw("&cFlying is currently disabled");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -1009,7 +1011,7 @@ static bool LocalPlayer_HandleNoClip(void) {
|
||||
return true;
|
||||
} else if (!p->_WarnedNoclip) {
|
||||
p->_WarnedNoclip = true;
|
||||
if (!Game_ClassicMode) Chat_AddRaw("&cNoclip is currently disabled");
|
||||
if (hackPermMsgs) Chat_AddRaw("&cNoclip is currently disabled");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -606,7 +606,6 @@ static void Launcher_ApplyUpdate(void) {
|
||||
if (res) Launcher_ShowError(res, "making update script executable");
|
||||
|
||||
/* TODO: (open -a Terminal ", '"' + path + '"'); on OSX */
|
||||
/* TODO: chmod +x on non-windows */
|
||||
res = Platform_StartProcess(&scriptName, &scriptArgs);
|
||||
if (res) { Launcher_ShowError(res, "starting update script"); return; }
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ extern const char* FpsLimit_Names[FPS_LIMIT_COUNT];
|
||||
#define OPT_CAMERA_CLIPPING "hacks-cameraclipping"
|
||||
#define OPT_WOM_STYLE_HACKS "hacks-womstylehacks"
|
||||
#define OPT_FULL_BLOCK_STEP "hacks-fullblockstep"
|
||||
#define OPT_HACK_PERM_MSGS "hacks-perm-msgs"
|
||||
|
||||
#define OPT_TAB_AUTOCOMPLETE "gui-tab-autocomplete"
|
||||
#define OPT_SHOW_BLOCK_IN_HAND "gui-blockinhand"
|
||||
|
Loading…
x
Reference in New Issue
Block a user