Re-implement E/R controls, add toggle UI button for debugging
This commit is contained in:
@@ -2,6 +2,7 @@ package io.anuke.mindustry;
|
||||
|
||||
import com.badlogic.gdx.Application.ApplicationType;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.utils.I18NBundle;
|
||||
|
||||
import io.anuke.mindustry.core.Control;
|
||||
import io.anuke.mindustry.core.Renderer;
|
||||
@@ -50,8 +51,10 @@ public class Vars{
|
||||
public static boolean showPaths = false;
|
||||
//if false, player is always hidden
|
||||
public static boolean showPlayer = true;
|
||||
//whether to hide ui, only on debug
|
||||
public static boolean showUI = true;
|
||||
//number of save slots-- increasing may lead to layout issues
|
||||
//TODO named save slots, possibly with a scroll dialog
|
||||
//TODO named save slots
|
||||
public static final int saveSlots = 8;
|
||||
//amount of drops that are left when breaking a block
|
||||
public static final float breakDropAmount = 0.5f;
|
||||
@@ -64,6 +67,8 @@ public class Vars{
|
||||
|
||||
public static final int tilesize = 8;
|
||||
|
||||
public static I18NBundle bundle;
|
||||
|
||||
public static Control control;
|
||||
public static Renderer renderer;
|
||||
public static UI ui;
|
||||
|
||||
@@ -106,7 +106,9 @@ public class Control extends Module{
|
||||
"zoom_hold", Keys.CONTROL_LEFT,
|
||||
"menu", Gdx.app.getType() == ApplicationType.Android ? Keys.BACK : Keys.ESCAPE,
|
||||
"pause", Keys.SPACE,
|
||||
"dash", Keys.SHIFT_LEFT
|
||||
"dash", Keys.SHIFT_LEFT,
|
||||
"rotate_right", Keys.R,
|
||||
"rotate_left", Keys.E
|
||||
);
|
||||
|
||||
for(int i = 0; i < Vars.saveSlots; i ++){
|
||||
@@ -419,6 +421,10 @@ public class Control extends Module{
|
||||
wavetime = 0f;
|
||||
}
|
||||
|
||||
if(Inputs.keyUp(Keys.U)){
|
||||
Vars.showUI = !Vars.showUI;
|
||||
}
|
||||
|
||||
if(Inputs.keyUp(Keys.O)){
|
||||
Vars.noclip = !Vars.noclip;
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ public class Renderer extends RendererModule{
|
||||
|
||||
drawOverlay();
|
||||
|
||||
if(Settings.getBool("indicators")){
|
||||
if(Settings.getBool("indicators") && Vars.showUI){
|
||||
drawEnemyMarkers();
|
||||
}
|
||||
}
|
||||
@@ -561,14 +561,17 @@ public class Renderer extends RendererModule{
|
||||
target.block().drawSelect(target);
|
||||
}
|
||||
}
|
||||
|
||||
if(!Vars.debug || Vars.showUI){
|
||||
|
||||
//draw entity health bars
|
||||
for(Enemy entity : control.enemyGroup.all()){
|
||||
drawHealth(entity);
|
||||
//draw entity health bars
|
||||
for(Enemy entity : control.enemyGroup.all()){
|
||||
drawHealth(entity);
|
||||
}
|
||||
|
||||
if(!Vars.android && Vars.showPlayer)
|
||||
drawHealth(player);
|
||||
}
|
||||
|
||||
if(!Vars.android && Vars.showPlayer)
|
||||
drawHealth(player);
|
||||
}
|
||||
|
||||
void drawHealth(DestructibleEntity dest){
|
||||
|
||||
@@ -131,6 +131,8 @@ public class UI extends SceneModule{
|
||||
|
||||
@Override
|
||||
public void update(){
|
||||
if(Vars.debug && !Vars.showUI) return;
|
||||
|
||||
Profiler.begin("ui");
|
||||
|
||||
if(nplay.visible()){
|
||||
|
||||
@@ -56,7 +56,7 @@ public class Player extends DestructibleEntity{
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
if(!Vars.showPlayer) return;
|
||||
if(Vars.debug && (!Vars.showPlayer || !Vars.showUI)) return;
|
||||
|
||||
if(Vars.snapCamera && Settings.getBool("smoothcam") && Settings.getBool("pixelate")){
|
||||
Draw.rect("mech-"+mech.name(), (int)x, (int)y, direction.angle()-90);
|
||||
|
||||
@@ -98,7 +98,7 @@ public class WaveCreator{
|
||||
|
||||
new EnemySpawn(TitanEnemy.class){{
|
||||
after = 16;
|
||||
amount = 2;
|
||||
amount = 1;
|
||||
spacing = 5;
|
||||
scaling = 3;
|
||||
tierscaleback = 0;
|
||||
|
||||
@@ -219,9 +219,11 @@ public class Enemy extends DestructibleEntity{
|
||||
@Override
|
||||
public void removed(){
|
||||
if(!dead){
|
||||
Vars.control.enemyDeath();
|
||||
|
||||
if(spawner != null){
|
||||
spawner.spawned --;
|
||||
}else{
|
||||
Vars.control.enemyDeath();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,14 +10,14 @@ import io.anuke.ucore.util.Angles;
|
||||
public class FortressEnemy extends Enemy{
|
||||
static int maxSpawn = 6;
|
||||
|
||||
float spawnTime = 240;
|
||||
float spawnTime = 190;
|
||||
boolean deployed;
|
||||
|
||||
public FortressEnemy() {
|
||||
|
||||
speed = 0.25f;
|
||||
reload = 90;
|
||||
maxhealth = 800;
|
||||
maxhealth = 700;
|
||||
range = 70f;
|
||||
bullet = BulletType.yellowshell;
|
||||
hitbox.setSize(10f);
|
||||
@@ -47,7 +47,7 @@ public class FortressEnemy extends Enemy{
|
||||
spawned ++;
|
||||
}
|
||||
}else if(distanceTo(Vars.control.getCore().worldx(),
|
||||
Vars.control.getCore().worldy()) <= 120f){
|
||||
Vars.control.getCore().worldy()) <= 90f){
|
||||
deployed = true;
|
||||
speed = 0.001f;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,14 @@ public class Input{
|
||||
player.rotation += Inputs.scroll();
|
||||
}
|
||||
|
||||
if(Inputs.keyUp("rotate_right")){
|
||||
player.rotation --;
|
||||
}
|
||||
|
||||
if(Inputs.keyUp("rotate_left")){
|
||||
player.rotation ++;
|
||||
}
|
||||
|
||||
player.rotation = Mathf.mod(player.rotation, 4);
|
||||
|
||||
for(int i = 0; i < 9; i ++){
|
||||
|
||||
@@ -157,7 +157,7 @@ public class BlocksFragment implements Fragment{
|
||||
header.addImage(region).size(8*5).padTop(4).units(Unit.dp);
|
||||
Label nameLabel = new Label(recipe.result.formalName);
|
||||
nameLabel.setWrap(true);
|
||||
header.add(nameLabel).padLeft(4).width(135f).units(Unit.dp);
|
||||
header.add(nameLabel).padLeft(2).width(135f).units(Unit.dp);
|
||||
|
||||
//extra info
|
||||
if(recipe.result.fullDescription != null){
|
||||
|
||||
Reference in New Issue
Block a user