mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-25 05:51:47 -08:00
parent
f1a5aae30a
commit
3d201f7042
5 changed files with 31 additions and 20 deletions
|
|
@ -263,7 +263,9 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||
|
||||
if(player.team().core() == null){
|
||||
player.set(world.width() * tilesize/2f, world.height() * tilesize/2f);
|
||||
player.unit(UnitTypes.alpha.spawn(player.team(), player.x, player.y));
|
||||
var unit = UnitTypes.alpha.spawn(player.team(), player.x, player.y);
|
||||
unit.spawnedByCore = true;
|
||||
player.unit(unit);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -285,30 +285,32 @@ public class MapGenerateDialog extends BaseDialog{
|
|||
|
||||
void showAdd(){
|
||||
BaseDialog selection = new BaseDialog("@add");
|
||||
selection.setFillParent(false);
|
||||
selection.cont.defaults().size(210f, 60f);
|
||||
int i = 0;
|
||||
for(Prov<GenerateFilter> gen : filterTypes){
|
||||
GenerateFilter filter = gen.get();
|
||||
selection.cont.pane(p -> {
|
||||
p.marginRight(14);
|
||||
p.defaults().size(210f, 60f);
|
||||
int i = 0;
|
||||
for(Prov<GenerateFilter> gen : filterTypes){
|
||||
GenerateFilter filter = gen.get();
|
||||
|
||||
if((filter.isPost() && applied)) continue;
|
||||
if((filter.isPost() && applied)) continue;
|
||||
|
||||
selection.cont.button(filter.name(), () -> {
|
||||
filters.add(filter);
|
||||
p.button(filter.name(), () -> {
|
||||
filters.add(filter);
|
||||
rebuildFilters();
|
||||
update();
|
||||
selection.hide();
|
||||
});
|
||||
if(++i % 2 == 0) p.row();
|
||||
}
|
||||
|
||||
p.button("@filter.defaultores", () -> {
|
||||
maps.addDefaultOres(filters);
|
||||
rebuildFilters();
|
||||
update();
|
||||
selection.hide();
|
||||
});
|
||||
if(++i % 2 == 0) selection.cont.row();
|
||||
}
|
||||
|
||||
selection.cont.button("@filter.defaultores", () -> {
|
||||
maps.addDefaultOres(filters);
|
||||
rebuildFilters();
|
||||
update();
|
||||
selection.hide();
|
||||
});
|
||||
|
||||
}).get().setScrollingDisabled(true, false);
|
||||
F
|
||||
selection.addCloseButton();
|
||||
selection.show();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,6 +123,7 @@ public class Universe{
|
|||
}
|
||||
|
||||
/** @return the last selected loadout for this specific core type. */
|
||||
@Nullable
|
||||
public Schematic getLoadout(CoreBlock core){
|
||||
//for tools - schem
|
||||
if(schematics == null) return Loadouts.basicShard;
|
||||
|
|
@ -134,7 +135,7 @@ public class Universe{
|
|||
Seq<Schematic> all = schematics.getLoadouts(core);
|
||||
Schematic schem = all.find(s -> s.file != null && s.file.nameWithoutExtension().equals(file));
|
||||
|
||||
return schem == null ? all.first() : schem;
|
||||
return schem == null ? all.any() ? all.first() : null : schem;
|
||||
}
|
||||
|
||||
/** Runs possible events. Resets event counter. */
|
||||
|
|
|
|||
|
|
@ -299,6 +299,10 @@ public class UnitType extends UnlockableContent{
|
|||
}
|
||||
}
|
||||
|
||||
if(weapons.isEmpty()){
|
||||
range = maxRange = 0f;
|
||||
}
|
||||
|
||||
if(mechStride < 0){
|
||||
mechStride = 4f + (hitSize -8f)/2.1f;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import arc.func.*;
|
|||
import arc.scene.ui.*;
|
||||
import arc.scene.ui.layout.*;
|
||||
import arc.struct.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.ctype.*;
|
||||
import mindustry.game.*;
|
||||
import mindustry.gen.*;
|
||||
|
|
@ -105,6 +106,7 @@ public class LaunchLoadoutDialog extends BaseDialog{
|
|||
int cols = Math.max((int)(Core.graphics.getWidth() / Scl.scl(230)), 1);
|
||||
ButtonGroup<Button> group = new ButtonGroup<>();
|
||||
selected = universe.getLoadout(core);
|
||||
if(selected == null) selected = schematics.getLoadouts().get((CoreBlock)Blocks.coreShard).first();
|
||||
|
||||
cont.add(Core.bundle.format("launch.from", sector.name())).row();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue