New tutorial section on tunnels, fixed tutorial bugs
This commit is contained in:
@@ -273,6 +273,7 @@ tutorial.healingTurret.text=This laser can be used to power a [lime]repair turre
|
|||||||
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 iron, using coal as fuel.
|
tutorial.smelterySetup.text=This smelter will now produce [orange]steel[] from the input iron, using coal as fuel.
|
||||||
|
tutorial.tunnelExplain.text=Also note that the items are going through a [orange]tunnel block[] and emerging on the other side, going through the stone block. Keep in mind that tunnels can only go through up to 2 blocks.
|
||||||
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
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import io.anuke.mindustry.entities.effect.Shield;
|
|||||||
import io.anuke.mindustry.entities.enemies.Enemy;
|
import io.anuke.mindustry.entities.enemies.Enemy;
|
||||||
import io.anuke.mindustry.entities.enemies.EnemyTypes;
|
import io.anuke.mindustry.entities.enemies.EnemyTypes;
|
||||||
import io.anuke.mindustry.game.*;
|
import io.anuke.mindustry.game.*;
|
||||||
|
import io.anuke.mindustry.game.Tutorial;
|
||||||
import io.anuke.mindustry.graphics.Fx;
|
import io.anuke.mindustry.graphics.Fx;
|
||||||
import io.anuke.mindustry.input.AndroidInput;
|
import io.anuke.mindustry.input.AndroidInput;
|
||||||
import io.anuke.mindustry.input.DesktopInput;
|
import io.anuke.mindustry.input.DesktopInput;
|
||||||
@@ -46,7 +47,7 @@ import java.util.Arrays;
|
|||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
public class Control extends Module{
|
public class Control extends Module{
|
||||||
Tutorial tutorial = new Tutorial();
|
io.anuke.mindustry.game.Tutorial tutorial = new io.anuke.mindustry.game.Tutorial();
|
||||||
boolean hiscore = false;
|
boolean hiscore = false;
|
||||||
|
|
||||||
final Array<Weapon> weapons = new Array<>();
|
final Array<Weapon> weapons = new Array<>();
|
||||||
|
|||||||
@@ -16,13 +16,13 @@ public class TargetType extends EnemyType {
|
|||||||
super("targetenemy");
|
super("targetenemy");
|
||||||
|
|
||||||
speed = 0f;
|
speed = 0f;
|
||||||
health = 25;
|
health = 40;
|
||||||
shootsound = null;
|
shootsound = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void move(Enemy enemy){
|
public void move(Enemy enemy){
|
||||||
super.move(enemy);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
package io.anuke.mindustry.core;
|
package io.anuke.mindustry.game;
|
||||||
|
|
||||||
import com.badlogic.gdx.math.GridPoint2;
|
import com.badlogic.gdx.math.GridPoint2;
|
||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
|
import io.anuke.mindustry.core.GameState;
|
||||||
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.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
@@ -72,7 +73,7 @@ public class Tutorial{
|
|||||||
//info.setText(stage.text);
|
//info.setText(stage.text);
|
||||||
|
|
||||||
if(stage.showBlock){
|
if(stage.showBlock){
|
||||||
Tile tile = world.tile(control.core.x + stage.blockPlaceX, control.core.y + stage.blockPlaceY);
|
Tile tile = world.tile(control.getCore().x + stage.blockPlaceX, control.getCore().y + stage.blockPlaceY);
|
||||||
|
|
||||||
if(tile.block() == stage.targetBlock && (tile.getRotation() == stage.blockRotation || stage.blockRotation == -1)){
|
if(tile.block() == stage.targetBlock && (tile.getRotation() == stage.blockRotation || stage.blockRotation == -1)){
|
||||||
move(true);
|
move(true);
|
||||||
@@ -156,8 +157,8 @@ public class Tutorial{
|
|||||||
world.tile(corex, corey - 3).setBlock(Blocks.air);
|
world.tile(corex, corey - 3).setBlock(Blocks.air);
|
||||||
world.tile(corex, corey - 3).setFloor(Blocks.stone);
|
world.tile(corex, corey - 3).setFloor(Blocks.stone);
|
||||||
|
|
||||||
world.tile(corex + 1, corey - 7).setFloor(Blocks.iron);
|
world.tile(corex + 1, corey - 8).setFloor(Blocks.iron);
|
||||||
world.tile(corex - 1, corey - 7).setFloor(Blocks.coal);
|
world.tile(corex - 1, corey - 8).setFloor(Blocks.coal);
|
||||||
|
|
||||||
int r = 10;
|
int r = 10;
|
||||||
|
|
||||||
@@ -290,12 +291,12 @@ public class Tutorial{
|
|||||||
|
|
||||||
void onSwitch(){
|
void onSwitch(){
|
||||||
for(int flip : new int[]{1, -1}){
|
for(int flip : new int[]{1, -1}){
|
||||||
world.tile(control.core.x + flip, control.core.y - 2).setBlock(DistributionBlocks.conveyor, 2 * flip);
|
world.tile(control.getCore().x + flip, control.getCore().y - 2).setBlock(DistributionBlocks.conveyor, 2 * flip);
|
||||||
world.tile(control.core.x + flip*2, control.core.y - 2).setBlock(DistributionBlocks.conveyor, 2 * flip);
|
world.tile(control.getCore().x + flip*2, control.getCore().y - 2).setBlock(DistributionBlocks.conveyor, 2 * flip);
|
||||||
world.tile(control.core.x + flip*2, control.core.y - 3).setBlock(DistributionBlocks.conveyor, 2 * flip);
|
world.tile(control.getCore().x + flip*2, control.getCore().y - 3).setBlock(DistributionBlocks.conveyor, 2 * flip);
|
||||||
world.tile(control.core.x + flip*2, control.core.y - 3).setBlock(DistributionBlocks.conveyor, 1);
|
world.tile(control.getCore().x + flip*2, control.getCore().y - 3).setBlock(DistributionBlocks.conveyor, 1);
|
||||||
world.tile(control.core.x + flip*2, control.core.y - 4).setFloor(Blocks.stone);
|
world.tile(control.getCore().x + flip*2, control.getCore().y - 4).setFloor(Blocks.stone);
|
||||||
world.tile(control.core.x + flip*2, control.core.y - 4).setBlock(ProductionBlocks.stonedrill);
|
world.tile(control.getCore().x + flip*2, control.getCore().y - 4).setBlock(ProductionBlocks.stonedrill);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -344,7 +345,7 @@ public class Tutorial{
|
|||||||
|
|
||||||
void onSwitch(){
|
void onSwitch(){
|
||||||
for(int i = 0; i < 4; i ++){
|
for(int i = 0; i < 4; i ++){
|
||||||
world.tile(control.core.x + 2, control.core.y - 2 + i).setBlock(DistributionBlocks.conveyor, 1);
|
world.tile(control.getCore().x + 2, control.getCore().y - 2 + i).setBlock(DistributionBlocks.conveyor, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
control.getInput().recipe = null;
|
control.getInput().recipe = null;
|
||||||
@@ -454,7 +455,7 @@ public class Tutorial{
|
|||||||
|
|
||||||
void onSwitch(){
|
void onSwitch(){
|
||||||
Vars.ui.<ImageButton>find("sectionbuttondistribution").fireClick();
|
Vars.ui.<ImageButton>find("sectionbuttondistribution").fireClick();
|
||||||
world.tile(blockPlaceX + control.core.x, blockPlaceY + control.core.y).setBlock(Blocks.air);
|
world.tile(blockPlaceX + control.getCore().x, blockPlaceY + control.getCore().y).setBlock(Blocks.air);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
conduitUse2{
|
conduitUse2{
|
||||||
@@ -470,7 +471,7 @@ public class Tutorial{
|
|||||||
}
|
}
|
||||||
|
|
||||||
void onSwitch(){
|
void onSwitch(){
|
||||||
world.tile(blockPlaceX + control.core.x, blockPlaceY + control.core.y).setBlock(Blocks.air);
|
world.tile(blockPlaceX + control.getCore().x, blockPlaceY + control.getCore().y).setBlock(Blocks.air);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
conduitUse3{
|
conduitUse3{
|
||||||
@@ -486,7 +487,7 @@ public class Tutorial{
|
|||||||
}
|
}
|
||||||
|
|
||||||
void onSwitch(){
|
void onSwitch(){
|
||||||
world.tile(blockPlaceX + control.core.x, blockPlaceY + control.core.y).setBlock(Blocks.air);
|
world.tile(blockPlaceX + control.getCore().x, blockPlaceY + control.getCore().y).setBlock(Blocks.air);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
generator{
|
generator{
|
||||||
@@ -501,7 +502,7 @@ public class Tutorial{
|
|||||||
}
|
}
|
||||||
|
|
||||||
void onSwitch(){
|
void onSwitch(){
|
||||||
world.tile(blockPlaceX + control.core.x, blockPlaceY + control.core.y).setBlock(Blocks.air);
|
world.tile(blockPlaceX + control.getCore().x, blockPlaceY + control.getCore().y).setBlock(Blocks.air);
|
||||||
Vars.ui.<ImageButton>find("sectionbuttonpower").fireClick();
|
Vars.ui.<ImageButton>find("sectionbuttonpower").fireClick();
|
||||||
Vars.control.addItem(Item.steel, 60);
|
Vars.control.addItem(Item.steel, 60);
|
||||||
Vars.control.addItem(Item.iron, 60);
|
Vars.control.addItem(Item.iron, 60);
|
||||||
@@ -567,7 +568,7 @@ public class Tutorial{
|
|||||||
canPlace = true;
|
canPlace = true;
|
||||||
canBack = false;
|
canBack = false;
|
||||||
blockPlaceX = 0;
|
blockPlaceX = 0;
|
||||||
blockPlaceY = -6;
|
blockPlaceY = -7;
|
||||||
targetBlock = ProductionBlocks.smelter;
|
targetBlock = ProductionBlocks.smelter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -584,14 +585,24 @@ public class Tutorial{
|
|||||||
}
|
}
|
||||||
|
|
||||||
void onSwitch(){
|
void onSwitch(){
|
||||||
for(int i = 0; i < 4; i ++){
|
for(int i = 0; i < 5; i ++){
|
||||||
world.tile(control.core.x, control.core.y - 5 + i).setBlock(DistributionBlocks.conveyor, 1);
|
world.tile(control.getCore().x, control.getCore().y - 6 + i).setBlock(DistributionBlocks.conveyor, 1);
|
||||||
}
|
}
|
||||||
world.tile(control.core.x+1, control.core.y - 7).setBlock(ProductionBlocks.irondrill);
|
|
||||||
world.tile(control.core.x-1, control.core.y - 7).setBlock(ProductionBlocks.coaldrill);
|
|
||||||
|
|
||||||
world.tile(control.core.x+1, control.core.y - 6).setBlock(DistributionBlocks.conveyor, 2);
|
world.tile(control.getCore().x, control.getCore().y - 6 + 1).setBlock(DistributionBlocks.tunnel, 3);
|
||||||
world.tile(control.core.x-1, control.core.y - 6).setBlock(DistributionBlocks.conveyor, 0);
|
world.tile(control.getCore().x, control.getCore().y - 6 + 2).setBlock(DefenseBlocks.stonewall, 0);
|
||||||
|
world.tile(control.getCore().x, control.getCore().y - 6 + 3).setBlock(DistributionBlocks.tunnel, 1);
|
||||||
|
|
||||||
|
world.tile(control.getCore().x+1, control.getCore().y - 8).setBlock(ProductionBlocks.irondrill);
|
||||||
|
world.tile(control.getCore().x-1, control.getCore().y - 8).setBlock(ProductionBlocks.coaldrill);
|
||||||
|
|
||||||
|
world.tile(control.getCore().x+1, control.getCore().y - 7).setBlock(DistributionBlocks.conveyor, 2);
|
||||||
|
world.tile(control.getCore().x-1, control.getCore().y - 7).setBlock(DistributionBlocks.conveyor, 0);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tunnelExplain{
|
||||||
|
{
|
||||||
|
canBack = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
end{
|
end{
|
||||||
@@ -4,8 +4,8 @@ import com.badlogic.gdx.Gdx;
|
|||||||
import com.badlogic.gdx.files.FileHandle;
|
import com.badlogic.gdx.files.FileHandle;
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.core.Tutorial;
|
import io.anuke.mindustry.game.Tutorial;
|
||||||
import io.anuke.mindustry.core.Tutorial.Stage;
|
import io.anuke.mindustry.game.Tutorial.Stage;
|
||||||
import io.anuke.mindustry.resource.Item;
|
import io.anuke.mindustry.resource.Item;
|
||||||
import io.anuke.mindustry.resource.Liquid;
|
import io.anuke.mindustry.resource.Liquid;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package io.anuke.mindustry.ui;
|
package io.anuke.mindustry.ui;
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.g2d.BitmapFont;
|
import com.badlogic.gdx.graphics.g2d.BitmapFont;
|
||||||
import io.anuke.ucore.UCore;
|
|
||||||
import io.anuke.ucore.core.Core;
|
import io.anuke.ucore.core.Core;
|
||||||
import io.anuke.ucore.function.Listenable;
|
import io.anuke.ucore.function.Listenable;
|
||||||
import io.anuke.ucore.scene.ui.Button;
|
import io.anuke.ucore.scene.ui.Button;
|
||||||
@@ -9,22 +8,37 @@ import io.anuke.ucore.scene.ui.layout.Unit;
|
|||||||
import io.anuke.ucore.util.Bundles;
|
import io.anuke.ucore.util.Bundles;
|
||||||
|
|
||||||
public class MenuButton extends Button{
|
public class MenuButton extends Button{
|
||||||
|
private static boolean hasInvalid = false;
|
||||||
|
private String text;
|
||||||
|
private boolean added = false;
|
||||||
|
|
||||||
public MenuButton(String text, PressGroup group, Listenable clicked){
|
public MenuButton(String text, PressGroup group, Listenable clicked){
|
||||||
super("menu");
|
super("menu");
|
||||||
String style = "title";
|
this.text = text;
|
||||||
float scale = 4f;
|
|
||||||
BitmapFont font = Core.skin.getFont("title");
|
BitmapFont font = Core.skin.getFont("title");
|
||||||
for(char c : Bundles.get(text.substring(1)).toCharArray()){
|
for(char c : Bundles.get(text.substring(1)).toCharArray()){
|
||||||
if(!font.getData().hasGlyph(c)){
|
if(!font.getData().hasGlyph(c)){
|
||||||
UCore.log("No glyph found: " + c);
|
hasInvalid = true;
|
||||||
style = "default";
|
|
||||||
scale = Unit.dp.scl(1f);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
add(text, style, scale);
|
|
||||||
clicked(clicked);
|
clicked(clicked);
|
||||||
group.add(this);
|
group.add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void layout() {
|
||||||
|
super.layout();
|
||||||
|
if(added)
|
||||||
|
return;
|
||||||
|
added = true;
|
||||||
|
String style = "title";
|
||||||
|
float scale = 4f;
|
||||||
|
BitmapFont font = Core.skin.getFont("title");
|
||||||
|
if(hasInvalid){
|
||||||
|
style = "default";
|
||||||
|
scale = Unit.dp.scl(1f);
|
||||||
|
}
|
||||||
|
add(text, style, scale);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
12
core/src/io/anuke/mindustry/ui/dialogs/LanguageDialog.java
Normal file
12
core/src/io/anuke/mindustry/ui/dialogs/LanguageDialog.java
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
package io.anuke.mindustry.ui.dialogs;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
public class LanguageDialog extends FloatingDialog{
|
||||||
|
private Locale[] locales = {Locale.ENGLISH, Locale.FRENCH, new Locale("es", "LA"), new Locale("pt", "BR")};
|
||||||
|
|
||||||
|
public LanguageDialog(){
|
||||||
|
super("$text.language");
|
||||||
|
addCloseButton();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -106,7 +106,6 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
void addSettings(){
|
void addSettings(){
|
||||||
sound.volumePrefs();
|
sound.volumePrefs();
|
||||||
|
|
||||||
//game.sliderPref("difficulty", 1, 0, Difficulty.values().length-1, i -> Difficulty.values()[i].toString());
|
|
||||||
game.screenshakePref();
|
game.screenshakePref();
|
||||||
game.checkPref("smoothcam", true);
|
game.checkPref("smoothcam", true);
|
||||||
game.checkPref("effects", true);
|
game.checkPref("effects", true);
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ public class DesktopLauncher {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onGameExit() {
|
public void onGameExit() {
|
||||||
DiscordRPC.INSTANCE.Discord_Shutdown();
|
lib.Discord_Shutdown();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user