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

View milestones in /vote gui #1396

Open
TomLewis opened this issue Nov 22, 2024 · 5 comments
Open

View milestones in /vote gui #1396

TomLewis opened this issue Nov 22, 2024 · 5 comments
Labels
Possible Feature Possible future feature

Comments

@TomLewis
Copy link

TomLewis commented Nov 22, 2024

Can we please get a way to check milestones in-game as a player, via maybe /vote gui, so that they can see how far they have come and to track how many more they can do.

Also when I add new vote milestones, are these atomatically given to players that supassed the milestones already? How/when are these milestones being triggerd when the vote?

You could add lore to the milestone yaml so thats shown as the lore:

  '15000':
    Enabled: true
    DisplayName: '&a&lVote 21'
    DisplayLore:
    - '&7You have voted 21 times!'
    - '&7Click to receive your reward!'
    Rewards:
      Money: 15000
      Messages:
        Player: '&8[&3VOTE&8] &aYou got %milestone% milestone votes!'
      Commands:
        Console:
        - crate give to %player% vote 21
@TomLewis TomLewis added the Possible Feature Possible future feature label Nov 22, 2024
@BenCodez
Copy link
Owner

These placeholderapi placeholders are available

votingplugin_milestonecount - User milestonecount
votingplugin_milestone_numberofvotesuntil_20 - Get number of votes until milestone
votingplugin_milestone_numberofvotesuntil_1 - Get number of votes until milestone
votingplugin_nextmilestone_votes_required - Get number of votes required for next available milestone
votingplugin_nextmilestone_votes_until - Get number of votes until next available milestone

@TomLewis
Copy link
Author

TomLewis commented Nov 23, 2024

2024-11-23_22 42 41

I started making a custom GUI for this out of those placeholders, but theres an issue. The first time you load these placeholders, they do not work. It shows some dots.

This happens every single time you log out and in-again, which means if I have a dynamic Deluxe Menus that shows custom blocks based on if you have unlocked a milestone or not, it will show incorrectly with nothing, you would have to as a user open the GUI, close it and open it again for these to load...

If I close the panel and re-open it, its fine, until I relog.
2024-11-23_22 45 18

@BenCodez
Copy link
Owner

https://github.com/BenCodez/VotingPlugin/wiki/PlaceHolderAPI-Expansion

Add _process to the end of the placeholder.

After a server restart it should stay cached though without that

@TomLewis
Copy link
Author

TomLewis commented Nov 23, 2024

Fantastic, that worked without having to restart, doing this all on my local dev server atm.

Are there any performance issues with this?

@BenCodez
Copy link
Owner

It just might trigger a mysql query, so try to avoid using that on the main thread, it can crash the server in rare cases. That's why it's disabled by default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Possible Feature Possible future feature
Projects
None yet
Development

No branches or pull requests

2 participants