Made blocks no longer unlock in custom games

This commit is contained in:
Anuken 2018-09-11 16:27:45 -04:00
parent 5dcacdeea1
commit 67cfa5d42f
4 changed files with 5 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 624 B

After

Width:  |  Height:  |  Size: 619 B

View File

@ -398,7 +398,7 @@ mode.waves.name=waves
mode.waves.description=the normal mode. limited resources and automatic incoming waves. mode.waves.description=the normal mode. limited resources and automatic incoming waves.
mode.sandbox.name=sandbox mode.sandbox.name=sandbox
mode.sandbox.description=infinite resources and no timer for waves. mode.sandbox.description=infinite resources and no timer for waves.
mode.sandbox.warning=Note that blocks cannot be used in sandbox mode until they are unlocked in other modes.\n\n[LIGHT_GRAY]If you have not unlocked any blocks, none will appear. mode.custom.warning=Note that blocks cannot be used in custom games until they are unlocked in sectors.\n\n[LIGHT_GRAY]If you have not unlocked any blocks, none will appear.
mode.freebuild.name=freebuild mode.freebuild.name=freebuild
mode.freebuild.description=limited resources and no timer for waves. mode.freebuild.description=limited resources and no timer for waves.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 99 KiB

View File

@ -13,7 +13,6 @@ import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.game.Content; import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.game.ContentDatabase; import io.anuke.mindustry.game.ContentDatabase;
import io.anuke.mindustry.game.EventType.*; import io.anuke.mindustry.game.EventType.*;
import io.anuke.mindustry.game.GameMode;
import io.anuke.mindustry.game.Saves; import io.anuke.mindustry.game.Saves;
import io.anuke.mindustry.input.DefaultKeybinds; import io.anuke.mindustry.input.DefaultKeybinds;
import io.anuke.mindustry.input.DesktopInput; import io.anuke.mindustry.input.DesktopInput;
@ -110,9 +109,9 @@ public class Control extends Module{
state.set(State.playing); state.set(State.playing);
if(state.mode == GameMode.sandbox && !Settings.getBool("sandbox-warning", false)){ if(world.getSector() == null && !Settings.getBool("custom-warning", false)){
threads.runGraphics(() -> ui.showInfo("$mode.sandbox.warning")); threads.runGraphics(() -> ui.showInfo("$mode.custom.warning"));
Settings.putBool("sandbox-warning", true); Settings.putBool("custom-warning", true);
Settings.save(); Settings.save();
} }
}); });
@ -388,7 +387,7 @@ public class Control extends Module{
} }
//check unlocks every 2 seconds //check unlocks every 2 seconds
if(!state.mode.infiniteResources && Timers.get("timerCheckUnlock", 120)){ if(world.getSector() != null && Timers.get("timerCheckUnlock", 120)){
checkUnlockableBlocks(); checkUnlockableBlocks();
//save if the db changed //save if the db changed