Removed Rules#tutorial
This commit is contained in:
@@ -465,7 +465,8 @@ public class TechTree implements ContentList{
|
||||
//TODO change positions?
|
||||
node(impact0078, Seq.with(
|
||||
new SectorComplete(tarFields),
|
||||
new Research(Items.thorium)
|
||||
new Research(Items.thorium),
|
||||
new Research(coreFoundation)
|
||||
), () -> {
|
||||
node(desolateRift, Seq.with(
|
||||
new SectorComplete(impact0078),
|
||||
|
||||
@@ -995,6 +995,7 @@ public class UnitTypes implements ContentList{
|
||||
shots = 2;
|
||||
inaccuracy = 5f;
|
||||
velocityRnd = 0.2f;
|
||||
shootSound = Sounds.missile;
|
||||
|
||||
bullet = new MissileBulletType(3f, 12){{
|
||||
width = 8f;
|
||||
@@ -1055,7 +1056,7 @@ public class UnitTypes implements ContentList{
|
||||
ejectEffect = Fx.casing1;
|
||||
rotateSpeed = 8f;
|
||||
bullet = missiles;
|
||||
shootSound = Sounds.shoot;
|
||||
shootSound = Sounds.missile;
|
||||
rotate = true;
|
||||
occlusion = 6f;
|
||||
}},
|
||||
@@ -1066,7 +1067,7 @@ public class UnitTypes implements ContentList{
|
||||
rotateSpeed = 8f;
|
||||
ejectEffect = Fx.casing1;
|
||||
bullet = missiles;
|
||||
shootSound = Sounds.shoot;
|
||||
shootSound = Sounds.missile;
|
||||
rotate = true;
|
||||
occlusion = 6f;
|
||||
}},
|
||||
@@ -1147,7 +1148,7 @@ public class UnitTypes implements ContentList{
|
||||
y = 27f;
|
||||
rotateSpeed = 2f;
|
||||
reload = 9f;
|
||||
shootSound = Sounds.flame;
|
||||
shootSound = Sounds.shoot;
|
||||
occlusion = 7f;
|
||||
rotate = true;
|
||||
recoil = 0.5f;
|
||||
|
||||
@@ -164,7 +164,7 @@ public class Control implements ApplicationListener, Loadable{
|
||||
if(state.isCampaign() && !net.client() && !headless){
|
||||
|
||||
//save gameover sate immediately
|
||||
if(saves.getCurrent() != null && !state.rules.tutorial){
|
||||
if(saves.getCurrent() != null){
|
||||
saves.getCurrent().save();
|
||||
}
|
||||
}
|
||||
@@ -479,10 +479,6 @@ public class Control implements ApplicationListener, Loadable{
|
||||
if(state.isGame()){
|
||||
input.update();
|
||||
|
||||
if(state.rules.tutorial){
|
||||
tutorial.update();
|
||||
}
|
||||
|
||||
//auto-update rpc every 5 seconds
|
||||
if(timer.get(0, 60 * 5)){
|
||||
platform.updateRPC();
|
||||
|
||||
@@ -140,12 +140,6 @@ public class UI implements ApplicationListener, Loadable{
|
||||
}
|
||||
}
|
||||
|
||||
//draw overlay for buttons
|
||||
if(state.rules.tutorial){
|
||||
control.tutorial.draw();
|
||||
Draw.flush();
|
||||
}
|
||||
|
||||
Events.fire(Trigger.uiDrawEnd);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,8 +32,6 @@ public class Rules{
|
||||
public boolean attackMode = false;
|
||||
/** Whether this is the editor gamemode. */
|
||||
public boolean editor = false;
|
||||
/** Whether the tutorial is enabled. False by default. */
|
||||
public boolean tutorial = false;
|
||||
/** Whether a gameover can happen at all. Set this to false to implement custom gameover conditions. */
|
||||
public boolean canGameOver = true;
|
||||
/** Whether reactors can explode and damage other blocks. */
|
||||
|
||||
@@ -85,7 +85,7 @@ public class Saves{
|
||||
lastTimestamp = Time.millis();
|
||||
}
|
||||
|
||||
if(state.isGame() && !state.gameOver && current != null && current.isAutosave() && !state.rules.tutorial){
|
||||
if(state.isGame() && !state.gameOver && current != null && current.isAutosave()){
|
||||
time += Time.delta;
|
||||
if(time > Core.settings.getInt("saveinterval") * 60){
|
||||
saving = true;
|
||||
|
||||
@@ -35,7 +35,6 @@ public class PausedDialog extends BaseDialog{
|
||||
cont.button("@back", Icon.left, this::hide).name("back");
|
||||
cont.button("@settings", Icon.settings, ui.settings::show).name("settings");
|
||||
|
||||
if(!state.rules.tutorial){
|
||||
if(!state.isCampaign() && !state.isEditor()){
|
||||
cont.row();
|
||||
cont.button("@savegame", Icon.save, save::show);
|
||||
@@ -55,7 +54,6 @@ public class PausedDialog extends BaseDialog{
|
||||
}
|
||||
}
|
||||
}).disabled(b -> !((steam && net.server()) || !net.active())).colspan(2).width(dw * 2 + 20f).update(e -> e.setText(net.server() && steam ? "@invitefriends" : "@hostserver"));
|
||||
}
|
||||
|
||||
cont.row();
|
||||
|
||||
@@ -95,10 +93,7 @@ public class PausedDialog extends BaseDialog{
|
||||
}
|
||||
|
||||
void showQuitConfirm(){
|
||||
ui.showConfirm("@confirm", state.rules.tutorial ? "@quit.confirm.tutorial" : "@quit.confirm", () -> {
|
||||
if(state.rules.tutorial){
|
||||
Core.settings.put("playedtutorial", true);
|
||||
}
|
||||
ui.showConfirm("@confirm", "@quit.confirm", () -> {
|
||||
wasClient = net.client();
|
||||
if(net.client()) netClient.disconnectQuietly();
|
||||
runExitSave();
|
||||
@@ -112,7 +107,7 @@ public class PausedDialog extends BaseDialog{
|
||||
return;
|
||||
}
|
||||
|
||||
if(control.saves.getCurrent() == null || !control.saves.getCurrent().isAutosave() || state.rules.tutorial || wasClient){
|
||||
if(control.saves.getCurrent() == null || !control.saves.getCurrent().isAutosave() || wasClient){
|
||||
logic.reset();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -96,13 +96,13 @@ public class HudFragment extends Fragment{
|
||||
//minimap + position
|
||||
parent.fill(t -> {
|
||||
t.name = "minimap/position";
|
||||
t.visible(() -> Core.settings.getBool("minimap") && !state.rules.tutorial && shown);
|
||||
t.visible(() -> Core.settings.getBool("minimap") && shown);
|
||||
//minimap
|
||||
t.add(new Minimap()).name("minimap");
|
||||
t.row();
|
||||
//position
|
||||
t.label(() -> player.tileX() + "," + player.tileY())
|
||||
.visible(() -> Core.settings.getBool("position") && !state.rules.tutorial)
|
||||
.visible(() -> Core.settings.getBool("position"))
|
||||
.touchable(Touchable.disabled)
|
||||
.name("position");
|
||||
t.top().right();
|
||||
@@ -319,12 +319,12 @@ public class HudFragment extends Fragment{
|
||||
.update(label -> label.color.set(Color.orange).lerp(Color.scarlet, Mathf.absin(Time.time(), 2f, 1f)))).touchable(Touchable.disabled);
|
||||
});
|
||||
|
||||
//tutorial text
|
||||
//TODO tutorial text
|
||||
parent.fill(t -> {
|
||||
t.name = "tutorial";
|
||||
Runnable resize = () -> {
|
||||
t.clearChildren();
|
||||
t.top().right().visible(() -> state.rules.tutorial);
|
||||
t.top().right().visible(() -> false);
|
||||
t.stack(new Button(){{
|
||||
marginLeft(48f);
|
||||
labelWrap(() -> control.tutorial.stage.text() + (control.tutorial.canNext() ? "\n\n" + Core.bundle.get("tutorial.next") : "")).width(!Core.graphics.isPortrait() ? 400f : 160f).pad(2f);
|
||||
@@ -465,7 +465,7 @@ public class HudFragment extends Fragment{
|
||||
public void showUnlock(UnlockableContent content){
|
||||
//some content may not have icons... yet
|
||||
//also don't play in the tutorial to prevent confusion
|
||||
if(state.isMenu() || state.rules.tutorial) return;
|
||||
if(state.isMenu()) return;
|
||||
|
||||
Sounds.message.play();
|
||||
|
||||
@@ -788,7 +788,7 @@ public class HudFragment extends Fragment{
|
||||
}
|
||||
|
||||
private boolean canSkipWave(){
|
||||
return state.rules.waves && ((net.server() || player.admin) || !net.active()) && state.enemies == 0 && !spawner.isSpawning() && !state.rules.tutorial;
|
||||
return state.rules.waves && ((net.server() || player.admin) || !net.active()) && state.enemies == 0 && !spawner.isSpawning();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -139,11 +139,6 @@ public class ItemTurret extends Turret{
|
||||
|
||||
//must not be found
|
||||
ammo.add(new ItemEntry(item, (int)type.ammoMultiplier));
|
||||
|
||||
//fire events for the tutorial
|
||||
if(state.rules.tutorial){
|
||||
Events.fire(new TurretAmmoDeliverEvent());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -366,10 +366,6 @@ public class CoreBlock extends StorageBlock{
|
||||
}else{
|
||||
super.handleItem(source, item);
|
||||
}
|
||||
|
||||
if(state.rules.tutorial){
|
||||
Events.fire(new CoreItemDeliverEvent());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user