Skip to content

Commit b0f635b

Browse files
CompletionWindow: add 'hide unlocked skills' checkbox and rename 'learned' to 'learnt'
Adds a new 'Hide unlocked skills' checkbox alongside 'Hide learnt skills' in the skill completion tracker. The new checkbox filters out skills already unlocked account-wide (via GW::SkillbarMgr::GetIsSkillUnlocked), which is distinct from per-character learnt status tracked in completion.ini. Applies to both Elite Skills and PvE Skills sections. Fixes #1408 Co-authored-by: Jon <3vcloud@users.noreply.github.com>
1 parent 342b4b4 commit b0f635b

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

GWToolboxdll/Windows/CompletionWindow.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ namespace {
262262

263263
bool hide_unlocked_achievements = false;
264264
bool hide_unlocked_skills = false;
265+
bool hide_account_unlocked_skills = false;
265266
bool hide_completed_vanquishes = false;
266267
bool hide_completed_missions = false;
267268
bool hide_collected_hats = false;
@@ -1219,6 +1220,7 @@ bool PvESkill::Draw(IDirect3DDevice9* device)
12191220
void PvESkill::CheckProgress(const std::wstring& player_name)
12201221
{
12211222
is_completed = false;
1223+
is_account_unlocked = GW::SkillbarMgr::GetIsSkillUnlocked(skill_id);
12221224
const auto& skills = character_completion;
12231225
if (!skills.contains(player_name)) {
12241226
return;
@@ -2386,7 +2388,9 @@ void CompletionWindow::Draw(IDirect3DDevice9* device)
23862388
}
23872389
ImGui::SameLine(checkbox_offset);
23882390
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, {0, 0});
2389-
ImGui::Checkbox("Hide learned skills", &hide_unlocked_skills);
2391+
ImGui::Checkbox("Hide learnt skills", &hide_unlocked_skills);
2392+
ImGui::SameLine();
2393+
ImGui::Checkbox("Hide unlocked skills", &hide_account_unlocked_skills);
23902394
ImGui::PopStyleVar();
23912395
ImGui::PopID();
23922396
};
@@ -2402,9 +2406,12 @@ void CompletionWindow::Draw(IDirect3DDevice9* device)
24022406
continue;
24032407
}
24042408
}
2409+
if (hide_account_unlocked_skills && camp_missions[i]->is_account_unlocked) {
2410+
continue;
2411+
}
24052412
filtered.push_back(camp_missions[i]);
24062413
}
2407-
if (hide_unlocked_skills && filtered.empty()) {
2414+
if ((hide_unlocked_skills || hide_account_unlocked_skills) && filtered.empty()) {
24082415
continue;
24092416
}
24102417
char label[128];
@@ -2425,9 +2432,12 @@ void CompletionWindow::Draw(IDirect3DDevice9* device)
24252432
continue;
24262433
}
24272434
}
2435+
if (hide_account_unlocked_skills && camp_missions[i]->is_account_unlocked) {
2436+
continue;
2437+
}
24282438
filtered.push_back(camp_missions[i]);
24292439
}
2430-
if (hide_unlocked_skills && filtered.empty()) {
2440+
if ((hide_unlocked_skills || hide_account_unlocked_skills) && filtered.empty()) {
24312441
continue;
24322442
}
24332443
char label[128];
@@ -2830,6 +2840,7 @@ void CompletionWindow::LoadSettings(ToolboxIni* ini)
28302840

28312841
LOAD_BOOL(show_as_list);
28322842
LOAD_BOOL(hide_unlocked_skills);
2843+
LOAD_BOOL(hide_account_unlocked_skills);
28332844
LOAD_BOOL(hide_completed_vanquishes);
28342845
LOAD_BOOL(hide_completed_missions);
28352846
LOAD_BOOL(hide_unlocked_achievements);
@@ -2961,6 +2972,7 @@ void CompletionWindow::SaveSettings(ToolboxIni* ini)
29612972

29622973
SAVE_BOOL(show_as_list);
29632974
SAVE_BOOL(hide_unlocked_skills);
2975+
SAVE_BOOL(hide_account_unlocked_skills);
29642976
SAVE_BOOL(hide_completed_vanquishes);
29652977
SAVE_BOOL(hide_completed_missions);
29662978
SAVE_BOOL(hide_unlocked_achievements);

GWToolboxdll/Windows/CompletionWindow.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ namespace Missions {
6565

6666
public:
6767
GW::Constants::ProfessionByte profession = (GW::Constants::ProfessionByte)0;
68+
bool is_account_unlocked = false;
6869
PvESkill(GW::Constants::SkillID _skill_id);
6970
bool IsDaily() override { return false; }
7071
bool HasQuest() override { return false; }

0 commit comments

Comments
 (0)