diff --git a/build/Debug/D2tweaks.ilk b/build/Debug/D2tweaks.ilk index d9598e8..8123b65 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 7158d17..cfefdbc 100644 --- a/build/Debug/D2tweaks.log +++ b/build/Debug/D2tweaks.log @@ -1,2 +1,39 @@ - loot_filter_settings_menu.cpp + client.cpp + 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 + auto_gold_pickup_client.cpp + auto_item_pickup_client.cpp + damage_display_client.cpp +D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\damage_display\damage_display_client.cpp(135,12): warning C4244: 'argument': conversion from 'time_t' to 'unsigned int', possible loss of data +D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\damage_display\damage_display_client.cpp(140,31): warning C4244: '=': conversion from 'ULONGLONG' to 'long', possible loss of data +D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\damage_display\damage_display_client.cpp(264,59): warning C4244: 'argument': conversion from 'float' to 'int', possible loss of data + item_drop_message_client.cpp + item_move_client.cpp +D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\item_move\item_move_client.cpp(99,33): warning C4018: '<': signed/unsigned mismatch + loot_filter.cpp + loot_filter_settings.cpp + loot_filter_settings_menu.cpp + loot_filter_settings_toggle_menu.cpp + test.cpp + trader_update_client.cpp + transmute_client.cpp + autosort_server.cpp +D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\server\modules\autosort\autosort_server.cpp(363,25): warning C4018: '<=': signed/unsigned mismatch +D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\server\modules\autosort\autosort_server.cpp(364,26): warning C4018: '<=': signed/unsigned mismatch + auto_gold_pickup_server.cpp +D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\server\modules\auto_gold_pickup\auto_gold_pickup_server.cpp(49,33): warning C4018: '>': signed/unsigned mismatch + auto_item_pickup_server.cpp + damage_display_server.cpp + identify_on_pickup_server.cpp + item_drop_message_server.cpp + item_move_server.cpp +D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\server\modules\item_move\item_move_server.cpp(144,1): warning C4715: 'd2_tweaks::server::modules::item_move::handle_packet': not all control paths return a value + test.cpp + trader_update_server.cpp + transmute_server.cpp + ui_manager.cpp + d2common.cpp + screen.cpp + LINK : ..\..\Diablo II\MODS\ironman-dev\D2tweaks.dll not found or not built by the last incremental link; performing full link 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 6062a06..f04a14a 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 66b6c19..02dad55 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 e352890..ae5c41f 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..8f2dc7a 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 fd2f133..42281cc 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 a14152d..6682a87 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 232cf8e..b5feb6c 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 fbc2f9b..5d65b6f 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 5c09a40..2c40e7d 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 41efecc..f892d1d 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 fa33dd1..b471571 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 a16db03..dc443a7 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.obj b/build/Debug/src/d2tweaks/client/modules/loot_filter/loot_filter_settings.obj index 2f7e82a..9b86dd8 100644 Binary files a/build/Debug/src/d2tweaks/client/modules/loot_filter/loot_filter_settings.obj and b/build/Debug/src/d2tweaks/client/modules/loot_filter/loot_filter_settings.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 78a57a9..bbf1281 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 44db999..9363ac6 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 3343b39..7058ad7 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 d1a1062..f0eb104 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 439d4c0..014ee45 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/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 d98ad44..63f431f 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 7965289..b4fc372 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 7e9a663..8f27d5e 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 15fb21e..0c3d453 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 a1beb82..d6d11a9 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 921c54c..dffea63 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 6a7fc46..a0d1c3f 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 34ca8f5..f526adc 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 fe77707..a6c62a6 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 3af8479..f98a430 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/ui/ui_manager.obj b/build/Debug/src/d2tweaks/ui/ui_manager.obj index c670d71..23322a0 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 90b7fe3..3702f57 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/utils/screen.obj b/build/Debug/src/diablo2/utils/screen.obj index 939a2d5..b60b389 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/vc143.pdb b/build/Debug/vc143.pdb index ab639a0..9afbeb1 100644 Binary files a/build/Debug/vc143.pdb and b/build/Debug/vc143.pdb differ diff --git a/include/d2tweaks/client/modules/loot_filter/loot_filter_settings.h b/include/d2tweaks/client/modules/loot_filter/loot_filter_settings.h index c01e0e1..914b318 100644 --- a/include/d2tweaks/client/modules/loot_filter/loot_filter_settings.h +++ b/include/d2tweaks/client/modules/loot_filter/loot_filter_settings.h @@ -63,6 +63,34 @@ namespace d2_tweaks { bool m_show_flawless; bool m_show_perfect; + bool m_show_rough; + bool m_show_faded; + bool m_show_blemished; + bool m_show_cleaned; + bool m_show_triangle; + bool m_show_trangle_cut; + bool m_show_square; + bool m_show_square_cut; + bool m_show_regular; + bool m_show_regular_cut; + bool m_show_star; + bool m_show_star_cut; + bool m_show_imperial; + bool m_show_imperial_cut; + bool m_show_royal; + bool m_show_royal_cut; + bool m_show_spectacular; + bool m_show_legendary; + bool m_show_legendary_cut; + + bool m_show_flourite; + bool m_show_jade; + bool m_show_argonite; + bool m_show_azurite; + bool m_show_sulpher; + bool m_show_quartz; + bool m_show_tiger_eye; + bool quality_settings[static_cast(diablo2::structures::item_quality_t::ITEM_QUALITY_COUNT)]; diff --git a/include/d2tweaks/client/modules/loot_filter/loot_filter_settings_menu.h b/include/d2tweaks/client/modules/loot_filter/loot_filter_settings_menu.h index 23465ae..d4c17af 100644 --- a/include/d2tweaks/client/modules/loot_filter/loot_filter_settings_menu.h +++ b/include/d2tweaks/client/modules/loot_filter/loot_filter_settings_menu.h @@ -4,6 +4,8 @@ #include +#include // Add this line + namespace diablo2 { namespace structures { struct unit; @@ -74,6 +76,35 @@ namespace d2_tweaks { ui::controls::checkbox* m_show_flawless; ui::controls::checkbox* m_show_perfect; + ui::controls::checkbox* m_show_flourite; + ui::controls::checkbox* m_show_jade; + ui::controls::checkbox* m_show_argonite; + ui::controls::checkbox* m_show_azurite; + ui::controls::checkbox* m_show_sulpher; + ui::controls::checkbox* m_show_quartz; + ui::controls::checkbox* m_show_tiger_eye; + + + ui::controls::checkbox* m_show_rough; + ui::controls::checkbox* m_show_faded; + ui::controls::checkbox* m_show_blemished; + ui::controls::checkbox* m_show_cleaned; + ui::controls::checkbox* m_show_triangle; + ui::controls::checkbox* m_show_trangle_cut; + ui::controls::checkbox* m_show_square; + ui::controls::checkbox* m_show_square_cut; + ui::controls::checkbox* m_show_regular; + ui::controls::checkbox* m_show_regular_cut; + ui::controls::checkbox* m_show_star; + ui::controls::checkbox* m_show_star_cut; + ui::controls::checkbox* m_show_imperial; + ui::controls::checkbox* m_show_imperial_cut; + ui::controls::checkbox* m_show_royal; + ui::controls::checkbox* m_show_royal_cut; + ui::controls::checkbox* m_show_spectacular; + ui::controls::checkbox* m_show_legendary; + ui::controls::checkbox* m_show_legendary_cut; + void(__fastcall* m_draw_dropped_items_names_original)(void*, void*); @@ -86,11 +117,17 @@ namespace d2_tweaks { void draw() override; private: std::string m_selected_gem; + + std::chrono::steady_clock::time_point m_last_packet_sent; + void gem_checkbox_clicked(const std::string& gem); + void stone_checkbox_clicked(const std::string& gem); void register_misc_checkboxes(); void register_quality_checkboxes(); + void extract_rune(bool value, uint32_t runeCode, uint32_t minValue, int propertyRowID); + void update_alt_only(bool value); void extract_r01(bool value); void extract_r02(bool value); @@ -140,7 +177,33 @@ namespace d2_tweaks { void extract_flawless(bool value); void extract_perfect(bool value); + void extract_rough(bool value); + void extract_faded(bool value); + void extract_blemished(bool value); + void extract_cleaned(bool value); + void extract_triangle(bool value); + void extract_trangle_cut(bool value); + void extract_square(bool value); + void extract_square_cut(bool value); + void extract_regular(bool value); + void extract_regular_cut(bool value); + void extract_star(bool value); + void extract_star_cut(bool value); + void extract_imperial(bool value); + void extract_imperial_cut(bool value); + void extract_royal(bool value); + void extract_royal_cut(bool value); + void extract_spectacular(bool value); + void extract_legendary(bool value); + void extract_legendary_cut(bool value); + void extract_flourite(bool value); + void extract_jade(bool value); + void extract_argonite(bool value); + void extract_azurite(bool value); + void extract_sulpher(bool value); + void extract_quartz(bool value); + void extract_tiger_eye(bool value); void update_show_gold(bool value); void update_show_runes(bool value); diff --git a/include/diablo2/d2common.h b/include/diablo2/d2common.h index 609c3a3..7a0f9e2 100644 --- a/include/diablo2/d2common.h +++ b/include/diablo2/d2common.h @@ -946,14 +946,14 @@ namespace diablo2 { UNIT_STAT_UNUSED_68 = 484, UNIT_STAT_UNUSED_69 = 485, UNIT_STAT_UNUSED_70 = 486, - UNIT_STAT_UNUSED_71 = 487, - UNIT_STAT_UNUSED_72 = 488, - UNIT_STAT_UNUSED_73 = 489, - UNIT_STAT_UNUSED_74 = 490, - UNIT_STAT_UNUSED_75 = 491, - UNIT_STAT_UNUSED_76 = 492, - UNIT_STAT_UNUSED_77 = 493, - UNIT_STAT_UNUSED_78 = 494, + UNIT_STAT_gembag_Stones_Flourite = 487, + UNIT_STAT_gembag_Stones_Jade = 488, + UNIT_STAT_gembag_Stones_Argonite = 489, + UNIT_STAT_gembag_Stones_Azurite = 490, + UNIT_STAT_gembag_Stones_Sulpher = 491, + UNIT_STAT_gembag_Stones_Quartz = 492, + UNIT_STAT_gembag_Stones_TigerEye = 493, + UNIT_STAT_BoH_Desc = 494, UNIT_STAT_runebag_RunesE = 495, UNIT_STAT_runebag_RunesF = 496, UNIT_STAT_passive_sum_mastery = 497, @@ -1050,6 +1050,5 @@ namespace diablo2 { //D2Common.0x6FD576D0 (#10601) // D2ItemsTxt* __stdcall DATATBLS_GetItemRecordFromItemCode(uint32_t dwCode, int* pItemId) static structures::items_line* get_item_record_from_item_code(uint32_t dwCode, int* pItemId); - }; } diff --git a/include/diablo2/d2win.h b/include/diablo2/d2win.h index 548f73d..73f0822 100644 --- a/include/diablo2/d2win.h +++ b/include/diablo2/d2win.h @@ -23,7 +23,7 @@ namespace diablo2 { UI_COLOR_DARK_WHITE = 0xF, UI_COLOR_LIGHT_GREY = 0x10, }; - + enum ui_font_t { UI_FONT_8 = 0, UI_FONT_16 = 1, diff --git a/src/d2tweaks/client/modules/loot_filter/loot_filter_settings_menu.cpp b/src/d2tweaks/client/modules/loot_filter/loot_filter_settings_menu.cpp index 02fe443..159552e 100644 --- a/src/d2tweaks/client/modules/loot_filter/loot_filter_settings_menu.cpp +++ b/src/d2tweaks/client/modules/loot_filter/loot_filter_settings_menu.cpp @@ -75,610 +75,825 @@ #include #include #include +#include -d2_tweaks::client::modules::loot_filter_settings_menu::loot_filter_settings_menu(token) { - menu::set_enabled(false); - menu::set_visible(false); +d2_tweaks::client::modules::loot_filter_settings_menu::loot_filter_settings_menu(token) + : m_last_packet_sent(std::chrono::steady_clock::now()) { + menu::set_enabled(false); + menu::set_visible(false); - //load_xml("d2tweaks\\interfaces\\loot_filter_settings_menu.xml"); - if (DLLBASE_D2EXPRES != 0) - load_xml("d2tweaks\\interface_d2expres\\loot_filter_settings_menu.xml"); - if (DLLBASE_SGD2FREERES != 0) - load_xml("d2tweaks\\interface_sgd2freeres\\loot_filter_settings_menu.xml"); - if (DLLBASE_SGD2FREERES == 0 && DLLBASE_D2EXPRES == 0) - load_xml("d2tweaks\\interface_vanilla\\loot_filter_settings_menu.xml"); + //load_xml("d2tweaks\\interfaces\\loot_filter_settings_menu.xml"); + if (DLLBASE_D2EXPRES != 0) + load_xml("d2tweaks\\interface_d2expres\\loot_filter_settings_menu.xml"); + if (DLLBASE_SGD2FREERES != 0) + load_xml("d2tweaks\\interface_sgd2freeres\\loot_filter_settings_menu.xml"); + if (DLLBASE_SGD2FREERES == 0 && DLLBASE_D2EXPRES == 0) + load_xml("d2tweaks\\interface_vanilla\\loot_filter_settings_menu.xml"); - register_misc_checkboxes(); - register_quality_checkboxes(); + register_misc_checkboxes(); + register_quality_checkboxes(); - setup_hooks(); + setup_hooks(); } void d2_tweaks::client::modules::loot_filter_settings_menu::reload_settings() { - register_misc_checkboxes(); - register_quality_checkboxes(); + register_misc_checkboxes(); + register_quality_checkboxes(); } void d2_tweaks::client::modules::loot_filter_settings_menu::draw() { - if (diablo2::d2_client::get_ui_window_state(diablo2::UI_WINDOW_MAINMENU)) - return; + if (diablo2::d2_client::get_ui_window_state(diablo2::UI_WINDOW_MAINMENU)) + return; - menu::draw(); + menu::draw(); } // Define a structure named GemType struct GemType { - // Comment: The number of chipped gems of this type - int chippedCount; + // Comment: The number of chipped gems of this type + int chippedCount; - // Comment: The row number in properties.txt minus 3, representing the type of gem - int rowID; + // Comment: The row number in properties.txt minus 3, representing the type of gem + int rowID; }; +// this map exits here because we're reducing this proper by value static std::unordered_map gemTypes = { - {"gcv", {-1, 382}}, // Chipped Amethyst - {"gcw", {-1, 383}}, // Chipped Diamond - {"gcg", {-1, 384}}, // Chipped Emerald - {"gcr", {-1, 381}}, // Chipped Ruby - {"gcb", {-1, 385}}, // Chipped Sapphire - {"skc", {-1, 387}}, // Chipped Skull - {"gcy", {-1, 386}}, // Chipped Topaz - {"gfv", {-3, 382}}, // Flawed Amethyst - {"gfw", {-3, 383}}, // Flawed Diamond - {"gfg", {-3, 384}}, // Flawed Emerald - {"gfr", {-3, 381}}, // Flawed Ruby - {"gfb", {-3, 385}}, // Flawed Sapphire - {"skf", {-3, 387}}, // Flawed Skull - {"gfy", {-3, 386}}, // Flawed Topaz - {"gsv", {-9, 382}}, // Amethyst - {"gsw", {-9, 383}}, // Diamond - {"gsg", {-9, 384}}, // Emerald - {"gsr", {-9, 381}}, // Ruby - {"gsb", {-9, 385}}, // Sapphire - {"sku", {-9, 387}}, // Skull - {"gsy", {-9, 386}}, // Topaz - {"gzv", {-27, 382}}, // Flawless Amethyst - {"glw", {-27, 383}}, // Flawless Diamond - {"glg", {-27, 384}}, // Flawless Emerald - {"glr", {-27, 381}}, // Flawless Ruby - {"glb", {-27, 385}}, // Flawless Sapphire - {"skl", {-27, 387}}, // Flawless Skull - {"gly", {-27, 386}}, // Flawless Topaz - {"gpv", {-81, 382}}, // Perfect Amethyst - {"gpw", {-81, 383}}, // Perfect Diamond - {"gpg", {-81, 384}}, // Perfect Emerald - {"gpr", {-81, 381}}, // Perfect Ruby - {"gpb", {-81, 385}}, // Perfect Sapphire - {"skz", {-81, 387}}, // Perfect Skull - {"gpy", {-81, 386}}, // Perfect Topaz - {"r01", {-1, 388}}, // El Rune - {"r02", {-3, 388}}, // Eld Rune - {"r03", {-9, 388}}, // Tir Rune - {"r04", {-27, 388}}, // Nef Rune - {"r05", {-81, 388}}, // Eth Rune - {"r06", {-243, 388}}, // Ith Rune - {"r07", {-1, 389}}, // Tal Rune - {"r08", {-3, 389}}, // Ral Rune - {"r09", {-9, 389}}, // Ort Rune - {"r10", {-27, 389}}, // Thul Rune - {"r11", {-81, 389}}, // Amn Rune - {"r12", {-243, 389}}, // Sol Rune - {"r13", {-1, 390}}, // Shael Rune - {"r14", {-3, 390}}, // Dol Rune - {"r15", {-9, 390}}, // Hel Rune - {"r16", {-27, 390}}, // Io Rune - {"r17", {-81, 390}}, // Lum Rune - {"r18", {-243, 390}}, // Ko Rune - {"r19", {-1, 391}}, // Fal Rune - {"r20", {-3, 391}}, // Lem Rune - {"r21", {-9, 391}}, // Pul Rune - {"r22", {-27, 391}}, // Um Rune - {"r23", {-81, 3901}}, // Mal Rune - {"r24", {-243, 391}}, // Ist Rune - {"r25", {-1, 392}}, // Gul Rune - {"r26", {-3, 392}}, // Vex Rune - {"r27", {-9, 392}}, // Ohm Rune - {"r28", {-27, 392}}, // Lo Rune - {"r29", {-81, 392}}, // Sur Rune - {"r30", {-243, 392}}, // Ber Rune - {"r31", {-1, 393}}, // Jah Rune - {"r32", {-2, 393}}, // Cham Rune - {"r33", {-4, 393}} // Zod Rune + {"gcv", {-1, 382}}, // Chipped Amethyst + {"gcw", {-1, 383}}, // Chipped Diamond + {"gcg", {-1, 384}}, // Chipped Emerald + {"gcr", {-1, 381}}, // Chipped Ruby + {"gcb", {-1, 385}}, // Chipped Sapphire + {"skc", {-1, 387}}, // Chipped Skull + {"gcy", {-1, 386}}, // Chipped Topaz + {"gfv", {-3, 382}}, // Flawed Amethyst + {"gfw", {-3, 383}}, // Flawed Diamond + {"gfg", {-3, 384}}, // Flawed Emerald + {"gfr", {-3, 381}}, // Flawed Ruby + {"gfb", {-3, 385}}, // Flawed Sapphire + {"skf", {-3, 387}}, // Flawed Skull + {"gfy", {-3, 386}}, // Flawed Topaz + {"gsv", {-9, 382}}, // Amethyst + {"gsw", {-9, 383}}, // Diamond + {"gsg", {-9, 384}}, // Emerald + {"gsr", {-9, 381}}, // Ruby + {"gsb", {-9, 385}}, // Sapphire + {"sku", {-9, 387}}, // Skull + {"gsy", {-9, 386}}, // Topaz + {"gzv", {-27, 382}}, // Flawless Amethyst + {"glw", {-27, 383}}, // Flawless Diamond + {"glg", {-27, 384}}, // Flawless Emerald + {"glr", {-27, 381}}, // Flawless Ruby + {"glb", {-27, 385}}, // Flawless Sapphire + {"skl", {-27, 387}}, // Flawless Skull + {"gly", {-27, 386}}, // Flawless Topaz + {"gpv", {-81, 382}}, // Perfect Amethyst + {"gpw", {-81, 383}}, // Perfect Diamond + {"gpg", {-81, 384}}, // Perfect Emerald + {"gpr", {-81, 381}}, // Perfect Ruby + {"gpb", {-81, 385}}, // Perfect Sapphire + {"skz", {-81, 387}}, // Perfect Skull + {"gpy", {-81, 386}}, // Perfect Topaz + {"r01", {-1, 388}}, // El Rune + {"r02", {-3, 388}}, // Eld Rune + {"r03", {-9, 388}}, // Tir Rune + {"r04", {-27, 388}}, // Nef Rune + {"r05", {-81, 388}}, // Eth Rune + {"r06", {-243, 388}}, // Ith Rune + {"r07", {-1, 389}}, // Tal Rune + {"r08", {-3, 389}}, // Ral Rune + {"r09", {-9, 389}}, // Ort Rune + {"r10", {-27, 389}}, // Thul Rune + {"r11", {-81, 389}}, // Amn Rune + {"r12", {-243, 389}}, // Sol Rune + {"r13", {-1, 390}}, // Shael Rune + {"r14", {-3, 390}}, // Dol Rune + {"r15", {-9, 390}}, // Hel Rune + {"r16", {-27, 390}}, // Io Rune + {"r17", {-81, 390}}, // Lum Rune + {"r18", {-243, 390}}, // Ko Rune + {"r19", {-1, 391}}, // Fal Rune + {"r20", {-3, 391}}, // Lem Rune + {"r21", {-9, 391}}, // Pul Rune + {"r22", {-27, 391}}, // Um Rune + {"r23", {-81, 3901}}, // Mal Rune + {"r24", {-243, 391}}, // Ist Rune + {"r25", {-1, 392}}, // Gul Rune + {"r26", {-3, 392}}, // Vex Rune + {"r27", {-9, 392}}, // Ohm Rune + {"r28", {-27, 392}}, // Lo Rune + {"r29", {-81, 392}}, // Sur Rune + {"r30", {-243, 392}}, // Ber Rune + {"r31", {-1, 393}}, // Jah Rune + {"r32", {-2, 393}}, // Cham Rune + {"r33", {-4, 393}} // Zod Rune }; void d2_tweaks::client::modules::loot_filter_settings_menu::gem_checkbox_clicked(const std::string& gem) { - // Set the state of the clicked checkbox to true - if (m_show_amethyst && gem == "amethyst") { - m_show_amethyst->set_state(true); - } - else if (m_show_ruby && gem == "ruby") { - m_show_ruby->set_state(true); - } - else if (m_show_sapphire && gem == "sapphire") { - m_show_sapphire->set_state(true); - } - else if (m_show_emerald && gem == "emerald") { - m_show_emerald->set_state(true); - } - else if (m_show_diamond && gem == "diamond") { - m_show_diamond->set_state(true); - } - else if (m_show_topaz && gem == "topaz") { - m_show_topaz->set_state(true); - } - else if (m_show_skull && gem == "skull") { - m_show_skull->set_state(true); - } + // Set the state of the clicked checkbox to true + if (m_show_amethyst && gem == "amethyst") { + m_show_amethyst->set_state(true); + } + else if (m_show_ruby && gem == "ruby") { + m_show_ruby->set_state(true); + } + else if (m_show_sapphire && gem == "sapphire") { + m_show_sapphire->set_state(true); + } + else if (m_show_emerald && gem == "emerald") { + m_show_emerald->set_state(true); + } + else if (m_show_diamond && gem == "diamond") { + m_show_diamond->set_state(true); + } + else if (m_show_topaz && gem == "topaz") { + m_show_topaz->set_state(true); + } + else if (m_show_skull && gem == "skull") { + m_show_skull->set_state(true); + } - // Uncheck all other gem checkboxes - if (m_show_amethyst && gem != "amethyst") { - m_show_amethyst->set_state(false); - } - if (m_show_ruby && gem != "ruby") { - m_show_ruby->set_state(false); - } - if (m_show_sapphire && gem != "sapphire") { - m_show_sapphire->set_state(false); - } - if (m_show_emerald && gem != "emerald") { - m_show_emerald->set_state(false); - } - if (m_show_diamond && gem != "diamond") { - m_show_diamond->set_state(false); - } - if (m_show_topaz && gem != "topaz") { - m_show_topaz->set_state(false); - } - if (m_show_skull && gem != "skull") { - m_show_skull->set_state(false); - } + // Uncheck all other gem checkboxes + if (m_show_amethyst && gem != "amethyst") { + m_show_amethyst->set_state(false); + } + if (m_show_ruby && gem != "ruby") { + m_show_ruby->set_state(false); + } + if (m_show_sapphire && gem != "sapphire") { + m_show_sapphire->set_state(false); + } + if (m_show_emerald && gem != "emerald") { + m_show_emerald->set_state(false); + } + if (m_show_diamond && gem != "diamond") { + m_show_diamond->set_state(false); + } + if (m_show_topaz && gem != "topaz") { + m_show_topaz->set_state(false); + } + if (m_show_skull && gem != "skull") { + m_show_skull->set_state(false); + } - // Update the selected gem - m_selected_gem = gem; + // Update the selected gem + m_selected_gem = gem; - // display m_selected_gem in a messagebox - //MessageBoxA(NULL, m_selected_gem.c_str(), "Selected Gem", MB_OK); + // display m_selected_gem in a messagebox + //MessageBoxA(NULL, m_selected_gem.c_str(), "Selected Gem", MB_OK); } +void d2_tweaks::client::modules::loot_filter_settings_menu::stone_checkbox_clicked(const std::string& gem) { + // Set the state of the clicked checkbox to true + if (m_show_flourite && gem == "flourite") { + m_show_flourite->set_state(true); + } + else if (m_show_jade && gem == "jade") { + m_show_jade->set_state(true); + } + else if (m_show_argonite && gem == "argonite") { + m_show_argonite->set_state(true); + } + else if (m_show_azurite && gem == "azurite") { + m_show_azurite->set_state(true); + } + else if (m_show_sulpher && gem == "sulpher") { + m_show_sulpher->set_state(true); + } + else if (m_show_quartz && gem == "quartz") { + m_show_quartz->set_state(true); + } + else if (m_show_tiger_eye && gem == "tiger_eye") { + m_show_tiger_eye->set_state(true); + } + // Uncheck all other gem checkboxes + if (m_show_flourite && gem != "flourite") { + m_show_flourite->set_state(false); + } + if (m_show_jade && gem != "jade") { + m_show_jade->set_state(false); + } + if (m_show_argonite && gem != "argonite") { + m_show_argonite->set_state(false); + } + if (m_show_azurite && gem != "azurite") { + m_show_azurite->set_state(false); + } + if (m_show_sulpher && gem != "sulpher") { + m_show_sulpher->set_state(false); + } + if (m_show_quartz && gem != "quartz") { + m_show_quartz->set_state(false); + } + if (m_show_tiger_eye && gem != "tiger_eye") { + m_show_tiger_eye->set_state(false); + } + // Update the selected gem + m_selected_gem = gem; + + // display m_selected_gem in a messagebox + //MessageBoxA(NULL, m_selected_gem.c_str(), "Selected Gem", MB_OK); +} void d2_tweaks::client::modules::loot_filter_settings_menu::register_misc_checkboxes() { - m_altonly = get_control("m_altonly"); - m_show_gold = get_control("m_show_gold"); - m_show_runes = get_control("m_show_runes"); - m_show_gems = get_control("m_show_gems"); + m_altonly = get_control("m_altonly"); + m_show_gold = get_control("m_show_gold"); + m_show_runes = get_control("m_show_runes"); + m_show_gems = get_control("m_show_gems"); - m_show_amethyst = get_control("m_show_amethyst"); - m_show_diamond = get_control("m_show_diamond"); - m_show_emerald = get_control("m_show_emerald"); - m_show_ruby = get_control("m_show_ruby"); - m_show_sapphire = get_control("m_show_sapphire"); - m_show_skull = get_control("m_show_skull"); - m_show_topaz = get_control("m_show_topaz"); + m_show_amethyst = get_control("m_show_amethyst"); + m_show_diamond = get_control("m_show_diamond"); + m_show_emerald = get_control("m_show_emerald"); + m_show_ruby = get_control("m_show_ruby"); + m_show_sapphire = get_control("m_show_sapphire"); + m_show_skull = get_control("m_show_skull"); + m_show_topaz = get_control("m_show_topaz"); - m_show_r01 = get_control("m_show_r01"); - m_show_r02 = get_control("m_show_r02"); - m_show_r03 = get_control("m_show_r03"); - m_show_r04 = get_control("m_show_r04"); - m_show_r05 = get_control("m_show_r05"); - m_show_r06 = get_control("m_show_r06"); - m_show_r07 = get_control("m_show_r07"); - m_show_r08 = get_control("m_show_r08"); - m_show_r09 = get_control("m_show_r09"); - m_show_r10 = get_control("m_show_r10"); - m_show_r11 = get_control("m_show_r11"); - m_show_r12 = get_control("m_show_r12"); - m_show_r13 = get_control("m_show_r13"); - m_show_r14 = get_control("m_show_r14"); - m_show_r15 = get_control("m_show_r15"); - m_show_r16 = get_control("m_show_r16"); - m_show_r17 = get_control("m_show_r17"); - m_show_r18 = get_control("m_show_r18"); - m_show_r19 = get_control("m_show_r19"); - m_show_r20 = get_control("m_show_r20"); - m_show_r21 = get_control("m_show_r21"); - m_show_r22 = get_control("m_show_r22"); - m_show_r23 = get_control("m_show_r23"); - m_show_r24 = get_control("m_show_r24"); - m_show_r25 = get_control("m_show_r25"); - m_show_r26 = get_control("m_show_r26"); - m_show_r27 = get_control("m_show_r27"); - m_show_r28 = get_control("m_show_r28"); - m_show_r29 = get_control("m_show_r29"); - m_show_r30 = get_control("m_show_r30"); - m_show_r31 = get_control("m_show_r31"); - m_show_r32 = get_control("m_show_r32"); - m_show_r33 = get_control("m_show_r33"); + m_show_r01 = get_control("m_show_r01"); + m_show_r02 = get_control("m_show_r02"); + m_show_r03 = get_control("m_show_r03"); + m_show_r04 = get_control("m_show_r04"); + m_show_r05 = get_control("m_show_r05"); + m_show_r06 = get_control("m_show_r06"); + m_show_r07 = get_control("m_show_r07"); + m_show_r08 = get_control("m_show_r08"); + m_show_r09 = get_control("m_show_r09"); + m_show_r10 = get_control("m_show_r10"); + m_show_r11 = get_control("m_show_r11"); + m_show_r12 = get_control("m_show_r12"); + m_show_r13 = get_control("m_show_r13"); + m_show_r14 = get_control("m_show_r14"); + m_show_r15 = get_control("m_show_r15"); + m_show_r16 = get_control("m_show_r16"); + m_show_r17 = get_control("m_show_r17"); + m_show_r18 = get_control("m_show_r18"); + m_show_r19 = get_control("m_show_r19"); + m_show_r20 = get_control("m_show_r20"); + m_show_r21 = get_control("m_show_r21"); + m_show_r22 = get_control("m_show_r22"); + m_show_r23 = get_control("m_show_r23"); + m_show_r24 = get_control("m_show_r24"); + m_show_r25 = get_control("m_show_r25"); + m_show_r26 = get_control("m_show_r26"); + m_show_r27 = get_control("m_show_r27"); + m_show_r28 = get_control("m_show_r28"); + m_show_r29 = get_control("m_show_r29"); + m_show_r30 = get_control("m_show_r30"); + m_show_r31 = get_control("m_show_r31"); + m_show_r32 = get_control("m_show_r32"); + m_show_r33 = get_control("m_show_r33"); + m_show_chipped = get_control("m_show_chipped"); + m_show_flawed = get_control("m_show_flawed"); + m_show_normal = get_control("m_show_normal"); + m_show_flawless = get_control("m_show_flawless"); + m_show_perfect = get_control("m_show_perfect"); - m_show_chipped = get_control("m_show_chipped"); - m_show_flawed = get_control("m_show_flawed"); - m_show_normal = get_control("m_show_normal"); - m_show_flawless = get_control("m_show_flawless"); - m_show_perfect = get_control("m_show_perfect"); + m_show_flourite = get_control("m_show_flourite"); + m_show_jade = get_control("m_show_jade"); + m_show_argonite = get_control("m_show_argonite"); + m_show_azurite = get_control("m_show_azurite"); + m_show_sulpher = get_control("m_show_sulpher"); + m_show_quartz = get_control("m_show_quartz"); + m_show_tiger_eye = get_control("m_show_tiger_eye"); + m_show_rough = get_control("m_show_rough"); + m_show_faded = get_control("m_show_faded"); + m_show_blemished = get_control("m_show_blemished"); + m_show_cleaned = get_control("m_show_cleaned"); + m_show_triangle = get_control("m_show_triangle"); + m_show_trangle_cut = get_control("m_show_trangle_cut"); + m_show_square = get_control("m_show_square"); + m_show_square_cut = get_control("m_show_square_cut"); + m_show_regular = get_control("m_show_regular"); + m_show_regular_cut = get_control("m_show_regular_cut"); + m_show_star = get_control("m_show_star"); + m_show_star_cut = get_control("m_show_star_cut"); + m_show_imperial = get_control("m_show_imperial"); + m_show_imperial_cut = get_control("m_show_imperial_cut"); + m_show_royal = get_control("m_show_royal"); + m_show_royal_cut = get_control("m_show_royal_cut"); + m_show_spectacular = get_control("m_show_spectacular"); + m_show_legendary = get_control("m_show_legendary"); + m_show_legendary_cut = get_control("m_show_legendary_cut"); - // gems - { - if (m_show_amethyst) { - m_show_amethyst->set_on_click(std::bind(&loot_filter_settings_menu::gem_checkbox_clicked, this, "amethyst")); - } - if (m_show_ruby) { - m_show_ruby->set_on_click(std::bind(&loot_filter_settings_menu::gem_checkbox_clicked, this, "ruby")); - } - if (m_show_sapphire) { - m_show_sapphire->set_on_click(std::bind(&loot_filter_settings_menu::gem_checkbox_clicked, this, "sapphire")); - } - if (m_show_emerald) { - m_show_emerald->set_on_click(std::bind(&loot_filter_settings_menu::gem_checkbox_clicked, this, "emerald")); - } - if (m_show_diamond) { - m_show_diamond->set_on_click(std::bind(&loot_filter_settings_menu::gem_checkbox_clicked, this, "diamond")); - } - if (m_show_topaz) { - m_show_topaz->set_on_click(std::bind(&loot_filter_settings_menu::gem_checkbox_clicked, this, "topaz")); - } - if (m_show_skull) { - m_show_skull->set_on_click(std::bind(&loot_filter_settings_menu::gem_checkbox_clicked, this, "skull")); - } + // gems + { + if (m_show_amethyst) { + m_show_amethyst->set_on_click(std::bind(&loot_filter_settings_menu::gem_checkbox_clicked, this, "amethyst")); + } + if (m_show_ruby) { + m_show_ruby->set_on_click(std::bind(&loot_filter_settings_menu::gem_checkbox_clicked, this, "ruby")); + } + if (m_show_sapphire) { + m_show_sapphire->set_on_click(std::bind(&loot_filter_settings_menu::gem_checkbox_clicked, this, "sapphire")); + } + if (m_show_emerald) { + m_show_emerald->set_on_click(std::bind(&loot_filter_settings_menu::gem_checkbox_clicked, this, "emerald")); + } + if (m_show_diamond) { + m_show_diamond->set_on_click(std::bind(&loot_filter_settings_menu::gem_checkbox_clicked, this, "diamond")); + } + if (m_show_topaz) { + m_show_topaz->set_on_click(std::bind(&loot_filter_settings_menu::gem_checkbox_clicked, this, "topaz")); + } + if (m_show_skull) { + m_show_skull->set_on_click(std::bind(&loot_filter_settings_menu::gem_checkbox_clicked, this, "skull")); + } + } + // stones + { + if (m_show_flourite) { + m_show_flourite->set_on_click(std::bind(&loot_filter_settings_menu::stone_checkbox_clicked, this, "flourite")); + } + if (m_show_jade) { + m_show_jade->set_on_click(std::bind(&loot_filter_settings_menu::stone_checkbox_clicked, this, "jade")); + } + if (m_show_argonite) { + m_show_argonite->set_on_click(std::bind(&loot_filter_settings_menu::stone_checkbox_clicked, this, "argonite")); + } + if (m_show_azurite) { + m_show_azurite->set_on_click(std::bind(&loot_filter_settings_menu::stone_checkbox_clicked, this, "azurite")); + } + if (m_show_sulpher) { + m_show_sulpher->set_on_click(std::bind(&loot_filter_settings_menu::stone_checkbox_clicked, this, "sulpher")); + } + if (m_show_quartz) { + m_show_quartz->set_on_click(std::bind(&loot_filter_settings_menu::stone_checkbox_clicked, this, "quartz")); + } + if (m_show_tiger_eye) { + m_show_tiger_eye->set_on_click(std::bind(&loot_filter_settings_menu::stone_checkbox_clicked, this, "tiger_eye")); + } + } - } + // gem qualities + { + if (m_show_chipped) { + m_show_chipped->set_state(loot_filter_settings::get().m_show_chipped); + m_show_chipped->set_on_click(std::bind(&loot_filter_settings_menu::extract_chipped, + this, std::placeholders::_1)); + } + if (m_show_flawed) { + m_show_flawed->set_state(loot_filter_settings::get().m_show_flawed); + m_show_flawed->set_on_click(std::bind(&loot_filter_settings_menu::extract_flawed, + this, std::placeholders::_1)); + } - // gem qualities - { - if (m_show_chipped) { - m_show_chipped->set_state(loot_filter_settings::get().m_show_chipped); - m_show_chipped->set_on_click(std::bind(&loot_filter_settings_menu::extract_chipped, - this, std::placeholders::_1)); - } + if (m_show_normal) { + m_show_normal->set_state(loot_filter_settings::get().m_show_normal); + m_show_normal->set_on_click(std::bind(&loot_filter_settings_menu::extract_normal, + this, std::placeholders::_1)); + } - if (m_show_flawed) { - m_show_flawed->set_state(loot_filter_settings::get().m_show_flawed); - m_show_flawed->set_on_click(std::bind(&loot_filter_settings_menu::extract_flawed, - this, std::placeholders::_1)); - } + if (m_show_flawless) { + m_show_flawless->set_state(loot_filter_settings::get().m_show_flawless); + m_show_flawless->set_on_click(std::bind(&loot_filter_settings_menu::extract_flawless, + this, std::placeholders::_1)); + } - if (m_show_normal) { - m_show_normal->set_state(loot_filter_settings::get().m_show_normal); - m_show_normal->set_on_click(std::bind(&loot_filter_settings_menu::extract_normal, - this, std::placeholders::_1)); - } + if (m_show_perfect) { + m_show_perfect->set_state(loot_filter_settings::get().m_show_perfect); + m_show_perfect->set_on_click(std::bind(&loot_filter_settings_menu::extract_perfect, + this, std::placeholders::_1)); + } + } - if (m_show_flawless) { - m_show_flawless->set_state(loot_filter_settings::get().m_show_flawless); - m_show_flawless->set_on_click(std::bind(&loot_filter_settings_menu::extract_flawless, - this, std::placeholders::_1)); - } + { + { + if (m_show_rough) { + m_show_rough->set_state(loot_filter_settings::get().m_show_rough); + m_show_rough->set_on_click(std::bind(&loot_filter_settings_menu::extract_rough, + this, std::placeholders::_1)); + } - if (m_show_perfect) { - m_show_perfect->set_state(loot_filter_settings::get().m_show_perfect); - m_show_perfect->set_on_click(std::bind(&loot_filter_settings_menu::extract_perfect, - this, std::placeholders::_1)); - } + if (m_show_faded) { + m_show_faded->set_state(loot_filter_settings::get().m_show_faded); + m_show_faded->set_on_click(std::bind(&loot_filter_settings_menu::extract_faded, + this, std::placeholders::_1)); + } + if (m_show_blemished) { + m_show_blemished->set_state(loot_filter_settings::get().m_show_blemished); + m_show_blemished->set_on_click(std::bind(&loot_filter_settings_menu::extract_blemished, + this, std::placeholders::_1)); + } - } + if (m_show_cleaned) { + m_show_cleaned->set_state(loot_filter_settings::get().m_show_cleaned); + m_show_cleaned->set_on_click(std::bind(&loot_filter_settings_menu::extract_cleaned, + this, std::placeholders::_1)); + } - // runes - { + if (m_show_triangle) { + m_show_triangle->set_state(loot_filter_settings::get().m_show_triangle); + m_show_triangle->set_on_click(std::bind(&loot_filter_settings_menu::extract_triangle, + this, std::placeholders::_1)); + } - if (m_show_r01) { - m_show_r01->set_state(loot_filter_settings::get().m_show_r01); - m_show_r01->set_on_click(std::bind(&loot_filter_settings_menu::extract_r01, - this, std::placeholders::_1)); - } + if (m_show_trangle_cut) { + m_show_trangle_cut->set_state(loot_filter_settings::get().m_show_trangle_cut); + m_show_trangle_cut->set_on_click(std::bind(&loot_filter_settings_menu::extract_trangle_cut, + this, std::placeholders::_1)); + } - if (m_show_r02) { - m_show_r02->set_state(loot_filter_settings::get().m_show_r02); - m_show_r02->set_on_click(std::bind(&loot_filter_settings_menu::extract_r02, - this, std::placeholders::_1)); - } + if (m_show_square) { + m_show_square->set_state(loot_filter_settings::get().m_show_square); + m_show_square->set_on_click(std::bind(&loot_filter_settings_menu::extract_square, + this, std::placeholders::_1)); + } - if (m_show_r03) { - m_show_r03->set_state(loot_filter_settings::get().m_show_r03); - m_show_r03->set_on_click(std::bind(&loot_filter_settings_menu::extract_r03, - this, std::placeholders::_1)); - } + if (m_show_square_cut) { + m_show_square_cut->set_state(loot_filter_settings::get().m_show_square_cut); + m_show_square_cut->set_on_click(std::bind(&loot_filter_settings_menu::extract_square_cut, + this, std::placeholders::_1)); + } - if (m_show_r04) { - m_show_r04->set_state(loot_filter_settings::get().m_show_r04); - m_show_r04->set_on_click(std::bind(&loot_filter_settings_menu::extract_r04, - this, std::placeholders::_1)); - } + if (m_show_regular) { + m_show_regular->set_state(loot_filter_settings::get().m_show_regular); + m_show_regular->set_on_click(std::bind(&loot_filter_settings_menu::extract_regular, + this, std::placeholders::_1)); + } - if (m_show_r05) { - m_show_r05->set_state(loot_filter_settings::get().m_show_r05); - m_show_r05->set_on_click(std::bind(&loot_filter_settings_menu::extract_r05, - this, std::placeholders::_1)); - } + if (m_show_regular_cut) { + m_show_regular_cut->set_state(loot_filter_settings::get().m_show_regular_cut); + m_show_regular_cut->set_on_click(std::bind(&loot_filter_settings_menu::extract_regular_cut, + this, std::placeholders::_1)); + } - if (m_show_r06) { - m_show_r06->set_state(loot_filter_settings::get().m_show_r06); - m_show_r06->set_on_click(std::bind(&loot_filter_settings_menu::extract_r06, - this, std::placeholders::_1)); - } + if (m_show_star) { + m_show_star->set_state(loot_filter_settings::get().m_show_star); + m_show_star->set_on_click(std::bind(&loot_filter_settings_menu::extract_star, + this, std::placeholders::_1)); + } - if (m_show_r07) { - m_show_r07->set_state(loot_filter_settings::get().m_show_r07); - m_show_r07->set_on_click(std::bind(&loot_filter_settings_menu::extract_r07, - this, std::placeholders::_1)); - } + if (m_show_star_cut) { + m_show_star_cut->set_state(loot_filter_settings::get().m_show_star_cut); + m_show_star_cut->set_on_click(std::bind(&loot_filter_settings_menu::extract_star_cut, + this, std::placeholders::_1)); + } - if (m_show_r08) { - m_show_r08->set_state(loot_filter_settings::get().m_show_r08); - m_show_r08->set_on_click(std::bind(&loot_filter_settings_menu::extract_r08, - this, std::placeholders::_1)); - } + if (m_show_imperial) { + m_show_imperial->set_state(loot_filter_settings::get().m_show_imperial); + m_show_imperial->set_on_click(std::bind(&loot_filter_settings_menu::extract_imperial, + this, std::placeholders::_1)); + } - if (m_show_r09) { - m_show_r09->set_state(loot_filter_settings::get().m_show_r09); - m_show_r09->set_on_click(std::bind(&loot_filter_settings_menu::extract_r09, - this, std::placeholders::_1)); - } + if (m_show_imperial_cut) { + m_show_imperial_cut->set_state(loot_filter_settings::get().m_show_imperial_cut); + m_show_imperial_cut->set_on_click(std::bind(&loot_filter_settings_menu::extract_imperial_cut, + this, std::placeholders::_1)); + } - if (m_show_r10) { - m_show_r10->set_state(loot_filter_settings::get().m_show_r10); - m_show_r10->set_on_click(std::bind(&loot_filter_settings_menu::extract_r10, - this, std::placeholders::_1)); - } + if (m_show_royal) { + m_show_royal->set_state(loot_filter_settings::get().m_show_royal); + m_show_royal->set_on_click(std::bind(&loot_filter_settings_menu::extract_royal, + this, std::placeholders::_1)); + } - if (m_show_r11) { - m_show_r11->set_state(loot_filter_settings::get().m_show_r11); - m_show_r11->set_on_click(std::bind(&loot_filter_settings_menu::extract_r11, - this, std::placeholders::_1)); - } + if (m_show_royal_cut) { + m_show_royal_cut->set_state(loot_filter_settings::get().m_show_royal_cut); + m_show_royal_cut->set_on_click(std::bind(&loot_filter_settings_menu::extract_royal_cut, + this, std::placeholders::_1)); + } - if (m_show_r12) { - m_show_r12->set_state(loot_filter_settings::get().m_show_r12); - m_show_r12->set_on_click(std::bind(&loot_filter_settings_menu::extract_r12, - this, std::placeholders::_1)); - } + if (m_show_spectacular) { + m_show_spectacular->set_state(loot_filter_settings::get().m_show_spectacular); + m_show_spectacular->set_on_click(std::bind(&loot_filter_settings_menu::extract_spectacular, + this, std::placeholders::_1)); + } - if (m_show_r13) { - m_show_r13->set_state(loot_filter_settings::get().m_show_r13); - m_show_r13->set_on_click(std::bind(&loot_filter_settings_menu::extract_r13, - this, std::placeholders::_1)); - } + if (m_show_legendary) { + m_show_legendary->set_state(loot_filter_settings::get().m_show_legendary); + m_show_legendary->set_on_click(std::bind(&loot_filter_settings_menu::extract_legendary, + this, std::placeholders::_1)); + } - if (m_show_r14) { - m_show_r14->set_state(loot_filter_settings::get().m_show_r14); - m_show_r14->set_on_click(std::bind(&loot_filter_settings_menu::extract_r14, - this, std::placeholders::_1)); - } + if (m_show_legendary_cut) { + m_show_legendary_cut->set_state(loot_filter_settings::get().m_show_legendary_cut); + m_show_legendary_cut->set_on_click(std::bind(&loot_filter_settings_menu::extract_legendary_cut, + this, std::placeholders::_1)); + } + } + } - if (m_show_r15) { - m_show_r15->set_state(loot_filter_settings::get().m_show_r15); - m_show_r15->set_on_click(std::bind(&loot_filter_settings_menu::extract_r15, - this, std::placeholders::_1)); - } + // runes + { + if (m_show_r01) { + m_show_r01->set_state(loot_filter_settings::get().m_show_r01); + m_show_r01->set_on_click(std::bind(&loot_filter_settings_menu::extract_r01, + this, std::placeholders::_1)); + } - if (m_show_r16) { - m_show_r16->set_state(loot_filter_settings::get().m_show_r16); - m_show_r16->set_on_click(std::bind(&loot_filter_settings_menu::extract_r16, - this, std::placeholders::_1)); - } + if (m_show_r02) { + m_show_r02->set_state(loot_filter_settings::get().m_show_r02); + m_show_r02->set_on_click(std::bind(&loot_filter_settings_menu::extract_r02, + this, std::placeholders::_1)); + } - if (m_show_r17) { - m_show_r17->set_state(loot_filter_settings::get().m_show_r17); - m_show_r17->set_on_click(std::bind(&loot_filter_settings_menu::extract_r17, - this, std::placeholders::_1)); - } + if (m_show_r03) { + m_show_r03->set_state(loot_filter_settings::get().m_show_r03); + m_show_r03->set_on_click(std::bind(&loot_filter_settings_menu::extract_r03, + this, std::placeholders::_1)); + } - if (m_show_r18) { - m_show_r18->set_state(loot_filter_settings::get().m_show_r18); - m_show_r18->set_on_click(std::bind(&loot_filter_settings_menu::extract_r18, - this, std::placeholders::_1)); - } + if (m_show_r04) { + m_show_r04->set_state(loot_filter_settings::get().m_show_r04); + m_show_r04->set_on_click(std::bind(&loot_filter_settings_menu::extract_r04, + this, std::placeholders::_1)); + } - if (m_show_r19) { - m_show_r19->set_state(loot_filter_settings::get().m_show_r19); - m_show_r19->set_on_click(std::bind(&loot_filter_settings_menu::extract_r19, - this, std::placeholders::_1)); - } + if (m_show_r05) { + m_show_r05->set_state(loot_filter_settings::get().m_show_r05); + m_show_r05->set_on_click(std::bind(&loot_filter_settings_menu::extract_r05, + this, std::placeholders::_1)); + } - if (m_show_r20) { - m_show_r20->set_state(loot_filter_settings::get().m_show_r20); - m_show_r20->set_on_click(std::bind(&loot_filter_settings_menu::extract_r20, - this, std::placeholders::_1)); - } + if (m_show_r06) { + m_show_r06->set_state(loot_filter_settings::get().m_show_r06); + m_show_r06->set_on_click(std::bind(&loot_filter_settings_menu::extract_r06, + this, std::placeholders::_1)); + } - if (m_show_r21) { - m_show_r21->set_state(loot_filter_settings::get().m_show_r21); - m_show_r21->set_on_click(std::bind(&loot_filter_settings_menu::extract_r21, - this, std::placeholders::_1)); - } + if (m_show_r07) { + m_show_r07->set_state(loot_filter_settings::get().m_show_r07); + m_show_r07->set_on_click(std::bind(&loot_filter_settings_menu::extract_r07, + this, std::placeholders::_1)); + } - if (m_show_r22) { - m_show_r22->set_state(loot_filter_settings::get().m_show_r22); - m_show_r22->set_on_click(std::bind(&loot_filter_settings_menu::extract_r22, - this, std::placeholders::_1)); - } + if (m_show_r08) { + m_show_r08->set_state(loot_filter_settings::get().m_show_r08); + m_show_r08->set_on_click(std::bind(&loot_filter_settings_menu::extract_r08, + this, std::placeholders::_1)); + } - if (m_show_r23) { - m_show_r23->set_state(loot_filter_settings::get().m_show_r23); - m_show_r23->set_on_click(std::bind(&loot_filter_settings_menu::extract_r23, - this, std::placeholders::_1)); - } + if (m_show_r09) { + m_show_r09->set_state(loot_filter_settings::get().m_show_r09); + m_show_r09->set_on_click(std::bind(&loot_filter_settings_menu::extract_r09, + this, std::placeholders::_1)); + } - if (m_show_r24) { - m_show_r24->set_state(loot_filter_settings::get().m_show_r24); - m_show_r24->set_on_click(std::bind(&loot_filter_settings_menu::extract_r24, - this, std::placeholders::_1)); - } + if (m_show_r10) { + m_show_r10->set_state(loot_filter_settings::get().m_show_r10); + m_show_r10->set_on_click(std::bind(&loot_filter_settings_menu::extract_r10, + this, std::placeholders::_1)); + } - if (m_show_r25) { - m_show_r25->set_state(loot_filter_settings::get().m_show_r25); - m_show_r25->set_on_click(std::bind(&loot_filter_settings_menu::extract_r25, - this, std::placeholders::_1)); - } + if (m_show_r11) { + m_show_r11->set_state(loot_filter_settings::get().m_show_r11); + m_show_r11->set_on_click(std::bind(&loot_filter_settings_menu::extract_r11, + this, std::placeholders::_1)); + } - if (m_show_r26) { - m_show_r26->set_state(loot_filter_settings::get().m_show_r26); - m_show_r26->set_on_click(std::bind(&loot_filter_settings_menu::extract_r26, - this, std::placeholders::_1)); - } + if (m_show_r12) { + m_show_r12->set_state(loot_filter_settings::get().m_show_r12); + m_show_r12->set_on_click(std::bind(&loot_filter_settings_menu::extract_r12, + this, std::placeholders::_1)); + } - if (m_show_r27) { - m_show_r27->set_state(loot_filter_settings::get().m_show_r27); - m_show_r27->set_on_click(std::bind(&loot_filter_settings_menu::extract_r27, - this, std::placeholders::_1)); - } + if (m_show_r13) { + m_show_r13->set_state(loot_filter_settings::get().m_show_r13); + m_show_r13->set_on_click(std::bind(&loot_filter_settings_menu::extract_r13, + this, std::placeholders::_1)); + } - if (m_show_r28) { - m_show_r28->set_state(loot_filter_settings::get().m_show_r28); - m_show_r28->set_on_click(std::bind(&loot_filter_settings_menu::extract_r28, - this, std::placeholders::_1)); - } + if (m_show_r14) { + m_show_r14->set_state(loot_filter_settings::get().m_show_r14); + m_show_r14->set_on_click(std::bind(&loot_filter_settings_menu::extract_r14, + this, std::placeholders::_1)); + } - if (m_show_r29) { - m_show_r29->set_state(loot_filter_settings::get().m_show_r29); - m_show_r29->set_on_click(std::bind(&loot_filter_settings_menu::extract_r29, - this, std::placeholders::_1)); - } + if (m_show_r15) { + m_show_r15->set_state(loot_filter_settings::get().m_show_r15); + m_show_r15->set_on_click(std::bind(&loot_filter_settings_menu::extract_r15, + this, std::placeholders::_1)); + } - if (m_show_r30) { - m_show_r30->set_state(loot_filter_settings::get().m_show_r30); - m_show_r30->set_on_click(std::bind(&loot_filter_settings_menu::extract_r30, - this, std::placeholders::_1)); - } + if (m_show_r16) { + m_show_r16->set_state(loot_filter_settings::get().m_show_r16); + m_show_r16->set_on_click(std::bind(&loot_filter_settings_menu::extract_r16, + this, std::placeholders::_1)); + } - if (m_show_r31) { - m_show_r31->set_state(loot_filter_settings::get().m_show_r31); - m_show_r31->set_on_click(std::bind(&loot_filter_settings_menu::extract_r31, - this, std::placeholders::_1)); - } + if (m_show_r17) { + m_show_r17->set_state(loot_filter_settings::get().m_show_r17); + m_show_r17->set_on_click(std::bind(&loot_filter_settings_menu::extract_r17, + this, std::placeholders::_1)); + } - if (m_show_r32) { - m_show_r32->set_state(loot_filter_settings::get().m_show_r32); - m_show_r32->set_on_click(std::bind(&loot_filter_settings_menu::extract_r32, - this, std::placeholders::_1)); - } + if (m_show_r18) { + m_show_r18->set_state(loot_filter_settings::get().m_show_r18); + m_show_r18->set_on_click(std::bind(&loot_filter_settings_menu::extract_r18, + this, std::placeholders::_1)); + } - if (m_show_r33) { - m_show_r33->set_state(loot_filter_settings::get().m_show_r33); - m_show_r33->set_on_click(std::bind(&loot_filter_settings_menu::extract_r33, - this, std::placeholders::_1)); - } + if (m_show_r19) { + m_show_r19->set_state(loot_filter_settings::get().m_show_r19); + m_show_r19->set_on_click(std::bind(&loot_filter_settings_menu::extract_r19, + this, std::placeholders::_1)); + } - } + if (m_show_r20) { + m_show_r20->set_state(loot_filter_settings::get().m_show_r20); + m_show_r20->set_on_click(std::bind(&loot_filter_settings_menu::extract_r20, + this, std::placeholders::_1)); + } + if (m_show_r21) { + m_show_r21->set_state(loot_filter_settings::get().m_show_r21); + m_show_r21->set_on_click(std::bind(&loot_filter_settings_menu::extract_r21, + this, std::placeholders::_1)); + } + if (m_show_r22) { + m_show_r22->set_state(loot_filter_settings::get().m_show_r22); + m_show_r22->set_on_click(std::bind(&loot_filter_settings_menu::extract_r22, + this, std::placeholders::_1)); + } - if (m_altonly) { - m_altonly->set_state(loot_filter_settings::get().alt_only); - m_altonly->set_on_click(std::bind(&loot_filter_settings_menu::update_alt_only, - this, std::placeholders::_1)); - } + if (m_show_r23) { + m_show_r23->set_state(loot_filter_settings::get().m_show_r23); + m_show_r23->set_on_click(std::bind(&loot_filter_settings_menu::extract_r23, + this, std::placeholders::_1)); + } - if (m_show_gold) { - m_show_gold->set_state(loot_filter_settings::get().show_gold); - m_show_gold->set_on_click(std::bind(&loot_filter_settings_menu::update_show_gold, - this, std::placeholders::_1)); - } + if (m_show_r24) { + m_show_r24->set_state(loot_filter_settings::get().m_show_r24); + m_show_r24->set_on_click(std::bind(&loot_filter_settings_menu::extract_r24, + this, std::placeholders::_1)); + } - if (m_show_runes) { - m_show_runes->set_state(loot_filter_settings::get().show_runes); - m_show_runes->set_on_click(std::bind(&loot_filter_settings_menu::update_show_runes, - this, std::placeholders::_1)); - } + if (m_show_r25) { + m_show_r25->set_state(loot_filter_settings::get().m_show_r25); + m_show_r25->set_on_click(std::bind(&loot_filter_settings_menu::extract_r25, + this, std::placeholders::_1)); + } - if (m_show_gems) { - m_show_gems->set_state(loot_filter_settings::get().show_gems); - m_show_gems->set_on_click(std::bind(&loot_filter_settings_menu::update_show_gems, - this, std::placeholders::_1)); - } + if (m_show_r26) { + m_show_r26->set_state(loot_filter_settings::get().m_show_r26); + m_show_r26->set_on_click(std::bind(&loot_filter_settings_menu::extract_r26, + this, std::placeholders::_1)); + } + + if (m_show_r27) { + m_show_r27->set_state(loot_filter_settings::get().m_show_r27); + m_show_r27->set_on_click(std::bind(&loot_filter_settings_menu::extract_r27, + this, std::placeholders::_1)); + } + + if (m_show_r28) { + m_show_r28->set_state(loot_filter_settings::get().m_show_r28); + m_show_r28->set_on_click(std::bind(&loot_filter_settings_menu::extract_r28, + this, std::placeholders::_1)); + } + + if (m_show_r29) { + m_show_r29->set_state(loot_filter_settings::get().m_show_r29); + m_show_r29->set_on_click(std::bind(&loot_filter_settings_menu::extract_r29, + this, std::placeholders::_1)); + } + + if (m_show_r30) { + m_show_r30->set_state(loot_filter_settings::get().m_show_r30); + m_show_r30->set_on_click(std::bind(&loot_filter_settings_menu::extract_r30, + this, std::placeholders::_1)); + } + + if (m_show_r31) { + m_show_r31->set_state(loot_filter_settings::get().m_show_r31); + m_show_r31->set_on_click(std::bind(&loot_filter_settings_menu::extract_r31, + this, std::placeholders::_1)); + } + + if (m_show_r32) { + m_show_r32->set_state(loot_filter_settings::get().m_show_r32); + m_show_r32->set_on_click(std::bind(&loot_filter_settings_menu::extract_r32, + this, std::placeholders::_1)); + } + + if (m_show_r33) { + m_show_r33->set_state(loot_filter_settings::get().m_show_r33); + m_show_r33->set_on_click(std::bind(&loot_filter_settings_menu::extract_r33, + this, std::placeholders::_1)); + } + } + + if (m_altonly) { + m_altonly->set_state(loot_filter_settings::get().alt_only); + m_altonly->set_on_click(std::bind(&loot_filter_settings_menu::update_alt_only, + this, std::placeholders::_1)); + } + + if (m_show_gold) { + m_show_gold->set_state(loot_filter_settings::get().show_gold); + m_show_gold->set_on_click(std::bind(&loot_filter_settings_menu::update_show_gold, + this, std::placeholders::_1)); + } + + if (m_show_runes) { + m_show_runes->set_state(loot_filter_settings::get().show_runes); + m_show_runes->set_on_click(std::bind(&loot_filter_settings_menu::update_show_runes, + this, std::placeholders::_1)); + } + + if (m_show_gems) { + m_show_gems->set_state(loot_filter_settings::get().show_gems); + m_show_gems->set_on_click(std::bind(&loot_filter_settings_menu::update_show_gems, + this, std::placeholders::_1)); + } } void d2_tweaks::client::modules::loot_filter_settings_menu::register_quality_checkboxes() { - using namespace diablo2::structures; + using namespace diablo2::structures; - register_quality_checkbox("m_inferior", item_quality_t::ITEM_QUALITY_INFERIOR); - register_quality_checkbox("m_normal", item_quality_t::ITEM_QUALITY_NORMAL); - register_quality_checkbox("m_superior", item_quality_t::ITEM_QUALITY_SUPERIOR); - register_quality_checkbox("m_magic", item_quality_t::ITEM_QUALITY_MAGIC); - register_quality_checkbox("m_set", item_quality_t::ITEM_QUALITY_SET); - register_quality_checkbox("m_rare", item_quality_t::ITEM_QUALITY_RARE); - register_quality_checkbox("m_unique", item_quality_t::ITEM_QUALITY_UNIQUE); - register_quality_checkbox("m_crafted", item_quality_t::ITEM_QUALITY_CRAFTED); - register_quality_checkbox("m_tempered", item_quality_t::ITEM_QUALITY_TEMPERED); + register_quality_checkbox("m_inferior", item_quality_t::ITEM_QUALITY_INFERIOR); + register_quality_checkbox("m_normal", item_quality_t::ITEM_QUALITY_NORMAL); + register_quality_checkbox("m_superior", item_quality_t::ITEM_QUALITY_SUPERIOR); + register_quality_checkbox("m_magic", item_quality_t::ITEM_QUALITY_MAGIC); + register_quality_checkbox("m_set", item_quality_t::ITEM_QUALITY_SET); + register_quality_checkbox("m_rare", item_quality_t::ITEM_QUALITY_RARE); + register_quality_checkbox("m_unique", item_quality_t::ITEM_QUALITY_UNIQUE); + register_quality_checkbox("m_crafted", item_quality_t::ITEM_QUALITY_CRAFTED); + register_quality_checkbox("m_tempered", item_quality_t::ITEM_QUALITY_TEMPERED); } void d2_tweaks::client::modules::loot_filter_settings_menu::update_alt_only(bool value) { - loot_filter_settings::get().alt_only = value; - loot_filter_settings::get().save(diablo2::d2_client::get_local_player_name()); + loot_filter_settings::get().alt_only = value; + loot_filter_settings::get().save(diablo2::d2_client::get_local_player_name()); } - // gems extraction functions void d2_tweaks::client::modules::loot_filter_settings_menu::extract_amethyst(bool value) {} void d2_tweaks::client::modules::loot_filter_settings_menu::extract_diamond(bool value) { - // Implementation goes here + // Implementation goes here } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_emerald(bool value) { - // Implementation goes here + // Implementation goes here } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_ruby(bool value) { - // Implementation goes here + // Implementation goes here } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_sapphire(bool value) { - // Implementation goes here + // Implementation goes here } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_skull(bool value) { - // Implementation goes here + // Implementation goes here } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_topaz(bool value) { - // Implementation goes here + // Implementation goes here } -// qualities extraction functions +// stones -void d2_tweaks::client::modules::loot_filter_settings_menu::extract_chipped(bool value) { - uint32_t gemCode = 0; - int gemPropRowID = 0; - diablo2::unit_stats_t stat; - if (m_selected_gem == "amethyst") { - gemCode = 'gcv '; - gemPropRowID = 382; - stat = diablo2::UNIT_STAT_gembag_Amethyst; +void d2_tweaks::client::modules::loot_filter_settings_menu::extract_rough(bool value) { - } - else if (m_selected_gem == "ruby") { - gemCode = 'gcr '; - gemPropRowID = 381; - stat = diablo2::UNIT_STAT_gembag_Ruby; - } - else if (m_selected_gem == "sapphire") { - gemCode = 'gcb '; - gemPropRowID = 385; - stat = diablo2::UNIT_STAT_gembag_Sapphire; - } - else if (m_selected_gem == "emerald") { - gemCode = 'gcg '; - gemPropRowID = 384; - stat = diablo2::UNIT_STAT_gembag_Emerald; - } - else if (m_selected_gem == "diamond") { - gemCode = 'gcw '; - gemPropRowID = 383; - stat = diablo2::UNIT_STAT_gembag_Diamond; - } - else if (m_selected_gem == "topaz") { - gemCode = 'gcy '; - gemPropRowID = 386; - stat = diablo2::UNIT_STAT_gembag_Topaz; - } - else if (m_selected_gem == "skull") { - gemCode = 'skc '; - gemPropRowID = 387; - stat = diablo2::UNIT_STAT_gembag_Skull; - } + uint32_t gemCode = 0; + int gemPropRowID = 0; + diablo2::unit_stats_t stat; - loot_filter_settings::get().m_show_chipped = value; + if (m_selected_gem == "flourite") { + gemCode = 'abc '; + gemPropRowID = 351; + stat = diablo2::UNIT_STAT_gembag_Stones_Flourite; + } + else if (m_selected_gem == "jade") { + gemCode = 'abv '; + gemPropRowID = 352; + stat = diablo2::UNIT_STAT_gembag_Stones_Jade; + } + else if (m_selected_gem == "argonite") { + gemCode = 'acg '; + gemPropRowID = 353; + stat = diablo2::UNIT_STAT_gembag_Stones_Argonite; + } + else if (m_selected_gem == "azurite") { + gemCode = 'acz '; + gemPropRowID = 354; + stat = diablo2::UNIT_STAT_gembag_Stones_Azurite; + } + else if (m_selected_gem == "sulpher") { + gemCode = 'adk '; + gemPropRowID = 355; + stat = diablo2::UNIT_STAT_gembag_Stones_Sulpher; + } + else if (m_selected_gem == "quartz") { + gemCode = 'ad3 '; + gemPropRowID = 356; + stat = diablo2::UNIT_STAT_gembag_Stones_Quartz; + } + else if (m_selected_gem == "tiger_eye") { + gemCode = 'aeo '; + gemPropRowID = 357; + stat = diablo2::UNIT_STAT_gembag_Stones_TigerEye; + } + + + loot_filter_settings::get().m_show_rough = value; auto player = diablo2::d2_client::get_local_player(); auto inventory = player->inventory; diablo2::structures::unit* bag; @@ -696,15 +911,22 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_chipped(bool } } if (statValue >= 1) { - static d2_tweaks::common::item_move_cs packet; - packet.item_guid = bagGuid; - packet.bag_guid = bagGuid; - packet.target_page = 0; - packet.extract = 1; - packet.iCode = gemCode; - packet.prop = gemPropRowID - 3; - packet.val = -1; - diablo2::d2_client::send_to_server(&packet, sizeof packet); + auto current_time = std::chrono::steady_clock::now(); + auto elapsed_time = std::chrono::duration_cast(current_time - m_last_packet_sent); + + if (elapsed_time.count() >= 500) { + static d2_tweaks::common::item_move_cs packet; + packet.item_guid = bagGuid; + packet.bag_guid = bagGuid; + packet.target_page = 0; + packet.extract = 1; + packet.iCode = gemCode; + packet.prop = gemPropRowID - 3; + packet.val = -1; + + diablo2::d2_client::send_to_server(&packet, sizeof packet); + m_last_packet_sent = current_time; + } D2PropertyStrc itemProperty = {}; itemProperty.nProperty = gemPropRowID - 3; // Adjust the property ID @@ -713,54 +935,1758 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_chipped(bool itemProperty.nMax = -1; diablo2::d2_common::add_property(bag, &itemProperty, 0); } +} +void d2_tweaks::client::modules::loot_filter_settings_menu::extract_faded(bool value) { + + uint32_t gemCode = 0; + int gemPropRowID = 0; + diablo2::unit_stats_t stat; + + if (m_selected_gem == "flourite") { + gemCode = 'abd '; + gemPropRowID = 351; + stat = diablo2::UNIT_STAT_gembag_Stones_Flourite; + } + else if (m_selected_gem == "jade") { + gemCode = 'abw '; + gemPropRowID = 352; + stat = diablo2::UNIT_STAT_gembag_Stones_Jade; + } + else if (m_selected_gem == "argonite") { + gemCode = 'ach '; + gemPropRowID = 353; + stat = diablo2::UNIT_STAT_gembag_Stones_Argonite; + } + else if (m_selected_gem == "azurite") { + gemCode = 'ac0 '; + gemPropRowID = 354; + stat = diablo2::UNIT_STAT_gembag_Stones_Azurite; + } + else if (m_selected_gem == "sulpher") { + gemCode = 'adl '; + gemPropRowID = 355; + stat = diablo2::UNIT_STAT_gembag_Stones_Sulpher; + } + else if (m_selected_gem == "quartz") { + gemCode = 'ad4 '; + gemPropRowID = 356; + stat = diablo2::UNIT_STAT_gembag_Stones_Quartz; + } + else if (m_selected_gem == "tiger_eye") { + gemCode = 'aep '; + gemPropRowID = 357; + stat = diablo2::UNIT_STAT_gembag_Stones_TigerEye; + } + + + + loot_filter_settings::get().m_show_rough = value; + auto player = diablo2::d2_client::get_local_player(); + auto inventory = player->inventory; + diablo2::structures::unit* bag; + uint32_t bagGuid = -1; + uint32_t statValue = 0; + + for (auto item = inventory->first_item; item != nullptr; item = item->item_data->pt_next_item) { + const auto record = diablo2::d2_common::get_item_record(item->data_record_index); + auto recordType = diablo2::d2_common::get_item_type_record(record->type); + char* normCode1 = record->string_code; + if (strncmp(normCode1, "ib1", 3) == 0) { + bag = item; + bagGuid = item->guid; + statValue = diablo2::d2_common::get_stat(item, stat, NULL); + } + } + if (statValue >= 2) { + auto current_time = std::chrono::steady_clock::now(); + auto elapsed_time = std::chrono::duration_cast(current_time - m_last_packet_sent); + + if (elapsed_time.count() >= 500) { + static d2_tweaks::common::item_move_cs packet; + packet.item_guid = bagGuid; + packet.bag_guid = bagGuid; + packet.target_page = 0; + packet.extract = 1; + packet.iCode = gemCode; + packet.prop = gemPropRowID - 3; + packet.val = -2; + + diablo2::d2_client::send_to_server(&packet, sizeof packet); + m_last_packet_sent = current_time; + } + + D2PropertyStrc itemProperty = {}; + itemProperty.nProperty = gemPropRowID - 3; // Adjust the property ID + itemProperty.nLayer = 0; + itemProperty.nMin = -2; + itemProperty.nMax = -2; + diablo2::d2_common::add_property(bag, &itemProperty, 0); + } +} + + + +void d2_tweaks::client::modules::loot_filter_settings_menu::extract_blemished(bool value) { + + uint32_t gemCode = 0; + int gemPropRowID = 0; + diablo2::unit_stats_t stat; + + if (m_selected_gem == "flourite") { + gemCode = 'abe '; + gemPropRowID = 351; + stat = diablo2::UNIT_STAT_gembag_Stones_Flourite; + } + else if (m_selected_gem == "jade") { + gemCode = 'abx '; + gemPropRowID = 352; + stat = diablo2::UNIT_STAT_gembag_Stones_Jade; + } + else if (m_selected_gem == "argonite") { + gemCode = 'aci '; + gemPropRowID = 353; + stat = diablo2::UNIT_STAT_gembag_Stones_Argonite; + } + else if (m_selected_gem == "azurite") { + gemCode = 'ac1 '; + gemPropRowID = 354; + stat = diablo2::UNIT_STAT_gembag_Stones_Azurite; + } + else if (m_selected_gem == "sulpher") { + gemCode = 'adm '; + gemPropRowID = 355; + stat = diablo2::UNIT_STAT_gembag_Stones_Sulpher; + } + else if (m_selected_gem == "quartz") { + gemCode = 'ad5 '; + gemPropRowID = 356; + stat = diablo2::UNIT_STAT_gembag_Stones_Quartz; + } + else if (m_selected_gem == "tiger_eye") { + gemCode = 'aeq '; + gemPropRowID = 357; + stat = diablo2::UNIT_STAT_gembag_Stones_TigerEye; + } + + + + + loot_filter_settings::get().m_show_rough = value; + auto player = diablo2::d2_client::get_local_player(); + auto inventory = player->inventory; + diablo2::structures::unit* bag; + uint32_t bagGuid = -1; + uint32_t statValue = 0; + + for (auto item = inventory->first_item; item != nullptr; item = item->item_data->pt_next_item) { + const auto record = diablo2::d2_common::get_item_record(item->data_record_index); + auto recordType = diablo2::d2_common::get_item_type_record(record->type); + char* normCode1 = record->string_code; + if (strncmp(normCode1, "ib1", 3) == 0) { + bag = item; + bagGuid = item->guid; + statValue = diablo2::d2_common::get_stat(item, stat, NULL); + } + } + if (statValue >= 4) { + auto current_time = std::chrono::steady_clock::now(); + auto elapsed_time = std::chrono::duration_cast(current_time - m_last_packet_sent); + + if (elapsed_time.count() >= 500) { + static d2_tweaks::common::item_move_cs packet; + packet.item_guid = bagGuid; + packet.bag_guid = bagGuid; + packet.target_page = 0; + packet.extract = 1; + packet.iCode = gemCode; + packet.prop = gemPropRowID - 3; + packet.val = -4; + + diablo2::d2_client::send_to_server(&packet, sizeof packet); + m_last_packet_sent = current_time; + } + + D2PropertyStrc itemProperty = {}; + itemProperty.nProperty = gemPropRowID - 3; // Adjust the property ID + itemProperty.nLayer = 0; + itemProperty.nMin = -4; + itemProperty.nMax = -4; + diablo2::d2_common::add_property(bag, &itemProperty, 0); + } +} + + + +void d2_tweaks::client::modules::loot_filter_settings_menu::extract_cleaned(bool value) { + + uint32_t gemCode = 0; + int gemPropRowID = 0; + diablo2::unit_stats_t stat; + + if (m_selected_gem == "flourite") { + gemCode = 'abf '; + gemPropRowID = 351; + stat = diablo2::UNIT_STAT_gembag_Stones_Flourite; + } + else if (m_selected_gem == "jade") { + gemCode = 'aby '; + gemPropRowID = 352; + stat = diablo2::UNIT_STAT_gembag_Stones_Jade; + } + else if (m_selected_gem == "argonite") { + gemCode = 'acj '; + gemPropRowID = 353; + stat = diablo2::UNIT_STAT_gembag_Stones_Argonite; + } + else if (m_selected_gem == "azurite") { + gemCode = 'ac2 '; + gemPropRowID = 354; + stat = diablo2::UNIT_STAT_gembag_Stones_Azurite; + } + else if (m_selected_gem == "sulpher") { + gemCode = 'adn '; + gemPropRowID = 355; + stat = diablo2::UNIT_STAT_gembag_Stones_Sulpher; + } + else if (m_selected_gem == "quartz") { + gemCode = 'ad6 '; + gemPropRowID = 356; + stat = diablo2::UNIT_STAT_gembag_Stones_Quartz; + } + else if (m_selected_gem == "tiger_eye") { + gemCode = 'aer '; + gemPropRowID = 357; + stat = diablo2::UNIT_STAT_gembag_Stones_TigerEye; + } + + + + loot_filter_settings::get().m_show_rough = value; + auto player = diablo2::d2_client::get_local_player(); + auto inventory = player->inventory; + diablo2::structures::unit* bag; + uint32_t bagGuid = -1; + uint32_t statValue = 0; + + for (auto item = inventory->first_item; item != nullptr; item = item->item_data->pt_next_item) { + const auto record = diablo2::d2_common::get_item_record(item->data_record_index); + auto recordType = diablo2::d2_common::get_item_type_record(record->type); + char* normCode1 = record->string_code; + if (strncmp(normCode1, "ib1", 3) == 0) { + bag = item; + bagGuid = item->guid; + statValue = diablo2::d2_common::get_stat(item, stat, NULL); + } + } + if (statValue >= 8) { + auto current_time = std::chrono::steady_clock::now(); + auto elapsed_time = std::chrono::duration_cast(current_time - m_last_packet_sent); + + if (elapsed_time.count() >= 500) { + static d2_tweaks::common::item_move_cs packet; + packet.item_guid = bagGuid; + packet.bag_guid = bagGuid; + packet.target_page = 0; + packet.extract = 1; + packet.iCode = gemCode; + packet.prop = gemPropRowID - 3; + packet.val = -8; + + diablo2::d2_client::send_to_server(&packet, sizeof packet); + m_last_packet_sent = current_time; + } + + D2PropertyStrc itemProperty = {}; + itemProperty.nProperty = gemPropRowID - 3; // Adjust the property ID + itemProperty.nLayer = 0; + itemProperty.nMin = -8; + itemProperty.nMax = -8; + diablo2::d2_common::add_property(bag, &itemProperty, 0); + } +} + + + +void d2_tweaks::client::modules::loot_filter_settings_menu::extract_triangle(bool value) { + + uint32_t gemCode = 0; + int gemPropRowID = 0; + diablo2::unit_stats_t stat; + + if (m_selected_gem == "flourite") { + gemCode = 'abg '; + gemPropRowID = 351; + stat = diablo2::UNIT_STAT_gembag_Stones_Flourite; + } + else if (m_selected_gem == "jade") { + gemCode = 'abz '; + gemPropRowID = 352; + stat = diablo2::UNIT_STAT_gembag_Stones_Jade; + } + else if (m_selected_gem == "argonite") { + gemCode = 'ack '; + gemPropRowID = 353; + stat = diablo2::UNIT_STAT_gembag_Stones_Argonite; + } + else if (m_selected_gem == "azurite") { + gemCode = 'ac3 '; + gemPropRowID = 354; + stat = diablo2::UNIT_STAT_gembag_Stones_Azurite; + } + else if (m_selected_gem == "sulpher") { + gemCode = 'ado '; + gemPropRowID = 355; + stat = diablo2::UNIT_STAT_gembag_Stones_Sulpher; + } + else if (m_selected_gem == "quartz") { + gemCode = 'ad7 '; + gemPropRowID = 356; + stat = diablo2::UNIT_STAT_gembag_Stones_Quartz; + } + else if (m_selected_gem == "tiger_eye") { + gemCode = 'aes '; + gemPropRowID = 357; + stat = diablo2::UNIT_STAT_gembag_Stones_TigerEye; + } + + + + loot_filter_settings::get().m_show_rough = value; + auto player = diablo2::d2_client::get_local_player(); + auto inventory = player->inventory; + diablo2::structures::unit* bag; + uint32_t bagGuid = -1; + uint32_t statValue = 0; + + for (auto item = inventory->first_item; item != nullptr; item = item->item_data->pt_next_item) { + const auto record = diablo2::d2_common::get_item_record(item->data_record_index); + auto recordType = diablo2::d2_common::get_item_type_record(record->type); + char* normCode1 = record->string_code; + if (strncmp(normCode1, "ib1", 3) == 0) { + bag = item; + bagGuid = item->guid; + statValue = diablo2::d2_common::get_stat(item, stat, NULL); + } + } + if (statValue >= 16) { + auto current_time = std::chrono::steady_clock::now(); + auto elapsed_time = std::chrono::duration_cast(current_time - m_last_packet_sent); + + if (elapsed_time.count() >= 500) { + static d2_tweaks::common::item_move_cs packet; + packet.item_guid = bagGuid; + packet.bag_guid = bagGuid; + packet.target_page = 0; + packet.extract = 1; + packet.iCode = gemCode; + packet.prop = gemPropRowID - 3; + packet.val = -16; + + diablo2::d2_client::send_to_server(&packet, sizeof packet); + m_last_packet_sent = current_time; + } + + D2PropertyStrc itemProperty = {}; + itemProperty.nProperty = gemPropRowID - 3; // Adjust the property ID + itemProperty.nLayer = 0; + itemProperty.nMin = -16; + itemProperty.nMax = -16; + diablo2::d2_common::add_property(bag, &itemProperty, 0); + } +} + + + +void d2_tweaks::client::modules::loot_filter_settings_menu::extract_trangle_cut(bool value) { + + uint32_t gemCode = 0; + int gemPropRowID = 0; + diablo2::unit_stats_t stat; + + if (m_selected_gem == "flourite") { + gemCode = 'abh '; + gemPropRowID = 351; + stat = diablo2::UNIT_STAT_gembag_Stones_Flourite; + } + else if (m_selected_gem == "jade") { + gemCode = 'ab0 '; + gemPropRowID = 352; + stat = diablo2::UNIT_STAT_gembag_Stones_Jade; + } + else if (m_selected_gem == "argonite") { + gemCode = 'acl '; + gemPropRowID = 353; + stat = diablo2::UNIT_STAT_gembag_Stones_Argonite; + } + else if (m_selected_gem == "azurite") { + gemCode = 'ac4 '; + gemPropRowID = 354; + stat = diablo2::UNIT_STAT_gembag_Stones_Azurite; + } + else if (m_selected_gem == "sulpher") { + gemCode = 'adp '; + gemPropRowID = 355; + stat = diablo2::UNIT_STAT_gembag_Stones_Sulpher; + } + else if (m_selected_gem == "quartz") { + gemCode = 'ad8 '; + gemPropRowID = 356; + stat = diablo2::UNIT_STAT_gembag_Stones_Quartz; + } + else if (m_selected_gem == "tiger_eye") { + gemCode = 'aet '; + gemPropRowID = 357; + stat = diablo2::UNIT_STAT_gembag_Stones_TigerEye; + } + + + + loot_filter_settings::get().m_show_rough = value; + auto player = diablo2::d2_client::get_local_player(); + auto inventory = player->inventory; + diablo2::structures::unit* bag; + uint32_t bagGuid = -1; + uint32_t statValue = 0; + + for (auto item = inventory->first_item; item != nullptr; item = item->item_data->pt_next_item) { + const auto record = diablo2::d2_common::get_item_record(item->data_record_index); + auto recordType = diablo2::d2_common::get_item_type_record(record->type); + char* normCode1 = record->string_code; + if (strncmp(normCode1, "ib1", 3) == 0) { + bag = item; + bagGuid = item->guid; + statValue = diablo2::d2_common::get_stat(item, stat, NULL); + } + } + if (statValue >= 32) { + auto current_time = std::chrono::steady_clock::now(); + auto elapsed_time = std::chrono::duration_cast(current_time - m_last_packet_sent); + + if (elapsed_time.count() >= 500) { + static d2_tweaks::common::item_move_cs packet; + packet.item_guid = bagGuid; + packet.bag_guid = bagGuid; + packet.target_page = 0; + packet.extract = 1; + packet.iCode = gemCode; + packet.prop = gemPropRowID - 3; + packet.val = -32; + + diablo2::d2_client::send_to_server(&packet, sizeof packet); + m_last_packet_sent = current_time; + } + + D2PropertyStrc itemProperty = {}; + itemProperty.nProperty = gemPropRowID - 3; // Adjust the property ID + itemProperty.nLayer = 0; + itemProperty.nMin = -32; + itemProperty.nMax = -32; + diablo2::d2_common::add_property(bag, &itemProperty, 0); + } +} + + + +void d2_tweaks::client::modules::loot_filter_settings_menu::extract_square(bool value) { + + uint32_t gemCode = 0; + int gemPropRowID = 0; + diablo2::unit_stats_t stat; + + if (m_selected_gem == "flourite") { + gemCode = 'abi '; + gemPropRowID = 351; + stat = diablo2::UNIT_STAT_gembag_Stones_Flourite; + } + else if (m_selected_gem == "jade") { + gemCode = 'ab1 '; + gemPropRowID = 352; + stat = diablo2::UNIT_STAT_gembag_Stones_Jade; + } + else if (m_selected_gem == "argonite") { + gemCode = 'acm '; + gemPropRowID = 353; + stat = diablo2::UNIT_STAT_gembag_Stones_Argonite; + } + else if (m_selected_gem == "azurite") { + gemCode = 'ac5 '; + gemPropRowID = 354; + stat = diablo2::UNIT_STAT_gembag_Stones_Azurite; + } + else if (m_selected_gem == "sulpher") { + gemCode = 'adq '; + gemPropRowID = 355; + stat = diablo2::UNIT_STAT_gembag_Stones_Sulpher; + } + else if (m_selected_gem == "quartz") { + gemCode = 'ad9 '; + gemPropRowID = 356; + stat = diablo2::UNIT_STAT_gembag_Stones_Quartz; + } + else if (m_selected_gem == "tiger_eye") { + gemCode = 'aeu '; + gemPropRowID = 357; + stat = diablo2::UNIT_STAT_gembag_Stones_TigerEye; + } + + + loot_filter_settings::get().m_show_rough = value; + auto player = diablo2::d2_client::get_local_player(); + auto inventory = player->inventory; + diablo2::structures::unit* bag; + uint32_t bagGuid = -1; + uint32_t statValue = 0; + + for (auto item = inventory->first_item; item != nullptr; item = item->item_data->pt_next_item) { + const auto record = diablo2::d2_common::get_item_record(item->data_record_index); + auto recordType = diablo2::d2_common::get_item_type_record(record->type); + char* normCode1 = record->string_code; + if (strncmp(normCode1, "ib1", 3) == 0) { + bag = item; + bagGuid = item->guid; + statValue = diablo2::d2_common::get_stat(item, stat, NULL); + } + } + if (statValue >= 64) { + auto current_time = std::chrono::steady_clock::now(); + auto elapsed_time = std::chrono::duration_cast(current_time - m_last_packet_sent); + + if (elapsed_time.count() >= 500) { + static d2_tweaks::common::item_move_cs packet; + packet.item_guid = bagGuid; + packet.bag_guid = bagGuid; + packet.target_page = 0; + packet.extract = 1; + packet.iCode = gemCode; + packet.prop = gemPropRowID - 3; + packet.val = -64; + + diablo2::d2_client::send_to_server(&packet, sizeof packet); + m_last_packet_sent = current_time; + } + + D2PropertyStrc itemProperty = {}; + itemProperty.nProperty = gemPropRowID - 3; // Adjust the property ID + itemProperty.nLayer = 0; + itemProperty.nMin = -64; + itemProperty.nMax = -64; + diablo2::d2_common::add_property(bag, &itemProperty, 0); + } +} + + + +void d2_tweaks::client::modules::loot_filter_settings_menu::extract_square_cut(bool value) { + + uint32_t gemCode = 0; + int gemPropRowID = 0; + diablo2::unit_stats_t stat; + + if (m_selected_gem == "flourite") { + gemCode = 'abj '; + gemPropRowID = 351; + stat = diablo2::UNIT_STAT_gembag_Stones_Flourite; + } + else if (m_selected_gem == "jade") { + gemCode = 'ab2 '; + gemPropRowID = 352; + stat = diablo2::UNIT_STAT_gembag_Stones_Jade; + } + else if (m_selected_gem == "argonite") { + gemCode = 'acn '; + gemPropRowID = 353; + stat = diablo2::UNIT_STAT_gembag_Stones_Argonite; + } + else if (m_selected_gem == "azurite") { + gemCode = 'ac6 '; + gemPropRowID = 354; + stat = diablo2::UNIT_STAT_gembag_Stones_Azurite; + } + else if (m_selected_gem == "sulpher") { + gemCode = 'adr '; + gemPropRowID = 355; + stat = diablo2::UNIT_STAT_gembag_Stones_Sulpher; + } + else if (m_selected_gem == "quartz") { + gemCode = 'aeb '; + gemPropRowID = 356; + stat = diablo2::UNIT_STAT_gembag_Stones_Quartz; + } + else if (m_selected_gem == "tiger_eye") { + gemCode = 'aev '; + gemPropRowID = 357; + stat = diablo2::UNIT_STAT_gembag_Stones_TigerEye; + } + + + + loot_filter_settings::get().m_show_rough = value; + auto player = diablo2::d2_client::get_local_player(); + auto inventory = player->inventory; + diablo2::structures::unit* bag; + uint32_t bagGuid = -1; + uint32_t statValue = 0; + + for (auto item = inventory->first_item; item != nullptr; item = item->item_data->pt_next_item) { + const auto record = diablo2::d2_common::get_item_record(item->data_record_index); + auto recordType = diablo2::d2_common::get_item_type_record(record->type); + char* normCode1 = record->string_code; + if (strncmp(normCode1, "ib1", 3) == 0) { + bag = item; + bagGuid = item->guid; + statValue = diablo2::d2_common::get_stat(item, stat, NULL); + } + } + if (statValue >= 128) { + auto current_time = std::chrono::steady_clock::now(); + auto elapsed_time = std::chrono::duration_cast(current_time - m_last_packet_sent); + + if (elapsed_time.count() >= 500) { + static d2_tweaks::common::item_move_cs packet; + packet.item_guid = bagGuid; + packet.bag_guid = bagGuid; + packet.target_page = 0; + packet.extract = 1; + packet.iCode = gemCode; + packet.prop = gemPropRowID - 3; + packet.val = -128; + + diablo2::d2_client::send_to_server(&packet, sizeof packet); + m_last_packet_sent = current_time; + } + + D2PropertyStrc itemProperty = {}; + itemProperty.nProperty = gemPropRowID - 3; // Adjust the property ID + itemProperty.nLayer = 0; + itemProperty.nMin = -128; + itemProperty.nMax = -128; + diablo2::d2_common::add_property(bag, &itemProperty, 0); + } +} + + + +void d2_tweaks::client::modules::loot_filter_settings_menu::extract_regular(bool value) { + + uint32_t gemCode = 0; + int gemPropRowID = 0; + diablo2::unit_stats_t stat; + + if (m_selected_gem == "flourite") { + gemCode = 'abk '; + gemPropRowID = 351; + stat = diablo2::UNIT_STAT_gembag_Stones_Flourite; + } + else if (m_selected_gem == "jade") { + gemCode = 'ab3 '; + gemPropRowID = 352; + stat = diablo2::UNIT_STAT_gembag_Stones_Jade; + } + else if (m_selected_gem == "argonite") { + gemCode = 'aco '; + gemPropRowID = 353; + stat = diablo2::UNIT_STAT_gembag_Stones_Argonite; + } + else if (m_selected_gem == "azurite") { + gemCode = 'ac7 '; + gemPropRowID = 354; + stat = diablo2::UNIT_STAT_gembag_Stones_Azurite; + } + else if (m_selected_gem == "sulpher") { + gemCode = 'ads '; + gemPropRowID = 355; + stat = diablo2::UNIT_STAT_gembag_Stones_Sulpher; + } + else if (m_selected_gem == "quartz") { + gemCode = 'aec '; + gemPropRowID = 356; + stat = diablo2::UNIT_STAT_gembag_Stones_Quartz; + } + else if (m_selected_gem == "tiger_eye") { + gemCode = 'aew '; + gemPropRowID = 357; + stat = diablo2::UNIT_STAT_gembag_Stones_TigerEye; + } + + + + loot_filter_settings::get().m_show_rough = value; + auto player = diablo2::d2_client::get_local_player(); + auto inventory = player->inventory; + diablo2::structures::unit* bag; + uint32_t bagGuid = -1; + uint32_t statValue = 0; + + for (auto item = inventory->first_item; item != nullptr; item = item->item_data->pt_next_item) { + const auto record = diablo2::d2_common::get_item_record(item->data_record_index); + auto recordType = diablo2::d2_common::get_item_type_record(record->type); + char* normCode1 = record->string_code; + if (strncmp(normCode1, "ib1", 3) == 0) { + bag = item; + bagGuid = item->guid; + statValue = diablo2::d2_common::get_stat(item, stat, NULL); + } + } + if (statValue >= 256) { + auto current_time = std::chrono::steady_clock::now(); + auto elapsed_time = std::chrono::duration_cast(current_time - m_last_packet_sent); + + if (elapsed_time.count() >= 500) { + static d2_tweaks::common::item_move_cs packet; + packet.item_guid = bagGuid; + packet.bag_guid = bagGuid; + packet.target_page = 0; + packet.extract = 1; + packet.iCode = gemCode; + packet.prop = gemPropRowID - 3; + packet.val = -256; + + diablo2::d2_client::send_to_server(&packet, sizeof packet); + m_last_packet_sent = current_time; + } + + D2PropertyStrc itemProperty = {}; + itemProperty.nProperty = gemPropRowID - 3; // Adjust the property ID + itemProperty.nLayer = 0; + itemProperty.nMin = -256; + itemProperty.nMax = -256; + diablo2::d2_common::add_property(bag, &itemProperty, 0); + } +} + + + +void d2_tweaks::client::modules::loot_filter_settings_menu::extract_regular_cut(bool value) { + + uint32_t gemCode = 0; + int gemPropRowID = 0; + diablo2::unit_stats_t stat; + + if (m_selected_gem == "flourite") { + gemCode = 'abl '; + gemPropRowID = 351; + stat = diablo2::UNIT_STAT_gembag_Stones_Flourite; + } + else if (m_selected_gem == "jade") { + gemCode = 'ab4 '; + gemPropRowID = 352; + stat = diablo2::UNIT_STAT_gembag_Stones_Jade; + } + else if (m_selected_gem == "argonite") { + gemCode = 'acp '; + gemPropRowID = 353; + stat = diablo2::UNIT_STAT_gembag_Stones_Argonite; + } + else if (m_selected_gem == "azurite") { + gemCode = 'ac8 '; + gemPropRowID = 354; + stat = diablo2::UNIT_STAT_gembag_Stones_Azurite; + } + else if (m_selected_gem == "sulpher") { + gemCode = 'adt '; + gemPropRowID = 355; + stat = diablo2::UNIT_STAT_gembag_Stones_Sulpher; + } + else if (m_selected_gem == "quartz") { + gemCode = 'aed '; + gemPropRowID = 356; + stat = diablo2::UNIT_STAT_gembag_Stones_Quartz; + } + else if (m_selected_gem == "tiger_eye") { + gemCode = 'aex '; + gemPropRowID = 357; + stat = diablo2::UNIT_STAT_gembag_Stones_TigerEye; + } + + + loot_filter_settings::get().m_show_rough = value; + auto player = diablo2::d2_client::get_local_player(); + auto inventory = player->inventory; + diablo2::structures::unit* bag; + uint32_t bagGuid = -1; + uint32_t statValue = 0; + + for (auto item = inventory->first_item; item != nullptr; item = item->item_data->pt_next_item) { + const auto record = diablo2::d2_common::get_item_record(item->data_record_index); + auto recordType = diablo2::d2_common::get_item_type_record(record->type); + char* normCode1 = record->string_code; + if (strncmp(normCode1, "ib1", 3) == 0) { + bag = item; + bagGuid = item->guid; + statValue = diablo2::d2_common::get_stat(item, stat, NULL); + } + } + if (statValue >= 512) { + auto current_time = std::chrono::steady_clock::now(); + auto elapsed_time = std::chrono::duration_cast(current_time - m_last_packet_sent); + + if (elapsed_time.count() >= 500) { + static d2_tweaks::common::item_move_cs packet; + packet.item_guid = bagGuid; + packet.bag_guid = bagGuid; + packet.target_page = 0; + packet.extract = 1; + packet.iCode = gemCode; + packet.prop = gemPropRowID - 3; + packet.val = -512; + + diablo2::d2_client::send_to_server(&packet, sizeof packet); + m_last_packet_sent = current_time; + } + + D2PropertyStrc itemProperty = {}; + itemProperty.nProperty = gemPropRowID - 3; // Adjust the property ID + itemProperty.nLayer = 0; + itemProperty.nMin = -512; + itemProperty.nMax = -512; + diablo2::d2_common::add_property(bag, &itemProperty, 0); + } +} + + + +void d2_tweaks::client::modules::loot_filter_settings_menu::extract_star(bool value) { + + uint32_t gemCode = 0; + int gemPropRowID = 0; + diablo2::unit_stats_t stat; + + if (m_selected_gem == "flourite") { + gemCode = 'abm '; + gemPropRowID = 351; + stat = diablo2::UNIT_STAT_gembag_Stones_Flourite; + } + else if (m_selected_gem == "jade") { + gemCode = 'ab5 '; + gemPropRowID = 352; + stat = diablo2::UNIT_STAT_gembag_Stones_Jade; + } + else if (m_selected_gem == "argonite") { + gemCode = 'acq '; + gemPropRowID = 353; + stat = diablo2::UNIT_STAT_gembag_Stones_Argonite; + } + else if (m_selected_gem == "azurite") { + gemCode = 'ac9 '; + gemPropRowID = 354; + stat = diablo2::UNIT_STAT_gembag_Stones_Azurite; + } + else if (m_selected_gem == "sulpher") { + gemCode = 'adu '; + gemPropRowID = 355; + stat = diablo2::UNIT_STAT_gembag_Stones_Sulpher; + } + else if (m_selected_gem == "quartz") { + gemCode = 'aef '; + gemPropRowID = 356; + stat = diablo2::UNIT_STAT_gembag_Stones_Quartz; + } + else if (m_selected_gem == "tiger_eye") { + gemCode = 'aey '; + gemPropRowID = 357; + stat = diablo2::UNIT_STAT_gembag_Stones_TigerEye; + } + + + + loot_filter_settings::get().m_show_rough = value; + auto player = diablo2::d2_client::get_local_player(); + auto inventory = player->inventory; + diablo2::structures::unit* bag; + uint32_t bagGuid = -1; + uint32_t statValue = 0; + + for (auto item = inventory->first_item; item != nullptr; item = item->item_data->pt_next_item) { + const auto record = diablo2::d2_common::get_item_record(item->data_record_index); + auto recordType = diablo2::d2_common::get_item_type_record(record->type); + char* normCode1 = record->string_code; + if (strncmp(normCode1, "ib1", 3) == 0) { + bag = item; + bagGuid = item->guid; + statValue = diablo2::d2_common::get_stat(item, stat, NULL); + } + } + if (statValue >= 1024) { + auto current_time = std::chrono::steady_clock::now(); + auto elapsed_time = std::chrono::duration_cast(current_time - m_last_packet_sent); + + if (elapsed_time.count() >= 500) { + static d2_tweaks::common::item_move_cs packet; + packet.item_guid = bagGuid; + packet.bag_guid = bagGuid; + packet.target_page = 0; + packet.extract = 1; + packet.iCode = gemCode; + packet.prop = gemPropRowID - 3; + packet.val = -1024; + + diablo2::d2_client::send_to_server(&packet, sizeof packet); + m_last_packet_sent = current_time; + } + + D2PropertyStrc itemProperty = {}; + itemProperty.nProperty = gemPropRowID - 3; // Adjust the property ID + itemProperty.nLayer = 0; + itemProperty.nMin = -1024; + itemProperty.nMax = -1024; + diablo2::d2_common::add_property(bag, &itemProperty, 0); + } +} + + + +void d2_tweaks::client::modules::loot_filter_settings_menu::extract_star_cut(bool value) { + + uint32_t gemCode = 0; + int gemPropRowID = 0; + diablo2::unit_stats_t stat; + + if (m_selected_gem == "flourite") { + gemCode = 'abn '; + gemPropRowID = 351; + stat = diablo2::UNIT_STAT_gembag_Stones_Flourite; + } + else if (m_selected_gem == "jade") { + gemCode = 'ab6 '; + gemPropRowID = 352; + stat = diablo2::UNIT_STAT_gembag_Stones_Jade; + } + else if (m_selected_gem == "argonite") { + gemCode = 'acr '; + gemPropRowID = 353; + stat = diablo2::UNIT_STAT_gembag_Stones_Argonite; + } + else if (m_selected_gem == "azurite") { + gemCode = 'adb '; + gemPropRowID = 354; + stat = diablo2::UNIT_STAT_gembag_Stones_Azurite; + } + else if (m_selected_gem == "sulpher") { + gemCode = 'adv '; + gemPropRowID = 355; + stat = diablo2::UNIT_STAT_gembag_Stones_Sulpher; + } + else if (m_selected_gem == "quartz") { + gemCode = 'aeg '; + gemPropRowID = 356; + stat = diablo2::UNIT_STAT_gembag_Stones_Quartz; + } + else if (m_selected_gem == "tiger_eye") { + gemCode = 'aez '; + gemPropRowID = 357; + stat = diablo2::UNIT_STAT_gembag_Stones_TigerEye; + } + + + + loot_filter_settings::get().m_show_rough = value; + auto player = diablo2::d2_client::get_local_player(); + auto inventory = player->inventory; + diablo2::structures::unit* bag; + uint32_t bagGuid = -1; + uint32_t statValue = 0; + + for (auto item = inventory->first_item; item != nullptr; item = item->item_data->pt_next_item) { + const auto record = diablo2::d2_common::get_item_record(item->data_record_index); + auto recordType = diablo2::d2_common::get_item_type_record(record->type); + char* normCode1 = record->string_code; + if (strncmp(normCode1, "ib1", 3) == 0) { + bag = item; + bagGuid = item->guid; + statValue = diablo2::d2_common::get_stat(item, stat, NULL); + } + } + if (statValue >= 2048) { + auto current_time = std::chrono::steady_clock::now(); + auto elapsed_time = std::chrono::duration_cast(current_time - m_last_packet_sent); + + if (elapsed_time.count() >= 500) { + static d2_tweaks::common::item_move_cs packet; + packet.item_guid = bagGuid; + packet.bag_guid = bagGuid; + packet.target_page = 0; + packet.extract = 1; + packet.iCode = gemCode; + packet.prop = gemPropRowID - 3; + packet.val = -2048; + + diablo2::d2_client::send_to_server(&packet, sizeof packet); + m_last_packet_sent = current_time; + } + + D2PropertyStrc itemProperty = {}; + itemProperty.nProperty = gemPropRowID - 3; // Adjust the property ID + itemProperty.nLayer = 0; + itemProperty.nMin = -2048; + itemProperty.nMax = -2048; + diablo2::d2_common::add_property(bag, &itemProperty, 0); + } +} + + + +void d2_tweaks::client::modules::loot_filter_settings_menu::extract_imperial(bool value) { + + uint32_t gemCode = 0; + int gemPropRowID = 0; + diablo2::unit_stats_t stat; + + if (m_selected_gem == "flourite") { + gemCode = 'abo '; + gemPropRowID = 351; + stat = diablo2::UNIT_STAT_gembag_Stones_Flourite; + } + else if (m_selected_gem == "jade") { + gemCode = 'ab7 '; + gemPropRowID = 352; + stat = diablo2::UNIT_STAT_gembag_Stones_Jade; + } + else if (m_selected_gem == "argonite") { + gemCode = 'acs '; + gemPropRowID = 353; + stat = diablo2::UNIT_STAT_gembag_Stones_Argonite; + } + else if (m_selected_gem == "azurite") { + gemCode = 'adc '; + gemPropRowID = 354; + stat = diablo2::UNIT_STAT_gembag_Stones_Azurite; + } + else if (m_selected_gem == "sulpher") { + gemCode = 'adw '; + gemPropRowID = 355; + stat = diablo2::UNIT_STAT_gembag_Stones_Sulpher; + } + else if (m_selected_gem == "quartz") { + gemCode = 'aeh '; + gemPropRowID = 356; + stat = diablo2::UNIT_STAT_gembag_Stones_Quartz; + } + else if (m_selected_gem == "tiger_eye") { + gemCode = 'ae0 '; + gemPropRowID = 357; + stat = diablo2::UNIT_STAT_gembag_Stones_TigerEye; + } + + + + loot_filter_settings::get().m_show_rough = value; + auto player = diablo2::d2_client::get_local_player(); + auto inventory = player->inventory; + diablo2::structures::unit* bag; + uint32_t bagGuid = -1; + uint32_t statValue = 0; + + for (auto item = inventory->first_item; item != nullptr; item = item->item_data->pt_next_item) { + const auto record = diablo2::d2_common::get_item_record(item->data_record_index); + auto recordType = diablo2::d2_common::get_item_type_record(record->type); + char* normCode1 = record->string_code; + if (strncmp(normCode1, "ib1", 3) == 0) { + bag = item; + bagGuid = item->guid; + statValue = diablo2::d2_common::get_stat(item, stat, NULL); + } + } + if (statValue >= 4096) { + auto current_time = std::chrono::steady_clock::now(); + auto elapsed_time = std::chrono::duration_cast(current_time - m_last_packet_sent); + + if (elapsed_time.count() >= 500) { + static d2_tweaks::common::item_move_cs packet; + packet.item_guid = bagGuid; + packet.bag_guid = bagGuid; + packet.target_page = 0; + packet.extract = 1; + packet.iCode = gemCode; + packet.prop = gemPropRowID - 3; + packet.val = -4096; + + diablo2::d2_client::send_to_server(&packet, sizeof packet); + m_last_packet_sent = current_time; + } + + D2PropertyStrc itemProperty = {}; + itemProperty.nProperty = gemPropRowID - 3; // Adjust the property ID + itemProperty.nLayer = 0; + itemProperty.nMin = -4096; + itemProperty.nMax = -4096; + diablo2::d2_common::add_property(bag, &itemProperty, 0); + } +} + + + +void d2_tweaks::client::modules::loot_filter_settings_menu::extract_imperial_cut(bool value) { + + uint32_t gemCode = 0; + int gemPropRowID = 0; + diablo2::unit_stats_t stat; + + if (m_selected_gem == "flourite") { + gemCode = 'abp '; + gemPropRowID = 351; + stat = diablo2::UNIT_STAT_gembag_Stones_Flourite; + } + else if (m_selected_gem == "jade") { + gemCode = 'ab8 '; + gemPropRowID = 352; + stat = diablo2::UNIT_STAT_gembag_Stones_Jade; + } + else if (m_selected_gem == "argonite") { + gemCode = 'act '; + gemPropRowID = 353; + stat = diablo2::UNIT_STAT_gembag_Stones_Argonite; + } + else if (m_selected_gem == "azurite") { + gemCode = 'ade '; + gemPropRowID = 354; + stat = diablo2::UNIT_STAT_gembag_Stones_Azurite; + } + else if (m_selected_gem == "sulpher") { + gemCode = 'adx '; + gemPropRowID = 355; + stat = diablo2::UNIT_STAT_gembag_Stones_Sulpher; + } + else if (m_selected_gem == "quartz") { + gemCode = 'aei '; + gemPropRowID = 356; + stat = diablo2::UNIT_STAT_gembag_Stones_Quartz; + } + else if (m_selected_gem == "tiger_eye") { + gemCode = 'ae1 '; + gemPropRowID = 357; + stat = diablo2::UNIT_STAT_gembag_Stones_TigerEye; + } + + + + loot_filter_settings::get().m_show_rough = value; + auto player = diablo2::d2_client::get_local_player(); + auto inventory = player->inventory; + diablo2::structures::unit* bag; + uint32_t bagGuid = -1; + uint32_t statValue = 0; + + for (auto item = inventory->first_item; item != nullptr; item = item->item_data->pt_next_item) { + const auto record = diablo2::d2_common::get_item_record(item->data_record_index); + auto recordType = diablo2::d2_common::get_item_type_record(record->type); + char* normCode1 = record->string_code; + if (strncmp(normCode1, "ib1", 3) == 0) { + bag = item; + bagGuid = item->guid; + statValue = diablo2::d2_common::get_stat(item, stat, NULL); + } + } + if (statValue >= 8192) { + auto current_time = std::chrono::steady_clock::now(); + auto elapsed_time = std::chrono::duration_cast(current_time - m_last_packet_sent); + + if (elapsed_time.count() >= 500) { + static d2_tweaks::common::item_move_cs packet; + packet.item_guid = bagGuid; + packet.bag_guid = bagGuid; + packet.target_page = 0; + packet.extract = 1; + packet.iCode = gemCode; + packet.prop = gemPropRowID - 3; + packet.val = -8192; + + diablo2::d2_client::send_to_server(&packet, sizeof packet); + m_last_packet_sent = current_time; + } + + D2PropertyStrc itemProperty = {}; + itemProperty.nProperty = gemPropRowID - 3; // Adjust the property ID + itemProperty.nLayer = 0; + itemProperty.nMin = -8192; + itemProperty.nMax = -8192; + diablo2::d2_common::add_property(bag, &itemProperty, 0); + } +} + + + +void d2_tweaks::client::modules::loot_filter_settings_menu::extract_royal(bool value) { + + uint32_t gemCode = 0; + int gemPropRowID = 0; + diablo2::unit_stats_t stat; + + if (m_selected_gem == "flourite") { + gemCode = 'abq '; + gemPropRowID = 351; + stat = diablo2::UNIT_STAT_gembag_Stones_Flourite; + } + else if (m_selected_gem == "jade") { + gemCode = 'ab9 '; + gemPropRowID = 352; + stat = diablo2::UNIT_STAT_gembag_Stones_Jade; + } + else if (m_selected_gem == "argonite") { + gemCode = 'acu '; + gemPropRowID = 353; + stat = diablo2::UNIT_STAT_gembag_Stones_Argonite; + } + else if (m_selected_gem == "azurite") { + gemCode = 'adf '; + gemPropRowID = 354; + stat = diablo2::UNIT_STAT_gembag_Stones_Azurite; + } + else if (m_selected_gem == "sulpher") { + gemCode = 'ady '; + gemPropRowID = 355; + stat = diablo2::UNIT_STAT_gembag_Stones_Sulpher; + } + else if (m_selected_gem == "quartz") { + gemCode = 'aej '; + gemPropRowID = 356; + stat = diablo2::UNIT_STAT_gembag_Stones_Quartz; + } + else if (m_selected_gem == "tiger_eye") { + gemCode = 'ae2 '; + gemPropRowID = 357; + stat = diablo2::UNIT_STAT_gembag_Stones_TigerEye; + } + + + + loot_filter_settings::get().m_show_rough = value; + auto player = diablo2::d2_client::get_local_player(); + auto inventory = player->inventory; + diablo2::structures::unit* bag; + uint32_t bagGuid = -1; + uint32_t statValue = 0; + + for (auto item = inventory->first_item; item != nullptr; item = item->item_data->pt_next_item) { + const auto record = diablo2::d2_common::get_item_record(item->data_record_index); + auto recordType = diablo2::d2_common::get_item_type_record(record->type); + char* normCode1 = record->string_code; + if (strncmp(normCode1, "ib1", 3) == 0) { + bag = item; + bagGuid = item->guid; + statValue = diablo2::d2_common::get_stat(item, stat, NULL); + } + } + if (statValue >= 16384) { + auto current_time = std::chrono::steady_clock::now(); + auto elapsed_time = std::chrono::duration_cast(current_time - m_last_packet_sent); + + if (elapsed_time.count() >= 500) { + static d2_tweaks::common::item_move_cs packet; + packet.item_guid = bagGuid; + packet.bag_guid = bagGuid; + packet.target_page = 0; + packet.extract = 1; + packet.iCode = gemCode; + packet.prop = gemPropRowID - 3; + packet.val = -16384; + + diablo2::d2_client::send_to_server(&packet, sizeof packet); + m_last_packet_sent = current_time; + } + + D2PropertyStrc itemProperty = {}; + itemProperty.nProperty = gemPropRowID - 3; // Adjust the property ID + itemProperty.nLayer = 0; + itemProperty.nMin = -16384; + itemProperty.nMax = -16384; + diablo2::d2_common::add_property(bag, &itemProperty, 0); + } +} + + + +void d2_tweaks::client::modules::loot_filter_settings_menu::extract_royal_cut(bool value) { + + uint32_t gemCode = 0; + int gemPropRowID = 0; + diablo2::unit_stats_t stat; + + if (m_selected_gem == "flourite") { + gemCode = 'abr '; + gemPropRowID = 351; + stat = diablo2::UNIT_STAT_gembag_Stones_Flourite; + } + else if (m_selected_gem == "jade") { + gemCode = 'acb '; + gemPropRowID = 352; + stat = diablo2::UNIT_STAT_gembag_Stones_Jade; + } + else if (m_selected_gem == "argonite") { + gemCode = 'acv '; + gemPropRowID = 353; + stat = diablo2::UNIT_STAT_gembag_Stones_Argonite; + } + else if (m_selected_gem == "azurite") { + gemCode = 'adg '; + gemPropRowID = 354; + stat = diablo2::UNIT_STAT_gembag_Stones_Azurite; + } + else if (m_selected_gem == "sulpher") { + gemCode = 'adz '; + gemPropRowID = 355; + stat = diablo2::UNIT_STAT_gembag_Stones_Sulpher; + } + else if (m_selected_gem == "quartz") { + gemCode = 'aek '; + gemPropRowID = 356; + stat = diablo2::UNIT_STAT_gembag_Stones_Quartz; + } + else if (m_selected_gem == "tiger_eye") { + gemCode = 'ae3 '; + gemPropRowID = 357; + stat = diablo2::UNIT_STAT_gembag_Stones_TigerEye; + } + + + + loot_filter_settings::get().m_show_rough = value; + auto player = diablo2::d2_client::get_local_player(); + auto inventory = player->inventory; + diablo2::structures::unit* bag; + uint32_t bagGuid = -1; + uint32_t statValue = 0; + + for (auto item = inventory->first_item; item != nullptr; item = item->item_data->pt_next_item) { + const auto record = diablo2::d2_common::get_item_record(item->data_record_index); + auto recordType = diablo2::d2_common::get_item_type_record(record->type); + char* normCode1 = record->string_code; + if (strncmp(normCode1, "ib1", 3) == 0) { + bag = item; + bagGuid = item->guid; + statValue = diablo2::d2_common::get_stat(item, stat, NULL); + } + } + if (statValue >= 32768) { + auto current_time = std::chrono::steady_clock::now(); + auto elapsed_time = std::chrono::duration_cast(current_time - m_last_packet_sent); + + if (elapsed_time.count() >= 500) { + static d2_tweaks::common::item_move_cs packet; + packet.item_guid = bagGuid; + packet.bag_guid = bagGuid; + packet.target_page = 0; + packet.extract = 1; + packet.iCode = gemCode; + packet.prop = gemPropRowID - 3; + packet.val = -32768; + + diablo2::d2_client::send_to_server(&packet, sizeof packet); + m_last_packet_sent = current_time; + } + + D2PropertyStrc itemProperty = {}; + itemProperty.nProperty = gemPropRowID - 3; // Adjust the property ID + itemProperty.nLayer = 0; + itemProperty.nMin = -32768; + itemProperty.nMax = -32768; + diablo2::d2_common::add_property(bag, &itemProperty, 0); + } +} + + + +void d2_tweaks::client::modules::loot_filter_settings_menu::extract_spectacular(bool value) { + + uint32_t gemCode = 0; + int gemPropRowID = 0; + diablo2::unit_stats_t stat; + + if (m_selected_gem == "flourite") { + gemCode = 'abs '; + gemPropRowID = 351; + stat = diablo2::UNIT_STAT_gembag_Stones_Flourite; + } + else if (m_selected_gem == "jade") { + gemCode = 'acd '; + gemPropRowID = 352; + stat = diablo2::UNIT_STAT_gembag_Stones_Jade; + } + else if (m_selected_gem == "argonite") { + gemCode = 'acw '; + gemPropRowID = 353; + stat = diablo2::UNIT_STAT_gembag_Stones_Argonite; + } + else if (m_selected_gem == "azurite") { + gemCode = 'adh '; + gemPropRowID = 354; + stat = diablo2::UNIT_STAT_gembag_Stones_Azurite; + } + else if (m_selected_gem == "sulpher") { + gemCode = 'ad0 '; + gemPropRowID = 355; + stat = diablo2::UNIT_STAT_gembag_Stones_Sulpher; + } + else if (m_selected_gem == "quartz") { + gemCode = 'ael '; + gemPropRowID = 356; + stat = diablo2::UNIT_STAT_gembag_Stones_Quartz; + } + else if (m_selected_gem == "tiger_eye") { + gemCode = 'ae4 '; + gemPropRowID = 357; + stat = diablo2::UNIT_STAT_gembag_Stones_TigerEye; + } + + + + loot_filter_settings::get().m_show_rough = value; + auto player = diablo2::d2_client::get_local_player(); + auto inventory = player->inventory; + diablo2::structures::unit* bag; + uint32_t bagGuid = -1; + uint32_t statValue = 0; + + for (auto item = inventory->first_item; item != nullptr; item = item->item_data->pt_next_item) { + const auto record = diablo2::d2_common::get_item_record(item->data_record_index); + auto recordType = diablo2::d2_common::get_item_type_record(record->type); + char* normCode1 = record->string_code; + if (strncmp(normCode1, "ib1", 3) == 0) { + bag = item; + bagGuid = item->guid; + statValue = diablo2::d2_common::get_stat(item, stat, NULL); + } + } + if (statValue >= 65536) { + auto current_time = std::chrono::steady_clock::now(); + auto elapsed_time = std::chrono::duration_cast(current_time - m_last_packet_sent); + + if (elapsed_time.count() >= 500) { + static d2_tweaks::common::item_move_cs packet; + packet.item_guid = bagGuid; + packet.bag_guid = bagGuid; + packet.target_page = 0; + packet.extract = 1; + packet.iCode = gemCode; + packet.prop = gemPropRowID - 3; + packet.val = -65536; + + diablo2::d2_client::send_to_server(&packet, sizeof packet); + m_last_packet_sent = current_time; + } + + D2PropertyStrc itemProperty = {}; + itemProperty.nProperty = gemPropRowID - 3; // Adjust the property ID + itemProperty.nLayer = 0; + itemProperty.nMin = -65536; + itemProperty.nMax = -65536; + diablo2::d2_common::add_property(bag, &itemProperty, 0); + } +} + + + +void d2_tweaks::client::modules::loot_filter_settings_menu::extract_legendary(bool value) { + + uint32_t gemCode = 0; + int gemPropRowID = 0; + diablo2::unit_stats_t stat; + + if (m_selected_gem == "flourite") { + gemCode = 'abt '; + gemPropRowID = 351; + stat = diablo2::UNIT_STAT_gembag_Stones_Flourite; + } + else if (m_selected_gem == "jade") { + gemCode = 'ace '; + gemPropRowID = 352; + stat = diablo2::UNIT_STAT_gembag_Stones_Jade; + } + else if (m_selected_gem == "argonite") { + gemCode = 'acx '; + gemPropRowID = 353; + stat = diablo2::UNIT_STAT_gembag_Stones_Argonite; + } + else if (m_selected_gem == "azurite") { + gemCode = 'adi '; + gemPropRowID = 354; + stat = diablo2::UNIT_STAT_gembag_Stones_Azurite; + } + else if (m_selected_gem == "sulpher") { + gemCode = 'ad1 '; + gemPropRowID = 355; + stat = diablo2::UNIT_STAT_gembag_Stones_Sulpher; + } + else if (m_selected_gem == "quartz") { + gemCode = 'aem '; + gemPropRowID = 356; + stat = diablo2::UNIT_STAT_gembag_Stones_Quartz; + } + else if (m_selected_gem == "tiger_eye") { + gemCode = 'ae5 '; + gemPropRowID = 357; + stat = diablo2::UNIT_STAT_gembag_Stones_TigerEye; + } + + + + loot_filter_settings::get().m_show_rough = value; + auto player = diablo2::d2_client::get_local_player(); + auto inventory = player->inventory; + diablo2::structures::unit* bag; + uint32_t bagGuid = -1; + uint32_t statValue = 0; + + for (auto item = inventory->first_item; item != nullptr; item = item->item_data->pt_next_item) { + const auto record = diablo2::d2_common::get_item_record(item->data_record_index); + auto recordType = diablo2::d2_common::get_item_type_record(record->type); + char* normCode1 = record->string_code; + if (strncmp(normCode1, "ib1", 3) == 0) { + bag = item; + bagGuid = item->guid; + statValue = diablo2::d2_common::get_stat(item, stat, NULL); + } + } + if (statValue >= 131072) { + auto current_time = std::chrono::steady_clock::now(); + auto elapsed_time = std::chrono::duration_cast(current_time - m_last_packet_sent); + + if (elapsed_time.count() >= 500) { + static d2_tweaks::common::item_move_cs packet; + packet.item_guid = bagGuid; + packet.bag_guid = bagGuid; + packet.target_page = 0; + packet.extract = 1; + packet.iCode = gemCode; + packet.prop = gemPropRowID - 3; + packet.val = -131072; + + diablo2::d2_client::send_to_server(&packet, sizeof packet); + m_last_packet_sent = current_time; + } + + D2PropertyStrc itemProperty = {}; + itemProperty.nProperty = gemPropRowID - 3; // Adjust the property ID + itemProperty.nLayer = 0; + itemProperty.nMin = -131072; + itemProperty.nMax = -131072; + diablo2::d2_common::add_property(bag, &itemProperty, 0); + } +} + + + +void d2_tweaks::client::modules::loot_filter_settings_menu::extract_legendary_cut(bool value) { + + uint32_t gemCode = 0; + int gemPropRowID = 0; + diablo2::unit_stats_t stat; + + if (m_selected_gem == "flourite") { + gemCode = 'abu '; + gemPropRowID = 351; + stat = diablo2::UNIT_STAT_gembag_Stones_Flourite; + } + else if (m_selected_gem == "jade") { + gemCode = 'acf '; + gemPropRowID = 352; + stat = diablo2::UNIT_STAT_gembag_Stones_Jade; + } + else if (m_selected_gem == "argonite") { + gemCode = 'acy '; + gemPropRowID = 353; + stat = diablo2::UNIT_STAT_gembag_Stones_Argonite; + } + else if (m_selected_gem == "azurite") { + gemCode = 'adj '; + gemPropRowID = 354; + stat = diablo2::UNIT_STAT_gembag_Stones_Azurite; + } + else if (m_selected_gem == "sulpher") { + gemCode = 'ad2 '; + gemPropRowID = 355; + stat = diablo2::UNIT_STAT_gembag_Stones_Sulpher; + } + else if (m_selected_gem == "quartz") { + gemCode = 'aen '; + gemPropRowID = 356; + stat = diablo2::UNIT_STAT_gembag_Stones_Quartz; + } + else if (m_selected_gem == "tiger_eye") { + gemCode = 'ae6 '; + gemPropRowID = 357; + stat = diablo2::UNIT_STAT_gembag_Stones_TigerEye; + } + + + + loot_filter_settings::get().m_show_rough = value; + auto player = diablo2::d2_client::get_local_player(); + auto inventory = player->inventory; + diablo2::structures::unit* bag; + uint32_t bagGuid = -1; + uint32_t statValue = 0; + + for (auto item = inventory->first_item; item != nullptr; item = item->item_data->pt_next_item) { + const auto record = diablo2::d2_common::get_item_record(item->data_record_index); + auto recordType = diablo2::d2_common::get_item_type_record(record->type); + char* normCode1 = record->string_code; + if (strncmp(normCode1, "ib1", 3) == 0) { + bag = item; + bagGuid = item->guid; + statValue = diablo2::d2_common::get_stat(item, stat, NULL); + } + } + if (statValue >= 262144) { + auto current_time = std::chrono::steady_clock::now(); + auto elapsed_time = std::chrono::duration_cast(current_time - m_last_packet_sent); + + if (elapsed_time.count() >= 500) { + static d2_tweaks::common::item_move_cs packet; + packet.item_guid = bagGuid; + packet.bag_guid = bagGuid; + packet.target_page = 0; + packet.extract = 1; + packet.iCode = gemCode; + packet.prop = gemPropRowID - 3; + packet.val = -262144; + + diablo2::d2_client::send_to_server(&packet, sizeof packet); + m_last_packet_sent = current_time; + } + + D2PropertyStrc itemProperty = {}; + itemProperty.nProperty = gemPropRowID - 3; // Adjust the property ID + itemProperty.nLayer = 0; + itemProperty.nMin = -262144; + itemProperty.nMax = -262144; + diablo2::d2_common::add_property(bag, &itemProperty, 0); + } +} + + + +// qualities extraction functions + +void d2_tweaks::client::modules::loot_filter_settings_menu::extract_chipped(bool value) { + uint32_t gemCode = 0; + int gemPropRowID = 0; + diablo2::unit_stats_t stat; + + if (m_selected_gem == "amethyst") { + gemCode = 'gcv '; + gemPropRowID = 382; + stat = diablo2::UNIT_STAT_gembag_Amethyst; + } + else if (m_selected_gem == "ruby") { + gemCode = 'gcr '; + gemPropRowID = 381; + stat = diablo2::UNIT_STAT_gembag_Ruby; + } + else if (m_selected_gem == "sapphire") { + gemCode = 'gcb '; + gemPropRowID = 385; + stat = diablo2::UNIT_STAT_gembag_Sapphire; + } + else if (m_selected_gem == "emerald") { + gemCode = 'gcg '; + gemPropRowID = 384; + stat = diablo2::UNIT_STAT_gembag_Emerald; + } + else if (m_selected_gem == "diamond") { + gemCode = 'gcw '; + gemPropRowID = 383; + stat = diablo2::UNIT_STAT_gembag_Diamond; + } + else if (m_selected_gem == "topaz") { + gemCode = 'gcy '; + gemPropRowID = 386; + stat = diablo2::UNIT_STAT_gembag_Topaz; + } + else if (m_selected_gem == "skull") { + gemCode = 'skc '; + gemPropRowID = 387; + stat = diablo2::UNIT_STAT_gembag_Skull; + } + + loot_filter_settings::get().m_show_chipped = value; + auto player = diablo2::d2_client::get_local_player(); + auto inventory = player->inventory; + diablo2::structures::unit* bag; + uint32_t bagGuid = -1; + uint32_t statValue = 0; + + for (auto item = inventory->first_item; item != nullptr; item = item->item_data->pt_next_item) { + const auto record = diablo2::d2_common::get_item_record(item->data_record_index); + auto recordType = diablo2::d2_common::get_item_type_record(record->type); + char* normCode1 = record->string_code; + if (strncmp(normCode1, "ib1", 3) == 0) { + bag = item; + bagGuid = item->guid; + statValue = diablo2::d2_common::get_stat(item, stat, NULL); + } + } + if (statValue >= 1) { + auto current_time = std::chrono::steady_clock::now(); + auto elapsed_time = std::chrono::duration_cast(current_time - m_last_packet_sent); + + if (elapsed_time.count() >= 500) { + static d2_tweaks::common::item_move_cs packet; + packet.item_guid = bagGuid; + packet.bag_guid = bagGuid; + packet.target_page = 0; + packet.extract = 1; + packet.iCode = gemCode; + packet.prop = gemPropRowID - 3; + packet.val = -1; + + diablo2::d2_client::send_to_server(&packet, sizeof packet); + m_last_packet_sent = current_time; + } + + D2PropertyStrc itemProperty = {}; + itemProperty.nProperty = gemPropRowID - 3; // Adjust the property ID + itemProperty.nLayer = 0; + itemProperty.nMin = -1; + itemProperty.nMax = -1; + diablo2::d2_common::add_property(bag, &itemProperty, 0); + } } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_flawed(bool value) { - uint32_t gemCode; - int gemPropRowID; - diablo2::unit_stats_t stat; + uint32_t gemCode; + int gemPropRowID; + diablo2::unit_stats_t stat; - if (m_selected_gem == "amethyst") { - gemCode = 'gfv '; - gemPropRowID = 382; - stat = diablo2::UNIT_STAT_gembag_Amethyst; + if (m_selected_gem == "amethyst") { + gemCode = 'gfv '; + gemPropRowID = 382; + stat = diablo2::UNIT_STAT_gembag_Amethyst; + } + else if (m_selected_gem == "ruby") { + gemCode = 'gfr '; + gemPropRowID = 381; + stat = diablo2::UNIT_STAT_gembag_Ruby; + } + else if (m_selected_gem == "sapphire") { + gemCode = 'gfb '; + gemPropRowID = 385; + stat = diablo2::UNIT_STAT_gembag_Sapphire; + } + else if (m_selected_gem == "emerald") { + gemCode = 'gfg '; + gemPropRowID = 384; + stat = diablo2::UNIT_STAT_gembag_Emerald; + } + else if (m_selected_gem == "diamond") { + gemCode = 'gfw '; + gemPropRowID = 383; + stat = diablo2::UNIT_STAT_gembag_Diamond; + } + else if (m_selected_gem == "topaz") { + gemCode = 'gfy '; + gemPropRowID = 386; + stat = diablo2::UNIT_STAT_gembag_Topaz; + } + else if (m_selected_gem == "skull") { + gemCode = 'skf '; + gemPropRowID = 387; + stat = diablo2::UNIT_STAT_gembag_Skull; + } - } - else if (m_selected_gem == "ruby") { - gemCode = 'gfr '; - gemPropRowID = 381; - stat = diablo2::UNIT_STAT_gembag_Ruby; - } - else if (m_selected_gem == "sapphire") { - gemCode = 'gfb '; - gemPropRowID = 385; - stat = diablo2::UNIT_STAT_gembag_Sapphire; - } - else if (m_selected_gem == "emerald") { - gemCode = 'gfg '; - gemPropRowID = 384; - stat = diablo2::UNIT_STAT_gembag_Emerald; - } - else if (m_selected_gem == "diamond") { - gemCode = 'gfw '; - gemPropRowID = 383; - stat = diablo2::UNIT_STAT_gembag_Diamond; - } - else if (m_selected_gem == "topaz") { - gemCode = 'gfy '; - gemPropRowID = 386; - stat = diablo2::UNIT_STAT_gembag_Topaz; - } - else if (m_selected_gem == "skull") { - gemCode = 'skf '; - gemPropRowID = 387; - stat = diablo2::UNIT_STAT_gembag_Skull; - } - - loot_filter_settings::get().m_show_flawed = value; + loot_filter_settings::get().m_show_flawed = value; auto player = diablo2::d2_client::get_local_player(); auto inventory = player->inventory; diablo2::structures::unit* bag; @@ -795,52 +2721,50 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_flawed(bool itemProperty.nMax = -3; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_normal(bool value) { - uint32_t gemCode; - int gemPropRowID; - diablo2::unit_stats_t stat; + uint32_t gemCode; + int gemPropRowID; + diablo2::unit_stats_t stat; - if (m_selected_gem == "amethyst") { - gemCode = 'gsv '; - gemPropRowID = 382; - stat = diablo2::UNIT_STAT_gembag_Amethyst; + if (m_selected_gem == "amethyst") { + gemCode = 'gsv '; + gemPropRowID = 382; + stat = diablo2::UNIT_STAT_gembag_Amethyst; + } + else if (m_selected_gem == "ruby") { + gemCode = 'gsr '; + gemPropRowID = 381; + stat = diablo2::UNIT_STAT_gembag_Ruby; + } + else if (m_selected_gem == "sapphire") { + gemCode = 'gsb '; + gemPropRowID = 385; + stat = diablo2::UNIT_STAT_gembag_Sapphire; + } + else if (m_selected_gem == "emerald") { + gemCode = 'gsg '; + gemPropRowID = 384; + stat = diablo2::UNIT_STAT_gembag_Emerald; + } + else if (m_selected_gem == "diamond") { + gemCode = 'gsw '; + gemPropRowID = 383; + stat = diablo2::UNIT_STAT_gembag_Diamond; + } + else if (m_selected_gem == "topaz") { + gemCode = 'gsy '; + gemPropRowID = 386; + stat = diablo2::UNIT_STAT_gembag_Topaz; + } + else if (m_selected_gem == "skull") { + gemCode = 'sku '; + gemPropRowID = 387; + stat = diablo2::UNIT_STAT_gembag_Skull; + } - } - else if (m_selected_gem == "ruby") { - gemCode = 'gsr '; - gemPropRowID = 381; - stat = diablo2::UNIT_STAT_gembag_Ruby; - } - else if (m_selected_gem == "sapphire") { - gemCode = 'gsb '; - gemPropRowID = 385; - stat = diablo2::UNIT_STAT_gembag_Sapphire; - } - else if (m_selected_gem == "emerald") { - gemCode = 'gsg '; - gemPropRowID = 384; - stat = diablo2::UNIT_STAT_gembag_Emerald; - } - else if (m_selected_gem == "diamond") { - gemCode = 'gsw '; - gemPropRowID = 383; - stat = diablo2::UNIT_STAT_gembag_Diamond; - } - else if (m_selected_gem == "topaz") { - gemCode = 'gsy '; - gemPropRowID = 386; - stat = diablo2::UNIT_STAT_gembag_Topaz; - } - else if (m_selected_gem == "skull") { - gemCode = 'sku '; - gemPropRowID = 387; - stat = diablo2::UNIT_STAT_gembag_Skull; - } - - loot_filter_settings::get().m_show_normal = value; + loot_filter_settings::get().m_show_normal = value; auto player = diablo2::d2_client::get_local_player(); auto inventory = player->inventory; diablo2::structures::unit* bag; @@ -878,48 +2802,47 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_normal(bool } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_flawless(bool value) { - uint32_t gemCode; - int gemPropRowID; - diablo2::unit_stats_t stat; + uint32_t gemCode; + int gemPropRowID; + diablo2::unit_stats_t stat; - if (m_selected_gem == "amethyst") { - gemCode = 'gzv '; - gemPropRowID = 382; - stat = diablo2::UNIT_STAT_gembag_Amethyst; + if (m_selected_gem == "amethyst") { + gemCode = 'gzv '; + gemPropRowID = 382; + stat = diablo2::UNIT_STAT_gembag_Amethyst; + } + else if (m_selected_gem == "ruby") { + gemCode = 'glr '; + gemPropRowID = 381; + stat = diablo2::UNIT_STAT_gembag_Ruby; + } + else if (m_selected_gem == "sapphire") { + gemCode = 'glb '; + gemPropRowID = 385; + stat = diablo2::UNIT_STAT_gembag_Sapphire; + } + else if (m_selected_gem == "emerald") { + gemCode = 'glg '; + gemPropRowID = 384; + stat = diablo2::UNIT_STAT_gembag_Emerald; + } + else if (m_selected_gem == "diamond") { + gemCode = 'glw '; + gemPropRowID = 383; + stat = diablo2::UNIT_STAT_gembag_Diamond; + } + else if (m_selected_gem == "topaz") { + gemCode = 'gly '; + gemPropRowID = 386; + stat = diablo2::UNIT_STAT_gembag_Topaz; + } + else if (m_selected_gem == "skull") { + gemCode = 'skl '; + gemPropRowID = 387; + stat = diablo2::UNIT_STAT_gembag_Skull; + } - } - else if (m_selected_gem == "ruby") { - gemCode = 'glr '; - gemPropRowID = 381; - stat = diablo2::UNIT_STAT_gembag_Ruby; - } - else if (m_selected_gem == "sapphire") { - gemCode = 'glb '; - gemPropRowID = 385; - stat = diablo2::UNIT_STAT_gembag_Sapphire; - } - else if (m_selected_gem == "emerald") { - gemCode = 'glg '; - gemPropRowID = 384; - stat = diablo2::UNIT_STAT_gembag_Emerald; - } - else if (m_selected_gem == "diamond") { - gemCode = 'glw '; - gemPropRowID = 383; - stat = diablo2::UNIT_STAT_gembag_Diamond; - } - else if (m_selected_gem == "topaz") { - gemCode = 'gly '; - gemPropRowID = 386; - stat = diablo2::UNIT_STAT_gembag_Topaz; - } - else if (m_selected_gem == "skull") { - gemCode = 'skl '; - gemPropRowID = 387; - stat = diablo2::UNIT_STAT_gembag_Skull; - } - - loot_filter_settings::get().m_show_flawless = value; + loot_filter_settings::get().m_show_flawless = value; auto player = diablo2::d2_client::get_local_player(); auto inventory = player->inventory; diablo2::structures::unit* bag; @@ -957,48 +2880,47 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_flawless(boo } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_perfect(bool value) { - uint32_t gemCode; - int gemPropRowID; - diablo2::unit_stats_t stat; + uint32_t gemCode; + int gemPropRowID; + diablo2::unit_stats_t stat; - if (m_selected_gem == "amethyst") { - gemCode = 'gpv '; - gemPropRowID = 382; - stat = diablo2::UNIT_STAT_gembag_Amethyst; + if (m_selected_gem == "amethyst") { + gemCode = 'gpv '; + gemPropRowID = 382; + stat = diablo2::UNIT_STAT_gembag_Amethyst; + } + else if (m_selected_gem == "ruby") { + gemCode = 'gpr '; + gemPropRowID = 381; + stat = diablo2::UNIT_STAT_gembag_Ruby; + } + else if (m_selected_gem == "sapphire") { + gemCode = 'gpb '; + gemPropRowID = 385; + stat = diablo2::UNIT_STAT_gembag_Sapphire; + } + else if (m_selected_gem == "emerald") { + gemCode = 'gpg '; + gemPropRowID = 384; + stat = diablo2::UNIT_STAT_gembag_Emerald; + } + else if (m_selected_gem == "diamond") { + gemCode = 'gpw '; + gemPropRowID = 383; + stat = diablo2::UNIT_STAT_gembag_Diamond; + } + else if (m_selected_gem == "topaz") { + gemCode = 'gpy '; + gemPropRowID = 386; + stat = diablo2::UNIT_STAT_gembag_Topaz; + } + else if (m_selected_gem == "skull") { + gemCode = 'skz '; + gemPropRowID = 387; + stat = diablo2::UNIT_STAT_gembag_Skull; + } - } - else if (m_selected_gem == "ruby") { - gemCode = 'gpr '; - gemPropRowID = 381; - stat = diablo2::UNIT_STAT_gembag_Ruby; - } - else if (m_selected_gem == "sapphire") { - gemCode = 'gpb '; - gemPropRowID = 385; - stat = diablo2::UNIT_STAT_gembag_Sapphire; - } - else if (m_selected_gem == "emerald") { - gemCode = 'gpg '; - gemPropRowID = 384; - stat = diablo2::UNIT_STAT_gembag_Emerald; - } - else if (m_selected_gem == "diamond") { - gemCode = 'gpw '; - gemPropRowID = 383; - stat = diablo2::UNIT_STAT_gembag_Diamond; - } - else if (m_selected_gem == "topaz") { - gemCode = 'gpy '; - gemPropRowID = 386; - stat = diablo2::UNIT_STAT_gembag_Topaz; - } - else if (m_selected_gem == "skull") { - gemCode = 'skz '; - gemPropRowID = 387; - stat = diablo2::UNIT_STAT_gembag_Skull; - } - - loot_filter_settings::get().m_show_perfect = value; + loot_filter_settings::get().m_show_perfect = value; auto player = diablo2::d2_client::get_local_player(); auto inventory = player->inventory; diablo2::structures::unit* bag; @@ -1053,7 +2975,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r01(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesA, NULL); } } - if (statValue > 1) { + if (statValue >= 1) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1071,7 +2993,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r01(bool val itemProperty.nMax = -1; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r02(bool value) { @@ -1092,7 +3013,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r02(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesA, NULL); } } - if (statValue > 3) { + if (statValue >= 3) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1110,7 +3031,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r02(bool val itemProperty.nMax = -3; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r03(bool value) { @@ -1131,7 +3051,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r03(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesA, NULL); } } - if (statValue > 9) { + if (statValue >= 9) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1149,7 +3069,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r03(bool val itemProperty.nMax = -9; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r04(bool value) { @@ -1170,7 +3089,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r04(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesA, NULL); } } - if (statValue > 27) { + if (statValue >= 27) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1188,7 +3107,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r04(bool val itemProperty.nMax = -27; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r05(bool value) { @@ -1209,7 +3127,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r05(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesA, NULL); } } - if (statValue > 81) { + if (statValue >= 81) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1227,7 +3145,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r05(bool val itemProperty.nMax = -81; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r06(bool value) { @@ -1248,7 +3165,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r06(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesA, NULL); } } - if (statValue > 243) { + if (statValue >= 243) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1266,7 +3183,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r06(bool val itemProperty.nMax = -243; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r07(bool value) { @@ -1287,7 +3203,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r07(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesB, NULL); } } - if (statValue > 1) { + if (statValue >= 1) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1305,7 +3221,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r07(bool val itemProperty.nMax = -1; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r08(bool value) { @@ -1326,7 +3241,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r08(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesB, NULL); } } - if (statValue > 3) { + if (statValue >= 3) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1344,7 +3259,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r08(bool val itemProperty.nMax = -3; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r09(bool value) { @@ -1365,7 +3279,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r09(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesB, NULL); } } - if (statValue > 9) { + if (statValue >= 9) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1383,7 +3297,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r09(bool val itemProperty.nMax = -9; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r10(bool value) { @@ -1404,7 +3317,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r10(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesB, NULL); } } - if (statValue > 27) { + if (statValue >= 27) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1422,7 +3335,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r10(bool val itemProperty.nMax = -27; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r11(bool value) { @@ -1443,7 +3355,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r11(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesB, NULL); } } - if (statValue > 81) { + if (statValue >= 81) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1461,7 +3373,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r11(bool val itemProperty.nMax = -81; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r12(bool value) { @@ -1482,7 +3393,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r12(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesB, NULL); } } - if (statValue > 243) { + if (statValue >= 243) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1500,7 +3411,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r12(bool val itemProperty.nMax = -243; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r13(bool value) { @@ -1521,7 +3431,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r13(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesC, NULL); } } - if (statValue > 1) { + if (statValue >= 1) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1539,7 +3449,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r13(bool val itemProperty.nMax = -1; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r14(bool value) { @@ -1560,7 +3469,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r14(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesC, NULL); } } - if (statValue > 3) { + if (statValue >= 3) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1578,7 +3487,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r14(bool val itemProperty.nMax = -3; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r15(bool value) { @@ -1599,7 +3507,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r15(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesC, NULL); } } - if (statValue > 9) { + if (statValue >= 9) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1617,7 +3525,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r15(bool val itemProperty.nMax = -9; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r16(bool value) { @@ -1638,7 +3545,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r16(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesC, NULL); } } - if (statValue > 27) { + if (statValue >= 27) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1656,7 +3563,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r16(bool val itemProperty.nMax = -27; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r17(bool value) { @@ -1677,7 +3583,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r17(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesC, NULL); } } - if (statValue > 81) { + if (statValue >= 81) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1695,7 +3601,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r17(bool val itemProperty.nMax = -81; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r18(bool value) { @@ -1716,7 +3621,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r18(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesC, NULL); } } - if (statValue > 243) { + if (statValue >= 243) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1734,7 +3639,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r18(bool val itemProperty.nMax = -243; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r19(bool value) { @@ -1755,7 +3659,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r19(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesD, NULL); } } - if (statValue > 1) { + if (statValue >= 1) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1773,7 +3677,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r19(bool val itemProperty.nMax = -1; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r20(bool value) { @@ -1794,7 +3697,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r20(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesD, NULL); } } - if (statValue > 3) { + if (statValue >= 3) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1812,7 +3715,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r20(bool val itemProperty.nMax = -3; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r21(bool value) { @@ -1833,7 +3735,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r21(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesD, NULL); } } - if (statValue > 9) { + if (statValue >= 9) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1851,7 +3753,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r21(bool val itemProperty.nMax = -9; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r22(bool value) { @@ -1872,7 +3773,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r22(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesD, NULL); } } - if (statValue > 27) { + if (statValue >= 27) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1890,7 +3791,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r22(bool val itemProperty.nMax = -27; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r23(bool value) { @@ -1911,7 +3811,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r23(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesD, NULL); } } - if (statValue > 81) { + if (statValue >= 81) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1929,7 +3829,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r23(bool val itemProperty.nMax = -81; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r24(bool value) { @@ -1950,7 +3849,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r24(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesD, NULL); } } - if (statValue > 243) { + if (statValue >= 243) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -1968,7 +3867,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r24(bool val itemProperty.nMax = -243; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r25(bool value) { @@ -1989,7 +3887,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r25(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesE, NULL); } } - if (statValue > 1) { + if (statValue >= 1) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -2007,7 +3905,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r25(bool val itemProperty.nMax = -1; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r26(bool value) { @@ -2028,7 +3925,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r26(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesE, NULL); } } - if (statValue > 3) { + if (statValue >= 3) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -2046,7 +3943,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r26(bool val itemProperty.nMax = -3; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r27(bool value) { @@ -2067,7 +3963,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r27(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesE, NULL); } } - if (statValue > 9) { + if (statValue >= 9) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -2085,7 +3981,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r27(bool val itemProperty.nMax = -9; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r28(bool value) { @@ -2106,7 +4001,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r28(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesE, NULL); } } - if (statValue > 27) { + if (statValue >= 27) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -2124,7 +4019,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r28(bool val itemProperty.nMax = -27; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r29(bool value) { @@ -2145,7 +4039,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r29(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesE, NULL); } } - if (statValue > 81) { + if (statValue >= 81) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -2163,7 +4057,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r29(bool val itemProperty.nMax = -81; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r30(bool value) { @@ -2184,7 +4077,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r30(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesE, NULL); } } - if (statValue > 243) { + if (statValue >= 243) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -2202,7 +4095,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r30(bool val itemProperty.nMax = -243; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r31(bool value) { @@ -2223,7 +4115,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r31(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesF, NULL); } } - if (statValue > 1) { + if (statValue >= 1) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -2241,7 +4133,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r31(bool val itemProperty.nMax = -1; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r32(bool value) { @@ -2262,7 +4153,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r32(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesF, NULL); } } - if (statValue > 2) { + if (statValue >= 2) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -2280,7 +4171,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r32(bool val itemProperty.nMax = -2; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r33(bool value) { @@ -2301,7 +4191,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r33(bool val statValue = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesF, NULL); } } - if (statValue > 4) { + if (statValue >= 4) { static d2_tweaks::common::item_move_cs packet; packet.item_guid = bagGuid; packet.bag_guid = bagGuid; @@ -2319,263 +4209,255 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r33(bool val itemProperty.nMax = -4; diablo2::d2_common::add_property(bag, &itemProperty, 0); } - } - - - - - // Rune Extraction Functions - - void d2_tweaks::client::modules::loot_filter_settings_menu::update_show_gold(bool value) { - loot_filter_settings::get().show_gold = value; - loot_filter_settings::get().save(diablo2::d2_client::get_local_player_name()); + loot_filter_settings::get().show_gold = value; + loot_filter_settings::get().save(diablo2::d2_client::get_local_player_name()); } void d2_tweaks::client::modules::loot_filter_settings_menu::update_show_runes(bool value) { - loot_filter_settings::get().show_runes = value; - loot_filter_settings::get().save(diablo2::d2_client::get_local_player_name()); + loot_filter_settings::get().show_runes = value; + loot_filter_settings::get().save(diablo2::d2_client::get_local_player_name()); } void d2_tweaks::client::modules::loot_filter_settings_menu::update_show_gems(bool value) { - loot_filter_settings::get().show_gems = value; - loot_filter_settings::get().save(diablo2::d2_client::get_local_player_name()); + loot_filter_settings::get().show_gems = value; + loot_filter_settings::get().save(diablo2::d2_client::get_local_player_name()); } void d2_tweaks::client::modules::loot_filter_settings_menu::update_quality_allowance(bool value, - diablo2::structures::item_quality_t quality) { - loot_filter_settings::get().quality_settings[static_cast(quality)] = value; - loot_filter_settings::get().save(diablo2::d2_client::get_local_player_name()); + diablo2::structures::item_quality_t quality) { + loot_filter_settings::get().quality_settings[static_cast(quality)] = value; + loot_filter_settings::get().save(diablo2::d2_client::get_local_player_name()); } void d2_tweaks::client::modules::loot_filter_settings_menu::register_quality_checkbox(const std::string& name, - diablo2::structures::item_quality_t quality) { - auto control = get_control(name); + diablo2::structures::item_quality_t quality) { + auto control = get_control(name); - if (!control) - return; + if (!control) + return; - control->set_state(loot_filter_settings::get().quality_settings[static_cast(quality)]); - control->set_on_click(std::bind(&loot_filter_settings_menu::update_quality_allowance, - this, std::placeholders::_1, quality)); + control->set_state(loot_filter_settings::get().quality_settings[static_cast(quality)]); + control->set_on_click(std::bind(&loot_filter_settings_menu::update_quality_allowance, + this, std::placeholders::_1, quality)); } void d2_tweaks::client::modules::loot_filter_settings_menu::setup_hooks() { - m_handle_dropped_items_original = - static_cast(hooking::get_call( - diablo2::d2_client::get_base() + 0x1641B)); - m_draw_dropped_items_names_original = - static_cast(hooking::get_call( - diablo2::d2_client::get_base() + 0x81BF5)); + m_handle_dropped_items_original = + static_cast(hooking::get_call( + diablo2::d2_client::get_base() + 0x1641B)); + m_draw_dropped_items_names_original = + static_cast(hooking::get_call( + diablo2::d2_client::get_base() + 0x81BF5)); - hooking::set_call(diablo2::d2_client::get_base() + 0x81BF5, draw_dropped_items_names); - hooking::set_call(diablo2::d2_client::get_base() + 0x1641B, handle_dropped_items); + hooking::set_call(diablo2::d2_client::get_base() + 0x81BF5, draw_dropped_items_names); + hooking::set_call(diablo2::d2_client::get_base() + 0x1641B, handle_dropped_items); - setup_alt_hook(); + setup_alt_hook(); } void d2_tweaks::client::modules::loot_filter_settings_menu::setup_alt_hook() const { - asm_code asmCode; - asmCode.add({ 0x83, 0x7D, 0x00, 0x04 }); //cmp dword ptr [ebp+0], 4 - asmCode.add({ 0x0F, 0x85 }, - new asm_address_relative(2, 6, diablo2::d2_client::get_base() + 0x6A399)); //jnz D2Client.dll+6A399 + asm_code asmCode; + asmCode.add({ 0x83, 0x7D, 0x00, 0x04 }); //cmp dword ptr [ebp+0], 4 + asmCode.add({ 0x0F, 0x85 }, + new asm_address_relative(2, 6, diablo2::d2_client::get_base() + 0x6A399)); //jnz D2Client.dll+6A399 - asmCode.add({ 0x56 }); //push esi - asmCode.add({ 0xB8 }, new asm_address_static(1, check_alt_item)); //mov eax, check_alt_item - asmCode.add({ 0x8B, 0xCD }); //mov ecx, ebp - asmCode.add({ 0xFF, 0xD0 }); //call eax - asmCode.add({ 0x5E }); //pop esi + asmCode.add({ 0x56 }); //push esi + asmCode.add({ 0xB8 }, new asm_address_static(1, check_alt_item)); //mov eax, check_alt_item + asmCode.add({ 0x8B, 0xCD }); //mov ecx, ebp + asmCode.add({ 0xFF, 0xD0 }); //call eax + asmCode.add({ 0x5E }); //pop esi - asmCode.add({ 0x84, 0xC0 }); //test al, al - asmCode.add({ 0x0F, 0x84 }, - new asm_address_relative(2, 6, diablo2::d2_client::get_base() + 0x6A399)); //je D2Client.dll+6A399 - asmCode.add({ 0xE9 }, - new asm_address_relative(1, 5, diablo2::d2_client::get_base() + 0x6A027)); //jmp D2Client.dll+6A027 + asmCode.add({ 0x84, 0xC0 }); //test al, al + asmCode.add({ 0x0F, 0x84 }, + new asm_address_relative(2, 6, diablo2::d2_client::get_base() + 0x6A399)); //je D2Client.dll+6A399 + asmCode.add({ 0xE9 }, + new asm_address_relative(1, 5, diablo2::d2_client::get_base() + 0x6A027)); //jmp D2Client.dll+6A027 - auto addr = diablo2::d2_client::get_base() + 0x6A022; + auto addr = diablo2::d2_client::get_base() + 0x6A022; - DWORD old_protect; - VirtualProtect(addr, 5, PAGE_EXECUTE_READWRITE, &old_protect); + DWORD old_protect; + VirtualProtect(addr, 5, PAGE_EXECUTE_READWRITE, &old_protect); - memset(addr, 0x90, 10); - *reinterpret_cast(addr) = 0xE9; - *reinterpret_cast(static_cast(addr) + 1) = - reinterpret_cast(asmCode.get_code()) - reinterpret_cast(addr) - 5; + memset(addr, 0x90, 10); + *reinterpret_cast(addr) = 0xE9; + *reinterpret_cast(static_cast(addr) + 1) = + reinterpret_cast(asmCode.get_code()) - reinterpret_cast(addr) - 5; - VirtualProtect(addr, 5, old_protect, &old_protect); + VirtualProtect(addr, 5, old_protect, &old_protect); } bool d2_tweaks::client::modules::loot_filter_settings_menu::is_gold(diablo2::structures::unit* item) { - static auto goldRecordIndex = -1; + static auto goldRecordIndex = -1; - if (item == nullptr) - return false; + if (item == nullptr) + return false; - if (item->type != diablo2::structures::unit_type_t::UNIT_TYPE_ITEM) - return false; + if (item->type != diablo2::structures::unit_type_t::UNIT_TYPE_ITEM) + return false; - if (item->item_data == nullptr) - return false; + if (item->item_data == nullptr) + return false; - if (goldRecordIndex == -1) { - auto record = diablo2::d2_common::get_item_record(item->data_record_index); + if (goldRecordIndex == -1) { + auto record = diablo2::d2_common::get_item_record(item->data_record_index); - if (record->string_code[0] == 'g' && - record->string_code[1] == 'l' && - record->string_code[2] == 'd') { //Gold pile - goldRecordIndex = item->data_record_index; - } - } + if (record->string_code[0] == 'g' && + record->string_code[1] == 'l' && + record->string_code[2] == 'd') { //Gold pile + goldRecordIndex = item->data_record_index; + } + } - return item->data_record_index == goldRecordIndex; + return item->data_record_index == goldRecordIndex; } bool d2_tweaks::client::modules::loot_filter_settings_menu::is_rune(diablo2::structures::unit* item) { - static auto runeTypeId = -1; + static auto runeTypeId = -1; - if (item == nullptr) - return false; + if (item == nullptr) + return false; - if (item->type != diablo2::structures::unit_type_t::UNIT_TYPE_ITEM) - return false; + if (item->type != diablo2::structures::unit_type_t::UNIT_TYPE_ITEM) + return false; - if (item->item_data == nullptr) - return false; + if (item->item_data == nullptr) + return false; - const auto record = diablo2::d2_common::get_item_record(item->data_record_index); + const auto record = diablo2::d2_common::get_item_record(item->data_record_index); - if (runeTypeId == -1) { - const auto itemTypeRecord = diablo2::d2_common::get_item_type_record(record->type); + if (runeTypeId == -1) { + const auto itemTypeRecord = diablo2::d2_common::get_item_type_record(record->type); - const auto code = itemTypeRecord->code; + const auto code = itemTypeRecord->code; - if (code[0] == 'r' && - code[1] == 'u' && - code[2] == 'n' && - code[3] == 'e') { - runeTypeId = record->type; - } - } + if (code[0] == 'r' && + code[1] == 'u' && + code[2] == 'n' && + code[3] == 'e') { + runeTypeId = record->type; + } + } - return record->type == runeTypeId; + return record->type == runeTypeId; } bool d2_tweaks::client::modules::loot_filter_settings_menu::is_gem(diablo2::structures::unit* item) { - static auto gemTypeId = -1; + static auto gemTypeId = -1; - if (item == nullptr) - return false; + if (item == nullptr) + return false; - if (item->type != diablo2::structures::unit_type_t::UNIT_TYPE_ITEM) - return false; + if (item->type != diablo2::structures::unit_type_t::UNIT_TYPE_ITEM) + return false; - if (item->item_data == nullptr) - return false; + if (item->item_data == nullptr) + return false; - const auto record = diablo2::d2_common::get_item_record(item->data_record_index); + const auto record = diablo2::d2_common::get_item_record(item->data_record_index); - if (gemTypeId == -1) { - const auto itemTypeRecord = diablo2::d2_common::get_item_type_record(record->type); + if (gemTypeId == -1) { + const auto itemTypeRecord = diablo2::d2_common::get_item_type_record(record->type); - const auto code = itemTypeRecord->code; + const auto code = itemTypeRecord->code; - if (code[0] == 'g' && - code[1] == 'e' && - code[2] == 'm') { - gemTypeId = record->type; - } - } + if (code[0] == 'g' && + code[1] == 'e' && + code[2] == 'm') { + gemTypeId = record->type; + } + } - return record->type == gemTypeId; + return record->type == gemTypeId; } bool d2_tweaks::client::modules::loot_filter_settings_menu::check_alt_item(diablo2::structures::unit* unit) { - static auto& instance = singleton::instance(); + static auto& instance = singleton::instance(); - if (!unit || unit->type != diablo2::structures::unit_type_t::UNIT_TYPE_ITEM) { - return true; - } + if (!unit || unit->type != diablo2::structures::unit_type_t::UNIT_TYPE_ITEM) { + return true; + } - if (unit->item_data == nullptr) { - return true; - } + if (unit->item_data == nullptr) { + return true; + } - if (is_gold(unit)) - return instance.m_show_gold && instance.m_show_gold->get_state(); + if (is_gold(unit)) + return instance.m_show_gold && instance.m_show_gold->get_state(); - if (is_rune(unit)) - return instance.m_show_runes && instance.m_show_runes->get_state(); + if (is_rune(unit)) + return instance.m_show_runes && instance.m_show_runes->get_state(); - if (is_gem(unit)) - return instance.m_show_gems && instance.m_show_gems->get_state(); + if (is_gem(unit)) + return instance.m_show_gems && instance.m_show_gems->get_state(); - return loot_filter_settings::get().quality_settings[static_cast(unit->item_data->quality)]; + return loot_filter_settings::get().quality_settings[static_cast(unit->item_data->quality)]; } void d2_tweaks::client::modules::loot_filter_settings_menu::draw_dropped_items_names(diablo2::structures::unit* unit, - void* edx) { - static auto& instance = singleton::instance(); + void* edx) { + static auto& instance = singleton::instance(); - if (!unit || unit->type != diablo2::structures::unit_type_t::UNIT_TYPE_ITEM) { - instance.m_draw_dropped_items_names_original(unit, edx); - return; - } + if (!unit || unit->type != diablo2::structures::unit_type_t::UNIT_TYPE_ITEM) { + instance.m_draw_dropped_items_names_original(unit, edx); + return; + } - if (unit->item_data == nullptr) { - instance.m_draw_dropped_items_names_original(unit, edx); - return; - } + if (unit->item_data == nullptr) { + instance.m_draw_dropped_items_names_original(unit, edx); + return; + } - if (instance.m_altonly && instance.m_altonly->get_state()) - return; + if (instance.m_altonly && instance.m_altonly->get_state()) + return; - if (is_gold(unit) && instance.m_show_gold && !instance.m_show_gold->get_state()) - return; + if (is_gold(unit) && instance.m_show_gold && !instance.m_show_gold->get_state()) + return; - if (is_rune(unit) && instance.m_show_runes && !instance.m_show_runes->get_state()) - return; + if (is_rune(unit) && instance.m_show_runes && !instance.m_show_runes->get_state()) + return; - if (is_gem(unit) && instance.m_show_gems && !instance.m_show_gems->get_state()) - return; + if (is_gem(unit) && instance.m_show_gems && !instance.m_show_gems->get_state()) + return; - if (!loot_filter_settings::get().quality_settings[static_cast(unit->item_data->quality)]) - return; + if (!loot_filter_settings::get().quality_settings[static_cast(unit->item_data->quality)]) + return; - instance.m_draw_dropped_items_names_original(unit, edx); + instance.m_draw_dropped_items_names_original(unit, edx); } void d2_tweaks::client::modules::loot_filter_settings_menu::handle_dropped_items(diablo2::structures::unit* unit, - void* edx) { - static auto& instance = singleton::instance(); + void* edx) { + static auto& instance = singleton::instance(); - if (!unit || unit->type != diablo2::structures::unit_type_t::UNIT_TYPE_ITEM) { - instance.m_handle_dropped_items_original(unit, edx); - return; - } + if (!unit || unit->type != diablo2::structures::unit_type_t::UNIT_TYPE_ITEM) { + instance.m_handle_dropped_items_original(unit, edx); + return; + } - if (unit->item_data == nullptr) { - instance.m_handle_dropped_items_original(unit, edx); - return; - } + if (unit->item_data == nullptr) { + instance.m_handle_dropped_items_original(unit, edx); + return; + } - if (instance.m_altonly && instance.m_altonly->get_state()) - return; + if (instance.m_altonly && instance.m_altonly->get_state()) + return; - if (is_gold(unit) && instance.m_show_gold && !instance.m_show_gold->get_state()) - return; + if (is_gold(unit) && instance.m_show_gold && !instance.m_show_gold->get_state()) + return; - if (is_rune(unit) && instance.m_show_runes && !instance.m_show_runes->get_state()) - return; + if (is_rune(unit) && instance.m_show_runes && !instance.m_show_runes->get_state()) + return; - if (is_gem(unit) && instance.m_show_gems && !instance.m_show_gems->get_state()) - return; + if (is_gem(unit) && instance.m_show_gems && !instance.m_show_gems->get_state()) + return; - if (!loot_filter_settings::get().quality_settings[static_cast(unit->item_data->quality)]) - return; + if (!loot_filter_settings::get().quality_settings[static_cast(unit->item_data->quality)]) + return; - instance.m_handle_dropped_items_original(unit, edx); + instance.m_handle_dropped_items_original(unit, edx); } \ No newline at end of file diff --git a/src/d2tweaks/server/modules/item_move/item_move_server.cpp b/src/d2tweaks/server/modules/item_move/item_move_server.cpp index 68730fb..5df15aa 100644 --- a/src/d2tweaks/server/modules/item_move/item_move_server.cpp +++ b/src/d2tweaks/server/modules/item_move/item_move_server.cpp @@ -73,6 +73,10 @@ bool d2_tweaks::server::modules::item_move::handle_packet(diablo2::structures::g //MessageBox(NULL, bag_guid.c_str(), "Bag GUID", MB_OK | MB_ICONINFORMATION); + // display itemMove->iCode in a messagebox + std::string iCode = std::to_string(itemMove->iCode); + //MessageBox(NULL, iCode.c_str(), "iCode", MB_OK | MB_ICONINFORMATION); + if (itemMove->extract == 1) { // display bag guid in a messagebox diff --git a/src/d2tweaks/ui/ui_manager.cpp b/src/d2tweaks/ui/ui_manager.cpp index a2ffa02..0723b7e 100644 --- a/src/d2tweaks/ui/ui_manager.cpp +++ b/src/d2tweaks/ui/ui_manager.cpp @@ -151,21 +151,7 @@ const char* ITEMS_armor_and_weapons[] = { "drd", "dre", "drf", "bab", "bac", "bad", "bae", "baf", "pab", "pac", "pad", "pae", "paf", "neb", "neg", "ned", "nee", "nef", "tor", "ooc", "eaq", "ebq", "ib1", "ib3", - // stones - "abc", "abd", "abe", "abf", "abg", "abh", "abi", "abj", "abk", "abl", - "abm", "abn", "abo", "abp", "abq", "abr", "abs", "abt", "abu", "abv", - "abw", "abx", "aby", "abz", "ab0", "ab1", "ab2", "ab3", "ab4", "ab5", - "ab6", "ab7", "ab8", "ab9", "acb", "acd", "ace", "acf", "acg", "ach", - "aci", "acj", "ack", "acl", "acm", "acn", "aco", "acp", "acq", "acr", - "acs", "act", "acu", "acv", "acw", "acx", "acy", "acz", "ac0", "ac1", - "ac2", "ac3", "ac4", "ac5", "ac6", "ac7", "ac8", "ac9", "adb", "adc", - "ade", "adf", "adg", "adh", "adi", "adj", "adk", "adl", "adm", "adn", - "ado", "adp", "adq", "adr", "ads", "adt", "adu", "adv", "adw", "adx", - "ady", "adz", "ad0", "ad1", "ad2", "ad3", "ad4", "ad5", "ad6", "ad7", - "ad8", "ad9", "aeb", "aec", "aed", "aef", "aeg", "aeh", "aei", "aej", - "aek", "ael", "aem", "aen", "aeo", "aep", "aeq", "aer", "aes", "aet", - "aeu", "aev", "aew", "aex", "aey", "aez", "ae0", "ae1", "ae2", "ae3", - "ae4", "ae5", "ae6", + // demon keys/chests "dkr1", "dkr2", "dkr3", "dkr4", "dkr5", "da1", "db1", "dc1" // crafting items @@ -186,6 +172,24 @@ const char* ITEMS_gems_and_runes[] = { }; +const char* ITEMS_Stones[] = { + // stones + "abc", "abd", "abe", "abf", "abg", "abh", "abi", "abj", "abk", "abl", + "abm", "abn", "abo", "abp", "abq", "abr", "abs", "abt", "abu", "abv", + "abw", "abx", "aby", "abz", "ab0", "ab1", "ab2", "ab3", "ab4", "ab5", + "ab6", "ab7", "ab8", "ab9", "acb", "acd", "ace", "acf", "acg", "ach", + "aci", "acj", "ack", "acl", "acm", "acn", "aco", "acp", "acq", "acr", + "acs", "act", "acu", "acv", "acw", "acx", "acy", "acz", "ac0", "ac1", + "ac2", "ac3", "ac4", "ac5", "ac6", "ac7", "ac8", "ac9", "adb", "adc", + "ade", "adf", "adg", "adh", "adi", "adj", "adk", "adl", "adm", "adn", + "ado", "adp", "adq", "adr", "ads", "adt", "adu", "adv", "adw", "adx", + "ady", "adz", "ad0", "ad1", "ad2", "ad3", "ad4", "ad5", "ad6", "ad7", + "ad8", "ad9", "aeb", "aec", "aed", "aef", "aeg", "aeh", "aei", "aej", + "aek", "ael", "aem", "aen", "aeo", "aep", "aeq", "aer", "aes", "aet", + "aeu", "aev", "aew", "aex", "aey", "aez", "ae0", "ae1", "ae2", "ae3", + "ae4", "ae5", "ae6", +}; + // Define a structure named GemType struct GemType { // Comment: The number of chipped gems of this type @@ -195,6 +199,11 @@ struct GemType { int rowID; }; +// Gem/Rune Extractors +static std::unordered_map stoneTypes = { + +}; + // Gems/runes and their corresponding codes and properties.txt line numbers static std::unordered_map gemTypes = { {"gcv", {1, 382}}, // Chipped Amethyst @@ -264,7 +273,141 @@ static std::unordered_map gemTypes = { {"r30", {243, 392}}, // Ber Rune {"r31", {1, 393}}, // Jah Rune {"r32", {2, 393}}, // Cham Rune - {"r33", {4, 393}} // Zod Rune + {"r33", {4, 393}}, // Zod Rune + //stones + {"abc", {1, 351}}, + {"abd", {2, 351}}, + {"abe", {4, 351}}, + {"abf", {8, 351}}, + {"abg", {16, 351}}, + {"abh", {32, 351}}, + {"abi", {64, 351}}, + {"abj", {128, 351}}, + {"abk", {256, 351}}, + {"abl", {512, 351}}, + {"abm", {1024, 351}}, + {"abn", {2048, 351}}, + {"abo", {4096, 351}}, + {"abp", {8192, 351}}, + {"abq", {16384, 351}}, + {"abr", {32768, 351}}, + {"abs", {65536, 351}}, + {"abt", {131072, 351}}, + {"abu", {262144, 351}}, + {"abv", {1, 352}}, + {"abw", {2, 352}}, + {"abx", {4, 352}}, + {"aby", {8, 352}}, + {"abz", {16, 352}}, + {"ab0", {32, 352}}, + {"ab1", {64, 352}}, + {"ab2", {128, 352}}, + {"ab3", {256, 352}}, + {"ab4", {512, 352}}, + {"ab5", {1024, 352}}, + {"ab6", {2048, 352}}, + {"ab7", {4096, 352}}, + {"ab8", {8192, 352}}, + {"ab9", {16384, 352}}, + {"acb", {32768, 352}}, + {"acd", {65536, 352}}, + {"ace", {131072, 352}}, + {"acf", {262144, 352}}, + {"acg", {1, 353}}, + {"ach", {2, 353}}, + {"aci", {4, 353}}, + {"acj", {8, 353}}, + {"ack", {16, 353}}, + {"acl", {32, 353}}, + {"acm", {64, 353}}, + {"acn", {128, 353}}, + {"aco", {256, 353}}, + {"acp", {512, 353}}, + {"acq", {1024, 353}}, + {"acr", {2048, 353}}, + {"acs", {4096, 353}}, + {"act", {8192, 353}}, + {"acu", {16384, 353}}, + {"acv", {32768, 353}}, + {"acw", {65536, 353}}, + {"acx", {131072, 353}}, + {"acy", {262144, 353}}, + {"acz", {1, 354}}, + {"ac0", {2, 354}}, + {"ac1", {4, 354}}, + {"ac2", {8, 354}}, + {"ac3", {16, 354}}, + {"ac4", {32, 354}}, + {"ac5", {64, 354}}, + {"ac6", {128, 354}}, + {"ac7", {256, 354}}, + {"ac8", {512, 354}}, + {"ac9", {1024, 354}}, + {"adb", {2048, 354}}, + {"adc", {4096, 354}}, + {"ade", {8192, 354}}, + {"adf", {16384, 354}}, + {"adg", {32768, 354}}, + {"adh", {65536, 354}}, + {"adi", {131072, 354}}, + {"adj", {262144, 354}}, + {"adk", {1, 355}}, + {"adl", {2, 355}}, + {"adm", {4, 355}}, + {"adn", {8, 355}}, + {"ado", {16, 355}}, + {"adp", {32, 355}}, + {"adq", {64, 355}}, + {"adr", {128, 355}}, + {"ads", {256, 355}}, + {"adt", {512, 355}}, + {"adu", {1024, 355}}, + {"adv", {2048, 355}}, + {"adw", {4096, 355}}, + {"adx", {8192, 355}}, + {"ady", {16384, 355}}, + {"adz", {32768, 355}}, + {"ad0", {65536, 355}}, + {"ad1", {131072, 355}}, + {"ad2", {262144, 355}}, + {"ad3", {1, 356}}, + {"ad4", {2, 356}}, + {"ad5", {4, 356}}, + {"ad6", {8, 356}}, + {"ad7", {16, 356}}, + {"ad8", {32, 356}}, + {"ad9", {64, 356}}, + {"aeb", {128, 356}}, + {"aec", {256, 356}}, + {"aed", {512, 356}}, + {"aef", {1024, 356}}, + {"aeg", {2048, 356}}, + {"aeh", {4096, 356}}, + {"aei", {8192, 356}}, + {"aej", {16384, 356}}, + {"aek", {32768, 356}}, + {"ael", {65536, 356}}, + {"aem", {131072, 356}}, + {"aen", {262144, 356}}, + {"aeo", {1, 357}}, + {"aep", {2, 357}}, + {"aeq", {4, 357}}, + {"aer", {8, 357}}, + {"aes", {16, 357}}, + {"aet", {32, 357}}, + {"aeu", {64, 357}}, + {"aev", {128, 357}}, + {"aew", {256, 357}}, + {"aex", {512, 357}}, + {"aey", {1024, 357}}, + {"aez", {2048, 357}}, + {"ae0", {4096, 357}}, + {"ae1", {8192, 357}}, + {"ae2", {16384, 357}}, + {"ae3", {32768, 357}}, + {"ae4", {65536, 357}}, + {"ae5", {131072, 357}}, + {"ae6", {262144, 357}}, }; // Gem/Rune Extractors @@ -359,6 +502,16 @@ bool isArmorOrWeaponCode(const char* normCode) { return false; } +bool isStoneCode(const char* normCode) { + // Iterate over the gemRuneCodes array and check if normCode matches any of the codes + for (const auto& code : ITEMS_Stones) { + if (strncmp(normCode, code, 3) == 0) { + return true; + } + } + return false; +} + LRESULT d2_tweaks::ui::ui_manager::wnd_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { static auto& instance = singleton::instance();