Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Saveable Schematics for the Ring of Loki #75

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
Added new icons and adjusted GUI scale
ReignOfFROZE committed Mar 3, 2025
commit 3620cf91bb0f2db7062bf1f0f599f6bdd3908668
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
@@ -16,6 +16,6 @@ dependencies {
compileOnly('curse.maven:cofh-lib-220333:2388748')
compileOnly('curse.maven:minefactory-reloaded-66672:2366150')
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.7.18-GTNH:dev')
// runtimeOnlyNonPublishable('com.github.GTNewHorizons:ModularUI2:2.2.4-1.7.10:dev')
runtimeOnlyNonPublishable('com.github.GTNewHorizons:ModularUI2:2.2.4-1.7.10:dev')
}

27 changes: 13 additions & 14 deletions src/main/java/vazkii/botania/client/gui/loki/GuiLokiSchematics.java
Original file line number Diff line number Diff line change
@@ -64,20 +64,20 @@ public ModularPanel buildUI(ModularGuiContext context) {
.imageSize(330, 252)
.adaptable(12)
.build();
final UITexture checkIcon = AdaptableUITexture
final UITexture checkIcon = UITexture
.builder()
.location("botania:textures/gui/check")
.imageSize(16, 16)
.imageSize(20, 20)
.build();
final UITexture deleteIcon = AdaptableUITexture
final UITexture deleteIcon = UITexture
.builder()
.location("botania:textures/gui/delete")
.imageSize(16, 16)
.imageSize(20, 20)
.build();
final UITexture renameIcon = AdaptableUITexture
final UITexture renameIcon = UITexture
.builder()
.location("botania:textures/gui/rename")
.imageSize(16, 16)
.imageSize(20, 20)
.build();

selectedSchematic = itemStack.getTagCompound().getString(ItemLokiRing.TAG_CURRENT_SCHEMATIC);
@@ -88,20 +88,19 @@ public ModularPanel buildUI(ModularGuiContext context) {
Set<Object> deleted = new HashSet<>();

final ScrollWidget<?> scrollWidget = new ScrollWidget<>(new VerticalScrollData());
scrollWidget.getScrollArea().getScrollY().setScrollSize(ring.schematicNames.size() * (SCROLL_AREA_HEIGHT / 10 + 1));
scrollWidget.getScrollArea().getScrollY().setScrollSize(ring.schematicNames.size() * (SCROLL_AREA_HEIGHT / 5 + 1));
int idx = 0;
for(Object key : itemStack.getTagCompound().getCompoundTag(ItemLokiRing.TAG_SAVED_SCHEMATICS).tagMap.keySet()) {
scrollWidget.child(
new Row()
.sizeRel(1f, 0.1f)
.pos(0, ring.schematicNames.indexOf(key) * (SCROLL_AREA_HEIGHT / 10 + 1))
.sizeRel(1f, 0.2f)
.pos(0, ring.schematicNames.indexOf(key) * (SCROLL_AREA_HEIGHT / 5 + 1))
.padding(5, 0, 5, 5)
.setEnabledIf((w) -> !deleted.contains(key))
.background(new Rectangle()
.setColor(idx % 2 == 0 ? Color.ORANGE.brighter(3) : Color.ORANGE.brighter(2)))
.child(
new TextWidget(key.toString())
.scale(0.5f)
.widthRel(0.72f))
.child(
new ParentWidget<>()
@@ -118,7 +117,7 @@ public ModularPanel buildUI(ModularGuiContext context) {
})
.background(checkIcon)
.hoverBackground(checkIcon)
.size(8, 8)
.size(20,20)
.center()))
.child(
new ParentWidget<>()
@@ -134,7 +133,7 @@ public ModularPanel buildUI(ModularGuiContext context) {
})
.background(renameIcon)
.hoverBackground(renameIcon)
.size(8, 8)
.size(20, 20)
.center()))
.child(
new ParentWidget<>()
@@ -150,7 +149,7 @@ public ModularPanel buildUI(ModularGuiContext context) {
})
.background(deleteIcon)
.hoverBackground(deleteIcon)
.size(8, 8)
.size(20, 20)
.center())));
idx++;
}
@@ -161,7 +160,7 @@ public ModularPanel buildUI(ModularGuiContext context) {
.style(EnumChatFormatting.BLACK)
.align(Alignment.TopCenter)
.marginTop(8)
.scale(0.5F))
.scale(0.75f))
.child(
scrollWidget
.pos(10, 20)
Binary file modified src/main/resources/assets/botania/textures/gui/check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/assets/botania/textures/gui/delete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/assets/botania/textures/gui/rename.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.