diff --git a/build/Debug/D2tweaks.ilk b/build/Debug/D2tweaks.ilk index f6fb6fe..42b593b 100644 Binary files a/build/Debug/D2tweaks.ilk and b/build/Debug/D2tweaks.ilk differ diff --git a/build/Debug/D2tweaks.log b/build/Debug/D2tweaks.log index 6259bee..fa5656b 100644 --- a/build/Debug/D2tweaks.log +++ b/build/Debug/D2tweaks.log @@ -1,5 +1,3 @@ C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(517,5): warning MSB8004: Output Directory does not end with a trailing slash. This build instance will add the slash as it is required to allow proper evaluation of the Output Directory. autosort_client.cpp -D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\autosort\autosort_client.cpp(1163,13): warning C4244: 'argument': conversion from 'time_t' to 'unsigned int', possible loss of data -D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\autosort\autosort_client.cpp(1168,32): warning C4244: '=': conversion from 'ULONGLONG' to 'long', possible loss of data D2tweaks.vcxproj -> D:\Diablo II\MODS\ironman-dev\D2tweaks.dll diff --git a/build/Debug/D2tweaks.tlog/CL.command.1.tlog b/build/Debug/D2tweaks.tlog/CL.command.1.tlog index 43c5e22..1cb1c8f 100644 Binary files a/build/Debug/D2tweaks.tlog/CL.command.1.tlog and b/build/Debug/D2tweaks.tlog/CL.command.1.tlog differ diff --git a/build/Debug/D2tweaks.tlog/CL.read.1.tlog b/build/Debug/D2tweaks.tlog/CL.read.1.tlog index 4ecb719..91bde92 100644 Binary files a/build/Debug/D2tweaks.tlog/CL.read.1.tlog and b/build/Debug/D2tweaks.tlog/CL.read.1.tlog differ diff --git a/build/Debug/D2tweaks.tlog/CL.write.1.tlog b/build/Debug/D2tweaks.tlog/CL.write.1.tlog index be0bf79..7ab433c 100644 Binary files a/build/Debug/D2tweaks.tlog/CL.write.1.tlog and b/build/Debug/D2tweaks.tlog/CL.write.1.tlog differ diff --git a/build/Debug/D2tweaks.tlog/link.read.1.tlog b/build/Debug/D2tweaks.tlog/link.read.1.tlog index 5597e98..3cd0a7f 100644 Binary files a/build/Debug/D2tweaks.tlog/link.read.1.tlog and b/build/Debug/D2tweaks.tlog/link.read.1.tlog differ diff --git a/build/Debug/src/common/asm_code.obj b/build/Debug/src/common/asm_code.obj index 57d4dc1..f314002 100644 Binary files a/build/Debug/src/common/asm_code.obj and b/build/Debug/src/common/asm_code.obj differ diff --git a/build/Debug/src/common/hooking.obj b/build/Debug/src/common/hooking.obj index f4aa0d0..3c617f1 100644 Binary files a/build/Debug/src/common/hooking.obj and b/build/Debug/src/common/hooking.obj differ diff --git a/build/Debug/src/d2tweaks/client/client.obj b/build/Debug/src/d2tweaks/client/client.obj index da88437..dbb97fa 100644 Binary files a/build/Debug/src/d2tweaks/client/client.obj and b/build/Debug/src/d2tweaks/client/client.obj differ diff --git a/build/Debug/src/d2tweaks/client/modules/auto_gold_pickup/auto_gold_pickup_client.obj b/build/Debug/src/d2tweaks/client/modules/auto_gold_pickup/auto_gold_pickup_client.obj index ced0a26..3a00012 100644 Binary files a/build/Debug/src/d2tweaks/client/modules/auto_gold_pickup/auto_gold_pickup_client.obj and b/build/Debug/src/d2tweaks/client/modules/auto_gold_pickup/auto_gold_pickup_client.obj differ diff --git a/build/Debug/src/d2tweaks/client/modules/auto_item_pickup/auto_item_pickup_client.obj b/build/Debug/src/d2tweaks/client/modules/auto_item_pickup/auto_item_pickup_client.obj index b175ae3..c2dbb6f 100644 Binary files a/build/Debug/src/d2tweaks/client/modules/auto_item_pickup/auto_item_pickup_client.obj and b/build/Debug/src/d2tweaks/client/modules/auto_item_pickup/auto_item_pickup_client.obj differ diff --git a/build/Debug/src/d2tweaks/client/modules/autosort/autosort_client.obj b/build/Debug/src/d2tweaks/client/modules/autosort/autosort_client.obj index 667a816..9f8b908 100644 Binary files a/build/Debug/src/d2tweaks/client/modules/autosort/autosort_client.obj and b/build/Debug/src/d2tweaks/client/modules/autosort/autosort_client.obj differ diff --git a/build/Debug/src/d2tweaks/client/modules/client_module.obj b/build/Debug/src/d2tweaks/client/modules/client_module.obj index b2e1241..76aa59a 100644 Binary files a/build/Debug/src/d2tweaks/client/modules/client_module.obj and b/build/Debug/src/d2tweaks/client/modules/client_module.obj differ diff --git a/build/Debug/src/d2tweaks/client/modules/damage_display/damage_display_client.obj b/build/Debug/src/d2tweaks/client/modules/damage_display/damage_display_client.obj index 4dc58fb..cd0414e 100644 Binary files a/build/Debug/src/d2tweaks/client/modules/damage_display/damage_display_client.obj and b/build/Debug/src/d2tweaks/client/modules/damage_display/damage_display_client.obj differ diff --git a/build/Debug/src/d2tweaks/client/modules/item_drop_message/item_drop_message_client.obj b/build/Debug/src/d2tweaks/client/modules/item_drop_message/item_drop_message_client.obj index deae4f0..d957b9a 100644 Binary files a/build/Debug/src/d2tweaks/client/modules/item_drop_message/item_drop_message_client.obj and b/build/Debug/src/d2tweaks/client/modules/item_drop_message/item_drop_message_client.obj differ diff --git a/build/Debug/src/d2tweaks/client/modules/item_move/item_move_client.obj b/build/Debug/src/d2tweaks/client/modules/item_move/item_move_client.obj index a824e12..6027d78 100644 Binary files a/build/Debug/src/d2tweaks/client/modules/item_move/item_move_client.obj and b/build/Debug/src/d2tweaks/client/modules/item_move/item_move_client.obj differ diff --git a/build/Debug/src/d2tweaks/client/modules/loot_filter/loot_filter.obj b/build/Debug/src/d2tweaks/client/modules/loot_filter/loot_filter.obj index 00a07e6..698fe42 100644 Binary files a/build/Debug/src/d2tweaks/client/modules/loot_filter/loot_filter.obj and b/build/Debug/src/d2tweaks/client/modules/loot_filter/loot_filter.obj differ diff --git a/build/Debug/src/d2tweaks/client/modules/loot_filter/loot_filter_settings_menu.obj b/build/Debug/src/d2tweaks/client/modules/loot_filter/loot_filter_settings_menu.obj index 802db65..1cda60a 100644 Binary files a/build/Debug/src/d2tweaks/client/modules/loot_filter/loot_filter_settings_menu.obj and b/build/Debug/src/d2tweaks/client/modules/loot_filter/loot_filter_settings_menu.obj differ diff --git a/build/Debug/src/d2tweaks/client/modules/loot_filter/loot_filter_settings_toggle_menu.obj b/build/Debug/src/d2tweaks/client/modules/loot_filter/loot_filter_settings_toggle_menu.obj index ae9dc92..d5f6833 100644 Binary files a/build/Debug/src/d2tweaks/client/modules/loot_filter/loot_filter_settings_toggle_menu.obj and b/build/Debug/src/d2tweaks/client/modules/loot_filter/loot_filter_settings_toggle_menu.obj differ diff --git a/build/Debug/src/d2tweaks/client/modules/small_patches/small_patches.obj b/build/Debug/src/d2tweaks/client/modules/small_patches/small_patches.obj index a8266f3..b4b598a 100644 Binary files a/build/Debug/src/d2tweaks/client/modules/small_patches/small_patches.obj and b/build/Debug/src/d2tweaks/client/modules/small_patches/small_patches.obj differ diff --git a/build/Debug/src/d2tweaks/client/modules/test/test.obj b/build/Debug/src/d2tweaks/client/modules/test/test.obj index 23a5a12..b7f4669 100644 Binary files a/build/Debug/src/d2tweaks/client/modules/test/test.obj and b/build/Debug/src/d2tweaks/client/modules/test/test.obj differ diff --git a/build/Debug/src/d2tweaks/client/modules/trader_update/trader_update_client.obj b/build/Debug/src/d2tweaks/client/modules/trader_update/trader_update_client.obj index 4cbd354..9e10971 100644 Binary files a/build/Debug/src/d2tweaks/client/modules/trader_update/trader_update_client.obj and b/build/Debug/src/d2tweaks/client/modules/trader_update/trader_update_client.obj differ diff --git a/build/Debug/src/d2tweaks/client/modules/transmute/transmute_client.obj b/build/Debug/src/d2tweaks/client/modules/transmute/transmute_client.obj index 2bbe40b..6b55778 100644 Binary files a/build/Debug/src/d2tweaks/client/modules/transmute/transmute_client.obj and b/build/Debug/src/d2tweaks/client/modules/transmute/transmute_client.obj differ diff --git a/build/Debug/src/d2tweaks/common/asset_manager.obj b/build/Debug/src/d2tweaks/common/asset_manager.obj index 252cdec..e2d0711 100644 Binary files a/build/Debug/src/d2tweaks/common/asset_manager.obj and b/build/Debug/src/d2tweaks/common/asset_manager.obj differ diff --git a/build/Debug/src/d2tweaks/common/common.obj b/build/Debug/src/d2tweaks/common/common.obj index f4729ae..d83fe5e 100644 Binary files a/build/Debug/src/d2tweaks/common/common.obj and b/build/Debug/src/d2tweaks/common/common.obj differ diff --git a/build/Debug/src/d2tweaks/server/modules/auto_gold_pickup/auto_gold_pickup_server.obj b/build/Debug/src/d2tweaks/server/modules/auto_gold_pickup/auto_gold_pickup_server.obj index a402e01..96ad0b9 100644 Binary files a/build/Debug/src/d2tweaks/server/modules/auto_gold_pickup/auto_gold_pickup_server.obj and b/build/Debug/src/d2tweaks/server/modules/auto_gold_pickup/auto_gold_pickup_server.obj differ diff --git a/build/Debug/src/d2tweaks/server/modules/auto_item_pickup/auto_item_pickup_server.obj b/build/Debug/src/d2tweaks/server/modules/auto_item_pickup/auto_item_pickup_server.obj index b0a52ed..5853dec 100644 Binary files a/build/Debug/src/d2tweaks/server/modules/auto_item_pickup/auto_item_pickup_server.obj and b/build/Debug/src/d2tweaks/server/modules/auto_item_pickup/auto_item_pickup_server.obj differ diff --git a/build/Debug/src/d2tweaks/server/modules/autosort/autosort_server.obj b/build/Debug/src/d2tweaks/server/modules/autosort/autosort_server.obj index 605eeab..0b232f5 100644 Binary files a/build/Debug/src/d2tweaks/server/modules/autosort/autosort_server.obj and b/build/Debug/src/d2tweaks/server/modules/autosort/autosort_server.obj differ diff --git a/build/Debug/src/d2tweaks/server/modules/damage_display/damage_display_server.obj b/build/Debug/src/d2tweaks/server/modules/damage_display/damage_display_server.obj index 7e3aa09..404c638 100644 Binary files a/build/Debug/src/d2tweaks/server/modules/damage_display/damage_display_server.obj and b/build/Debug/src/d2tweaks/server/modules/damage_display/damage_display_server.obj differ diff --git a/build/Debug/src/d2tweaks/server/modules/identify_on_pickup/identify_on_pickup_server.obj b/build/Debug/src/d2tweaks/server/modules/identify_on_pickup/identify_on_pickup_server.obj index 65106a8..659d176 100644 Binary files a/build/Debug/src/d2tweaks/server/modules/identify_on_pickup/identify_on_pickup_server.obj and b/build/Debug/src/d2tweaks/server/modules/identify_on_pickup/identify_on_pickup_server.obj differ diff --git a/build/Debug/src/d2tweaks/server/modules/item_drop_message/item_drop_message_server.obj b/build/Debug/src/d2tweaks/server/modules/item_drop_message/item_drop_message_server.obj index c6086be..5413895 100644 Binary files a/build/Debug/src/d2tweaks/server/modules/item_drop_message/item_drop_message_server.obj and b/build/Debug/src/d2tweaks/server/modules/item_drop_message/item_drop_message_server.obj differ diff --git a/build/Debug/src/d2tweaks/server/modules/item_move/item_move_server.obj b/build/Debug/src/d2tweaks/server/modules/item_move/item_move_server.obj index 96ae28a..9d26d46 100644 Binary files a/build/Debug/src/d2tweaks/server/modules/item_move/item_move_server.obj and b/build/Debug/src/d2tweaks/server/modules/item_move/item_move_server.obj differ diff --git a/build/Debug/src/d2tweaks/server/modules/test/test.obj b/build/Debug/src/d2tweaks/server/modules/test/test.obj index ca5a57a..0c65f6d 100644 Binary files a/build/Debug/src/d2tweaks/server/modules/test/test.obj and b/build/Debug/src/d2tweaks/server/modules/test/test.obj differ diff --git a/build/Debug/src/d2tweaks/server/modules/trader_update/trader_update_server.obj b/build/Debug/src/d2tweaks/server/modules/trader_update/trader_update_server.obj index e16e30a..555bebc 100644 Binary files a/build/Debug/src/d2tweaks/server/modules/trader_update/trader_update_server.obj and b/build/Debug/src/d2tweaks/server/modules/trader_update/trader_update_server.obj differ diff --git a/build/Debug/src/d2tweaks/server/modules/transmute/transmute_server.obj b/build/Debug/src/d2tweaks/server/modules/transmute/transmute_server.obj index 8aded4b..03b7640 100644 Binary files a/build/Debug/src/d2tweaks/server/modules/transmute/transmute_server.obj and b/build/Debug/src/d2tweaks/server/modules/transmute/transmute_server.obj differ diff --git a/build/Debug/src/d2tweaks/server/server.obj b/build/Debug/src/d2tweaks/server/server.obj index cd7b5cd..c628ff5 100644 Binary files a/build/Debug/src/d2tweaks/server/server.obj and b/build/Debug/src/d2tweaks/server/server.obj differ diff --git a/build/Debug/src/d2tweaks/ui/controls/button.obj b/build/Debug/src/d2tweaks/ui/controls/button.obj index aacc5f3..14eafdb 100644 Binary files a/build/Debug/src/d2tweaks/ui/controls/button.obj and b/build/Debug/src/d2tweaks/ui/controls/button.obj differ diff --git a/build/Debug/src/d2tweaks/ui/controls/checkbox.obj b/build/Debug/src/d2tweaks/ui/controls/checkbox.obj index 99eda29..906d10a 100644 Binary files a/build/Debug/src/d2tweaks/ui/controls/checkbox.obj and b/build/Debug/src/d2tweaks/ui/controls/checkbox.obj differ diff --git a/build/Debug/src/d2tweaks/ui/controls/group.obj b/build/Debug/src/d2tweaks/ui/controls/group.obj index bfcd6ee..0ba5d50 100644 Binary files a/build/Debug/src/d2tweaks/ui/controls/group.obj and b/build/Debug/src/d2tweaks/ui/controls/group.obj differ diff --git a/build/Debug/src/d2tweaks/ui/controls/image.obj b/build/Debug/src/d2tweaks/ui/controls/image.obj index 8b2de93..04d95ea 100644 Binary files a/build/Debug/src/d2tweaks/ui/controls/image.obj and b/build/Debug/src/d2tweaks/ui/controls/image.obj differ diff --git a/build/Debug/src/d2tweaks/ui/controls/label.obj b/build/Debug/src/d2tweaks/ui/controls/label.obj index 0b8f066..5b41b31 100644 Binary files a/build/Debug/src/d2tweaks/ui/controls/label.obj and b/build/Debug/src/d2tweaks/ui/controls/label.obj differ diff --git a/build/Debug/src/d2tweaks/ui/menu.obj b/build/Debug/src/d2tweaks/ui/menu.obj index 8c1cb0e..f54c355 100644 Binary files a/build/Debug/src/d2tweaks/ui/menu.obj and b/build/Debug/src/d2tweaks/ui/menu.obj differ diff --git a/build/Debug/src/d2tweaks/ui/ui_manager.obj b/build/Debug/src/d2tweaks/ui/ui_manager.obj index 1bb72df..c4bb72f 100644 Binary files a/build/Debug/src/d2tweaks/ui/ui_manager.obj and b/build/Debug/src/d2tweaks/ui/ui_manager.obj differ diff --git a/build/Debug/src/diablo2/d2client.obj b/build/Debug/src/diablo2/d2client.obj index 907dd78..903ac8c 100644 Binary files a/build/Debug/src/diablo2/d2client.obj and b/build/Debug/src/diablo2/d2client.obj differ diff --git a/build/Debug/src/diablo2/d2common.obj b/build/Debug/src/diablo2/d2common.obj index abdbe8a..2a8cc28 100644 Binary files a/build/Debug/src/diablo2/d2common.obj and b/build/Debug/src/diablo2/d2common.obj differ diff --git a/build/Debug/src/diablo2/d2gfx.obj b/build/Debug/src/diablo2/d2gfx.obj index 027b345..1dfbba1 100644 Binary files a/build/Debug/src/diablo2/d2gfx.obj and b/build/Debug/src/diablo2/d2gfx.obj differ diff --git a/build/Debug/src/diablo2/d2win.obj b/build/Debug/src/diablo2/d2win.obj index fa3209e..e182887 100644 Binary files a/build/Debug/src/diablo2/d2win.obj and b/build/Debug/src/diablo2/d2win.obj differ diff --git a/build/Debug/src/diablo2/utils/screen.obj b/build/Debug/src/diablo2/utils/screen.obj index dabb198..db4fb80 100644 Binary files a/build/Debug/src/diablo2/utils/screen.obj and b/build/Debug/src/diablo2/utils/screen.obj differ diff --git a/build/Debug/src/main.obj b/build/Debug/src/main.obj index 0862508..a23cbb3 100644 Binary files a/build/Debug/src/main.obj and b/build/Debug/src/main.obj differ diff --git a/build/Debug/vc143.pdb b/build/Debug/vc143.pdb index 4bd4cab..ef0a1c4 100644 Binary files a/build/Debug/vc143.pdb and b/build/Debug/vc143.pdb differ diff --git a/src/d2tweaks/client/modules/autosort/autosort_client.cpp b/src/d2tweaks/client/modules/autosort/autosort_client.cpp index 97e9f1c..db98a78 100644 --- a/src/d2tweaks/client/modules/autosort/autosort_client.cpp +++ b/src/d2tweaks/client/modules/autosort/autosort_client.cpp @@ -117,6 +117,20 @@ public: + // Function to find the Diablo II window handle + HWND FindDiabloIIWindow() { + return FindWindow(NULL, "Diablo II"); + } + + // Function to draw a filled rectangle using GDI + void DrawFilledRect(HWND hwnd, int left, int top, int right, int bottom, COLORREF color) { + HDC hdc = GetDC(hwnd); + HBRUSH hBrush = CreateSolidBrush(color); + RECT rect = { left, top, right, bottom }; + FillRect(hdc, &rect, hBrush); + DeleteObject(hBrush); + ReleaseDC(hwnd, hdc); + } @@ -303,6 +317,56 @@ public: diablo2::ui_color_t::UI_COLOR_WHITE; + // print player health, mana, and stamina bars, lastexp, nextexp, and level + // Get current HP, Mana, and Stamina along with their maximum values + int statHP = diablo2::d2_common::get_stat(player, static_cast(6), NULL); + int statMaxHP = diablo2::d2_common::get_stat(player, static_cast(7), NULL); + int statMana = diablo2::d2_common::get_stat(player, static_cast(8), NULL); + int statMaxMana = diablo2::d2_common::get_stat(player, static_cast(9), NULL); + int statStamina = diablo2::d2_common::get_stat(player, static_cast(10), NULL); + int statMaxStamina = diablo2::d2_common::get_stat(player, static_cast(11), NULL); + + // Calculate the percentages of current HP, Mana, and Stamina + float healthPercentage = static_cast(statHP) / static_cast(statMaxHP); + float manaPercentage = static_cast(statMana) / static_cast(statMaxMana); + float staminaPercentage = static_cast(statStamina) / static_cast(statMaxStamina); + + // Define the dimensions for the bars + int barWidth = 200; // Width of the bars + int barHeight = 10; // Height of the bars + + // Define the coordinates for the bars + int barX = 15; // Left coordinate of the bars + int barY_HP = 600; // Top coordinate of the HP bar + int barY_Mana = barY_HP + barHeight + 4; // Top coordinate of the Mana bar with separator + int barY_Stamina = barY_Mana + barHeight + 4; // Top coordinate of the Stamina bar with separator + + + + // Calculate the filled widths of the bars + int filledHPWidth = static_cast(healthPercentage * barWidth); + int filledManaWidth = static_cast(manaPercentage * barWidth); + int filledStaminaWidth = static_cast(staminaPercentage * barWidth); + + HWND diabloIIWnd = FindDiabloIIWindow(); + + // Draw the filled HP bar + // diablo2::d2_gfx::draw_filled_rect(barX, barY_HP, barX + filledHPWidth, barY_HP + barHeight, 1, 7); + DrawFilledRect(diabloIIWnd, barX, barY_HP, barX + filledHPWidth, barY_HP + barHeight, RGB(255, 0, 0)); // Red color for HP + + + // Draw the filled Mana bar + // diablo2::d2_gfx::draw_filled_rect(barX, barY_Mana, barX + filledManaWidth, barY_Mana + barHeight, 3, 7); + DrawFilledRect(diabloIIWnd, barX, barY_Mana, barX + filledManaWidth, barY_Mana + barHeight, RGB(100, 100, 255)); // Blue color for Mana + + // Draw the filled Stamina bar + // diablo2::d2_gfx::draw_filled_rect(barX, barY_Stamina, barX + filledStaminaWidth, barY_Stamina + barHeight, 9, 7); + DrawFilledRect(diabloIIWnd, barX, barY_Stamina, barX + filledStaminaWidth, barY_Stamina + barHeight, RGB(255, 255, 0)); // Green color for Stamina + + int statLevel = diablo2::d2_common::get_stat(player, static_cast(12), NULL); + int statLastExp = diablo2::d2_common::get_stat(player, static_cast(29), NULL); + int statNextExp = diablo2::d2_common::get_stat(player, static_cast(30), NULL); + diff --git a/src/d2tweaks/client/modules/damage_display/damage_display_client.cpp b/src/d2tweaks/client/modules/damage_display/damage_display_client.cpp index 287ccf0..aa49a82 100644 --- a/src/d2tweaks/client/modules/damage_display/damage_display_client.cpp +++ b/src/d2tweaks/client/modules/damage_display/damage_display_client.cpp @@ -221,79 +221,35 @@ static void draw_damage_labels() { // Determine the color based on healthPercentage diablo2::ui_color_t textColor; - if (healthPercentage >= 0.67f) { - textColor = diablo2::UI_COLOR_GREEN; - } - else if (healthPercentage <= 0.33f) { - textColor = diablo2::UI_COLOR_RED; - } - else { - textColor = diablo2::UI_COLOR_YELLOW; - } - int bMaxWidth = 100; - - // Calculate the width of the health bar based on the percentage (max width is 10 characters) - uint32_t barWidth = static_cast(healthPercentage * 10.0f); - barWidth = (barWidth > bMaxWidth) ? bMaxWidth : barWidth; // Ensure barWidth doesn't exceed 10 - barWidth = (label->currentHp > 0 && barWidth == 0) ? 1 : barWidth; // Ensure at least one '#' if currentHp is not 0 - - char barChar[1]; GetPrivateProfileStringA("Options", "char", "", barChar, sizeof(barChar), "./D2Tweaks.ini"); - - LPWSTR barCharW = reinterpret_cast(barChar); - - // Construct the health bar string representation - std::wstring barText; - for (uint32_t i = 0; i < barWidth; ++i) { - barText.append(barCharW); // Use '#' to represent filled portion of the bar - } - for (uint32_t i = barWidth; i < bMaxWidth; ++i) { - barText.append(L""); // Use '-' to represent empty portion of the bar - } + textColor = healthPercentage >= 0.67f ? diablo2::UI_COLOR_GREEN : (healthPercentage <= 0.33f ? diablo2::UI_COLOR_RED : diablo2::UI_COLOR_YELLOW); // Construct the health fraction string std::wstring fractionStr = std::to_wstring(label->currentHp) + L"/" + std::to_wstring(label->maxHp); // Combine the strings for health percentage and bar text std::wstring combinedText = std::to_wstring(static_cast(healthPercentage * 100.0f)) + L"% [" + fractionStr + L"]"; - const WCHAR* combinedTextPtr = combinedText.c_str(); // Calculate text position for the combined text uint32_t textX = mx; uint32_t textY = my; - // Draw the combined text (health percentage and bar text) //diablo2::d2_win::draw_text(const_cast(combinedTcombinedTextext.c_str()), textX, textY, textColor, 0); //diablo2::d2_win::draw_boxed_text(const_cast(fractionStr.c_str()), textX + label->unit_width/2, textY - 12, 0, 0, textColor); - - diablo2::d2_win::set_current_font(diablo2::UI_FONT_6); // Set font to FONT16 + //diablo2::d2_win::set_current_font(diablo2::UI_FONT_6); // Set font to FONT16 //diablo2::d2_win::draw_text(const_cast(fractionStr.c_str()), textX + diablo2::d2_win::get_text_pixel_width(const_cast(combinedTextPtr)) / 2, textY - 12, textColor, 0); - - diablo2::d2_win::set_current_font(diablo2::UI_FONT_6); // Set font to FONT6 + //diablo2::d2_win::set_current_font(diablo2::UI_FONT_6); // Set font to FONT6 //diablo2::d2_win::draw_text(const_cast(combinedText.c_str()), textX, textY, textColor, 0); - - HWND hWndDiabloII = findDiabloIIWindow(); - - - int _barHeight = GetPrivateProfileIntA("Options", "barHeight", 0, "./D2Tweaks.ini"); - int _barWidth = GetPrivateProfileIntA("Options", "barWidth", 0, "./D2Tweaks.ini"); - - if (GetTickCount64() >= nEndTime) { - nEndTime = GetTickCount64() + DURATION; - } //drawHealthBar(hWndDiabloII, textX, textY, _barWidth, _barHeight, healthPercentage, RGB(255, 0, 0), RGB(0, 0, 0)); - //onDraw(hWndDiabloII, textX, textY, _barWidth, _barHeight, healthPercentage, RGB(255, 0, 0), RGB(0, 0, 0)); - //diablo2::d2_win::draw_boxed_text(const_cast(combinedText.c_str()), textX, textY, 0, 3, textColor); + int _barHeight = GetPrivateProfileIntA("Options", "barHeight", 0, "./D2Tweaks.ini"); + diablo2::d2_win::draw_text(const_cast(combinedText.c_str()), textX, textY, textColor, 0); - diablo2::d2_gfx::draw_filled_rect(textX, textY, textX + healthPercentage * 60, textY + _barHeight, 9, 7); - - - + diablo2::d2_gfx::draw_filled_rect(textX, textY, textX + healthPercentage * 60, textY + _barHeight, 9, 7); const auto offset = static_cast(lerp(static_cast(label->unit_height) + 5.f, static_cast(label->unit_height) + 30.f, static_cast(delta) / static_cast(DISPLAY_TIME))); my -= offset; diff --git a/src/d2tweaks/client/modules/loot_filter/loot_filter_settings_toggle_menu.cpp b/src/d2tweaks/client/modules/loot_filter/loot_filter_settings_toggle_menu.cpp index 8c10528..e81c73c 100644 --- a/src/d2tweaks/client/modules/loot_filter/loot_filter_settings_toggle_menu.cpp +++ b/src/d2tweaks/client/modules/loot_filter/loot_filter_settings_toggle_menu.cpp @@ -9,7 +9,7 @@ #include #include -bool m_stats_enabled = false; +bool m_stats_enabled = true; d2_tweaks::client::modules::loot_filter_settings_toggle_menu::loot_filter_settings_toggle_menu(token) { m_show = false;