mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-18 11:29:23 +00:00
Auto-format spaces to tabs (#2)
This commit is contained in:
1 parent
25be7fd254
commit
5bb4b5d9a5
756 files changed
+49198
-48489
No files matched your search
@@ -9,25 +9,25 @@ import binnie.craftgui.core.geometry.IPoint;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
|
||||
class ControlSpeciexBoxOption extends ControlTextOption<IAlleleSpecies> {
|
||||
private ControlDatabaseIndividualDisplay controlBee;
|
||||
private ControlDatabaseIndividualDisplay controlBee;
|
||||
|
||||
public ControlSpeciexBoxOption(final ControlList<IAlleleSpecies> controlList, final IAlleleSpecies option, final int y) {
|
||||
super(controlList, option, option.getName(), y);
|
||||
this.setSize(new IPoint(this.getSize().x(), 20.0f));
|
||||
(this.controlBee = new ControlDatabaseIndividualDisplay(this, 2.0f, 2.0f)).setSpecies(this.getValue(), EnumDiscoveryState.Undetermined);
|
||||
if (this.controlBee.discovered == EnumDiscoveryState.Discovered) {
|
||||
this.controlBee.discovered = EnumDiscoveryState.Show;
|
||||
}
|
||||
this.textWidget.setValue((this.controlBee.discovered == EnumDiscoveryState.Show) ? option.getName() : "Undiscovered");
|
||||
if (this.controlBee.discovered == EnumDiscoveryState.Show) {
|
||||
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.controlBee.setPosition(new IPoint(this.controlBee.pos().x(), (height - 18) / 2));
|
||||
}
|
||||
public ControlSpeciexBoxOption(final ControlList<IAlleleSpecies> controlList, final IAlleleSpecies option, final int y) {
|
||||
super(controlList, option, option.getName(), y);
|
||||
this.setSize(new IPoint(this.getSize().x(), 20.0f));
|
||||
(this.controlBee = new ControlDatabaseIndividualDisplay(this, 2.0f, 2.0f)).setSpecies(this.getValue(), EnumDiscoveryState.Undetermined);
|
||||
if (this.controlBee.discovered == EnumDiscoveryState.Discovered) {
|
||||
this.controlBee.discovered = EnumDiscoveryState.Show;
|
||||
}
|
||||
this.textWidget.setValue((this.controlBee.discovered == EnumDiscoveryState.Show) ? option.getName() : "Undiscovered");
|
||||
if (this.controlBee.discovered == EnumDiscoveryState.Show) {
|
||||
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.controlBee.setPosition(new IPoint(this.controlBee.pos().x(), (height - 18) / 2));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user