diff --git a/game/assets/gui/gui_custom.png b/game/assets/gui/gui_custom.png new file mode 100644 index 0000000..1315f75 Binary files /dev/null and b/game/assets/gui/gui_custom.png differ diff --git a/source/client/gui/components/OptionList.cpp b/source/client/gui/components/OptionList.cpp index ab67381..641d8d6 100644 --- a/source/client/gui/components/OptionList.cpp +++ b/source/client/gui/components/OptionList.cpp @@ -12,13 +12,13 @@ #include "client/renderer/FoliageColor.hpp" #include "client/renderer/GrassColor.hpp" -#define C_OPTION_ITEM_HEIGHT (18) +#define C_OPTION_ITEM_HEIGHT (20) -#define C_ON_OFF_SWITCH_WIDTH (28) -#define C_ON_OFF_SWITCH_HEIGHT (16) +#define C_ON_OFF_SWITCH_WIDTH (32) +#define C_ON_OFF_SWITCH_HEIGHT (18) #define C_DISTANCE_SWITCH_WIDTH (60) -#define C_DISTANCE_SWITCH_HEIGHT (16) +#define C_DISTANCE_SWITCH_HEIGHT (18) BooleanOptionItem::BooleanOptionItem(bool* pValue, const std::string& text) { @@ -115,6 +115,8 @@ void DistanceOptionItem::onClick(OptionList* pList, int mouseX, int mouseY) if (mouseX <= itemX + C_SCROLLED_LIST_ITEM_WIDTH - C_DISTANCE_SWITCH_WIDTH - 6) return; + if (mouseX > itemX + C_SCROLLED_LIST_ITEM_WIDTH - 6) + return; int oldValue = *m_pValue; *m_pValue = (oldValue + 1) % RD_COUNT; @@ -193,36 +195,11 @@ bool OptionList::isSelectedItem(int index) void OptionList::drawOnOffSwitch(int x, int y, bool state, bool disabled) { - // Draws a simplistic On/Off switch. + m_pMinecraft->m_pTextures->loadAndBindTexture("gui/gui_custom.png"); + + blit(x, y, 0, state ? 18 : 0, C_ON_OFF_SWITCH_WIDTH, C_ON_OFF_SWITCH_HEIGHT, C_ON_OFF_SWITCH_WIDTH, C_ON_OFF_SWITCH_HEIGHT); - uint32_t - edgeColor = 0xFF444444, - backdropEnabled = 0xFFAAAAAA, - backdropDisabled = 0xFF333333, - leverOn = 0xFFFFFFFF, - leverOff = 0xFF888888; - - if (disabled) - { - edgeColor = 0xFF222222; - backdropEnabled = 0xFF555555; - backdropDisabled = 0xFF191919, - leverOn = 0xFF7F7F7F, - leverOff = 0xFF444444; - } - - // Draw edges - fill(x + 0, y + 0, x + C_ON_OFF_SWITCH_WIDTH - 0, y + C_ON_OFF_SWITCH_HEIGHT - 0, edgeColor); - - // Draw backdrop - fill(x + 1, y + 1, x + C_ON_OFF_SWITCH_WIDTH - 1, y + C_ON_OFF_SWITCH_HEIGHT - 1, state ? backdropEnabled : backdropDisabled); - - if (state) - // Draw ON position - fill(x + C_ON_OFF_SWITCH_WIDTH / 2 + 2, y + 1, x + C_ON_OFF_SWITCH_WIDTH - 1, y + C_ON_OFF_SWITCH_HEIGHT - 1, leverOn); - else - // Draw OFF position - fill(x + 1, y + 1, x + C_ON_OFF_SWITCH_WIDTH / 2 - 2, y + C_ON_OFF_SWITCH_HEIGHT - 1, leverOff); + m_pMinecraft->m_pTextures->loadAndBindTexture("gui/gui.png");// bind the old texture back } void OptionList::renderItem(int index, int x, int y, int height, Tesselator& t) diff --git a/source/client/gui/screens/StartMenuScreen.cpp b/source/client/gui/screens/StartMenuScreen.cpp index 9c98c08..30dfc85 100644 --- a/source/client/gui/screens/StartMenuScreen.cpp +++ b/source/client/gui/screens/StartMenuScreen.cpp @@ -208,7 +208,7 @@ const char* gSplashes[] = "Woo, worldofminecraft!", "Woo, reddit!", "Woo, 2pp!", - "Google anlyticsed!", + "Not Google anlyticsed!", "Give us Gordon!", "Tip your waiter!", "Very fun!",