use of net.minecraftforge.fml.client.config.GuiButtonExt in project Cavern2 by kegare.
the class GuiMiningRecords method initGui.
@Override
public void initGui() {
if (recordList == null) {
recordList = new RecordList();
}
recordList.setDimensions(width, height, 32, height - 28);
if (doneButton == null) {
doneButton = new GuiButtonExt(0, 0, 0, 145, 20, I18n.format("gui.done"));
}
doneButton.x = width / 2 + 10;
doneButton.y = height - doneButton.height - 4;
if (detailInfo == null) {
detailInfo = new GuiCheckBox(1, 0, 12, I18n.format(Config.LANG_KEY + "detail"), true);
}
detailInfo.setIsChecked(CaveConfigGui.detailInfo);
detailInfo.x = width / 2 + 95;
buttonList.clear();
buttonList.add(doneButton);
buttonList.add(detailInfo);
detailHoverChecker = new HoverChecker(detailInfo, 800);
selectedHoverChecker = new HoverChecker(0, 20, 0, 100, 800);
}
use of net.minecraftforge.fml.client.config.GuiButtonExt in project Cavern2 by kegare.
the class GuiSelectBiome method initGui.
@Override
public void initGui() {
if (biomeList == null) {
biomeList = new BiomeList();
}
biomeList.setDimensions(width, height, 32, height - 28);
if (doneButton == null) {
doneButton = new GuiButtonExt(0, 0, 0, 145, 20, I18n.format("gui.done"));
}
doneButton.x = width / 2 + 10;
doneButton.y = height - doneButton.height - 4;
if (detailInfo == null) {
detailInfo = new GuiCheckBox(1, 0, 5, I18n.format(Config.LANG_KEY + "detail"), true);
}
detailInfo.setIsChecked(CaveConfigGui.detailInfo);
detailInfo.x = width / 2 + 95;
if (instantFilter == null) {
instantFilter = new GuiCheckBox(2, 0, detailInfo.y + detailInfo.height + 2, I18n.format(Config.LANG_KEY + "instant"), true);
}
instantFilter.setIsChecked(CaveConfigGui.instantFilter);
instantFilter.x = detailInfo.x;
buttonList.clear();
buttonList.add(doneButton);
buttonList.add(detailInfo);
buttonList.add(instantFilter);
if (filterTextField == null) {
filterTextField = new GuiTextField(0, fontRenderer, 0, 0, 150, 16);
filterTextField.setMaxStringLength(100);
}
filterTextField.x = width / 2 - filterTextField.width - 5;
filterTextField.y = height - filterTextField.height - 6;
selectedHoverChecker = new HoverChecker(0, 20, 0, 100, 800);
detailHoverChecker = new HoverChecker(detailInfo, 800);
instantHoverChecker = new HoverChecker(instantFilter, 800);
}
use of net.minecraftforge.fml.client.config.GuiButtonExt in project Cavern2 by kegare.
the class GuiSelectBlock method initGui.
@Override
public void initGui() {
if (blockList == null) {
blockList = new BlockList();
}
blockList.setDimensions(width, height, 32, height - 28);
boolean hasSwitch = switchEntry != null;
int buttonWidth = hasSwitch ? 70 : 145;
if (doneButton == null) {
doneButton = new GuiButtonExt(0, 0, 0, buttonWidth, 20, I18n.format("gui.done"));
}
doneButton.x = width / 2 + 10;
doneButton.y = height - doneButton.height - 4;
if (switchButton == null) {
switchButton = new GuiButtonExt(3, 0, 0, buttonWidth, 20, hasSwitch ? switchEntry.getTranslatedName() : "");
switchButton.visible = hasSwitch;
}
switchButton.x = doneButton.x;
switchButton.y = doneButton.y;
if (hasSwitch) {
doneButton.x += buttonWidth + 3;
}
if (detailInfo == null) {
detailInfo = new GuiCheckBox(1, 0, 5, I18n.format(Config.LANG_KEY + "detail"), true);
}
detailInfo.setIsChecked(CaveConfigGui.detailInfo);
detailInfo.x = width / 2 + 95;
if (instantFilter == null) {
instantFilter = new GuiCheckBox(2, 0, detailInfo.y + detailInfo.height + 2, I18n.format(Config.LANG_KEY + "instant"), true);
}
instantFilter.setIsChecked(CaveConfigGui.instantFilter);
instantFilter.x = detailInfo.x;
buttonList.clear();
buttonList.add(doneButton);
buttonList.add(switchButton);
buttonList.add(detailInfo);
buttonList.add(instantFilter);
if (filterTextField == null) {
filterTextField = new GuiTextField(0, fontRenderer, 0, 0, 150, 16);
filterTextField.setMaxStringLength(100);
}
filterTextField.x = width / 2 - filterTextField.width - 5;
filterTextField.y = height - filterTextField.height - 6;
selectedHoverChecker = new HoverChecker(0, 20, 0, 100, 800);
detailHoverChecker = new HoverChecker(detailInfo, 800);
instantHoverChecker = new HoverChecker(instantFilter, 800);
if (switchEntry != null && mc.currentScreen == this) {
switchEntry.getGuiScreen().setWorldAndResolution(mc, width, height);
}
}
use of net.minecraftforge.fml.client.config.GuiButtonExt in project Cavern2 by kegare.
the class GuiSelectMob method initGui.
@Override
public void initGui() {
if (mobList == null) {
mobList = new MobList();
}
mobList.setDimensions(width, height, 32, height - 28);
if (doneButton == null) {
doneButton = new GuiButtonExt(0, 0, 0, 145, 20, I18n.format("gui.done"));
}
doneButton.x = width / 2 + 10;
doneButton.y = height - doneButton.height - 4;
if (detailInfo == null) {
detailInfo = new GuiCheckBox(1, 0, 5, I18n.format(Config.LANG_KEY + "detail"), true);
}
detailInfo.setIsChecked(CaveConfigGui.detailInfo);
detailInfo.x = width / 2 + 95;
if (instantFilter == null) {
instantFilter = new GuiCheckBox(2, 0, detailInfo.y + detailInfo.height + 2, I18n.format(Config.LANG_KEY + "instant"), true);
}
instantFilter.setIsChecked(CaveConfigGui.instantFilter);
instantFilter.x = detailInfo.x;
buttonList.clear();
buttonList.add(doneButton);
buttonList.add(detailInfo);
buttonList.add(instantFilter);
if (filterTextField == null) {
filterTextField = new GuiTextField(0, fontRenderer, 0, 0, 150, 16);
filterTextField.setMaxStringLength(100);
}
filterTextField.x = width / 2 - filterTextField.width - 5;
filterTextField.y = height - filterTextField.height - 6;
detailHoverChecker = new HoverChecker(detailInfo, 800);
instantHoverChecker = new HoverChecker(instantFilter, 800);
selectedHoverChecker = new HoverChecker(0, 20, 0, 100, 800);
}
use of net.minecraftforge.fml.client.config.GuiButtonExt in project Cavern2 by kegare.
the class GuiSelectOreDict method initGui.
@Override
public void initGui() {
if (oreDictList == null) {
oreDictList = new OreDictList();
}
oreDictList.setDimensions(width, height, 32, height - 28);
boolean hasSwitch = switchEntry != null;
int buttonWidth = hasSwitch ? 70 : 145;
if (doneButton == null) {
doneButton = new GuiButtonExt(0, 0, 0, buttonWidth, 20, I18n.format("gui.done"));
}
doneButton.x = width / 2 + 10;
doneButton.y = height - doneButton.height - 4;
if (switchButton == null) {
switchButton = new GuiButtonExt(3, 0, 0, buttonWidth, 20, hasSwitch ? switchEntry.getTranslatedName() : "");
switchButton.visible = hasSwitch;
}
switchButton.x = doneButton.x;
switchButton.y = doneButton.y;
if (hasSwitch) {
doneButton.x += buttonWidth + 3;
}
if (detailInfo == null) {
detailInfo = new GuiCheckBox(1, 0, 5, I18n.format(Config.LANG_KEY + "detail"), true);
}
detailInfo.setIsChecked(CaveConfigGui.detailInfo);
detailInfo.x = width / 2 + 95;
if (instantFilter == null) {
instantFilter = new GuiCheckBox(2, 0, detailInfo.y + detailInfo.height + 2, I18n.format(Config.LANG_KEY + "instant"), true);
}
instantFilter.setIsChecked(CaveConfigGui.instantFilter);
instantFilter.x = detailInfo.x;
buttonList.clear();
buttonList.add(doneButton);
buttonList.add(switchButton);
buttonList.add(detailInfo);
buttonList.add(instantFilter);
if (filterTextField == null) {
filterTextField = new GuiTextField(0, fontRenderer, 0, 0, 150, 16);
filterTextField.setMaxStringLength(100);
}
filterTextField.x = width / 2 - filterTextField.width - 5;
filterTextField.y = height - filterTextField.height - 6;
selectedHoverChecker = new HoverChecker(0, 20, 0, 100, 800);
detailHoverChecker = new HoverChecker(detailInfo, 800);
instantHoverChecker = new HoverChecker(instantFilter, 800);
if (switchEntry != null && mc.currentScreen == this) {
switchEntry.getGuiScreen().setWorldAndResolution(mc, width, height);
}
}
Aggregations