diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index dc6040ffae..93f2a8fd67 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -2325,7 +2325,8 @@ public class Blocks{ rotateSpeed = -2f; rotation = 45f; }}, - new DrawRegion("-cap") + new DrawRegion("-cap"), + new DrawLiquidRegion() ); }}; @@ -2340,7 +2341,7 @@ public class Blocks{ generateEffect = Fx.generatespark; ambientSoundVolume = 0.03f; - drawer = new DrawMulti(new DrawDefault(), new DrawWarmupRegion()); + drawer = new DrawMulti(new DrawDefault(), new DrawWarmupRegion(), new DrawLiquidRegion()); consumeItem(Items.pyratite); consumeLiquid(Liquids.cryofluid, 0.1f); diff --git a/core/src/mindustry/ui/dialogs/LaunchLoadoutDialog.java b/core/src/mindustry/ui/dialogs/LaunchLoadoutDialog.java index 7969450dcd..28bed19c41 100644 --- a/core/src/mindustry/ui/dialogs/LaunchLoadoutDialog.java +++ b/core/src/mindustry/ui/dialogs/LaunchLoadoutDialog.java @@ -50,8 +50,30 @@ public class LaunchLoadoutDialog extends BaseDialog{ int cap = lastCapacity = (int)(sector.planet.launchCapacityMultiplier * selected.findCore().itemCapacity); //cap resources based on core type + ItemSeq schems = selected.requirements(); ItemSeq resources = universe.getLaunchResources(); resources.min(cap); + + int capacity = lastCapacity; + + if(!sector.planet.allowLaunchLoadout){ + resources.clear(); + //TODO this should be set to a proper loadout based on sector. + if(destination.preset != null){ + var rules = destination.preset.generator.map.rules(); + for(var stack : rules.loadout){ + if(!sector.planet.hiddenItems.contains(stack.item)){ + resources.add(stack.item, stack.amount); + } + } + } + + }else if(getMax()){ + for(Item item : content.items()){ + resources.set(item, Mathf.clamp(sitems.get(item) - schems.get(item), 0, capacity)); + } + } + universe.updateLaunchResources(resources); total.clear(); @@ -66,28 +88,6 @@ public class LaunchLoadoutDialog extends BaseDialog{ ItemSeq schems = selected.requirements(); ItemSeq launches = universe.getLaunchResources(); - int capacity = lastCapacity; - - if(!sector.planet.allowLaunchLoadout){ - launches.clear(); - //TODO this should be set to a proper loadout based on sector. - if(destination.preset != null){ - var rules = destination.preset.generator.map.rules(); - for(var stack : rules.loadout){ - if(!sector.planet.hiddenItems.contains(stack.item)){ - launches.add(stack.item, stack.amount); - } - } - } - - universe.updateLaunchResources(launches); - }else if(getMax()){ - for(Item item : content.items()){ - launches.set(item, Mathf.clamp(sitems.get(item) - launches.get(item), 0, capacity)); - } - - universe.updateLaunchResources(launches); - } for(ItemStack s : total){ int as = schems.get(s.item), al = launches.get(s.item);