mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-07-13 09:17:52 +07:00
Combined stand still and right click casting into one block
Combined stand still and right click casting into one block Moved vars into final fields to improve readability Implemented getHovered(int) to get targetId (if any)
This commit is contained in:
@ -80,14 +80,14 @@ public class CursorMovementSystem extends BaseSystem {
|
|||||||
boolean hit = hit1 != null || hit2 != null;
|
boolean hit = hit1 != null || hit2 != null;
|
||||||
if (hit) return;
|
if (hit) return;
|
||||||
|
|
||||||
if (Gdx.input.isButtonPressed(Input.Buttons.LEFT) && UIUtils.shift()) {
|
final boolean leftPressed = Gdx.input.isButtonPressed(Input.Buttons.LEFT);
|
||||||
|
if ((leftPressed && UIUtils.shift()) || Gdx.input.isButtonPressed(Input.Buttons.RIGHT)) {
|
||||||
setTarget(renderer.getSrc(), Engine.INVALID_ENTITY);
|
setTarget(renderer.getSrc(), Engine.INVALID_ENTITY);
|
||||||
|
final int playerId = renderer.getSrc();
|
||||||
|
final int skillId = Riiablo.charData.getAction(leftPressed ? Input.Buttons.LEFT : Input.Buttons.RIGHT);
|
||||||
iso.agg(tmpVec2.set(Gdx.input.getX(), Gdx.input.getY())).unproject().toWorld();
|
iso.agg(tmpVec2.set(Gdx.input.getX(), Gdx.input.getY())).unproject().toWorld();
|
||||||
actioneer.cast(renderer.getSrc(), Riiablo.charData.getAction(Input.Buttons.LEFT), Engine.INVALID_ENTITY, tmpVec2);
|
final int targetId = getHovered(playerId);
|
||||||
} else if (Gdx.input.isButtonPressed(Input.Buttons.RIGHT)) {
|
actioneer.cast(playerId, skillId, targetId, tmpVec2);
|
||||||
setTarget(renderer.getSrc(), Engine.INVALID_ENTITY);
|
|
||||||
iso.agg(tmpVec2.set(Gdx.input.getX(), Gdx.input.getY())).unproject().toWorld();
|
|
||||||
actioneer.cast(renderer.getSrc(), Riiablo.charData.getAction(Input.Buttons.RIGHT), Engine.INVALID_ENTITY, tmpVec2);
|
|
||||||
} else {
|
} else {
|
||||||
updateLeft();
|
updateLeft();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user