use of gregtech.common.terminal.app.prospector.widget.WidgetOreList in project GregTech by GregTechCEu.
the class ProspectorApp method initApp.
@Override
public AbstractApplication initApp() {
int chunkRadius = getAppTier() + 3;
int offset = (232 - 32 * 7 + 16) / 2;
background = new ColorRectTexture(0xA0000000);
this.addWidget(new ImageWidget(0, 0, 333, 232, background));
if (isClient) {
this.addWidget(new ImageWidget(0, 0, 333, offset, GuiTextures.UI_FRAME_SIDE_UP));
this.addWidget(new ImageWidget(0, 232 - offset, 333, offset, GuiTextures.UI_FRAME_SIDE_DOWN));
this.widgetOreList = new WidgetOreList(32 * chunkRadius - 16, offset, 333 - 32 * chunkRadius + 16, 232 - 2 * offset);
this.addWidget(this.widgetOreList);
}
this.widgetProspectingMap = new WidgetProspectingMap(0, offset + (7 - chunkRadius) * 16, chunkRadius, this.widgetOreList, mode, 1);
if (isClient) {
persist = Tables.newCustomTable(Maps.newHashMap(), Maps::newHashMap);
widgetProspectingMap.setOnPacketReceived(packet -> persist.put(packet.chunkX, packet.chunkZ, packet));
}
this.addWidget(1, this.widgetProspectingMap);
loadLocalConfig(nbt -> {
this.widgetProspectingMap.setDarkMode(nbt.getBoolean("dark"));
background.setColor(this.widgetProspectingMap.getDarkMode() ? 0xA0000000 : 0xA0ffffff);
});
if (isClient) {
loadPacketLocalConfig();
}
return this;
}
use of gregtech.common.terminal.app.prospector.widget.WidgetOreList in project GregTech by GregTechCEu.
the class ProspectorScannerBehavior method createUI.
@Override
public ModularUI createUI(PlayerInventoryHolder holder, @Nonnull EntityPlayer entityPlayer) {
int mode = getMode(entityPlayer.getHeldItem(EnumHand.MAIN_HAND));
ModularUI.Builder builder = ModularUI.builder(GuiTextures.BACKGROUND, 332, 200);
this.widgetOreList = new WidgetOreList(32 * radius - 6, 18, 332 - 32 * radius, 176);
builder.widget(this.widgetOreList);
builder.widget(new WidgetProspectingMap(6, 18, radius, this.widgetOreList, mode, 1));
return builder.label(6, 6, getTranslationKey()).build(holder, entityPlayer);
}
Aggregations