Search in sources :

Example 1 with IUIHolder

use of gregtech.api.gui.IUIHolder in project GregTech by GregTechCEu.

the class TextPluginBehavior method customUI.

@Override
public WidgetPluginConfig customUI(WidgetPluginConfig widgets, IUIHolder holder, EntityPlayer entityPlayer) {
    widgets.setSize(260, 210);
    for (int i = 0; i < texts.length; i++) {
        int finalI = i;
        widgets.addWidget(new TextFieldWidget(25, 25 + i * 10, 100, 10, true, () -> this.texts[finalI], (text) -> setText(finalI, text, this.colors[finalI])).setValidator((data) -> true));
        widgets.addWidget(new WidgetARGB(135, 25 + i * 10, 10, colors[i], color -> setText(finalI, this.texts[finalI], color)));
    }
    return widgets;
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound) Arrays(java.util.Arrays) RayTraceResult(net.minecraft.util.math.RayTraceResult) MonitorPluginBaseBehavior(gregtech.api.items.behavior.MonitorPluginBaseBehavior) IUIHolder(gregtech.api.gui.IUIHolder) WidgetARGB(gregtech.common.gui.widget.WidgetARGB) Side(net.minecraftforge.fml.relauncher.Side) RenderUtil(gregtech.client.utils.RenderUtil) EntityPlayer(net.minecraft.entity.player.EntityPlayer) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) GregtechDataCodes(gregtech.api.capability.GregtechDataCodes) TextFieldWidget(gregtech.api.gui.widgets.TextFieldWidget) PacketBuffer(net.minecraft.network.PacketBuffer) WidgetPluginConfig(gregtech.common.gui.widget.monitor.WidgetPluginConfig) WidgetARGB(gregtech.common.gui.widget.WidgetARGB) TextFieldWidget(gregtech.api.gui.widgets.TextFieldWidget)

Aggregations

GregtechDataCodes (gregtech.api.capability.GregtechDataCodes)1 IUIHolder (gregtech.api.gui.IUIHolder)1 TextFieldWidget (gregtech.api.gui.widgets.TextFieldWidget)1 MonitorPluginBaseBehavior (gregtech.api.items.behavior.MonitorPluginBaseBehavior)1 RenderUtil (gregtech.client.utils.RenderUtil)1 WidgetARGB (gregtech.common.gui.widget.WidgetARGB)1 WidgetPluginConfig (gregtech.common.gui.widget.monitor.WidgetPluginConfig)1 Arrays (java.util.Arrays)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 PacketBuffer (net.minecraft.network.PacketBuffer)1 RayTraceResult (net.minecraft.util.math.RayTraceResult)1 Side (net.minecraftforge.fml.relauncher.Side)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1