Skip to content

Commit

Permalink
Adds buttons for completing dailies & weeklies
Browse files Browse the repository at this point in the history
  • Loading branch information
fadillzzz committed Mar 31, 2024
1 parent a2b990c commit d80389b
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/feats/quest.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
#include "quest.hpp"
#include "../globals.hpp"
#include <regex>

namespace Feats {
namespace Quest {
void completeQuestsWithFilter(std::regex filter) {
const auto character = Globals::getCharacter();

if (character != nullptr) {
const auto questComponent = character->QuestComponent;

if (questComponent != nullptr) {
const auto quests = questComponent->QuestsInProgress;

for (auto &quest : quests) {
if (std::regex_match(quest.QuestID.ToString(), filter)) {
questComponent->GM_CompleteQuestObject(quest.QuestID);
}
}
}
}
}

void init() { return; }
void tick() { return; }
void menu() {
Expand All @@ -24,6 +43,18 @@ namespace Feats {

ImGui::SameLine();

if (ImGui::Button("Complete Daily")) {
completeQuestsWithFilter(std::regex("rv\\d{6}"));
}

ImGui::SameLine();

if (ImGui::Button("Complete Weekly")) {
completeQuestsWithFilter(std::regex("[aA]ctivityquest\\d{3}"));
}

ImGui::SameLine();

if (ImGui::Button("Complete all quests")) {
const auto character = Globals::getCharacter();

Expand Down

0 comments on commit d80389b

Please sign in to comment.