Skip to content

Commit

Permalink
/age2 now uses timer
Browse files Browse the repository at this point in the history
  • Loading branch information
HasKha committed Dec 23, 2020
1 parent 74615da commit 71d98a8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions GWToolboxdll/Modules/ChatCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <Windows/Hotkeys.h>
#include <Windows/MainWindow.h>
#include <Windows/SettingsWindow.h>
#include <Widgets/TimerWidget.h>


namespace {
Expand Down Expand Up @@ -529,8 +530,7 @@ void ChatCommands::CmdEnterMission(const wchar_t*, int argc, LPWSTR* argv) {
}

void ChatCommands::CmdAge2(const wchar_t* , int, LPWSTR* ) {
DWORD second = GW::Map::GetInstanceTime() / 1000;
Log::Info("%02u:%02u:%02u", (second / 3600), (second / 60) % 60, second % 60);
TimerWidget::Instance().PrintTimer();
}

void ChatCommands::CmdDialog(const wchar_t *, int argc, LPWSTR *argv) {
Expand Down
5 changes: 3 additions & 2 deletions GWToolboxdll/Modules/GameSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ class GameSettings : public ToolboxModule {

bool lazy_chest_looting = false;

bool auto_age2_on_age = true;
bool auto_age_on_vanquish = false;

static GW::Friend* GetOnlineFriend(wchar_t* account, wchar_t* playing);

std::vector<PendingChatMessage*> pending_messages;
Expand Down Expand Up @@ -280,8 +283,6 @@ class GameSettings : public ToolboxModule {
bool check_message_on_party_change = true;
bool npc_speech_bubbles_as_chat = false;
bool redirect_npc_messages_to_emote_chat = false;
bool auto_age2_on_age = true;
bool auto_age_on_vanquish = false;
bool hide_dungeon_chest_popup = false;
bool skip_entering_name_for_faction_donate = false;
bool stop_screen_shake = false;
Expand Down
5 changes: 4 additions & 1 deletion GWToolboxdll/Widgets/TimerWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <Logger.h>
#include <Timer.h>

#include <Modules/GameSettings.h>
#include <Modules/ToolboxSettings.h>
#include <Widgets/TimerWidget.h>

Expand Down Expand Up @@ -282,7 +283,9 @@ void TimerWidget::Draw(IDirect3DDevice9* pDevice) {
ImVec2 min = ImGui::GetWindowPos();
ImVec2 max(min.x + size.x, min.y + size.y);
if (ctrl_pressed && ImGui::IsMouseReleased(0) && ImGui::IsMouseHoveringRect(min, max)) {
PrintTimer();
if (!GameSettings::Instance().auto_age2_on_age) {
PrintTimer();
}
GW::Chat::SendChat('/', "age");
}
}
Expand Down

0 comments on commit 71d98a8

Please sign in to comment.