mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-21 20:18:06 +07:00
Bugfixes
This commit is contained in:
parent
142e93f3e9
commit
88e1770f2e
BIN
core/assets/sprites/schematic-background.png
Normal file
BIN
core/assets/sprites/schematic-background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
@ -119,10 +119,11 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
|
||||
for(ApplicationListener listener : modules){
|
||||
listener.init();
|
||||
}
|
||||
super.resize(graphics.getWidth(), graphics.getHeight());
|
||||
mods.each(Mod::init);
|
||||
finished = true;
|
||||
Events.fire(new ClientLoadEvent());
|
||||
super.resize(graphics.getWidth(), graphics.getHeight());
|
||||
app.post(() -> app.post(() -> app.post(() -> app.post(() -> super.resize(graphics.getWidth(), graphics.getHeight())))));
|
||||
}
|
||||
}else{
|
||||
super.update();
|
||||
|
@ -1344,7 +1344,8 @@ public class Blocks implements ContentList{
|
||||
Items.pyratite, Bullets.pyraFlame
|
||||
);
|
||||
recoil = 0f;
|
||||
reload = 4f;
|
||||
reload = 5f;
|
||||
coolantMultiplier = 2f;
|
||||
range = 60f;
|
||||
shootCone = 50f;
|
||||
targetAir = false;
|
||||
|
@ -103,12 +103,12 @@ public class Schematics implements Loadable{
|
||||
|
||||
shadowBuffer.endDraw();
|
||||
|
||||
buffer.beginDraw(Color.orange);
|
||||
buffer.beginDraw(Color.clear);
|
||||
|
||||
Draw.proj().setOrtho(0, buffer.getHeight(), buffer.getWidth(), -buffer.getHeight());
|
||||
for(int x = 0; x < schematic.width + padding; x++){
|
||||
for(int y = 0; y < schematic.height + padding; y++){
|
||||
Draw.rect("metal-floor", x * resolution + resolution/2f, y * resolution + resolution/2f, resolution, resolution);
|
||||
//Draw.rect("metal-floor", x * resolution + resolution/2f, y * resolution + resolution/2f, resolution, resolution);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,11 @@
|
||||
package io.anuke.mindustry.ui.dialogs;
|
||||
|
||||
import io.anuke.arc.*;
|
||||
import io.anuke.arc.graphics.*;
|
||||
import io.anuke.arc.graphics.Texture.*;
|
||||
import io.anuke.arc.graphics.g2d.*;
|
||||
import io.anuke.arc.scene.ui.*;
|
||||
import io.anuke.arc.scene.ui.layout.*;
|
||||
import io.anuke.arc.util.*;
|
||||
import io.anuke.mindustry.game.*;
|
||||
import io.anuke.mindustry.game.Schematics.*;
|
||||
@ -17,7 +21,11 @@ public class SchematicsDialog extends FloatingDialog{
|
||||
|
||||
public SchematicsDialog(){
|
||||
super("$schematics");
|
||||
Core.assets.load("sprites/schematic-background.png", Texture.class).loaded = t -> {
|
||||
((Texture)t).setWrap(TextureWrap.Repeat);
|
||||
};
|
||||
|
||||
shouldPause = true;
|
||||
addCloseButton();
|
||||
shown(this::setup);
|
||||
}
|
||||
@ -49,25 +57,34 @@ public class SchematicsDialog extends FloatingDialog{
|
||||
for(Schematic s : schematics.all()){
|
||||
if(!search.isEmpty() && !s.name().contains(search)) continue;
|
||||
|
||||
Button sel = t.addButton(b -> {
|
||||
Texture tex = schematics.getPreview(s, PreviewRes.high);
|
||||
b.add(s.name()).center().color(Color.lightGray).fillY().get().setEllipsis(true);
|
||||
Button[] sel = {null};
|
||||
sel[0] = t.addButton(b -> {
|
||||
b.top();
|
||||
b.margin(4f);
|
||||
b.table(buttons -> {
|
||||
buttons.left();
|
||||
buttons.defaults().size(50f);
|
||||
buttons.addImageButton(Icon.pencilSmall, Styles.clearPartiali, () -> {
|
||||
|
||||
});
|
||||
|
||||
buttons.addImageButton(Icon.trash16Small, Styles.clearPartiali, () -> {
|
||||
|
||||
});
|
||||
|
||||
}).growX().height(50f);
|
||||
b.row();
|
||||
b.add(new BorderImage(tex){
|
||||
@Override
|
||||
public void draw(){
|
||||
//Draw.blend(Blending.disabled);
|
||||
super.draw();
|
||||
//Draw.blend();
|
||||
}
|
||||
}.setScaling(Scaling.fit).setName("border"));
|
||||
b.add(s.name()).center().color(Color.lightGray).top().left().get().setEllipsis(true);
|
||||
b.row();
|
||||
b.add(new SchematicImage(s).setScaling(Scaling.fit).setName("border")).size(200f);
|
||||
}, () -> {
|
||||
if(sel[0].childrenPressed()) return;
|
||||
control.input.useSchematic(s);
|
||||
hide();
|
||||
}).size(200f, 230f).pad(2).style(Styles.clearPartiali).get();
|
||||
}).pad(4).style(Styles.cleari).get();
|
||||
|
||||
BorderImage image = sel.find("border");
|
||||
image.update(() -> image.borderColor = (sel.isOver() ? Pal.accent : Pal.gray));
|
||||
//BorderImage image = sel[0].find("border");
|
||||
//image.update(() -> image.borderColor = (sel[0].isOver() ? Pal.accent : Pal.gray));
|
||||
|
||||
if(++i % 4 == 0){
|
||||
t.row();
|
||||
@ -83,6 +100,35 @@ public class SchematicsDialog extends FloatingDialog{
|
||||
info.show(schematic);
|
||||
}
|
||||
|
||||
public static class SchematicImage extends Image{
|
||||
public float scaling = 16f;
|
||||
public float thickness = 4f;
|
||||
public Color borderColor = Pal.gray;
|
||||
|
||||
public SchematicImage(Schematic s){
|
||||
super(schematics.getPreview(s, PreviewRes.high));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
Texture background = Core.assets.get("sprites/schematic-background.png", Texture.class);
|
||||
TextureRegion region = Draw.wrap(background);
|
||||
float xr = width / scaling;
|
||||
float yr = height / scaling;
|
||||
region.setU2(xr);
|
||||
region.setV2(yr);
|
||||
Draw.rect(region, x + width/2f, y + height/2f, width, height);
|
||||
|
||||
super.draw();
|
||||
|
||||
Draw.color(borderColor);
|
||||
Draw.alpha(parentAlpha);
|
||||
Lines.stroke(Scl.scl(thickness));
|
||||
Lines.rect(x, y, width, height);
|
||||
Draw.reset();
|
||||
}
|
||||
}
|
||||
|
||||
public static class SchematicInfoDialog extends FloatingDialog{
|
||||
|
||||
SchematicInfoDialog(){
|
||||
|
Loading…
Reference in New Issue
Block a user