Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -2070,6 +2070,7 @@ public class Blocks{
|
||||
consumeLiquid(Liquids.nitrogen, 10f / 60f);
|
||||
|
||||
itemCapacity = 200;
|
||||
researchCost = with(Items.silicon, 2500, Items.surgeAlloy, 20, Items.oxide, 30);
|
||||
}};
|
||||
|
||||
unitCargoUnloadPoint = new UnitCargoUnloadPoint("unit-cargo-unload-point"){{
|
||||
@@ -2078,6 +2079,8 @@ public class Blocks{
|
||||
size = 2;
|
||||
|
||||
itemCapacity = 100;
|
||||
|
||||
researchCost = with(Items.silicon, 3000, Items.oxide, 20);
|
||||
}};
|
||||
|
||||
//endregion
|
||||
|
||||
@@ -118,9 +118,9 @@ public class SpawnGroup implements JsonSerializable, Cloneable{
|
||||
if(unitAmount != 1) json.writeValue("amount", unitAmount);
|
||||
if(effect != null) json.writeValue("effect", effect.name);
|
||||
if(spawn != -1) json.writeValue("spawn", spawn);
|
||||
if(payloads != null && payloads.size > 0){
|
||||
json.writeValue("payloads", payloads.map(u -> u.name).toArray(String.class));
|
||||
}
|
||||
if(payloads != null && payloads.size > 0) json.writeValue("payloads", payloads.map(u -> u.name).toArray(String.class));
|
||||
if(items != null && items.amount > 0) json.writeValue("items", items);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -138,9 +138,9 @@ public class SpawnGroup implements JsonSerializable, Cloneable{
|
||||
shieldScaling = data.getFloat("shieldScaling", 0);
|
||||
unitAmount = data.getInt("amount", 1);
|
||||
spawn = data.getInt("spawn", -1);
|
||||
if(data.has("payloads")){
|
||||
payloads = Seq.with(json.readValue(String[].class, data.get("payloads"))).map(s -> content.getByName(ContentType.unit, s));
|
||||
}
|
||||
if(data.has("payloads")) payloads = Seq.with(json.readValue(String[].class, data.get("payloads"))).map(s -> content.getByName(ContentType.unit, s));
|
||||
if(data.has("items")) items = json.readValue(ItemStack.class, data.get("items"));
|
||||
|
||||
|
||||
//old boss effect ID
|
||||
if(data.has("effect") && data.get("effect").isNumber() && data.getInt("effect", -1) == 8){
|
||||
|
||||
@@ -9,12 +9,14 @@ import static mindustry.maps.filters.FilterOption.*;
|
||||
public class ClearFilter extends GenerateFilter{
|
||||
public Block target = Blocks.stone;
|
||||
public Block replace = Blocks.air;
|
||||
public Block ignore = Blocks.air;
|
||||
|
||||
@Override
|
||||
public FilterOption[] options(){
|
||||
return new FilterOption[]{
|
||||
new BlockOption("target", () -> target, b -> target = b, anyOptional),
|
||||
new BlockOption("replacement", () -> replace, b -> replace = b, anyOptional)
|
||||
new BlockOption("replacement", () -> replace, b -> replace = b, anyOptional),
|
||||
new BlockOption("ignore", () -> ignore, b -> ignore = b, anyOptional)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -25,6 +27,7 @@ public class ClearFilter extends GenerateFilter{
|
||||
|
||||
@Override
|
||||
public void apply(GenerateInput in){
|
||||
if(ignore != Blocks.air && (in.block == ignore || in.floor == ignore || in.overlay == ignore)) return;
|
||||
|
||||
if(in.block == target || in.floor == target || (target.isOverlay() && in.overlay == target)){
|
||||
//special case: when air is the result, replace only the overlay or wall
|
||||
|
||||
@@ -3,6 +3,7 @@ package mindustry.maps.filters;
|
||||
|
||||
import arc.*;
|
||||
import arc.func.*;
|
||||
import arc.input.*;
|
||||
import arc.scene.*;
|
||||
import arc.scene.event.*;
|
||||
import arc.scene.style.*;
|
||||
@@ -103,7 +104,7 @@ public abstract class FilterOption{
|
||||
|
||||
@Override
|
||||
public void build(Table table){
|
||||
table.button(b -> b.image(supplier.get().uiIcon).update(i -> ((TextureRegionDrawable)i.getDrawable())
|
||||
Button button = table.button(b -> b.image(supplier.get().uiIcon).update(i -> ((TextureRegionDrawable)i.getDrawable())
|
||||
.setRegion(supplier.get() == Blocks.air ? Icon.none.getRegion() : supplier.get().uiIcon)).size(iconSmall), () -> {
|
||||
BaseDialog dialog = new BaseDialog("@filter.option." + name);
|
||||
dialog.cont.pane(t -> {
|
||||
@@ -124,7 +125,19 @@ public abstract class FilterOption{
|
||||
|
||||
dialog.addCloseButton();
|
||||
dialog.show();
|
||||
}).pad(4).margin(12f);
|
||||
}).pad(4).margin(12f).get();
|
||||
|
||||
button.clicked(KeyCode.mouseMiddle, () -> {
|
||||
Core.app.setClipboardText(supplier.get().name);
|
||||
ui.showInfoFade("@copied");
|
||||
});
|
||||
|
||||
button.clicked(KeyCode.mouseRight, () -> {
|
||||
if(content.block(Core.app.getClipboardText()) != null && filter.get(content.block(Core.app.getClipboardText()))){
|
||||
consumer.get(content.block(Core.app.getClipboardText()));
|
||||
changed.run();
|
||||
}
|
||||
});
|
||||
|
||||
table.add("@filter.option." + name);
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ public class DiscordDialog extends Dialog{
|
||||
buttons.button("@back", Icon.left, this::hide);
|
||||
buttons.button("@copylink", Icon.copy, () -> {
|
||||
Core.app.setClipboardText(discordURL);
|
||||
ui.showInfoFade("@copied");
|
||||
});
|
||||
buttons.button("@openlink", Icon.discord, () -> {
|
||||
if(!Core.app.openURI(discordURL)){
|
||||
|
||||
@@ -24,7 +24,7 @@ import static mindustry.Vars.*;
|
||||
public class LoadDialog extends BaseDialog{
|
||||
Table slots;
|
||||
String searchString;
|
||||
Gamemode filteredMode;
|
||||
Seq<Gamemode> filteredModes;
|
||||
TextField searchField;
|
||||
ScrollPane pane;
|
||||
|
||||
@@ -50,6 +50,7 @@ public class LoadDialog extends BaseDialog{
|
||||
cont.clear();
|
||||
|
||||
slots = new Table();
|
||||
filteredModes = new Seq<>();
|
||||
pane = new ScrollPane(slots);
|
||||
|
||||
rebuild();
|
||||
@@ -66,9 +67,9 @@ public class LoadDialog extends BaseDialog{
|
||||
boolean sandbox = mode == Gamemode.sandbox;
|
||||
if(Core.atlas.isFound(icon.getRegion()) || sandbox){
|
||||
search.button(sandbox ? Icon.terrain : icon, Styles.emptyTogglei, () -> {
|
||||
filteredMode = filteredMode == mode ? null : mode;
|
||||
if(!filteredModes.addUnique(mode)) filteredModes.remove(mode);
|
||||
rebuild();
|
||||
}).size(60f).checked(b -> filteredMode == mode).tooltip("@mode." + mode.name() + ".name");
|
||||
}).size(60f).padLeft(-8f).checked(b -> !filteredModes.contains(mode)).tooltip("@mode." + mode.name() + ".name");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +98,7 @@ public class LoadDialog extends BaseDialog{
|
||||
for(SaveSlot slot : array){
|
||||
if(slot.isHidden()
|
||||
|| (searchString != null && !Strings.stripColors(slot.getName()).toLowerCase().contains(searchString))
|
||||
|| (filteredMode != null && filteredMode != slot.mode())){
|
||||
|| (!filteredModes.isEmpty() && filteredModes.contains(slot.mode()))){
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ public class MapsDialog extends BaseDialog{
|
||||
rebuildMaps();
|
||||
}).maxTextLength(50).growX().get();
|
||||
searchField.setMessageText("@editor.search");
|
||||
search.button(Icon.filter, Styles.emptyi, this::showMapFilters);
|
||||
search.button(Icon.filter, Styles.emptyi, this::showMapFilters).tooltip("@editor.filters");
|
||||
|
||||
cont.add(search).growX();
|
||||
cont.row();
|
||||
|
||||
Reference in New Issue
Block a user