Started on GUI for player settings.
This commit is contained in:
@@ -14,6 +14,7 @@ public class ModeOptions {
|
||||
REDO("effortlessbuilding.action.redo"),
|
||||
REPLACE("effortlessbuilding.action.replace"),
|
||||
OPEN_MODIFIER_SETTINGS("effortlessbuilding.action.open_modifier_settings"),
|
||||
OPEN_PLAYER_SETTINGS("effortlessbuilding.action.open_player_settings"),
|
||||
|
||||
NORMAL_SPEED("effortlessbuilding.action.normal_speed"),
|
||||
FAST_SPEED("effortlessbuilding.action.fast_speed"),
|
||||
@@ -130,6 +131,10 @@ public class ModeOptions {
|
||||
if (player.world.isRemote)
|
||||
ClientProxy.openModifierSettings();
|
||||
break;
|
||||
case OPEN_PLAYER_SETTINGS:
|
||||
if (player.world.isRemote)
|
||||
ClientProxy.openPlayerSettings();
|
||||
break;
|
||||
|
||||
case NORMAL_SPEED:
|
||||
buildSpeed = ActionEnum.NORMAL_SPEED;
|
||||
@@ -175,7 +180,11 @@ public class ModeOptions {
|
||||
break;
|
||||
}
|
||||
|
||||
if (player.world.isRemote && action != ActionEnum.REPLACE && action != ActionEnum.OPEN_MODIFIER_SETTINGS) {
|
||||
if (player.world.isRemote &&
|
||||
action != ActionEnum.REPLACE &&
|
||||
action != ActionEnum.OPEN_MODIFIER_SETTINGS &&
|
||||
action != ActionEnum.OPEN_PLAYER_SETTINGS) {
|
||||
|
||||
EffortlessBuilding.logTranslate(player, "", action.name, "", true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,304 @@
|
||||
package nl.requios.effortlessbuilding.gui.buildmode;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.SimpleSound;
|
||||
import net.minecraft.client.gui.AbstractGui;
|
||||
import net.minecraft.client.gui.IGuiEventListener;
|
||||
import net.minecraft.client.gui.screen.LanguageScreen;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
import net.minecraft.client.gui.widget.list.ExtendedList;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.fml.client.gui.widget.ExtendedButton;
|
||||
import net.minecraftforge.fml.client.gui.widget.Slider;
|
||||
import nl.requios.effortlessbuilding.EffortlessBuilding;
|
||||
|
||||
public class PlayerSettingsGui extends Screen {
|
||||
|
||||
protected int left, right, top, bottom;
|
||||
|
||||
private Button shaderTypeButton;
|
||||
private ShaderTypeList shaderTypeList;
|
||||
private Button closeButton;
|
||||
|
||||
protected boolean showShaderList = false;
|
||||
|
||||
public enum ShaderType {
|
||||
DISSOLVE_BLUE("Dissolve Blue"),
|
||||
DISSOLVE_ORANGE("Dissolve Orange");
|
||||
|
||||
public String name;
|
||||
ShaderType(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
|
||||
public PlayerSettingsGui() {
|
||||
super(new TranslationTextComponent("effortlessbuilding.screen.player_settings"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
left = this.width / 2 - 140;
|
||||
right = this.width / 2 + 140;
|
||||
top = this.height / 2 - 100;
|
||||
bottom = this.height / 2 + 100;
|
||||
|
||||
int yy = top;
|
||||
shaderTypeList = new ShaderTypeList(this.minecraft);
|
||||
this.children.add(shaderTypeList);
|
||||
//TODO set selected name
|
||||
String currentShaderName = ShaderType.DISSOLVE_BLUE.name;
|
||||
shaderTypeButton = new ExtendedButton(right - 180, yy, 180, 20, currentShaderName, (button) -> {
|
||||
showShaderList = !showShaderList;
|
||||
});
|
||||
addButton(shaderTypeButton);
|
||||
|
||||
yy += 50;
|
||||
Slider slider = new Slider(right - 200, yy, 200, 20, "", "", 0.5, 2.0, 1.0, true, true, (button) -> {
|
||||
|
||||
});
|
||||
addButton(slider);
|
||||
|
||||
closeButton = new ExtendedButton(left + 50, bottom - 20, 180, 20, "Done", (button) -> {
|
||||
this.minecraft.player.closeScreen();
|
||||
});
|
||||
addButton(closeButton);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
super.tick();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(int mouseX, int mouseY, float partialTicks) {
|
||||
this.renderBackground();
|
||||
|
||||
int yy = top;
|
||||
font.drawString("Shader type", left, yy + 5, 0xFFFFFF);
|
||||
|
||||
yy += 50;
|
||||
font.drawString("Shader speed", left, yy + 5, 0xFFFFFF);
|
||||
|
||||
super.render(mouseX, mouseY, partialTicks);
|
||||
|
||||
if (showShaderList)
|
||||
this.shaderTypeList.render(mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) {
|
||||
super.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
if (showShaderList) {
|
||||
if (!shaderTypeList.isMouseOver(mouseX, mouseY) && !shaderTypeButton.isMouseOver(mouseX, mouseY))
|
||||
showShaderList = false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removed() {
|
||||
ShaderTypeList.ShaderTypeEntry selectedShader = shaderTypeList.getSelected();
|
||||
//TODO save
|
||||
}
|
||||
|
||||
//Inspired by LanguageScreen
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
class ShaderTypeList extends ExtendedList<PlayerSettingsGui.ShaderTypeList.ShaderTypeEntry> {
|
||||
|
||||
public ShaderTypeList(Minecraft mcIn) {
|
||||
super(mcIn, 180, 140, top + 20, top + 100, 18);
|
||||
this.setLeftPos(right - width);
|
||||
|
||||
for (int i = 0; i < 40; i++) {
|
||||
|
||||
for (ShaderType shaderType : ShaderType.values()) {
|
||||
ShaderTypeEntry shaderTypeEntry = new ShaderTypeEntry(shaderType);
|
||||
addEntry(shaderTypeEntry);
|
||||
//TODO setSelected to this if appropriate
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (this.getSelected() != null) {
|
||||
this.centerScrollOn(this.getSelected());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRowWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSelected(PlayerSettingsGui.ShaderTypeList.ShaderTypeEntry selected) {
|
||||
super.setSelected(selected);
|
||||
Minecraft.getInstance().getSoundHandler().play(SimpleSound.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
|
||||
EffortlessBuilding.log("Selected shader " + selected.shaderType.name);
|
||||
shaderTypeButton.setMessage(selected.shaderType.name);
|
||||
// showShaderList = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseClicked(double p_mouseClicked_1_, double p_mouseClicked_3_, int p_mouseClicked_5_) {
|
||||
if (!showShaderList) return false;
|
||||
return super.mouseClicked(p_mouseClicked_1_, p_mouseClicked_3_, p_mouseClicked_5_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseReleased(double p_mouseReleased_1_, double p_mouseReleased_3_, int p_mouseReleased_5_) {
|
||||
if (!showShaderList) return false;
|
||||
return super.mouseReleased(p_mouseReleased_1_, p_mouseReleased_3_, p_mouseReleased_5_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseDragged(double p_mouseDragged_1_, double p_mouseDragged_3_, int p_mouseDragged_5_, double p_mouseDragged_6_, double p_mouseDragged_8_) {
|
||||
if (!showShaderList) return false;
|
||||
return super.mouseDragged(p_mouseDragged_1_, p_mouseDragged_3_, p_mouseDragged_5_, p_mouseDragged_6_, p_mouseDragged_8_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseScrolled(double p_mouseScrolled_1_, double p_mouseScrolled_3_, double p_mouseScrolled_5_) {
|
||||
if (!showShaderList) return false;
|
||||
return super.mouseScrolled(p_mouseScrolled_1_, p_mouseScrolled_3_, p_mouseScrolled_5_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMouseOver(double p_isMouseOver_1_, double p_isMouseOver_3_) {
|
||||
if (!showShaderList) return false;
|
||||
return super.isMouseOver(p_isMouseOver_1_, p_isMouseOver_3_);
|
||||
}
|
||||
|
||||
protected boolean isFocused() {
|
||||
return PlayerSettingsGui.this.getFocused() == this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getScrollbarPosition() {
|
||||
return right - 6;
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class ShaderTypeEntry extends ExtendedList.AbstractListEntry<ShaderTypeEntry> {
|
||||
private final ShaderType shaderType;
|
||||
|
||||
public ShaderTypeEntry(ShaderType shaderType) {
|
||||
this.shaderType = shaderType;
|
||||
}
|
||||
|
||||
public void render(int itemIndex, int rowTop, int rowLeft, int rowWidth, int rowHeight, int mouseX, int mouseY, boolean hovered, float partialTicks) {
|
||||
if (rowTop + 10 > ShaderTypeList.this.y0 && rowTop + rowHeight - 5 < ShaderTypeList.this.y1)
|
||||
drawString(font, shaderType.name, ShaderTypeList.this.x0 + 8, rowTop + 4, 0xFFFFFF);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseClicked(double p_mouseClicked_1_, double p_mouseClicked_3_, int p_mouseClicked_5_) {
|
||||
if (p_mouseClicked_5_ == 0) {
|
||||
setSelected(this);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//From AbstractList, disabled parts
|
||||
public void render(int p_render_1_, int p_render_2_, float p_render_3_) {
|
||||
this.renderBackground();
|
||||
int i = this.getScrollbarPosition();
|
||||
int j = i + 6;
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
BufferBuilder bufferbuilder = tessellator.getBuffer();
|
||||
// this.minecraft.getTextureManager().bindTexture(AbstractGui.BACKGROUND_LOCATION);
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ZERO, GlStateManager.DestFactor.ONE);
|
||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
float f = 32.0F;
|
||||
bufferbuilder.begin(7, DefaultVertexFormats.POSITION_COLOR);
|
||||
bufferbuilder.pos((double)this.x0, (double)this.y1, 0.0D).color(20, 20, 20, 180).endVertex();
|
||||
bufferbuilder.pos((double)this.x1, (double)this.y1, 0.0D).color(20, 20, 20, 180).endVertex();
|
||||
bufferbuilder.pos((double)this.x1, (double)this.y0, 0.0D).color(20, 20, 20, 180).endVertex();
|
||||
bufferbuilder.pos((double)this.x0, (double)this.y0, 0.0D).color(20, 20, 20, 180).endVertex();
|
||||
tessellator.draw();
|
||||
int k = this.getRowLeft();
|
||||
int l = this.y0 + 4 - (int)this.getScrollAmount();
|
||||
if (this.renderHeader) {
|
||||
this.renderHeader(k, l, tessellator);
|
||||
}
|
||||
|
||||
this.renderList(k, l, p_render_1_, p_render_2_, p_render_3_);
|
||||
RenderSystem.disableDepthTest();
|
||||
// this.renderHoleBackground(0, this.y0, 255, 255);
|
||||
// this.renderHoleBackground(this.y1, this.height, 255, 255);
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ZERO, GlStateManager.DestFactor.ONE);
|
||||
RenderSystem.disableAlphaTest();
|
||||
RenderSystem.shadeModel(7425);
|
||||
RenderSystem.disableTexture();
|
||||
// int i1 = 4;
|
||||
// bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
|
||||
// bufferbuilder.pos((double)this.x0, (double)(this.y0 + 4), 0.0D).tex(0.0F, 1.0F).color(0, 0, 0, 0).endVertex();
|
||||
// bufferbuilder.pos((double)this.x1, (double)(this.y0 + 4), 0.0D).tex(1.0F, 1.0F).color(0, 0, 0, 0).endVertex();
|
||||
// bufferbuilder.pos((double)this.x1, (double)this.y0, 0.0D).tex(1.0F, 0.0F).color(0, 0, 0, 255).endVertex();
|
||||
// bufferbuilder.pos((double)this.x0, (double)this.y0, 0.0D).tex(0.0F, 0.0F).color(0, 0, 0, 255).endVertex();
|
||||
// tessellator.draw();
|
||||
// bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
|
||||
// bufferbuilder.pos((double)this.x0, (double)this.y1, 0.0D).tex(0.0F, 1.0F).color(0, 0, 0, 255).endVertex();
|
||||
// bufferbuilder.pos((double)this.x1, (double)this.y1, 0.0D).tex(1.0F, 1.0F).color(0, 0, 0, 255).endVertex();
|
||||
// bufferbuilder.pos((double)this.x1, (double)(this.y1 - 4), 0.0D).tex(1.0F, 0.0F).color(0, 0, 0, 0).endVertex();
|
||||
// bufferbuilder.pos((double)this.x0, (double)(this.y1 - 4), 0.0D).tex(0.0F, 0.0F).color(0, 0, 0, 0).endVertex();
|
||||
// tessellator.draw();
|
||||
|
||||
//SCROLLBAR
|
||||
int j1 = this.getMaxScroll();
|
||||
if (j1 > 0) {
|
||||
int k1 = (int)((float)((this.y1 - this.y0) * (this.y1 - this.y0)) / (float)this.getMaxPosition());
|
||||
k1 = MathHelper.clamp(k1, 32, this.y1 - this.y0 - 8);
|
||||
int l1 = (int)this.getScrollAmount() * (this.y1 - this.y0 - k1) / j1 + this.y0;
|
||||
if (l1 < this.y0) {
|
||||
l1 = this.y0;
|
||||
}
|
||||
|
||||
bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
|
||||
bufferbuilder.pos((double)i, (double)this.y1, 0.0D).tex(0.0F, 1.0F).color(0, 0, 0, 255).endVertex();
|
||||
bufferbuilder.pos((double)j, (double)this.y1, 0.0D).tex(1.0F, 1.0F).color(0, 0, 0, 255).endVertex();
|
||||
bufferbuilder.pos((double)j, (double)this.y0, 0.0D).tex(1.0F, 0.0F).color(0, 0, 0, 255).endVertex();
|
||||
bufferbuilder.pos((double)i, (double)this.y0, 0.0D).tex(0.0F, 0.0F).color(0, 0, 0, 255).endVertex();
|
||||
tessellator.draw();
|
||||
bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
|
||||
bufferbuilder.pos((double)i, (double)(l1 + k1), 0.0D).tex(0.0F, 1.0F).color(128, 128, 128, 255).endVertex();
|
||||
bufferbuilder.pos((double)j, (double)(l1 + k1), 0.0D).tex(1.0F, 1.0F).color(128, 128, 128, 255).endVertex();
|
||||
bufferbuilder.pos((double)j, (double)l1, 0.0D).tex(1.0F, 0.0F).color(128, 128, 128, 255).endVertex();
|
||||
bufferbuilder.pos((double)i, (double)l1, 0.0D).tex(0.0F, 0.0F).color(128, 128, 128, 255).endVertex();
|
||||
tessellator.draw();
|
||||
bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
|
||||
bufferbuilder.pos((double)i, (double)(l1 + k1 - 1), 0.0D).tex(0.0F, 1.0F).color(192, 192, 192, 255).endVertex();
|
||||
bufferbuilder.pos((double)(j - 1), (double)(l1 + k1 - 1), 0.0D).tex(1.0F, 1.0F).color(192, 192, 192, 255).endVertex();
|
||||
bufferbuilder.pos((double)(j - 1), (double)l1, 0.0D).tex(1.0F, 0.0F).color(192, 192, 192, 255).endVertex();
|
||||
bufferbuilder.pos((double)i, (double)l1, 0.0D).tex(0.0F, 0.0F).color(192, 192, 192, 255).endVertex();
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
// this.renderDecorations(p_render_1_, p_render_2_);
|
||||
RenderSystem.enableTexture();
|
||||
RenderSystem.shadeModel(7424);
|
||||
RenderSystem.enableAlphaTest();
|
||||
RenderSystem.disableBlend();
|
||||
}
|
||||
|
||||
private int getMaxScroll() {
|
||||
return Math.max(0, this.getMaxPosition() - (this.y1 - this.y0 - 4));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import java.util.concurrent.TimeUnit;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
@@ -171,8 +172,9 @@ public class RadialMenu extends Screen {
|
||||
//Add actions
|
||||
buttons.add(new MenuButton(ActionEnum.UNDO.name, ActionEnum.UNDO, -buttonDistance - 26, -13, Direction.UP));
|
||||
buttons.add(new MenuButton(ActionEnum.REDO.name, ActionEnum.REDO, -buttonDistance, -13, Direction.UP));
|
||||
buttons.add(new MenuButton(ActionEnum.OPEN_MODIFIER_SETTINGS.name, ActionEnum.OPEN_MODIFIER_SETTINGS, -buttonDistance - 26, 13, Direction.DOWN));
|
||||
buttons.add(new MenuButton(ActionEnum.REPLACE.name, ActionEnum.REPLACE, -buttonDistance, 13, Direction.DOWN));
|
||||
buttons.add(new MenuButton(ActionEnum.OPEN_PLAYER_SETTINGS.name, ActionEnum.OPEN_PLAYER_SETTINGS, -buttonDistance - 26 - 13, 13, Direction.DOWN));
|
||||
buttons.add(new MenuButton(ActionEnum.OPEN_MODIFIER_SETTINGS.name, ActionEnum.OPEN_MODIFIER_SETTINGS, -buttonDistance - 13, 13, Direction.DOWN));
|
||||
buttons.add(new MenuButton(ActionEnum.REPLACE.name, ActionEnum.REPLACE, -buttonDistance + 13, 13, Direction.DOWN));
|
||||
|
||||
//Add buildmode dependent options
|
||||
OptionEnum[] options = currentBuildMode.options;
|
||||
@@ -473,16 +475,16 @@ public class RadialMenu extends Screen {
|
||||
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) {
|
||||
EffortlessBuilding.log("mouse clicked");
|
||||
|
||||
// KeyBinding.updateKeyBindState();
|
||||
// KeyBinding.setKeyBindState(ClientProxy.keyBindings[3].getKeyCode(), true);
|
||||
KeyBinding.updateKeyBindState();
|
||||
KeyBinding.setKeyBindState(ClientProxy.keyBindings[3].getKey(), true);
|
||||
|
||||
// if (mouseButton == 0) {
|
||||
// this.mc.displayGuiScreen(null);
|
||||
//
|
||||
// if (this.mc.currentScreen == null) {
|
||||
// this.mc.setIngameFocus();
|
||||
// }
|
||||
// }
|
||||
if (mouseButton == 0) {
|
||||
this.minecraft.displayGuiScreen(null);
|
||||
|
||||
if (this.minecraft.currentScreen == null) {
|
||||
this.minecraft.setGameFocused(true);
|
||||
}
|
||||
}
|
||||
return super.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
}
|
||||
|
||||
|
||||
@@ -137,7 +137,6 @@ public class ModifierSettingsGui extends Screen {
|
||||
//Send to server
|
||||
PacketHandler.INSTANCE.sendToServer(new ModifierSettingsMessage(modifierSettings));
|
||||
|
||||
//TODO fix not being able to scroll after this gui has opened
|
||||
Minecraft.getInstance().mouseHelper.grabMouse();
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ import nl.requios.effortlessbuilding.buildmode.ModeSettingsManager;
|
||||
import nl.requios.effortlessbuilding.buildmodifier.ModifierSettingsManager;
|
||||
import nl.requios.effortlessbuilding.compatibility.CompatHelper;
|
||||
import nl.requios.effortlessbuilding.gui.RandomizerBagScreen;
|
||||
import nl.requios.effortlessbuilding.gui.buildmode.PlayerSettingsGui;
|
||||
import nl.requios.effortlessbuilding.gui.buildmode.RadialMenu;
|
||||
import nl.requios.effortlessbuilding.gui.buildmodifier.ModifierSettingsGui;
|
||||
import nl.requios.effortlessbuilding.helper.ReachHelper;
|
||||
@@ -68,9 +69,6 @@ public class ClientProxy implements IProxy {
|
||||
|
||||
@Override
|
||||
public void clientSetup(FMLClientSetupEvent event) {
|
||||
//Crashes in 1.13, do it elsewhere
|
||||
// ShaderHandler.init();
|
||||
|
||||
// register key bindings
|
||||
keyBindings = new KeyBinding[7];
|
||||
|
||||
@@ -337,6 +335,20 @@ public class ClientProxy implements IProxy {
|
||||
}
|
||||
}
|
||||
|
||||
public static void openPlayerSettings() {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
ClientPlayerEntity player = mc.player;
|
||||
|
||||
RadialMenu.instance.setVisibility(0f);
|
||||
|
||||
//Disabled if max reach is 0, might be set in the config that way.
|
||||
if (mc.currentScreen == null) {
|
||||
mc.displayGuiScreen(new PlayerSettingsGui());
|
||||
} else {
|
||||
player.closeScreen();
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onGuiOpen(GuiOpenEvent event) {
|
||||
PlayerEntity player = Minecraft.getInstance().player;
|
||||
|
||||
@@ -143,7 +143,9 @@ public class RenderHandler {
|
||||
|
||||
net.minecraftforge.client.ForgeHooksClient.drawScreen(RadialMenu.instance, mouseX, mouseY, event.getPartialTicks());
|
||||
} else {
|
||||
if (wasVisible && RadialMenu.instance.doAction != ModeOptions.ActionEnum.OPEN_MODIFIER_SETTINGS) {
|
||||
if (wasVisible &&
|
||||
RadialMenu.instance.doAction != ModeOptions.ActionEnum.OPEN_MODIFIER_SETTINGS &&
|
||||
RadialMenu.instance.doAction != ModeOptions.ActionEnum.OPEN_PLAYER_SETTINGS) {
|
||||
mc.mouseHelper.grabMouse();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"effortlessbuilding.screen.modifier_settings": "Modifier Settings",
|
||||
"effortlessbuilding.screen.radial_menu": "Build Modes",
|
||||
"effortlessbuilding.screen.randomizer_bag": "Randomizer Bag",
|
||||
"effortlessbuilding.screen.player_settings": "Player Settings",
|
||||
|
||||
"key.effortlessbuilding.category": "Effortless Building",
|
||||
"key.effortlessbuilding.hud.desc": "Modifier Menu",
|
||||
@@ -34,6 +35,7 @@
|
||||
"effortlessbuilding.action.redo": "Redo",
|
||||
"effortlessbuilding.action.replace": "Replace",
|
||||
"effortlessbuilding.action.open_modifier_settings": "Open Modifier Settings",
|
||||
"effortlessbuilding.action.open_player_settings": "Open Settings",
|
||||
|
||||
"effortlessbuilding.action.build_speed": "Build Speed",
|
||||
"effortlessbuilding.action.filling": "Filling",
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Reference in New Issue
Block a user