public void update() { // sorry for all the megafunctions here super.update(); scale = desiredscale * SCALELERPAMOUNT + scale * (1 - SCALELERPAMOUNT); // drawOffset = viewOffset.add(scale); update_middleclickmapmovement(); update_rightclickselection(); if (this.checkMouseOver()) { if (Center.leftMouseDown()) { if (Center.leftMouseClicked()) { currentPoint = new EventLocation( Center.mousePosition(), Gui.SpawnLocationCreator_getDesiredSpawnType()); SpawnList.clearSelections(); } if (currentPoint != null) { currentPoint.position = screenToMap(Center.mousePosition()); if (!checkValidSpawnLocation()) { showMessage("Invalid location."); currentPoint.position = new Vector2(9999, 0); } else { switch (snapType) { case None: break; case Grid: currentPoint.useSnap_Cartesian(.2f); break; case Ring: currentPoint.useSnap_Polar(_G.PI / 12, .2f); break; } String mess = "Placing point."; for (int i = 0; i < (_G.cycle % 150) / 50; i++) mess += '.'; showMessage(mess); } } } else if (currentPoint != null) { if (!checkValidSpawnLocation()) { // Out of bounds showMessage("Invalid location."); currentPoint = null; } else { /*if(currentPoint.type == EventType.PlotHole){ if(currentPoint.position.x > FIELDUNITSIZE.x*2 || currentPoint.position.x < -FIELDUNITSIZE.x*2 || currentPoint.position.y > FIELDUNITSIZE.y*2 || currentPoint.position.y < -FIELDUNITSIZE.y*2){ showMessage("WARNING: Plot Hole will be moved."); }else{ showMessage("Plot Hole placed!"); } }else{*/ if (currentPoint.position.magnitude() < 2) { showMessage("WARNING: Location is too close!"); } else { showMessage("Point placed!"); } // } addSpawnLocation(currentPoint); SpawnList.selectSpawn(currentPoint); currentPoint = null; } } } else if (currentPoint != null) { if (Center.leftMouseDown()) { showMessage("Invalid location."); currentPoint.position = new Vector2(9999, 0); } else { currentPoint = null; showMessage("Point placement cancelled."); } } else if (SpawnList.selectedSpawns.size() != 0) { int siz = SpawnList.selectedSpawns.size(); // showMessage(""+siz+(siz == 1 ? " point selected." : " points selected.")); } }