本文整理汇总了Java中com.mumfrey.liteloader.client.gui.GuiCheckbox类的典型用法代码示例。如果您正苦于以下问题:Java GuiCheckbox类的具体用法?Java GuiCheckbox怎么用?Java GuiCheckbox使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GuiCheckbox类属于com.mumfrey.liteloader.client.gui包,在下文中一共展示了GuiCheckbox类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GuiColourConfigLine
import com.mumfrey.liteloader.client.gui.GuiCheckbox; //导入依赖的package包/类
@SuppressWarnings("UnusedAssignment")
public GuiColourConfigLine(Minecraft mc, int Id, int xPos, int yPos, String DisplayString, int Colour, boolean checked, boolean enabled)
{
this.mc = mc;
this.checked = checked;
int BOX_WIDTH = 18;
int height = 12;
int width = 24;
Checkbox = new GuiCheckbox(Id++, xPos, yPos, null);
Checkbox.checked = checked && enabled;
Checkbox.enabled = enabled;
ColouredButton = new GuiColouredButton(mc,Id++, xPos + BOX_WIDTH, yPos, width, height, Colour ,DisplayString);
ColouredButton.enabled = Checkbox.checked && Checkbox.enabled;
}
示例2: draw
import com.mumfrey.liteloader.client.gui.GuiCheckbox; //导入依赖的package包/类
@Override
public void draw(int x, int y) {
int yPos = this.yPos;
yPos += mc.fontRendererObj.FONT_HEIGHT + 4;
mc.fontRendererObj.drawString(this.text, xPos, yPos, -1);
for (Entry<E, GuiCheckbox> e : options.entrySet()) {
GuiCheckbox s = e.getValue();
s.checked = e.getKey() == this.get();
s.drawButton(mc, x, y);
}
}
示例3: preset
import com.mumfrey.liteloader.client.gui.GuiCheckbox; //导入依赖的package包/类
public StringSetting preset(String name, String cmd) {
this.height += 16;
GuiCheckbox chk = new GuiCheckbox(height, xPos, yPos + height, name);
if (this.get().equals(cmd)) {
chk.checked = true;
}
this.presets.put(cmd, chk);
return this;
}
示例4: initGui
import com.mumfrey.liteloader.client.gui.GuiCheckbox; //导入依赖的package包/类
@SuppressWarnings("UnusedAssignment")
@Override
public void initGui() {
final int LEFT = width / 10 + 16;
GuiCheckbox pony, human, both, hd, sizes, snuzzles, showscale, villager, zombie, pigmen, skeleton, illager;
int row = 32;
this.buttonList.add(pony = ponies = new GuiCheckbox(PONY_ID, LEFT, row += 15, I18n.format(PONY)));
this.buttonList.add(human = humans = new GuiCheckbox(HUMAN_ID, LEFT, row += 15, I18n.format(HUMAN)));
this.buttonList.add(both = this.both = new GuiCheckbox(BOTH_ID, LEFT, row += 15, I18n.format(BOTH)));
row += 15;
this.buttonList.add(hd = new GuiCheckbox(HD_ID, LEFT, row += 15, I18n.format(HD)));
this.buttonList.add(sizes = new GuiCheckbox(SIZES_ID, LEFT, row += 15, I18n.format(SIZES)));
this.buttonList.add(snuzzles = new GuiCheckbox(SNUZZLES_ID, LEFT, row += 15, I18n.format(SNUZZLES)));
this.buttonList.add(showscale = new GuiCheckbox(SHOW_SCALE_ID, LEFT, row += 15, I18n.format(SHOW_SCALE)));
final int RIGHT = width - width / 3;
row = 32;
this.buttonList.add(villager = new GuiCheckbox(VILLAGERS_ID, RIGHT, row += 15, I18n.format(VILLAGERS)));
this.buttonList.add(zombie = new GuiCheckbox(ZOMBIES_ID, RIGHT, row += 15, I18n.format(ZOMBIES)));
this.buttonList.add(pigmen = new GuiCheckbox(ZOMBIE_PIGMEN_ID, RIGHT, row += 15, I18n.format(ZOMBIE_PIGMEN)));
this.buttonList.add(skeleton = new GuiCheckbox(SKELETONS_ID, RIGHT, row += 15, I18n.format(SKELETONS)));
this.buttonList.add(illager = new GuiCheckbox(ILLAGER_ID, RIGHT, row += 15, I18n.format(ILLAGERS)));
switch (config.getPonyLevel()) {
default:
case PONIES:
pony.checked = true;
break;
case HUMANS:
human.checked = true;
break;
case BOTH:
both.checked = true;
break;
}
hd.checked = config.hd;
sizes.checked = config.sizes;
snuzzles.checked = config.snuzzles;
showscale.checked = config.showscale;
villager.checked = config.villagers;
zombie.checked = config.zombies;
pigmen.checked = config.pigzombies;
skeleton.checked = config.skeletons;
illager.checked = config.illagers;
}
示例5: actionPerformed
import com.mumfrey.liteloader.client.gui.GuiCheckbox; //导入依赖的package包/类
@Override
protected void actionPerformed(GuiButton button) throws IOException {
if (button instanceof GuiCheckbox) {
boolean checked = !((GuiCheckbox) button).checked;
((GuiCheckbox) button).checked = checked;
switch (button.id) {
case PONY_ID:
config.setPonyLevel(PonyLevel.PONIES);
ponies.checked = true;
humans.checked = false;
both.checked = false;
break;
case HUMAN_ID:
config.setPonyLevel(PonyLevel.HUMANS);
humans.checked = true;
ponies.checked = false;
both.checked = false;
break;
case BOTH_ID:
config.setPonyLevel(PonyLevel.BOTH);
both.checked = true;
ponies.checked = false;
humans.checked = false;
break;
case HD_ID:
config.hd = checked;
break;
case SIZES_ID:
config.sizes = checked;
break;
case SNUZZLES_ID:
config.snuzzles = checked;
break;
case SHOW_SCALE_ID:
config.showscale = checked;
break;
case VILLAGERS_ID:
config.villagers = checked;
break;
case ZOMBIES_ID:
config.zombies = checked;
break;
case ZOMBIE_PIGMEN_ID:
config.pigzombies = checked;
break;
case SKELETONS_ID:
config.skeletons = checked;
break;
case ILLAGER_ID:
config.illagers = checked;
break;
}
}
}
示例6: BoolSetting
import com.mumfrey.liteloader.client.gui.GuiCheckbox; //导入依赖的package包/类
public BoolSetting(String name, Consumer<Boolean> consumer, boolean value) {
super(name, consumer, value, 30, 14);
this.chkbox = new GuiCheckbox(0, 0, 0, name);
this.chkbox.checked = value;
}
示例7: option
import com.mumfrey.liteloader.client.gui.GuiCheckbox; //导入依赖的package包/类
public OptionSetting<E> option(E sorter, String name) {
height += 16;
this.options.put(sorter, new GuiCheckbox(height, xPos, yPos, name));
return this;
}
示例8: onPresetPressed
import com.mumfrey.liteloader.client.gui.GuiCheckbox; //导入依赖的package包/类
private void onPresetPressed(GuiCheckbox chk) {
this.presets.values().forEach(it -> it.checked = false);
chk.checked = true;
String cmd = this.presets.inverse().get(chk);
this.set(cmd);
}
示例9: onPanelShown
import com.mumfrey.liteloader.client.gui.GuiCheckbox; //导入依赖的package包/类
@Override
public void onPanelShown(ConfigPanelHost host) //TODO: add support for .lang files
{
mod = host.getMod();
ScaledResolution scaledResolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight);
GuiControl.setScreenSizeAndScale(host.getWidth(), host.getHeight(), scaledResolution.getScaleFactor());
int id = 0;
int line = 0;
this.GuiButtons.clear();
this.ColouredConfigLines.clear();
GuiButtons.add(ContDurStringBox = new GuiCheckbox(id++, RANK_ONE, SPACING * line++, "Draw durability string"));
String[] ContDurModeStrings = {"Normal number", "Percentual value"};
ContDurModeRadioController = new GuiRadioHandler(this.mc, this.fr, ContDurModeStrings ,id++, RANK_TWO, line++, "Display the current durability as a", LiteModDurabilityViewer.instance.DurMode[0], LiteModDurabilityViewer.instance.RDurString);
line += ContDurModeStrings.length;
String[] DurSizeStrings = {"Display a small font", "Display a large font (disables durability bar)"};
DurSizeRadioController = new GuiRadioHandler(this.mc, this.fr, DurSizeStrings,id++, RANK_TWO, line++, "Size of the displayed font", LiteModDurabilityViewer.instance.DurSize, LiteModDurabilityViewer.instance.RDurString);
line += DurSizeStrings.length;
ColouredConfigLines.add(ContStaticColour = new GuiColourConfigLine(this.mc, id++, RANK_TWO, SPACING * line++, "Use static colour",
ColourUtils.RGBConverter(LiteModDurabilityViewer.instance.ContDurColour).getRGB(),
LiteModDurabilityViewer.instance.ContStaticColour,
LiteModDurabilityViewer.instance.RDurString));
GuiButtons.add(ContDurbarBox = new GuiCheckbox(id++, RANK_TWO, SPACING * line++, "Draw the vanilla durabilitybar on top of the item texture"));
ColouredConfigLines.add(ArrowColour = new GuiColourConfigLine(this.mc, id++, RANK_ONE, SPACING * line++, "Display arrowcount in the hud",
ColourUtils.RGBConverter(LiteModDurabilityViewer.instance.ArrowColour).getRGB(),
LiteModDurabilityViewer.instance.ArrowCount,
true));
GuiButtons.add(ArmourDurStringBox = new GuiCheckbox(id++, RANK_ONE, SPACING * line++, "Draw your armour-status on the hud"));
String[] ArmourDurModeStrings = {"Normal number", "Percentual value"};
ArmourDurModeRadioController = new GuiRadioHandler(this.mc, this.fr, ArmourDurModeStrings, id++, RANK_TWO, line++, "Display current armour durability as a", LiteModDurabilityViewer.instance.DurMode[1], LiteModDurabilityViewer.instance.RADur);
line += ArmourDurModeStrings.length;
String[] ArmourLocModes = {"top center", "right of the hotbar", "left of the hotbar"};
ArmourLocRadioControler = new GuiRadioHandler(this.mc, this.fr, ArmourLocModes, id++, RANK_TWO, line++, "Where to draw the armour HUD", LiteModDurabilityViewer.instance.ArmourLoc, LiteModDurabilityViewer.instance.RADur);
line += ArmourLocModes.length;
ColouredConfigLines.add(ArmourStaticColour = new GuiColourConfigLine(this.mc, id++, RANK_TWO, SPACING * line++, "Use a static colour",
ColourUtils.RGBConverter(LiteModDurabilityViewer.instance.ArmourDurColour).getRGB(),
LiteModDurabilityViewer.instance.ArmourStaticColour,
LiteModDurabilityViewer.instance.RADur));
//noinspection UnusedAssignment
GuiButtons.add(ArmourDurbarBox = new GuiCheckbox(id++, RANK_TWO, SPACING * line++, "Draw the vanilla durabilitybar on top of the armour pieces on armourhud"));
GuiButtons.addAll(ColouredConfigLines);
GuiButtons.addAll(ContDurModeRadioController.getButtons());
GuiButtons.addAll(DurSizeRadioController.getButtons());
GuiButtons.addAll(ArmourDurModeRadioController.getButtons());
GuiButtons.addAll(ArmourLocRadioControler.getButtons());
ArmourDurStringBox.checked = LiteModDurabilityViewer.instance.RADur;
ArmourDurbarBox.checked = LiteModDurabilityViewer.instance.RADurBar;
ContDurStringBox.checked = LiteModDurabilityViewer.instance.RDurString;
ContDurbarBox.checked = LiteModDurabilityViewer.instance.RCDurBar && DurSizeRadioController.getSettings() == 0;
ContDurbarBox.enabled = LiteModDurabilityViewer.instance.DurSize == 0;
}