mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-11 12:05:09 -05:00
fix: don't show duplicate gregs on item tracker (#2498)
Co-authored-by: briaguya <briaguya@alice>
This commit is contained in:
parent
494bdcdb25
commit
9325e6d0a5
@ -9,6 +9,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <libultraship/bridge.h>
|
#include <libultraship/bridge.h>
|
||||||
#include <Hooks.h>
|
#include <Hooks.h>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <z64.h>
|
#include <z64.h>
|
||||||
@ -855,14 +856,14 @@ void UpdateVectors() {
|
|||||||
if (CVarGetInteger("gItemTrackerDungeonItemsDisplayType", 0) == 1) {
|
if (CVarGetInteger("gItemTrackerDungeonItemsDisplayType", 0) == 1) {
|
||||||
mainWindowItems.insert(mainWindowItems.end(), dungeonItems.begin(), dungeonItems.end());
|
mainWindowItems.insert(mainWindowItems.end(), dungeonItems.begin(), dungeonItems.end());
|
||||||
}
|
}
|
||||||
if (CVarGetInteger("gItemTrackerGregDisplayType", 0) == 1) {
|
|
||||||
// insert empty items until we're on a new row for greg
|
// if we're adding greg to the misc window,
|
||||||
while (mainWindowItems.size() % 6) {
|
// and misc isn't on the main window,
|
||||||
mainWindowItems.push_back(ITEM_TRACKER_ITEM(ITEM_NONE, 0, DrawItem));
|
// and it doesn't already have greg, add him
|
||||||
}
|
if (CVarGetInteger("gItemTrackerGregDisplayType", 0) == 2 &&
|
||||||
mainWindowItems.insert(mainWindowItems.end(), gregItems.begin(), gregItems.end());
|
CVarGetInteger("gItemTrackerMiscItemsDisplayType", 1) != 1 &&
|
||||||
}
|
std::none_of(miscItems.begin(), miscItems.end(), [](ItemTrackerItem item){return item.id == ITEM_RUPEE_GREEN;})) {
|
||||||
if (CVarGetInteger("gItemTrackerGregDisplayType", 0) == 2) {
|
|
||||||
miscItems.insert(miscItems.end(), gregItems.begin(), gregItems.end());
|
miscItems.insert(miscItems.end(), gregItems.begin(), gregItems.end());
|
||||||
} else {
|
} else {
|
||||||
for (auto it = miscItems.begin(); it != miscItems.end();) {
|
for (auto it = miscItems.begin(); it != miscItems.end();) {
|
||||||
@ -874,6 +875,17 @@ void UpdateVectors() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if we're adding greg to the main window
|
||||||
|
if (CVarGetInteger("gItemTrackerGregDisplayType", 0) == 1) {
|
||||||
|
// insert empty items until we're on a new row for greg
|
||||||
|
while (mainWindowItems.size() % 6) {
|
||||||
|
mainWindowItems.push_back(ITEM_TRACKER_ITEM(ITEM_NONE, 0, DrawItem));
|
||||||
|
}
|
||||||
|
|
||||||
|
// add greg
|
||||||
|
mainWindowItems.insert(mainWindowItems.end(), gregItems.begin(), gregItems.end());
|
||||||
|
}
|
||||||
|
|
||||||
shouldUpdateVectors = false;
|
shouldUpdateVectors = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user