mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-11 11:17:11 +07:00
Minor UI changes for pause button
This commit is contained in:
parent
226ad16242
commit
4d44fc3855
BIN
core/assets-raw/sprites/ui/icons/icon-chat.png
Normal file
BIN
core/assets-raw/sprites/ui/icons/icon-chat.png
Normal file
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 |
@ -10,7 +10,7 @@ import io.anuke.ucore.entities.Entity;
|
|||||||
import io.anuke.ucore.util.Angles;
|
import io.anuke.ucore.util.Angles;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
//TODO clean up this giant mess
|
//TODO clean up this mess
|
||||||
public interface Syncable {
|
public interface Syncable {
|
||||||
|
|
||||||
public Interpolator<?> getInterpolator();
|
public Interpolator<?> getInterpolator();
|
||||||
@ -20,6 +20,7 @@ public interface Syncable {
|
|||||||
public abstract void read(T entity, float[] data);
|
public abstract void read(T entity, float[] data);
|
||||||
public abstract void update(T entity, Interpolator interpolator);
|
public abstract void update(T entity, Interpolator interpolator);
|
||||||
|
|
||||||
|
//TODO write dashing state so particles appear
|
||||||
public static final SyncType<Player> player = new SyncType<Player>() {
|
public static final SyncType<Player> player = new SyncType<Player>() {
|
||||||
@Override
|
@Override
|
||||||
public float[] write(Player entity) {
|
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 SyncType<T> type;
|
||||||
public Vector2 target = new Vector2();
|
public Vector2 target = new Vector2();
|
||||||
public Vector2 last = new Vector2();
|
public Vector2 last = new Vector2();
|
||||||
|
@ -65,9 +65,19 @@ public class HudFragment implements Fragment{
|
|||||||
}).get();
|
}).get();
|
||||||
|
|
||||||
pause = new imagebutton("icon-pause", isize, ()->{
|
pause = new imagebutton("icon-pause", isize, ()->{
|
||||||
GameState.set(GameState.is(State.paused) ? State.playing : State.paused);
|
if(Net.active() && Vars.android){
|
||||||
}).update(i -> i.getStyle().imageUp = Core.skin.getDrawable(GameState.is(State.paused) ? "icon-play" : "icon-pause")).cell
|
//TODO open android chat
|
||||||
.disabled(b -> Net.active()).get();
|
}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();
|
}}.end();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user