mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-27 23:46:05 +00:00
Clean Up More Gui Classes
This commit is contained in:
1 parent
ab1a2eeb89
commit
34fda5ddd1
49 files changed
+228
-221
No files matched your search
@@ -18,8 +18,8 @@ import binnie.core.gui.resource.minecraft.StandardTexture;
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
public class ControlColorMixSymbol extends Control implements ITooltip {
|
||||
static Texture MutationPlus = new StandardTexture(2, 94, 16, 16, CraftGUITextureSheet.Controls2);
|
||||
static Texture MutationArrow = new StandardTexture(20, 94, 32, 16, CraftGUITextureSheet.Controls2);
|
||||
static Texture MutationPlus = new StandardTexture(2, 94, 16, 16, CraftGUITextureSheet.CONTROLS_2);
|
||||
static Texture MutationArrow = new StandardTexture(20, 94, 32, 16, CraftGUITextureSheet.CONTROLS_2);
|
||||
IColorMix value;
|
||||
int type;
|
||||
|
||||
|
||||
@@ -5,22 +5,22 @@ import forestry.api.genetics.EnumTolerance;
|
||||
import forestry.api.genetics.IAllele;
|
||||
|
||||
public enum Tolerance {
|
||||
None(0, 0),
|
||||
Both1(-1, 1),
|
||||
Both2(-2, 2),
|
||||
Both3(-3, 3),
|
||||
Both4(-4, 4),
|
||||
Both5(-5, 5),
|
||||
Up1(0, 1),
|
||||
Up2(0, 2),
|
||||
Up3(0, 3),
|
||||
Up4(0, 4),
|
||||
Up5(0, 5),
|
||||
Down1(-1, 0),
|
||||
Down2(-2, 0),
|
||||
Down3(-3, 0),
|
||||
Down4(-4, 0),
|
||||
Down5(-5, 0);
|
||||
NONE(0, 0),
|
||||
BOTH_1(-1, 1),
|
||||
BOTH_2(-2, 2),
|
||||
BOTH_3(-3, 3),
|
||||
BOTH_4(-4, 4),
|
||||
BOTH_5(-5, 5),
|
||||
UP_1(0, 1),
|
||||
UP_2(0, 2),
|
||||
UP_3(0, 3),
|
||||
UP_4(0, 4),
|
||||
UP_5(0, 5),
|
||||
DOWN_1(-1, 0),
|
||||
DOWN_2(-2, 0),
|
||||
DOWN_3(-3, 0),
|
||||
DOWN_4(-4, 0),
|
||||
DOWN_5(-5, 0);
|
||||
|
||||
private int[] bounds;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ public final class BinnieGUIHandler implements IGuiHandler {
|
||||
@Override
|
||||
@Nullable
|
||||
public final Object getServerGuiElement(final int id, final EntityPlayer player, final World world, final int x, final int y, final int z) {
|
||||
final Window window = this.getWindow(id, player, world, x, y, z, Side.SERVER);
|
||||
Window window = this.getWindow(id, player, world, x, y, z, Side.SERVER);
|
||||
if (window == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -38,7 +38,7 @@ public final class BinnieGUIHandler implements IGuiHandler {
|
||||
if (BinnieCore.getBinnieProxy().isSimulating(world)) {
|
||||
return this.getServerGuiElement(id, player, world, x, y, z);
|
||||
}
|
||||
final Window window = this.getWindow(id, player, world, x, y, z, Side.CLIENT);
|
||||
Window window = this.getWindow(id, player, world, x, y, z, Side.CLIENT);
|
||||
if (window == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -47,7 +47,7 @@ public final class BinnieGUIHandler implements IGuiHandler {
|
||||
|
||||
@Nullable
|
||||
public Window getWindow(final int id, final EntityPlayer player, final World world, final int x, final int y, final int z, final Side side) {
|
||||
for (final IBinnieGUID guid : this.mod.getGUIDs()) {
|
||||
for (IBinnieGUID guid : this.mod.getGUIDs()) {
|
||||
if (guid.ordinal() == id) {
|
||||
return guid.getWindow(player, world, x, y, z, side);
|
||||
}
|
||||
|
||||
@@ -12,5 +12,5 @@ import binnie.core.network.IOrdinaled;
|
||||
|
||||
public interface IBinnieGUID extends IOrdinaled {
|
||||
@Nullable
|
||||
Window getWindow(final EntityPlayer player, final World world, final int x, final int y, final int z, final Side side);
|
||||
Window getWindow(EntityPlayer player, World world, int x, int y, int z, Side side);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
package binnie.core.gui;
|
||||
|
||||
public interface ITooltip {
|
||||
void getTooltip(final Tooltip p0);
|
||||
void getTooltip(Tooltip tooltip);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
package binnie.core.gui;
|
||||
|
||||
public interface ITooltipHelp {
|
||||
void getHelpTooltip(final Tooltip p0);
|
||||
void getHelpTooltip(Tooltip tooltip);
|
||||
}
|
||||
@@ -155,7 +155,7 @@ public interface IWidget {
|
||||
@Nullable
|
||||
Area getCroppedZone();
|
||||
|
||||
void setCroppedZone(final IWidget p0, final Area p1);
|
||||
void setCroppedZone(IWidget widget, Area area);
|
||||
|
||||
boolean isCroppedWidet();
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ public class Tooltip {
|
||||
|
||||
public Tooltip() {
|
||||
this.tooltip = new ArrayList<>();
|
||||
this.type = Type.Standard;
|
||||
this.type = Type.STANDARD;
|
||||
this.maxWidth = 256;
|
||||
}
|
||||
|
||||
@@ -87,11 +87,11 @@ public class Tooltip {
|
||||
}
|
||||
|
||||
public enum Type implements ITooltipType {
|
||||
Standard,
|
||||
Help,
|
||||
Information,
|
||||
User,
|
||||
Power
|
||||
STANDARD,
|
||||
HELP,
|
||||
INFORMATION,
|
||||
USER,
|
||||
POWER
|
||||
}
|
||||
|
||||
public interface ITooltipType {
|
||||
|
||||
@@ -40,6 +40,7 @@ import binnie.core.gui.minecraft.control.ControlItemDisplay;
|
||||
import binnie.core.gui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.gui.minecraft.control.ControlTabIcon;
|
||||
import binnie.core.gui.window.Panel;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.genetics.gui.ControlGenesisOption;
|
||||
|
||||
public class WindowGenesis extends Window {
|
||||
@@ -66,7 +67,7 @@ public class WindowGenesis extends Window {
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
new ControlPlayerInventory(this);
|
||||
this.setTitle("Genesis");
|
||||
this.setTitle(I18N.localise("binniecore.gui.genesis.title"));
|
||||
final ControlTabBar<BreedingSystem> tabSystems = new ControlTabBar<BreedingSystem>(this, 8, 28, 23, 100, Position.LEFT, Binnie.GENETICS.getActiveSystems()) {
|
||||
@Override
|
||||
public ControlTab<BreedingSystem> createTab(final int x, final int y, final int w, final int h, final BreedingSystem value) {
|
||||
@@ -116,22 +117,26 @@ public class WindowGenesis extends Window {
|
||||
tabSystems.addEventHandler(new EventValueChanged.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventValueChanged event) {
|
||||
WindowGenesis.this.root = ((BreedingSystem) event.getValue()).getSpeciesRoot();
|
||||
WindowGenesis.this.template = WindowGenesis.this.root.getDefaultTemplate();
|
||||
WindowGenesis.this.refreshTemplate(null);
|
||||
root = ((BreedingSystem) event.getValue()).getSpeciesRoot();
|
||||
template = root.getDefaultTemplate();
|
||||
refreshTemplate(null);
|
||||
}
|
||||
}.setOrigin(EventHandler.Origin.SELF, tabSystems));
|
||||
this.geneList.addEventHandler(new EventValueChanged.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventValueChanged event) {
|
||||
final Map<IChromosomeType, List<IAllele>> map = Binnie.GENETICS.getChromosomeMap(WindowGenesis.this.root);
|
||||
final List<Gene> opts = new ArrayList<>();
|
||||
final IChromosomeType chromo = event.value != null ? ((Gene) event.value).getChromosome() : null;
|
||||
if (chromo != null)// fix NPE
|
||||
for (final IAllele allele : map.get(chromo)) {
|
||||
opts.add(new Gene(allele, chromo, WindowGenesis.this.root));
|
||||
}
|
||||
WindowGenesis.this.geneOptions.setOptions(opts);
|
||||
if(event.value == null){
|
||||
return;
|
||||
}
|
||||
Map<IChromosomeType, List<IAllele>> map = Binnie.GENETICS.getChromosomeMap(root);
|
||||
List<Gene> options = new ArrayList<>();
|
||||
Gene gene = (Gene) event.value;
|
||||
IChromosomeType chromosomeType = gene.getChromosome();
|
||||
List<IAllele> alleles = map.get(chromosomeType);
|
||||
for (IAllele allele : alleles) {
|
||||
options.add(new Gene(allele, chromosomeType, root));
|
||||
}
|
||||
geneOptions.setOptions(options);
|
||||
}
|
||||
}.setOrigin(EventHandler.Origin.SELF, this.geneList));
|
||||
this.geneOptions.addEventHandler(new EventValueChanged.Handler() {
|
||||
@@ -140,33 +145,32 @@ public class WindowGenesis extends Window {
|
||||
if (event.value == null) {
|
||||
return;
|
||||
}
|
||||
final IChromosomeType chromo = ((Gene) event.value).getChromosome();
|
||||
Gene gene = (Gene) event.value;
|
||||
IChromosomeType chromosomeType = gene.getChromosome();
|
||||
IAllele allele = ((Gene) event.value).getAllele();
|
||||
WindowGenesis.this.template[chromo.ordinal()] = allele;
|
||||
template[chromosomeType.ordinal()] = allele;
|
||||
ISpeciesRoot speciesRoot = ((Gene) event.value).getSpeciesRoot();
|
||||
if (chromo == speciesRoot.getSpeciesChromosomeType()) {
|
||||
WindowGenesis.this.template = speciesRoot.getTemplate(allele.getUID());
|
||||
if (chromosomeType == speciesRoot.getSpeciesChromosomeType()) {
|
||||
template = speciesRoot.getTemplate(allele.getUID());
|
||||
}
|
||||
WindowGenesis.this.refreshTemplate(chromo);
|
||||
refreshTemplate(chromosomeType);
|
||||
}
|
||||
}.setOrigin(EventHandler.Origin.SELF, this.geneOptions));
|
||||
this.panelPickup = new Panel(this, 16, 140, 60, 42, MinecraftGUI.PanelType.Black);
|
||||
this.refreshTemplate(null);
|
||||
}
|
||||
|
||||
private void refreshTemplate(@Nullable final IChromosomeType selection) {
|
||||
final List<Gene> genes = new ArrayList<>();
|
||||
final IChromosomeType[] arr$;
|
||||
final IChromosomeType[] chromos = arr$ = Binnie.GENETICS.getChromosomeMap(this.root).keySet().toArray(new IChromosomeType[0]);
|
||||
for (final IChromosomeType type : arr$) {
|
||||
final IAllele allele = this.template[type.ordinal()];
|
||||
private void refreshTemplate(@Nullable IChromosomeType selection) {
|
||||
List<Gene> genes = new ArrayList<>();
|
||||
IChromosomeType[] chromosomeTypes = Binnie.GENETICS.getChromosomeMap(this.root).keySet().toArray(new IChromosomeType[0]);
|
||||
for (IChromosomeType type : chromosomeTypes) {
|
||||
IAllele allele = this.template[type.ordinal()];
|
||||
if (allele == null) {
|
||||
throw new NullPointerException("Allele missing for Chromosome " + type.getName());
|
||||
}
|
||||
genes.add(new Gene(allele, type, this.root));
|
||||
}
|
||||
final Map<IChromosomeType, List<IAllele>> map = Binnie.GENETICS.getChromosomeMap(this.root);
|
||||
this.geneList.setOptions(genes);
|
||||
geneList.setOptions(genes);
|
||||
if (selection != null) {
|
||||
this.geneList.setValue(new Gene(this.template[selection.ordinal()], selection, this.root));
|
||||
} else {
|
||||
@@ -178,11 +182,12 @@ public class WindowGenesis extends Window {
|
||||
private void refreshPickup() {
|
||||
this.panelPickup.deleteAllChildren();
|
||||
int i = 0;
|
||||
for (final ISpeciesType type : Binnie.GENETICS.getSystem(this.root).getActiveTypes()) {
|
||||
final IIndividual ind = this.root.templateAsIndividual(this.template);
|
||||
BreedingSystem system = Binnie.GENETICS.getSystem(this.root);
|
||||
for (ISpeciesType type : system.getActiveTypes()) {
|
||||
IIndividual ind = this.root.templateAsIndividual(this.template);
|
||||
ind.analyze();
|
||||
final ItemStack stack = this.root.getMemberStack(ind, type);
|
||||
final ControlItemDisplay display = new ControlItemDisplay(this.panelPickup, 4 + i % 3 * 18, 4 + i / 3 * 18);
|
||||
ItemStack stack = this.root.getMemberStack(ind, type);
|
||||
ControlItemDisplay display = new ControlItemDisplay(this.panelPickup, 4 + i % 3 * 18, 4 + i / 3 * 18);
|
||||
display.setItemStack(stack);
|
||||
display.setTooltip();
|
||||
display.addEventHandler(new EventMouse.Down.Handler() {
|
||||
@@ -201,20 +206,20 @@ public class WindowGenesis extends Window {
|
||||
public void receiveGuiNBTOnServer(final EntityPlayer player, final String name, final NBTTagCompound nbt) {
|
||||
super.receiveGuiNBTOnServer(player, name, nbt);
|
||||
if (name.equals("genesis")) {
|
||||
final ItemStack stack = new ItemStack(nbt);
|
||||
final InventoryPlayer playerInv = player.inventory;
|
||||
ItemStack stack = new ItemStack(nbt);
|
||||
InventoryPlayer inventoryPlayer = player.inventory;
|
||||
ItemStack playerStack = inventoryPlayer.getItemStack();
|
||||
if (stack.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
if (playerInv.getItemStack().isEmpty()) {
|
||||
playerInv.setItemStack(stack);
|
||||
} else if (playerInv.getItemStack().isItemEqual(stack) && ItemStack.areItemStackTagsEqual(playerInv.getItemStack(), stack)) {
|
||||
final int fit = stack.getMaxStackSize() - (stack.getCount() + playerInv.getItemStack().getCount());
|
||||
if (playerStack.isEmpty()) {
|
||||
inventoryPlayer.setItemStack(stack);
|
||||
} else if (playerStack.isItemEqual(stack) && ItemStack.areItemStackTagsEqual(playerStack, stack)) {
|
||||
final int fit = stack.getMaxStackSize() - (stack.getCount() + playerStack.getCount());
|
||||
if (fit >= 0) {
|
||||
final ItemStack itemStack;
|
||||
final ItemStack rec = itemStack = stack;
|
||||
itemStack.grow(playerInv.getItemStack().getCount());
|
||||
playerInv.setItemStack(rec);
|
||||
ItemStack itemStack = stack;
|
||||
itemStack.grow(playerStack.getCount());
|
||||
inventoryPlayer.setItemStack(itemStack);
|
||||
}
|
||||
}
|
||||
player.openContainer.detectAndSendChanges();
|
||||
|
||||
@@ -62,9 +62,9 @@ public class ControlCheckbox extends Control implements IControlValue<Boolean> {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
Object texture = this.getValue() ? CraftGUITexture.CheckboxChecked : CraftGUITexture.Checkbox;
|
||||
Object texture = this.getValue() ? CraftGUITexture.CHECKBOX_CHECKED : CraftGUITexture.CHECKBOX;
|
||||
if (this.isMouseOver()) {
|
||||
texture = (this.getValue() ? CraftGUITexture.CheckboxCheckedHighlighted : CraftGUITexture.CheckboxHighlighted);
|
||||
texture = (this.getValue() ? CraftGUITexture.CHECKBOX_CHECKED_HIGHLIGHTED : CraftGUITexture.CHECKBOX_HIGHLIGHTED);
|
||||
}
|
||||
CraftGUI.RENDER.texture(texture, Point.ZERO);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class ControlTextEdit extends Control implements IControlValue<String> {
|
||||
|
||||
@Override
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.Slot, this.getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.SLOT, this.getArea());
|
||||
this.renderTextField();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package binnie.core.gui.controls;
|
||||
public interface IControlSelection<T> {
|
||||
T getSelectedValue();
|
||||
|
||||
void setSelectedValue(final T p0);
|
||||
void setSelectedValue(T value);
|
||||
|
||||
boolean isSelected(final IControlSelectionOption<T> p0);
|
||||
boolean isSelected(IControlSelectionOption<T> option);
|
||||
}
|
||||
@@ -61,11 +61,11 @@ public class ControlButton extends Control {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
Object texture = CraftGUITexture.ButtonDisabled;
|
||||
Object texture = CraftGUITexture.BUTTON_DISABLED;
|
||||
if (this.isMouseOver()) {
|
||||
texture = CraftGUITexture.ButtonHighlighted;
|
||||
texture = CraftGUITexture.BUTTON_HIGHLIGHTED;
|
||||
} else if (this.isEnabled()) {
|
||||
texture = CraftGUITexture.Button;
|
||||
texture = CraftGUITexture.BUTTON;
|
||||
}
|
||||
CraftGUI.RENDER.texture(texture, this.getArea());
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class ControlOption<T> extends Control implements IControlValue<T> {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderForeground(int guiWidth, int guiHeight) {
|
||||
if (this.isCurrentSelection()) {
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.Outline, this.getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.OUTLINE, this.getArea());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -73,11 +73,11 @@ public class ControlScrollBar extends Control {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
final Area renderArea = this.getRenderArea();
|
||||
Object texture = CraftGUITexture.ScrollDisabled;
|
||||
Object texture = CraftGUITexture.SCROLL_DISABLED;
|
||||
if (this.isMouseOver()) {
|
||||
texture = CraftGUITexture.ScrollHighlighted;
|
||||
texture = CraftGUITexture.SCROLL_HIGHLIGHTED;
|
||||
} else if (this.isEnabled()) {
|
||||
texture = CraftGUITexture.Scroll;
|
||||
texture = CraftGUITexture.SCROLL;
|
||||
}
|
||||
CraftGUI.RENDER.texture(texture, renderArea);
|
||||
}
|
||||
|
||||
@@ -73,17 +73,17 @@ public class ControlTab<T> extends Control implements ITooltip, IControlValue<T>
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
Object texture = CraftGUITexture.TabDisabled;
|
||||
Object texture = CraftGUITexture.TAB_DISABLED;
|
||||
if (this.isMouseOver()) {
|
||||
texture = CraftGUITexture.TabHighlighted;
|
||||
texture = CraftGUITexture.TAB_HIGHLIGHTED;
|
||||
} else if (this.isCurrentSelection()) {
|
||||
texture = CraftGUITexture.Tab;
|
||||
texture = CraftGUITexture.TAB;
|
||||
}
|
||||
final Texture lTexture = CraftGUI.RENDER.getTexture(texture);
|
||||
final Position position = this.getTabPosition();
|
||||
Texture iTexture = lTexture.crop(position, 8);
|
||||
final Area area = this.getArea();
|
||||
if (texture == CraftGUITexture.TabDisabled) {
|
||||
if (texture == CraftGUITexture.TAB_DISABLED) {
|
||||
if (position == Position.Top || position == Position.LEFT) {
|
||||
area.setPosition(area.getPosition().sub(new Point(4 * position.x(), 4 * position.y())));
|
||||
area.setSize(area.getSize().add(new Point(4 * position.x(), 4 * position.y())));
|
||||
@@ -95,13 +95,13 @@ public class ControlTab<T> extends Control implements ITooltip, IControlValue<T>
|
||||
if (this instanceof ControlTabIcon) {
|
||||
final ControlTabIcon icon = (ControlTabIcon) this;
|
||||
final ControlItemDisplay item = (ControlItemDisplay) getFirstChild();
|
||||
if (texture == CraftGUITexture.TabDisabled) {
|
||||
if (texture == CraftGUITexture.TAB_DISABLED) {
|
||||
item.setColor(-1431655766);
|
||||
} else {
|
||||
item.setColor(-1);
|
||||
}
|
||||
if (icon.hasOutline()) {
|
||||
iTexture = CraftGUI.RENDER.getTexture(CraftGUITexture.TabOutline);
|
||||
iTexture = CraftGUI.RENDER.getTexture(CraftGUITexture.TAB_OUTLINE);
|
||||
iTexture = iTexture.crop(position, 8);
|
||||
RenderUtil.setColour(icon.getOutlineColour());
|
||||
CraftGUI.RENDER.texture(iTexture, area.inset(2));
|
||||
|
||||
@@ -16,7 +16,7 @@ import binnie.core.gui.resource.minecraft.CraftGUITextureSheet;
|
||||
import binnie.core.gui.resource.minecraft.StandardTexture;
|
||||
|
||||
class ControlBreedingProgress extends Control {
|
||||
private static Texture Progress = new StandardTexture(80, 22, 4, 4, CraftGUITextureSheet.Controls2);
|
||||
private static Texture Progress = new StandardTexture(80, 22, 4, 4, CraftGUITextureSheet.CONTROLS_2);
|
||||
private float percentage;
|
||||
private int colour;
|
||||
|
||||
@@ -29,7 +29,7 @@ class ControlBreedingProgress extends Control {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.PanelBlack, this.getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.PANEL_BLACK, this.getArea());
|
||||
final Area area = this.getArea().inset(1);
|
||||
area.setSize(new Point(Math.round(area.size().xPos() * this.percentage), area.size().yPos()));
|
||||
RenderUtil.setColour(this.colour);
|
||||
|
||||
@@ -21,8 +21,8 @@ import binnie.core.gui.resource.minecraft.StandardTexture;
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
class ControlMutationSymbol extends Control implements ITooltip {
|
||||
private static Texture MutationPlus = new StandardTexture(2, 94, 16, 16, CraftGUITextureSheet.Controls2);
|
||||
private static Texture MutationArrow = new StandardTexture(20, 94, 32, 16, CraftGUITextureSheet.Controls2);
|
||||
private static Texture MutationPlus = new StandardTexture(2, 94, 16, 16, CraftGUITextureSheet.CONTROLS_2);
|
||||
private static Texture MutationArrow = new StandardTexture(20, 94, 32, 16, CraftGUITextureSheet.CONTROLS_2);
|
||||
private IMutation value;
|
||||
private boolean discovered;
|
||||
private int type;
|
||||
|
||||
@@ -3,26 +3,26 @@ package binnie.core.gui.events;
|
||||
import binnie.core.gui.IWidget;
|
||||
|
||||
public abstract class EventHandler<E extends Event> {
|
||||
Class<E> eventClass;
|
||||
Class<? extends E> eventClass;
|
||||
Origin origin;
|
||||
IWidget relative;
|
||||
|
||||
public EventHandler(final Class<E> eventClass) {
|
||||
public EventHandler(Class<? extends E> eventClass) {
|
||||
this.origin = Origin.ANY;
|
||||
this.relative = null;
|
||||
this.eventClass = eventClass;
|
||||
}
|
||||
|
||||
public EventHandler<E> setOrigin(final Origin origin, final IWidget relative) {
|
||||
public EventHandler<E> setOrigin(Origin origin, IWidget relative) {
|
||||
this.origin = origin;
|
||||
this.relative = relative;
|
||||
return this;
|
||||
}
|
||||
|
||||
public abstract void onEvent(final E p0);
|
||||
public abstract void onEvent(E event);
|
||||
|
||||
public final boolean handles(final Event e) {
|
||||
return this.eventClass.isInstance(e) && this.origin.isOrigin(e.getOrigin(), this.relative);
|
||||
public final boolean handles(Event event) {
|
||||
return this.eventClass.isInstance(event) && this.origin.isOrigin(event.getOrigin(), this.relative);
|
||||
}
|
||||
|
||||
public enum Origin {
|
||||
@@ -31,7 +31,7 @@ public abstract class EventHandler<E extends Event> {
|
||||
PARENT,
|
||||
DIRECT_CHILD;
|
||||
|
||||
public boolean isOrigin(final IWidget origin, final IWidget test) {
|
||||
public boolean isOrigin(IWidget origin, IWidget test) {
|
||||
switch (this) {
|
||||
case ANY: {
|
||||
return true;
|
||||
|
||||
@@ -41,8 +41,8 @@ public abstract class Dialog extends Control {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
RenderUtil.drawGradientRect(this.getArea().outset(400), -1442840576, -1442840576);
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.Window, this.getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TabOutline, this.getArea().inset(4));
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.WINDOW, this.getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TAB_OUTLINE, this.getArea().inset(4));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -102,10 +102,10 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
if(draggedItem.isEmpty()) {
|
||||
final MinecraftTooltip tooltip = new MinecraftTooltip();
|
||||
if (this.isHelpMode()) {
|
||||
tooltip.setType(Tooltip.Type.Help);
|
||||
tooltip.setType(Tooltip.Type.HELP);
|
||||
this.window.getHelpTooltip(tooltip);
|
||||
} else {
|
||||
tooltip.setType(Tooltip.Type.Standard);
|
||||
tooltip.setType(Tooltip.Type.STANDARD);
|
||||
this.window.getTooltip(tooltip);
|
||||
}
|
||||
if (tooltip.exists()) {
|
||||
|
||||
@@ -230,7 +230,7 @@ public abstract class Window extends TopLevelWidget implements INetwork.ReceiveG
|
||||
CraftGUI.RENDER.texture(this.getBackground2(), new Point(256, 0));
|
||||
}
|
||||
RenderUtil.setColour(this.getColor());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.Window, this.getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.WINDOW, this.getArea());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -82,7 +82,7 @@ public class ControlEnergyBar extends Control implements ITooltip {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.EnergyBarBack, this.getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.ENERGY_BAR_BACK, this.getArea());
|
||||
final float percentage = this.getPercentage() / 100.0f;
|
||||
int colourFromPercentage = this.getColourFromPercentage(percentage);
|
||||
RenderUtil.setColour(colourFromPercentage);
|
||||
@@ -102,15 +102,15 @@ public class ControlEnergyBar extends Control implements ITooltip {
|
||||
}
|
||||
}
|
||||
if (this.isMouseOver() && Window.get(this).getGui().isHelpMode()) {
|
||||
final int c = -1442840576 + MinecraftTooltip.getOutline(Tooltip.Type.Help);
|
||||
final int c = -1442840576 + MinecraftTooltip.getOutline(Tooltip.Type.HELP);
|
||||
RenderUtil.drawGradientRect(this.getArea().inset(1), c, c);
|
||||
} else if (ControlEnergyBar.isError) {
|
||||
final int c = -1442840576 + MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error);
|
||||
RenderUtil.drawGradientRect(this.getArea().inset(1), c, c);
|
||||
}
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.EnergyBarGlow, area);
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.ENERGY_BAR_GLOW, area);
|
||||
GlStateManager.color(1, 1, 1, 1);
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.EnergyBarGlass, this.getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.ENERGY_BAR_GLASS, this.getArea());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -118,12 +118,12 @@ public class ControlEnergyBar extends Control implements ITooltip {
|
||||
public void onRenderForeground(int guiWidth, int guiHeight) {
|
||||
if (this.isMouseOver() && Window.get(this).getGui().isHelpMode()) {
|
||||
final Area area = this.getArea();
|
||||
RenderUtil.setColour(MinecraftTooltip.getOutline(Tooltip.Type.Help));
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.Outline, area.outset(1));
|
||||
RenderUtil.setColour(MinecraftTooltip.getOutline(Tooltip.Type.HELP));
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.OUTLINE, area.outset(1));
|
||||
} else if (ControlEnergyBar.isError) {
|
||||
final Area area = this.getArea();
|
||||
RenderUtil.setColour(MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error));
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.Outline, area.outset(1));
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.OUTLINE, area.outset(1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,11 +34,11 @@ public class ControlErrorState extends Control implements ITooltip {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
Object texture = CraftGUITexture.StateWarning;
|
||||
Object texture = CraftGUITexture.STATE_WARNING;
|
||||
if (this.errorState == null) {
|
||||
texture = CraftGUITexture.StateNone;
|
||||
texture = CraftGUITexture.STATE_NONE;
|
||||
} else if (this.type == 0) {
|
||||
texture = CraftGUITexture.StateError;
|
||||
texture = CraftGUITexture.STATE_ERROR;
|
||||
}
|
||||
CraftGUI.RENDER.texture(texture, Point.ZERO);
|
||||
super.onRenderBackground(guiWidth, guiHeight);
|
||||
|
||||
@@ -20,12 +20,12 @@ public class ControlHelp extends Control implements ITooltip {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.HelpButton, this.getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.HELP_BUTTON, this.getArea());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
tooltip.setType(Tooltip.Type.Help);
|
||||
tooltip.setType(Tooltip.Type.HELP);
|
||||
tooltip.add("Help");
|
||||
tooltip.add("To activate help tooltips,");
|
||||
tooltip.add("hold down the tab key and");
|
||||
|
||||
@@ -23,12 +23,12 @@ public class ControlInfo extends Control implements ITooltip {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.InfoButton, this.getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.INFO_BUTTON, this.getArea());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
tooltip.setType(Tooltip.Type.Information);
|
||||
tooltip.setType(Tooltip.Type.INFORMATION);
|
||||
tooltip.add("Info");
|
||||
tooltip.add(this.info);
|
||||
tooltip.setMaxWidth(200);
|
||||
|
||||
@@ -83,10 +83,10 @@ public class ControlLiquidTank extends Control implements ITooltip {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.RENDER.texture(this.horizontal ? CraftGUITexture.HorizontalLiquidTank : CraftGUITexture.LiquidTank, Point.ZERO);
|
||||
CraftGUI.RENDER.texture(this.horizontal ? CraftGUITexture.HORIZONTAL_LIQUID_TANK : CraftGUITexture.LIQUID_TANK, Point.ZERO);
|
||||
GuiCraftGUI gui = Window.get(this).getGui();
|
||||
if (this.isMouseOver() && gui.isHelpMode()) {
|
||||
final int c = -1442840576 + MinecraftTooltip.getOutline(Tooltip.Type.Help);
|
||||
final int c = -1442840576 + MinecraftTooltip.getOutline(Tooltip.Type.HELP);
|
||||
RenderUtil.drawGradientRect(this.getArea().inset(1), c, c);
|
||||
} else if (ControlLiquidTank.tankError.contains(this.tankID)) {
|
||||
final int c = -1442840576 + MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error);
|
||||
@@ -139,17 +139,17 @@ public class ControlLiquidTank extends Control implements ITooltip {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderForeground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.RENDER.texture(this.horizontal ? CraftGUITexture.HorizontalLiquidTankOverlay : CraftGUITexture.LiquidTankOverlay, Point.ZERO);
|
||||
CraftGUI.RENDER.texture(this.horizontal ? CraftGUITexture.HORIZONTAL_LIQUID_TANK_OVERLAY : CraftGUITexture.LIQUID_TANK_OVERLAY, Point.ZERO);
|
||||
GuiCraftGUI gui = Window.get(this).getGui();
|
||||
if (this.isMouseOver() && gui.isHelpMode()) {
|
||||
final Area area = this.getArea();
|
||||
RenderUtil.setColour(MinecraftTooltip.getOutline(Tooltip.Type.Help));
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.Outline, area.outset(1));
|
||||
RenderUtil.setColour(MinecraftTooltip.getOutline(Tooltip.Type.HELP));
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.OUTLINE, area.outset(1));
|
||||
}
|
||||
if (ControlLiquidTank.tankError.contains(this.tankID)) {
|
||||
final Area area = this.getArea();
|
||||
RenderUtil.setColour(MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error));
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.Outline, area.outset(1));
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.OUTLINE, area.outset(1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,12 +24,12 @@ public class ControlPowerSystem extends Control implements ITooltip {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.PowerButton, this.getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.POWER_BUTTON, this.getArea());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
tooltip.setType(Tooltip.Type.Power);
|
||||
tooltip.setType(Tooltip.Type.POWER);
|
||||
tooltip.add("Power Supply");
|
||||
tooltip.add("Powered by " + this.system.getUnitName());
|
||||
tooltip.setMaxWidth(200);
|
||||
|
||||
@@ -50,9 +50,9 @@ public class ControlSlide extends Control {
|
||||
Area tabArea = new Area(hor ? (-lh / 2) : (-lw / 2), hor ? (-lw / 2) : (-lh / 2), hor ? lh : lw, hor ? lw : lh);
|
||||
final Point shift = new Point(ar.width() * (1 - this.anchor.x()) / 2, ar.height() * (1 - this.anchor.y()) / 2);
|
||||
tabArea = tabArea.shift(shift.xPos() - (-3 + lh / 2) * this.anchor.x(), shift.yPos() - (-3 + lh / 2) * this.anchor.y());
|
||||
Texture texture = CraftGUI.RENDER.getTexture(this.isSlideActive() ? CraftGUITexture.Tab : CraftGUITexture.TabDisabled).crop(this.anchor.opposite(), 8);
|
||||
Texture texture = CraftGUI.RENDER.getTexture(this.isSlideActive() ? CraftGUITexture.TAB : CraftGUITexture.TAB_DISABLED).crop(this.anchor.opposite(), 8);
|
||||
CraftGUI.RENDER.texture(texture, tabArea);
|
||||
texture = CraftGUI.RENDER.getTexture(CraftGUITexture.TabOutline).crop(this.anchor.opposite(), 8);
|
||||
texture = CraftGUI.RENDER.getTexture(CraftGUITexture.TAB_OUTLINE).crop(this.anchor.opposite(), 8);
|
||||
CraftGUI.RENDER.texture(texture, tabArea.inset(2));
|
||||
final Area labelArea = new Area(-lw / 2, 0, lw, lh);
|
||||
GlStateManager.pushMatrix();
|
||||
@@ -66,8 +66,8 @@ public class ControlSlide extends Control {
|
||||
RenderUtil.drawText(labelArea, TextJustification.MIDDLE_CENTER, this.label, 16777215);
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.Window, this.getArea());
|
||||
final Object slideTexture = (this.anchor == Position.BOTTOM) ? CraftGUITexture.SlideDown : ((this.anchor == Position.Top) ? CraftGUITexture.SlideUp : ((this.anchor == Position.LEFT) ? CraftGUITexture.SlideLeft : CraftGUITexture.SlideRight));
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.WINDOW, this.getArea());
|
||||
final Object slideTexture = (this.anchor == Position.BOTTOM) ? CraftGUITexture.SLIDE_DOWN : ((this.anchor == Position.Top) ? CraftGUITexture.SLIDE_UP : ((this.anchor == Position.LEFT) ? CraftGUITexture.SLIDE_LEFT : CraftGUITexture.SLIDE_RIGHT));
|
||||
CraftGUI.RENDER.texture(slideTexture, new Point((this.anchor.x() + 1) * this.getWidth() / 2 - 8, (this.anchor.y() + 1) * this.getHeight() / 2 - 8));
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ public class ControlSlot extends ControlSlotBase {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.Slot, Point.ZERO);
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.SLOT, Point.ZERO);
|
||||
final InventorySlot islot = this.getInventorySlot();
|
||||
if (islot != null) {
|
||||
SlotValidator validator = islot.getValidator();
|
||||
@@ -137,7 +137,7 @@ public class ControlSlot extends ControlSlotBase {
|
||||
area.setPosition(Point.ZERO.sub(this.getPosition()));
|
||||
}
|
||||
RenderUtil.setColour(c);
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.Outline, area.outset(1));
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.OUTLINE, area.outset(1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public abstract class ControlSlotBase extends Control implements ITooltip {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
final int size = this.getSize().xPos();
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.Slot, this.getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.SLOT, this.getArea());
|
||||
if (this.getTopParent().getMousedOverWidget() == this) {
|
||||
RenderUtil.drawGradientRect(new Area(new Point(1, 1), this.getArea().size().sub(new Point(2, 2))), -2130706433, -2130706433);
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@ public class ControlSlotCharge extends Control {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.PanelBlack, this.getArea());
|
||||
CraftGUI.RENDER.texturePercentage(CraftGUI.RENDER.getTexture(CraftGUITexture.SlotCharge), this.getArea().inset(1), Position.BOTTOM, this.getCharge());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.PANEL_BLACK, this.getArea());
|
||||
CraftGUI.RENDER.texturePercentage(CraftGUI.RENDER.getTexture(CraftGUITexture.SLOT_CHARGE), this.getArea().inset(1), Position.BOTTOM, this.getCharge());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,12 +28,12 @@ public class ControlUser extends Control implements ITooltip {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.UserButton, this.getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.USER_BUTTON, this.getArea());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
tooltip.setType(Tooltip.Type.User);
|
||||
tooltip.setType(Tooltip.Type.USER);
|
||||
tooltip.add("Owner");
|
||||
if (!Objects.equals(this.username, "")) {
|
||||
tooltip.add(this.username);
|
||||
|
||||
@@ -15,7 +15,7 @@ public enum EnumHighlighting {
|
||||
return MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error);
|
||||
}
|
||||
case Help: {
|
||||
return MinecraftTooltip.getOutline(Tooltip.Type.Help);
|
||||
return MinecraftTooltip.getOutline(Tooltip.Type.HELP);
|
||||
}
|
||||
case ShiftClick: {
|
||||
return 16776960;
|
||||
|
||||
@@ -5,5 +5,5 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public interface IStyleSheet {
|
||||
@SideOnly(Side.CLIENT)
|
||||
Texture getTexture(final Object p0);
|
||||
Texture getTexture(Object object);
|
||||
}
|
||||
@@ -8,11 +8,11 @@ import binnie.genetics.gui.punnett.ExtraBeeGUITexture;
|
||||
|
||||
public class StyleSheetPunnett extends StyleSheet {
|
||||
public StyleSheetPunnett() {
|
||||
this.textures.put(CraftGUITexture.Window, new PaddedTexture(0, 0, 160, 160, 0, BinnieCoreTexture.GUI_PUNNETT, 32, 32, 32, 32));
|
||||
this.textures.put(CraftGUITexture.Slot, new StandardTexture(160, 0, 18, 18, 0, BinnieCoreTexture.GUI_PUNNETT));
|
||||
this.textures.put(CraftGUITexture.WINDOW, new PaddedTexture(0, 0, 160, 160, 0, BinnieCoreTexture.GUI_PUNNETT, 32, 32, 32, 32));
|
||||
this.textures.put(CraftGUITexture.SLOT, new StandardTexture(160, 0, 18, 18, 0, BinnieCoreTexture.GUI_PUNNETT));
|
||||
this.textures.put(ExtraBeeGUITexture.Chromosome, new StandardTexture(160, 36, 16, 16, 0, BinnieCoreTexture.GUI_PUNNETT));
|
||||
this.textures.put(ExtraBeeGUITexture.Chromosome2, new StandardTexture(160, 52, 16, 16, 0, BinnieCoreTexture.GUI_PUNNETT));
|
||||
this.textures.put(CraftGUITexture.HelpButton, new StandardTexture(178, 0, 16, 16, 0, BinnieCoreTexture.GUI_PUNNETT));
|
||||
this.textures.put(CraftGUITexture.InfoButton, new StandardTexture(178, 16, 16, 16, 0, BinnieCoreTexture.GUI_PUNNETT));
|
||||
this.textures.put(CraftGUITexture.HELP_BUTTON, new StandardTexture(178, 0, 16, 16, 0, BinnieCoreTexture.GUI_PUNNETT));
|
||||
this.textures.put(CraftGUITexture.INFO_BUTTON, new StandardTexture(178, 16, 16, 16, 0, BinnieCoreTexture.GUI_PUNNETT));
|
||||
}
|
||||
}
|
||||
@@ -1,48 +1,48 @@
|
||||
package binnie.core.gui.resource.minecraft;
|
||||
|
||||
public enum CraftGUITexture {
|
||||
Window("window"),
|
||||
PanelGray("panel.gray"),
|
||||
PanelBlack("panel.black"),
|
||||
PanelTinted("panel.tinted"),
|
||||
ButtonDisabled("button.disabled"),
|
||||
Button("button"),
|
||||
ButtonHighlighted("button.highlighted"),
|
||||
Slot("slot"),
|
||||
SlotBorder("slot.border"),
|
||||
SlotOverlay("slot.overlay"),
|
||||
SlotCharge("slot.charge"),
|
||||
LiquidTank("liquidtank"),
|
||||
LiquidTankOverlay("liquidtank.overlay"),
|
||||
StateError("errorstate.error"),
|
||||
StateWarning("errorstate.warning"),
|
||||
StateNone("errorstate.none"),
|
||||
EnergyBarBack("energybar.back"),
|
||||
EnergyBarGlow("energybar.glow"),
|
||||
EnergyBarGlass("energybar.glass"),
|
||||
TabDisabled("tab.disabled"),
|
||||
Tab("tab"),
|
||||
TabHighlighted("tab.highlighted"),
|
||||
TabOutline("tab.outline"),
|
||||
TabSolid("tab.solid"),
|
||||
ScrollDisabled("scroll.disabled"),
|
||||
Scroll("scroll"),
|
||||
ScrollHighlighted("scroll.highlighted"),
|
||||
Outline("outline"),
|
||||
HelpButton("button.help"),
|
||||
InfoButton("button.info"),
|
||||
UserButton("button.user"),
|
||||
PowerButton("button.power"),
|
||||
HorizontalLiquidTank("horizontalliquidtank"),
|
||||
HorizontalLiquidTankOverlay("horizontalliquidtank.overlay"),
|
||||
SlideUp("slide.up"),
|
||||
SlideDown("slide.down"),
|
||||
SlideLeft("slide.left"),
|
||||
SlideRight("slide.right"),
|
||||
Checkbox("checkbox"),
|
||||
CheckboxHighlighted("checkbox.highlighted"),
|
||||
CheckboxChecked("checkbox.checked"),
|
||||
CheckboxCheckedHighlighted("checkbox.checked.highlighted");
|
||||
WINDOW("window"),
|
||||
PANEL_GRAY("panel.gray"),
|
||||
PANEL_BLACK("panel.black"),
|
||||
PANEL_TINTED("panel.tinted"),
|
||||
BUTTON_DISABLED("button.disabled"),
|
||||
BUTTON("button"),
|
||||
BUTTON_HIGHLIGHTED("button.highlighted"),
|
||||
SLOT("slot"),
|
||||
SLOT_BORDER("slot.border"),
|
||||
SLOT_OVERLAY("slot.overlay"),
|
||||
SLOT_CHARGE("slot.charge"),
|
||||
LIQUID_TANK("liquidtank"),
|
||||
LIQUID_TANK_OVERLAY("liquidtank.overlay"),
|
||||
STATE_ERROR("errorstate.error"),
|
||||
STATE_WARNING("errorstate.warning"),
|
||||
STATE_NONE("errorstate.none"),
|
||||
ENERGY_BAR_BACK("energybar.back"),
|
||||
ENERGY_BAR_GLOW("energybar.glow"),
|
||||
ENERGY_BAR_GLASS("energybar.glass"),
|
||||
TAB_DISABLED("tab.disabled"),
|
||||
TAB("tab"),
|
||||
TAB_HIGHLIGHTED("tab.highlighted"),
|
||||
TAB_OUTLINE("tab.outline"),
|
||||
TAB_SOLID("tab.solid"),
|
||||
SCROLL_DISABLED("scroll.disabled"),
|
||||
SCROLL("scroll"),
|
||||
SCROLL_HIGHLIGHTED("scroll.highlighted"),
|
||||
OUTLINE("outline"),
|
||||
HELP_BUTTON("button.help"),
|
||||
INFO_BUTTON("button.info"),
|
||||
USER_BUTTON("button.user"),
|
||||
POWER_BUTTON("button.power"),
|
||||
HORIZONTAL_LIQUID_TANK("horizontalliquidtank"),
|
||||
HORIZONTAL_LIQUID_TANK_OVERLAY("horizontalliquidtank.overlay"),
|
||||
SLIDE_UP("slide.up"),
|
||||
SLIDE_DOWN("slide.down"),
|
||||
SLIDE_LEFT("slide.left"),
|
||||
SLIDE_RIGHT("slide.right"),
|
||||
CHECKBOX("checkbox"),
|
||||
CHECKBOX_HIGHLIGHTED("checkbox.highlighted"),
|
||||
CHECKBOX_CHECKED("checkbox.checked"),
|
||||
CHECKBOX_CHECKED_HIGHLIGHTED("checkbox.checked.highlighted");
|
||||
|
||||
String name;
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ import binnie.core.resource.BinnieResource;
|
||||
import binnie.core.resource.IBinnieTexture;
|
||||
|
||||
public enum CraftGUITextureSheet implements IBinnieTexture {
|
||||
Controls2("controls"),
|
||||
Panel2("panels"),
|
||||
Slots("slots");
|
||||
CONTROLS_2("controls"),
|
||||
PANEL_2("panels"),
|
||||
SLOTS("slots");
|
||||
|
||||
private final String name;
|
||||
|
||||
|
||||
@@ -33,23 +33,23 @@ public class Panel extends Control {
|
||||
if (panelType instanceof MinecraftGUI.PanelType) {
|
||||
switch ((MinecraftGUI.PanelType) panelType) {
|
||||
case Black: {
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.PanelBlack, this.getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.PANEL_BLACK, this.getArea());
|
||||
break;
|
||||
}
|
||||
case Gray: {
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.PanelGray, this.getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.PANEL_GRAY, this.getArea());
|
||||
break;
|
||||
}
|
||||
case Tinted: {
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.PanelTinted, this.getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.PANEL_TINTED, this.getArea());
|
||||
break;
|
||||
}
|
||||
case Outline: {
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.Outline, this.getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.OUTLINE, this.getArea());
|
||||
break;
|
||||
}
|
||||
case TabOutline: {
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TabOutline, this.getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TAB_OUTLINE, this.getArea());
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
||||
@@ -159,7 +159,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderForeground(int guiWidth, int guiHeight) {
|
||||
final Texture iTexture = CraftGUI.RENDER.getTexture(CraftGUITexture.TabOutline);
|
||||
final Texture iTexture = CraftGUI.RENDER.getTexture(CraftGUITexture.TAB_OUTLINE);
|
||||
RenderUtil.setColour(WindowCompartment.this.getTab(WindowCompartment.this.panels.get(this)).getColor().getColour());
|
||||
CraftGUI.RENDER.texture(iTexture, this.getArea().inset(3));
|
||||
}
|
||||
@@ -290,7 +290,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
final Object texture = this.isMouseOver() ? CraftGUITexture.TabHighlighted : CraftGUITexture.Tab;
|
||||
final Object texture = this.isMouseOver() ? CraftGUITexture.TAB_HIGHLIGHTED : CraftGUITexture.TAB;
|
||||
CraftGUI.RENDER.texture(CraftGUI.RENDER.getTexture(texture).crop(Position.BOTTOM, 8), this.getArea());
|
||||
}
|
||||
};
|
||||
@@ -378,7 +378,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
RenderUtil.setColour(11184810);
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.Outline, this.getArea().inset(new Border(0, 6, 0, 0)));
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.OUTLINE, this.getArea().inset(new Border(0, 6, 0, 0)));
|
||||
}
|
||||
};
|
||||
scroll.setScrollableContent(this.slotGrid = new Control(scroll, 1, 1, 108, 18));
|
||||
|
||||
@@ -166,7 +166,7 @@ public class ControlTileSelect extends Control implements IControlValue<IDesign>
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.Slot, Point.ZERO);
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.SLOT, Point.ZERO);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -45,7 +45,7 @@ public class ControlSlotFluid extends Control implements ITooltip {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
final int size = this.getSize().xPos();
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.Slot, this.getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.SLOT, this.getArea());
|
||||
if (this.getTopParent().getMousedOverWidget() == this) {
|
||||
RenderUtil.drawGradientRect(new Area(new Point(1, 1), this.getArea().size().sub(new Point(2, 2))), -2130706433, -2130706433);
|
||||
}
|
||||
|
||||
@@ -66,9 +66,9 @@ public class AnalystPageDatabase extends ControlAnalystPage {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
RenderUtil.setColour(5592405);
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TabSolid, getArea().inset(1));
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TAB_SOLID, getArea().inset(1));
|
||||
RenderUtil.setColour(AnalystPageDatabase.this.getColor());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TabOutline, getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TAB_OUTLINE, getArea());
|
||||
renderTextField();
|
||||
}
|
||||
};
|
||||
@@ -163,12 +163,12 @@ public class AnalystPageDatabase extends ControlAnalystPage {
|
||||
WindowAnalyst window = (WindowAnalyst) AnalystPageDatabase.this.getTopParent();
|
||||
if (window.getIndividual() != null && window.getIndividual().getGenome().getPrimary() == species) {
|
||||
RenderUtil.setColour(15658734);
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TabSolid, getArea().outset(1));
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TAB_SOLID, getArea().outset(1));
|
||||
RenderUtil.setColour(AnalystPageDatabase.this.getColor());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TabOutline, getArea().outset(1));
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TAB_OUTLINE, getArea().outset(1));
|
||||
} else if (calculateIsMouseOver()) {
|
||||
RenderUtil.setColour(15658734);
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TabSolid, getArea().outset(1));
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TAB_SOLID, getArea().outset(1));
|
||||
}
|
||||
super.onRenderBackground(guiWidth, guiHeight);
|
||||
}
|
||||
|
||||
@@ -37,12 +37,12 @@ public abstract class ControlToleranceBar<T extends Enum<T>> extends Control imp
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(Tooltip list) {
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
int types = fullSet.size();
|
||||
int type = getRelativeMousePosition().xPos() / (getSize().xPos() / types);
|
||||
for (T tol : fullSet) {
|
||||
if (tol.ordinal() - ((enumClass == EnumTemperature.class) ? 1 : 0) == type) {
|
||||
list.add((tolerated.contains(tol) ? "" : TextFormatting.DARK_GRAY) + getName(tol));
|
||||
tooltip.add((tolerated.contains(tol) ? "" : TextFormatting.DARK_GRAY) + getName(tol));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,10 +180,10 @@ public class WindowAnalyst extends Window {
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
RenderUtil.setColour(syst.getColour());
|
||||
int outset = (getSystem() == syst) ? 1 : 0;
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TabOutline, getArea().outset(outset));
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TAB_OUTLINE, getArea().outset(outset));
|
||||
if (getSystem() == syst) {
|
||||
RenderUtil.setColour(1140850688 + syst.getColour());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TabSolid, getArea().outset(outset));
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TAB_SOLID, getArea().outset(outset));
|
||||
}
|
||||
RenderUtil.drawItem(new Point(2, 2), syst.getItemStackRepresentitive());
|
||||
}
|
||||
@@ -218,7 +218,7 @@ public class WindowAnalyst extends Window {
|
||||
return;
|
||||
}
|
||||
RenderUtil.setColour(getContent().getColor());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TabOutline, getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TAB_OUTLINE, getArea());
|
||||
}
|
||||
};
|
||||
new ControlScrollBar(this, sectionWidth + 2 - 3, 6, 3, getHeight() - 8 + 2 - 6, leftPage) {
|
||||
@@ -243,7 +243,7 @@ public class WindowAnalyst extends Window {
|
||||
return;
|
||||
}
|
||||
RenderUtil.setColour(getContent().getColor());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TabOutline, getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TAB_OUTLINE, getArea());
|
||||
}
|
||||
};
|
||||
new ControlScrollBar(this, sectionWidth + 2 - 3 + sectionWidth + 4, 6, 3, getHeight() - 8 + 2 - 6, rightPage) {
|
||||
@@ -390,11 +390,11 @@ public class WindowAnalyst extends Window {
|
||||
RenderUtil.setColour((active ? -16777216 : 1140850688) + value.getColor());
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableBlend();
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TabSolid, getArea().inset(1));
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TAB_SOLID, getArea().inset(1));
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.popMatrix();
|
||||
RenderUtil.setColour(value.getColor());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TabOutline, getArea().inset(1));
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.TAB_OUTLINE, getArea().inset(1));
|
||||
super.onRenderBackground(guiWidth, guiHeight);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -32,7 +32,7 @@ public class ControlBiomes extends Control implements ITooltip {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(Tooltip list) {
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
if (tolerated.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public class ControlBiomes extends Control implements ITooltip {
|
||||
|
||||
Biome biome = Biome.getBiome(tolerated.get(i));
|
||||
if (biome != null) {
|
||||
list.add(biome.getBiomeName());
|
||||
tooltip.add(biome.getBiomeName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class ControlBiomes extends Control implements ITooltip {
|
||||
//TODO FIND COLOR
|
||||
//CraftGUI.Render.colour(Biome.getBiome(i).color);
|
||||
}
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.Button, new Area(x, y, 16, 16));
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.BUTTON, new Area(x, y, 16, 16));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ public class ControlClimateBar extends Control implements ITooltip {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(Tooltip list) {
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
if (tolerated.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
@@ -67,16 +67,16 @@ public class ControlClimateBar extends Control implements ITooltip {
|
||||
}
|
||||
|
||||
if (isHumidity) {
|
||||
list.add(EnumHumidity.values()[type].name);
|
||||
tooltip.add(EnumHumidity.values()[type].name);
|
||||
} else {
|
||||
list.add(EnumTemperature.values()[type + 1].name);
|
||||
tooltip.add(EnumTemperature.values()[type + 1].name);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.EnergyBarBack, getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.ENERGY_BAR_BACK, getArea());
|
||||
int types = isHumidity ? 3 : 6;
|
||||
int w = (int) ((getSize().xPos() - 2.0f) / types);
|
||||
for (int i = 0; i < types; ++i) {
|
||||
@@ -91,7 +91,7 @@ public class ControlClimateBar extends Control implements ITooltip {
|
||||
RenderUtil.drawSolidRect(new Area(x + 1, 1, w, getSize().yPos() - 2), color);
|
||||
}
|
||||
}
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.EnergyBarGlass, getArea());
|
||||
CraftGUI.RENDER.texture(CraftGUITexture.ENERGY_BAR_GLASS, getArea());
|
||||
}
|
||||
|
||||
public void setSpecies(IAlleleBeeSpecies species) {
|
||||
|
||||
@@ -61,8 +61,8 @@ public class WindowPunnettSquare extends Window {
|
||||
|
||||
static class StyleSheetPunnett extends StyleSheet {
|
||||
public StyleSheetPunnett() {
|
||||
textures.put(CraftGUITexture.Window, new PaddedTexture(0, 0, 160, 160, 0, texture, 32, 32, 32, 32));
|
||||
textures.put(CraftGUITexture.Slot, new StandardTexture(160, 0, 18, 18, 0, texture));
|
||||
textures.put(CraftGUITexture.WINDOW, new PaddedTexture(0, 0, 160, 160, 0, texture, 32, 32, 32, 32));
|
||||
textures.put(CraftGUITexture.SLOT, new StandardTexture(160, 0, 18, 18, 0, texture));
|
||||
textures.put(ExtraBeeGUITexture.Chromosome, new StandardTexture(160, 36, 16, 16, 0, texture));
|
||||
textures.put(ExtraBeeGUITexture.Chromosome2, new StandardTexture(160, 52, 16, 16, 0, texture));
|
||||
}
|
||||
|
||||
@@ -272,6 +272,8 @@ binniecore.gui.nottolerated=Not Tolerated
|
||||
|
||||
binniecore.gui.design=Design
|
||||
|
||||
binniecore.gui.genesis.title=Genesis
|
||||
|
||||
binniecore.gui.fieldkit.title=Field Kit
|
||||
binniecore.gui.fieldkit.info=The Field Kit analyses bees, trees, flowers and butterflies. All that is required is a piece of paper to jot notes
|
||||
binniecore.gui.fieldkit.paper=Paper
|
||||
|
||||
Reference in new issue
Block a user