Added target cursor
This commit is contained in:
@@ -73,7 +73,7 @@ public class UI implements ApplicationListener, Loadable{
|
||||
public ColorPicker picker;
|
||||
public LogicDialog logic;
|
||||
|
||||
public Cursor drillCursor, unloadCursor;
|
||||
public Cursor drillCursor, unloadCursor, targetCursor;
|
||||
|
||||
private @Nullable Element lastAnnouncement;
|
||||
|
||||
@@ -128,6 +128,7 @@ public class UI implements ApplicationListener, Loadable{
|
||||
|
||||
drillCursor = Core.graphics.newCursor("drill", Fonts.cursorScale());
|
||||
unloadCursor = Core.graphics.newCursor("unload", Fonts.cursorScale());
|
||||
targetCursor = Core.graphics.newCursor("target", Fonts.cursorScale());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -399,6 +399,10 @@ public class DesktopInput extends InputHandler{
|
||||
cursorType = ui.drillCursor;
|
||||
}
|
||||
|
||||
if(commandMode && selectedUnits.any() && ((cursor.build != null && cursor.build.team != player.team()) || (selectedEnemyUnit(input.mouseWorldX(), input.mouseWorldY()) != null))){
|
||||
cursorType = ui.targetCursor;
|
||||
}
|
||||
|
||||
if(getRequest(cursor.x, cursor.y) != null && mode == none){
|
||||
cursorType = SystemCursor.hand;
|
||||
}
|
||||
@@ -407,6 +411,7 @@ public class DesktopInput extends InputHandler{
|
||||
cursorType = ui.unloadCursor;
|
||||
}
|
||||
|
||||
|
||||
if(cursor.build != null && cursor.interactable(player.team()) && !isPlacing() && Math.abs(Core.input.axisTap(Binding.rotate)) > 0 && Core.input.keyDown(Binding.rotateplaced) && cursor.block().rotate && cursor.block().quickRotate){
|
||||
Call.rotateBlock(player, cursor.build, Core.input.axisTap(Binding.rotate) > 0);
|
||||
}
|
||||
|
||||
@@ -190,7 +190,6 @@ public class Placement{
|
||||
(plan.tile() != null && plan.tile().block() == plan.block)); //don't count the same block as inaccessible
|
||||
|
||||
var result = plans1.clear();
|
||||
var team = player.team();
|
||||
|
||||
outer:
|
||||
for(int i = 0; i < plans.size;){
|
||||
|
||||
Reference in New Issue
Block a user