mirror of
https://github.com/chylex/Better-Controls.git
synced 2024-11-25 19:42:45 +01:00
Compare commits
2 Commits
8d5536cc69
...
7895b0dc0f
Author | SHA1 | Date | |
---|---|---|---|
7895b0dc0f | |||
1fe1234bac |
@ -3,21 +3,21 @@ modId=bettercontrols
|
|||||||
modName=Better Controls
|
modName=Better Controls
|
||||||
modDescription=Adds many powerful key bindings and options to control your movement.\\n\\nThe features complement vanilla mechanics without giving unfair advantages, so server use should be fine.
|
modDescription=Adds many powerful key bindings and options to control your movement.\\n\\nThe features complement vanilla mechanics without giving unfair advantages, so server use should be fine.
|
||||||
modAuthor=chylex
|
modAuthor=chylex
|
||||||
modVersion=1.3.0a
|
modVersion=1.3.0b
|
||||||
modLicense=MPL-2.0
|
modLicense=MPL-2.0
|
||||||
modSourcesURL=https://github.com/chylex/Better-Controls
|
modSourcesURL=https://github.com/chylex/Better-Controls
|
||||||
modIssuesURL=https://github.com/chylex/Better-Controls/issues
|
modIssuesURL=https://github.com/chylex/Better-Controls/issues
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
minecraftVersion=1.20.2
|
minecraftVersion=1.20.3
|
||||||
neoForgeVersion=20.2.86
|
neoForgeVersion=20.3.8-beta
|
||||||
fabricVersion=0.14.21
|
fabricVersion=0.14.21
|
||||||
loomVersion=1.3
|
loomVersion=1.3
|
||||||
mixinVersion=0.8.5
|
mixinVersion=0.8.5
|
||||||
|
|
||||||
# Constraints
|
# Constraints
|
||||||
minimumMinecraftVersion=1.20.2
|
minimumMinecraftVersion=1.20.3
|
||||||
minimumNeoForgeVersion=20.2.86
|
minimumNeoForgeVersion=20.3.7
|
||||||
minimumFabricVersion=0.12.3
|
minimumFabricVersion=0.12.3
|
||||||
|
|
||||||
# Gradle
|
# Gradle
|
||||||
|
@ -10,9 +10,9 @@ pluginManagement {
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
if (settings.extra.has("neoForgeVersion")) {
|
if (settings.extra.has("neoForgeVersion")) {
|
||||||
id("net.neoforged.gradle.vanilla") version "7.0.41"
|
id("net.neoforged.gradle.vanilla") version "7.0.61"
|
||||||
id("net.neoforged.gradle.userdev") version "7.0.41"
|
id("net.neoforged.gradle.userdev") version "7.0.61"
|
||||||
id("net.neoforged.gradle.mixin") version "7.0.41"
|
id("net.neoforged.gradle.mixin") version "7.0.61"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settings.extra.has("loomVersion")) {
|
if (settings.extra.has("loomVersion")) {
|
||||||
|
@ -234,9 +234,9 @@ public class BetterControlsScreen extends OptionsSubScreen {
|
|||||||
y = generateMiscellaneousOptions(y + ROW_HEIGHT, elements) + TITLE_MARGIN_TOP;
|
y = generateMiscellaneousOptions(y + ROW_HEIGHT, elements) + TITLE_MARGIN_TOP;
|
||||||
|
|
||||||
//noinspection DataFlowIssue
|
//noinspection DataFlowIssue
|
||||||
addRenderableWidget(Button.builder(CommonComponents.GUI_DONE, btn -> minecraft.setScreen(lastScreen)).pos(width / 2 - 99, height - 29).size(200, 20).build());
|
addRenderableWidget(Button.builder(CommonComponents.GUI_DONE, btn -> minecraft.setScreen(lastScreen)).pos(width / 2 - 99, height - 25).size(200, 20).build());
|
||||||
|
|
||||||
addRenderableWidget(optionsWidget = new OptionListWidget(21, height - 32, width, height, elements, y - TITLE_MARGIN_TOP + BOTTOM_PADDING));
|
addRenderableWidget(optionsWidget = new OptionListWidget(width, height - 50, 21, y - TITLE_MARGIN_TOP + BOTTOM_PADDING, elements));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -244,12 +244,15 @@ public class BetterControlsScreen extends OptionsSubScreen {
|
|||||||
BetterControlsCommon.getConfig().save();
|
BetterControlsCommon.getConfig().save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderBackground(final @NotNull GuiGraphics graphics, final int mouseX, final int mouseY, final float delta) {
|
||||||
|
renderDirtBackground(graphics);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(final @NotNull GuiGraphics graphics, final int mouseX, final int mouseY, final float delta) {
|
public void render(final @NotNull GuiGraphics graphics, final int mouseX, final int mouseY, final float delta) {
|
||||||
renderBackground(graphics, mouseX, mouseY, delta);
|
|
||||||
optionsWidget.render(graphics, mouseX, mouseY, delta);
|
|
||||||
graphics.drawCenteredString(font, title, width / 2, 8, TextWidget.WHITE);
|
|
||||||
super.render(graphics, mouseX, mouseY, delta);
|
super.render(graphics, mouseX, mouseY, delta);
|
||||||
|
graphics.drawCenteredString(font, title, width / 2, 8, TextWidget.WHITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startEditingKeyBinding(final KeyBindingWidget widget) {
|
private void startEditingKeyBinding(final KeyBindingWidget widget) {
|
||||||
|
@ -54,8 +54,8 @@ public final class OptionListWidget extends ContainerObjectSelectionList<Entry>
|
|||||||
|
|
||||||
private record Offset(int x, int y) {}
|
private record Offset(int x, int y) {}
|
||||||
|
|
||||||
public OptionListWidget(final int top, final int bottom, final int width, final int height, final List<GuiEventListener> widgets, final int innerHeight) {
|
public OptionListWidget(final int width, final int height, final int top, final int innerHeight, final List<GuiEventListener> widgets) {
|
||||||
super(Minecraft.getInstance(), width, height, top, bottom, innerHeight);
|
super(Minecraft.getInstance(), width, height, top, innerHeight);
|
||||||
addEntry(new Entry(widgets));
|
addEntry(new Entry(widgets));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,8 +14,8 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
|||||||
|
|
||||||
@Mixin(KeyBindsList.class)
|
@Mixin(KeyBindsList.class)
|
||||||
public abstract class HookControlsListWidget extends ContainerObjectSelectionList<Entry> {
|
public abstract class HookControlsListWidget extends ContainerObjectSelectionList<Entry> {
|
||||||
public HookControlsListWidget(final Minecraft client, final int width, final int height, final int top, final int bottom, final int itemHeight) {
|
public HookControlsListWidget(final Minecraft client, final int width, final int height, final int top, final int itemHeight) {
|
||||||
super(client, width, height, top, bottom, itemHeight);
|
super(client, width, height, top, itemHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Redirect(method = "<init>", at = @At(value = "FIELD", target = "Lnet/minecraft/client/Options;keyMappings:[Lnet/minecraft/client/KeyMapping;"))
|
@Redirect(method = "<init>", at = @At(value = "FIELD", target = "Lnet/minecraft/client/Options;keyMappings:[Lnet/minecraft/client/KeyMapping;"))
|
||||||
|
Loading…
Reference in New Issue
Block a user