Add Talos autostart flag
This commit is contained in:
Submodule h2d-libgdx-talos-extension updated: 946b6beb7e...af8045e3c7
+2
@@ -25,6 +25,7 @@ public class UpdateTalosDataCommand extends EntityModifyRevertibleCommand {
|
||||
|
||||
TalosComponent talosComponent = SandboxComponentRetriever.get(entity, TalosComponent.class);
|
||||
talosComponent.transform = vo.transform;
|
||||
talosComponent.autoStart = vo.autoStart;
|
||||
talosComponent.effect.setPosition(0, 0);
|
||||
|
||||
Facade.getInstance().sendNotification(MsgAPI.ITEM_DATA_UPDATED, entity);
|
||||
@@ -37,6 +38,7 @@ public class UpdateTalosDataCommand extends EntityModifyRevertibleCommand {
|
||||
TalosComponent talosComponent = SandboxComponentRetriever.get(entity, TalosComponent.class);
|
||||
talosComponent.effect.setPosition(0, 0);
|
||||
talosComponent.transform = backup.transform;
|
||||
talosComponent.autoStart = backup.autoStart;
|
||||
|
||||
Facade.getInstance().sendNotification(MsgAPI.ITEM_DATA_UPDATED, entity);
|
||||
}
|
||||
|
||||
+13
-4
@@ -1,21 +1,21 @@
|
||||
package games.rednblack.editor.view.ui.properties.panels;
|
||||
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.kotcrab.vis.ui.widget.VisCheckBox;
|
||||
import games.rednblack.editor.event.CheckBoxChangeListener;
|
||||
import games.rednblack.editor.view.ui.properties.UIItemCollapsibleProperties;
|
||||
import games.rednblack.h2d.common.view.ui.StandardWidgetsFactory;
|
||||
|
||||
public class UITalosProperties extends UIItemCollapsibleProperties {
|
||||
private VisCheckBox matrixTransformCheckBox;
|
||||
private final VisCheckBox matrixTransformCheckBox, autoStartCheckBox;
|
||||
|
||||
public UITalosProperties() {
|
||||
super("Talos VFX");
|
||||
|
||||
matrixTransformCheckBox = StandardWidgetsFactory.createCheckBox();
|
||||
matrixTransformCheckBox = StandardWidgetsFactory.createCheckBox("Matrix Transform");
|
||||
autoStartCheckBox = StandardWidgetsFactory.createCheckBox("Auto Start");
|
||||
|
||||
mainTable.add(StandardWidgetsFactory.createLabel("Matrix Transform", Align.right)).padRight(5).width(120).right();
|
||||
mainTable.add(matrixTransformCheckBox).left().row();
|
||||
mainTable.add(autoStartCheckBox).left().row();
|
||||
|
||||
setListeners();
|
||||
}
|
||||
@@ -29,11 +29,20 @@ public class UITalosProperties extends UIItemCollapsibleProperties {
|
||||
return matrixTransformCheckBox.isChecked();
|
||||
}
|
||||
|
||||
public boolean isAutoStartEnabled() {
|
||||
return autoStartCheckBox.isChecked();
|
||||
}
|
||||
|
||||
public void setMatrixTransformEnabled(boolean scissorsEnabled) {
|
||||
matrixTransformCheckBox.setChecked(scissorsEnabled);
|
||||
}
|
||||
|
||||
public void setAutoStartEnabled(boolean autoStart) {
|
||||
autoStartCheckBox.setChecked(autoStart);
|
||||
}
|
||||
|
||||
private void setListeners() {
|
||||
matrixTransformCheckBox.addListener(new CheckBoxChangeListener(getUpdateEventName()));
|
||||
autoStartCheckBox.addListener(new CheckBoxChangeListener(getUpdateEventName()));
|
||||
}
|
||||
}
|
||||
|
||||
+4
-1
@@ -18,13 +18,16 @@ public class UITalosPropertiesMediator extends UIItemPropertiesMediator<UITalosP
|
||||
|
||||
@Override
|
||||
protected void translateObservableDataToView(int item) {
|
||||
viewComponent.setMatrixTransformEnabled(SandboxComponentRetriever.get(item, TalosComponent.class).transform);
|
||||
TalosComponent talosComponent = SandboxComponentRetriever.get(item, TalosComponent.class);
|
||||
viewComponent.setMatrixTransformEnabled(talosComponent.transform);
|
||||
viewComponent.setAutoStartEnabled(talosComponent.autoStart);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void translateViewToItemData() {
|
||||
TalosVO payloadVo = new TalosVO();
|
||||
payloadVo.transform = viewComponent.isMatrixTransformEnabled();
|
||||
payloadVo.autoStart = viewComponent.isAutoStartEnabled();
|
||||
|
||||
Object payload = UpdateTalosDataCommand.payload(observableReference, payloadVo);
|
||||
facade.sendNotification(MsgAPI.ACTION_UPDATE_TALOS_DATA, payload);
|
||||
|
||||
Reference in New Issue
Block a user