From 02845d9a5f8dbaee930b466edbf94bdd45968d4f Mon Sep 17 00:00:00 2001 From: Sally Knight Date: Fri, 27 Mar 2026 20:37:52 +0300 Subject: [PATCH] chore: fmt --- Minecraft.Client/UI/Button.cpp | 2 +- .../UI/Screens/AchievementPopup.cpp | 26 ++++++++----------- .../UI/Screens/CraftingScreen.cpp | 7 ++--- .../UI/Screens/SelectWorldScreen.cpp | 14 ++++++---- .../UI/Screens/SelectWorldScreen.h | 2 +- 5 files changed, 26 insertions(+), 25 deletions(-) diff --git a/Minecraft.Client/UI/Button.cpp b/Minecraft.Client/UI/Button.cpp index b5759fa1f..4dd859f20 100644 --- a/Minecraft.Client/UI/Button.cpp +++ b/Minecraft.Client/UI/Button.cpp @@ -43,7 +43,7 @@ void Button::render(Minecraft* minecraft, int xm, int ym) { Font* font = minecraft->font; // glBindTexture(GL_TEXTURE_2D, minecraft->textures->loadTexture( - // TN_GUI_GUI)); // 4J was L"/gui/gui.png" + // TN_GUI_GUI)); // 4J was L"/gui/gui.png" minecraft->textures->bindTexture(&GUI_GUI_LOCATION); glColor4f(1, 1, 1, 1); diff --git a/Minecraft.Client/UI/Screens/AchievementPopup.cpp b/Minecraft.Client/UI/Screens/AchievementPopup.cpp index de59ec75b..f518da342 100644 --- a/Minecraft.Client/UI/Screens/AchievementPopup.cpp +++ b/Minecraft.Client/UI/Screens/AchievementPopup.cpp @@ -68,14 +68,14 @@ void AchievementPopup::prepareWindow() { void AchievementPopup::render() { // 4J Unused #if ENABLE_JAVA_GUIS - if (Minecraft::warezTime > 0) - { + if (Minecraft::warezTime > 0) { glDisable(GL_DEPTH_TEST); glDepthMask(false); Lighting::turnOff(); prepareWindow(); - std::wstring title = L"Minecraft " + SharedConstants::VERSION_STRING + L" Unlicensed Copy :("; + std::wstring title = L"Minecraft " + SharedConstants::VERSION_STRING + + L" Unlicensed Copy :("; std::wstring msg1 = L"(Or logged in from another location)"; std::wstring msg2 = L"Purchase at minecraft.net"; @@ -89,16 +89,12 @@ void AchievementPopup::render() { if (ach == NULL || startTime == 0) return; double time = (System::currentTimeMillis() - startTime) / 3000.0; - if (isHelper) - { - } - else if (!isHelper && (time < 0 || time > 1)) - { + if (isHelper) { + } else if (!isHelper && (time < 0 || time > 1)) { startTime = 0; return; } - prepareWindow(); glDisable(GL_DEPTH_TEST); glDepthMask(false); @@ -112,7 +108,7 @@ void AchievementPopup::render() { yo = yo * yo; int xx = width - 160; - int yy = 0 - (int) (yo * 36); + int yy = 0 - (int)(yo * 36); int tex = mc->textures->loadTexture(TN_ACHIEVEMENT_BG); glColor4f(1, 1, 1, 1); glEnable(GL_TEXTURE_2D); @@ -122,13 +118,13 @@ void AchievementPopup::render() { blit(xx, yy, 96, 202, 160, 32); // if (isHelper) - // { + // { // mc->font->drawWordWrap(desc, xx + 30, yy + 7, 120, 0xffffffff); // } - // else - // { - mc->font->draw(title, xx + 30, yy + 7, 0xffffff00); - mc->font->draw(desc, xx + 30, yy + 18, 0xffffffff); + // else + // { + mc->font->draw(title, xx + 30, yy + 7, 0xffffff00); + mc->font->draw(desc, xx + 30, yy + 18, 0xffffffff); // } glPushMatrix(); diff --git a/Minecraft.Client/UI/Screens/CraftingScreen.cpp b/Minecraft.Client/UI/Screens/CraftingScreen.cpp index 00b90e8c4..14b9aaae5 100644 --- a/Minecraft.Client/UI/Screens/CraftingScreen.cpp +++ b/Minecraft.Client/UI/Screens/CraftingScreen.cpp @@ -12,8 +12,8 @@ ResourceLocation GUI_CRAFTING_LOCATION = ResourceLocation(TN_GUI_CRAFTING); CraftingScreen::CraftingScreen(std::shared_ptr inventory, Level* level, int x, int y, int z) : AbstractContainerScreen(new CraftingMenu(inventory, level, x, y, z)) { - this->inventory = inventory; - } + this->inventory = inventory; +} void CraftingScreen::removed() { AbstractContainerScreen::removed(); @@ -21,7 +21,8 @@ void CraftingScreen::removed() { } void CraftingScreen::renderLabels() { - font->draw(Language::getInstance()->getElement(L"container.crafting"), 8 + 16 + 4, 2 + 2 + 2, 0x404040); + font->draw(Language::getInstance()->getElement(L"container.crafting"), + 8 + 16 + 4, 2 + 2 + 2, 0x404040); font->draw(inventory->getName(), 8, imageHeight - 96 + 2, 0x404040); } diff --git a/Minecraft.Client/UI/Screens/SelectWorldScreen.cpp b/Minecraft.Client/UI/Screens/SelectWorldScreen.cpp index aa410280b..8c181623d 100644 --- a/Minecraft.Client/UI/Screens/SelectWorldScreen.cpp +++ b/Minecraft.Client/UI/Screens/SelectWorldScreen.cpp @@ -127,7 +127,9 @@ void SelectWorldScreen::buttonClicked(Button* button) { minecraft->setScreen( new RenameWorldScreen(this, getWorldId(selectedWorld))); } else if (button->id == BUTTON_CANCEL_ID) { - app.DebugPrintf("SelectWorldScreen::buttonClicked 'Cancel' minecraft->setScreen(lastScreen)\n"); + app.DebugPrintf( + "SelectWorldScreen::buttonClicked 'Cancel' " + "minecraft->setScreen(lastScreen)\n"); minecraft->setScreen(lastScreen); } else { worldSelectionList->buttonClicked(button); @@ -181,9 +183,9 @@ void SelectWorldScreen::render(int xm, int ym, float a) { static bool forceCreateLevel = false; if (count++ >= 100) { if (!forceCreateLevel && levelList->size() > 0) { - // 4J Stu - For some obscures reason the "delete" button is called - // "renameButton" and vice versa. - // if( levelList->size() > 2 && deleteButton->active ) + // 4J Stu - For some obscures reason the "delete" button is + // called "renameButton" and vice versa. if( levelList->size() > + // 2 && deleteButton->active ) //{ // this->selectedWorld = 2; // count = 0; @@ -205,7 +207,9 @@ void SelectWorldScreen::render(int xm, int ym, float a) { count = 0; } } else { - app.DebugPrintf("SelectWorldScreen::render minecraft->setScreen(new CreateWorldScreen(this))\n"); + app.DebugPrintf( + "SelectWorldScreen::render minecraft->setScreen(new " + "CreateWorldScreen(this))\n"); minecraft->setScreen(new CreateWorldScreen(this)); } } diff --git a/Minecraft.Client/UI/Screens/SelectWorldScreen.h b/Minecraft.Client/UI/Screens/SelectWorldScreen.h index 77f8dd120..39b56c32f 100644 --- a/Minecraft.Client/UI/Screens/SelectWorldScreen.h +++ b/Minecraft.Client/UI/Screens/SelectWorldScreen.h @@ -20,7 +20,7 @@ protected: private: // final DateFormat DATE_FORMAT = new SimpleDateFormat(); // 4J - - //removed + // removed protected: Screen* lastScreen;