Optional staggering
This commit is contained in:
@@ -12,6 +12,7 @@ public class SaturnClientConfig {
|
|||||||
public static Property<Boolean> saturnTitleScreen = Property.bool(true);
|
public static Property<Boolean> saturnTitleScreen = Property.bool(true);
|
||||||
public static Property<Boolean> bendyCloaks = Property.bool(true);
|
public static Property<Boolean> bendyCloaks = Property.bool(true);
|
||||||
public static Property<Integer> openEmoteWheel = Property.keybinding(GLFW.GLFW_KEY_B);
|
public static Property<Integer> openEmoteWheel = Property.keybinding(GLFW.GLFW_KEY_B);
|
||||||
|
public static Property<Boolean> stagger = Property.bool(true);
|
||||||
|
|
||||||
public static Identifier getLogo() {
|
public static Identifier getLogo() {
|
||||||
return realisticLogo.value ? Textures.REALISTIC_LOGO : Textures.LOGO;
|
return realisticLogo.value ? Textures.REALISTIC_LOGO : Textures.LOGO;
|
||||||
@@ -23,6 +24,7 @@ public class SaturnClientConfig {
|
|||||||
config.property("Saturn client title screen", saturnTitleScreen);
|
config.property("Saturn client title screen", saturnTitleScreen);
|
||||||
config.property("Open Emote Wheel", openEmoteWheel);
|
config.property("Open Emote Wheel", openEmoteWheel);
|
||||||
config.property("Bendy Cloaks", bendyCloaks);
|
config.property("Bendy Cloaks", bendyCloaks);
|
||||||
|
config.property("Stagger Animations", stagger);
|
||||||
|
|
||||||
// Initialize a sub namespace for theme
|
// Initialize a sub namespace for theme
|
||||||
Theme.init(config);
|
Theme.init(config);
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package org.saturnclient.ui2.elements;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.saturnclient.saturnclient.config.SaturnClientConfig;
|
||||||
import org.saturnclient.ui2.Element;
|
import org.saturnclient.ui2.Element;
|
||||||
import org.saturnclient.ui2.ElementContext;
|
import org.saturnclient.ui2.ElementContext;
|
||||||
import org.saturnclient.ui2.RenderScope;
|
import org.saturnclient.ui2.RenderScope;
|
||||||
@@ -17,9 +18,14 @@ public class AnimationStagger extends Element {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void draw(Element element) {
|
public void draw(Element element) {
|
||||||
|
if (!SaturnClientConfig.stagger.value) {
|
||||||
|
element.animation = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (element.animation != null) {
|
if (element.animation != null) {
|
||||||
element.animation.delay = delay * children.size();
|
element.animation.delay = delay * children.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
ElementRenderer.draw(children, element);
|
ElementRenderer.draw(children, element);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public class Scroll extends Element {
|
|||||||
int calculateScrollBarHeight() {
|
int calculateScrollBarHeight() {
|
||||||
if (maxScroll <= 0)
|
if (maxScroll <= 0)
|
||||||
return height - (scrollBarPadding.value * 2);
|
return height - (scrollBarPadding.value * 2);
|
||||||
return Math.max(20, (height * height) / (height + maxScroll)) - (scrollBarPadding.value * 2);
|
return Math.max(20, (height * height) / (height + maxScroll + 10)) - (scrollBarPadding.value * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
int calculateScrollBarY() {
|
int calculateScrollBarY() {
|
||||||
|
|||||||
Reference in New Issue
Block a user