diff --git a/src/client/Options.cpp b/src/client/Options.cpp index f532b57..ea4309b 100755 --- a/src/client/Options.cpp +++ b/src/client/Options.cpp @@ -9,6 +9,8 @@ bool Options::debugGl = false; void Options::initDefaultValues() { + F1 = false; + difficulty = Difficulty::NORMAL; hideGui = false; thirdPersonView = false; diff --git a/src/client/Options.h b/src/client/Options.h index 63fc95f..b1f60ed 100755 --- a/src/client/Options.h +++ b/src/client/Options.h @@ -108,6 +108,8 @@ private: public: static bool debugGl; + bool F1; + float music; float sound; //note: sensitivity is transformed in Options::update diff --git a/src/client/gui/Gui.cpp b/src/client/gui/Gui.cpp index 8d576cb..b0a60c2 100755 --- a/src/client/gui/Gui.cpp +++ b/src/client/gui/Gui.cpp @@ -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,14 +88,16 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) { // F: 3 int ySlot = screenHeight - 16 - 3; - if (minecraft->gameMode->canHurtPlayer()) { - minecraft->textures->loadAndBindTexture("gui/icons.png"); - Tesselator& t = Tesselator::instance; - t.beginOverride(); - t.colorABGR(0xffffffff); - renderHearts(); - renderBubbles(); - t.endOverrideAndDraw(); + if (!minecraft->options.F1) { + if (minecraft->gameMode->canHurtPlayer()) { + minecraft->textures->loadAndBindTexture("gui/icons.png"); + Tesselator& t = Tesselator::instance; + t.beginOverride(); + t.colorABGR(0xffffffff); + renderHearts(); + renderBubbles(); + t.endOverrideAndDraw(); + } } if(minecraft->player->getSleepTimer() > 0) { @@ -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); diff --git a/src/client/renderer/GameRenderer.cpp b/src/client/renderer/GameRenderer.cpp index 1ca6ce3..53d67ce 100755 --- a/src/client/renderer/GameRenderer.cpp +++ b/src/client/renderer/GameRenderer.cpp @@ -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);