Before gem implementation

This commit is contained in:
Hash Borgir 2024-05-05 23:27:15 -06:00
parent 343fa4253b
commit ee810d5f38
3 changed files with 381 additions and 192 deletions

View File

@ -49,6 +49,20 @@ namespace d2_tweaks {
bool m_show_r32;
bool m_show_r33;
bool m_show_amethyst;
bool m_show_diamond;
bool m_show_emerald;
bool m_show_ruby;
bool m_show_sapphire;
bool m_show_skull;
bool m_show_topaz;
bool m_show_chipped;
bool m_show_flawed;
bool m_show_normal;
bool m_show_flawless;
bool m_show_perfect;
bool quality_settings[static_cast<size_t>(diablo2::structures::item_quality_t::ITEM_QUALITY_COUNT)];

View File

@ -85,6 +85,9 @@ namespace d2_tweaks {
void draw() override;
private:
std::string m_selected_gem;
void gem_checkbox_clicked(const std::string& gem);
void register_misc_checkboxes();
void register_quality_checkboxes();
@ -123,6 +126,20 @@ namespace d2_tweaks {
void extract_r32(bool value);
void extract_r33(bool value);
void extract_amethyst(bool value);
void extract_diamond(bool value);
void extract_emerald(bool value);
void extract_ruby(bool value);
void extract_sapphire(bool value);
void extract_skull(bool value);
void extract_topaz(bool value);
void extract_chipped(bool value);
void extract_flawed(bool value);
void extract_normal(bool value);
void extract_flawless(bool value);
void extract_perfect(bool value);
void update_show_gold(bool value);

View File

@ -186,6 +186,34 @@ static std::unordered_map<std::string, GemType> gemTypes = {
{"r33", {-4, 393}} // Zod Rune
};
void d2_tweaks::client::modules::loot_filter_settings_menu::gem_checkbox_clicked(const std::string& gem) {
// 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;
}
void d2_tweaks::client::modules::loot_filter_settings_menu::register_misc_checkboxes() {
m_altonly = get_control<ui::controls::checkbox>("m_altonly");
@ -243,6 +271,90 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::register_misc_checkb
m_show_perfect = get_control<ui::controls::checkbox>("m_show_perfect");
// gems
{
if (m_show_amethyst) {
m_show_amethyst->set_state(loot_filter_settings::get().m_show_amethyst);
m_show_amethyst->set_on_click(std::bind(&loot_filter_settings_menu::extract_amethyst,
this, std::placeholders::_1));
}
if (m_show_diamond) {
m_show_diamond->set_state(loot_filter_settings::get().m_show_diamond);
m_show_diamond->set_on_click(std::bind(&loot_filter_settings_menu::extract_diamond,
this, std::placeholders::_1));
}
if (m_show_emerald) {
m_show_emerald->set_state(loot_filter_settings::get().m_show_emerald);
m_show_emerald->set_on_click(std::bind(&loot_filter_settings_menu::extract_emerald,
this, std::placeholders::_1));
}
if (m_show_ruby) {
m_show_ruby->set_state(loot_filter_settings::get().m_show_ruby);
m_show_ruby->set_on_click(std::bind(&loot_filter_settings_menu::extract_ruby,
this, std::placeholders::_1));
}
if (m_show_sapphire) {
m_show_sapphire->set_state(loot_filter_settings::get().m_show_sapphire);
m_show_sapphire->set_on_click(std::bind(&loot_filter_settings_menu::extract_sapphire,
this, std::placeholders::_1));
}
if (m_show_skull) {
m_show_skull->set_state(loot_filter_settings::get().m_show_skull);
m_show_skull->set_on_click(std::bind(&loot_filter_settings_menu::extract_skull,
this, std::placeholders::_1));
}
if (m_show_topaz) {
m_show_topaz->set_state(loot_filter_settings::get().m_show_topaz);
m_show_topaz->set_on_click(std::bind(&loot_filter_settings_menu::extract_topaz,
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_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_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_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_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));
}
}
// 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,
@ -441,23 +553,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::register_misc_checkb
this, std::placeholders::_1));
}
}
@ -506,6 +602,68 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::update_alt_only(bool
}
// 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
}
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_emerald(bool value) {
// Implementation goes here
}
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_ruby(bool value) {
// Implementation goes here
}
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_sapphire(bool value) {
// Implementation goes here
}
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_skull(bool value) {
// Implementation goes here
}
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_topaz(bool value) {
// Implementation goes here
}
// qualities extraction functions
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_chipped(bool value) {
if (value) {
// Checkbox is checked
// Perform actions when the checkbox is checked
MessageBoxA(NULL, value ? "Checked" : "Unchecked", "Checkbox value true", MB_OK);
}
else {
// Checkbox is unchecked
// Perform actions when the checkbox is unchecked
MessageBoxA(NULL, value ? "Checked" : "Unchecked", "Checkbox value false", MB_OK);
}
}
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_flawed(bool value) {
// Implementation goes here
}
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_normal(bool value) {
// Implementation goes here
}
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_flawless(bool value) {
// Implementation goes here
}
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_perfect(bool value) {
// Implementation goes here
}
// Rune Extraction Functions
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r01(bool value) {
loot_filter_settings::get().m_show_r01 = value;
auto player = diablo2::d2_client::get_local_player();