mirror of
https://gitlab.com/hashborgir/d2tweaks-rnd2k.git
synced 2025-10-13 16:34:22 -05:00
Stats display refactor using ini file done.
This commit is contained in:
@@ -13,25 +13,16 @@
|
||||
struct StatEntry {
|
||||
std::wstring stat_display_string;
|
||||
diablo2::ui_color_t colorStat, colorStatValue;
|
||||
int x1, y1, x2, y2, is_item_stat, item_type_id, stat = 0; // x1,y1 stat_display_string | x2,y2 statValue
|
||||
int x1, y1, x2, y2, is_item_stat, item_type_id, stat, op, param = 0; // x1,y1 stat_display_string | x2,y2 statValue
|
||||
};
|
||||
|
||||
extern std::vector<StatEntry> globalStatsVector; // Declaration of the global variable
|
||||
|
||||
extern diablo2::structures::gfxdata g_gfxdata; // global gfxdata
|
||||
|
||||
extern int randStat;
|
||||
extern int randStatRangeLow;
|
||||
extern int randStatRangeHigh;
|
||||
extern int randStatBool;
|
||||
|
||||
|
||||
extern bool m_stats_enabled;
|
||||
|
||||
extern bool m_help_enabled;
|
||||
|
||||
extern bool m_cube_enabled;
|
||||
|
||||
extern bool m_stash_enabled;
|
||||
|
||||
namespace diablo2 {
|
||||
|
@@ -24,7 +24,7 @@ namespace d2_tweaks {
|
||||
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{}
|
||||
|
@@ -61,7 +61,6 @@ namespace d2_tweaks {
|
||||
//handle hovering over item and actual click
|
||||
static void __fastcall handle_dropped_items(diablo2::structures::unit* unit, void* edx);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -20,6 +20,7 @@ namespace d2_tweaks {
|
||||
ui::controls::button* m_btn_toggle_help;
|
||||
ui::controls::button* m_btn_toggle_cube;
|
||||
ui::controls::button* m_btn_toggle_stash;
|
||||
|
||||
menu* m_filter_settings_menu;
|
||||
bool m_show;
|
||||
public:
|
||||
|
@@ -226,7 +226,6 @@ namespace d2_tweaks {
|
||||
packet_header() : d2_packet_type(0xBB), message_type(0) {}
|
||||
};
|
||||
|
||||
|
||||
struct d2_entity_action_cs : packet_header {
|
||||
uint32_t action;
|
||||
uint32_t entity_id;
|
||||
@@ -274,7 +273,6 @@ namespace d2_tweaks {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct inventory_sort_sc : packet_header {
|
||||
uint8_t page;
|
||||
uint8_t tx;
|
||||
@@ -300,7 +298,6 @@ namespace d2_tweaks {
|
||||
damage_type_t damage_type;
|
||||
uint32_t damage;
|
||||
|
||||
|
||||
uint32_t currentHp; // New field for current hit points
|
||||
uint32_t maxHp; // New field for maximum hit points
|
||||
|
||||
@@ -400,7 +397,7 @@ namespace d2_tweaks {
|
||||
message_type = MESSAGE_TYPE_TRADER_UPDATE;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#pragma pack(pop)
|
||||
}
|
||||
}
|
@@ -24,11 +24,11 @@ namespace d2_tweaks {
|
||||
void init() override;
|
||||
|
||||
bool handle_packet(diablo2::structures::game* game, diablo2::structures::unit* player,
|
||||
common::packet_header* packet) override;
|
||||
common::packet_header* packet) override;
|
||||
private:
|
||||
bool sort(diablo2::structures::game* game, diablo2::structures::unit* player, uint8_t page);
|
||||
bool find_free_space(diablo2::structures::inventory* inv,
|
||||
diablo2::structures::unit* item, int32_t inventoryIndex, char page, uint32_t& x, uint32_t& y, bool isCharmZone);
|
||||
diablo2::structures::unit* item, int32_t inventoryIndex, char page, uint32_t& x, uint32_t& y, bool isCharmZone);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@ namespace d2_tweaks {
|
||||
void init() override;
|
||||
|
||||
bool handle_packet(diablo2::structures::game* game, diablo2::structures::unit* player,
|
||||
common::packet_header* packet) override;
|
||||
common::packet_header* packet) override;
|
||||
void tick(diablo2::structures::game* game, diablo2::structures::unit* unit) override;
|
||||
};
|
||||
}
|
||||
|
@@ -24,10 +24,10 @@ namespace d2_tweaks {
|
||||
void init() override;
|
||||
|
||||
bool handle_packet(diablo2::structures::game* game, diablo2::structures::unit* player,
|
||||
common::packet_header* packet) override;
|
||||
common::packet_header* packet) override;
|
||||
private:
|
||||
bool find_free_space(diablo2::structures::inventory* inv,
|
||||
diablo2::structures::unit* item, int32_t inventoryIndex, char page, uint32_t& x, uint32_t& y);
|
||||
diablo2::structures::unit* item, int32_t inventoryIndex, char page, uint32_t& x, uint32_t& y);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@@ -22,10 +22,10 @@ namespace d2_tweaks {
|
||||
void tick(diablo2::structures::game* game, diablo2::structures::unit* unit) override;
|
||||
bool handle_packet(diablo2::structures::game* game, diablo2::structures::unit* player, common::packet_header* packet) override;
|
||||
|
||||
//private:
|
||||
// bool find_free_space(diablo2::structures::inventory* inv, diablo2::structures::unit* item, int32_t inventoryIndex, char page, uint32_t& x, uint32_t& y);
|
||||
// bool send_to_cube(diablo2::structures::game* game, diablo2::structures::unit* player, diablo2::structures::unit* item);
|
||||
// bool move_item_to(diablo2::structures::game* game, diablo2::structures::unit* player, common::packet_header* packet);
|
||||
//private:
|
||||
// bool find_free_space(diablo2::structures::inventory* inv, diablo2::structures::unit* item, int32_t inventoryIndex, char page, uint32_t& x, uint32_t& y);
|
||||
// bool send_to_cube(diablo2::structures::game* game, diablo2::structures::unit* player, diablo2::structures::unit* item);
|
||||
// bool move_item_to(diablo2::structures::game* game, diablo2::structures::unit* player, common::packet_header* packet);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@@ -47,7 +47,7 @@ namespace d2_tweaks {
|
||||
|
||||
diablo2::structures::unit* get_server_unit(diablo2::structures::game* game, uint32_t guid, diablo2::structures::unit_type_t type);
|
||||
void iterate_server_units(diablo2::structures::game* game, diablo2::structures::unit_type_t type,
|
||||
const std::function<bool(diablo2::structures::unit*)>& cb);
|
||||
const std::function<bool(diablo2::structures::unit*)>& cb);
|
||||
private:
|
||||
static int32_t __fastcall net_tick(diablo2::structures::game* game, diablo2::structures::unit* unit, int32_t a3, int32_t a4);
|
||||
};
|
||||
|
@@ -40,7 +40,7 @@ namespace d2_tweaks {
|
||||
std::vector<respos> m_respos;
|
||||
public:
|
||||
button(menu* menu, const rect& rect, const std::function<void()>& onClick,
|
||||
common::asset* image, int32_t frameDown, int32_t frameUp, int32_t clickSound = -1);
|
||||
common::asset* image, int32_t frameDown, int32_t frameUp, int32_t clickSound = -1);
|
||||
explicit button(menu* menu, const pugi::xml_node& node);
|
||||
virtual ~button();
|
||||
|
||||
|
@@ -35,7 +35,7 @@ namespace d2_tweaks {
|
||||
std::function<void(bool)> m_on_click;
|
||||
public:
|
||||
explicit checkbox(menu* menu, const std::wstring& text, const rect& rect, const std::function<void()>& onClick,
|
||||
common::asset* image, int32_t frameChecked, int32_t frameUnchecked, int32_t clickSound = -1);
|
||||
common::asset* image, int32_t frameChecked, int32_t frameUnchecked, int32_t clickSound = -1);
|
||||
explicit checkbox(menu* menu, const pugi::xml_node& node);
|
||||
|
||||
void set_x(int32_t value) override;
|
||||
|
@@ -115,7 +115,6 @@ namespace d2_tweaks {
|
||||
virtual void middle_mouse(int32_t offsetX, int32_t offsetY, bool up, bool& block) {}
|
||||
virtual void mouse_wheel(int32_t offsetX, int32_t offsetY, bool up, bool& block) {}
|
||||
|
||||
|
||||
virtual void key_event(int32_t offsetX, int32_t offsetY, uint32_t key, bool up, bool& block) = 0;
|
||||
};
|
||||
}
|
||||
|
@@ -9,7 +9,6 @@
|
||||
namespace d2_tweaks {
|
||||
namespace ui {
|
||||
namespace controls {
|
||||
|
||||
class label : public control {
|
||||
std::wstring m_text;
|
||||
bool m_text_owned;
|
||||
@@ -19,8 +18,8 @@ namespace d2_tweaks {
|
||||
std::vector<respos> m_respos;
|
||||
public:
|
||||
explicit label(menu* menu, const std::wstring& text, int32_t x = 0, int32_t y = 0,
|
||||
diablo2::ui_color_t color = diablo2::UI_COLOR_WHITE,
|
||||
diablo2::ui_font_t font = diablo2::UI_FONT_16);
|
||||
diablo2::ui_color_t color = diablo2::UI_COLOR_WHITE,
|
||||
diablo2::ui_font_t font = diablo2::UI_FONT_16);
|
||||
explicit label(menu* menu, const pugi::xml_node& node);
|
||||
|
||||
void set_text(const std::wstring& text) {
|
||||
@@ -31,7 +30,6 @@ namespace d2_tweaks {
|
||||
return m_text;
|
||||
}
|
||||
|
||||
|
||||
diablo2::ui_color_t get_color() const {
|
||||
return m_color;
|
||||
}
|
||||
|
@@ -35,7 +35,6 @@ namespace d2_tweaks {
|
||||
bool process_middle_mouse(bool up);
|
||||
bool process_mouse_wheel(bool up);
|
||||
|
||||
|
||||
bool process_key_event(uint32_t key, bool up);
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user