This commit is contained in:
Anuken
2019-10-18 19:31:01 -04:00
parent 142e93f3e9
commit 88e1770f2e
5 changed files with 66 additions and 18 deletions
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){ for(ApplicationListener listener : modules){
listener.init(); listener.init();
} }
super.resize(graphics.getWidth(), graphics.getHeight());
mods.each(Mod::init); mods.each(Mod::init);
finished = true; finished = true;
Events.fire(new ClientLoadEvent()); 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{ }else{
super.update(); super.update();
@@ -1344,7 +1344,8 @@ public class Blocks implements ContentList{
Items.pyratite, Bullets.pyraFlame Items.pyratite, Bullets.pyraFlame
); );
recoil = 0f; recoil = 0f;
reload = 4f; reload = 5f;
coolantMultiplier = 2f;
range = 60f; range = 60f;
shootCone = 50f; shootCone = 50f;
targetAir = false; targetAir = false;
@@ -103,12 +103,12 @@ public class Schematics implements Loadable{
shadowBuffer.endDraw(); shadowBuffer.endDraw();
buffer.beginDraw(Color.orange); buffer.beginDraw(Color.clear);
Draw.proj().setOrtho(0, buffer.getHeight(), buffer.getWidth(), -buffer.getHeight()); Draw.proj().setOrtho(0, buffer.getHeight(), buffer.getWidth(), -buffer.getHeight());
for(int x = 0; x < schematic.width + padding; x++){ for(int x = 0; x < schematic.width + padding; x++){
for(int y = 0; y < schematic.height + padding; y++){ 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; package io.anuke.mindustry.ui.dialogs;
import io.anuke.arc.*;
import io.anuke.arc.graphics.*; 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.*;
import io.anuke.arc.scene.ui.layout.*;
import io.anuke.arc.util.*; import io.anuke.arc.util.*;
import io.anuke.mindustry.game.*; import io.anuke.mindustry.game.*;
import io.anuke.mindustry.game.Schematics.*; import io.anuke.mindustry.game.Schematics.*;
@@ -17,7 +21,11 @@ public class SchematicsDialog extends FloatingDialog{
public SchematicsDialog(){ public SchematicsDialog(){
super("$schematics"); super("$schematics");
Core.assets.load("sprites/schematic-background.png", Texture.class).loaded = t -> {
((Texture)t).setWrap(TextureWrap.Repeat);
};
shouldPause = true;
addCloseButton(); addCloseButton();
shown(this::setup); shown(this::setup);
} }
@@ -49,25 +57,34 @@ public class SchematicsDialog extends FloatingDialog{
for(Schematic s : schematics.all()){ for(Schematic s : schematics.all()){
if(!search.isEmpty() && !s.name().contains(search)) continue; if(!search.isEmpty() && !s.name().contains(search)) continue;
Button sel = t.addButton(b -> { Button[] sel = {null};
Texture tex = schematics.getPreview(s, PreviewRes.high); sel[0] = t.addButton(b -> {
b.add(s.name()).center().color(Color.lightGray).fillY().get().setEllipsis(true); 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.row();
b.add(new BorderImage(tex){ b.add(s.name()).center().color(Color.lightGray).top().left().get().setEllipsis(true);
@Override b.row();
public void draw(){ b.add(new SchematicImage(s).setScaling(Scaling.fit).setName("border")).size(200f);
//Draw.blend(Blending.disabled);
super.draw();
//Draw.blend();
}
}.setScaling(Scaling.fit).setName("border"));
}, () -> { }, () -> {
if(sel[0].childrenPressed()) return;
control.input.useSchematic(s); control.input.useSchematic(s);
hide(); hide();
}).size(200f, 230f).pad(2).style(Styles.clearPartiali).get(); }).pad(4).style(Styles.cleari).get();
BorderImage image = sel.find("border"); //BorderImage image = sel[0].find("border");
image.update(() -> image.borderColor = (sel.isOver() ? Pal.accent : Pal.gray)); //image.update(() -> image.borderColor = (sel[0].isOver() ? Pal.accent : Pal.gray));
if(++i % 4 == 0){ if(++i % 4 == 0){
t.row(); t.row();
@@ -83,6 +100,35 @@ public class SchematicsDialog extends FloatingDialog{
info.show(schematic); 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{ public static class SchematicInfoDialog extends FloatingDialog{
SchematicInfoDialog(){ SchematicInfoDialog(){