Skip to content

Commit

Permalink
Cleaned up the cad generation buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
madhephaestus committed Jun 20, 2023
1 parent 5eb54ff commit 1064e85
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public class CreatureLab extends AbstractBowlerStudioTab implements IOnEngineeri
private ProgressIndicator pi;

private MobileBaseCadManager baseManager;
private CheckBox autoRegen = new CheckBox("Auto-Regen CAD");
private CheckBox autoRegen = new CheckBox("Auto-Generate CAD");
private Button regen=new Button("Generate Cad Now");
Parent root;
private BowlerJInputDevice gameController = null;
CreatureLabControlsTab tab = new CreatureLabControlsTab();
Expand Down Expand Up @@ -79,6 +80,11 @@ public void initializeUI(BowlerAbstractDevice pm) {
autoRegen.setOnAction(event -> {
regenFromUiEvent();
});
regen.setDisable(true);
regen.setOnAction(event -> {
autoRegen.setSelected(true);
regenFromUiEvent();
});
// TODO Auto-generated method stub
setText(pm.getScriptingName());

Expand Down Expand Up @@ -135,6 +141,7 @@ private void regenFromUiEvent() {
autoRegen.setDisable(true);
if (radioOptions != null)
radioOptions.setDisable(true);
regen.setDisable(true);
}
baseManager.setAutoRegen(autoRegen.isSelected());
if (autoRegen.isSelected()) {
Expand Down Expand Up @@ -263,14 +270,15 @@ public void run() {
baseManager = MobileBaseCadManager.get(device, BowlerStudioController.getMobileBaseUI());
pi.progressProperty().bindBidirectional(baseManager.getProcesIndictor());
HBox progressIndicatorPanel = new HBox(10);
progressIndicatorPanel.getChildren().addAll(new Label("Cad Progress:"), pi);
progress.getChildren().addAll(progressIndicatorPanel, autoRegen, radioOptions);

progress.setStyle("-fx-background-color: #FFFFFF;");
progress.setOpacity(.7);
progress.setMinHeight(100);
progress.setPrefSize(325, 150);
tab.setOverlayTop(progress);
progress.getChildren().addAll( regen,autoRegen, radioOptions);
progressIndicatorPanel.getChildren().addAll( progress,pi);

progressIndicatorPanel.setStyle("-fx-background-color: #FFFFFF;");
progressIndicatorPanel.setOpacity(.7);
progressIndicatorPanel.setMinHeight(100);
progressIndicatorPanel.setPrefSize(325, 150);
tab.setOverlayTop(progressIndicatorPanel);

BowlerStudioModularFrame.getBowlerStudioModularFrame().showCreatureLab();
setCadMode(true);// start the UI in config mode
Expand All @@ -286,6 +294,8 @@ public void changed(ObservableValue<? extends Number> observable, Number oldValu
autoRegen.setDisable(false);
if (radioOptions != null)
radioOptions.setDisable(false);
regen.setDisable(false);

});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import javafx.fxml.FXML;
import javafx.scene.control.TreeView;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;

public class CreatureLabControlsTab {
Expand Down Expand Up @@ -53,7 +54,7 @@ public void setTreeBox(AnchorPane treeBox) {
}


public void setOverlayTop(VBox progress) {
public void setOverlayTop(HBox progress) {
// TODO Auto-generated method stub
BowlerStudio.runLater(()->{
progressBar.getChildren().clear();
Expand Down

0 comments on commit 1064e85

Please sign in to comment.