Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/gwdevhub/GWToolboxpp into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
3vcloud committed Jun 19, 2024
2 parents 96a52e1 + a3ef52d commit 7414379
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 47 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(gwtoolbox)

set(GWTOOLBOXEXE_VERSION "4.0")
set(GWTOOLBOXDLL_VERSION "6.21")
set(GWTOOLBOXDLL_VERSION_BETA "beta1") # can be anything. Marks beta version if not empty.
set(GWTOOLBOXDLL_VERSION_BETA "beta2") # can be anything. Marks beta version if not empty.
set(GWTOOLBOX_MODULE_VERSION "6,21,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
Expand Down
4 changes: 1 addition & 3 deletions GWToolboxdll/Modules/ChatCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <GWCA/Managers/AgentMgr.h>
#include <GWCA/Managers/CameraMgr.h>
#include <GWCA/Managers/MemoryMgr.h>
#include <GWCA/Managers/QuestMgr.h>
#include <GWCA/Managers/PlayerMgr.h>
#include <GWCA/Managers/SkillbarMgr.h>
#include <GWCA/Managers/FriendListMgr.h>
Expand All @@ -43,7 +44,6 @@
#include <Logger.h>

#include <Modules/ChatCommands.h>
#include <Modules/ObserverModule.h>
#include <Modules/GameSettings.h>
#include <Modules/ChatSettings.h>
#include <Modules/InventoryManager.h>
Expand All @@ -56,8 +56,6 @@
#include <Modules/HallOfMonumentsModule.h>
#include <Modules/DialogModule.h>
#include <Modules/Resources.h>
#include <GWCA/Managers/QuestMgr.h>
#include <Widgets/BondsWidget.h>

constexpr auto CMDTITLE_KEEP_CURRENT = 0xfffe;
constexpr auto CMDTITLE_REMOVE_CURRENT = 0xffff;
Expand Down
11 changes: 8 additions & 3 deletions GWToolboxdll/Modules/Updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

namespace {
// 0=none, 1=check and warn, 2=check and ask, 3=check and do
enum class ReleaseType : uint8_t {
enum class ReleaseType : int {
Stable,
Beta
};
enum class Mode : uint8_t {
enum class Mode : int {
DontCheckForUpdates,
CheckAndWarn,
CheckAndAsk,
Expand Down Expand Up @@ -101,6 +101,10 @@ namespace {
}
release->download_url = asset["browser_download_url"].get<std::string>();
release->version = tag_name.substr(0, version_number_len);
if (is_prerelease) {
release->version += tag_name.substr(version_number_len + 1);
}
std::ranges::transform(release->version, release->version.begin(), [](const auto chr) { return static_cast<char>(std::tolower(chr)); });
release->body = js["body"].get<std::string>();
release->size = asset["size"].get<uintmax_t>();
return release;
Expand All @@ -119,6 +123,7 @@ namespace {
out->size = std::filesystem::file_size(path);
out->version = GWTOOLBOXDLL_VERSION;
out->version.append(GWTOOLBOXDLL_VERSION_BETA);
std::ranges::transform(out->version, out->version.begin(), [](const auto chr) { return static_cast<char>(std::tolower(chr)); });
return out;
}

Expand Down Expand Up @@ -208,7 +213,7 @@ void Updater::LoadSettings(ToolboxIni* ini)
{
ToolboxModule::LoadSettings(ini);
#ifdef _DEBUG
mode = static_cast<Mode>(0);
mode = Mode::DontCheckForUpdates;
release_type = ReleaseType::Beta;
#else
mode = static_cast<Mode>(ini->GetLongValue(Name(), "update_mode", static_cast<int>(mode)));
Expand Down
7 changes: 0 additions & 7 deletions GWToolboxdll/Widgets/EffectsMonitorWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,12 @@

#include <GWCA/Context/WorldContext.h>

#include <GWCA/Packets/StoC.h>

#include <GWCA/GameEntities/Skill.h>

#include <GWCA/Managers/AgentMgr.h>
#include <GWCA/Managers/EffectMgr.h>
#include <GWCA/Managers/SkillbarMgr.h>
#include <GWCA/Managers/MapMgr.h>
#include <GWCA/Managers/UIMgr.h>
#include <GWCA/Managers/StoCMgr.h>
#include <GWCA/Managers/GameThreadMgr.h>
#include <GWCA/Managers/RenderMgr.h>
#include <GWCA/Managers/MemoryMgr.h>

#include <Utils/GuiUtils.h>
#include <Color.h>
Expand Down
13 changes: 0 additions & 13 deletions GWToolboxdll/Windows/Hotkeys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1476,9 +1476,6 @@ bool HotkeyAction::GetText(void*, int idx, const char** out_text)
case OpenXunlaiChest:
*out_text = "Open Xunlai Chest";
return true;
case OpenLockedChest:
*out_text = "Open Locked Chest";
return true;
case DropGoldCoin:
*out_text = "Drop Gold Coin";
return true;
Expand Down Expand Up @@ -1529,16 +1526,6 @@ void HotkeyAction::Execute()
GW::Items::OpenXunlaiWindow();
});
break;
case OpenLockedChest: {
if (isExplorable()) {
const GW::Agent* target = GW::Agents::GetTarget();
if (target && target->GetIsGadgetType()) {
GW::Agents::InteractAgent(target);
GW::Items::OpenLockedChest();
}
}
break;
}
case DropGoldCoin:
if (isExplorable()) {
GW::Items::DropGold(1);
Expand Down
5 changes: 2 additions & 3 deletions GWToolboxdll/Windows/Hotkeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,16 +262,15 @@ class HotkeyAction : public TBHotkey {

enum Action {
OpenXunlaiChest,
OpenLockedChest,
DropGoldCoin,
DropGoldCoin = 2,
ReapplyTitle,
EnterChallenge,
};

static bool GetText(void*, int idx, const char** out_text);

public:
Action action;
Action action = OpenXunlaiChest;

static const char* IniSection() { return "Action"; }
[[nodiscard]] const char* Name() const override { return IniSection(); }
Expand Down
27 changes: 10 additions & 17 deletions GWToolboxdll/Windows/InfoWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -953,35 +953,28 @@ namespace {
[[maybe_unused]] const GW::Chat::ChatBuffer* log = GW::Chat::GetChatLog();
[[maybe_unused]] const GW::AreaInfo* ai = GW::Map::GetMapInfo(GW::Map::GetMapID());

#ifdef _DEBUG
const auto frame = GW::UI::GetFrameByLabel(L"NPCInteract");
if (frame && frame->IsVisible()) {
auto dialog_buttons_frame = GW::UI::GetChildFrame(frame, 2); // Scrollable frame
dialog_buttons_frame = GW::UI::GetChildFrame(dialog_buttons_frame, 0);
dialog_buttons_frame = GW::UI::GetChildFrame(dialog_buttons_frame, 0);
dialog_buttons_frame = GW::UI::GetChildFrame(dialog_buttons_frame, 1);
if (dialog_buttons_frame) {
auto relation = dialog_buttons_frame->relation;
auto& siblings = dialog_buttons_frame->relation.siblings;
siblings.
do {
const auto frame = sibling->Next();
if (!frame) break;
if (frame == relation) break;
sibling = sibling->Next();

}

for(auto button_frame : siblings){
const auto button_frame = (*it)->GetFrame();
for (auto& sibling : dialog_buttons_frame->relation.siblings) {
const auto button_frame = sibling.GetFrame();
if (button_frame->child_offset_id != 0x1)
continue; // Not a button frame
const auto top_left = button_frame->position.GetTopLeftOnScreen(frame);
const auto bottom_right = button_frame->position.GetBottomRightOnScreen(frame);
ImGui::GetBackgroundDrawList()->AddRect({ top_left.x,top_left.y }, { bottom_right.x,bottom_right.y }, IM_COL32_WHITE);
const auto label = std::to_string(button_frame->field100_0x1a8);
const auto draw_list = ImGui::GetBackgroundDrawList();
draw_list->AddRect({ top_left.x, top_left.y }, { bottom_right.x, bottom_right.y }, IM_COL32_WHITE);
draw_list->AddText({ top_left.x, top_left.y }, IM_COL32_WHITE, label.c_str());
}
}

}

(frame);
#endif
}
}

Expand Down

0 comments on commit 7414379

Please sign in to comment.