refactor: Move custom ImGui functions to ImGuiExt namespace (#1427)

Co-authored-by: Nik <werwolv98@gmail.com>
This commit is contained in:
iTrooz
2023-11-16 22:24:06 +01:00
committed by GitHub
parent 77c326d300
commit 39252dfe48
79 changed files with 644 additions and 622 deletions

View File

@@ -46,7 +46,7 @@ namespace hex::plugin::builtin {
// Determine achievement border color based on unlock state
const auto borderColor = [&] {
if (achievement.isUnlocked())
return ImGui::GetCustomColorU32(ImGuiCustomCol_AchievementUnlocked, 1.0F);
return ImGuiExt::GetCustomColorU32(ImGuiCustomCol_AchievementUnlocked, 1.0F);
else if (node->isUnlockable())
return ImGui::GetColorU32(ImGuiCol_Button, 1.0F);
else
@@ -127,7 +127,7 @@ namespace hex::plugin::builtin {
ImGui::Separator();
separator = true;
ImGui::TextFormattedColored(ImGui::GetCustomColorVec4(ImGuiCustomCol_AchievementUnlocked), "[ {} ]", LangEntry("hex.builtin.view.achievements.click"));
ImGuiExt::TextFormattedColored(ImGuiExt::GetCustomColorVec4(ImGuiCustomCol_AchievementUnlocked), "[ {} ]", LangEntry("hex.builtin.view.achievements.click"));
}
// Draw achievement description if available
@@ -137,7 +137,7 @@ namespace hex::plugin::builtin {
else
ImGui::NewLine();
ImGui::TextFormattedWrapped("{}", LangEntry(desc));
ImGuiExt::TextFormattedWrapped("{}", LangEntry(desc));
}
ImGui::EndDisabled();
}
@@ -424,7 +424,7 @@ namespace hex::plugin::builtin {
ImGui::BringWindowToDisplayFront(ImGui::GetCurrentWindow());
// Draw unlock text
ImGui::TextFormattedColored(ImGui::GetCustomColorVec4(ImGuiCustomCol_AchievementUnlocked), "{}", "hex.builtin.view.achievements.unlocked"_lang);
ImGuiExt::TextFormattedColored(ImGuiExt::GetCustomColorVec4(ImGuiCustomCol_AchievementUnlocked), "{}", "hex.builtin.view.achievements.unlocked"_lang);
// Draw achievement icon
ImGui::Image(this->m_currAchievement->getIcon(), scaled({ 20, 20 }));
@@ -434,7 +434,7 @@ namespace hex::plugin::builtin {
ImGui::SameLine();
// Draw name of achievement
ImGui::TextFormattedWrapped("{}", LangEntry(this->m_currAchievement->getUnlocalizedName()));
ImGuiExt::TextFormattedWrapped("{}", LangEntry(this->m_currAchievement->getUnlocalizedName()));
// Handle clicking on the popup
if (ImGui::IsWindowHovered() && ImGui::IsMouseReleased(ImGuiMouseButton_Left)) {