diff --git a/ClassDiagram.cd b/ClassDiagram.cd
new file mode 100644
index 0000000..7b89419
--- /dev/null
+++ b/ClassDiagram.cd
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/D2tweaks.vcxproj b/D2tweaks.vcxproj
index b3ebdc3..7bd1f67 100644
--- a/D2tweaks.vcxproj
+++ b/D2tweaks.vcxproj
@@ -180,6 +180,7 @@
+
diff --git a/build/Debug/D2tweaks.ilk b/build/Debug/D2tweaks.ilk
index a789d5e..161f944 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 ae7cdff..80bf905 100644
--- a/build/Debug/D2tweaks.log
+++ b/build/Debug/D2tweaks.log
@@ -1,11 +1,2 @@
- autosort_client.cpp
-D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\autosort\autosort_client.cpp(197,15): warning C4018: '<': signed/unsigned mismatch
-D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\autosort\autosort_client.cpp(197,66): warning C4018: '<=': signed/unsigned mismatch
-D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\autosort\autosort_client.cpp(252,41): warning C4244: '=': conversion from 'double' to 'int32_t', possible loss of data
-D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\autosort\autosort_client.cpp(255,43): warning C4244: '=': conversion from 'double' to 'int32_t', possible loss of data
-D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\autosort\autosort_client.cpp(258,41): warning C4244: '=': conversion from 'double' to 'int32_t', possible loss of data
-D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\autosort\autosort_client.cpp(261,43): warning C4244: '=': conversion from 'double' to 'int32_t', possible loss of data
-D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\autosort\autosort_client.cpp(264,41): warning C4244: '=': conversion from 'double' to 'int32_t', possible loss of data
-D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\autosort\autosort_client.cpp(282,41): warning C4244: '=': conversion from 'double' to 'int32_t', possible loss of data
-D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\autosort\autosort_client.cpp(288,41): warning C4244: '=': conversion from 'double' to 'int32_t', possible loss of data
+ ui_manager.cpp
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 edf5b32..a3c2d44 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 56a34b9..f27937e 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 509a5ea..6bfc0be 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..23975a3 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/d2tweaks/client/client.obj b/build/Debug/src/d2tweaks/client/client.obj
index fc8d246..f073a6b 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 72ed981..63511c6 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 2e1893a..c1f1dd1 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 0f01f22..5de6405 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/damage_display/damage_display_client.obj b/build/Debug/src/d2tweaks/client/modules/damage_display/damage_display_client.obj
index ec43548..5755354 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 82df900..971d65e 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 fc2d283..12a6176 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_settings_menu.obj b/build/Debug/src/d2tweaks/client/modules/loot_filter/loot_filter_settings_menu.obj
index 58bd88a..e6040e3 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 7e79c27..3b04eb2 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/test/test.obj b/build/Debug/src/d2tweaks/client/modules/test/test.obj
index 6926f5f..2b1220b 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 e23cff3..3cb104c 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 e83204f..fb1958d 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/common.obj b/build/Debug/src/d2tweaks/common/common.obj
index ec17bf7..1d098bf 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 7c3f467..3e66845 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 7be5b70..62875cf 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 6090204..0fba90f 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 56d6994..b2e8dab 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 49990e9..9a1d8fd 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 51df1b4..ae0c6f3 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 9a8bd94..01c8688 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/server_module.obj b/build/Debug/src/d2tweaks/server/modules/server_module.obj
index 5d74cd3..309bf70 100644
Binary files a/build/Debug/src/d2tweaks/server/modules/server_module.obj and b/build/Debug/src/d2tweaks/server/modules/server_module.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 412667d..fc943fe 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 f12b4d2..3f3c3e4 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 208bf4a..3db4bbe 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 b6d6635..526b943 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/ui_manager.obj b/build/Debug/src/d2tweaks/ui/ui_manager.obj
index a1e2b03..1103bc0 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/d2common.obj b/build/Debug/src/diablo2/d2common.obj
index 08617ba..dc8330a 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/d2game.obj b/build/Debug/src/diablo2/d2game.obj
index ce19ca2..dd07b84 100644
Binary files a/build/Debug/src/diablo2/d2game.obj and b/build/Debug/src/diablo2/d2game.obj differ
diff --git a/build/Debug/src/diablo2/d2lang.obj b/build/Debug/src/diablo2/d2lang.obj
index d07f666..38bd9ca 100644
Binary files a/build/Debug/src/diablo2/d2lang.obj and b/build/Debug/src/diablo2/d2lang.obj differ
diff --git a/build/Debug/src/diablo2/utils/screen.obj b/build/Debug/src/diablo2/utils/screen.obj
index ab679ef..5547358 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 85f753d..209dfa0 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 93a3328..872201f 100644
Binary files a/build/Debug/vc143.pdb and b/build/Debug/vc143.pdb differ
diff --git a/include/diablo2/d2common.h b/include/diablo2/d2common.h
index aada8d3..fed8504 100644
--- a/include/diablo2/d2common.h
+++ b/include/diablo2/d2common.h
@@ -1044,5 +1044,11 @@ namespace diablo2 {
// Write a function signature for this function
static structures::D2ItemStatCostTxt* get_item_stat_cost_record(int nStatId);
+ //D2Common.0x6FD57720 (#10602)
+ //int __stdcall DATATBLS_GetItemIdFromItemCode(uint32_t dwCode)
+ static int get_item_id_from_item_code(uint32_t dwCode);
+
+
+
};
}
diff --git a/include/diablo2/d2game.h b/include/diablo2/d2game.h
index 0adc437..2a81318 100644
--- a/include/diablo2/d2game.h
+++ b/include/diablo2/d2game.h
@@ -47,5 +47,8 @@ namespace diablo2 {
static void update_inventory_items(structures::game* game, structures::unit* player);
static uint32_t __fastcall diablo2::d2_game::transmogrify(diablo2::structures::game* game, diablo2::structures::unit* player);
+
+ //D2Game.0x6FC4ED80
+ structures::unit* __fastcall D2GAME_CreateItemEx_6FC4ED80(structures::game* pGame, structures::D2ItemDropStrc* pItemDrop, int32_t a3);
};
}
diff --git a/include/diablo2/structures/unit.h b/include/diablo2/structures/unit.h
index 965ce97..e2718e6 100644
--- a/include/diablo2/structures/unit.h
+++ b/include/diablo2/structures/unit.h
@@ -1,6 +1,8 @@
#pragma once
#include
+#include "room.h"
+#include
#pragma pack(push, 1)
@@ -74,6 +76,50 @@ namespace diablo2 {
ITEMFLAG_ITEM = 0x08000000
};
+ struct D2SeedStrc
+ {
+ union
+ {
+ struct
+ {
+ uint32_t nLowSeed; //0x00
+ uint32_t nHighSeed; //0x04
+ };
+ uint64_t lSeed; //0x00
+ };
+ };
+
+ struct D2ItemDropStrc
+ {
+ diablo2::structures::unit* pUnit; //0x00
+ D2SeedStrc* pSeed; //0x04
+ diablo2::structures::game* pGame; //0x08
+ int32_t nItemLvl; //0x0C
+ uint32_t unk0x10; //0x10
+ int32_t nId; //0x14
+ int32_t nSpawnType; //0x18 [3 for ground spawn, 4 for inv spawn]
+ int32_t nX; //0x1C
+ int32_t nY; //0x20
+ diablo2::structures::room* pRoom; //0x24
+ uint16_t wUnitInitFlags; //0x28
+ uint16_t wItemFormat; //0x2A [ptGame0x0x78]
+ BOOL bForce; //0x2C
+ int32_t nQuality; //0x30
+ int32_t nQuantity; //0x34
+ int32_t nMinDur; //0x38
+ int32_t nMaxDur; //0x3C
+ int32_t nItemIndex; //0x40
+ uint32_t dwFlags1; //0x44 - itemflag override (used when force is true)
+ uint32_t dwSeed; //0x48 - overrides the seed, used when force is true
+ uint32_t dwItemSeed; //0x4C - overrides the item seed when force is true
+ int32_t eEarLvl; //0x50
+ int32_t nQtyOverride; //0x54
+ char szName[16]; //0x58
+ int32_t nPrefix[3]; //0x68
+ int32_t nSuffix[3]; //0x74
+ uint32_t dwFlags2; //0x80
+ };
+
struct unit {
unit_type_t type;
diff --git a/src/d2tweaks/client/modules/autosort/autosort_client.cpp b/src/d2tweaks/client/modules/autosort/autosort_client.cpp
index 83262bf..f789d63 100644
--- a/src/d2tweaks/client/modules/autosort/autosort_client.cpp
+++ b/src/d2tweaks/client/modules/autosort/autosort_client.cpp
@@ -236,15 +236,9 @@ public:
for (const auto& stat : stats) {
int param = stat.param;
int op = stat.op;
-
- int32_t spirits = diablo2::d2_common::get_stat(player, static_cast(185), NULL);
- int32_t soulscaptured = statValue = diablo2::d2_common::get_stat(player, static_cast(184), NULL);
-
auto statline = diablo2::d2_common::get_item_stat_cost_record(stat.stat);
-
auto opBase = statline->wOpBase;
auto opStat = statline->wOpStat[0];
-
auto opBaseValue = diablo2::d2_common::get_stat(player, static_cast(opBase), NULL);
auto opStatValue = diablo2::d2_common::get_stat(player, static_cast(opStat), NULL);
@@ -299,8 +293,6 @@ public:
if (!diablo2::d2_client::get_ui_window_state(diablo2::UI_WINDOW_STASH)
&& !diablo2::d2_client::get_ui_window_state(diablo2::UI_WINDOW_CHARACTER)
- // && !diablo2::d2_client::get_ui_window_state(diablo2::UI_WINDOW_INVENTORY)
- // && !diablo2::d2_client::get_ui_window_state(diablo2::UI_WINDOW_SKILL)
&& !diablo2::d2_client::get_ui_window_state(diablo2::UI_WINDOW_CHAT)
&& !diablo2::d2_client::get_ui_window_state(diablo2::UI_WINDOW_NPCMENU)
&& !diablo2::d2_client::get_ui_window_state(diablo2::UI_WINDOW_MAINMENU)
@@ -329,34 +321,25 @@ public:
//diablo2::d2_win::draw_boxed_text(const_cast(statText.c_str()), stat.x1, stat.y1 + textOffset, 1, 0, stat.colorStat);
//diablo2::d2_win::draw_boxed_text(const_cast(statValueStr.c_str()), stat.x2, stat.y2 + textOffset, 1, 4, stat.colorStatValue);
-
// diablo2::d2_win::set_current_font(diablo2::UI_FONT_16); // Set font to FONT16
-
//diablo2::structures::d2_cmp::init_gfx_data(&g_gfxdata);
-
//diablo2::d2_gfx::draw_image(&g_gfxdata, 200, 200, 1, 5, 0);
-
// instead try to load direct jpg with gdi and insetad ofloading jpg file, specify it bb64 encoded and decode it.
}
}
if (m_help_enabled) {
- const int windowWidth = 1280;
- const int windowHeight = 768;
-
- const int boxWidth = 1000;
- const int boxHeight = 680;
-
- const int boxX = (windowWidth - boxWidth) / 2;
- const int boxY = (windowHeight - boxHeight) / 2;
-
- const std::string helpText = "This is a sample help screen! You can put help text in here!?";
-
- // Draw filled background box
- diablo2::d2_gfx::draw_filled_rect(boxX, boxY, boxX + boxWidth, boxY + boxHeight, 0, 255);
-
- // Draw justified text inside the box with padding
- drawJustifiedTextInBox(helpText, boxX, boxY, boxWidth, boxHeight, 0);
+ //const int windowWidth = 1280;
+ //const int windowHeight = 768;
+ //const int boxWidth = 1000;
+ //const int boxHeight = 680;
+ //const int boxX = (windowWidth - boxWidth) / 2;
+ //const int boxY = (windowHeight - boxHeight) / 2;
+ //const std::string helpText = "This is a sample help screen! You can put help text in here!?";
+ //// Draw filled background box
+ //diablo2::d2_gfx::draw_filled_rect(boxX, boxY, boxX + boxWidth, boxY + boxHeight, 0, 255);
+ //// Draw justified text inside the box with padding
+ //drawJustifiedTextInBox(helpText, boxX, boxY, boxWidth, boxHeight, 0);
}
diablo2::ui_color_t::UI_COLOR_WHITE;
@@ -391,8 +374,6 @@ public:
int sHCenter = sHeight / 2;
int sWCenter = sWidth / 2;
- //spdlog::info("healthPercentage: {}", healthPercentage);
-
// Define default bar color
DWORD barColor = 0;
@@ -407,42 +388,54 @@ public:
barColor = 5;
}
- //spdlog::info("barColor: {}", barColor);
-
// Define the dimensions for the bars
- int barWidth = 200; // Width of the bars
- int barHeight = 16; // Height of the bars
+ int pbarWidth = GetPrivateProfileIntA("Options", "pbarWidth", 200, "./d2tweaks.ini");
+ int pbarHeight = GetPrivateProfileIntA("Options", "pbarHeight", 16, "./d2tweaks.ini");
+
// Define the coordinates for the bars
int barX = 245; // Left coordinate of the bars
int barY_HP = 728; // 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
+ int barY_Mana = barY_HP + pbarHeight + 4; // Top coordinate of the Mana bar with separator
+ int barY_Stamina = barY_Mana + pbarHeight + 4; // Top coordinate of the Stamina bar with separator
std::wstring life = strHP + L" / " + strMaxHP;
std::wstring mana = strMana + L" / " + strMaxMana;
std::wstring stamina = strStamina + L" / " + strMaxStamina;
// 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);
+ int filledHPWidth = static_cast(healthPercentage * pbarWidth);
+ int filledManaWidth = static_cast(manaPercentage * pbarWidth);
+ int filledStaminaWidth = static_cast(staminaPercentage * pbarWidth);
// at 345 we need to minus the width of the text
sWCenter = barX + 100 - (diablo2::d2_win::get_text_pixel_width(const_cast(mana.c_str())) / 2);
HWND diabloIIWnd = FindDiabloIIWindow();
- // Draw the filled HP bar
- diablo2::d2_gfx::draw_filled_rect(barX, barY_HP, barX + filledHPWidth, barY_HP + barHeight, barColor, 255);
- //DrawFilledRect(diabloIIWnd, barX, barY_HP, barX + filledHPWidth, barY_HP + barHeight, RGB(255, 0, 0)); // Red color for HP
- diablo2::d2_win::draw_text(const_cast(life.c_str()), sWCenter, barY_HP + 15, diablo2::UI_COLOR_WHITE, 0);
+ // Get player_bars_enabled from [Options] in d2tweaks.ini
+ int player_bars_enabled_hp = GetPrivateProfileIntA("Options", "player_bars_hp_enabled", 1, "./d2tweaks.ini");
+ int player_bars_X_hp = GetPrivateProfileIntA("Options", "player_bars_hp_X", barX, "./d2tweaks.ini");
+ int player_bars_Y_hp = GetPrivateProfileIntA("Options", "player_bars_hp_Y", barY_HP, "./d2tweaks.ini");
- // Draw the filled Mana bar
- diablo2::d2_gfx::draw_filled_rect(barX, barY_Mana, barX + filledManaWidth, barY_Mana + barHeight, 140, 255);
- //DrawFilledRect(diabloIIWnd, barX, barY_Mana, barX + filledManaWidth, barY_Mana + barHeight, RGB(100, 100, 255)); // Blue color for Mana
- diablo2::d2_win::draw_text(const_cast(mana.c_str()), sWCenter, barY_Mana + 15, diablo2::UI_COLOR_WHITE, 0);
+ int player_bars_enabled_mana = GetPrivateProfileIntA("Options", "player_bars_mana_enabled", 1, "./d2tweaks.ini");
+ int player_bars_X_mana = GetPrivateProfileIntA("Options", "player_bars_mana_X", barX, "./d2tweaks.ini");
+ int player_bars_Y_mana = GetPrivateProfileIntA("Options", "player_bars_mana_Y", barY_Mana, "./d2tweaks.ini");
+
+
+ if (player_bars_enabled_hp == 1) {
+ // Draw the filled HP bar
+ diablo2::d2_gfx::draw_filled_rect(player_bars_X_hp, player_bars_Y_hp, barX + filledHPWidth, barY_HP + pbarHeight, barColor, 255);
+ //DrawFilledRect(diabloIIWnd, barX, barY_HP, barX + filledHPWidth, barY_HP + barHeight, RGB(255, 0, 0)); // Red color for HP
+ diablo2::d2_win::draw_text(const_cast(life.c_str()), sWCenter, barY_HP + 15, diablo2::UI_COLOR_WHITE, 0);
+ }
+ if (player_bars_enabled_mana == 1) {
+ // Draw the filled Mana bar
+ diablo2::d2_gfx::draw_filled_rect(player_bars_X_mana, player_bars_Y_mana, barX + filledManaWidth, barY_Mana + pbarHeight, 140, 255);
+ //DrawFilledRect(diabloIIWnd, barX, barY_Mana, barX + filledManaWidth, barY_Mana + barHeight, RGB(100, 100, 255)); // Blue color for Mana
+ diablo2::d2_win::draw_text(const_cast(mana.c_str()), sWCenter, barY_Mana + 15, diablo2::UI_COLOR_WHITE, 0);
+ }
/*
// Define the number of separators
int numColors = 256;
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 b6836b9..bede0df 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
@@ -5,91 +5,45 @@
#include
#include
#include
-#include
+#include
#include
#include
-
-#include
-
-#include
-#include
-#include
-
-#include
-#include
-#include
-
-#include // For system function
-
-#include // For ShellExecute
#include
#include
-
+#include // For system function
+#include // For ShellExecute
#include
#include
-
#include
-
#include
-
#include
-
-#include
-#include
-#include
-#include
#include
-
-#include
-
#include
-
-#include
-
-#include
-
#include
-#include
#include
-
-#include
-#include
#include
-#include
-
-#include
-#include
#include
-#include
#include
-
#include
#include
#include
#include
-
#include
#include
#include
#include
-
#include
#include
-#include
#include
#include
#include
#include
#include
-#include
#include
#include