Prepared for 3.3 beta release

This commit is contained in:
Anuken
2018-01-09 23:10:41 -05:00
parent 9542f74c14
commit 0b71dcecc0
6 changed files with 139 additions and 81 deletions

View File

@@ -130,6 +130,15 @@ text.respawn=Respawning in
text.error.title=[crimson]An error has occured text.error.title=[crimson]An error has occured
text.error.crashmessage=[SCARLET]An unexpected error has occured, which would have caused a crash. []Please report the exact circumstances under which this error occured to the developer: \n[ORANGE]anukendev@gmail.com[] text.error.crashmessage=[SCARLET]An unexpected error has occured, which would have caused a crash. []Please report the exact circumstances under which this error occured to the developer: \n[ORANGE]anukendev@gmail.com[]
text.error.crashtitle=An error has occured text.error.crashtitle=An error has occured
text.mode.break=Break mode: {0}
text.mode.place=Place mode: {0}
placemode.hold.name=line
placemode.areadelete.name=area
placemode.touchdelete.name=touch
placemode.holddelete.name=hold
placemode.none.name=none
placemode.touch.name=touch
placemode.cursor.name=cursor
text.blocks.extrainfo=[accent]extra block info: text.blocks.extrainfo=[accent]extra block info:
text.blocks.blockinfo=Block Info text.blocks.blockinfo=Block Info
text.blocks.powercapacity=Power Capacity text.blocks.powercapacity=Power Capacity
@@ -211,7 +220,7 @@ map.spiral.name=spiral
map.tutorial.name=tutorial map.tutorial.name=tutorial
tutorial.intro.text=[yellow]Welcome to the tutorial.[] To begin, press 'next'. tutorial.intro.text=[yellow]Welcome to the tutorial.[] To begin, press 'next'.
tutorial.moveDesktop.text=To move, use the [orange][[WASD][] keys. Hold [orange]shift[] to boost. Hold [orange]CTRL[] while using the [orange]scrollwheel[] to zoom in or out. tutorial.moveDesktop.text=To move, use the [orange][[WASD][] keys. Hold [orange]shift[] to boost. Hold [orange]CTRL[] while using the [orange]scrollwheel[] to zoom in or out.
tutorial.shoot.text=Use your mouse to aim, hold [orange]left mouse button[] to shootInternal. Try practicing on the [yellow]target[]. tutorial.shoot.text=Use your mouse to aim, hold [orange]left mouse button[] to shoot. Try practicing on the [yellow]target[].
tutorial.moveAndroid.text=To pan the view, drag one finger across the screen. Pinch and drag to zoom in or out. tutorial.moveAndroid.text=To pan the view, drag one finger across the screen. Pinch and drag to zoom in or out.
tutorial.placeSelect.text=Try selecting a [yellow]conveyor[] from the block menu in the bottom right. tutorial.placeSelect.text=Try selecting a [yellow]conveyor[] from the block menu in the bottom right.
tutorial.placeConveyorDesktop.text=Use the [orange][[scrollwheel][] to rotate the conveyor to face [orange]forwards[], then place it in the [yellow]marked location[] using the [orange][[left mouse button][]. tutorial.placeConveyorDesktop.text=Use the [orange][[scrollwheel][] to rotate the conveyor to face [orange]forwards[], then place it in the [yellow]marked location[] using the [orange][[left mouse button][].
@@ -250,7 +259,7 @@ tutorial.laserMore.text=You can check how much power a block has by hovering ove
tutorial.healingTurret.text=This laser can be used to power a [lime]repair turret[]. Place one here. tutorial.healingTurret.text=This laser can be used to power a [lime]repair turret[]. Place one here.
tutorial.healingTurretExplain.text=As long as it has power, this turret will [lime]repair nearby blocks.[] When playing, make sure you get one in your base as quickly as possible! tutorial.healingTurretExplain.text=As long as it has power, this turret will [lime]repair nearby blocks.[] When playing, make sure you get one in your base as quickly as possible!
tutorial.smeltery.text=Many blocks require [orange]steel[] to make, which requires a [orange]smelter[] to craft. Place one here. tutorial.smeltery.text=Many blocks require [orange]steel[] to make, which requires a [orange]smelter[] to craft. Place one here.
tutorial.smelterySetup.text=This smelter will now produce [orange]steel[] from the input coal and iron. tutorial.smelterySetup.text=This smelter will now produce [orange]steel[] from the input iron, using coal as fuel.
tutorial.end.text=And that concludes the tutorial! Good luck! tutorial.end.text=And that concludes the tutorial! Good luck!
keybind.move_x.name=move_x keybind.move_x.name=move_x
keybind.move_y.name=move_y keybind.move_y.name=move_y

View File

@@ -4,7 +4,6 @@ import com.badlogic.gdx.math.GridPoint2;
import io.anuke.mindustry.Vars; import io.anuke.mindustry.Vars;
import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.resource.Item;
import io.anuke.mindustry.resource.Weapon;
import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.*; import io.anuke.mindustry.world.blocks.*;
@@ -374,6 +373,8 @@ public class Tutorial{
androidOnly = true; androidOnly = true;
} }
}, },
//TODO re-add tutorial on weapons
/*
purchaseWeapons{ purchaseWeapons{
{ {
desktopOnly = true; desktopOnly = true;
@@ -397,7 +398,7 @@ public class Tutorial{
Vars.ui.hudfrag.updateWeapons(); Vars.ui.hudfrag.updateWeapons();
} }
} }
}, },*/
spawnWave{ spawnWave{
float warmup = 0f; float warmup = 0f;
{ {

View File

@@ -35,6 +35,7 @@ public abstract class InputHandler extends InputAdapter{
public int rotation; public int rotation;
public PlaceMode placeMode = android ? PlaceMode.cursor : PlaceMode.hold; public PlaceMode placeMode = android ? PlaceMode.cursor : PlaceMode.hold;
public PlaceMode breakMode = android ? PlaceMode.none : PlaceMode.holdDelete; public PlaceMode breakMode = android ? PlaceMode.none : PlaceMode.holdDelete;
public PlaceMode lastPlaceMode = placeMode;
public abstract void update(); public abstract void update();
public abstract float getCursorX(); public abstract float getCursorX();

View File

@@ -14,6 +14,7 @@ import io.anuke.ucore.core.Draw;
import io.anuke.ucore.core.Inputs; import io.anuke.ucore.core.Inputs;
import io.anuke.ucore.core.Timers; import io.anuke.ucore.core.Timers;
import io.anuke.ucore.scene.utils.Cursors; import io.anuke.ucore.scene.utils.Cursors;
import io.anuke.ucore.util.Bundles;
import io.anuke.ucore.util.Mathf; import io.anuke.ucore.util.Mathf;
import io.anuke.ucore.util.Tmp; import io.anuke.ucore.util.Tmp;
@@ -393,4 +394,9 @@ public enum PlaceMode{
public void tapped(int x, int y){ public void tapped(int x, int y){
} }
@Override
public String toString(){
return Bundles.get("placemode."+name().toLowerCase()+".name");
}
} }

View File

@@ -1,6 +1,5 @@
package io.anuke.mindustry.ui.fragments; package io.anuke.mindustry.ui.fragments;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.BitmapFont;
@@ -81,7 +80,12 @@ public class ChatFragment extends Table implements Fragment{
add(chatfield).padBottom(offsety).padLeft(offsetx).growX().padRight(offsetx).height(28); add(chatfield).padBottom(offsety).padLeft(offsetx).growX().padRight(offsetx).height(28);
if(Vars.android) { if(Vars.android) {
addImageButton("icon-arrow-right", 14 * 2, this::toggle).size(50f, 55f).visible(() -> chatOpen); marginBottom(110f);
marginRight(240f);
}
if(Vars.android) {
addImageButton("icon-arrow-right", 14 * 2, this::toggle).size(46f, 51f).visible(() -> chatOpen).pad(2f);
} }
} }
@@ -91,7 +95,7 @@ public class ChatFragment extends Table implements Fragment{
batch.setColor(shadowColor); batch.setColor(shadowColor);
if(chatOpen) if(chatOpen)
batch.draw(skin.getRegion("white"), offsetx, chatfield.getY(), Gdx.graphics.getWidth()-offsetx*2, chatfield.getHeight()-1); batch.draw(skin.getRegion("white"), offsetx, chatfield.getY(), chatfield.getWidth() + 15f, chatfield.getHeight()-1);
//font.getData().down = Unit.dp.scl(-21.5f); //font.getData().down = Unit.dp.scl(-21.5f);
//font.getData().lineHeight = 22f; //font.getData().lineHeight = 22f;
@@ -106,7 +110,7 @@ public class ChatFragment extends Table implements Fragment{
batch.setColor(shadowColor); batch.setColor(shadowColor);
float theight = offsety + spacing; float theight = offsety + spacing + getMarginBottom();
for(int i = 0; i < messagesShown && i < messages.size && i < fadetime; i ++){ for(int i = 0; i < messagesShown && i < messages.size && i < fadetime; i ++){
layout.setText(font, messages.get(i).formattedMessage, Color.WHITE, textWidth, Align.bottomLeft, true); layout.setText(font, messages.get(i).formattedMessage, Color.WHITE, textWidth, Align.bottomLeft, true);

View File

@@ -11,18 +11,22 @@ import io.anuke.mindustry.input.PlaceMode;
import io.anuke.ucore.core.Core; import io.anuke.ucore.core.Core;
import io.anuke.ucore.scene.actions.Actions; import io.anuke.ucore.scene.actions.Actions;
import io.anuke.ucore.scene.builders.imagebutton; 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.builders.table;
import io.anuke.ucore.scene.event.Touchable; import io.anuke.ucore.scene.event.Touchable;
import io.anuke.ucore.scene.ui.ButtonGroup; import io.anuke.ucore.scene.ui.ButtonGroup;
import io.anuke.ucore.scene.ui.ImageButton; import io.anuke.ucore.scene.ui.ImageButton;
import io.anuke.ucore.scene.ui.Label;
import io.anuke.ucore.scene.ui.layout.Table; import io.anuke.ucore.scene.ui.layout.Table;
import io.anuke.ucore.util.Bundles;
import io.anuke.ucore.util.Mathf; import io.anuke.ucore.util.Mathf;
import static io.anuke.mindustry.Vars.control; import static io.anuke.mindustry.Vars.control;
public class PlacementFragment implements Fragment{ public class PlacementFragment implements Fragment{
boolean shown = false; boolean shown = false, placing = false;
Table breaktable, next; Table breaktable, next, container;
Label modelabel;
public void build(){ public void build(){
if(!Vars.android) return; if(!Vars.android) return;
@@ -30,6 +34,7 @@ public class PlacementFragment implements Fragment{
InputHandler input = control.getInput(); InputHandler input = control.getInput();
float s = 50f; float s = 50f;
float translation = 54f;
new table(){{ new table(){{
visible(() -> !GameState.is(State.menu)); visible(() -> !GameState.is(State.menu));
@@ -41,6 +46,20 @@ public class PlacementFragment implements Fragment{
ButtonGroup<ImageButton> breakGroup = new ButtonGroup<>(); ButtonGroup<ImageButton> breakGroup = new ButtonGroup<>();
update(t -> { update(t -> {
if((input.recipe == null) == placing){
float i = 0.1f;
Interpolation n = Interpolation.pow3Out;
if(input.recipe == null){
placing = false;
container.clearActions();
container.actions(Actions.translateBy(0, -(container.getTranslation().y + translation), i, n));
}else{
placing = true;
container.clearActions();
container.actions(Actions.translateBy(0, -(container.getTranslation().y), i, n));
input.placeMode = input.lastPlaceMode;
}
}
if(!input.placeMode.delete){ if(!input.placeMode.delete){
placeGroup.setMinCheckCount(1); placeGroup.setMinCheckCount(1);
@@ -72,43 +91,8 @@ public class PlacementFragment implements Fragment{
} }
}); });
new table(){{ container = new table(){{
visible(() -> input.recipe != null); modelabel = new label("").get();
touchable(Touchable.enabled);
aleft();
new table("pane"){{
margin(5f);
aleft();
defaults().size(s, s + 4).padBottom(-5.5f);
Color color = Color.GRAY;
new imagebutton("icon-cancel", 14*3, ()->{
input.recipe = null;
}).imageColor(color)
.visible(()->input.recipe != null);
for(PlaceMode mode : PlaceMode.values()){
if(!mode.shown || mode.delete) continue;
new imagebutton("icon-" + mode.name(), "toggle", 10*3, ()->{
control.getInput().resetCursor();
input.placeMode = mode;
}).group(placeGroup).get().setName(mode.name());
}
new imagebutton("icon-arrow", 14*3, ()->{
input.rotation = Mathf.mod(input.rotation + 1, 4);
}).imageColor(color).visible(() -> input.recipe != null).update(image ->{
image.getImage().setRotation(input.rotation *90);
image.getImage().setOrigin(Align.center);
});
}}.padBottom(-5).left().end();
}}.left().end();
row(); row();
@@ -147,6 +131,7 @@ public class PlacementFragment implements Fragment{
control.getInput().resetCursor(); control.getInput().resetCursor();
input.breakMode = mode; input.breakMode = mode;
if (!mode.both) input.placeMode = mode; if (!mode.both) input.placeMode = mode;
modeText(Bundles.format("text.mode.break", mode.toString()));
}).group(breakGroup).get().setName(mode.name()); }).group(breakGroup).get().setName(mode.name());
} }
@@ -158,9 +143,61 @@ public class PlacementFragment implements Fragment{
}}.end().get(); }}.end().get();
row();
new table() {{
touchable(Touchable.enabled);
aleft();
new table("pane") {{
margin(5f);
aleft();
defaults().size(s, s + 4).padBottom(-5.5f);
Color color = Color.GRAY;
new imagebutton("icon-cancel", 14 * 3, () -> {
input.recipe = null;
}).imageColor(color)
.visible(() -> input.recipe != null);
for (PlaceMode mode : PlaceMode.values()) {
if (!mode.shown || mode.delete) continue;
new imagebutton("icon-" + mode.name(), "toggle", 10 * 3, () -> {
control.getInput().resetCursor();
input.placeMode = mode;
input.lastPlaceMode = mode;
modeText(Bundles.format("text.mode.place", mode.toString()));
}).group(placeGroup).get().setName(mode.name());
}
new imagebutton("icon-arrow", 14 * 3, () -> {
input.rotation = Mathf.mod(input.rotation + 1, 4);
}).imageColor(color).visible(() -> input.recipe != null).update(image -> {
image.getImage().setRotation(input.rotation * 90);
image.getImage().setOrigin(Align.center);
});
}}.left().end();
}}.left().end();
}}.end().get();
container.setTranslation(0, -translation);
}}.end(); }}.end();
} }
private void modeText(String text){
modelabel.setText(text);
modelabel.clearActions();
modelabel.setColor(Color.WHITE);
modelabel.actions(Actions.fadeOut(5f, Interpolation.fade));
}
private void toggle(boolean show){ private void toggle(boolean show){
float dur = 0.3f; float dur = 0.3f;
Interpolation in = Interpolation.pow3Out; Interpolation in = Interpolation.pow3Out;