use of uk.co.qmunity.lib.client.gui.widget.WidgetMode in project BluePower by Qmunity.
the class GuiGateWireless method initGui.
@Override
public void initGui() {
super.initGui();
Keyboard.enableRepeatEvents(true);
Mouse.getDWheel();
addWidget(accessLevel = new WidgetMode(0, guiLeft + 10, guiTop + ySize - 24, 228, 0, Accessibility.values().length, Refs.MODID + ":textures/gui/wirelessRedstone.png") {
@Override
public void addTooltip(int mouseX, int mouseY, List<String> curTip, boolean shiftPressed) {
curTip.add((accessLevel.enabled ? "" : EnumChatFormatting.GRAY) + "Accessability");
}
});
addWidget(filterAccessLevel = new WidgetMode(1, guiLeft + 12, guiTop + 35, 228, 0, Accessibility.values().length + 2, Refs.MODID + ":textures/gui/wirelessRedstone.png"));
filterAccessLevel.value = 4;
addWidget(addFrequency = new WidgetMode(3, guiLeft + 10, guiTop + ySize - 24 - 14 - 3, 228 + 14, 0, 1, Refs.MODID + ":textures/gui/wirelessRedstone.png") {
@Override
public void addTooltip(int mouseX, int mouseY, List<String> curTip, boolean shiftPressed) {
curTip.add((addFrequency.enabled ? "" : EnumChatFormatting.GRAY) + "Add frequency");
}
});
addWidget(saveFrequency = new WidgetMode(4, guiLeft + 37, guiTop + ySize - 24 - 14 - 3, 228 + 14, 28, 1, Refs.MODID + ":textures/gui/wirelessRedstone.png") {
@Override
public void addTooltip(int mouseX, int mouseY, List<String> curTip, boolean shiftPressed) {
curTip.add((saveFrequency.enabled ? "" : EnumChatFormatting.GRAY) + "Save changes");
}
});
addWidget(removeFrequency = new WidgetMode(5, guiLeft + 88 - 10 - 14, guiTop + ySize - 24 - 14 - 3, 228 + 14, 14, 1, Refs.MODID + ":textures/gui/wirelessRedstone.png") {
@Override
public void addTooltip(int mouseX, int mouseY, List<String> curTip, boolean shiftPressed) {
if (gate.getFrequency() != null && (selected == null || selected.equals(gate.getFrequency()))) {
curTip.add("Unselect frequency");
} else if (selected != null) {
curTip.add("Remove frequency");
} else {
curTip.add(EnumChatFormatting.GRAY + "Select a frequency");
}
}
});
addWidget(modeSelector = new WidgetMode(6, guiLeft + 10, guiTop + 57, 228, (14 * 5), 3, Refs.MODID + ":textures/gui/wirelessRedstone.png"));
modeSelector.value = gate.getMode().ordinal();
frequencyName = new GuiTextField(fontRendererObj, guiLeft + 88, guiTop + 22, 133, 10);
accessLevel.enabled = false;
saveFrequency.enabled = false;
addFrequency.enabled = false;
}
use of uk.co.qmunity.lib.client.gui.widget.WidgetMode in project BluePower by Qmunity.
the class GuiCircuitDatabaseMain method initGui.
@Override
public void initGui() {
super.initGui();
WidgetTab widget = new WidgetTab(1, guiLeft - 32, guiTop + 10, 33, 35, 198, 3, Refs.MODID + ":textures/gui/circuit_database.png") {
@Override
protected void addTooltip(int curHoveredTab, List<String> curTip, boolean shiftPressed) {
switch(curHoveredTab) {
case 0:
curTip.add("gui.bluepower:circuitDatabase.tab.copyAndShare");
break;
case 1:
curTip.add("gui.bluepower:circuitDatabase.tab.private");
break;
case 2:
curTip.add("gui.bluepower:circuitDatabase.tab.server");
if (Minecraft.getMinecraft().isSingleplayer())
curTip.add("gui.bluepower:circuitDatabase.info.serverOnly");
break;
}
}
};
widget.value = circuitDatabase.clientCurrentTab;
widget.enabledTabs[2] = !Minecraft.getMinecraft().isSingleplayer();
addWidget(widget);
shareOptionTab = new WidgetSidewaysTab(2, guiLeft + 44, guiTop + 18, 14, 14, 234, 3, Refs.MODID + ":textures/gui/circuit_database.png") {
@Override
protected void addTooltip(int curHoveredTab, List<String> curTip, boolean shiftPressed) {
switch(curHoveredTab) {
case 0:
curTip.add("gui.bluepower:circuitDatabase.action.cancel");
break;
case 1:
curTip.add("gui.bluepower:circuitDatabase.action.savePrivate");
if (!enabledTabs[curHoveredTab]) {
curTip.add("gui.bluepower:circuitDatabase.info.nameTaken");
}
break;
case 2:
curTip.add("gui.bluepower:circuitDatabase.action.saveServer");
if (Minecraft.getMinecraft().isSingleplayer()) {
curTip.add("gui.bluepower:circuitDatabase.info.serverOnly");
} else if (!enabledTabs[curHoveredTab]) {
curTip.add("gui.bluepower:circuitDatabase.info.nameTaken");
}
break;
}
}
};
shareOptionTab.value = circuitDatabase.selectedShareOption;
addWidget(shareOptionTab);
copyButton = new WidgetMode(3, guiLeft + 80, guiTop + 48, 176, 37, 1, Refs.MODID + ":textures/gui/circuit_database.png") {
@Override
public void addTooltip(int x, int y, List<String> curTip, boolean shiftPressed) {
curTip.add("gui.bluepower:circuitDatabase.action.copy");
}
};
addWidget(copyButton);
Keyboard.enableRepeatEvents(true);
nameField = new GuiTextField(fontRendererObj, guiLeft + 95, guiTop + 35, 70, fontRendererObj.FONT_HEIGHT);
nameField.setEnableBackgroundDrawing(true);
nameField.setVisible(true);
nameField.setTextColor(16777215);
nameField.setText(circuitDatabase.getText(1));
}
use of uk.co.qmunity.lib.client.gui.widget.WidgetMode in project BluePower by Qmunity.
the class GuiManager method initGui.
@Override
public void initGui() {
super.initGui();
WidgetColor colorWidget = new WidgetColor(0, guiLeft + 155, guiTop + 55);
colorWidget.value = manager.filterColor.ordinal();
addWidget(colorWidget);
WidgetMode modeWidget = new WidgetMode(1, guiLeft + 155, guiTop + 21, 176, 2, Refs.MODID + ":textures/gui/manager.png") {
@Override
public void addTooltip(int mouseX, int mouseY, List<String> curTip, boolean shiftPressed) {
curTip.add("gui.bluepower:sortingMachine.mode");
String mode = null;
switch(value) {
case 0:
mode = "gui.bluepower:manager.mode.exact";
break;
case 1:
mode = "gui.bluepower:manager.mode.all";
break;
}
curTip.add(mode);
if (shiftPressed) {
curTip.add(mode + ".info");
} else {
curTip.add("gui.bluepower:tooltip.sneakForInfo");
}
}
};
modeWidget.value = manager.mode;
addWidget(modeWidget);
WidgetNumber numberWidget = new WidgetNumber(2, guiLeft + 155, guiTop + 38, 9) {
@Override
public void addTooltip(int mouseX, int mouseY, List<String> curTip, boolean shiftPressed) {
curTip.add("gui.bluepower:sortingMachine.priority");
curTip.add("gui.bluepower:sortingMachine.priority.info");
}
};
numberWidget.value = manager.priority;
addWidget(numberWidget);
WidgetFuzzySetting fuzzyWidget = new WidgetFuzzySetting(3, guiLeft + 155, guiTop + 72);
fuzzyWidget.value = manager.fuzzySetting;
addWidget(fuzzyWidget);
}
use of uk.co.qmunity.lib.client.gui.widget.WidgetMode in project BluePower by Qmunity.
the class GuiSortingMachine method initGui.
@Override
public void initGui() {
super.initGui();
for (int i = 0; i < 8; i++) {
WidgetColor colorWidget = new WidgetColor(i, guiLeft + 27 + 18 * i, guiTop + 110);
colorWidget.value = sortingMachine.colors[i].ordinal();
addWidget(colorWidget);
}
switch(sortingMachine.sortMode) {
case ANY_ITEM_DEFAULT:
case ANY_STACK_DEFAULT:
WidgetColor colorWidget = new WidgetColor(8, guiLeft + 7, guiTop + 122);
colorWidget.value = sortingMachine.colors[8].ordinal();
addWidget(colorWidget);
}
WidgetMode pullModeWidget = new WidgetMode(9, guiLeft + 7, guiTop + 90, 196, PullMode.values().length, Refs.MODID + ":textures/gui/sorting_machine.png") {
@Override
public void addTooltip(int mouseX, int mouseY, List<String> curTip, boolean shiftPressed) {
curTip.add("gui.bluepower:sortingMachine.pullMode");
curTip.add(PullMode.values()[value].toString());
if (shiftPressed) {
curTip.add(PullMode.values()[value].toString() + ".info");
} else {
curTip.add("gui.bluepower:tooltip.sneakForInfo");
}
}
};
pullModeWidget.value = sortingMachine.pullMode.ordinal();
addWidget(pullModeWidget);
WidgetMode sortModeWidget = new WidgetMode(10, guiLeft + 7, guiTop + 106, 210, TileSortingMachine.SortMode.values().length, Refs.MODID + ":textures/gui/sorting_machine.png") {
@Override
public void addTooltip(int mouseX, int mouseY, List<String> curTip, boolean shiftPressed) {
curTip.add("gui.bluepower:sortingMachine.sortMode");
curTip.add(TileSortingMachine.SortMode.values()[value].toString());
if (shiftPressed) {
curTip.add(TileSortingMachine.SortMode.values()[value].toString() + ".info");
} else {
curTip.add("gui.bluepower:tooltip.sneakForInfo");
}
}
};
sortModeWidget.value = sortingMachine.sortMode.ordinal();
addWidget(sortModeWidget);
for (int i = 0; i < 8; i++) {
WidgetFuzzySetting fuzzyWidget = new WidgetFuzzySetting(i + 11, guiLeft + 27 + 18 * i, guiTop + 126);
fuzzyWidget.value = sortingMachine.fuzzySettings[i];
addWidget(fuzzyWidget);
}
}
use of uk.co.qmunity.lib.client.gui.widget.WidgetMode in project BluePower by Qmunity.
the class GuiItemDetector method initGui.
@Override
public void initGui() {
super.initGui();
WidgetMode modeWidget = new WidgetMode(0, guiLeft + 152, guiTop + 10, 176, 3, Refs.MODID + ":textures/gui/item_detector.png") {
@Override
public void addTooltip(int mouseX, int mouseY, List<String> curTip, boolean shiftPressed) {
curTip.add("gui.bluepower:sortingMachine.mode");
String mode;
switch(value) {
case 0:
mode = "gui.bluepower:itemDetector.mode.item";
break;
case 1:
mode = "gui.bluepower:itemDetector.mode.stack";
break;
default:
mode = "gui.bluepower:itemDetector.mode.stuffed";
}
curTip.add(mode);
if (shiftPressed) {
curTip.add(mode + ".info");
} else {
curTip.add("gui.bluepower:tooltip.sneakForInfo");
}
}
};
modeWidget.value = itemDetector.mode;
addWidget(modeWidget);
WidgetFuzzySetting fuzzyWidget = new WidgetFuzzySetting(1, guiLeft + 152, guiTop + 55);
fuzzyWidget.value = itemDetector.fuzzySetting;
addWidget(fuzzyWidget);
}
Aggregations