Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6.17 #1048

Merged
merged 111 commits into from
May 1, 2024
Merged

6.17 #1048

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
1066705
use index instead of bag_id @3vcloud revisit this when you figure out…
DubbleClick Apr 12, 2024
4862ec2
refactoring failed here?
DubbleClick Apr 12, 2024
ebcdf0a
Update settings
AlexMacocian Apr 12, 2024
2d19f62
Setup settings checkbox
AlexMacocian Apr 12, 2024
30a8d43
use index instead of bag_id @3vcloud revisit this when you figure out…
DubbleClick Apr 12, 2024
9383a2a
refactoring failed here?
DubbleClick Apr 12, 2024
8d1dec5
#993 highlight current char in reroll window
DubbleClick Apr 12, 2024
c4fe763
#1005 close button id changed from 3 to 4
DubbleClick Apr 12, 2024
7b45fae
#1002 don't recolour outgoing messages to whisper channel
DubbleClick Apr 12, 2024
5f567de
Update settings
AlexMacocian Apr 12, 2024
0a76830
Setup settings checkbox
AlexMacocian Apr 12, 2024
6345dc6
Rebased
AlexMacocian Apr 12, 2024
002d617
Fixed whisper redirect not working
3vcloud Apr 13, 2024
f9cccb7
Show player minimap drawings instantly without waiting for server rou…
3vcloud Apr 14, 2024
692685b
Added option in minimap settings to hide gw compass drawings in favor…
3vcloud Apr 14, 2024
9264c0a
Don't draw quest marker more than once
3vcloud Apr 14, 2024
4c568f2
Merge branch 'dev' of https://github.com/gwdevhub/GWToolboxpp into dev
3vcloud Apr 14, 2024
d080221
Fix bug preventing theme settings from saving on exit
3vcloud Apr 14, 2024
9406c56
Use table api for pcons
3vcloud Apr 14, 2024
da603ab
Setup price fetching code
AlexMacocian Apr 14, 2024
874dd01
Update settings
AlexMacocian Apr 12, 2024
626a53a
Setup settings checkbox
AlexMacocian Apr 12, 2024
9b93bdc
Update settings
AlexMacocian Apr 12, 2024
ec5ddca
Setup settings checkbox
AlexMacocian Apr 12, 2024
8a28d42
Setup price fetching code
AlexMacocian Apr 14, 2024
2ba44ce
Merge branch 'alexmacocian/price-checker' of https://github.com/AlexM…
AlexMacocian Apr 14, 2024
4807d8b
Price checker for both modifiers and materials
AlexMacocian Apr 14, 2024
7080bcf
Cache prices locally
AlexMacocian Apr 14, 2024
75e92c1
respect hide_city_pcons_in_explorable setting in PconRefiller
AlexMacocian Apr 14, 2024
7f703e7
Merge branch 'alexmacocian/price-checker' of https://github.com/AlexM…
AlexMacocian Apr 14, 2024
36849fe
Merge dev
AlexMacocian Apr 14, 2024
5e30cc8
Fix merge issues
AlexMacocian Apr 14, 2024
97f39a2
Support for dynamic coloring based on item price
AlexMacocian Apr 14, 2024
142a9b6
Move description logic to PriceCheckerModule
AlexMacocian Apr 15, 2024
5fcdab3
Save module settings
AlexMacocian Apr 15, 2024
4e95d8f
Extract print functionality to its own reusable method
AlexMacocian Apr 15, 2024
d1b9982
Fix 'Item price' string
AlexMacocian Apr 15, 2024
68ff599
Increase static buffer size
AlexMacocian Apr 15, 2024
07880b0
work on quest markers, prepare for different colours
DubbleClick Apr 15, 2024
14f5f8d
different colors for non-primary quests
DubbleClick Apr 15, 2024
17f2900
Revert "Don't use timer widget for recording start/end times"
DubbleClick Apr 15, 2024
da72753
add setting for release or prerelease (beta) versions
DubbleClick Apr 15, 2024
4978e4f
1017 don't draw other markers, draw active marker first
DubbleClick Apr 15, 2024
1844f8b
fix build failure
DubbleClick Apr 15, 2024
dbdfafb
simplify pluginmodule
DubbleClick Apr 15, 2024
4c005ff
#1019 disable camera smoothing for reversed cam
DubbleClick Apr 15, 2024
2941315
Move settings to module code
AlexMacocian Apr 15, 2024
9ddc4e0
Merge pull request #1022 from AlexMacocian/alexmacocian/price-checker
3vcloud Apr 15, 2024
5433f2d
Move static funcs to pvt namespace
3vcloud Apr 15, 2024
7ea8cdd
Fixed bug preventing terminate from being called when a module is tur…
3vcloud Apr 15, 2024
bfed8d3
Expose GameSettings::OnGetItemDescription statically
3vcloud Apr 15, 2024
f56f9fa
Pricechecker rewrite
3vcloud Apr 15, 2024
c4d191b
Made pricechecker module optional
3vcloud Apr 15, 2024
8b9d39e
Removed recursive call to GW::HookBase::Initialize
3vcloud Apr 16, 2024
48e8c47
Updated gwca
3vcloud Apr 16, 2024
b58cd29
Price checker description terminator fix
AlexMacocian Apr 16, 2024
bc454b7
Fix IsCommonMaterial()
AlexMacocian Apr 16, 2024
ae7a412
Remove redundant assignment
AlexMacocian Apr 16, 2024
7b59521
Merge pull request #1026 from AlexMacocian/alexmacocian/price-checker…
DubbleClick Apr 16, 2024
d8a3ee8
remove scuffed GuiUtils::format
DubbleClick Apr 16, 2024
6f2a8af
update gwca
DubbleClick Apr 22, 2024
bde49a4
#1031 dont reset timer if never_reset is active even if entering expl…
DubbleClick Apr 22, 2024
cb15e35
don't run toolbox wndproc if gwtoolbox_disabled (in pvp)
DubbleClick Apr 22, 2024
35f5bf5
remove manual memory management from ghkey
DubbleClick Apr 22, 2024
480dd27
skip 500ms wait and instead check if key had been released since dial…
DubbleClick Apr 22, 2024
d48c06f
attempt to update github actions, let's pray it works
DubbleClick Apr 22, 2024
784496e
Minimize on travel
AlexMacocian Apr 22, 2024
23ff35b
Remove duplicate setting entries
AlexMacocian Apr 22, 2024
f3d137d
replace std::ranges::find != std::ranges::end with std::ranges::contains
DubbleClick Apr 22, 2024
d51d3b1
Merge pull request #1033 from AlexMacocian/minimize_on_travel
DubbleClick Apr 22, 2024
e7c7058
use std::to_underlying instead of static_cast<uint32_t>
DubbleClick Apr 22, 2024
8206116
enable hardening for wolfssl.cmake
DubbleClick Apr 22, 2024
4ece73f
Update index.md
DubbleClick Apr 23, 2024
b3c91ee
allow targeting locked chests again
DubbleClick Apr 23, 2024
30bf571
don't load from non-existent setting folder
DubbleClick Apr 24, 2024
6805875
updated gwca, instance timer changed for testing
3vcloud Apr 24, 2024
6e7e7fa
Merge branch 'dev' of https://github.com/gwdevhub/GWToolboxpp into dev
3vcloud Apr 24, 2024
8fabc9e
fix gwca
DubbleClick Apr 24, 2024
361080c
missing lf
DubbleClick Apr 24, 2024
0aa803d
incorect -> incorrect
DubbleClick Apr 25, 2024
d1af5ed
don't hide keys in itemfilter
DubbleClick Apr 25, 2024
b494d49
update GetIsAgentTargettable
DubbleClick Apr 25, 2024
eb6fab2
changed TargetNearest to default to Living if no type was provided
DubbleClick Apr 25, 2024
b9d73d2
users can now use the same alias for multiple commands or strings to …
DubbleClick Apr 25, 2024
a4fc5e0
prioritize marked targets over other players #1038
DubbleClick Apr 25, 2024
95801f7
fixup some UIMessage packets
DubbleClick Apr 25, 2024
989d792
missed gwca update
DubbleClick Apr 25, 2024
a799d55
Use kSendCallTarget packet
AlexMacocian Apr 25, 2024
c1a65c4
Log Out packet
AlexMacocian Apr 25, 2024
4f76346
Merge pull request #1039 from AlexMacocian/alexmacocian/chat-command-…
DubbleClick Apr 26, 2024
c02a369
Fix null pointer crash in quest marker renderer
adituv Apr 26, 2024
d28de62
Merge pull request #1040 from adituv/fix-npe-quest-renderer
DubbleClick Apr 26, 2024
a365ac8
Deliberately avoid freeing plugin dlls at runtime - hooks don't like it
3vcloud Apr 27, 2024
4e84b0f
Trigger GW::Terminate on a different thread away from the update loop
3vcloud Apr 27, 2024
72fd3c9
Free plugins right before termination to avoid GWToolbox dll hanging …
3vcloud Apr 27, 2024
df72260
Updated GWCA
3vcloud Apr 27, 2024
0a6768d
Updated gwca
3vcloud Apr 27, 2024
a141114
Fixed bug showing item price for non-trader items in price checker
3vcloud Apr 28, 2024
38e8043
fix signalterminate never being called
DubbleClick Apr 28, 2024
e25aeab
Fix 'hide city pcons in explorable area' not loading
adituv Apr 29, 2024
55ca391
Merge pull request #1046 from adituv/dev
DubbleClick Apr 29, 2024
64e30ac
fix crash when unloading plugin a second time
DubbleClick May 1, 2024
a703e97
version 6.17
DubbleClick May 1, 2024
254e4fa
let toolbox terminate when in pvp
DubbleClick May 1, 2024
9a8c202
enable OnMinOrRestoreOrExitBtnClicked when toolbox is in disabled pvp…
DubbleClick May 1, 2024
d26dd5d
Added missing GW Key options to hotkeys module
3vcloud May 1, 2024
98b0ff5
Fixed bugs
3vcloud May 1, 2024
f9a4134
revert gwca commit
DubbleClick May 1, 2024
0ac842f
remove clock plugin
DubbleClick May 1, 2024
b6b2f01
only send closing to gw once toolbox has actually exited
DubbleClick May 1, 2024
1abed17
remove clock plugin from cmake
DubbleClick May 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:

steps:
- name: Setup Windows 10 SDK Action
uses: GuillaumeFalourd/setup-windows10-sdk-action@v1.11
uses: GuillaumeFalourd/setup-windows10-sdk-action@v2
with:
sdk-version: 22621

- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Checkout submodules
shell: bash
Expand Down Expand Up @@ -41,6 +41,6 @@ jobs:
run: cmake --build . --config RelWithDebInfo

- name: Save output
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: ${{runner.workspace}}/GWToolboxpp/bin/RelWithDebInfo/
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ set(CMAKE_GENERATOR_PLATFORM win32)
project(gwtoolbox)

set(GWTOOLBOXEXE_VERSION "4.0")
set(GWTOOLBOXDLL_VERSION "6.16")
set(GWTOOLBOXDLL_VERSION "6.17")
set(GWTOOLBOXDLL_VERSION_BETA "") # can be anything. Marks beta version if not empty.
set(GWTOOLBOX_MODULE_VERSION "6,16,0,0") # used for Dll module info. See GWToolboxdll/GWToolbox.rc
set(GWTOOLBOX_MODULE_VERSION "6,17,0,0") # used for Dll module info. See GWToolboxdll/GWToolbox.rc

# this is no longer required, but in case we have to add an installer again some day
# configure_file(${PROJECT_SOURCE_DIR}/gwtoolbox.wxs.in ${PROJECT_SOURCE_DIR}/gwtoolbox.wxs @ONLY)
Expand Down
2 changes: 1 addition & 1 deletion Dependencies/GWCA
Submodule GWCA updated from 9ae233 to c5c2d0
103 changes: 74 additions & 29 deletions GWToolboxdll/GWToolbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#include <GWCA/Context/PreGameContext.h>
#include <GWCA/Context/CharContext.h>
#include <GWCA/Context/MapContext.h>

#include <GWCA/GameEntities/Map.h>

Expand Down Expand Up @@ -33,12 +32,15 @@
#include "Modules/InventoryManager.h"
#include "Modules/LoginModule.h"
#include "Modules/Updater.h"
#include "Modules/PriceCheckerModule.h"
#include "Windows/SettingsWindow.h"

#include <Windows/MainWindow.h>
#include <Widgets/Minimap/Minimap.h>
#include <hidusage.h>

#include "GWCA/Utilities/Scanner.h"




Expand All @@ -60,11 +62,6 @@ namespace {

bool event_handler_attached = false;

bool IsPvP() {
const auto m = GW::Map::GetMapInfo();
return (m && /*GW::Map::GetInstanceType() != GW::Constants::InstanceType::Outpost &&*/ m->GetIsPvP());
}

bool AttachWndProcHandler()
{
if (event_handler_attached) {
Expand Down Expand Up @@ -98,7 +95,35 @@ namespace {
return true;
}

GW::UI::UIInteractionCallback OnMinOrRestoreOrExitBtnClicked_Func = nullptr;
GW::UI::UIInteractionCallback OnMinOrRestoreOrExitBtnClicked_Ret = nullptr;

void OnMinOrRestoreOrExitBtnClicked(GW::UI::InteractionMessage* message, void* wparam, void* lparam)
{
GW::Hook::EnterHook();
if (message->message_id == GW::UI::UIMessage::kMouseAction && wparam) {
struct MouseParams {
uint32_t button_id;
uint32_t button_id_dupe;
uint32_t current_state; // 0x5 = hovered, 0x6 = mouse down
}* param = static_cast<MouseParams*>(wparam);
const auto frame = GW::UI::GetFrameByLabel(L"btnExit");
if (frame && frame->frame_id == message->frame_id && param->current_state == 0x6) {
param->current_state = 0x5; // Revert state to avoid GW closing the window on mouse up

// Left button clicked, on the exit button (ID 0x3)
static bool closing_gw = false;
if (!closing_gw) {
SendMessage(gw_window_handle, WM_CLOSE, NULL, NULL);
}
closing_gw = true;
GW::Hook::LeaveHook();
return;
}
}
OnMinOrRestoreOrExitBtnClicked_Ret(message, wparam, lparam);
GW::Hook::LeaveHook();
}

bool render_callback_attached = false;
bool AttachRenderCallback() {
Expand All @@ -119,6 +144,7 @@ namespace {
bool game_loop_callback_attached = false;
GW::HookEntry game_loop_callback_entry;
bool AttachGameLoopCallback() {
GW::GameThreadModule.enable_hooks();
if (!game_loop_callback_attached) {
GW::GameThread::RegisterGameThreadCallback(&game_loop_callback_entry,GWToolbox::Update);
game_loop_callback_attached = true;
Expand Down Expand Up @@ -263,8 +289,7 @@ namespace {
if (!enable) {
return false;
}
const auto is_terminating = std::ranges::find(modules_terminating, &m);
if (is_terminating != modules_terminating.end()) {
if (std::ranges::contains(modules_terminating, &m)) {
return false; // Not finished terminating
}
vec.push_back(&m);
Expand Down Expand Up @@ -373,7 +398,6 @@ DWORD __stdcall ThreadEntry(LPVOID)
{
Log::Log("Initializing API\n");

GW::HookBase::Initialize();
if (!GW::Initialize()) {
if (MessageBoxA(nullptr, "Initialize Failed at finding all addresses, contact Developers about this.", "GWToolbox++ API Error", 0) == IDOK) { }
return 0;
Expand Down Expand Up @@ -405,6 +429,7 @@ DWORD __stdcall ThreadEntry(LPVOID)

// @Remark:
// Hooks are disable from Guild Wars thread (safely), so we just make sure we exit the last hooks
GW::DisableHooks();
while (GW::HookBase::GetInHookCount()) {
Sleep(16);
}
Expand All @@ -419,6 +444,11 @@ DWORD __stdcall ThreadEntry(LPVOID)

Log::Log("Closing log/console, bye!\n");
Log::Terminate();

if (defer_close) {
// Toolbox was closed by a user closing GW - close it here for the by sending the `WM_CLOSE` message again.
SendMessage(gw_window_handle, WM_CLOSE, NULL, NULL);
}
return 0;
}

Expand Down Expand Up @@ -448,6 +478,9 @@ LRESULT CALLBACK WndProc(const HWND hWnd, const UINT Message, const WPARAM wPara
if (!(!GW::GetPreGameContext() && GWToolbox::IsInitialized())) {
return CallWindowProc(OldWndProc, hWnd, Message, wParam, lParam);
}
if (gwtoolbox_disabled) {
return CallWindowProc(OldWndProc, hWnd, Message, wParam, lParam);
}

if (Message == WM_RBUTTONUP) {
right_mouse_down = false;
Expand Down Expand Up @@ -576,8 +609,16 @@ void GWToolbox::Initialize()
case GWToolboxState::Terminated:
gwtoolbox_state = GWToolboxState::Initialising;
AttachRenderCallback();
//AttachGameLoopCallback();
GW::EnableHooks();

// Stop GW from force closing the game when clicking on the exit button in window fullscreen; instead route it through the close signal.
if (!OnMinOrRestoreOrExitBtnClicked_Func) {
OnMinOrRestoreOrExitBtnClicked_Func = (GW::UI::UIInteractionCallback)GW::Scanner::Find("\x83\xc4\x0c\xa9\x00\x00\x80\x00", "xxxxxxxx", -0x54);
if (OnMinOrRestoreOrExitBtnClicked_Func) {
GW::HookBase::CreateHook((void**)&OnMinOrRestoreOrExitBtnClicked_Func, OnMinOrRestoreOrExitBtnClicked, reinterpret_cast<void**>(&OnMinOrRestoreOrExitBtnClicked_Ret));
GW::HookBase::EnableHooks(OnMinOrRestoreOrExitBtnClicked_Func);
}
}
UpdateInitialising(.0f);
AttachGameLoopCallback();
pending_detach_dll = false;
Expand Down Expand Up @@ -670,14 +711,16 @@ void GWToolbox::Disable()
return;
GW::DisableHooks();
GW::RenderModule.enable_hooks();
if (OnMinOrRestoreOrExitBtnClicked_Func)
GW::HookBase::EnableHooks(OnMinOrRestoreOrExitBtnClicked_Func);
AttachRenderCallback();
gwtoolbox_disabled = true;
}

bool GWToolbox::CanTerminate()
{
return modules_terminating.empty()
&& GuiUtils::FontsLoaded()
return modules_terminating.empty()
&& GuiUtils::FontsLoaded()
&& all_modules_enabled.empty()
&& !imgui_initialized
&& !event_handler_attached;
Expand Down Expand Up @@ -706,6 +749,8 @@ void GWToolbox::Update(GW::HookStatus*) {
return;
}

UpdateModulesTerminating(delta_f);

// Update loop
for (const auto m : all_modules_enabled) {
m->Update(delta_f);
Expand Down Expand Up @@ -847,11 +892,24 @@ void GWToolbox::UpdateInitialising(float) {
gwtoolbox_state = GWToolboxState::DrawInitialising;
}

void GWToolbox::UpdateModulesTerminating(float delta_f) {
terminate_modules:
for (const auto m : modules_terminating) {
if (m->CanTerminate()) {
m->Terminate();
const auto found = std::ranges::find(modules_terminating, m);
ASSERT(found != modules_terminating.end());
modules_terminating.erase(found);
goto terminate_modules;
}
m->Update(delta_f);
}
}

void GWToolbox::UpdateTerminating(float delta_f) {
ASSERT(gwtoolbox_state == GWToolboxState::Terminating);

if (all_modules_enabled.size()) {
SaveSettings();
while (modules_enabled.size()) {
ASSERT(ToggleModule(*modules_enabled[0], false) == false);
}
Expand All @@ -863,17 +921,7 @@ void GWToolbox::UpdateTerminating(float delta_f) {
}
}
ASSERT(all_modules_enabled.empty());
terminate_modules:
for (const auto m : modules_terminating) {
if (m->CanTerminate()) {
m->Terminate();
const auto found = std::ranges::find(modules_terminating, m);
ASSERT(found != modules_terminating.end());
modules_terminating.erase(found);
goto terminate_modules;
}
m->Update(delta_f);
}
UpdateModulesTerminating(delta_f);
if (!modules_terminating.empty())
return;

Expand All @@ -885,15 +933,12 @@ void GWToolbox::UpdateTerminating(float delta_f) {
GW::DisableHooks();

gwtoolbox_state = GWToolboxState::Terminated;

if (defer_close) {
// Toolbox was closed by a user closing GW - close it here for the by sending the `WM_CLOSE` message again.
SendMessageW(gw_window_handle, WM_CLOSE, NULL, NULL);
}
}

void GWToolbox::DrawTerminating(IDirect3DDevice9*) {
ASSERT(gwtoolbox_state == GWToolboxState::DrawTerminating);
// Save settings on the draw loop otherwise theme won't be saved
SaveSettings();
ASSERT(DetachImgui());
gwtoolbox_state = GWToolboxState::Terminating;
}
Expand Down
1 change: 1 addition & 0 deletions GWToolboxdll/GWToolbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,6 @@ class GWToolbox {
static void DrawInitialising(IDirect3DDevice9* device);
static void DrawTerminating(IDirect3DDevice9* device);
static void UpdateInitialising(float);
static void UpdateModulesTerminating(float);
static void UpdateTerminating(float);
};
Loading