Register new Property to imply that the path segment following a keyframe has a user-set interpolator instead of the default

Modified Keyframe GUI to allow for custom Path interpolator
This commit is contained in:
CrushedPixel
2017-01-13 12:05:07 +01:00
parent d46589193e
commit cd16211309
6 changed files with 417 additions and 31 deletions

View File

@@ -2,9 +2,23 @@ package com.replaymod.simplepathing;
import com.replaymod.core.SettingsRegistry;
import java.util.ArrayList;
public final class Setting<T> extends SettingsRegistry.SettingKeys<T> {
public static final Setting<Boolean> PATH_PREVIEW = make("pathpreview", "pathpreview", true);
public static final Setting<Boolean> LINEAR_INTERPOLATION = make("linear_interpolation", "linearinterpolation", false);
public static final SettingsRegistry.MultipleChoiceSettingKeys<String> DEFAULT_INTERPOLATION =
new SettingsRegistry.MultipleChoiceSettingKeys<>(
"simplepathing", "interpolator", "replaymod.gui.settings.interpolator",
"replaymod.gui.editkeyframe.interpolator.cubic.name");
static {
DEFAULT_INTERPOLATION.setChoices(new ArrayList<String>() {
{
add("replaymod.gui.editkeyframe.interpolator.cubic.name");
add("replaymod.gui.editkeyframe.interpolator.linear.name");
}
});
}
private static <T> Setting<T> make(String key, String displayName, T defaultValue) {
return new Setting<>(key, displayName, defaultValue);