mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-20 12:19:47 +00:00
Fix soil item model and start to move craftgui
This commit is contained in:
1 parent
de2dc3dabb
commit
3ed915f9d5
12 files changed
+14
-16
No files matched your search
@@ -0,0 +1,28 @@
|
||||
package binnie.botany.craftgui;
|
||||
|
||||
import binnie.botany.api.IFlowerColour;
|
||||
import binnie.craftgui.controls.listbox.ControlList;
|
||||
import binnie.craftgui.controls.listbox.ControlTextOption;
|
||||
import binnie.craftgui.core.Attribute;
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import binnie.craftgui.core.geometry.CraftGUIUtil;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
|
||||
public class ControlColourOption extends ControlTextOption<IFlowerColour> {
|
||||
ControlColourDisplay controlBee;
|
||||
IPoint boxPosition;
|
||||
|
||||
public ControlColourOption(final ControlList<IFlowerColour> controlList, final IFlowerColour option, final int y) {
|
||||
super(controlList, option, option.getColourName(), y);
|
||||
this.setSize(new IPoint(this.getSize().x(), 20.0f));
|
||||
(this.controlBee = new ControlColourDisplay(this, 2.0f, 2.0f)).setValue(option);
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
CraftGUIUtil.moveWidget(this.textWidget, new IPoint(22.0f, 0.0f));
|
||||
this.textWidget.setSize(this.textWidget.getSize().sub(new IPoint(24.0f, 0.0f)));
|
||||
final int th = (int) CraftGUI.Render.textHeight(this.textWidget.getValue(), this.textWidget.getSize().x());
|
||||
final int height = Math.max(20, th + 6);
|
||||
this.setSize(new IPoint(this.size().x(), height));
|
||||
this.textWidget.setSize(new IPoint(this.textWidget.getSize().x(), height));
|
||||
this.boxPosition = new IPoint(2.0f, (height - 18) / 2);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user