Skip to content

Commit

Permalink
Merge pull request #539 from WSSDude420/ui-changes
Browse files Browse the repository at this point in the history
Fix Bindings Input tab printing "Cyber Engine Tweaks"
  • Loading branch information
Yamashi authored Apr 3, 2021
2 parents 650077b + 0ad2d27 commit 7addac4
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/overlay/widgets/Bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,23 @@ bool Bindings::DrawBindings(bool aDrawHotkeys)
: ("This mod has no inputs, but it should have some hotkeys in other tab...")
};

std::string_view prevMod{""};
std::string activeModName;
std::string_view prevMod { "" };
size_t modBindsForType { 0 };
for (auto& vkBindInfo : m_vkBindInfos)
{
std::string_view curMod { vkBindInfo.Bind.ID };
curMod = curMod.substr(0, curMod.find('.'));
if (prevMod != curMod)
{
// make it writable (also checks for "cet" modname)
std::string activeModName { (curMod == "cet") ? ("Cyber Engine Tweaks") : (curMod) };
if (curMod == "cet")
{
if (!aDrawHotkeys)
continue; // skip in this instance
activeModName = "Cyber Engine Tweaks";
}
else
activeModName = curMod;

// transform to nicer format till modinfo is in
bool capitalize = true;
Expand All @@ -169,7 +176,7 @@ bool Bindings::DrawBindings(bool aDrawHotkeys)
// add vertical spacing when this is not first iteration and check if we drawn anything
if (!prevMod.empty())
{
if (!modBindsForType && (prevMod != "cet"))
if (!modBindsForType)
{
// we did not draw anything, write appropriate message so it is not empty
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 10.0f);
Expand Down

0 comments on commit 7addac4

Please sign in to comment.