in buildinterfacemenu, just check if the button you're hovering over has a popup interface, and then draw the interface same way as the drawtabarea interface
|
Hello rune-server members, today i come baring questions, as usual haha. Thank you in advance for any support:
Currently i am trying to draw a box inside the frame upon hovering over the "I" icon. I want to draw the box inside the black frames. Currently i have a version that process to cfheck if tabid 7 is open, then it checks if ur mouse is over the sprite that i want to hover over. After that i draw the box, so it kinda works right now but i contiuallsy keep drawing the box while i am hovering when i just want it to show untill u no longer are hovering.. i removed my code because im 100% sure i don't need to process the hvoer interaction...
heres a small image..
please note i do not want to click the hover icon then draw the interface if i did i would just create a non visble interface...
in buildinterfacemenu, just check if the button you're hovering over has a popup interface, and then draw the interface same way as the drawtabarea interface
I'm not sure what you mean by popup interface but if you reffering to the actual hover sprite, then I originally had this in buildinterface
Using thisCode:private void buildInterfaceMenu(int i, Widget widget, int k, int l, int i1, int j1) { if (widget == null || widget.type != 0 || widget.children == null || widget.invisible || widget.drawingDisabled) return; if (k < i || i1 < l || k > i + widget.width || i1 > l + widget.height) return; int size = widget.children.length; for (int l1 = 0; l1 < size; l1++) { int i2 = widget.childX[l1] + i; int j2 = (widget.childY[l1] + l) - j1; Widget childInterface = Widget.interfaceCache[widget.children[l1]]; if (childInterface == null) { continue; } i2 += childInterface.horizontalOffset; j2 += childInterface.verticalOffset; if ((childInterface.hoverType >= 0 || childInterface.defaultHoverColor != 0) && k >= i2 && i1 >= j2 && k < i2 + childInterface.width && i1 < j2 + childInterface.height) if (childInterface.hoverType >= 0) anInt886 = childInterface.hoverType; else anInt886 = childInterface.id; if (tabId == 7 && Client.instance.hover(712, 212, Client.cacheSprite[792])) { System.out.println("hit hover, draw overlay.");
to check if im hovering i get this result...Code:if (tabId == 7 && Client.instance.hover(712, 212, Client.cacheSprite[792])) {
Ok so then you can tell it to draw the overlay. After the tab area is rendered, make it draw the hover the same way as the tab interface.
Client.instance.hover(712, 212, Client.cacheSprite[792]
What is that function?
You shouldn't hardcode it like that because it wont work in fullscreen/resizable. And all the code for checking if the button is hovered is already there for you.
In buildInterfaceMenu
That will check if the component type is 1 (button) and the mouse is inside the component's boundaries. It will set the menu actions.Code:if (class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
So in there you can just make it check if that component should render a hover interface, and set your variable to render it.
If I understood correctly u want stuff to showup when u hover over... like it does show the spell requirements in the spellbook. - why not do it the same way then?
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |