FEAT: F1 (but why jump doesnt work wtf)

This commit is contained in:
InviseDivine
2026-03-13 22:21:53 +02:00
parent 13dcf593d8
commit bf2248063d
4 changed files with 23 additions and 11 deletions

View File

@@ -9,6 +9,8 @@
bool Options::debugGl = false;
void Options::initDefaultValues() {
F1 = false;
difficulty = Difficulty::NORMAL;
hideGui = false;
thirdPersonView = false;

View File

@@ -108,6 +108,8 @@ private:
public:
static bool debugGl;
bool F1;
float music;
float sound;
//note: sensitivity is transformed in Options::update

View File

@@ -1,6 +1,7 @@
#include "Gui.h"
#include "Font.h"
#include "client/Options.h"
#include "platform/input/Keyboard.h"
#include "screens/IngameBlockSelectionScreen.h"
#include "../Minecraft.h"
#include "../player/LocalPlayer.h"
@@ -87,6 +88,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) {
// F: 3
int ySlot = screenHeight - 16 - 3;
if (!minecraft->options.F1) {
if (minecraft->gameMode->canHurtPlayer()) {
minecraft->textures->loadAndBindTexture("gui/icons.png");
Tesselator& t = Tesselator::instance;
@@ -96,6 +98,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) {
renderBubbles();
t.endOverrideAndDraw();
}
}
if(minecraft->player->getSleepTimer() > 0) {
glDisable(GL_DEPTH_TEST);
@@ -106,7 +109,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) {
glEnable(GL_ALPHA_TEST);
glEnable(GL_DEPTH_TEST);
}
if (!minecraft->options.F1) {
renderToolBar(a, ySlot, screenWidth);
glEnable(GL_BLEND);
@@ -122,6 +125,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) {
if (minecraft->options.renderDebug)
renderDebugInfo();
#endif
}
glDisable(GL_BLEND);
glEnable2(GL_ALPHA_TEST);
@@ -201,6 +205,10 @@ void Gui::handleClick(int button, int x, int y) {
void Gui::handleKeyPressed(int key)
{
if (key == Keyboard::KEY_F1) {
minecraft->options.F1 = !minecraft->options.F1;
}
if (key == 99)
{
if (minecraft->player->inventory->selected > 0)
@@ -516,7 +524,7 @@ void Gui::renderProgressIndicator( const bool isTouchInterface, const int screen
ItemInstance* currentItem = minecraft->player->inventory->getSelected();
bool bowEquipped = currentItem != NULL ? currentItem->getItem() == Item::bow : false;
bool itemInUse = currentItem != NULL ? currentItem->getItem() == minecraft->player->getUseItem()->getItem() : false;
if (!isTouchInterface || minecraft->options.isJoyTouchArea || (bowEquipped && itemInUse)) {
if ((!isTouchInterface || minecraft->options.isJoyTouchArea || (bowEquipped && itemInUse)) && !minecraft->options.F1) {
minecraft->textures->loadAndBindTexture("gui/icons.png");
glEnable(GL_BLEND);
glBlendFunc2(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR);

View File

@@ -373,7 +373,7 @@ void GameRenderer::renderLevel(float a) {
// glDisable2(GL_FOG);
setupFog(1);
if (zoom == 1) {
if (zoom == 1 && !mc->options.F1) {
TIMER_POP_PUSH("hand");
glClear(GL_DEPTH_BUFFER_BIT);
renderItemInHand(a, i);