mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-19 19:59:49 +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
@@ -2,7 +2,11 @@ package binnie.extrabees.gui.database;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.craftgui.controls.core.Control;
|
||||
import binnie.craftgui.core.*;
|
||||
import binnie.craftgui.core.Attribute;
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import binnie.craftgui.core.ITooltip;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.Tooltip;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.resource.minecraft.CraftGUITexture;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
@@ -14,49 +18,49 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ControlBiomes extends Control implements ITooltip {
|
||||
List<Integer> tolerated;
|
||||
List<Integer> tolerated;
|
||||
|
||||
public ControlBiomes(final IWidget parent, final int x, final int y, final int width, final int height) {
|
||||
super(parent, x, y, width * 16, height * 16);
|
||||
this.tolerated = new ArrayList<>();
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
}
|
||||
public ControlBiomes(final IWidget parent, final int x, final int y, final int width, final int height) {
|
||||
super(parent, x, y, width * 16, height * 16);
|
||||
this.tolerated = new ArrayList<>();
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip list) {
|
||||
if (this.tolerated.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
final int x = (int) (this.getRelativeMousePosition().x() / 16.0f);
|
||||
final int y = (int) (this.getRelativeMousePosition().y() / 16.0f);
|
||||
final int i = x + y * 8;
|
||||
if (i < this.tolerated.size()) {
|
||||
Biome biome = Biome.getBiome(this.tolerated.get(i));
|
||||
if (biome != null) {
|
||||
list.add(biome.getBiomeName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void getTooltip(final Tooltip list) {
|
||||
if (this.tolerated.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
final int x = (int) (this.getRelativeMousePosition().x() / 16.0f);
|
||||
final int y = (int) (this.getRelativeMousePosition().y() / 16.0f);
|
||||
final int i = x + y * 8;
|
||||
if (i < this.tolerated.size()) {
|
||||
Biome biome = Biome.getBiome(this.tolerated.get(i));
|
||||
if (biome != null) {
|
||||
list.add(biome.getBiomeName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderForeground() {
|
||||
for (int i = 0; i < this.tolerated.size(); ++i) {
|
||||
final int x = i % 8 * 16;
|
||||
final int y = i / 8 * 16;
|
||||
if (Biome.getBiome(i) != null) {
|
||||
//TODO FIND COLOR
|
||||
//CraftGUI.Render.colour(Biome.getBiome(i).color);
|
||||
}
|
||||
CraftGUI.Render.texture(CraftGUITexture.Button, new IArea(x, y, 16.0f, 16.0f));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onRenderForeground() {
|
||||
for (int i = 0; i < this.tolerated.size(); ++i) {
|
||||
final int x = i % 8 * 16;
|
||||
final int y = i / 8 * 16;
|
||||
if (Biome.getBiome(i) != null) {
|
||||
//TODO FIND COLOR
|
||||
//CraftGUI.Render.colour(Biome.getBiome(i).color);
|
||||
}
|
||||
CraftGUI.Render.texture(CraftGUITexture.Button, new IArea(x, y, 16.0f, 16.0f));
|
||||
}
|
||||
}
|
||||
|
||||
public void setSpecies(final IAlleleBeeSpecies species) {
|
||||
this.tolerated.clear();
|
||||
if (species == null) {
|
||||
return;
|
||||
}
|
||||
final IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(Binnie.Genetics.getBeeRoot().getTemplate(species.getUID()));
|
||||
final IBee bee = Binnie.Genetics.getBeeRoot().getBee(genome);
|
||||
}
|
||||
public void setSpecies(final IAlleleBeeSpecies species) {
|
||||
this.tolerated.clear();
|
||||
if (species == null) {
|
||||
return;
|
||||
}
|
||||
final IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(Binnie.Genetics.getBeeRoot().getTemplate(species.getUID()));
|
||||
final IBee bee = Binnie.Genetics.getBeeRoot().getBee(genome);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user