Skip to content
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

Fixed a quickslot refreshing bug #7

Closed

Conversation

LucasDelvallet
Copy link

Fixed the bug which occurs when taking loots from monsters. It didn't refresh the quickslots if one of the looted item was on one of the quickslot.

Fixed the bug which occurs when taking loots from monsters. It didn't refresh the quickslots if one of the looted item was on one of the quickslot.
@Zukero
Copy link
Owner

Zukero commented Feb 23, 2015

While I have no doubt this works, it really looks like a dirty hack.

IMHO, the place to do it would be in the public void pickupAll(Loot loot) method. You could then check if one of the looted items were used in one of the quickslots, and call quickSlotListeners.onQuickSlotChanged(index); if needed.

More over, for this to be complete, it should also be triggered when picking-up a single item from a loot list. See in Dialogs.java the following method: private static void showLoot(final MainActivity mainActivity, final ControllerContext controllers, final WorldContext world, final Loot combinedLoot, final Iterable<Loot> lootBags, final int title, final String msg). It should delegate most of its job to the controller, for example by creating a pickupItem(ItemType type, int qty).
I reckon, this one's not your fault, but as long as you're working in this area, I couldn't hurt to bring some more consistency to the code :D

@LucasDelvallet
Copy link
Author

We have corrected our implementation of the correction. Now we are using the quickSlotListener to notify the quickItemView we have taken a looted item. If the item is on one of the quickSlot, we refresh the quickSlots. If not, we do nothing.

We have also delegated some of the job of the showLoot method present in dialogs.java to a pickupItem method in the ItemController, but we are not sure if it's correct.

@Zukero
Copy link
Owner

Zukero commented Jan 22, 2017

I implemented another simple fix for this recently.
I forgot about this PR.
Closing. Thanks for your submission.

@Zukero Zukero closed this Jan 22, 2017
Zukero pushed a commit that referenced this pull request Oct 30, 2018
Chriz76 pushed a commit to Chriz76/andors-trail that referenced this pull request Mar 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants