Skip to content

Commit

Permalink
Buttons are fixed. Now to test more advanced rendering features under…
Browse files Browse the repository at this point in the history
… other mods.
  • Loading branch information
sakura-ryoko committed Aug 17, 2024
1 parent 9b04ebc commit 0154679
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mod_version = 0.20.999-snap
# Minecraft, Fabric Loader and API and mappings versions
minecraft_version_out = 24w33a
minecraft_version = 24w33a
mappings_version = 24w33a+build.4
mappings_version = 24w33a+build.12

fabric_loader_version = 0.15.11
mod_menu_version = 11.0.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ public void render(int mouseX, int mouseY, boolean selected, DrawContext drawCon

if (this.renderDefaultBackground)
{
// TODO --> method_62279() // guiTextured
drawContext.drawGuiTexture(RenderLayer::method_62279, this.getTexture(this.hovered), this.x, this.y, this.width, this. height);
drawContext.drawGuiTexture(RenderLayer::getGuiTextured, this.getTexture(this.hovered), this.x, this.y, this.width, this.height);
}

if (this.icon != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,15 @@ public void render(int mouseX, int mouseY, boolean selected, DrawContext drawCon

RenderUtils.color(1f, 1f, 1f, 1f);

// TODO --> method_62279() // guiTextured
drawContext.drawGuiTexture(RenderLayer::method_62279, WidgetSlider.BUTTON_DISABLE_TEXTURE, this.x + 1, this.y, this.width - 3, 20);
drawContext.drawGuiTexture(RenderLayer::getGuiTextured, WidgetSlider.BUTTON_DISABLE_TEXTURE, this.x + 1, this.y, this.width - 3, 20);

double relPos = this.callback.getValueRelative();
int sw = this.sliderWidth;
int usableWidth = this.width - 4 - sw;
int s = sw / 2;


drawContext.drawGuiTexture(RenderLayer::method_62279, WidgetSlider.BUTTON_TEXTURE, this.x + 2 + (int) (relPos * usableWidth), this.y, sw, 20);
drawContext.drawGuiTexture(RenderLayer::getGuiTextured, WidgetSlider.BUTTON_TEXTURE, this.x + 2 + (int) (relPos * usableWidth), this.y, sw, 20);

String str = this.callback.getFormattedDisplayValue();
int w = this.getStringWidth(str);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/fi/dy/masa/malilib/render/RenderUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ public static void renderSprite(int x, int y, int width, int height, Identifier
if (texture != null)
{
Sprite sprite = mc().getSpriteAtlas(atlas).apply(texture);
// TODO --> method_62279() // guiTextured
drawContext.drawSprite(RenderLayer::method_62279, sprite, x, y, 0, width, height);
//drawContext.drawSprite(RenderLayer::getGuiTextured, sprite, x, y, 0, width, height);
drawContext.drawSprite(RenderLayer::getGuiTextured, sprite, x, y, width, height, 0);
}
}

Expand Down

0 comments on commit 0154679

Please sign in to comment.