BdLib

BdLib

97M Downloads

major refactor of WidgetContainer chain ..

piotrb opened this issue ยท 6 comments

commented

I'm trying to extend it and its being a huge pain ..

I want to add a new method to it, a second variant of draw, right now draw is meant for drawing the "active" part of the widget, I want to have 2 parts to a widget, the passive and the active one. The passive is drawn along with the window background from drawGuiContainerBackgroundLayer

I plan to extend all your widgets, but if you're willing I'd rather just pull request a refactor and integrate this background layer rendering right at its core.

commented

How do you work easily with bdlib in local dev? Right now I just pull it from your maven ...

commented

Does that help - 26137a8?

For dev environment i just manually remove it as a library and add as a source folder in IDEA module settings when i want to work on it.

commented

That looks like a great start, I'll get back to you how well that integrates .. build 30 here I go ;)

commented

Close ... only one bit missing .. the background rendering needs to be wrapped in a translate, otherwise it is not oriented into the gui itself .. had to hack that into my initial attempt ..

Simple enough:

GL11.glPushMatrix
GL11.glTranslatef(this.guiLeft.toFloat, this.guiTop.toFloat, 0.0F)
// render the stuff
GL11.glPopMatrix

You do seem to have something simillar, but it doesn't seem to have any effect ..

Not sure if its my use of subcontainers in the inventory grid or what .. maybe have a quick look at my code ..

piotrb/hamcraft@9c58763

commented

Thanks, all fixed

commented

The issue was that for drawGuiContainerForegroundLayer() this translation was done by vanilla code but drawGuiContainerBackgroundLayer() happens before that so i had to add it manually. Should work now