use of com.lowdragmc.lowdraglib.gui.widget.DraggableScrollableWidgetGroup in project Multiblocked by Low-Drag-MC.
the class PlayerCapabilityTrait method openConfigurator.
@Override
public void openConfigurator(WidgetGroup parentDialog) {
DraggableScrollableWidgetGroup dragGroup = new DraggableScrollableWidgetGroup((384 - 176) / 2, 0, 176, 256);
parentDialog.addWidget(dragGroup);
refreshSlots(dragGroup);
}
use of com.lowdragmc.lowdraglib.gui.widget.DraggableScrollableWidgetGroup in project Multiblocked by Low-Drag-MC.
the class SingleCapabilityTrait method openConfigurator.
@Override
public void openConfigurator(WidgetGroup parentDialog) {
DraggableScrollableWidgetGroup dragGroup = new DraggableScrollableWidgetGroup((384 - 176) / 2, 0, 176, 256);
parentDialog.addWidget(dragGroup);
refreshSlots(dragGroup);
}
use of com.lowdragmc.lowdraglib.gui.widget.DraggableScrollableWidgetGroup in project Multiblocked by Low-Drag-MC.
the class PredicateBlocks method getConfigWidget.
@Override
public List<WidgetGroup> getConfigWidget(List<WidgetGroup> groups) {
super.getConfigWidget(groups);
WidgetGroup group = new WidgetGroup(0, 0, 182, 100);
groups.add(group);
DraggableScrollableWidgetGroup container = new DraggableScrollableWidgetGroup(0, 25, 182, 80).setBackground(new ColorRectTexture(0xffaaaaaa));
group.addWidget(container);
List<BlockState> blockList = Arrays.stream(blocks).map(Block::defaultBlockState).collect(Collectors.toList());
for (BlockState blockState : blockList) {
addBlockSelectorWidget(blockList, container, blockState);
}
group.addWidget(new LabelWidget(0, 6, "multiblocked.gui.label.block_settings"));
group.addWidget(new ButtonWidget(162, 0, 20, 20, cd -> {
blockList.add(null);
addBlockSelectorWidget(blockList, container, null);
}).setButtonTexture(new ResourceTexture("multiblocked:textures/gui/add.png")).setHoverBorderTexture(1, -1).setHoverTooltips("multiblocked.gui.predicate.blocks.add"));
return groups;
}
use of com.lowdragmc.lowdraglib.gui.widget.DraggableScrollableWidgetGroup in project Multiblocked by Low-Drag-MC.
the class PredicateStates method getConfigWidget.
@Override
public List<WidgetGroup> getConfigWidget(List<WidgetGroup> groups) {
super.getConfigWidget(groups);
WidgetGroup group = new WidgetGroup(0, 0, 182, 100);
groups.add(group);
DraggableScrollableWidgetGroup container = new DraggableScrollableWidgetGroup(0, 25, 182, 80).setBackground(new ColorRectTexture(0xffaaaaaa));
group.addWidget(container);
List<BlockState> blockList = new ArrayList<>(Arrays.asList(states));
for (BlockState blockState : blockList) {
addBlockSelectorWidget(blockList, container, blockState);
}
group.addWidget(new LabelWidget(0, 6, "multiblocked.gui.label.block_settings"));
group.addWidget(new ButtonWidget(162, 0, 20, 20, cd -> {
blockList.add(null);
addBlockSelectorWidget(blockList, container, null);
}).setButtonTexture(new ResourceTexture("multiblocked:textures/gui/add.png")).setHoverBorderTexture(1, -1).setHoverTooltips("multiblocked.gui.predicate.states.add"));
return groups;
}
use of com.lowdragmc.lowdraglib.gui.widget.DraggableScrollableWidgetGroup in project Multiblocked by Low-Drag-MC.
the class GeoComponentRenderer method createConfigurator.
@Override
public Supplier<IMultiblockedRenderer> createConfigurator(WidgetGroup parent, DraggableScrollableWidgetGroup group, IMultiblockedRenderer current) {
TextFieldWidget tfw = new TextFieldWidget(1, 1, 150, 20, null, null);
File path = new File(Multiblocked.location, "assets/multiblocked/geo");
AtomicBoolean isGlobal = new AtomicBoolean(false);
if (current instanceof GeoComponentRenderer) {
tfw.setCurrentString(((GeoComponentRenderer) current).modelName);
isGlobal.set(((GeoComponentRenderer) current).isGlobal);
}
group.addWidget(new ButtonWidget(155, 1, 20, 20, cd -> DialogWidget.showFileDialog(parent, "select a geo file", path, true, DialogWidget.suffixFilter(".geo.json"), r -> {
if (r != null && r.isFile()) {
tfw.setCurrentString(r.getName().replace(".geo.json", ""));
}
})).setButtonTexture(new ResourceTexture("multiblocked:textures/gui/darkened_slot.png"), new TextTexture("F", -1)).setHoverTooltips("multiblocked.gui.tips.file_selector"));
group.addWidget(tfw);
group.addWidget(createBoolSwitch(1, 25, "isGlobal", "multiblocked.gui.predicate.geo.0", isGlobal.get(), isGlobal::set));
return () -> {
if (tfw.getCurrentString().isEmpty()) {
return null;
} else {
return new GeoComponentRenderer(tfw.getCurrentString(), isGlobal.get());
}
};
}
Aggregations