Skip to content

Commit

Permalink
Removed ping build hotkey, use /pingbuild command
Browse files Browse the repository at this point in the history
Refactor builds window to use pointers, move stuff to pvt namespace
  • Loading branch information
3vcloud committed Jan 5, 2025
1 parent a36aaad commit de9940f
Show file tree
Hide file tree
Showing 12 changed files with 837 additions and 906 deletions.
Binary file modified Dependencies/GWCA/bin/gwca.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion Dependencies/GWCA/include/GWCA/Managers/MemoryMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace GW {

DWORD GetSkillTimer();

GWCA_API bool GetPersonalDir(std::wstring& out);
GWCA_API bool GetPersonalDir(size_t buf_len, wchar_t* buf);

GWCA_API HWND GetGWWindowHandle();

Expand Down
16 changes: 10 additions & 6 deletions Dependencies/GWCA/include/GWCA/Managers/UIMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ namespace GW {
enum Channel : int;
typedef uint32_t Color;
}

namespace SkillbarMgr {
struct SkillTemplate;
}
namespace UI {
struct TooltipInfo;
typedef GW::Array<unsigned char> ArrayByte;
Expand Down Expand Up @@ -389,7 +391,7 @@ namespace GW {

// GWCA Client to Server commands. Only added the ones that are used for hooks, everything else goes straight into GW

kSendLoadSkillbar = 0x30000000 | 0x3, // wparam = UIPacket::kSendLoadSkillbar*
kSendLoadSkillTemplate = 0x30000000 | 0x3, // wparam = SkillbarMgr::SkillTemplate*
kSendPingWeaponSet = 0x30000000 | 0x4, // wparam = UIPacket::kSendPingWeaponSet*
kSendMoveItem = 0x30000000 | 0x5, // wparam = UIPacket::kSendMoveItem*
kSendMerchantRequestQuote = 0x30000000 | 0x6, // wparam = UIPacket::kSendMerchantRequestQuote*
Expand Down Expand Up @@ -418,7 +420,13 @@ namespace GW {
enum class NumberPreference : uint32_t;
enum class EnumPreference : uint32_t;



namespace UIPacket {
struct kSendLoadSkillTemplate {
uint32_t agent_id;
SkillbarMgr::SkillTemplate* skill_template;
};
struct kVendorWindow {
TransactionType transaction_type;
uint32_t unk;
Expand Down Expand Up @@ -561,10 +569,6 @@ namespace GW {
wchar_t* sender_enc;
};

struct kSendLoadSkillbar {
uint32_t agent_id;
uint32_t* skill_ids;
};
struct kSendPingWeaponSet {
uint32_t agent_id;
uint32_t weapon_item_id;
Expand Down
Binary file modified Dependencies/GWCA/lib/gwca.lib
Binary file not shown.
2 changes: 1 addition & 1 deletion GWToolboxdll/Utils/GuiUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ namespace GuiUtils {

void DrawSkillbar(const char* build_code) {
GW::SkillbarMgr::SkillTemplate skill_template;
if (!GW::SkillbarMgr::DecodeSkillTemplate(skill_template, build_code))
if (!(build_code && *build_code && GW::SkillbarMgr::DecodeSkillTemplate(skill_template, build_code)))
return;

const float text_size = ImGui::CalcTextSize(" ").y;
Expand Down
11 changes: 11 additions & 0 deletions GWToolboxdll/Utils/ToolboxUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <GWCA/Managers/AgentMgr.h>
#include <GWCA/Managers/MapMgr.h>
#include <GWCA/Managers/SkillbarMgr.h>
#include <GWCA/Managers/MemoryMgr.h>

#include <GWCA/Packets/Opcodes.h>
#include <GWCA/Packets/StoC.h>
Expand Down Expand Up @@ -164,6 +165,16 @@ namespace GW {
return nullptr;
}
}

namespace MemoryMgr {
bool GetPersonalDir(std::wstring& out) {
out.resize(512, 0);
if (!GetPersonalDir(out.capacity(), out.data()))
return false;
out.resize(wcslen(out.data()));
return !out.empty();
}
}
}

namespace ToolboxUtils {
Expand Down
3 changes: 3 additions & 0 deletions GWToolboxdll/Utils/ToolboxUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ namespace GW {

AvailableCharacterInfo* GetAvailableCharacter(const wchar_t* name);
}
namespace MemoryMgr {
bool GetPersonalDir(std::wstring& out);
}
}

namespace ToolboxUtils {
Expand Down
Loading

0 comments on commit de9940f

Please sign in to comment.