Now component animations and MainPagePanel animation can be disabled

This commit is contained in:
huangyuhui
2017-05-20 18:44:26 +08:00
parent 3462123877
commit 30ee33cd66
4 changed files with 14 additions and 1 deletions

View File

@@ -60,6 +60,8 @@ import org.jackhuang.hmcl.laf.utils.TMSchema.Part;
* @author Igor Kushnirskiy
*/
public class AnimationController implements ActionListener, PropertyChangeListener {
public static boolean ENABLE_ANIMATION = true;
private static AnimationController INSTANCE = new AnimationController();
private static final String ANIMATION_CONTROLLER_KEY = "BeautyEye.AnimationController";
@@ -205,7 +207,8 @@ public class AnimationController implements ActionListener, PropertyChangeListen
public static void paintSkin(JComponent component, Skin skin,
Graphics g, int dx, int dy, int dw, int dh, State state) {
triggerAnimation(component, skin.getPart(component), state);
if (ENABLE_ANIMATION)
triggerAnimation(component, skin.getPart(component), state);
AnimationController controller = getAnimationController(component);
synchronized (controller) {
AnimationState animationState = null;