Fixed #7201
This commit is contained in:
@@ -2325,7 +2325,8 @@ public class Blocks{
|
|||||||
rotateSpeed = -2f;
|
rotateSpeed = -2f;
|
||||||
rotation = 45f;
|
rotation = 45f;
|
||||||
}},
|
}},
|
||||||
new DrawRegion("-cap")
|
new DrawRegion("-cap"),
|
||||||
|
new DrawLiquidRegion()
|
||||||
);
|
);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -2340,7 +2341,7 @@ public class Blocks{
|
|||||||
generateEffect = Fx.generatespark;
|
generateEffect = Fx.generatespark;
|
||||||
ambientSoundVolume = 0.03f;
|
ambientSoundVolume = 0.03f;
|
||||||
|
|
||||||
drawer = new DrawMulti(new DrawDefault(), new DrawWarmupRegion());
|
drawer = new DrawMulti(new DrawDefault(), new DrawWarmupRegion(), new DrawLiquidRegion());
|
||||||
|
|
||||||
consumeItem(Items.pyratite);
|
consumeItem(Items.pyratite);
|
||||||
consumeLiquid(Liquids.cryofluid, 0.1f);
|
consumeLiquid(Liquids.cryofluid, 0.1f);
|
||||||
|
|||||||
@@ -50,8 +50,30 @@ public class LaunchLoadoutDialog extends BaseDialog{
|
|||||||
int cap = lastCapacity = (int)(sector.planet.launchCapacityMultiplier * selected.findCore().itemCapacity);
|
int cap = lastCapacity = (int)(sector.planet.launchCapacityMultiplier * selected.findCore().itemCapacity);
|
||||||
|
|
||||||
//cap resources based on core type
|
//cap resources based on core type
|
||||||
|
ItemSeq schems = selected.requirements();
|
||||||
ItemSeq resources = universe.getLaunchResources();
|
ItemSeq resources = universe.getLaunchResources();
|
||||||
resources.min(cap);
|
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);
|
universe.updateLaunchResources(resources);
|
||||||
|
|
||||||
total.clear();
|
total.clear();
|
||||||
@@ -66,28 +88,6 @@ public class LaunchLoadoutDialog extends BaseDialog{
|
|||||||
|
|
||||||
ItemSeq schems = selected.requirements();
|
ItemSeq schems = selected.requirements();
|
||||||
ItemSeq launches = universe.getLaunchResources();
|
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){
|
for(ItemStack s : total){
|
||||||
int as = schems.get(s.item), al = launches.get(s.item);
|
int as = schems.get(s.item), al = launches.get(s.item);
|
||||||
|
|||||||
Reference in New Issue
Block a user