Jump to content

Making a custom weapon gauge that fills up by successful attacks


Misskeisha

Recommended Posts

Well what the title suggests basically, ive searched everywhere, reading for the answer havent found anything maybe im missing something.The goal is a bar that either

shows on the items hud slot when you hold it or at least the tooltip that slowly fills up when you hit enemies.Any ideas or recommendations are aprreciated.

Link to comment
Share on other sites

Create an IItemDecorator and attach it for your item via RegisterItemDecorationsEvent on the mod bud if you want it on the item hud. On the tooltip, you can use RenderTooltipEvent$GatherComponents on the forge event bus to add your specific thing to the tooltip. If you want something custom to render for the tooltip, you can create a new ClientTooltipComponent and register it via RegisterClientTooltipComponentFactoriesEvent on the mod event bus.

Link to comment
Share on other sites

  • 2 months later...

A bit of a late answer but im still stuck on this, especially since i took a break from coding.In my weapons class ive created the meter for the gauge(how it should go up and when etc),then used the hover text method but used the console to show me the bar going up everytime i hit sth(worked).I dont get how ill make it render the bar in game (in tooltip) ive made and how it can fill up without me creating a thousand textures and such(i guess i need vector knowledge which i cant find anywhere).As of now ive just made, again inside of the weapons class, a new ClientTooltipComponent but dont know what to do as of it having the png file ive made to show the gauge and how i will make it reference the counter.Heres the GitHub link

https://github.com/MissKeisha1/RPGMOD

Edited by Misskeisha
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.