Skip to content

Cargo Hold Tracker: Restore Deposit-All Tracking#240

Open
BBeeaarr wants to merge 2 commits intoLlemonDuck:mainfrom
BBeeaarr:cargohold-fix-deposit-all
Open

Cargo Hold Tracker: Restore Deposit-All Tracking#240
BBeeaarr wants to merge 2 commits intoLlemonDuck:mainfrom
BBeeaarr:cargohold-fix-deposit-all

Conversation

@BBeeaarr
Copy link
Copy Markdown

Closes #177
java_MIIZeoZ1et

  • Uses onSoundEffectPlayed event as the source of truth for the confirmation of a successful quick-deposit
    • Sound effect with ID = 10905 is played upon a successful quick deposit (sent from server)
    • This SFX event is only fired when the client is not muted so we unmute the client to enable the event to post
    • uses consume method to avoid playing SFX for players who play with 0 volume
  • Upon clicking Deposit-all unmute the client anticipating SFX with ID = 10905 and memoize player inventory
  • Durable through inventory changes that occur between clicking Deposit-all and the deposit action

private static final int SFX_DEPOSIT_ALL_ID = 10905;
private static final int DEPOSIT_ALL_MAX_TICKS_TIMEOUT = 12;
private int depositAllTicksRemaining;
private Multiset<Integer> initialDepositAllInventory;
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be able to use memoizedInventory instead here

private int previousSfxVolume = -1;
private static final int SFX_OVERRIDE_VOLUME = 1;
private static final int SFX_DEPOSIT_ALL_ID = 10905;
private static final int DEPOSIT_ALL_MAX_TICKS_TIMEOUT = 12;
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

12 ticks gives ~5 seconds for the deposit to occur. Can adjust if necessary

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.

Cargo hold tracking does not detect items added via quick-deposit menu option

1 participant