Minor UI changes for pause button

This commit is contained in:
Anuken 2018-01-04 15:18:38 -05:00
parent 226ad16242
commit 4d44fc3855
5 changed files with 202 additions and 184 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 80 KiB

View File

@ -10,7 +10,7 @@ import io.anuke.ucore.entities.Entity;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
//TODO clean up this giant mess
//TODO clean up this mess
public interface Syncable {
public Interpolator<?> getInterpolator();
@ -20,6 +20,7 @@ public interface Syncable {
public abstract void read(T entity, float[] data);
public abstract void update(T entity, Interpolator interpolator);
//TODO write dashing state so particles appear
public static final SyncType<Player> player = new SyncType<Player>() {
@Override
public float[] write(Player entity) {
@ -78,7 +79,7 @@ public interface Syncable {
};
}
public static class Interpolator<T extends Entity> {
class Interpolator<T extends Entity> {
public SyncType<T> type;
public Vector2 target = new Vector2();
public Vector2 last = new Vector2();

View File

@ -65,9 +65,19 @@ public class HudFragment implements Fragment{
}).get();
pause = new imagebutton("icon-pause", isize, ()->{
GameState.set(GameState.is(State.paused) ? State.playing : State.paused);
}).update(i -> i.getStyle().imageUp = Core.skin.getDrawable(GameState.is(State.paused) ? "icon-play" : "icon-pause")).cell
.disabled(b -> Net.active()).get();
if(Net.active() && Vars.android){
//TODO open android chat
}else {
GameState.set(GameState.is(State.paused) ? State.playing : State.paused);
}
}).update(i ->{
if(Net.active() && Vars.android){
i.getStyle().imageUp = Core.skin.getDrawable("icon-chat");
}else {
i.setDisabled(Net.active());
i.getStyle().imageUp = Core.skin.getDrawable(GameState.is(State.paused) ? "icon-play" : "icon-pause");
}
}).get();
}}.end();