Skip to content

Commit

Permalink
1.19.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerozgen committed Jan 7, 2023
1 parent 3a81e71 commit 78ad7ae
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 15 deletions.
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.19.3
yarn_mappings=1.19.3+build.2
loader_version=0.14.11
fabric_version=0.68.1+1.19.3
minecraft_version=1.19.2
yarn_mappings=1.19.2+build.28
loader_version=0.14.12
fabric_version=0.72.0+1.19.2

# Mod Properties
mod_version=1.5.2
mod_version=1.5.3+1.19.2
maven_group=jerozgen
archives_base_name=language-reload

# Dependencies
modmenu_version=5.0.0-alpha.4
modmenu_version=4.1.2
4 changes: 2 additions & 2 deletions src/main/java/jerozgen/languagereload/gui/LanguageEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public void render(MatrixStack matrices, int index, int top, int left, int entry
}
buttons.forEach(button -> button.visible = false);
ButtonRenderer buttonRenderer = (button, x, y) -> {
button.setX(x);
button.setY(y);
button.x = x;
button.y = y;
button.visible = true;
button.render(matrices, mouseX, mouseY, tickDelta);
};
Expand Down
19 changes: 16 additions & 3 deletions src/main/java/jerozgen/languagereload/gui/LockedLanguageEntry.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
package jerozgen.languagereload.gui;

import net.minecraft.client.gui.tooltip.Tooltip;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.TexturedButtonWidget;
import net.minecraft.client.resource.language.LanguageDefinition;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.screen.ScreenTexts;
import net.minecraft.text.Text;

import java.util.LinkedList;
import java.util.function.Consumer;

public class LockedLanguageEntry extends LanguageEntry {
private final Text LOCK_BUTTON_TOOLTIP = Text.translatable("language.default.tooltip");

private final ButtonWidget lockButton = addChild(new TexturedButtonWidget(0, 0, 16, 24, 43, 0, 0,
TEXTURE, TEXTURE_WIDTH, TEXTURE_HEIGHT, __ -> {}));
TEXTURE, TEXTURE_WIDTH, TEXTURE_HEIGHT, __ -> {}, new ButtonWidget.TooltipSupplier() {
@Override
public void onTooltip(ButtonWidget button, MatrixStack matrices, int mouseX, int mouseY) {
if (client.currentScreen != null) {
client.currentScreen.renderTooltip(matrices, LOCK_BUTTON_TOOLTIP, mouseX, mouseY);
}
}

@Override
public void supply(Consumer<Text> consumer) {
consumer.accept(LOCK_BUTTON_TOOLTIP);
}
}, ScreenTexts.EMPTY));

public LockedLanguageEntry(Runnable refreshListsAction, LanguageDefinition language, LinkedList<LanguageDefinition> selectedLanguages) {
super(refreshListsAction, language, selectedLanguages);
lockButton.active = false;
lockButton.setTooltip(Tooltip.of(LOCK_BUTTON_TOOLTIP));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ void onInit(CallbackInfo ci) {
refresh();

addDrawableChild(gameOptions.getForceUnicodeFont().createButton(gameOptions, width / 2 - 155, height - 28, 150));
addDrawableChild(ButtonWidget.builder(ScreenTexts.DONE, this::onDone)
.dimensions(width / 2 - 155 + 160, height - 28, 150, 20)
.build());
addDrawableChild(new ButtonWidget(width / 2 - 155 + 160, height - 28, 150, 20, ScreenTexts.DONE, this::onDone));

super.init();
ci.cancel();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"depends": {
"fabric-resource-loader-v0": "*",
"fabricloader": ">=0.14.6",
"minecraft": ">=1.19.3",
"minecraft": ">=1.19 <1.19.3",
"java": ">=17"
}
}

0 comments on commit 78ad7ae

Please sign in to comment.