Cleaned up weather class
This commit is contained in:
@@ -10,6 +10,12 @@ public class Weathers implements ContentList{
|
||||
|
||||
@Override
|
||||
public void load(){
|
||||
snow = new Weather("snow"){
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
//TODO
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,11 @@ import static mindustry.Vars.*;
|
||||
public class Logic implements ApplicationListener{
|
||||
|
||||
public Logic(){
|
||||
Events.on(WorldLoadEvent.class, event -> {
|
||||
//TODO remove later
|
||||
Weathers.snow.create();
|
||||
});
|
||||
|
||||
Events.on(WaveEvent.class, event -> {
|
||||
if(state.isCampaign()){
|
||||
//TODO implement
|
||||
|
||||
@@ -39,7 +39,7 @@ public class Renderer implements ApplicationListener{
|
||||
camera = new Camera();
|
||||
Shaders.init();
|
||||
|
||||
fx.addEffect(new SnowFilter());
|
||||
//fx.addEffect(new SnowFilter());
|
||||
}
|
||||
|
||||
public void shake(float intensity, float duration){
|
||||
@@ -253,6 +253,8 @@ public class Renderer implements ApplicationListener{
|
||||
|
||||
overlays.drawTop();
|
||||
|
||||
Groups.drawWeather();
|
||||
|
||||
endFx();
|
||||
|
||||
if(!pixelator.enabled()){
|
||||
|
||||
@@ -1,28 +1,59 @@
|
||||
package mindustry.type;
|
||||
|
||||
import arc.func.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.ctype.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
public abstract class Weather extends MappableContent{
|
||||
protected float duration = 100f;
|
||||
protected Prov<Weatherc> type = WeatherEntity::create;
|
||||
|
||||
public Weather(String name, Prov<Weatherc> type){
|
||||
super(name);
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Weather(String name){
|
||||
super(name);
|
||||
}
|
||||
|
||||
public abstract void update();
|
||||
public void create(){
|
||||
Weatherc entity = type.get();
|
||||
entity.init(this);
|
||||
entity.add();
|
||||
}
|
||||
|
||||
public abstract void draw();
|
||||
public void update(){
|
||||
|
||||
}
|
||||
|
||||
public void draw(){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContentType getContentType(){
|
||||
return ContentType.weather;
|
||||
}
|
||||
|
||||
//TODO implement
|
||||
|
||||
@EntityDef(value = {Weatherc.class}, pooled = true, isFinal = false)
|
||||
@Component
|
||||
class WeatherComp{
|
||||
abstract class WeatherComp implements Posc, DrawLayerWeatherc{
|
||||
Weather weather;
|
||||
|
||||
void init(Weather weather){
|
||||
this.weather = weather;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawWeather(){
|
||||
weather.draw();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float clipSize(){
|
||||
return Float.MAX_VALUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user