gt:         if (ProjectManager.getCurrentClientLevelData() != null) {
context: package craftedcart.smblevelworkshop.ui;
  
  import craftedcart.smblevelworkshop.SMBLWSettings;
  import craftedcart.smblevelworkshop.Window;
  import craftedcart.smblevelworkshop.asset.*;
  import craftedcart.smblevelworkshop.level.ClientLevelData;
  import craftedcart.smblevelworkshop.level.LevelData;
  import craftedcart.smblevelworkshop.project.ProjectManager;
  import craftedcart.smblevelworkshop.resource.LangManager;
  import craftedcart.smblevelworkshop.resource.ResourceManager;
  import craftedcart.smblevelworkshop.resource.ResourceShaderProgram;
  import craftedcart.smblevelworkshop.resource.model.OBJLoader;
  import craftedcart.smblevelworkshop.resource.model.OBJObject;
  import craftedcart.smblevelworkshop.resource.model.ResourceModel;
  import craftedcart.smblevelworkshop.ui.component.FPSOverlay;
  import craftedcart.smblevelworkshop.ui.component.InputOverlay;
  import craftedcart.smblevelworkshop.ui.component.ItemButton;
  import craftedcart.smblevelworkshop.ui.component.OutlinerObject;
  import craftedcart.smblevelworkshop.ui.component.timeline.Timeline;
  import craftedcart.smblevelworkshop.ui.component.transform.*;
  import craftedcart.smblevelworkshop.undo.*;
  import craftedcart.smblevelworkshop.util.*;
  import craftedcart.smblevelworkshop.util.MathUtils;
  import craftedcart.smbworkshopexporter.*;
  import craftedcart.smbworkshopexporter.placeables.*;
  import io.github.craftedcart.fluidui.FluidUIScreen;
  import io.github.craftedcart.fluidui.IUIScreen;
  import io.github.craftedcart.fluidui.component.Button;
  import io.github.craftedcart.fluidui.component.*;
  import io.github.craftedcart.fluidui.component.Component;
  import io.github.craftedcart.fluidui.component.Image;
  import io.github.craftedcart.fluidui.component.Label;
  import io.github.craftedcart.fluidui.component.Panel;
  import io.github.craftedcart.fluidui.component.TextField;
  import io.github.craftedcart.fluidui.plugin.AbstractComponentPlugin;
  import io.github.craftedcart.fluidui.plugin.PluginSmoothAnimateAnchor;
  import io.github.craftedcart.fluidui.uiaction.UIAction;
  import io.github.craftedcart.fluidui.util.*;
  import org.jetbrains.annotations.NotNull;
  import org.jetbrains.annotations.Nullable;
  import org.lwjgl.LWJGLException;
  import org.lwjgl.input.Keyboard;
  import org.lwjgl.input.Mouse;
  import org.lwjgl.opengl.Display;
  import org.lwjgl.opengl.GL11;
  import org.lwjgl.opengl.GL20;
  import org.lwjgl.util.glu.GLU;
  import org.xml.sax.SAXException;
  
  import javax.xml.parsers.ParserConfigurationException;
  import java.awt.*;
  import java.io.File;
  import java.io.IOException;
  import java.util.*;
  import java.util.List;
  
  /**
   * @author CraftedCart
   * Created on 02/04/2016 (DD/MM/YYYY)
   */
  public class MainScreen extends FluidUIScreen {
  
      private static final double TIMELINE_HEIGHT = 136;
  
      //Camera
      @NotNull private PosXYZ cameraPos = new PosXYZ(5, 5, 5);
      @NotNull private PosXY cameraRot = new PosXY(-45, 35);
  
      //UI
      private final Image modeCursor = new Image();
      private final Component mainUI = new Component();
      private final Label modeLabel = new Label();
      private final Label modeDirectionLabel = new Label();
      private final Panel notifPanel = new Panel();
      private final Timeline timeline = new Timeline(this);
      private final Panel onScreenCameraControlsPanel = new Panel();
      private final FPSOverlay fpsOverlay = new FPSOverlay();
  
      private EnumObjectMode objectMode = EnumObjectMode.PLACEABLE_EDIT;
  
      //UI: Left Panel
      public final Panel addPlaceablePanel = new Panel();
      public final Panel outlinerPlaceablesPanel = new Panel();
      public final ListBox outlinerPlaceablesListBox = new ListBox();
      public final Panel outlinerObjectsPanel = new Panel();
      public final ListBox outlinerObjectsListBox = new ListBox();
  
      private final TextButton importObjButton = new TextButton();
      private final TextButton importConfigButton = new TextButton();
      private final TextButton exportButton = new TextButton();
      private final TextButton settingsButton = new TextButton();
      private final TextButton projectSettingsButton = new TextButton();
  
      //UI: Placeable Properties
      private final ListBox propertiesPlaceablesListBox = new ListBox();
      private final ListBox propertiesObjectsListBox = new ListBox();
  
      private final PlaceableScaleTextFields placeableScaleTextFields = new PlaceableScaleTextFields(this, null);
      private final PlaceableRotationTextFields placeableRotationTextFields = new PlaceableRotationTextFields(this, placeableScaleTextFields.getFirstTextField());
      private final PlaceablePositionTextFields placeablePositionTextFields = new PlaceablePositionTextFields(this, placeableRotationTextFields.getFirstTextField());
  
      private final TextButton typeButton = new TextButton();
      @Nullable private List<String> typeList = null;
  
      private final TextButton placeableItemGroupButton = new TextButton();
  
      //UI: Object Properties
      private final TextButton objectItemGroupButton = new TextButton();
  
      //UI: Text Fields
      private Set<TextField> textFields;
  
      //UI: Input Overlay
      private final InputOverlay inputOverlay = new InputOverlay();
  
      //Undo
      @NotNull private List<UndoCommand> undoCommandList = new ArrayList<>();
      @NotNull private List<UndoCommand> redoCommandList = new ArrayList<>();
  
      private boolean preventRendering = false; //Used when unloading textures and VBOs
      private boolean isLoadingProject = false; //Just in case disabling the button is too slow
  
      //Notifications
      private int notificationID = 0;
  
      //Mouse & Scroll Wheel Delta (For snapping)
      private double deltaX = 0;
  
      //Locks
      private final Object outlinerPlaceablesListBoxLock = new Object();
      private final Object outlinerObjectsListBoxLock = new Object();
      private final Object renderingLock = new Object();
  
      private final Set<UIAction> nextFrameActions = new HashSet<>();
  
      public MainScreen() {
          init();
      }
  
      private void init() {
  
          if (textFields == null) {
              textFields = new HashSet<>();
          }
  
          try {
              Window.drawable.makeCurrent();
          } catch (LWJGLException e) {
              e.printStackTrace();
          }
  
          //Defined at class level
          modeCursor.setOnInitAction(() -> {
              modeCursor.setTopLeftPos(-16, -16);
              modeCursor.setBottomRightPos(16, 16);
              modeCursor.setTopLeftAnchor(0.5, 0.5);
              modeCursor.setBottomRightAnchor(0.5, 0.5);
              modeCursor.setVisible(false);
              modeCursor.setTexture(ResourceManager.getTexture("image/modeEditCursor").getTexture());
              modeCursor.setColor(UIColor.matGreen());
          });
          addChildComponent("modeCursor", modeCursor);
  
          //Defined at class level
          mainUI.setOnInitAction(() -> {
              mainUI.setTopLeftPos(0, 0);
              mainUI.setBottomRightPos(0, 0);
              mainUI.setTopLeftAnchor(0, 0);
              mainUI.setBottomRightAnchor(1, 1);
              mainUI.setTheme(new DefaultUITheme());
          });
          addChildComponent("mainUI", mainUI);
  
          //<editor-fold desc="Bottom Panel">
          final Panel bottomPanel = new Panel();
          bottomPanel.setOnInitAction(() -> {
              bottomPanel.setBackgroundColor(UIColor.matGrey900(0.75));
              bottomPanel.setTopLeftPos(260, -50 - TIMELINE_HEIGHT);
              bottomPanel.setBottomRightPos(-260, -4 - TIMELINE_HEIGHT);
              bottomPanel.setTopLeftAnchor(0, 1);
              bottomPanel.setBottomRightAnchor(1, 1);
          });
          mainUI.addChildComponent("bottomPanel", bottomPanel);
          //</editor-fold>
  
          //<editor-fold desc="ProjectManager.getCurrentProject().mode Label">
          //Defined at class level
          modeLabel.setOnInitAction(() -> {
              modeLabel.setTopLeftPos(4, 0);
              modeLabel.setBottomRightPos(-4, 24);
              modeLabel.setTopLeftAnchor(0, 0);
              modeLabel.setBottomRightAnchor(1, 0);
              modeLabel.setTextColor(UIColor.matWhite());
          });
          bottomPanel.addChildComponent("modeLabel", modeLabel);
          //</editor-fold>
  
          //<editor-fold desc="ProjectManager.getCurrentProject().mode Direction Label">
          //Defined at class level
          modeDirectionLabel.setOnInitAction(() -> {
              modeDirectionLabel.setTopLeftPos(4, 24);
              modeDirectionLabel.setBottomRightPos(-4, 48);
              modeDirectionLabel.setTopLeftAnchor(0, 0);
              modeDirectionLabel.setBottomRightAnchor(1, 0);
          });
          bottomPanel.addChildComponent("modeDirectionLabel", modeDirectionLabel);
          //</editor-fold>
  
          final Panel leftPanel = new Panel();
          leftPanel.setOnInitAction(() -> {
              leftPanel.setBackgroundColor(UIColor.matGrey900(0.75));
              leftPanel.setTopLeftPos(0, 0);
              leftPanel.setBottomRightPos(256, 0 - TIMELINE_HEIGHT);
              leftPanel.setTopLeftAnchor(0, 0);
              leftPanel.setBottomRightAnchor(0, 1);
          });
          mainUI.addChildComponent("leftPanel", leftPanel);
  
          //<editor-fold desc="Placeables / Objects mode buttons">
          final TextButton outlinerPlaceablesTabButton = new TextButton();
          final TextButton outlinerObjectsTabButton = new TextButton();
  
          //Defined above
          outlinerPlaceablesTabButton.setOnInitAction(() -> {
              outlinerPlaceablesTabButton.setTopLeftPos(0, 0);
              outlinerPlaceablesTabButton.setBottomRightPos(-1, 24);
              outlinerPlaceablesTabButton.setTopLeftAnchor(0, 0);
              outlinerPlaceablesTabButton.setBottomRightAnchor(0.5, 0);
              outlinerPlaceablesTabButton.setText(LangManager.getItem("placeables"));
              outlinerPlaceablesTabButton.setBackgroundIdleColor(UIColor.matBlue900());
          });
          outlinerPlaceablesTabButton.setOnLMBAction(() -> {
              outlinerPlaceablesTabButton.setBackgroundIdleColor(UIColor.matBlue900());
              outlinerObjectsTabButton.setBackgroundIdleColor(UIColor.matBlue());
  
              addPlaceablePanel.setVisible(true);
              outlinerPlaceablesPanel.setVisible(true);
              outlinerObjectsPanel.setVisible(false);
  
              propertiesPlaceablesListBox.setVisible(true);
              propertiesObjectsListBox.setVisible(false);
  
              if (ProjectManager.getCurrentProject() != null && ProjectManager.getCurrentClientLevelData() != null) {
                  ProjectManager.getCurrentClientLevelData().clearSelectedObjects();
              }
  
              objectMode = EnumObjectMode.PLACEABLE_EDIT;
          });
          leftPanel.addChildComponent("outlinerPlaceablesTabButton", outlinerPlaceablesTabButton);
  
          //Defined above
          outlinerObjectsTabButton.setOnInitAction(() -> {
              outlinerObjectsTabButton.setTopLeftPos(1, 0);
              outlinerObjectsTabButton.setBottomRightPos(0, 24);
              outlinerObjectsTabButton.setTopLeftAnchor(0.5, 0);
              outlinerObjectsTabButton.setBottomRightAnchor(1, 0);
              outlinerObjectsTabButton.setText(LangManager.getItem("objects"));
              outlinerObjectsTabButton.setBackgroundIdleColor(UIColor.matBlue());
          });
          outlinerObjectsTabButton.setOnLMBAction(() -> {
              outlinerPlaceablesTabButton.setBackgroundIdleColor(UIColor.matBlue());
              outlinerObjectsTabButton.setBackgroundIdleColor(UIColor.matBlue900());
  
              addPlaceablePanel.setVisible(false);
              outlinerPlaceablesPanel.setVisible(false);
              outlinerObjectsPanel.setVisible(true);
  
              propertiesPlaceablesListBox.setVisible(false);
              propertiesObjectsListBox.setVisible(true);
  
              if (ProjectManager.getCurrentProject() != null && ProjectManager.getCurrentClientLevelData() != null) {
                  ProjectManager.getCurrentClientLevelData().clearSelectedPlaceables();
              }
  
              objectMode = EnumObjectMode.OBJECT_EDIT;
          });
          leftPanel.addChildComponent("outlinerObjectsTabButton", outlinerObjectsTabButton);
          //</editor-fold>
  
          //Defined at class level
          addPlaceablePanel.setOnInitAction(() -> {
              addPlaceablePanel.setTopLeftPos(0, 24);
              addPlaceablePanel.setBottomRightPos(0, 168);
              addPlaceablePanel.setTopLeftAnchor(0, 0);
              addPlaceablePanel.setBottomRightAnchor(1, 0);
              addPlaceablePanel.setBackgroundColor(UIColor.transparent());
          });
          leftPanel.addChildComponent("addPlaceablePanel", addPlaceablePanel);
  
          final Label addPlaceableLabel = new Label();
          addPlaceableLabel.setOnInitAction(() -> {
              addPlaceableLabel.setText(LangManager.getItem("addPlaceable"));
              addPlaceableLabel.setHorizontalAlign(EnumHAlignment.centre);
              addPlaceableLabel.setVerticalAlign(EnumVAlignment.centre);
              addPlaceableLabel.setTopLeftPos(4, 0);
              addPlaceableLabel.setBottomRightPos(-4, 24);
              addPlaceableLabel.setTopLeftAnchor(0, 0);
              addPlaceableLabel.setBottomRightAnchor(1, 0);
          });
          addPlaceablePanel.addChildComponent("addPlaceableLabel", addPlaceableLabel);
  
          final ListBox addPlaceableListBox = new ListBox();
          addPlaceableListBox.setOnInitAction(() -> {
              addPlaceableListBox.setBackgroundColor(UIColor.transparent());
              addPlaceableListBox.setTopLeftPos(0, 24);
              addPlaceableListBox.setBottomRightPos(0, 0);
              addPlaceableListBox.setTopLeftAnchor(0, 0);
              addPlaceableListBox.setBottomRightAnchor(1, 1);
              addPlaceableListBox.setCanScroll(false);
          });
          addPlaceablePanel.addChildComponent("addPlaceableListBox", addPlaceableListBox);
  
          //<editor-fold desc="Add placeable buttons">
          for (IAsset asset : AssetManager.getAvaliableAssets()) {
              final TextButton placeableButton = new TextButton();
              placeableButton.setOnInitAction(() -> {
                  placeableButton.setText(LangManager.getItem(asset.getName()));
                  placeableButton.setTopLeftPos(0, 0);
                  placeableButton.setBottomRightPos(0, 18);
              });
              placeableButton.setOnLMBAction(() -> addPlaceable(new Placeable(asset.getCopy())));
              addPlaceableListBox.addChildComponent(asset.getName() + "AddPlaceableButton", placeableButton);
          }
          //</editor-fold>
  
          //<editor-fold desc="Outliner placeables panel">
          //Defined at class level
          outlinerPlaceablesPanel.setOnInitAction(() -> {
              outlinerPlaceablesPanel.setTopLeftPos(0, 168);
              outlinerPlaceablesPanel.setBottomRightPos(0, 0);
              outlinerPlaceablesPanel.setTopLeftAnchor(0, 0);
              outlinerPlaceablesPanel.setBottomRightAnchor(1, 1);
              outlinerPlaceablesPanel.setBackgroundColor(UIColor.transparent());
          });
          leftPanel.addChildComponent("outlinerPlaceablesPanel", outlinerPlaceablesPanel);
  
          final Label outlinerPlaceablesLabel = new Label();
          outlinerPlaceablesLabel.setOnInitAction(() -> {
              outlinerPlaceablesLabel.setText(LangManager.getItem("outliner"));
              outlinerPlaceablesLabel.setHorizontalAlign(EnumHAlignment.centre);
              outlinerPlaceablesLabel.setVerticalAlign(EnumVAlignment.centre);
              outlinerPlaceablesLabel.setTopLeftPos(4, 0);
              outlinerPlaceablesLabel.setBottomRightPos(-4, 24);
              outlinerPlaceablesLabel.setTopLeftAnchor(0, 0);
              outlinerPlaceablesLabel.setBottomRightAnchor(1, 0);
          });
          outlinerPlaceablesPanel.addChildComponent("outlinerPlaceablesLabel", outlinerPlaceablesLabel);
  
          //Defined at class level
          outlinerPlaceablesListBox.setOnInitAction(() -> {
              outlinerPlaceablesListBox.setBackgroundColor(UIColor.transparent());
              outlinerPlaceablesListBox.setTopLeftPos(0, 24);
              outlinerPlaceablesListBox.setBottomRightPos(0, 0);
              outlinerPlaceablesListBox.setTopLeftAnchor(0, 0);
              outlinerPlaceablesListBox.setBottomRightAnchor(1, 1);
          });
          outlinerPlaceablesPanel.addChildComponent("outlinerPlaceablesListBox", outlinerPlaceablesListBox);
          //</editor-fold>
  
          //<editor-fold desc="Outliner objects panel">
          //Defined at class level
          outlinerObjectsPanel.setOnInitAction(() -> {
              outlinerObjectsPanel.setTopLeftPos(0, 24);
              outlinerObjectsPanel.setBottomRightPos(0, 0);
              outlinerObjectsPanel.setTopLeftAnchor(0, 0);
              outlinerObjectsPanel.setBottomRightAnchor(1, 1);
              outlinerObjectsPanel.setBackgroundColor(UIColor.transparent());
              outlinerObjectsPanel.setVisible(false); //Hidden by default
          });
          leftPanel.addChildComponent("outlinerObjectsPanel", outlinerObjectsPanel);
  
          final Label outlinerObjectsLabel = new Label();
          outlinerObjectsLabel.setOnInitAction(() -> {
              outlinerObjectsLabel.setText(LangManager.getItem("outliner"));
              outlinerObjectsLabel.setHorizontalAlign(EnumHAlignment.centre);
              outlinerObjectsLabel.setVerticalAlign(EnumVAlignment.centre);
              outlinerObjectsLabel.setTopLeftPos(4, 0);
              outlinerObjectsLabel.setBottomRightPos(-4, 24);
              outlinerObjectsLabel.setTopLeftAnchor(0, 0);
              outlinerObjectsLabel.setBottomRightAnchor(1, 0);
          });
          outlinerObjectsPanel.addChildComponent("outlinerObjectsLabel", outlinerObjectsLabel);
  
          //Defined at class level
          outlinerObjectsListBox.setOnInitAction(() -> {
              outlinerObjectsListBox.setBackgroundColor(UIColor.transparent());
              outlinerObjectsListBox.setTopLeftPos(0, 24);
  //            outlinerObjectsListBox.setBottomRightPos(0, -24); //TODO: When external backgrounds are figured out, uncomment this
              outlinerObjectsListBox.setBottomRightPos(0, 0);
              outlinerObjectsListBox.setTopLeftAnchor(0, 0);
              outlinerObjectsListBox.setBottomRightAnchor(1, 1);
          });
          outlinerObjectsPanel.addChildComponent("outlinerObjectsListBox", outlinerObjectsListBox);
          //</editor-fold>
  
  //        final TextField addExternalBackgroundObjectTextField = new TextField();
  //        addExternalBackgroundObjectTextField.setOnInitAction(() -> {
  //            addExternalBackgroundObjectTextField.setTopLeftPos(0, -24);
  //            addExternalBackgroundObjectTextField.setBottomRightPos(0, 0);
  //            addExternalBackgroundObjectTextField.setTopLeftAnchor(0, 1);
  //            addExternalBackgroundObjectTextField.setBottomRightAnchor(1, 1);
  //            addExternalBackgroundObjectTextField.setPlaceholder(LangManager.getItem("addExternalBackgroundObject"));
  //            addExternalBackgroundObjectTextField.setBackgroundColor(UIColor.transparent());
  //        });
  //        addExternalBackgroundObjectTextField.setOnReturnAction(() -> {
  //            if (ProjectManager.getCurrentProject() != null && ProjectManager.getCurrentClientLevelData() != null) {
  //                if (!Objects.equals(addExternalBackgroundObjectTextField.value, "")) {
  //                    if (!ProjectManager.getCurrentLevelData().isObjectBackgroundExternal(addExternalBackgroundObjectTextField.text) &&
  //                            !ProjectManager.getCurrentLevelData().getModel().hasObject(addExternalBackgroundObjectTextField.text)) {
  //                        ProjectManager.getCurrentLevelData().addBackgroundExternalObject(addExternalBackgroundObjectTextField.text);
  //
  //                        outlinerObjectsListBox.addChildComponent(getOutlinerExternalBackgroundObjectComponent(addExternalBackgroundObjectTextField.text));
  //                    } else {
  //                        sendNotif(LangManager.getItem("alreadyObject"), UIColor.matRed());
  //                    }
  //
  //                    addExternalBackgroundObjectTextField.setValue(""); //Clear text field
  //                } else {
  //                    //Text field is blank
  //                    sendNotif(LangManager.getItem("noObjectSpecified"), UIColor.matRed());
  //                }
  //            } else {
  //                sendNotif(LangManager.getItem("noLevelLoaded"), UIColor.matRed());
  //            }
  //        });
  //        outlinerObjectsPanel.addChildComponent("addExternalBackgroundObjectTextField", addExternalBackgroundObjectTextField);
  //        textFields.add(addExternalBackgroundObjectTextField);
  
          final Panel rightPanel = new Panel();
          rightPanel.setOnInitAction(() -> {
              rightPanel.setBackgroundColor(UIColor.matGrey900(0.75));
              rightPanel.setTopLeftPos(-256, 0);
              rightPanel.setBottomRightPos(0, 0 - TIMELINE_HEIGHT);
              rightPanel.setTopLeftAnchor(1, 0);
              rightPanel.setBottomRightAnchor(1, 1);
          });
          mainUI.addChildComponent("rightPanel", rightPanel);
  
          final ListBox actionsListBox = new ListBox();
          actionsListBox.setOnInitAction(() -> {
              actionsListBox.setTopLeftPos(0, 0);
              actionsListBox.setBottomRightPos(0, 130);
              actionsListBox.setTopLeftAnchor(0, 0);
              actionsListBox.setBottomRightAnchor(1, 0);
              actionsListBox.setBackgroundColor(UIColor.transparent());
          });
          rightPanel.addChildComponent("actionsListBox", actionsListBox);
  
          //<editor-fold desc="ImportObj TextButton">
          //Defined at class level
          importObjButton.setOnInitAction(() -> {
              importObjButton.setText(LangManager.getItem("importObj"));
              importObjButton.setTopLeftPos(0, 0);
              importObjButton.setBottomRightPos(0, 24);
          });
          importObjButton.setOnLMBAction(this::importObj);
          actionsListBox.addChildComponent("importObjButton", importObjButton);
          //</editor-fold>
  
          //<editor-fold desc="ImportConfig TextButton">
          //Defined at class level
          importConfigButton.setOnInitAction(() -> {
              importConfigButton.setText(LangManager.getItem("importConfig"));
              importConfigButton.setTopLeftPos(0, 0);
              importConfigButton.setBottomRightPos(0, 24);
          });
          importConfigButton.setOnLMBAction(this::importConfig);
          actionsListBox.addChildComponent("importConfigButton", importConfigButton);
          //</editor-fold>
  
          //<editor-fold desc="Export TextButton">
          //Defined at class level
          exportButton.setOnInitAction(() -> {
              exportButton.setText(LangManager.getItem("export"));
              exportButton.setTopLeftPos(0, 0);
              exportButton.setBottomRightPos(0, 24);
          });
          exportButton.setOnLMBAction(this::export);
          actionsListBox.addChildComponent("exportButton", exportButton);
          //</editor-fold>
  
          //<editor-fold desc="Settings TextButton">
          //Defined at class level
          settingsButton.setOnInitAction(() -> {
              settingsButton.setText(LangManager.getItem("settings"));
              settingsButton.setTopLeftPos(0, 0);
              settingsButton.setBottomRightPos(0, 24);
          });
          settingsButton.setOnLMBAction(this::showSettings);
          actionsListBox.addChildComponent("settingsButton", settingsButton);
          //</editor-fold>
  
          //<editor-fold desc="Project Settings TextButton">
          //Defined at class level
          projectSettingsButton.setOnInitAction(() -> {
              projectSettingsButton.setText(LangManager.getItem("projectSettings"));
              projectSettingsButton.setTopLeftPos(0, 0);
              projectSettingsButton.setBottomRightPos(0, 24);
          });
          projectSettingsButton.setOnLMBAction(this::showProjectSettings);
          actionsListBox.addChildComponent("projectSettingsButton", projectSettingsButton);
          //</editor-fold>
  
          //<editor-fold desc="Placeable Properties">
          //Defined at class level
          propertiesPlaceablesListBox.setOnInitAction(() -> {
              propertiesPlaceablesListBox.setTopLeftPos(0, 130);
              propertiesPlaceablesListBox.setBottomRightPos(0, 0);
              propertiesPlaceablesListBox.setTopLeftAnchor(0, 0);
              propertiesPlaceablesListBox.setBottomRightAnchor(1, 1);
              propertiesPlaceablesListBox.setBackgroundColor(UIColor.transparent());
          });
          rightPanel.addChildComponent("propertiesPlaceablesListBox", propertiesPlaceablesListBox);
  
          final Label placeablesPropertiesLabel = new Label();
          placeablesPropertiesLabel.setOnInitAction(() -> {
              placeablesPropertiesLabel.setText(LangManager.getItem("properties"));
              placeablesPropertiesLabel.setHorizontalAlign(EnumHAlignment.centre);
              placeablesPropertiesLabel.setVerticalAlign(EnumVAlignment.centre);
              placeablesPropertiesLabel.setTopLeftPos(0, 0);
              placeablesPropertiesLabel.setBottomRightPos(0, 28);
              placeablesPropertiesLabel.setTopLeftAnchor(0, 0);
              placeablesPropertiesLabel.setBottomRightAnchor(1, 0);
          });
          propertiesPlaceablesListBox.addChildComponent("placeablesPropertiesLabel", placeablesPropertiesLabel);
  
          final Label placeablePositionLabel = new Label();
          placeablePositionLabel.setOnInitAction(() -> {
              placeablePositionLabel.setText(LangManager.getItem("position"));
              placeablePositionLabel.setVerticalAlign(EnumVAlignment.centre);
              placeablePositionLabel.setTopLeftPos(0, 0);
              placeablePositionLabel.setBottomRightPos(0, 24);
          });
          propertiesPlaceablesListBox.addChildComponent("placeablePositionLabel", placeablePositionLabel);
  
          //Defined at class level
          placeablePositionTextFields.setOnInitAction(() -> {
              placeablePositionTextFields.setTopLeftPos(0, 0);
              placeablePositionTextFields.setBottomRightPos(0, 76);
          });
          propertiesPlaceablesListBox.addChildComponent("placeablePositionTextFields", placeablePositionTextFields);
  
          final Label rotationLabel = new Label();
          rotationLabel.setOnInitAction(() -> {
              rotationLabel.setText(LangManager.getItem("rotation"));
              rotationLabel.setVerticalAlign(EnumVAlignment.centre);
              rotationLabel.setTopLeftPos(0, 0);
              rotationLabel.setBottomRightPos(0, 24);
          });
          propertiesPlaceablesListBox.addChildComponent("rotationLabel", rotationLabel);
  
          //Defined at class level
          placeableRotationTextFields.setOnInitAction(() -> {
              placeableRotationTextFields.setTopLeftPos(0, 0);
              placeableRotationTextFields.setBottomRightPos(0, 76);
          });
          propertiesPlaceablesListBox.addChildComponent("placeableRotationTextFields", placeableRotationTextFields);
  
          final Label scaleLabel = new Label();
          scaleLabel.setOnInitAction(() -> {
              scaleLabel.setText(LangManager.getItem("scale"));
              scaleLabel.setVerticalAlign(EnumVAlignment.centre);
              scaleLabel.setTopLeftPos(0, 0);
              scaleLabel.setBottomRightPos(0, 24);
          });
          propertiesPlaceablesListBox.addChildComponent("scaleLabel", scaleLabel);
  
          //Defined at class level
          placeableScaleTextFields.setOnInitAction(() -> {
              placeableScaleTextFields.setTopLeftPos(0, 0);
              placeableScaleTextFields.setBottomRightPos(0, 76);
          });
          propertiesPlaceablesListBox.addChildComponent("placeableScaleTextFields", placeableScaleTextFields);
  
          final Label typeLabel = new Label();
          typeLabel.setOnInitAction(() -> {
              typeLabel.setText(LangManager.getItem("type"));
              typeLabel.setVerticalAlign(EnumVAlignment.centre);
              typeLabel.setTopLeftPos(0, 0);
              typeLabel.setBottomRightPos(0, 24);
          });
          propertiesPlaceablesListBox.addChildComponent("typeLabel", typeLabel);
  
          //Defined at class level
          typeButton.setOnInitAction(() -> {
              typeButton.setText(LangManager.getItem("noTypes"));
              typeButton.setEnabled(false);
              typeButton.setTopLeftPos(0, 0);
              typeButton.setBottomRightPos(0, 24);
          });
          typeButton.setOnLMBAction(() -> {
              assert mousePos != null;
              setOverlayUiScreen(getTypeSelectorOverlayScreen(mousePos.y));
          });
          propertiesPlaceablesListBox.addChildComponent("typeButton", typeButton);
  
          final Label placeableItemGroupLabel = new Label();
          placeableItemGroupLabel.setOnInitAction(() -> {
              placeableItemGroupLabel.setText(LangManager.getItem("itemGroup"));
              placeableItemGroupLabel.setVerticalAlign(EnumVAlignment.centre);
              placeableItemGroupLabel.setTopLeftPos(0, 0);
              placeableItemGroupLabel.setBottomRightPos(0, 24);
          });
          propertiesPlaceablesListBox.addChildComponent("itemGroupLabel", placeableItemGroupLabel);
  
          //Defined at class level
          placeableItemGroupButton.setOnInitAction(() -> {
              placeableItemGroupButton.setText(LangManager.getItem("nothingSelected"));
              placeableItemGroupButton.setEnabled(false);
              placeableItemGroupButton.setTopLeftPos(0, 0);
              placeableItemGroupButton.setBottomRightPos(0, 24);
          });
          placeableItemGroupButton.setOnLMBAction(() -> {
              assert mousePos != null;
              setOverlayUiScreen(getItemGroupSelectorOverlayScreen(mousePos.x, mousePos.y));
          });
          propertiesPlaceablesListBox.addChildComponent("placeableItemGroupButton", placeableItemGroupButton);
          //</editor-fold>
  
          //<editor-fold desc="Object Properties">
          //Defined at class level
          propertiesObjectsListBox.setOnInitAction(() -> {
              propertiesObjectsListBox.setTopLeftPos(0, 130);
              propertiesObjectsListBox.setBottomRightPos(0, 0);
              propertiesObjectsListBox.setTopLeftAnchor(0, 0);
              propertiesObjectsListBox.setBottomRightAnchor(1, 1);
              propertiesObjectsListBox.setBackgroundColor(UIColor.transparent());
              propertiesObjectsListBox.setVisible(false);
          });
          rightPanel.addChildComponent("propertiesObjectsListBox", propertiesObjectsListBox);
  
          final Label objectsPropertiesLabel = new Label();
          objectsPropertiesLabel.setOnInitAction(() -> {
              objectsPropertiesLabel.setText(LangManager.getItem("properties"));
              objectsPropertiesLabel.setHorizontalAlign(EnumHAlignment.centre);
              objectsPropertiesLabel.setVerticalAlign(EnumVAlignment.centre);
              objectsPropertiesLabel.setTopLeftPos(0, 0);
              objectsPropertiesLabel.setBottomRightPos(0, 28);
              objectsPropertiesLabel.setTopLeftAnchor(0, 0);
              objectsPropertiesLabel.setBottomRightAnchor(1, 0);
          });
          propertiesObjectsListBox.addChildComponent("objectsPropertiesLabel", objectsPropertiesLabel);
  
          final Label objectItemGroupLabel = new Label();
          objectItemGroupLabel.setOnInitAction(() -> {
              objectItemGroupLabel.setText(LangManager.getItem("itemGroup"));
              objectItemGroupLabel.setVerticalAlign(EnumVAlignment.centre);
              objectItemGroupLabel.setTopLeftPos(0, 0);
              objectItemGroupLabel.setBottomRightPos(0, 24);
          });
          propertiesObjectsListBox.addChildComponent("objectItemGroupLabel", objectItemGroupLabel);
  
          //Defined at class level
          objectItemGroupButton.setOnInitAction(() -> {
              objectItemGroupButton.setText(LangManager.getItem("nothingSelected"));
              objectItemGroupButton.setEnabled(false);
              objectItemGroupButton.setTopLeftPos(0, 0);
              objectItemGroupButton.setBottomRightPos(0, 24);
          });
          objectItemGroupButton.setOnLMBAction(() -> {
              assert mousePos != null;
              setOverlayUiScreen(getItemGroupSelectorOverlayScreen(mousePos.x, mousePos.y));
          });
          propertiesObjectsListBox.addChildComponent("objectItemGroupButton", objectItemGroupButton);
          //</editor-fold>
  
          //Defined at class level
          notifPanel.setOnInitAction(() -> {
              notifPanel.setTopLeftPos(0, 0);
              notifPanel.setBottomRightPos(0, 0);
              notifPanel.setTopLeftAnchor(0, 0);
              notifPanel.setBottomRightAnchor(1, 1);
              notifPanel.setBackgroundColor(UIColor.transparent());
          });
          mainUI.addChildComponent("notifPanel", notifPanel);
  
          //Defined at class level
          timeline.setOnInitAction(() -> {
              timeline.setTopLeftPos(0, -TIMELINE_HEIGHT);
              timeline.setBottomRightPos(0, 0);
              timeline.setTopLeftAnchor(0, 1);
              timeline.setBottomRightAnchor(1, 1);
              timeline.setBackgroundColor(UIColor.matGrey900(0.75));
          });
          mainUI.addChildComponent("timeline", timeline);
  
          //<editor-fold desc="On screen camera controls">
          //On screen camera controls - For those with difficulty controlling the camera with MMB / WASDQE
          //Declared at class level
          onScreenCameraControlsPanel.setOnInitAction(() -> {
              onScreenCameraControlsPanel.setBackgroundColor(UIColor.matGrey900(0.75));
              onScreenCameraControlsPanel.setTopLeftAnchor(0.5, 1);
              onScreenCameraControlsPanel.setBottomRightAnchor(0.5, 1);
              onScreenCameraControlsPanel.setTopLeftPos(-36, -72 -TIMELINE_HEIGHT - 52);
              onScreenCameraControlsPanel.setBottomRightPos(36, -TIMELINE_HEIGHT - 52);
              onScreenCameraControlsPanel.setVisible(false);
          });
          mainUI.addChildComponent("onScreenCameraControlsPanel", onScreenCameraControlsPanel);
  
          final Button cameraPanDownButton = new Button();
          cameraPanDownButton.setOnInitAction(() -> {
              cameraPanDownButton.setTopLeftAnchor(0, 0);
              cameraPanDownButton.setBottomRightAnchor(0, 0);
              cameraPanDownButton.setTopLeftPos(0, 0);
              cameraPanDownButton.setBottomRightPos(24, 24);
              cameraPanDownButton.setTexture(ResourceManager.getTexture("image/arrowRightDown").getTexture());
          });
          cameraPanDownButton.addPlugin(new AbstractComponentPlugin() {
              @Override
              public void onPostDraw() {
                  if (linkedComponent.mouseOver && Mouse.isButtonDown(0)) {
                      double speed = Window.isShiftDown() ? SMBLWSettings.cameraSprintSpeedMultiplier * SMBLWSettings.cameraSpeed : SMBLWSettings.cameraSpeed;
                      cameraPos = cameraPos.add(0, -UIUtils.getDelta() * speed, 0);
                  }
              }
          });
          onScreenCameraControlsPanel.addChildComponent("cameraPanDownButton", cameraPanDownButton);
  
          final Button cameraPanLeftButton = new Button();
          cameraPanLeftButton.setOnInitAction(() -> {
              cameraPanLeftButton.setTopLeftAnchor(0, 0);
              cameraPanLeftButton.setBottomRightAnchor(0, 0);
              cameraPanLeftButton.setTopLeftPos(0, 24);
              cameraPanLeftButton.setBottomRightPos(24, 48);
              cameraPanLeftButton.setTexture(ResourceManager.getTexture("image/arrowLeft").getTexture());
          });
          cameraPanLeftButton.addPlugin(new AbstractComponentPlugin() {
              @Override
              public void onPostDraw() {
                  if (linkedComponent.mouseOver && Mouse.isButtonDown(0)) {
                      double speed = Window.isShiftDown() ? SMBLWSettings.cameraSprintSpeedMultiplier * SMBLWSettings.cameraSpeed : SMBLWSettings.cameraSpeed;
                      PosXYZ rightVector = new PosXYZ(Math.sin(Math.toRadians(cameraRot.x + 90)), 0, -Math.cos(Math.toRadians(cameraRot.x + 90)));
                      cameraPos = cameraPos.subtract(rightVector.multiply(UIUtils.getDelta()).multiply(speed));
                  }
              }
          });
          onScreenCameraControlsPanel.addChildComponent("cameraPanLeftButton", cameraPanLeftButton);
  
          final Button cameraPanForwardButton = new Button();
          cameraPanForwardButton.setOnInitAction(() -> {
              cameraPanForwardButton.setTopLeftAnchor(0, 0);
              cameraPanForwardButton.setBottomRightAnchor(0, 0);
              cameraPanForwardButton.setTopLeftPos(24, 0);
              cameraPanForwardButton.setBottomRightPos(48, 24);
              cameraPanForwardButton.setTexture(ResourceManager.getTexture("image/arrowUp").getTexture());
          });
          cameraPanForwardButton.addPlugin(new AbstractComponentPlugin() {
              @Override
              public void onPostDraw() {
                  if (linkedComponent.mouseOver && Mouse.isButtonDown(0)) {
                      double speed = Window.isShiftDown() ? SMBLWSettings.cameraSprintSpeedMultiplier * SMBLWSettings.cameraSpeed : SMBLWSettings.cameraSpeed;
                      PosXYZ forwardVector = new PosXYZ(Math.sin(Math.toRadians(cameraRot.x)), 0, -Math.cos(Math.toRadians(cameraRot.x)));
                      cameraPos = cameraPos.add(forwardVector.multiply(UIUtils.getDelta()).multiply(speed));
                  }
              }
          });
          onScreenCameraControlsPanel.addChildComponent("cameraPanForwardButton", cameraPanForwardButton);
  
          final Image cameraPanIcon = new Image();
          cameraPanIcon.setOnInitAction(() -> {
              cameraPanIcon.setTexture(ResourceManager.getTexture("image/arrowAll").getTexture());
              cameraPanIcon.setTopLeftAnchor(0, 0);
              cameraPanIcon.setBottomRightAnchor(0, 0);
              cameraPanIcon.setTopLeftPos(24, 24);
              cameraPanIcon.setBottomRightPos(48, 48);
          });
          onScreenCameraControlsPanel.addChildComponent("cameraPanIcon", cameraPanIcon);
  
          final Button cameraPanBackwardsButton = new Button();
          cameraPanBackwardsButton.setOnInitAction(() -> {
              cameraPanBackwardsButton.setTopLeftAnchor(0, 0);
              cameraPanBackwardsButton.setBottomRightAnchor(0, 0);
              cameraPanBackwardsButton.setTopLeftPos(24, 48);
              cameraPanBackwardsButton.setBottomRightPos(48, 72);
              cameraPanBackwardsButton.setTexture(ResourceManager.getTexture("image/arrowDown").getTexture());
          });
          cameraPanBackwardsButton.addPlugin(new AbstractComponentPlugin() {
              @Override
              public void onPostDraw() {
                  if (linkedComponent.mouseOver && Mouse.isButtonDown(0)) {
                      double speed = Window.isShiftDown() ? SMBLWSettings.cameraSprintSpeedMultiplier * SMBLWSettings.cameraSpeed : SMBLWSettings.cameraSpeed;
                      PosXYZ forwardVector = new PosXYZ(Math.sin(Math.toRadians(cameraRot.x)), 0, -Math.cos(Math.toRadians(cameraRot.x)));
                      cameraPos = cameraPos.subtract(forwardVector.multiply(UIUtils.getDelta()).multiply(speed));
                  }
              }
          });
          onScreenCameraControlsPanel.addChildComponent("cameraPanBackwardsButton", cameraPanBackwardsButton);
  
          final Button cameraPanUpButton = new Button();
          cameraPanUpButton.setOnInitAction(() -> {
              cameraPanUpButton.setTopLeftAnchor(0, 0);
              cameraPanUpButton.setBottomRightAnchor(0, 0);
              cameraPanUpButton.setTopLeftPos(48, 0);
              cameraPanUpButton.setBottomRightPos(72, 24);
              cameraPanUpButton.setTexture(ResourceManager.getTexture("image/arrowLeftUp").getTexture());
          });
          cameraPanUpButton.addPlugin(new AbstractComponentPlugin() {
              @Override
              public void onPostDraw() {
                  if (linkedComponent.mouseOver && Mouse.isButtonDown(0)) {
                      double speed = Window.isShiftDown() ? SMBLWSettings.cameraSprintSpeedMultiplier * SMBLWSettings.cameraSpeed : SMBLWSettings.cameraSpeed;
                      cameraPos = cameraPos.add(0, UIUtils.getDelta() * speed, 0);
                  }
              }
          });
          onScreenCameraControlsPanel.addChildComponent("cameraPanUpButton", cameraPanUpButton);
  
          final Button cameraPanRightButton = new Button();
          cameraPanRightButton.setOnInitAction(() -> {
              cameraPanRightButton.setTopLeftAnchor(0, 0);
              cameraPanRightButton.setBottomRightAnchor(0, 0);
              cameraPanRightButton.setTopLeftPos(48, 24);
              cameraPanRightButton.setBottomRightPos(72, 48);
              cameraPanRightButton.setTexture(ResourceManager.getTexture("image/arrowRight").getTexture());
          });
          cameraPanRightButton.addPlugin(new AbstractComponentPlugin() {
              @Override
              public void onPostDraw() {
                  if (linkedComponent.mouseOver && Mouse.isButtonDown(0)) {
                      double speed = Window.isShiftDown() ? SMBLWSettings.cameraSprintSpeedMultiplier * SMBLWSettings.cameraSpeed : SMBLWSettings.cameraSpeed;
                      PosXYZ rightVector = new PosXYZ(Math.sin(Math.toRadians(cameraRot.x + 90)), 0, -Math.cos(Math.toRadians(cameraRot.x + 90)));
                      cameraPos = cameraPos.add(rightVector.multiply(UIUtils.getDelta()).multiply(speed));
                  }
              }
          });
          onScreenCameraControlsPanel.addChildComponent("cameraPanRightButton", cameraPanRightButton);
          //</editor-fold>
  
          //Defined at class level
          inputOverlay.setOnInitAction(() -> {
              inputOverlay.setTopLeftPos(256, 0);
              inputOverlay.setBottomRightPos(-256, -TIMELINE_HEIGHT);
              inputOverlay.setTopLeftAnchor(0, 0);
              inputOverlay.setBottomRightAnchor(1, 1);
              inputOverlay.setBackgroundColor(UIColor.transparent());
          });
          mainUI.addChildComponent("inputOverlay", inputOverlay);
  
          //Defined at class level
          fpsOverlay.setOnInitAction(() -> {
              fpsOverlay.setTopLeftPos(260, 4);
              fpsOverlay.setBottomRightPos(516, 28);
              fpsOverlay.setTopLeftAnchor(0, 0);
              fpsOverlay.setBottomRightAnchor(0, 0);
              fpsOverlay.setBackgroundColor(UIColor.matGrey900(0.75));
              fpsOverlay.setVisible(false);
          });
          mainUI.addChildComponent("fpsOverlay", fpsOverlay);
  
          Window.logOpenGLError("After MainScreen.init()");
  
          try {
              Window.drawable.releaseContext();
          } catch (LWJGLException e) {
              e.printStackTrace();
          }
  
      }
  
      @Override
      public void preDraw() {
          super.preDraw();
  
          Window.logOpenGLError("After MainScreen.super.preDraw()");
  
          //Run next frame actions
          nextFrameActions.forEach(UIAction::execute);
          nextFrameActions.clear();
  
          //Show on screen camera controls if setting enabled
          onScreenCameraControlsPanel.setVisible(SMBLWSettings.showOnScreenCameraControls);
          //Show on screen input if setting enabled
          inputOverlay.setVisible(SMBLWSettings.showOnScreenInput);
          //Show FPS if setting enabled
          fpsOverlay.setVisible(SMBLWSettings.showFPSOverlay);
  
  