close button working.Need to add misc pots

This commit is contained in:
Hash Borgir 2024-05-19 19:35:35 -06:00
parent 4d21c90f5a
commit 488e2a0c2e
4 changed files with 31 additions and 1 deletions

View File

@ -106,6 +106,8 @@ namespace d2_tweaks {
bool m_show_mp4; bool m_show_mp4;
bool m_show_mp5; bool m_show_mp5;
bool m_show_close;
bool quality_settings[static_cast<size_t>(diablo2::structures::item_quality_t::ITEM_QUALITY_COUNT)]; bool quality_settings[static_cast<size_t>(diablo2::structures::item_quality_t::ITEM_QUALITY_COUNT)];
char reserved[1004]; char reserved[1004];

View File

@ -119,6 +119,7 @@ namespace d2_tweaks {
ui::controls::checkbox* m_show_mp4; ui::controls::checkbox* m_show_mp4;
ui::controls::checkbox* m_show_mp5; ui::controls::checkbox* m_show_mp5;
ui::controls::checkbox* m_close;
void(__fastcall* m_draw_dropped_items_names_original)(void*, void*); void(__fastcall* m_draw_dropped_items_names_original)(void*, void*);
void(__fastcall* m_handle_dropped_items_original)(void*, void*); void(__fastcall* m_handle_dropped_items_original)(void*, void*);
@ -220,6 +221,7 @@ namespace d2_tweaks {
void extract_mp4(bool value); void extract_mp4(bool value);
void extract_mp5(bool value); void extract_mp5(bool value);
void close_window(bool value);
//void extract_flourite(bool value); //void extract_flourite(bool value);

View File

@ -22,11 +22,14 @@ namespace d2_tweaks {
ui::controls::button* m_btn_toggle_stash; ui::controls::button* m_btn_toggle_stash;
ui::controls::button* m_btn_toggle_bag; ui::controls::button* m_btn_toggle_bag;
public:
menu* m_filter_settings_menu; menu* m_filter_settings_menu;
menu* m_menu; menu* m_menu;
bool m_show; bool m_show;
bool m_show_bag; bool m_show_bag;
public:
explicit loot_filter_settings_toggle_menu(token); explicit loot_filter_settings_toggle_menu(token);
void toggle_show() { void toggle_show() {

View File

@ -623,6 +623,14 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::register_misc_checkb
m_show_mp4 = get_control<ui::controls::checkbox>("m_show_mp4"); m_show_mp4 = get_control<ui::controls::checkbox>("m_show_mp4");
m_show_mp5 = get_control<ui::controls::checkbox>("m_show_mp5"); m_show_mp5 = get_control<ui::controls::checkbox>("m_show_mp5");
m_close = get_control<ui::controls::checkbox>("m_close");
if (m_close) {
m_close->set_state(loot_filter_settings::get().m_show_close);
m_close->set_on_click(std::bind(&loot_filter_settings_menu::close_window,
this, std::placeholders::_1));
}
// potions // potions
{ {
@ -1190,6 +1198,21 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_item(bool va
// potions // potions
#include <d2tweaks/client/modules/loot_filter/loot_filter_settings_toggle_menu.h>
void d2_tweaks::client::modules::loot_filter_settings_menu::close_window(bool value) {
auto& toggle_menu = singleton<loot_filter_settings_toggle_menu>::instance();
toggle_menu.m_show = false;
m_stats_enabled = true;
toggle_menu.m_filter_settings_menu->set_enabled(false);
toggle_menu.m_filter_settings_menu->set_visible(false);
}
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_rejuv_potion(bool value) { void d2_tweaks::client::modules::loot_filter_settings_menu::extract_rejuv_potion(bool value) {
loot_filter_settings::get().m_show_rejuv_potion = value; loot_filter_settings::get().m_show_rejuv_potion = value;
extract_item(value, 396, 1, 'rvs ', diablo2::UNIT_STAT_gembag_Potions); extract_item(value, 396, 1, 'rvs ', diablo2::UNIT_STAT_gembag_Potions);