diff --git a/core/assets-raw/sprites/blocks/distribution/mass-driver.png b/core/assets-raw/sprites/blocks/distribution/mass-driver.png index 79f79274b4..cde1d754f9 100644 Binary files a/core/assets-raw/sprites/blocks/distribution/mass-driver.png and b/core/assets-raw/sprites/blocks/distribution/mass-driver.png differ diff --git a/core/assets-raw/sprites/blocks/extra/shadow-round-3.png b/core/assets-raw/sprites/blocks/extra/shadow-round-3.png index 639b3f0e12..f2b116ff67 100644 Binary files a/core/assets-raw/sprites/blocks/extra/shadow-round-3.png and b/core/assets-raw/sprites/blocks/extra/shadow-round-3.png differ diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 9fbf4323df..e86a6f86fc 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -370,6 +370,7 @@ mode.waves.name=waves mode.waves.description=the normal mode. limited resources and automatic incoming waves. mode.sandbox.name=sandbox 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.freebuild.name=freebuild mode.freebuild.description=limited resources and no timer for waves. diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index 6bb4269a96..33c8a4ae0d 100644 Binary files a/core/assets/sprites/sprites.png and b/core/assets/sprites/sprites.png differ diff --git a/core/src/io/anuke/mindustry/core/Control.java b/core/src/io/anuke/mindustry/core/Control.java index 50965884f8..6111ed6fc4 100644 --- a/core/src/io/anuke/mindustry/core/Control.java +++ b/core/src/io/anuke/mindustry/core/Control.java @@ -13,6 +13,7 @@ import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.game.Content; import io.anuke.mindustry.game.ContentDatabase; import io.anuke.mindustry.game.EventType.*; +import io.anuke.mindustry.game.GameMode; import io.anuke.mindustry.game.Saves; import io.anuke.mindustry.input.DefaultKeybinds; import io.anuke.mindustry.input.DesktopInput; @@ -109,6 +110,12 @@ public class Control extends Module{ } state.set(State.playing); + + if(state.mode == GameMode.sandbox && !Settings.getBool("sandbox-warning", false)){ + threads.runGraphics(() -> ui.showInfo("$mode.sandbox.warning")); + Settings.putBool("sandbox-warning", true); + Settings.save(); + } }); Events.on(WorldLoadGraphicsEvent.class, () -> { diff --git a/core/src/io/anuke/mindustry/core/Logic.java b/core/src/io/anuke/mindustry/core/Logic.java index 9f9af7e9bb..c83d751015 100644 --- a/core/src/io/anuke/mindustry/core/Logic.java +++ b/core/src/io/anuke/mindustry/core/Logic.java @@ -59,7 +59,7 @@ public class Logic extends Module{ tile.entity.items.set(item, 1000); } } - }else{ + }else if(!state.mode.infiniteResources){ tile.entity.items.add(Items.tungsten, 50); tile.entity.items.add(Items.lead, 20); } diff --git a/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java b/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java index 5e1a5c9884..79e18ea09e 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java @@ -227,10 +227,12 @@ public class BlocksFragment extends Fragment{ if(entity == null) return; - for(ItemStack s : r.requirements){ - if(!entity.items.has(s.item, Mathf.ceil(s.amount))){ - istack.setColor(Color.GRAY); - return; + if(!state.mode.infiniteResources){ + for(ItemStack s : r.requirements){ + if(!entity.items.has(s.item, Mathf.ceil(s.amount))){ + istack.setColor(Color.GRAY); + return; + } } } istack.setColor(Color.WHITE); @@ -310,7 +312,7 @@ public class BlocksFragment extends Fragment{ requirements.addImage(stack.item.region).size(8 * 3); Label reqlabel = new Label(() -> { TileEntity core = players[0].getClosestCore(); - if(core == null) return "*/*"; + if(core == null || state.mode.infiniteResources) return "*/*"; int amount = core.items.get(stack.item); String color = (amount < stack.amount / 2f ? "[red]" : amount < stack.amount ? "[orange]" : "[white]"); diff --git a/core/src/io/anuke/mindustry/world/blocks/BuildBlock.java b/core/src/io/anuke/mindustry/world/blocks/BuildBlock.java index a5f9251869..c110d9dbeb 100644 --- a/core/src/io/anuke/mindustry/world/blocks/BuildBlock.java +++ b/core/src/io/anuke/mindustry/world/blocks/BuildBlock.java @@ -208,7 +208,7 @@ public class BuildBlock extends Block{ builderID = builder.getID(); } - if(progress >= 1f || debug){ + if(progress >= 1f || debug || state.mode.infiniteResources){ Call.onConstructFinish(tile, recipe.result, builderID, tile.getRotation(), builder.getTeam()); } } @@ -236,7 +236,7 @@ public class BuildBlock extends Block{ progress = Mathf.clamp(progress - amount); - if(progress <= 0 || debug){ + if(progress <= 0 || debug || state.mode.infiniteResources){ Call.onDeconstructFinish(tile, this.recipe == null ? previous : this.recipe.result); } }