Various mobile bugfixes
This commit is contained in:
@@ -261,7 +261,7 @@ public class Renderer implements ApplicationListener{
|
||||
playerGroup.count(p -> p.isFlying() == flying && p.getTeam() == team) == 0 && flying) continue;
|
||||
|
||||
drawAndInterpolate(unitGroups[team.ordinal()], u -> u.isFlying() == flying && !u.isDead(), Unit::drawUnder);
|
||||
drawAndInterpolate(playerGroup, p -> p.isFlying() == flying && p.getTeam() == team, Unit::drawUnder);
|
||||
drawAndInterpolate(playerGroup, p -> p.isFlying() == flying && p.getTeam() == team && !p.isDead(), Unit::drawUnder);
|
||||
|
||||
Shaders.outline.color.set(team.color);
|
||||
Shaders.mix.color.set(Color.WHITE);
|
||||
|
||||
@@ -3,7 +3,6 @@ package io.anuke.mindustry.input;
|
||||
import io.anuke.arc.Core;
|
||||
import io.anuke.arc.collection.Array;
|
||||
import io.anuke.arc.collection.ObjectSet;
|
||||
import io.anuke.mindustry.entities.Effects;
|
||||
import io.anuke.arc.graphics.Color;
|
||||
import io.anuke.arc.graphics.g2d.Draw;
|
||||
import io.anuke.arc.graphics.g2d.Lines;
|
||||
@@ -21,11 +20,12 @@ import io.anuke.arc.util.Time;
|
||||
import io.anuke.mindustry.content.Blocks;
|
||||
import io.anuke.mindustry.content.Fx;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.entities.Effects;
|
||||
import io.anuke.mindustry.entities.Units;
|
||||
import io.anuke.mindustry.entities.traits.TargetTrait;
|
||||
import io.anuke.mindustry.entities.type.Player;
|
||||
import io.anuke.mindustry.entities.type.TileEntity;
|
||||
import io.anuke.mindustry.entities.type.Unit;
|
||||
import io.anuke.mindustry.entities.Units;
|
||||
import io.anuke.mindustry.entities.traits.TargetTrait;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.graphics.Shaders;
|
||||
import io.anuke.mindustry.input.PlaceUtils.NormalizeDrawResult;
|
||||
@@ -642,7 +642,6 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
|
||||
@Override
|
||||
public boolean pan(float x, float y, float deltaX, float deltaY){
|
||||
if(!canPan) return false;
|
||||
float scale = Core.camera.width / Core.graphics.getWidth();
|
||||
deltaX *= scale;
|
||||
deltaY *= scale;
|
||||
@@ -671,7 +670,7 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
public boolean zoom(float initialDistance, float distance){
|
||||
if(lastDistance == -1) lastDistance = initialDistance;
|
||||
|
||||
float amount = (distance > lastDistance ? 0.07f : -0.07f) * Time.delta();
|
||||
float amount = (Mathf.sign(distance > lastDistance) * 0.07f) * Time.delta();
|
||||
renderer.scaleCamera(io.anuke.arc.scene.ui.layout.Unit.dp.scl(amount));
|
||||
lastDistance = distance;
|
||||
return true;
|
||||
@@ -679,7 +678,6 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
|
||||
@Override
|
||||
public boolean touchDown(float x, float y, int pointer, KeyCode button){
|
||||
canPan = !Core.scene.hasMouse();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public class PausedDialog extends FloatingDialog{
|
||||
cont.addButton("$back", this::hide).colspan(2).width(dw*2 + 20f);
|
||||
|
||||
cont.row();
|
||||
cont.addButton("techtree", ui.tech::show);
|
||||
cont.addButton("$techtree", ui.tech::show);
|
||||
cont.addButton("$settings", ui.settings::show);
|
||||
|
||||
if(!world.isZone()){
|
||||
|
||||
@@ -147,7 +147,7 @@ public class TechTreeDialog extends FloatingDialog{
|
||||
}
|
||||
});
|
||||
button.exited(() -> {
|
||||
if(hoverNode == button && !infoTable.hasMouse() && !hoverNode.hasMouse()){
|
||||
if(!mobile && hoverNode == button && !infoTable.hasMouse() && !hoverNode.hasMouse()){
|
||||
hoverNode = null;
|
||||
rebuild();
|
||||
}
|
||||
|
||||
@@ -54,7 +54,6 @@ public class HudFragment extends Fragment{
|
||||
|
||||
//menu at top left
|
||||
parent.fill(cont -> {
|
||||
|
||||
cont.top().left().visible(() -> !state.is(State.menu));
|
||||
|
||||
if(mobile){
|
||||
@@ -147,12 +146,6 @@ public class HudFragment extends Fragment{
|
||||
//minimap
|
||||
//parent.fill(t -> t.top().right().add(new Minimap()).visible(() -> !state.is(State.menu) && Core.settings.getBool("minimap")));
|
||||
|
||||
//paused table
|
||||
parent.fill(t -> {
|
||||
t.top().visible(() -> state.is(State.paused) && !Net.active());
|
||||
t.table("button", top -> top.add("$paused").pad(6f));
|
||||
});
|
||||
|
||||
//spawner warning
|
||||
parent.fill(t -> {
|
||||
t.touchable(Touchable.disabled);
|
||||
@@ -222,8 +215,9 @@ public class HudFragment extends Fragment{
|
||||
.update(label -> label.getColor().set(Color.ORANGE).lerp(Color.SCARLET, Mathf.absin(Time.time(), 2f, 1f))));
|
||||
});
|
||||
|
||||
//launch button
|
||||
parent.fill(t -> {
|
||||
t.top().right().visible(() -> !state.is(State.menu));
|
||||
t.top().visible(() -> !state.is(State.menu));
|
||||
|
||||
TextButton button = Elements.newButton("$launch", Call::launchZone);
|
||||
|
||||
@@ -252,9 +246,12 @@ public class HudFragment extends Fragment{
|
||||
button.getLabelCell().left().get().setAlignment(Align.left, Align.left);
|
||||
|
||||
t.add(button).size(350f, 80f);
|
||||
});
|
||||
|
||||
//.addRowImageTextButton("$launch", "icon-arrow-up", 8*3, Call::launchZone)
|
||||
//.size(94f, 70f).visible(() -> world.isZone() && world.getZone().metCondition() && !Net.client());
|
||||
//paused table
|
||||
parent.fill(t -> {
|
||||
t.top().visible(() -> state.is(State.paused) && !Net.active());
|
||||
t.table("button", top -> top.add("$paused").pad(6f));
|
||||
});
|
||||
|
||||
//'saving' indicator
|
||||
|
||||
Reference in New Issue
Block a user