This commit is contained in:
parent
59a2175fb2
commit
0b3bac264f
@ -4,13 +4,13 @@ org.gradle.parallel=true
|
|||||||
|
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://fabricmc.net/develop
|
# check these on https://fabricmc.net/develop
|
||||||
minecraft_version=1.21.5
|
minecraft_version=1.21.6
|
||||||
yarn_mappings=1.21.5+build.1
|
yarn_mappings=1.21.6+build.1
|
||||||
loader_version=0.16.14
|
loader_version=0.16.14
|
||||||
loom_version=1.10-SNAPSHOT
|
loom_version=1.10-SNAPSHOT
|
||||||
|
|
||||||
# Fabric API
|
# Fabric API
|
||||||
fabric_version=0.127.0+1.21.5
|
fabric_version=0.127.0+1.21.6
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.1.2+1.21.5
|
mod_version = 1.1.2+1.21.5
|
||||||
|
@ -51,7 +51,7 @@ public class RepeatingScreen extends Screen {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
|
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
|
||||||
renderBackground(context, mouseX, mouseY, delta);
|
// renderBackground(context, mouseX, mouseY, delta);
|
||||||
|
|
||||||
for (RenderListener l : render_listeners) {
|
for (RenderListener l : render_listeners) {
|
||||||
if (l.beforeRender()) {
|
if (l.beforeRender()) {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package ru.themixray.repeating_mod.widget;
|
package ru.themixray.repeating_mod.widget;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
import net.minecraft.client.gui.DrawContext;
|
import net.minecraft.client.gui.DrawContext;
|
||||||
import net.minecraft.client.gui.Drawable;
|
import net.minecraft.client.gui.Drawable;
|
||||||
import net.minecraft.client.gui.tooltip.Tooltip;
|
import net.minecraft.client.gui.tooltip.Tooltip;
|
||||||
@ -18,6 +19,7 @@ import java.util.List;
|
|||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class RecordWidget implements Drawable, Widget {
|
public class RecordWidget implements Drawable, Widget {
|
||||||
|
@Getter
|
||||||
private RecordState record;
|
private RecordState record;
|
||||||
|
|
||||||
private List<ClickableWidget> children;
|
private List<ClickableWidget> children;
|
||||||
@ -150,22 +152,13 @@ public class RecordWidget implements Drawable, Widget {
|
|||||||
children.add(replay_button);
|
children.add(replay_button);
|
||||||
}
|
}
|
||||||
|
|
||||||
public RecordState getRecord() {
|
public void drawText(int x, int y, DrawContext ctx, List<Text> lines, int line_height, boolean shadow) {
|
||||||
return record;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void drawText(int x, int y, DrawContext ctx, List<Text> lines, float size, int line_height, boolean shadow) {
|
|
||||||
ctx.getMatrices().push();
|
|
||||||
ctx.getMatrices().scale(size, size, size);
|
|
||||||
|
|
||||||
int now_y = y;
|
int now_y = y;
|
||||||
|
|
||||||
for (Text line : lines) {
|
for (Text line : lines) {
|
||||||
ctx.drawText(Main.client.textRenderer, line, (int) (x / size), (int) (now_y / size), line.getStyle().getColor().getRgb(), shadow);
|
ctx.drawText(Main.client.textRenderer, line, x, now_y, 0xff000000 + line.getStyle().getColor().getRgb(), shadow);
|
||||||
now_y += line_height;
|
now_y += line_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.getMatrices().pop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -190,7 +183,7 @@ public class RecordWidget implements Drawable, Widget {
|
|||||||
.append(": ")
|
.append(": ")
|
||||||
.styled((s) -> s.withColor(0xbbbbbb)),
|
.styled((s) -> s.withColor(0xbbbbbb)),
|
||||||
Text.literal(record.getAuthor()).styled((s) -> s.withColor(0xffffff))
|
Text.literal(record.getAuthor()).styled((s) -> s.withColor(0xffffff))
|
||||||
), 1,
|
),
|
||||||
9,
|
9,
|
||||||
false);
|
false);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user