1
0
mirror of https://github.com/Anuken/Mindustry.git synced 2024-09-22 05:47:44 +03:00

Changed rotation control scheme, fixed "transparent" boxes

This commit is contained in:
Anuken 2017-12-07 21:54:28 -05:00
parent 956e35b677
commit cffb673bae
22 changed files with 319 additions and 397 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.anuke.mindustry"
android:versionCode="18"
android:versionName="3.02b" >
android:versionCode="19"
android:versionName="3.03b" >
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="25" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 78 KiB

View File

@ -100,8 +100,7 @@ public class Control extends Module{
"left", Keys.A,
"down", Keys.S,
"right", Keys.D,
"rotate", Keys.R,
"rotate_back", Keys.E,
"zoom_hold", Keys.CONTROL_LEFT,
"menu", Gdx.app.getType() == ApplicationType.Android ? Keys.BACK : Keys.ESCAPE,
"pause", Keys.SPACE
);

View File

@ -38,7 +38,7 @@ import io.anuke.ucore.util.*;
public class Renderer extends RendererModule{
String[] surfaces = { "shadow", "shield", "pixel", "indicators" };
int targetscale = baseCameraScale;
int chunksize = 16;
int chunksize = 32;
int[][][] cache;
FloatArray shieldHits = new FloatArray();
float shieldHitDuration = 18f;

View File

@ -112,8 +112,9 @@ public class UI extends SceneModule{
Draw.color();
TextureRegion back = Draw.region("background");
float backscl = 5.5f;
float backscl = 4f;
Draw.alpha(0.8f);
Core.batch.draw(back, w/2 - back.getRegionWidth()*backscl/2, h/2 - back.getRegionHeight()*backscl/2,
back.getRegionWidth()*backscl, back.getRegionHeight()*backscl);
@ -122,10 +123,9 @@ public class UI extends SceneModule{
float logow = logo.getRegionWidth()*logoscl;
float logoh = logo.getRegionHeight()*logoscl;
Draw.color();
Core.batch.draw(logo, w/2 - logow/2, h - logoh + 15, logow, logoh);
Draw.color();
Core.batch.draw(logo, w/2 - logow/2, h - logoh + 15, logow, logoh);
}

View File

@ -25,20 +25,15 @@ public class Input{
//player is dead
if(player.health <= 0) return;
if(Inputs.scrolled() && !GameState.is(State.menu) && !Vars.ui.onDialog()){
if(Inputs.scrolled() && Inputs.keyDown("zoom_hold") && !GameState.is(State.menu) && !Vars.ui.onDialog()){
Vars.renderer.scaleCamera(Inputs.scroll());
}
if(Inputs.keyUp("rotate"))
player.rotation ++;
if(Inputs.keyUp("rotate_back"))
player.rotation --;
if(player.rotation < 0)
player.rotation += 4;
if(Inputs.scrolled()){
player.rotation += Inputs.scroll();
}
player.rotation %= 4;
player.rotation = Mathf.mod(player.rotation, 4);
for(int i = 0; i < 9; i ++){
if(Inputs.keyUp(Keys.valueOf(""+(i+1))) && i < control.getWeapons().size){

View File

@ -41,7 +41,7 @@ public class BlocksFragment implements Fragment{
row();
new table("pane"){{
get().setTouchable(Touchable.enabled);
int rows = 4;
int maxcol = 0;
float size = 48;
@ -139,6 +139,7 @@ public class BlocksFragment implements Fragment{
void updateRecipe(){
Recipe recipe = player.recipe;
desctable.clear();
desctable.setTouchable(Touchable.enabled);
desctable.defaults().left();
desctable.left();

View File

@ -66,12 +66,14 @@ public class HudFragment implements Fragment{
row();
new table(){{
get().setTouchable(Touchable.enabled);
addWaveTable();
}}.fillX().end();
row();
itemtable = new table("button").end().top().left().fillX().size(-1).get();
itemtable.setTouchable(Touchable.enabled);
itemtable.setVisible(()-> control.getMode() != GameMode.sandbox);
itemcell = get().getCell(itemtable);

View File

@ -11,6 +11,7 @@ import io.anuke.mindustry.input.PlaceMode;
import io.anuke.ucore.scene.builders.imagebutton;
import io.anuke.ucore.scene.builders.label;
import io.anuke.ucore.scene.builders.table;
import io.anuke.ucore.scene.event.Touchable;
import io.anuke.ucore.scene.ui.ButtonGroup;
import io.anuke.ucore.scene.ui.ImageButton;
import io.anuke.ucore.scene.ui.layout.Unit;
@ -27,6 +28,7 @@ public class PlacementFragment implements Fragment{
new table("pane"){{
get().setTouchable(Touchable.enabled);
new label(()->"Placement Mode: [orange]" + AndroidInput.mode.name()).pad(4).units(Unit.dp);
row();