-
-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvement: Add ability to use /shedittracker
with CorpseTracker
#2582
Improvement: Add ability to use /shedittracker
with CorpseTracker
#2582
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure how easy this is to implement. but i dont like the code duplication
ProfileStorageData.profileSpecific?.mining?.mineshaft?.corpseProfitTracker?.let { trackerData -> | ||
trackerData.getSelectedBucket()?.let { | ||
tracker.addItem(it, event.internalName, event.amount) | ||
ChatUtils.chat("Added ${event.internalName.itemName} §8x${event.amount} to Corpse Tracker §8(${it.displayName}§8)§e.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be abstracted into the bucketed item tracker.
ideally the bucketed item tracker would reuse the logic from skyhann iitem tracker so that this unique chat message is not necessary in the first place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't re-use the logic - they're entirely separate trackers. The item trackers just have the concept of one set of global "loot" that's added to - this is an enum driven base of buckets, the logic doesn't fit. The only way I could think to do this was using the currently-selected bucket.
Best I could do would be to abstract it back to the bucketed item tracker, however that message is going to end up having to be very generic. We can't do it in SkyhanniItemTracker
and expect it to work here - the addItem
signatures are already overridden for SkyhanniBucketedItemTracker
, as it takes a bucket as first param.
We also don't have the context of the tracker
instance in the tracker itself, which would prevent actually moving this into the generic SkyhanniBucketedItemTracker
, as we need to know the currently selected bucket;
ProfileStorageData.profileSpecific?.mining?.mineshaft?.corpseProfitTracker?.let {
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only way I could think to do this was using the currently-selected bucket.
I was not expecting anything more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about abstracting the existing item tracker class and creating a new "single bucketed tracker" for everything else?
tracker.addItem(it, event.internalName, event.amount) | ||
ChatUtils.chat("Added ${event.internalName.itemName} §8x${event.amount} to Corpse Tracker §8(${it.displayName}§8)§e.") | ||
} ?: ChatUtils.chat( | ||
"§cYou do not have a Corpse Type selected, and cannot add loot to this tracker generically.\n" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this will clash with the default answer messages from /shedittracker
@@ -36,7 +36,7 @@ class SkyHanniBucketedItemTracker<E : Enum<E>, BucketedData : BucketedItemTracke | |||
addItem(bucket, SKYBLOCK_COIN, coins) | |||
} | |||
|
|||
fun addItem(bucket: E, internalName: NEUInternalName, amount: Int) { | |||
fun addItem(bucket: E, internalName: NEUInternalName, amount: Int, manuallyAdded: Boolean = false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as mentioned before, i recomment moving this into skyhanni item tracker, avoiding the code duplication alltogether
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, it is working, it just isn't updating until something else triggers the tracker. Which, seems weird, but also I have up until now been unable to fix this, and can't get it to update when |
moving it t0 0.28 for now |
This pull request has conflicts with the base branch "beta". Please resolve those so we can test out your changes. |
I'm gonna close this out. I truly can't figure out what's going wrong with the |
What
Because
CorpseTracker
uses separated logic and buckets, it didn't fit the generic/shedititemtracker
logic. This PR adds separate logic for it.Changelog Improvements
/shedittracker
on Corpse Profit Tracker. - Daveed