mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-01-20 09:17:29 +07:00
Added placeholder code to allow casting using mobile controls
This commit is contained in:
parent
579476df2f
commit
5868465bb6
@ -62,8 +62,10 @@ public class Actioneer extends PassiveSystem {
|
||||
log.trace("mode changed to {} because it was invalid", mode);
|
||||
}
|
||||
|
||||
if (!targetVec.isZero()) {
|
||||
Vector2 entityPos = mPosition.get(entityId).position;
|
||||
mAngle.get(entityId).target.set(targetVec).sub(entityPos).nor();
|
||||
}
|
||||
|
||||
mSequence.create(entityId).sequence(mode, mMovementModes.get(entityId).NU);
|
||||
mCasting.create(entityId).set(skillId, targetVec);
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.riiablo.screen.panel;
|
||||
|
||||
import net.mostlyoriginal.api.event.common.EventSystem;
|
||||
|
||||
import com.badlogic.gdx.assets.AssetDescriptor;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||
@ -11,14 +13,14 @@ import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
|
||||
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.badlogic.gdx.utils.Disposable;
|
||||
|
||||
import com.riiablo.Riiablo;
|
||||
import com.riiablo.codec.DC6;
|
||||
import com.riiablo.engine.client.event.InteractEvent;
|
||||
import com.riiablo.engine.server.Actioneer;
|
||||
import com.riiablo.widget.Button;
|
||||
import com.riiablo.widget.HotkeyButton;
|
||||
|
||||
import net.mostlyoriginal.api.event.common.EventSystem;
|
||||
|
||||
public class MobileControls extends WidgetGroup implements Disposable {
|
||||
final AssetDescriptor<DC6> SkilliconDescriptor = new AssetDescriptor<>("data\\global\\ui\\SPELLS\\Skillicon.DC6", DC6.class);
|
||||
DC6 Skillicon;
|
||||
@ -27,6 +29,7 @@ public class MobileControls extends WidgetGroup implements Disposable {
|
||||
DC6 SoSkillicon;
|
||||
|
||||
protected EventSystem events;
|
||||
protected Actioneer actioneer;
|
||||
|
||||
Button interact;
|
||||
HotkeyButton skills[];
|
||||
@ -87,7 +90,10 @@ public class MobileControls extends WidgetGroup implements Disposable {
|
||||
}
|
||||
|
||||
HotkeyButton actor = (HotkeyButton) event.getListenerActor();
|
||||
// gameScreen.player.cast(actor.getSkill());
|
||||
final int skillId = actor.getSkill();
|
||||
if (skillId == -1) return;
|
||||
actioneer.cast(Riiablo.game.player, skillId, Vector2.Zero);
|
||||
// TODO: above target is placeholder
|
||||
}
|
||||
};
|
||||
gestureListener.getGestureDetector().setLongPressSeconds(0.5f);
|
||||
|
Loading…
Reference in New Issue
Block a user