mirror of
https://github.com/TeamMidnightDust/MidnightLib.git
synced 2025-12-16 17:25:09 +01:00
Backported to 1.21(.1)
This commit is contained in:
@@ -37,11 +37,14 @@ public abstract class MixinOptionsScreen extends Screen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(at = @At("TAIL"), method = "refreshWidgetPositions")
|
|
||||||
|
|
||||||
|
@Inject(at = @At("TAIL"), method = "initTabNavigation")
|
||||||
public void midnightlib$onResize(CallbackInfo ci) {
|
public void midnightlib$onResize(CallbackInfo ci) {
|
||||||
if (shouldShowButton()) this.midnightlib$setButtonPos();
|
if (shouldShowButton()) this.midnightlib$setButtonPos();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Unique
|
@Unique
|
||||||
public void midnightlib$setButtonPos() {
|
public void midnightlib$setButtonPos() {
|
||||||
midnightlib$button.setPosition(layout.getWidth() / 2 + 158, layout.getY() + layout.getFooterHeight() - 4);
|
midnightlib$button.setPosition(layout.getWidth() / 2 + 158, layout.getY() + layout.getFooterHeight() - 4);
|
||||||
|
|||||||
@@ -251,9 +251,9 @@ public abstract class MidnightConfig {
|
|||||||
if (prevTab != null && prevTab != tabManager.getCurrentTab()) {
|
if (prevTab != null && prevTab != tabManager.getCurrentTab()) {
|
||||||
prevTab = tabManager.getCurrentTab();
|
prevTab = tabManager.getCurrentTab();
|
||||||
this.list.clear(); fillList();
|
this.list.clear(); fillList();
|
||||||
list.setScrollY(0);
|
list.setScrollAmount(0);
|
||||||
}
|
}
|
||||||
scrollProgress = list.getScrollY();
|
scrollProgress = list.getScrollAmount();
|
||||||
for (EntryInfo info : entries) try {info.field.set(null, info.value);} catch (IllegalAccessException ignored) {}
|
for (EntryInfo info : entries) try {info.field.set(null, info.value);} catch (IllegalAccessException ignored) {}
|
||||||
updateButtons();
|
updateButtons();
|
||||||
}
|
}
|
||||||
@@ -395,7 +395,7 @@ public abstract class MidnightConfig {
|
|||||||
}
|
}
|
||||||
this.list.addButton(widgets, name, info);
|
this.list.addButton(widgets, name, info);
|
||||||
} else this.list.addButton(List.of(), name, info);
|
} else this.list.addButton(List.of(), name, info);
|
||||||
} list.setScrollY(scrollProgress);
|
} list.setScrollAmount(scrollProgress);
|
||||||
updateButtons();
|
updateButtons();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -423,7 +423,7 @@ public abstract class MidnightConfig {
|
|||||||
protected void drawHeaderAndFooterSeparators(DrawContext context) {
|
protected void drawHeaderAndFooterSeparators(DrawContext context) {
|
||||||
if (renderHeaderSeparator) super.drawHeaderAndFooterSeparators(context);
|
if (renderHeaderSeparator) super.drawHeaderAndFooterSeparators(context);
|
||||||
else { RenderSystem.enableBlend();
|
else { RenderSystem.enableBlend();
|
||||||
context.drawTexture(RenderLayer::getGuiTextured, this.client.world == null ? Screen.FOOTER_SEPARATOR_TEXTURE : Screen.INWORLD_FOOTER_SEPARATOR_TEXTURE, this.getX(), this.getBottom(), 0.0F, 0.0F, this.getWidth(), 2, 32, 2);
|
context.drawTexture(this.client.world == null ? Screen.FOOTER_SEPARATOR_TEXTURE : Screen.INWORLD_FOOTER_SEPARATOR_TEXTURE, this.getX(), this.getBottom(), 0.0F, 0.0F, this.getWidth(), 2, 32, 2);
|
||||||
RenderSystem.disableBlend(); }
|
RenderSystem.disableBlend(); }
|
||||||
}
|
}
|
||||||
public void addButton(List<ClickableWidget> buttons, Text text, EntryInfo info) { this.addEntry(new ButtonEntry(buttons, text, info)); }
|
public void addButton(List<ClickableWidget> buttons, Text text, EntryInfo info) { this.addEntry(new ButtonEntry(buttons, text, info)); }
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
org.gradle.jvmargs=-Xmx4096M
|
org.gradle.jvmargs=-Xmx4096M
|
||||||
|
|
||||||
minecraft_version=1.21.4
|
minecraft_version=1.21
|
||||||
supported_versions=
|
supported_versions=
|
||||||
yarn_mappings=1.21.4+build.1
|
yarn_mappings=1.21+build.1
|
||||||
enabled_platforms=fabric,neoforge
|
enabled_platforms=fabric,neoforge
|
||||||
|
|
||||||
archives_base_name=midnightlib
|
archives_base_name=midnightlib
|
||||||
mod_version=1.6.6
|
mod_version=1.6.7-1.21
|
||||||
maven_group=eu.midnightdust
|
maven_group=eu.midnightdust
|
||||||
release_type=release
|
release_type=release
|
||||||
curseforge_id=488090
|
curseforge_id=488090
|
||||||
modrinth_id=codAaoxh
|
modrinth_id=codAaoxh
|
||||||
|
|
||||||
fabric_loader_version=0.16.9
|
fabric_loader_version=0.16.10
|
||||||
fabric_api_version=0.110.5+1.21.4
|
fabric_api_version=0.115.0+1.21.1
|
||||||
|
|
||||||
neoforge_version=21.4.3-beta
|
neoforge_version=21.0.167
|
||||||
yarn_mappings_patch_neoforge_version = 1.21+build.4
|
yarn_mappings_patch_neoforge_version = 1.21+build.4
|
||||||
|
|
||||||
quilt_loader_version=0.19.0-beta.18
|
quilt_loader_version=0.19.0-beta.18
|
||||||
|
|||||||
Reference in New Issue
Block a user