本文整理汇总了Java中net.minecraftforge.fml.client.config.GuiCheckBox类的典型用法代码示例。如果您正苦于以下问题:Java GuiCheckBox类的具体用法?Java GuiCheckBox怎么用?Java GuiCheckBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GuiCheckBox类属于net.minecraftforge.fml.client.config包,在下文中一共展示了GuiCheckBox类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initGui
import net.minecraftforge.fml.client.config.GuiCheckBox; //导入依赖的package包/类
@Override
public void initGui()
{
int yBase = this.height / 2 - (106 / 2);
connectButton = new GuiButton(0, width / 2 - 40, this.height - 30, 80, 20, I18n.format("creeperhost.multiplayer.connect"));
if (canConnect)
{
buttonList.add(connectButton);
}
cancelButton = new GuiButton(1, width - 100, this.height - 30, 80, 20, I18n.format("creeperhost.multiplayer.cancel"));
buttonList.add(cancelButton);
String checkText = I18n.format("creeperhost.multiplayer.addlist");
int checkWidth = 11 + 2 + fontRendererObj.getStringWidth(checkText);
checkBox = new GuiCheckBox(2, (width / 2) - (checkWidth / 2), yBase + 36 + 30 + 30, checkText, addToServerList);
buttonList.add(checkBox);
}
开发者ID:CreeperHost,项目名称:CreeperHostGui,代码行数:17,代码来源:GuiInvited.java
示例2: initGui
import net.minecraftforge.fml.client.config.GuiCheckBox; //导入依赖的package包/类
@Override
public void initGui() {
super.initGui();
final int HALF_W = (width - xSize) / 2;
this.buttonList.add(graveButton = new GuiButton(GRAVE_BUTTON_ID, HALF_W, 20, 75, 20, this.GRAVE_BUTTON_STR));
this.buttonList.add(memorialButton = new GuiButton(1, HALF_W + 100, 20, 75, 20, this.MEMORIAL_BUTTON_STR));
graveButton.enabled = false;
//type
this.buttonList.add(typeSlider = new ChiselTypeSlider(TYPE_SLIDER_ID, HALF_W, 45, 176, 20, 0, this));
//material
this.buttonList.add(materialSlider = new ChiselMaterialSlider(MATERIAL_SLIDER_ID, HALF_W, 70, 176, 20, 0, this));
this.buttonList.add(isEnchantedButton = new GuiCheckBox(IS_ENCHANTED_CHECKBOX_ID, 125, 95, "Enchanted", false));
this.buttonList.add(isMossyButton = new GuiCheckBox(IS_MOSSY_CHECKBOX_ID, 200, 95, "Mossy", false));
}
开发者ID:NightKosh,项目名称:Gravestone-mod-Extended,代码行数:18,代码来源:GSChiselCraftingGui.java
示例3: GuiDirectorConfigOptions
import net.minecraftforge.fml.client.config.GuiCheckBox; //导入依赖的package包/类
public GuiDirectorConfigOptions(GuiCameraEditor editor)
{
super(editor);
this.reload = new GuiCheckBox(-1, 0, 0, I18n.format("blockbuster.gui.aperture.config.reload"), CameraHandler.actions);
this.reload.packedFGColour = 0xffffff;
this.actions = new GuiCheckBox(-2, 0, 0, I18n.format("blockbuster.gui.aperture.config.actions"), CameraHandler.reload);
this.actions.packedFGColour = 0xffffff;
this.reloadScene = new GuiButton(-3, 0, 0, 100, 20, I18n.format("blockbuster.gui.aperture.config.reload_scene"));
this.buttons.add(this.reload);
this.buttons.add(this.actions);
this.buttons.add(this.reloadScene);
for (GuiButton button : this.buttons.buttons)
{
this.max = Math.max(this.max, button.width);
}
}
开发者ID:mchorse,项目名称:blockbuster,代码行数:22,代码来源:GuiDirectorConfigOptions.java
示例4: initGui
import net.minecraftforge.fml.client.config.GuiCheckBox; //导入依赖的package包/类
@Override
public void initGui() {
this.redSlider = new GuiSlider(1, this.width / 2 - 100, this.height / 2 - 40, "Red", this.startR, 255);
this.greenSlider = new GuiSlider(2, this.width / 2 - 100, this.height / 2 - 20, "Green", this.startG, 255);
this.blueSlider = new GuiSlider(3, this.width / 2 - 100, this.height / 2 - 0, "Blue", this.startB, 255);
this.enableBox = new GuiCheckBox(4, this.width / 2 - 100, this.height / 2 - 60, "Enable Xray for this block", this.isEnabled);
this.addButton = new GuiButton(98, this.width - 100, this.height - 20, 100, 20, "Apply");
this.redSlider.enabled = false;
this.greenSlider.enabled = false;
this.blueSlider.enabled = false;
this.buttonList.add(new GuiButton(99, 2, this.height - 20, 100, 20, "Cancel"));
this.buttonList.add(this.addButton);
this.buttonList.add(this.redSlider);
this.buttonList.add(this.greenSlider);
this.buttonList.add(this.blueSlider);
this.buttonList.add(this.enableBox);
}
开发者ID:MrNobody98,项目名称:morecommands,代码行数:20,代码来源:XrayConfGui.java
示例5: updateButtons
import net.minecraftforge.fml.client.config.GuiCheckBox; //导入依赖的package包/类
private void updateButtons() {
this.btnToggle.displayString = I18n.format(this.marker.enabled ? Names.Gui.GuiMarkerEdit.ON : Names.Gui.GuiMarkerEdit.OFF);
this.nfMarkerLength.setEnabled(this.marker.enabled);
this.nfX.setEnabled(this.marker.enabled);
this.nfY.setEnabled(this.marker.enabled);
this.nfZ.setEnabled(this.marker.enabled);
this.sliderSpacing.enabled = this.marker.enabled;
this.sliderR.enabled = this.marker.enabled;
this.sliderG.enabled = this.marker.enabled;
this.sliderB.enabled = this.marker.enabled;
for (final GuiCheckBox checkBox : this.checkBoxes) {
checkBox.enabled = this.marker.enabled;
}
this.btnMove.enabled = this.marker.enabled;
}
开发者ID:Lunatrius,项目名称:Laser-Level,代码行数:20,代码来源:GuiMarkerEdit.java
示例6: initGui
import net.minecraftforge.fml.client.config.GuiCheckBox; //导入依赖的package包/类
@Override
public void initGui()
{
super.initGui();
int halfWidth = this.width / 2;
int halfHeight = this.height / 2;
this.nameField = new GuiTextFieldValidate(0, this.fontRendererObj, halfWidth - 100, halfHeight - 50, 200, 20, "([A-Za-z0-9]*)");
this.nameField.setMaxStringLength(Constants.MAX_SERVER_NAME_LENGTH);
this.nameField.setText(this.order.name.isEmpty() ? Util.getDefaultName() : this.order.name);
this.order.name = this.nameField.getText().trim();
String checkboxString = Util.localize("info.pregen");
int checkboxWidth = this.fontRendererObj.getStringWidth(checkboxString) + 11 + 2;
pregen = new GuiCheckBox(3, halfWidth - (checkboxWidth / 2), halfHeight - 8, checkboxString, order.pregen);
if (Config.getInstance().getPregenDiameter() > 0)
{
this.buttonList.add(pregen);
}
this.slotSlider = new GuiSlider(this, 1, halfWidth - 100, halfHeight + 15, Util.localize("slider.player_count"), Constants.MIN_PLAYER_COUNT, Constants.MAX_PLAYER_COUNT, this.order.playerAmount, SLIDER_FORMATTER);
this.slotSlider.width = 200;
this.buttonList.add(this.slotSlider);
}
开发者ID:CreeperHost,项目名称:CreeperHostGui,代码行数:29,代码来源:GuiGeneralServerInfo.java
示例7: initGui
import net.minecraftforge.fml.client.config.GuiCheckBox; //导入依赖的package包/类
@Override
public void initGui(){
super.initGui();
int x = 10;
int y = 10;
for(int i = 0; i < checkboxes.length; i++){
NetworkAbility ability = NetworkAbility.values()[i];
if(i == 4) {
x = 90;
y = 10;
}
y+=10;
buttonList.add(checkboxes[i] = new GuiCheckBox(i, guiLeft+x, guiTop+y, ability.getId(), false));
}
}
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:16,代码来源:GuiSecurityEncoder.java
示例8: initGui
import net.minecraftforge.fml.client.config.GuiCheckBox; //导入依赖的package包/类
/**
* I think Mojang should come up with something better than hardcoded
* positions and sizes for buttons. Something like HTML. Maybe I should
* write this library (for constructing minecraft GUIs). Hm...
*/
@Override
public void initGui()
{
int x = 10;
int w = 100;
int y2 = this.height - 30;
/* Initializing all GUI fields first */
this.invisible = new GuiCheckBox(2, x, y2 - 40, I18n.format("blockbuster.gui.actor.invisible"), this.actor.invisible);
this.freeze = new GuiCheckBox(3, x, y2 - 20, I18n.format("blockbuster.gui.actor.freeze"), this.actor.noClip);
/* Buttons */
this.done = new GuiButton(0, x, y2, w, 20, I18n.format("blockbuster.gui.done"));
this.pick = new GuiButton(1, x, 40, w, 20, I18n.format("blockbuster.gui.pick"));
this.rotateX = new GuiSlider(-1, x, 40 + 30, w, 20, I18n.format("blockbuster.gui.actor.yaw") + " ", "", -180, 180, this.actor.rotationYaw, false, true);
this.rotateY = new GuiSlider(-2, x, 40 + 30 * 2, w, 20, I18n.format("blockbuster.gui.actor.pitch") + " ", "", -90, 90, this.actor.rotationPitch, false, true);
/* And then, we're configuring them and injecting input data */
this.fillData();
this.buttonList.add(this.done);
this.buttonList.add(this.pick);
this.buttonList.add(this.invisible);
this.buttonList.add(this.freeze);
this.buttonList.add(this.rotateX);
this.buttonList.add(this.rotateY);
this.morphs.updateRect(120, 30, this.width - 120, this.height - 30);
}
开发者ID:mchorse,项目名称:blockbuster,代码行数:37,代码来源:GuiActor.java
示例9: GuiCustomModelMorphBuilder
import net.minecraftforge.fml.client.config.GuiCheckBox; //导入依赖的package包/类
public GuiCustomModelMorphBuilder()
{
super();
/* TODO: extract strings */
this.model = new GuiTextField(0, font, 0, 0, 0, 0);
this.model.setMaxStringLength(200);
this.texture = new GuiTextField(0, font, 0, 0, 0, 0);
this.texture.setMaxStringLength(500);
this.poses = new GuiDropDownField(this.font, this);
this.poseOnSneak = new GuiCheckBox(0, 0, 0, "Pose will apply when sneaking", false);
}
开发者ID:mchorse,项目名称:blockbuster,代码行数:13,代码来源:GuiCustomModelMorphBuilder.java
示例10: CommandSlotCheckbox
import net.minecraftforge.fml.client.config.GuiCheckBox; //导入依赖的package包/类
/**
* Constructs a checkbox with the specified text and the specified hover
* text. If you don't want text but want hover text, pass null into the
* first argument
*
* @param text
* @param hoverText
*/
public CommandSlotCheckbox(String text, String hoverText) {
super(text == null || text.isEmpty() ? 11 : 13 + Minecraft.getMinecraft().fontRendererObj.getStringWidth(text),
11);
this.checkbox = new GuiCheckBox(0, 0, 0, text == null ? "" : text, false);
if (hoverText != null)
this.hoverChecker = new HoverChecker(checkbox, 1000);
this.hoverText = hoverText;
}
开发者ID:Earthcomputer,项目名称:Easy-Editors,代码行数:17,代码来源:CommandSlotCheckbox.java
示例11: initGui
import net.minecraftforge.fml.client.config.GuiCheckBox; //导入依赖的package包/类
@Override
public void initGui() {
super.initGui();
//TODO: Adjust background image & draw inside ;)
buttonList.add(cbIgnoreRedstone = new GuiButtonExt(10, guiLeft + xSize, guiTop, "Redstone Mode"));
buttonList.add(cbEject = new GuiCheckBox(20, guiLeft + xSize, guiTop + 20, "Eject into World", tileEntity.isEject()));
buttonList.add(cbLinearMode = new GuiCheckBox(30, guiLeft + xSize, guiTop + 35, "Linear Mode", tileEntity.isLinearMode()));
buttonList.add(cbStackMode = new GuiCheckBox(40, guiLeft + xSize, guiTop + 50, "Stack Mode", tileEntity.isStackMode()));
cbStackMode.visible = tileEntity.isHighSpeed();
setRedstoneModeText();
}
开发者ID:Team-IO,项目名称:taam,代码行数:12,代码来源:GuiConveyorHopper.java
示例12: actionPerformed
import net.minecraftforge.fml.client.config.GuiCheckBox; //导入依赖的package包/类
@Override
protected void actionPerformed(final GuiButton button) throws IOException {
if (button.enabled) {
if (button.id == this.nfMarkerLength.id) {
this.marker.markerLength = this.nfMarkerLength.getValue();
RenderMarkers.INSTANCE.markDirty();
} else if (button.id == this.nfX.id) {
this.marker.pos.x = this.nfX.getValue();
RenderMarkers.INSTANCE.markDirty();
} else if (button.id == this.nfY.id) {
this.marker.pos.y = this.nfY.getValue();
RenderMarkers.INSTANCE.markDirty();
} else if (button.id == this.nfZ.id) {
this.marker.pos.z = this.nfZ.getValue();
RenderMarkers.INSTANCE.markDirty();
} else if (button.id == this.btnToggle.id) {
this.marker.enabled = !this.marker.enabled;
updateButtons();
RenderMarkers.INSTANCE.markDirty();
} else if (button.id == this.btnMove.id) {
this.marker.pos.set(this.mc.player);
this.marker.dimension = this.mc.player.dimension;
this.nfX.setValue(this.marker.pos.x);
this.nfY.setValue(this.marker.pos.y);
this.nfZ.setValue(this.marker.pos.z);
RenderMarkers.INSTANCE.markDirty();
} else if (button.id == this.btnDone.id) {
this.mc.displayGuiScreen(this.parentScreen);
} else {
for (final EnumFacing side : EnumFacing.VALUES) {
final GuiCheckBox checkBox = this.checkBoxes[side.ordinal()];
if (button.id == checkBox.id) {
this.marker.setEnabled(side, checkBox.isChecked());
RenderMarkers.INSTANCE.markDirty();
}
}
}
}
super.actionPerformed(button);
}
开发者ID:Lunatrius,项目名称:Laser-Level,代码行数:41,代码来源:GuiMarkerEdit.java
示例13: initiate
import net.minecraftforge.fml.client.config.GuiCheckBox; //导入依赖的package包/类
@Override
public void initiate()
{
super.initiate();
int x = this.x + this.width;
int y = this.y + this.height;
int w = this.width;
/* Some dirty way to make things dynamically adjust or so */
y -= 30;
this.done = new GuiButton(this.id, x - this.buttonWidth - 10, y, this.buttonWidth, 20, I18n.format("blockbuster.gui.done"));
y -= 25;
this.providesObj = new GuiCheckBox(0, x, y, I18n.format("blockbuster.gui.me.model.provides_obj"), false);
this.providesObj.xPosition -= this.providesObj.width + 12;
y -= 25;
w = this.width - this.font.getStringWidth(this.strTexture) - 24;
this.texture = new GuiTextField(0, this.font, x - 10 - w + 1, y, w - 3, 18);
y -= 25;
w = this.width - this.font.getStringWidth(this.strTextureSize) - 24;
this.textureSize = new GuiTwoInput(0, this.font, x - 10 - w, y, w, null);
y -= 25;
w = this.width - this.font.getStringWidth(this.strScale) - 24;
this.scale = new GuiThreeInput(0, this.font, x - 10 - w, y, w, null);
y -= 25;
w = this.width - this.font.getStringWidth(this.strName) - 24;
this.name = new GuiTextField(0, this.font, x - 10 - w + 1, y, w - 2, 18);
this.buttons.clear();
this.buttons.add(this.done);
if (this.model != null)
{
this.name.setText(this.model.name);
this.scale.a.setText(String.valueOf(this.model.scale[0]));
this.scale.b.setText(String.valueOf(this.model.scale[1]));
this.scale.c.setText(String.valueOf(this.model.scale[2]));
this.textureSize.a.setText(String.valueOf(this.model.texture[0]));
this.textureSize.b.setText(String.valueOf(this.model.texture[1]));
this.texture.setMaxStringLength(200);
if (this.model.defaultTexture != null)
{
this.texture.setText(this.model.defaultTexture.toString());
}
this.texture.setCursorPosition(0);
this.providesObj.setIsChecked(this.model.providesObj);
}
}
开发者ID:mchorse,项目名称:blockbuster,代码行数:55,代码来源:GuiModelModal.java
示例14: GuiLimbEditor
import net.minecraftforge.fml.client.config.GuiCheckBox; //导入依赖的package包/类
/**
* Initiate all GUI fields here
*
* I don't understand why Minecraft's GUI create new fields every time in
* iniGui (only makes sense for {@link InitGuiEvent}, but then you still can
* create buttons only once, update their positions and add them to
* buttonList).
*/
public GuiLimbEditor(GuiModelEditor editor)
{
this.editor = editor;
FontRenderer font = Minecraft.getMinecraft().fontRendererObj;
final int width = 100;
/* Buttons */
this.name = new GuiButton(NAME, 0, 0, width, 20, I18n.format("blockbuster.gui.me.name"));
this.parent = new GuiButton(PARENT, 0, 0, width, 20, I18n.format("blockbuster.gui.me.parent"));
/* Initiate inputs */
this.mirror = new GuiCheckBox(MIRROR, 0, 0, I18n.format("blockbuster.gui.me.mirror"), false);
this.texture = new GuiTwoInput(TEXTURE, font, 0, 0, 0, this);
this.size = new GuiThreeInput(SIZE, font, 0, 0, 0, this);
this.anchor = new GuiThreeInput(ANCHOR, font, 0, 0, 0, this);
this.color = new GuiThreeInput(COLOR, font, 0, 0, 0, this);
this.opacity = new GuiTextField(OPACITY, font, 0, 0, 0, 16);
this.opacity.setGuiResponder(this);
/* Gameplay */
this.looking = new GuiCheckBox(LOOKING, 0, 0, I18n.format("blockbuster.gui.me.looking"), false);
this.idle = new GuiCheckBox(IDLE, 0, 0, I18n.format("blockbuster.gui.me.idle"), false);
this.swinging = new GuiCheckBox(SWINGING, 0, 0, I18n.format("blockbuster.gui.me.swinging"), false);
this.swiping = new GuiCheckBox(SWIPING, 0, 0, I18n.format("blockbuster.gui.me.swiping"), false);
this.invert = new GuiCheckBox(INVERT, 0, 0, I18n.format("blockbuster.gui.me.invert"), false);
this.holding = new GuiCirculate(HOLDING, 0, 0, width, 20);
this.holding.addLabel(I18n.format("blockbuster.gui.me.no_hands"));
this.holding.addLabel(I18n.format("blockbuster.gui.me.right_hand"));
this.holding.addLabel(I18n.format("blockbuster.gui.me.left_hand"));
/* Poses */
this.translate = new GuiThreeInput(TRANSLATE, font, 0, 0, width, this);
this.scale = new GuiThreeInput(SCALE, font, 0, 0, width, this);
this.rotate = new GuiThreeInput(ROTATE, font, 0, 0, width, this);
this.origin = new GuiThreeInput(ORIGIN, font, 0, 0, width, this);
/* Category buttons */
this.next = new GuiButton(-1, 0, 0, ">");
this.prev = new GuiButton(-2, 0, 0, "<");
}
开发者ID:mchorse,项目名称:blockbuster,代码行数:51,代码来源:GuiLimbEditor.java
示例15: actionPerformed
import net.minecraftforge.fml.client.config.GuiCheckBox; //导入依赖的package包/类
@Override
protected void actionPerformed(GuiButton button) throws IOException {
super.actionPerformed(button);
switch(button.id) {
case 100:
for(int i=0; i<switches.length; i++) {
switches[i].enabled = true;
if(switches[i] == button) {
selectedButton = i;
}
}
button.enabled = false;
initButtonList();
selectDomainList(domainListSelection);
break;
case 104:
globalSetting.lockRotation = !globalSetting.lockRotation;
button.displayString = globalSetting.lockRotation ? i18n("lockyes") : i18n("lockno");
if (globalSetting.lockRotation) {
double curValue = rotationSlider.getValue();
double newValue = 0;
int temp = (int) (curValue % 90);
if (temp < 45) {
newValue = curValue - temp;
} else {
newValue = curValue + 90 - temp;
}
int newValueInt = MathHelper.floor_double(newValue);
globalSetting.rotation = newValueInt;
rotationSlider.setValue(newValueInt);
rotationSlider.updateSlider();
}
break;
case 105:
saveCurrentSelection();
break;
case 106:
saveAll();
break;
case 109:
globalSetting.saveGif = ((GuiCheckBox)button).isChecked();
break;
case 200:
mc.displayGuiScreen(parent);
break;
}
}
开发者ID:herbix,项目名称:renderTo,代码行数:48,代码来源:RenderToGuiScreen.java
示例16: initGui
import net.minecraftforge.fml.client.config.GuiCheckBox; //导入依赖的package包/类
@Override
public void initGui() {
addButton(new GuiButton(0, width / 2 - 160, height - 15 - 10, 150, 20, I18n.format("gui.done")));
cancelButton = addButton(
new GuiButton(1, width / 2 + 5, height - 15 - 10, 150, 20, I18n.format("gui.cancel")));
int halfWidth = width / 2;
int halfHeight = height / 2;
TextFormatting[] colors = new TextFormatting[17];
String[] displayNames = new String[17];
displayNames[0] = Translate.GUI_COMMANDEDITOR_SELECTTEAM_OPTIONS_COLOR_NONE;
for (int i = 0; i < 16; i++) {
colors[i + 1] = TextFormatting.fromColorIndex(i);
displayNames[i + 1] = I18n.format("color." + colors[i + 1].getFriendlyName());
}
color = addButton(
new CycleButton<TextFormatting>(halfWidth, halfHeight - 85, 100, 20, colors, displayNames));
color.setCurrentValue(options.color);
friendlyFire = addButton(new GuiCheckBox(-1, halfWidth, halfHeight - 52, "", options.friendlyFire));
seeFriendlyInvisibles = addButton(
new GuiCheckBox(-1, halfWidth, halfHeight - 22, "", options.seeFriendlyInvisibles));
Team.EnumVisible[] visibilities = Team.EnumVisible.values();
displayNames = new String[visibilities.length];
for (int i = 0; i < visibilities.length; i++) {
displayNames[i] = I18n
.format("gui.commandEditor.selectTeam.options.visibility." + visibilities[i].internalName);
}
nameTagVisibility = addButton(new CycleButton<Team.EnumVisible>(halfWidth, halfHeight + 5, 100, 20,
visibilities, displayNames));
nameTagVisibility.setCurrentValue(options.nameTagVisibility);
deathMessageVisibility = addButton(new CycleButton<Team.EnumVisible>(halfWidth, halfHeight + 35, 100,
20, visibilities, displayNames));
deathMessageVisibility.setCurrentValue(options.deathMessageVisibility);
Team.CollisionRule[] collisionRules = Team.CollisionRule.values();
displayNames = new String[visibilities.length];
for (int i = 0; i < collisionRules.length; i++) {
displayNames[i] = I18n
.format("gui.commandEditor.selectTeam.options.collisionRule." + collisionRules[i].name);
}
collisionRule = addButton(new CycleButton<Team.CollisionRule>(halfWidth, halfHeight + 65, 100, 20,
collisionRules, displayNames));
collisionRule.setCurrentValue(options.collisionRule);
}
开发者ID:Earthcomputer,项目名称:Easy-Editors,代码行数:50,代码来源:GuiSelectTeam.java
示例17: initGui
import net.minecraftforge.fml.client.config.GuiCheckBox; //导入依赖的package包/类
@Override
public void initGui() {
super.initGui();
final int centerX = this.width / 2;
final int centerY = this.height / 2;
final int nfOffsetX = 25;
final int nfHeight = 20;
int id = -1;
this.nfMarkerLength = new GuiNumericField(this.mc.fontRenderer, ++id, centerX + nfOffsetX, centerY - nfHeight / 2 - (nfHeight + 5) * 4);
this.buttonList.add(this.nfMarkerLength);
this.nfX = new GuiNumericField(this.mc.fontRenderer, ++id, centerX + nfOffsetX, centerY - nfHeight / 2 - (nfHeight + 5) * 3);
this.buttonList.add(this.nfX);
this.nfY = new GuiNumericField(this.mc.fontRenderer, ++id, centerX + nfOffsetX, centerY - nfHeight / 2 - (nfHeight + 5) * 2);
this.buttonList.add(this.nfY);
this.nfZ = new GuiNumericField(this.mc.fontRenderer, ++id, centerX + nfOffsetX, centerY - nfHeight / 2 - (nfHeight + 5) * 1);
this.buttonList.add(this.nfZ);
final int sliderWidth = 250;
final int sliderHeight = 20;
this.sliderSpacing = new GuiSlider(this.guiResponder, ++id, centerX - sliderWidth / 2, centerY - sliderHeight / 2 + (sliderHeight + 5) * 0, I18n.format(Names.Gui.GuiMarkerEdit.SPACING), 1.0f, 128.0f, this.marker.spacing, this.formatValue);
this.sliderSpacing.width = sliderWidth;
this.buttonList.add(this.sliderSpacing);
this.sliderR = new GuiSlider(this.guiResponder, ++id, centerX - sliderWidth / 2, centerY - sliderHeight / 2 + (sliderHeight + 5) * 1, I18n.format(Names.Gui.GuiMarkerEdit.RED), 0, 255, this.marker.getRed(), this.formatValue);
this.sliderR.width = sliderWidth;
this.buttonList.add(this.sliderR);
this.sliderG = new GuiSlider(this.guiResponder, ++id, centerX - sliderWidth / 2, centerY - sliderHeight / 2 + (sliderHeight + 5) * 2, I18n.format(Names.Gui.GuiMarkerEdit.GREEN), 0, 255, this.marker.getGreen(), this.formatValue);
this.sliderG.width = sliderWidth;
this.buttonList.add(this.sliderG);
this.sliderB = new GuiSlider(this.guiResponder, ++id, centerX - sliderWidth / 2, centerY - sliderHeight / 2 + (sliderHeight + 5) * 3, I18n.format(Names.Gui.GuiMarkerEdit.BLUE), 0, 255, this.marker.getBlue(), this.formatValue);
this.sliderB.width = sliderWidth;
this.buttonList.add(this.sliderB);
final EnumFacing[] sides = new EnumFacing[] {
EnumFacing.WEST, EnumFacing.EAST, EnumFacing.DOWN, EnumFacing.UP, EnumFacing.NORTH, EnumFacing.SOUTH
};
final int cbBaseOffsetX = -120;
for (int i = 0; i < sides.length; i++) {
final EnumFacing side = sides[i];
final int cbOffsetX = side.ordinal() % 2 == 0 ? 0 : 60;
final int cbHeight = 20;
this.checkBoxes[side.ordinal()] = new GuiCheckBox(++id, centerX + cbBaseOffsetX + cbOffsetX, centerY + (cbHeight + 5) * (i / 2 - 3) - 5, I18n.format(Names.Gui.GuiMarkerEdit.SIDE_BASE + side.getName()), this.marker.isEnabled(side));
this.buttonList.add(this.checkBoxes[side.ordinal()]);
}
this.btnToggle = new GuiButton(++id, centerX - 4 - 150, this.height - 25, 100, 20, I18n.format(this.marker.enabled ? Names.Gui.GuiMarkerEdit.ON : Names.Gui.GuiMarkerEdit.OFF));
this.buttonList.add(this.btnToggle);
this.btnMove = new GuiButton(++id, centerX - 50, this.height - 25, 100, 20, I18n.format(Names.Gui.GuiMarkers.MOVE));
this.buttonList.add(this.btnMove);
this.btnDone = new GuiButton(++id, centerX + 4 + 50, this.height - 25, 100, 20, I18n.format(Names.Gui.GuiMarkers.DONE));
this.buttonList.add(this.btnDone);
this.nfMarkerLength.setMinimum(0);
this.nfMarkerLength.setMaximum(Constants.Rendering.MAX_LENGTH);
this.nfX.setMinimum(Constants.World.MINIMUM_COORD);
this.nfX.setMaximum(Constants.World.MAXIMUM_COORD);
this.nfY.setMinimum(Constants.World.MINIMUM_COORD);
this.nfY.setMaximum(Constants.World.MAXIMUM_COORD);
this.nfZ.setMinimum(Constants.World.MINIMUM_COORD);
this.nfZ.setMaximum(Constants.World.MAXIMUM_COORD);
this.nfMarkerLength.setValue(this.marker.markerLength);
this.nfX.setValue(this.marker.pos.x);
this.nfY.setValue(this.marker.pos.y);
this.nfZ.setValue(this.marker.pos.z);
updateButtons();
}
开发者ID:Lunatrius,项目名称:Laser-Level,代码行数:81,代码来源:GuiMarkerEdit.java
注:本文中的net.minecraftforge.fml.client.config.GuiCheckBox类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论