1 package com.badlogic.gdx.tools.flame; 2 3 import com.badlogic.gdx.graphics.g3d.particles.values.ParticleValue; 4 5 /** @author Inferno */ 6 public class ParticleValuePanel<T extends ParticleValue> extends EditorPanel<T> { 7 ParticleValuePanel(FlameMain editor, String name, String description)8 public ParticleValuePanel (FlameMain editor, String name, String description) { 9 this(editor, name, description, true); 10 } 11 ParticleValuePanel(FlameMain editor, String name, String description, boolean isAlwaysActive)12 public ParticleValuePanel (FlameMain editor, String name, String description, boolean isAlwaysActive) { 13 this(editor, name, description, isAlwaysActive, false); 14 } 15 ParticleValuePanel(FlameMain editor, String name, String description, boolean isAlwaysActive, boolean isRemovable)16 public ParticleValuePanel (FlameMain editor, String name, String description, boolean isAlwaysActive, boolean isRemovable) { 17 super(editor, name, description, isAlwaysActive, isRemovable); 18 } 19 20 setHasAdvanced(boolean hasAdvanced)21 public void setHasAdvanced (boolean hasAdvanced) { 22 super.setHasAdvanced(hasAdvanced); 23 advancedButton.setVisible(hasAdvanced && (value.isActive() || isAlwaysActive)); 24 } 25 26 @Override setValue(T value)27 public void setValue (T value) { 28 super.setValue(value); 29 if(value != null){ 30 activeButton.setSelected(value.isActive()); 31 } 32 } 33 34 @Override activate()35 protected void activate () { 36 super.activate(); 37 if (value != null) value.setActive(activeButton.isSelected()); 38 } 39 } 40