Make pinned glyphs sort in the order they were pinned in

This commit is contained in:
Joseph C. Sible
2025-10-13 21:14:27 -04:00
parent 718fbcd895
commit 33330c9132
2 changed files with 20 additions and 7 deletions
+8 -1
View File
@@ -184,7 +184,14 @@ EX void showOverview() {
else if(udiv == 2 && umod < ittypes) {
gotoHelp(generateHelpForItem(eItem(umod)));
help_extensions.push_back(help_extension{'p', glyphpinned[umod] ? XLAT("unpin from HUD") : XLAT("pin to HUD"), [umod] () {
glyphpinned[umod] ^= true;
if(glyphpinned[umod]) {
revglyphpinned.erase(std::remove_if(revglyphpinned.begin(), revglyphpinned.end(), [umod] (int x) { return x == umod; }), revglyphpinned.end());
glyphpinned[umod] = 0;
}
else {
revglyphpinned.push_back(umod);
glyphpinned[umod] = revglyphpinned.size();
}
updatepinnedglyphs();
popScreen();
}});