Added PathPreviewRenderer to draw a Preview of the current Camera Path into the World

Added KeyframesModifyEvent to be dispatched whenever the ReplayHandler's Keyframe List is changed
Refactored Event package
Reworked Settings GUI
This commit is contained in:
CrushedPixel
2015-06-15 11:32:34 +02:00
committed by johni0702
parent 6d4512e74b
commit 3df1bdcfc8
23 changed files with 447 additions and 126 deletions

View File

@@ -0,0 +1,39 @@
package eu.crushedpixel.replaymod.gui.elements;
import eu.crushedpixel.replaymod.ReplayMod;
import eu.crushedpixel.replaymod.settings.ReplaySettings;
public class GuiSettingsOnOffButton extends GuiOnOffButton {
private ReplaySettings.ValueEnum toChange;
public GuiSettingsOnOffButton(int buttonId, int x, int y, int width, int height, ReplaySettings.ValueEnum toChange) {
super(buttonId, x, y, width, height, toChange.getName()+": ");
this.toChange = toChange;
if(toChange.getValue() instanceof Boolean) {
this.setValue((Boolean) toChange.getValue() == true ? 0 : 1);
}
}
public GuiSettingsOnOffButton(int buttonId, int x, int y, int width, int height, ReplaySettings.ValueEnum toChange, String onValue, String offValue) {
super(buttonId, x, y, width, height, toChange.getName()+": ", onValue, offValue);
this.toChange = toChange;
if(toChange.getValue() instanceof Boolean) {
this.setValue((Boolean) toChange.getValue() == true ? 0 : 1);
}
}
@Override
public void toggle() {
super.toggle();
toChange.setValue(isOn());
ReplayMod.replaySettings.rewriteSettings();
}
@Override
public void setValue(int value) {
super.setValue(value);
toChange.setValue(isOn());
ReplayMod.replaySettings.rewriteSettings();
}
}