Added some important stuff again
This commit is contained in:
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user