Update to 1.19.4
This commit is contained in:
parent
8369034f10
commit
8e30d8c2ee
@ -2,13 +2,13 @@
|
|||||||
org.gradle.jvmargs=-Xmx1G
|
org.gradle.jvmargs=-Xmx1G
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://modmuss50.me/fabric.html
|
# check these on https://modmuss50.me/fabric.html
|
||||||
minecraft_version=1.19.3
|
minecraft_version=1.19.4
|
||||||
yarn_mappings=1.19.3+build.5
|
yarn_mappings=1.19.4+build.1
|
||||||
loader_version=0.14.13
|
loader_version=0.14.17
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version=1.0.1
|
mod_version=1.1.0
|
||||||
maven_group=cmods
|
maven_group=cmods
|
||||||
archives_base_name=cmods
|
archives_base_name=cmods
|
||||||
# Dependencies
|
# Dependencies
|
||||||
# check this on https://modmuss50.me/fabric.html
|
# check this on https://modmuss50.me/fabric.html
|
||||||
fabric_version=0.73.0+1.19.3
|
fabric_version=0.75.3+1.19.4
|
||||||
|
@ -49,9 +49,9 @@ public class CmodsOptionsScreen extends Screen {
|
|||||||
adder.add(ButtonWidget.builder(ScreenTexts.DONE, button -> client.setScreen(parent))
|
adder.add(ButtonWidget.builder(ScreenTexts.DONE, button -> client.setScreen(parent))
|
||||||
.width(doneButtonWidth).build(), 2, adder.copyPositioner().marginTop(doneButtonRowIncrement));
|
.width(doneButtonWidth).build(), 2, adder.copyPositioner().marginTop(doneButtonRowIncrement));
|
||||||
|
|
||||||
grid.recalculateDimensions();
|
grid.refreshPositions();
|
||||||
SimplePositioningWidget.setPos(grid, 0, startHeight, this.width, this.height, 0.5f, 0.0f);
|
SimplePositioningWidget.setPos(grid, 0, startHeight, this.width, this.height, 0.5f, 0.0f);
|
||||||
addDrawableChild(grid);
|
grid.forEachChild(this::addDrawableChild);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addExtraButtons(ArrayList<ButtonBuilder> buttons, int precedence) {
|
public static void addExtraButtons(ArrayList<ButtonBuilder> buttons, int precedence) {
|
||||||
@ -72,7 +72,7 @@ public class CmodsOptionsScreen extends Screen {
|
|||||||
Text versionText = Text.literal("v" + CmodsClient.version);
|
Text versionText = Text.literal("v" + CmodsClient.version);
|
||||||
|
|
||||||
|
|
||||||
drawCenteredText(matrices, textRenderer, title, this.width / 2, 15, 0xffffff);
|
drawCenteredTextWithShadow(matrices, textRenderer, title, this.width / 2, 15, 0xffffff);
|
||||||
drawTextWithShadow(matrices, textRenderer, versionText, this.width - textRenderer.getWidth(versionText) - 2,
|
drawTextWithShadow(matrices, textRenderer, versionText, this.width - textRenderer.getWidth(versionText) - 2,
|
||||||
this.height - textRenderer.fontHeight - 2, 0xffffff);
|
this.height - textRenderer.fontHeight - 2, 0xffffff);
|
||||||
super.render(matrices, mouseX, mouseY, delta);
|
super.render(matrices, mouseX, mouseY, delta);
|
||||||
|
@ -2,16 +2,17 @@ package cmods.cmods.client.ui;
|
|||||||
|
|
||||||
import cmods.cmods.client.options.IntegerOption;
|
import cmods.cmods.client.options.IntegerOption;
|
||||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||||
import net.minecraft.client.gui.widget.ClickableWidget;
|
import net.minecraft.client.gui.widget.Widget;
|
||||||
import net.minecraft.client.gui.widget.WrapperWidget;
|
import net.minecraft.client.gui.widget.WrapperWidget;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class IntegerAdjustWidget extends WrapperWidget {
|
public class IntegerAdjustWidget extends WrapperWidget {
|
||||||
private final ArrayList<ButtonWidget> children;
|
private final ArrayList<ButtonWidget> elements;
|
||||||
private final IntegerOption option;
|
private final IntegerOption option;
|
||||||
|
private final Text text;
|
||||||
private final int delta;
|
private final int delta;
|
||||||
|
|
||||||
public IntegerAdjustWidget(Text text, IntegerOption option) {
|
public IntegerAdjustWidget(Text text, IntegerOption option) {
|
||||||
@ -19,25 +20,15 @@ public class IntegerAdjustWidget extends WrapperWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public IntegerAdjustWidget(Text text, IntegerOption option, int delta) {
|
public IntegerAdjustWidget(Text text, IntegerOption option, int delta) {
|
||||||
super(0, 0, 150, 20, text);
|
super(0, 0, 150, 20);
|
||||||
|
this.text = text;
|
||||||
this.option = option;
|
this.option = option;
|
||||||
this.delta = delta;
|
this.delta = delta;
|
||||||
children = new ArrayList<>(3);
|
elements = new ArrayList<>(3);
|
||||||
|
|
||||||
refreshDimensions();
|
refreshDimensions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected List<? extends ClickableWidget> wrappedWidgets() {
|
|
||||||
return children;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setWidth(int width) {
|
|
||||||
super.setWidth(width);
|
|
||||||
refreshDimensions();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setX(int x) {
|
public void setX(int x) {
|
||||||
super.setX(x);
|
super.setX(x);
|
||||||
@ -50,17 +41,11 @@ public class IntegerAdjustWidget extends WrapperWidget {
|
|||||||
refreshDimensions();
|
refreshDimensions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setPos(int x, int y) {
|
|
||||||
super.setPos(x, y);
|
|
||||||
refreshDimensions();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void refreshDimensions() {
|
private void refreshDimensions() {
|
||||||
final int button_width = 25;
|
final int button_width = 25;
|
||||||
final String labelStr = getMessage().getString() + ": ";
|
final String labelStr = text.getString() + ": ";
|
||||||
|
|
||||||
children.clear();
|
elements.clear();
|
||||||
|
|
||||||
ButtonWidget middle = ButtonWidget.builder(Text.literal(labelStr + option.get()), button -> {})
|
ButtonWidget middle = ButtonWidget.builder(Text.literal(labelStr + option.get()), button -> {})
|
||||||
.dimensions(getX() + button_width - 1, getY(),width - (button_width * 2) + 2, height).build();
|
.dimensions(getX() + button_width - 1, getY(),width - (button_width * 2) + 2, height).build();
|
||||||
@ -73,8 +58,15 @@ public class IntegerAdjustWidget extends WrapperWidget {
|
|||||||
button -> middle.setMessage(Text.literal(labelStr + option.inc(delta))))
|
button -> middle.setMessage(Text.literal(labelStr + option.inc(delta))))
|
||||||
.dimensions(getX() + width - button_width + 1, getY(), button_width, height).build();
|
.dimensions(getX() + width - button_width + 1, getY(), button_width, height).build();
|
||||||
|
|
||||||
children.add(sub);
|
elements.add(sub);
|
||||||
children.add(middle);
|
elements.add(middle);
|
||||||
children.add(add);
|
elements.add(add);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void forEachElement(Consumer<Widget> consumer) {
|
||||||
|
for (Widget element: elements) {
|
||||||
|
consumer.accept(element);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,9 +51,9 @@ public class UIOptionsScreen extends Screen {
|
|||||||
adder.add(ButtonWidget.builder(ScreenTexts.DONE, button -> client.setScreen(parent))
|
adder.add(ButtonWidget.builder(ScreenTexts.DONE, button -> client.setScreen(parent))
|
||||||
.width(doneButtonWidth).build(), 2, adder.copyPositioner().marginTop(doneButtonRowIncrement));
|
.width(doneButtonWidth).build(), 2, adder.copyPositioner().marginTop(doneButtonRowIncrement));
|
||||||
|
|
||||||
grid.recalculateDimensions();
|
grid.refreshPositions();
|
||||||
SimplePositioningWidget.setPos(grid, 0, startHeight, this.width, this.height, 0.5f, 0.0f);
|
SimplePositioningWidget.setPos(grid, 0, startHeight, this.width, this.height, 0.5f, 0.0f);
|
||||||
addDrawableChild(grid);
|
grid.forEachChild(this::addDrawableChild);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addButtons(ArrayList<ButtonBuilder> buttons, int precedence) {
|
public static void addButtons(ArrayList<ButtonBuilder> buttons, int precedence) {
|
||||||
@ -71,7 +71,7 @@ public class UIOptionsScreen extends Screen {
|
|||||||
|
|
||||||
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
||||||
this.renderBackground(matrices);
|
this.renderBackground(matrices);
|
||||||
drawCenteredText(matrices, this.textRenderer, this.title, this.width / 2, 15, 0xffffff);
|
drawCenteredTextWithShadow(matrices, this.textRenderer, this.title, this.width / 2, 15, 0xffffff);
|
||||||
super.render(matrices, mouseX, mouseY, delta);
|
super.render(matrices, mouseX, mouseY, delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,6 +23,6 @@
|
|||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": ">=0.14.10",
|
"fabricloader": ">=0.14.10",
|
||||||
"fabric": "*",
|
"fabric": "*",
|
||||||
"minecraft": "1.19.3"
|
"minecraft": "1.19.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user