Group animation settings per menu
The Animations section shows each menu's duration, stagger and curve under the menu's name instead of one flat list of 18 rows. AnimationConfig keeps its name and lists every menu's config; it's saved under the same keys as before, so existing settings keep loading. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
package org.saturnclient.config;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.saturnclient.config.property.IntProperty;
|
||||
import org.saturnclient.config.property.Property;
|
||||
import org.saturnclient.config.property.SelectProperty;
|
||||
@@ -25,6 +29,10 @@ public class AnimationConfig {
|
||||
// Emote wheel
|
||||
public static final AnimationConfig emoteWheel = new AnimationConfig(true, 700, 40);
|
||||
|
||||
/** Every menu's animation, in the order they're shown in the settings */
|
||||
public static final List<AnimationConfig> ALL = List.of(logo, mainMenu, modMenu, shiftMenu, cosmeticsMenu,
|
||||
emoteWheel);
|
||||
|
||||
public static void init(ConfigManager parent) {
|
||||
config = new ConfigManager(parent, "Animations");
|
||||
|
||||
@@ -47,7 +55,25 @@ public class AnimationConfig {
|
||||
this.curve = Property.select(1, "Ease In Out Cubic", "Ease Out Cubic", "Ease In Out Back");
|
||||
}
|
||||
|
||||
/** The menu this animates, like "Mod Menu" */
|
||||
public String name;
|
||||
|
||||
/**
|
||||
* This animation's settings under short names ("Duration"), for showing
|
||||
* them grouped under {@link #name}. They're saved under longer names
|
||||
* ("Mod Menu Duration"), which stay as they are so saved settings keep
|
||||
* loading.
|
||||
*/
|
||||
public Map<String, Property> getProperties() {
|
||||
Map<String, Property> properties = new LinkedHashMap<>();
|
||||
properties.put("Duration", duration);
|
||||
properties.put("Stagger", stagger);
|
||||
properties.put("Curve", curve);
|
||||
return properties;
|
||||
}
|
||||
|
||||
public void init(String name) {
|
||||
this.name = name;
|
||||
// config.property("Enable " + name + " Animations", this.enabled);
|
||||
config.property(name + " Duration", this.duration, "How long the animation takes");
|
||||
config.property(name + " Stagger", this.stagger, "Delay between items appearing one after another");
|
||||
|
||||
Reference in New Issue
Block a user