mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-30 22:49:06 +07:00
Fixed mobile menu shader / Added 'old save' message for sectors
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
#ifdef GL_ES
|
||||
precision mediump float;
|
||||
precision mediump int;
|
||||
precision highp float;
|
||||
precision highp int;
|
||||
#endif
|
||||
|
||||
uniform sampler2D u_texture;
|
||||
@ -8,12 +8,13 @@ uniform vec2 u_resolution;
|
||||
uniform float u_time;
|
||||
uniform vec2 u_uv;
|
||||
uniform vec2 u_uv2;
|
||||
uniform float u_scl;
|
||||
|
||||
varying vec4 v_color;
|
||||
varying vec2 v_texCoord;
|
||||
|
||||
void main() {
|
||||
vec2 coords = ((v_texCoord.xy - u_uv) / (u_uv2 - u_uv) - vec2(0.5, 0.5)) * u_resolution;
|
||||
vec2 coords = ((v_texCoord.xy - u_uv) / (u_uv2 - u_uv) - vec2(0.5, 0.5)) * u_resolution/u_scl;
|
||||
|
||||
float roundx = 8.0;
|
||||
float roundy = roundx;
|
||||
|
@ -56,6 +56,7 @@ public class Shaders{
|
||||
shader.setUniformf("u_resolution", Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
|
||||
shader.setUniformf("u_time", time += Gdx.graphics.getDeltaTime() * 60f);
|
||||
shader.setUniformf("u_uv", Draw.getBlankRegion().getU(), Draw.getBlankRegion().getV());
|
||||
shader.setUniformf("u_scl", Unit.dp.scl(1f));
|
||||
shader.setUniformf("u_uv2", Draw.getBlankRegion().getU2(), Draw.getBlankRegion().getV2());
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ import java.util.zip.InflaterInputStream;
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
public class SaveIO{
|
||||
public static final IntArray breakingVersions = IntArray.with(47);
|
||||
public static final IntArray breakingVersions = IntArray.with(47, 48, 49, 50, 51, 52);
|
||||
public static final IntMap<SaveFileVersion> versions = new IntMap<>();
|
||||
public static final Array<SaveFileVersion> versionArray = Array.with(
|
||||
new Save16()
|
||||
|
@ -8,6 +8,7 @@ import com.badlogic.gdx.utils.Array;
|
||||
import io.anuke.mindustry.content.Items;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.io.SaveIO;
|
||||
import io.anuke.mindustry.maps.generation.WorldGenerator.GenResult;
|
||||
import io.anuke.mindustry.maps.missions.BattleMission;
|
||||
import io.anuke.mindustry.maps.missions.WaveMission;
|
||||
@ -33,12 +34,19 @@ public class Sectors{
|
||||
}
|
||||
|
||||
public void playSector(Sector sector){
|
||||
if(sector.hasSave() && SaveIO.breakingVersions.contains(sector.getSave().getBuild())){
|
||||
sector.getSave().delete();
|
||||
ui.showInfo("$text.save.old");
|
||||
}
|
||||
|
||||
if(!sector.hasSave()){
|
||||
world.loadSector(sector);
|
||||
logic.play();
|
||||
sector.saveID = control.getSaves().addSave("sector-" + sector.packedPosition()).index;
|
||||
world.sectors().save();
|
||||
world.setSector(sector);
|
||||
}else if(SaveIO.breakingVersions.contains(sector.getSave().getBuild())){
|
||||
ui.showInfo("$text.save.old");
|
||||
}else try{
|
||||
sector.getSave().load();
|
||||
world.setSector(sector);
|
||||
|
Reference in New Issue
Block a user