Configurable plans, taken from Foo's
This commit is contained in:
@@ -783,6 +783,15 @@ public class DesktopInput extends InputHandler{
|
||||
if(getPlan(splan.x, splan.y, splan.block.size, splan) != null){
|
||||
player.unit().plans().remove(splan, true);
|
||||
}
|
||||
|
||||
if(input.ctrl()){
|
||||
inv.hide();
|
||||
config.hideConfig();
|
||||
planConfig.showConfig(splan);
|
||||
}else{
|
||||
planConfig.hide();
|
||||
}
|
||||
|
||||
splan = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -116,6 +116,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
|
||||
public final BlockInventoryFragment inv;
|
||||
public final BlockConfigFragment config;
|
||||
public final PlanConfigFragment planConfig;
|
||||
|
||||
private WidgetGroup group = new WidgetGroup();
|
||||
|
||||
@@ -136,6 +137,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
group.touchable = Touchable.childrenOnly;
|
||||
inv = new BlockInventoryFragment();
|
||||
config = new BlockConfigFragment();
|
||||
planConfig = new PlanConfigFragment();
|
||||
|
||||
Events.on(UnitDestroyEvent.class, e -> {
|
||||
if(e.unit != null && e.unit.isPlayer() && e.unit.getPlayer().isLocal() && e.unit.type.weapons.contains(w -> w.bullet.killShooter)){
|
||||
@@ -1622,6 +1624,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
|
||||
/** Handles tile tap events that are not platform specific. */
|
||||
boolean tileTapped(@Nullable Building build){
|
||||
planConfig.hide();
|
||||
if(build == null){
|
||||
inv.hide();
|
||||
config.hideConfig();
|
||||
@@ -1897,6 +1900,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
|
||||
inv.build(group);
|
||||
config.build(group);
|
||||
planConfig.build(group);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user