use of com.lowdragmc.lowdraglib.gui.texture.ColorBorderTexture in project Multiblocked by Low-Drag-MC.
the class SingleCapabilityTrait method refreshSlots.
protected void refreshSlots(DraggableScrollableWidgetGroup dragGroup) {
dragGroup.widgets.forEach(dragGroup::waitToRemoved);
ButtonWidget setting = (ButtonWidget) new ButtonWidget(10, 0, 8, 8, new ResourceTexture("multiblocked:textures/gui/option.png"), null).setHoverBorderTexture(1, -1).setHoverTooltips("multiblocked.gui.tips.settings");
ImageWidget imageWidget = new ImageWidget(1, 1, 16, 16, new GuiTextureGroup(new ColorRectTexture(getColorByIO(guiIO)), new ColorBorderTexture(1, getColorByIO(capabilityIO))));
setting.setVisible(false);
DraggableWidgetGroup slot = new DraggableWidgetGroup(x, y, 18, 18);
slot.setOnSelected(w -> setting.setVisible(true));
slot.setOnUnSelected(w -> setting.setVisible(false));
slot.addWidget(imageWidget);
slot.addWidget(setting);
slot.setOnEndDrag(b -> {
x = b.getSelfPosition().x;
y = b.getSelfPosition().y;
});
dragGroup.addWidget(slot);
setting.setOnPressCallback(cd2 -> {
DialogWidget dialog = new DialogWidget(dragGroup, true);
dialog.addWidget(new ImageWidget(0, 0, 176, 256, new ColorRectTexture(0xaf000000)));
initSettingDialog(dialog, slot);
});
}
use of com.lowdragmc.lowdraglib.gui.texture.ColorBorderTexture in project Multiblocked by Low-Drag-MC.
the class SingleCapabilityTrait method initSettingDialog.
protected void initSettingDialog(DialogWidget dialog, DraggableWidgetGroup slot) {
ImageWidget imageWidget = (ImageWidget) slot.widgets.get(0);
dialog.addWidget(new SelectorWidget(5, 5, 40, 15, Arrays.stream(IO.VALUES).map(Enum::name).collect(Collectors.toList()), -1).setValue(capabilityIO.name()).setOnChanged(io -> {
capabilityIO = IO.valueOf(io);
imageWidget.setImage(new GuiTextureGroup(new ColorRectTexture(getColorByIO(guiIO)), new ColorBorderTexture(1, getColorByIO(capabilityIO))));
}).setButtonBackground(ResourceBorderTexture.BUTTON_COMMON).setBackground(new ColorRectTexture(0xffaaaaaa)).setHoverTooltips("multiblocked.gui.trait.capability_io"));
dialog.addWidget(new SelectorWidget(50, 5, 40, 15, Arrays.stream(IO.VALUES).map(Enum::name).collect(Collectors.toList()), -1).setValue(guiIO.name()).setOnChanged(io -> {
guiIO = IO.valueOf(io);
imageWidget.setImage(new GuiTextureGroup(new ColorRectTexture(getColorByIO(guiIO)), new ColorBorderTexture(1, getColorByIO(capabilityIO))));
}).setButtonBackground(ResourceBorderTexture.BUTTON_COMMON).setBackground(new ColorRectTexture(0xffaaaaaa)).setHoverTooltips("multiblocked.gui.trait.gui_io"));
}
Aggregations