Campaign mechanics
This commit is contained in:
@@ -34,6 +34,12 @@ public class PausedDialog extends BaseDialog{
|
||||
});
|
||||
|
||||
if(!mobile){
|
||||
//TODO localize
|
||||
cont.label(() -> state.getSector() == null ? "" :
|
||||
"[lightgray]Next turn in [accent]" + state.getSector().displayTimeRemaining())
|
||||
.visible(() -> state.getSector() != null).colspan(2);
|
||||
cont.row();
|
||||
|
||||
float dw = 220f;
|
||||
cont.defaults().width(dw).height(55).pad(5f);
|
||||
|
||||
@@ -45,7 +51,10 @@ public class PausedDialog extends BaseDialog{
|
||||
//}else{
|
||||
// cont.button("$database", Icon.book, ui.database::show);
|
||||
//}
|
||||
cont.button("placeholder", Icon.warning, () -> ui.showInfo("go away"));
|
||||
//TODO remove
|
||||
cont.button("launch core", Icon.warning, () -> ui.planet.show(state.getSector(), player.team().core()))
|
||||
.disabled(b -> player.team().core() == null || !player.team().core().items.has(player.team().core().block.requirements))
|
||||
.visible(() -> state.isCampaign());
|
||||
cont.button("$settings", Icon.settings, ui.settings::show);
|
||||
|
||||
if(!state.rules.tutorial){
|
||||
|
||||
@@ -7,6 +7,7 @@ import arc.graphics.gl.*;
|
||||
import arc.input.*;
|
||||
import arc.math.*;
|
||||
import arc.math.geom.*;
|
||||
import arc.scene.*;
|
||||
import arc.scene.event.*;
|
||||
import arc.scene.ui.*;
|
||||
import arc.scene.ui.layout.*;
|
||||
@@ -197,19 +198,36 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
cont.clear();
|
||||
titleTable.remove();
|
||||
|
||||
//add listener to the background rect, so it doesn't get unnecessary touch input
|
||||
cont.rect((x, y, w, h) -> planets.render(this)).grow().get().addListener(new ElementGestureListener(){
|
||||
@Override
|
||||
public void tap(InputEvent event, float x, float y, int count, KeyCode button){
|
||||
if(hovered != null && (mode == launch ? canLaunch(hovered) && hovered != launchSector : hovered.unlocked())){
|
||||
selected = hovered;
|
||||
}
|
||||
|
||||
if(selected != null){
|
||||
updateSelected();
|
||||
}
|
||||
cont.stack(
|
||||
new Element(){
|
||||
{
|
||||
//add listener to the background rect, so it doesn't get unnecessary touch input
|
||||
addListener(new ElementGestureListener(){
|
||||
@Override
|
||||
public void tap(InputEvent event, float x, float y, int count, KeyCode button){
|
||||
if(hovered != null && (mode == launch ? canLaunch(hovered) && hovered != launchSector : hovered.unlocked())){
|
||||
selected = hovered;
|
||||
}
|
||||
|
||||
if(selected != null){
|
||||
updateSelected();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
planets.render(PlanetDialog.this);
|
||||
}
|
||||
},
|
||||
new Table(t -> {
|
||||
//TODO localize
|
||||
t.top();
|
||||
t.label(() -> "Turn " + universe.turn()).style(Styles.outlineLabel).color(Pal.accent);
|
||||
})).grow();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user