diff --git a/core/assets/sprites/sprites2.png b/core/assets/sprites/sprites2.png index 66ac6cce08..7be472cf93 100644 Binary files a/core/assets/sprites/sprites2.png and b/core/assets/sprites/sprites2.png differ diff --git a/core/assets/sprites/sprites3.png b/core/assets/sprites/sprites3.png index b1a0cd1f0e..d5d3c40bdd 100644 Binary files a/core/assets/sprites/sprites3.png and b/core/assets/sprites/sprites3.png differ diff --git a/core/assets/sprites/sprites4.png b/core/assets/sprites/sprites4.png index 6b7d503d25..f25608e718 100644 Binary files a/core/assets/sprites/sprites4.png and b/core/assets/sprites/sprites4.png differ diff --git a/core/src/mindustry/game/Gamemode.java b/core/src/mindustry/game/Gamemode.java index 3679ba0ad2..e2e38929b9 100644 --- a/core/src/mindustry/game/Gamemode.java +++ b/core/src/mindustry/game/Gamemode.java @@ -68,20 +68,6 @@ public enum Gamemode{ this.validator = validator; } - public static Gamemode bestFit(Rules rules){ - if(rules.pvp){ - return pvp; - }else if(rules.editor){ - return editor; - }else if(rules.attackMode){ - return attack; - }else if(rules.infiniteResources){ - return sandbox; - }else{ - return survival; - } - } - /** Applies this preset to this ruleset. */ public Rules apply(Rules in){ rules.get(in); diff --git a/core/src/mindustry/game/Rules.java b/core/src/mindustry/game/Rules.java index 1a6cf6bc18..e1625f3c80 100644 --- a/core/src/mindustry/game/Rules.java +++ b/core/src/mindustry/game/Rules.java @@ -61,7 +61,7 @@ public class Rules{ public float launchWaveMultiplier = 2f; /** Sector for saves that have them.*/ public @Nullable Sector sector; - /** Region that save is on. Indicates campaign. */ + /** Region that save is on. Indicates campaign. TODO not implemented. */ public @Nullable MapRegion region; /** Spawn layout. */ public Array spawns = new Array<>(); @@ -107,6 +107,16 @@ public class Rules{ /** Returns the gamemode that best fits these rules.*/ public Gamemode mode(){ - return Gamemode.bestFit(this); + if(pvp){ + return Gamemode.pvp; + }else if(editor){ + return Gamemode.editor; + }else if(attackMode){ + return Gamemode.attack; + }else if(infiniteResources){ + return Gamemode.sandbox; + }else{ + return Gamemode.survival; + } } } diff --git a/core/src/mindustry/game/Saves.java b/core/src/mindustry/game/Saves.java index d5f40563f9..19d673f3e7 100644 --- a/core/src/mindustry/game/Saves.java +++ b/core/src/mindustry/game/Saves.java @@ -291,7 +291,7 @@ public class Saves{ } public Gamemode mode(){ - return Gamemode.bestFit(meta.rules); + return meta.rules.mode(); } public int getBuild(){ diff --git a/core/src/mindustry/net/NetworkIO.java b/core/src/mindustry/net/NetworkIO.java index 55cc6fc364..84c5ee5ed6 100644 --- a/core/src/mindustry/net/NetworkIO.java +++ b/core/src/mindustry/net/NetworkIO.java @@ -77,7 +77,7 @@ public class NetworkIO{ buffer.putInt(Version.build); writeString(buffer, Version.type); - buffer.put((byte)Gamemode.bestFit(state.rules).ordinal()); + buffer.put((byte)state.rules.mode().ordinal()); buffer.putInt(netServer.admins.getPlayerLimit()); writeString(buffer, description, 100); diff --git a/core/src/mindustry/ui/dialogs/PlanetDialog.java b/core/src/mindustry/ui/dialogs/PlanetDialog.java index fead7db567..e0fc058dde 100644 --- a/core/src/mindustry/ui/dialogs/PlanetDialog.java +++ b/core/src/mindustry/ui/dialogs/PlanetDialog.java @@ -289,7 +289,6 @@ public class PlanetDialog extends FloatingDialog{ if(selected != null){ drawSelection(selected); drawBorders(selected, borderColor); - } batch.flush(Gl.triangles); diff --git a/core/src/mindustry/world/blocks/environment/ShallowLiquid.java b/core/src/mindustry/world/blocks/environment/ShallowLiquid.java index 5b9781d225..4c9c4c4636 100644 --- a/core/src/mindustry/world/blocks/environment/ShallowLiquid.java +++ b/core/src/mindustry/world/blocks/environment/ShallowLiquid.java @@ -5,6 +5,7 @@ import mindustry.world.*; //do not use in mods! public class ShallowLiquid extends Floor{ public final Floor liquidBase, floorBase; + public float liquidOpacity = 0.35f; public ShallowLiquid(String name, Block liquid, Block floor){ super(name); @@ -13,9 +14,9 @@ public class ShallowLiquid extends Floor{ this.floorBase = floor.asFloor(); isLiquid = true; - variants = floor.asFloor().variants; - status = liquid.asFloor().status; - liquidDrop = liquid.asFloor().liquidDrop; - cacheLayer = liquid.asFloor().cacheLayer; + variants = floorBase.variants; + status = liquidBase.status; + liquidDrop = liquidBase.liquidDrop; + cacheLayer = liquidBase.cacheLayer; } } diff --git a/desktop/src/mindustry/desktop/steam/SNet.java b/desktop/src/mindustry/desktop/steam/SNet.java index 82e55d246a..1b3170280c 100644 --- a/desktop/src/mindustry/desktop/steam/SNet.java +++ b/desktop/src/mindustry/desktop/steam/SNet.java @@ -348,7 +348,7 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback, smat.setLobbyData(steamID, "version", Version.build + ""); smat.setLobbyData(steamID, "versionType", Version.type); smat.setLobbyData(steamID, "wave", state.wave + ""); - smat.setLobbyData(steamID, "gamemode", Gamemode.bestFit(state.rules).name() + ""); + smat.setLobbyData(steamID, "gamemode", state.rules.mode().name() + ""); } } diff --git a/tools/src/mindustry/tools/Generators.java b/tools/src/mindustry/tools/Generators.java index 8a35e73f33..b047bff5c7 100644 --- a/tools/src/mindustry/tools/Generators.java +++ b/tools/src/mindustry/tools/Generators.java @@ -180,7 +180,7 @@ public class Generators{ res.draw(ImagePacker.get(region)); for(int x = 0; x < res.width; x++){ for(int y = 0; y < res.height; y++){ - Color color = overlay.getColor(x, y).a(0.3f); + Color color = overlay.getColor(x, y).a(floor.liquidOpacity); res.draw(x, y, color); } }