mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-05 07:47:48 +07:00
Added schematics dialog to desktop menu
This commit is contained in:
@ -27,7 +27,7 @@ allprojects{
|
||||
appName = 'Mindustry'
|
||||
gdxVersion = '1.9.10'
|
||||
roboVMVersion = '2.3.8-SNAPSHOT'
|
||||
steamworksVersion = 'ffa83e14c90be0c1977fc75b167bb8d6f3f94057'
|
||||
steamworksVersion = '1e1bd5c7c042f8eb0c23a6daaa373d562f82539a'
|
||||
arcHash = null
|
||||
|
||||
debugged = {
|
||||
|
@ -254,7 +254,7 @@ public class DesktopInput extends InputHandler{
|
||||
table.row();
|
||||
table.left().margin(0f).defaults().size(48f).left();
|
||||
|
||||
table.addImageButton(Icon.wikiSmall, Styles.clearPartiali, () -> {
|
||||
table.addImageButton(Icon.pasteSmall, Styles.clearPartiali, () -> {
|
||||
ui.schematics.show();
|
||||
});
|
||||
}
|
||||
|
@ -205,7 +205,7 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
boolean arrow = block != null && block.rotate;
|
||||
|
||||
i.getImage().setRotationOrigin(!arrow ? 0 : rotation * 90, Align.center);
|
||||
i.getStyle().imageUp = arrow ? Icon.arrowSmall : Icon.wikiSmall;
|
||||
i.getStyle().imageUp = arrow ? Icon.arrowSmall : Icon.pasteSmall;
|
||||
i.setChecked(!arrow && schematicMode);
|
||||
});
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class Placement{
|
||||
private static float tileHeuristic(Tile tile, Tile other){
|
||||
Block block = control.input.block;
|
||||
|
||||
if(!other.block().alwaysReplace && !(block != null && block.canReplace(other.block()))){
|
||||
if((!other.block().alwaysReplace && !(block != null && block.canReplace(other.block()))) || other.floor().isDeep()){
|
||||
return 20;
|
||||
}else{
|
||||
if(parents.containsKey(tile.pos())){
|
||||
|
@ -11,12 +11,12 @@ import io.anuke.arc.scene.ui.ImageButton.*;
|
||||
import io.anuke.arc.scene.ui.TextButton.*;
|
||||
import io.anuke.arc.scene.ui.layout.*;
|
||||
import io.anuke.arc.util.*;
|
||||
import io.anuke.mindustry.core.GameState.*;
|
||||
import io.anuke.mindustry.game.*;
|
||||
import io.anuke.mindustry.gen.*;
|
||||
import io.anuke.mindustry.graphics.*;
|
||||
import io.anuke.mindustry.type.*;
|
||||
import io.anuke.mindustry.ui.*;
|
||||
import io.anuke.mindustry.ui.Cicon;
|
||||
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
@ -118,8 +118,12 @@ public class SchematicsDialog extends FloatingDialog{
|
||||
})).size(200f);
|
||||
}, () -> {
|
||||
if(sel[0].childrenPressed()) return;
|
||||
control.input.useSchematic(s);
|
||||
hide();
|
||||
if(state.is(State.menu)){
|
||||
showInfo(s);
|
||||
}else{
|
||||
control.input.useSchematic(s);
|
||||
hide();
|
||||
}
|
||||
}).pad(4).style(Styles.cleari).get();
|
||||
|
||||
sel[0].getStyle().up = Tex.pane;
|
||||
|
@ -68,7 +68,7 @@ public class HudFragment extends Fragment{
|
||||
select.addImageButton(Icon.menuLargeSmall, style, ui.paused::show);
|
||||
flip = select.addImageButton(Icon.arrowUpSmall, style, this::toggleMenus).get();
|
||||
|
||||
select.addImageButton(Icon.wikiSmall, style, () -> {
|
||||
select.addImageButton(Icon.pasteSmall, style, () -> {
|
||||
ui.schematics.show();
|
||||
});
|
||||
|
||||
|
@ -164,6 +164,7 @@ public class MenuFragment extends Fragment{
|
||||
),
|
||||
new Buttoni("$editor", Icon.editorSmall, ui.maps::show), steam ? new Buttoni("$workshop", Icon.saveSmall, platform::openWorkshop) : null,
|
||||
new Buttoni(Core.bundle.get("mods") + "\n" + Core.bundle.get("mods.alpha"), Icon.wikiSmall, ui.mods::show),
|
||||
new Buttoni("$schematics", Icon.pasteSmall, ui.schematics::show),
|
||||
new Buttoni("$settings", Icon.toolsSmall, ui.settings::show),
|
||||
new Buttoni("$about.button", Icon.infoSmall, ui.about::show),
|
||||
new Buttoni("$quit", Icon.exitSmall, Core.app::exit)
|
||||
|
Reference in New Issue
Block a user