Added some important stuff again

This commit is contained in:
2026-07-06 20:59:35 +02:00
parent 8471d50646
commit 705141a240
7 changed files with 228 additions and 5 deletions
@@ -9,6 +9,7 @@ import io.wispforest.owo.ui.core.*;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.sounds.SimpleSoundInstance;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.Identifier;
import net.minecraft.sounds.SoundEvents;
import de.fullrisk.citrusDev.UIHelper.ScalableLabel;
import de.fullrisk.citrusDev.UIHelper.ScalableButton;
@@ -16,6 +17,8 @@ import de.fullrisk.citrusDev.UIHelper.ScaleValue;
public class MyScreen extends BaseOwoScreen<FlowLayout> {
private static final Identifier MC_FIVE = Identifier.fromNamespaceAndPath("citrus-dev", "minecraft_five");
public MyScreen() {
super(Component.literal("Citrus Dev"));
Minecraft.getInstance().getSoundManager().play(
@@ -90,6 +93,20 @@ public class MyScreen extends BaseOwoScreen<FlowLayout> {
friendsButton.verticalSizing(Sizing.fixed(20));
friendsButton.scale().animate(300, Easing.CUBIC, new ScaleValue(1f)).forwards();
// --- Sidebar Button Animations (Pop-in) ---
sidebarButton.scale().set(new ScaleValue(0f));
sidebarButton.scale().animate(400, Easing.CUBIC, new ScaleValue(1f)).forwards();
friendsButton.scale().set(new ScaleValue(0f));
friendsButton.scale().animate(430, Easing.CUBIC, new ScaleValue(1f)).forwards();
// --- Sidebar Button Hover Interactions ---
sidebarButton.mouseEnter().subscribe(() -> sidebarButton.scale().animate(120, Easing.CUBIC, new ScaleValue(1.1f)).forwards());
sidebarButton.mouseLeave().subscribe(() -> sidebarButton.scale().animate(120, Easing.CUBIC, new ScaleValue(1.0f)).forwards());
friendsButton.mouseEnter().subscribe(() -> friendsButton.scale().animate(120, Easing.CUBIC, new ScaleValue(1.1f)).forwards());
friendsButton.mouseLeave().subscribe(() -> friendsButton.scale().animate(120, Easing.CUBIC, new ScaleValue(1.0f)).forwards());
sidebar.child(friendsButton);
sidebar.child(sidebarButton);
panel.child(sidebar);
@@ -138,7 +155,7 @@ public class MyScreen extends BaseOwoScreen<FlowLayout> {
version.verticalTextAlignment(VerticalAlignment.BOTTOM);
version.horizontalSizing(Sizing.fixed(202));
version.verticalSizing(Sizing.fixed(12));
version.positioning(Positioning.relative(115, 100)); // bottom-right corner of `panel`
version.positioning(Positioning.relative(125, 100)); // bottom-right corner of `panel`
version.scale().set(new ScaleValue(0.7f));
@@ -11,11 +11,17 @@ import net.minecraft.network.chat.Component;
import io.wispforest.owo.ui.core.*;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.sounds.SimpleSoundInstance;
import net.minecraft.network.chat.FontDescription;
import net.minecraft.resources.Identifier;
import net.minecraft.sounds.SoundEvents;
import de.fullrisk.citrusDev.UIHelper.ScalableLabel;
import de.fullrisk.citrusDev.UIHelper.ScalableButton;
import de.fullrisk.citrusDev.UIHelper.ScaleValue;
public class OverviewScreen extends BaseOwoScreen<FlowLayout> {
private static final Identifier MC_FIVE = Identifier.fromNamespaceAndPath("citrus-dev", "minecraft_five");
@Override
protected OwoUIAdapter<FlowLayout> createAdapter() {
return OwoUIAdapter.create(this, UIContainers::verticalFlow);
@@ -33,16 +39,29 @@ public class OverviewScreen extends BaseOwoScreen<FlowLayout> {
iconButton.verticalAlignment(VerticalAlignment.CENTER);
iconButton.horizontalAlignment(HorizontalAlignment.CENTER);
iconButton.padding(Insets.of(6));
iconButton.horizontalSizing(Sizing.fixed(0));
iconButton.verticalSizing(Sizing.fixed(0));
Surface glassPanel = Surface.blur(5f, 15f)
.and(Surface.flat(0x40FFFFFF))
.and(Surface.outline(0xFFFFFFFF));
iconButton.surface(glassPanel);
iconButton.child(UIComponents.texture(
Identifier.fromNamespaceAndPath("minecraft", "textures/item/diamond.png"),
0, 0, 16, 16, 16, 16
));
iconButton.child(UIComponents.label(Component.literal("Click me")));
Identifier.fromNamespaceAndPath("citrus-dev", "textures/icons/block_culling_file.png"),
0, 0, 18, 12, 18, 12
)).horizontalAlignment(HorizontalAlignment.LEFT);
iconButton.child(UIComponents.label(
Component.literal("FPS")
.withStyle(style -> style.withFont(new FontDescription.Resource(MC_FIVE))))
.verticalTextAlignment(VerticalAlignment.TOP)
.verticalSizing(Sizing.fill(85)) // Forces the label component to span the full height
);
iconButton.child(UIComponents.label(
Component.literal("Test")
.withStyle(style -> style.withFont(new FontDescription.Resource(MC_FIVE))))
.verticalTextAlignment(VerticalAlignment.TOP)
.verticalSizing(Sizing.fill(85)) // Forces the label component to span the full height
);
iconButton.mouseEnter().subscribe(() -> {
iconButton.surface(Surface.blur(5f, 15f)
@@ -62,8 +81,11 @@ public class OverviewScreen extends BaseOwoScreen<FlowLayout> {
);
return true;
});
iconButton.horizontalSizing().animate(150, Easing.CUBIC, Sizing.fixed(100)).forwards();
iconButton.verticalSizing().animate(150, Easing.CUBIC, Sizing.fixed(35)).forwards();
rootComponent.child(iconButton);
}
@Override
public boolean isPauseScreen() {
return false;