-
Notifications
You must be signed in to change notification settings - Fork 180
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
Reworked the Badge system, added badge for RecipePower #537
Conversation
I have a couple of remarks regarding this PR.
{
"badges": [
{
"sprite": "origins:textures/gui/badge/active.png",
"text": "Active ability, use with %s."
},
{
"sprite": "origins:textures/gui/badge/info.png",
"text": "Cooldown: 15 seconds."
}
]
} Now, since before there was no distinction in badge types, all badges had the key binding associated with the power inserted into the formatting and replacing the
{
"type": "origins:key_binding",
"sprite": "origins:textures/gui/badge/active.png",
"text": "Interact with an entity using %s to suck blood.",
"key": "key.use"
} b) {
"type": "origins:crafting_recipe",
"sprite": "origins:textures/gui/badge/recipe.png",
"text": "You probably know this, but this is how you craft ladders:",
"recipe": "minecraft:ladder"
}
Thanks for your work on this PR, it's looking really good already and is a huge step towards making Origins both more extensible and user-friendly. :) |
|
Badges were almost completely hardcoded, so I reworked the whole system so it can work dynamically and accept more functions:
Badge
now work as a supplier of a list ofTooltipComponent
on the client side, providing fully customizable tooltip renderBadgeFactory
to define different type ofBadge
BadgeManager
now useBadgeFactory.Instance
(basically work as a supplier ofBadge
) to store and passBadge
between server side and client sideOriginDisplayScreen
now hold atime
field, so animated badge tooltips become possible (currently used for showing compound ingredients inRecipeBadge
's tooltip)Current implemented badges:
Badge
: a sprite without any tooltipsTooltipBadge
: have tooltipsKeyBindingBadge
: have tooltips which may show key binding namesCraftingRecipeBadge
: have tooltips, may show a 3x3 crafting recipeFurther work:
Make a callback for auto badges so addons can register(Done)