Tutorial fixes

This commit is contained in:
Anuken
2019-08-13 16:26:02 -04:00
parent 974ab59fd2
commit 58b4f64125
9 changed files with 40 additions and 55 deletions

View File

@@ -871,22 +871,23 @@ tutorial.intro = You have entered the[scarlet] Mindustry Tutorial.[]\nBegin by[a
tutorial.drill = Mining manually is inefficient.\n[accent]Drills []can mine automatically.\nClick the drill tab in the bottom right.\nSelect the[accent] mechanical drill[]. Place it on a copper vein by clicking.\n[accent]Right-click[] to stop building. tutorial.drill = Mining manually is inefficient.\n[accent]Drills []can mine automatically.\nClick the drill tab in the bottom right.\nSelect the[accent] mechanical drill[]. Place it on a copper vein by clicking.\n[accent]Right-click[] to stop building.
tutorial.drill.mobile = Mining manually is inefficient.\n[accent]Drills []can mine automatically.\nTap the drill tab in the bottom right.\nSelect the[accent] mechanical drill[].\nPlace it on a copper vein by tapping, then press the[accent] checkmark[] below to confirm your selection.\nPress the[accent] X button[] to cancel placement. tutorial.drill.mobile = Mining manually is inefficient.\n[accent]Drills []can mine automatically.\nTap the drill tab in the bottom right.\nSelect the[accent] mechanical drill[].\nPlace it on a copper vein by tapping, then press the[accent] checkmark[] below to confirm your selection.\nPress the[accent] X button[] to cancel placement.
tutorial.blockinfo = Each block has different stats. Each drill can only mine certain ores.\nTo check a block's info and stats,[accent] tap the "?" button while selecting it in the build menu.[]\n\n[accent]Access the Mechanical Drill's stats now.[] tutorial.blockinfo = Each block has different stats. Each drill can only mine certain ores.\nTo check a block's info and stats,[accent] tap the "?" button while selecting it in the build menu.[]\n\n[accent]Access the Mechanical Drill's stats now.[]
tutorial.conveyor = [accent]Conveyors[] are used to transport items to the core.\nMake a line of conveyors from the drill to the core.\n[accent]Hold down the mouse to place in a line.[]\nHold[accent] CTRL[] while selecting a line to place diagonally.\n\n[accent]{0}/{1} conveyors\n[accent]0/1 items delivered tutorial.conveyor = [accent]Conveyors[] are used to transport items to the core.\nMake a line of conveyors from the drill to the core.\n[accent]Hold down the mouse to place in a line.[]\nHold[accent] CTRL[] while selecting a line to place diagonally.\n\n[accent]{0}/{1} conveyors placed in line\n[accent]0/1 items delivered
tutorial.conveyor.mobile = [accent]Conveyors[] are used to transport items to the core.\nMake a line of conveyors from the drill to the core.\n[accent] Place in a line by holding down your finger for a few seconds[] and dragging in a direction.\n\n[accent]{0}/{1} conveyors\n[accent]0/1 items delivered tutorial.conveyor.mobile = [accent]Conveyors[] are used to transport items to the core.\nMake a line of conveyors from the drill to the core.\n[accent] Place in a line by holding down your finger for a few seconds[] and dragging in a direction.\n\n[accent]{0}/{1} conveyors placed in line\n[accent]0/1 items delivered
tutorial.turret = Defensive structures must be built to repel the[lightgray] enemy[].\nBuild a[accent] duo turret[] near your base. tutorial.turret = Defensive structures must be built to repel the[lightgray] enemy[].\nBuild a[accent] duo turret[] near your base.
tutorial.drillturret = Duo turrets require[accent] copper ammo []to shoot.\nPlace a drill near to the turret\n Lead conveyors into the turret to supply it with copper.\n\n[accent]Ammo delivered: 0/1 tutorial.drillturret = Duo turrets require[accent] copper ammo []to shoot.\nPlace a drill near the turret.\nLead conveyors into the turret to supply it with copper.\n\n[accent]Ammo delivered: 0/1
tutorial.pause = During battle, you are able to[accent] pause the game.[]\nYou may queue buildings while paused.\n\n[accent]Press space to pause. tutorial.pause = During battle, you are able to[accent] pause the game.[]\nYou may queue buildings while paused.\n\n[accent]Press space to pause.
tutorial.pause.mobile = During battle, you are able to[accent] pause the game.[]\nYou may queue buildings while paused.\n\n[accent]Press this button in the top left to pause. tutorial.pause.mobile = During battle, you are able to[accent] pause the game.[]\nYou may queue buildings while paused.\n\n[accent]Press this button in the top left to pause.
tutorial.unpause = Now press space again to unpause. tutorial.unpause = Now press space again to unpause.
tutorial.unpause.mobile = Now press it again to unpause. tutorial.unpause.mobile = Now press it again to unpause.
tutorial.breaking = Blocks frequently need to be destroyed.\n[accent]Hold down right-click[] to destroy all blocks in a selection.[]\n\n[accent]Destroy all the scrap blocks to the right of your core. tutorial.breaking = Blocks frequently need to be destroyed.\n[accent]Hold down right-click[] to destroy all blocks in a selection.[]\n\n[accent]Destroy all the scrap blocks to the left of your core using area selection.
tutorial.breaking.mobile = Blocks frequently need to be destroyed.\n[accent]Select deconstruction mode[], then tap a block to begin breaking it.\nDestroy an area by holding down your finger for a few seconds[] and dragging in a direction.\nPress the checkmark button to confirm breaking.\n\n[accent]Destroy all the scrap blocks to the right of your core. tutorial.breaking.mobile = Blocks frequently need to be destroyed.\n[accent]Select deconstruction mode[], then tap a block to begin breaking it.\nDestroy an area by holding down your finger for a few seconds[] and dragging in a direction.\nPress the checkmark button to confirm breaking.\n\n[accent]Destroy all the scrap blocks to the left of your core using area selection.
tutorial.withdraw = In some situations, taking items directly from blocks is necessary.\nTo do this, [accent]tap a block[] with items in it, then [accent]tap the item[] in the inventory. Multiple items can be withdrawn by [accent]tapping and holding[].\n\n[accent]Withdraw some copper from the core.[] tutorial.withdraw = In some situations, taking items directly from blocks is necessary.\nTo do this, [accent]tap a block[] with items in it, then [accent]tap the item[] in the inventory.\nMultiple items can be withdrawn by [accent]tapping and holding[].\n\n[accent]Withdraw some copper from the core.[]
tutorial.deposit = Deposit items into blocks by dragging from your ship to the destination block.\n\n[accent]Deposit your copper back into the core.[] tutorial.deposit = Deposit items into blocks by dragging from your ship to the destination block.\n\n[accent]Deposit your copper back into the core.[]
tutorial.waves = The[lightgray] enemy[] approaches.\n\nDefend the core for 2 waves.[accent] Click[] to shoot.\nBuild more turrets and drills. Mine more copper. tutorial.waves = The[lightgray] enemy[] approaches.\n\nDefend the core for 2 waves.[accent] Click[] to shoot.\nBuild more turrets and drills. Mine more copper.
tutorial.waves.mobile = The[lightgray] enemy[] approaches.\n\nDefend the core for 2 waves. Your ship will automatically fire at enemies.\nBuild more turrets and drills. Mine more copper. tutorial.waves.mobile = The[lightgray] enemy[] approaches.\n\nDefend the core for 2 waves. Your ship will automatically fire at enemies.\nBuild more turrets and drills. Mine more copper.
tutorial.launch = Once you reach a specific wave, you are able to[accent] launch the core[], leaving your defenses behind and[accent] obtaining all the resources in your core.[]\nThese resources can then be used to research new technology.\n\n[accent]Press the launch button. tutorial.launch = Once you reach a specific wave, you are able to[accent] launch the core[], leaving your defenses behind and[accent] obtaining all the resources in your core.[]\nThese resources can then be used to research new technology.\n\n[accent]Press the launch button.
item.copper.description = The most basic structural material. Used extensively in all types of blocks. item.copper.description = The most basic structural material. Used extensively in all types of blocks.
item.lead.description = A basic starter material. Used extensively in electronics and liquid transportation blocks. item.lead.description = A basic starter material. Used extensively in electronics and liquid transportation blocks.
item.metaglass.description = A super-tough glass compound. Extensively used for liquid distribution and storage. item.metaglass.description = A super-tough glass compound. Extensively used for liquid distribution and storage.

View File

@@ -344,8 +344,8 @@ public class Control implements ApplicationListener{
Platform.instance.updateRPC(); Platform.instance.updateRPC();
//play tutorial on stop //play tutorial on stop
if(!settings.getBool("tutorial", false)){ if(!settings.getBool("playedtutorial", false)){
Core.app.post(this::playTutorial); Core.app.post(() -> Core.app.post(this::playTutorial));
} }
//display UI scale changed dialog //display UI scale changed dialog

View File

@@ -1,15 +1,13 @@
package io.anuke.mindustry.game; package io.anuke.mindustry.game;
import io.anuke.arc.Core; import io.anuke.arc.*;
import io.anuke.arc.Events;
import io.anuke.arc.collection.*; import io.anuke.arc.collection.*;
import io.anuke.mindustry.Vars; import io.anuke.mindustry.*;
import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.*;
import io.anuke.mindustry.game.EventType.UnlockEvent; import io.anuke.mindustry.game.EventType.*;
import io.anuke.mindustry.type.*; import io.anuke.mindustry.type.*;
import static io.anuke.mindustry.Vars.content; import static io.anuke.mindustry.Vars.*;
import static io.anuke.mindustry.Vars.state;
/** Stores player unlocks. Clientside only. */ /** Stores player unlocks. Clientside only. */
public class GlobalData{ public class GlobalData{
@@ -40,7 +38,9 @@ public class GlobalData{
} }
public void addItem(Item item, int amount){ public void addItem(Item item, int amount){
unlockContent(item); if(amount > 0){
unlockContent(item);
}
modified = true; modified = true;
items.getAndIncrement(item, 0, amount); items.getAndIncrement(item, 0, amount);
state.stats.itemsDelivered.getAndIncrement(item, 0, amount); state.stats.itemsDelivered.getAndIncrement(item, 0, amount);

View File

@@ -20,7 +20,7 @@ import static io.anuke.mindustry.Vars.*;
/** Handles tutorial state. */ /** Handles tutorial state. */
public class Tutorial{ public class Tutorial{
private static final int mineCopper = 18; private static final int mineCopper = 18;
private static final int blocksToBreak = 3, blockOffset = 5; private static final int blocksToBreak = 3, blockOffset = -6;
private ObjectSet<String> events = new ObjectSet<>(); private ObjectSet<String> events = new ObjectSet<>();
private ObjectIntMap<Block> blocksPlaced = new ObjectIntMap<>(); private ObjectIntMap<Block> blocksPlaced = new ObjectIntMap<>();
@@ -179,7 +179,7 @@ public class Tutorial{
state.wave = 5; state.wave = 5;
//end tutorial, never show it again //end tutorial, never show it again
Core.settings.put("tutorial", true); Core.settings.put("playedtutorial", true);
Core.settings.save(); Core.settings.save();
} }
@@ -230,7 +230,7 @@ public class Tutorial{
Tile core = state.teams.get(defaultTeam).cores.first(); Tile core = state.teams.get(defaultTeam).cores.first();
for(int i = 0; i < blocksToBreak; i++){ for(int i = 0; i < blocksToBreak; i++){
world.removeBlock(world.ltile(core.x + blockOffset, core.y + i)); world.removeBlock(world.ltile(core.x + blockOffset, core.y + i));
world.tile(core.x + blockOffset, core.y + i).setBlock(Blocks.scrapWall); world.tile(core.x + blockOffset, core.y + i).setBlock(Blocks.scrapWall, defaultTeam);
} }
} }

View File

@@ -457,7 +457,7 @@ public class MobileInput extends InputHandler implements GestureListener{
selecting = hasRequest(cursor) && isPlacing() && mode == placing; selecting = hasRequest(cursor) && isPlacing() && mode == placing;
//call tap events //call tap events
if(pointer == 0 && !selecting && mode == none){ if(pointer == 0 && !selecting){
if(!tryTapPlayer(worldx, worldy) && Core.settings.getBool("keyboard")){ if(!tryTapPlayer(worldx, worldy) && Core.settings.getBool("keyboard")){
//shoot on touch down when in keyboard mode //shoot on touch down when in keyboard mode
player.isShooting = true; player.isShooting = true;

View File

@@ -90,7 +90,7 @@ public class PausedDialog extends FloatingDialog{
void showQuitConfirm(){ void showQuitConfirm(){
ui.showConfirm("$confirm", state.rules.tutorial ? "$quit.confirm.tutorial" : "$quit.confirm", () -> { ui.showConfirm("$confirm", state.rules.tutorial ? "$quit.confirm.tutorial" : "$quit.confirm", () -> {
if(state.rules.tutorial){ if(state.rules.tutorial){
Core.settings.put("tutorial", true); Core.settings.put("playedtutorial", true);
Core.settings.save(); Core.settings.save();
} }
wasClient = Net.client(); wasClient = Net.client();

View File

@@ -141,40 +141,23 @@ public class SettingsMenuDialog extends SettingsDialog{
game.pref(new Setting(){ game.pref(new Setting(){
@Override @Override
public void add(SettingsTable table){ public void add(SettingsTable table){
table.addButton("$settings.cleardata", () -> { table.addButton("$settings.cleardata", () -> ui.showConfirm("$confirm", "$settings.clearall.confirm", () -> {
FloatingDialog dialog = new FloatingDialog("$settings.cleardata"); ObjectMap<String, Object> map = new ObjectMap<>();
dialog.setFillParent(false); for(String value : Core.settings.keys()){
dialog.cont.defaults().size(230f, 60f).pad(3); if(value.contains("usid") || value.contains("uuid")){
dialog.addCloseButton(); map.put(value, Core.settings.getString(value));
dialog.cont.addButton("$settings.clearunlocks", () -> { }
ui.showConfirm("$confirm", "$settings.clear.confirm", () -> { }
data.reset(); Core.settings.clear();
dialog.hide(); Core.settings.putAll(map);
}); Core.settings.save();
});
dialog.cont.row();
dialog.cont.addButton("$settings.clearall", () -> {
ui.showConfirm("$confirm", "$settings.clearall.confirm", () -> {
ObjectMap<String, Object> map = new ObjectMap<>();
for(String value : Core.settings.keys()){
if(value.contains("usid") || value.contains("uuid")){
map.put(value, Core.settings.getString(value));
}
}
Core.settings.clear();
Core.settings.putAll(map);
Core.settings.save();
for(FileHandle file : dataDirectory.list()){ for(FileHandle file : dataDirectory.list()){
file.deleteDirectory(); file.deleteDirectory();
} }
Core.app.exit(); Core.app.exit();
}); })).size(220f, 60f).pad(6).left();
});
dialog.cont.row();
dialog.show();
}).size(220f, 60f).pad(6).left();
table.add(); table.add();
table.row(); table.row();
} }

View File

@@ -105,7 +105,7 @@ public class ZoneInfoDialog extends FloatingDialog{
cont.row(); cont.row();
cont.table(desc -> { cont.table(desc -> {
desc.left().defaults().left().width(Core.graphics.isPortrait() ? 350f : 500f); desc.left().defaults().left().width(Core.graphics.isPortrait() ? 350f : 500f);
desc.pane(t -> t.marginRight(12f).add(zone.description).wrap().growX()).fillX().maxHeight(mobile ? 240f : 400f).pad(2).padBottom(8f).get().setScrollingDisabled(true, false); desc.pane(t -> t.marginRight(12f).add(zone.description).wrap().growX()).fillX().maxHeight(mobile ? 300f : 450f).pad(2).padBottom(8f).get().setScrollingDisabled(true, false);
desc.row(); desc.row();
desc.table(t -> { desc.table(t -> {

View File

@@ -419,7 +419,8 @@ public class HudFragment extends Fragment{
/** Show unlock notification for a new recipe. */ /** Show unlock notification for a new recipe. */
public void showUnlock(UnlockableContent content){ public void showUnlock(UnlockableContent content){
//some content may not have icons... yet //some content may not have icons... yet
if(content.getContentIcon() == null || state.is(State.menu)) return; //also don't play in the tutorial to prevent confusion
if(content.getContentIcon() == null || state.is(State.menu) || state.rules.tutorial) return;
Sounds.message.play(); Sounds.message.play();