Initial commit

This commit is contained in:
Hash Borgir
2024-04-16 21:45:38 -06:00
commit 3159020c38
533 changed files with 135446 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
#pragma once
#include <d2tweaks/client/modules/client_module.h>
namespace d2_tweaks {
namespace ui {
namespace controls {
class label;
}
}
namespace client {
namespace modules {
class auto_gold_pickup final : public client_module {
public:
void init() override;
void init_early() override;
void handle_packet(common::packet_header* packet) override;
void tick() override;
};
}
}
}

View File

@@ -0,0 +1,17 @@
#pragma once
#include <d2tweaks/client/modules/client_module.h>
namespace d2_tweaks {
namespace client {
namespace modules {
class auto_item_pickup final : public client_module {
public:
void init() override;
void init_early() override;
void handle_packet(common::packet_header* packet) override;
void tick() override;
};
}
}
}

View File

@@ -0,0 +1,18 @@
#pragma once
#include <d2tweaks/client/modules/client_module.h>
//Inventory auto sort module client side
namespace d2_tweaks {
namespace client {
namespace modules {
class autosort final : public client_module {
public:
void init() override;
void init_early() override;
void handle_packet(common::packet_header* packet) override;
};
}
}
}

View File

@@ -0,0 +1,28 @@
#pragma once
#include <cstdint>
#define MODULE_INIT(module_name) static d2_tweaks::client::modules::module_name g_instance;
namespace d2_tweaks {
namespace common {
struct packet_header;
}
namespace client {
namespace modules {
class client_module {
public:
virtual ~client_module() = default;
client_module();
virtual void init() = 0;
virtual void init_early() = 0;
virtual void draw_ui();
virtual void tick();
virtual void handle_packet(common::packet_header* packet);
virtual void handle_cs_packet(common::packet_header* packet);
};
}
}
}

View File

@@ -0,0 +1,19 @@
#pragma once
#include <d2tweaks/client/modules/client_module.h>
//Display damage client side
namespace d2_tweaks {
namespace client {
namespace modules {
class damage_display final : public client_module {
public:
void init() override;
void init_early() override;
void handle_packet(common::packet_header* packet) override;
void tick() override;
};
}
}
}

View File

@@ -0,0 +1,18 @@
#pragma once
#include <d2tweaks/client/modules/client_module.h>
namespace d2_tweaks {
namespace client {
namespace modules {
class item_drop_message final : public client_module {
public:
void init() override;
void init_early() override;
void handle_packet(common::packet_header* packet) override;
static void GamePacketReceivedInterceptASM();
static void __fastcall GamePacketReceivedIntercept(uint8_t* packet, size_t size);
};
}
}
}

View File

@@ -0,0 +1,18 @@
#pragma once
#include <d2tweaks/client/modules/client_module.h>
//Item moving between inventory pages (cube, inventory and stash) by ctrl+click client side
namespace d2_tweaks {
namespace client {
namespace modules {
class item_move final : public client_module {
public:
void init() override;
void init_early() override;
void handle_packet(common::packet_header* packet) override;
};
}
}
}

View File

@@ -0,0 +1,15 @@
#pragma once
#include <d2tweaks/client/modules/client_module.h>
namespace d2_tweaks {
namespace client {
namespace modules {
class loot_filter final : public client_module {
public:
void init() override;
void init_early() override;
};
}
}
}

View File

@@ -0,0 +1,37 @@
#pragma once
#include <diablo2/structures/item_data.h>
#include <cstring>
namespace d2_tweaks {
namespace client {
namespace modules {
struct loot_filter_settings {
size_t size; //struct size
bool alt_only;
bool show_gold;
bool show_runes;
bool show_gems;
bool quality_settings[static_cast<size_t>(diablo2::structures::item_quality_t::ITEM_QUALITY_COUNT)];
char reserved[1004];
static loot_filter_settings& get();
static void save(const char* name);
static void load(const char* name);
static void remove(const char* name);
private:
loot_filter_settings() : size(sizeof(loot_filter_settings)),
alt_only(false), show_gold(true), show_runes(true), show_gems(true), reserved{}
{
memset(quality_settings, 0x1, sizeof quality_settings);
}
};
}
}
}

View File

@@ -0,0 +1,67 @@
#pragma once
#include <fw/singleton.h>
#include <d2tweaks/ui/menu.h>
namespace diablo2 {
namespace structures {
struct unit;
enum class item_quality_t : unsigned;
}
}
namespace d2_tweaks {
namespace ui {
namespace controls {
class checkbox;
}
}
namespace client {
namespace modules {
class loot_filter_settings_menu final : public ui::menu, singleton<loot_filter_settings_menu> {
ui::controls::checkbox* m_altonly;
ui::controls::checkbox* m_show_gold;
ui::controls::checkbox* m_show_runes;
ui::controls::checkbox* m_show_gems;
void(__fastcall* m_draw_dropped_items_names_original)(void*, void*);
void(__fastcall* m_handle_dropped_items_original)(void*, void*);
public:
explicit loot_filter_settings_menu(token);
void reload_settings();
void draw() override;
private:
void register_misc_checkboxes();
void register_quality_checkboxes();
void update_alt_only(bool value);
void update_show_gold(bool value);
void update_show_runes(bool value);
void update_show_gems(bool value);
void update_quality_allowance(bool value, diablo2::structures::item_quality_t quality);
void register_quality_checkbox(const std::string& name, diablo2::structures::item_quality_t quality);
void setup_hooks();
void setup_alt_hook() const;
static bool is_gold(diablo2::structures::unit* item);
static bool is_rune(diablo2::structures::unit* item);
static bool is_gem(diablo2::structures::unit* item);
static bool __fastcall check_alt_item(diablo2::structures::unit* unit);
//draw labels over dropped items
static void __fastcall draw_dropped_items_names(diablo2::structures::unit* unit, void* edx);
//handle hovering over item and actual click
static void __fastcall handle_dropped_items(diablo2::structures::unit* unit, void* edx);
};
}
}
}

View File

@@ -0,0 +1,32 @@
#pragma once
#include <fw/singleton.h>
#include <d2tweaks/ui/menu.h>
namespace d2_tweaks {
namespace ui {
namespace controls {
class button;
}
}
}
namespace d2_tweaks {
namespace client {
namespace modules {
class loot_filter_settings_toggle_menu final : public ui::menu, singleton<loot_filter_settings_toggle_menu> {
ui::controls::button* m_toggle_filter_settings_btn;
menu* m_filter_settings_menu;
bool m_show;
public:
explicit loot_filter_settings_toggle_menu(token);
void toggle_filter_settings_click();
void draw() override;
bool key_event(uint32_t key, bool up) override;
};
}
}
}

View File

@@ -0,0 +1,17 @@
#pragma once
#include <d2tweaks/client/modules/client_module.h>
//Client side patches that are too small to implement as separate modules
namespace d2_tweaks {
namespace client {
namespace modules {
class small_patches final : public client_module {
public:
void init() override;
void init_early() override;
};
}
}
}

View File

@@ -0,0 +1,18 @@
#pragma once
#include <d2tweaks/client/modules/client_module.h>
//Test client side module
namespace d2_tweaks {
namespace client {
namespace modules {
class test final : public client_module {
public:
void init() override;
void init_early() override;
void handle_packet(common::packet_header* packet) override;
};
}
}
}

View File

@@ -0,0 +1,19 @@
#pragma once
#include <cstdint>
#include <d2tweaks/client/modules/client_module.h>
namespace d2_tweaks {
namespace client {
namespace modules {
class trader_update final : public client_module {
public:
void init() override;
void init_early() override;
void handle_packet(common::packet_header* packet) override;
void handle_cs_packet(common::packet_header* packet) override;
void tick() override;
};
}
}
}

View File

@@ -0,0 +1,18 @@
#pragma once
#include <cstdint>
#include <d2tweaks/client/modules/client_module.h>
namespace d2_tweaks {
namespace client {
namespace modules {
class transmute final : public client_module {
public:
void init() override;
void init_early() override;
void handle_packet(common::packet_header* packet) override;
void tick() override;
};
}
}
}