Merge remote-tracking branch 'origin/master'

This commit is contained in:
Anuken
2018-09-03 16:22:29 -04:00
8 changed files with 26 additions and 15 deletions

View File

@@ -1,11 +1,11 @@
#ifdef GL_ES #ifdef GL_ES
precision highp float; precision mediump float;
precision highp int; precision mediump int;
#endif #endif
uniform sampler2D u_texture; uniform sampler2D u_texture;
uniform vec2 u_resolution; uniform vec2 u_resolution;
uniform float u_time; uniform int u_time;
uniform vec2 u_uv; uniform vec2 u_uv;
uniform vec2 u_uv2; uniform vec2 u_uv2;
uniform float u_scl; uniform float u_scl;
@@ -25,7 +25,7 @@ void main() {
float d = (abs(float(coords.x)) - abs(float(coords.y))); float d = (abs(float(coords.x)) - abs(float(coords.y)));
float m = abs(sin(-u_time/50.0 + d/120.0)); float m = abs(sin(-float(u_time)/50.0 + d/120.0));
m = float(int(m / roundm)) * roundm + roundm; m = float(int(m / roundm)) * roundm + roundm;
gl_FragColor.rgb = mix(v_color.rgb, vec3(0.0), m); gl_FragColor.rgb = mix(v_color.rgb, vec3(0.0), m);

View File

@@ -25,6 +25,7 @@ import io.anuke.ucore.scene.ui.layout.Unit;
import io.anuke.ucore.util.OS; import io.anuke.ucore.util.OS;
import io.anuke.ucore.util.Translator; import io.anuke.ucore.util.Translator;
import java.util.Arrays;
import java.util.Locale; import java.util.Locale;
public class Vars{ public class Vars{
@@ -146,6 +147,8 @@ public class Vars{
} }
} }
Arrays.sort(locales, (l1, l2) -> Platform.instance.getLocaleName(l1).compareTo(Platform.instance.getLocaleName(l2)));
Version.init(); Version.init();
playerGroup = Entities.addGroup(Player.class).enableMapping(); playerGroup = Entities.addGroup(Player.class).enableMapping();

View File

@@ -44,10 +44,10 @@ public class TurretBlocks extends BlockList implements ContentList{
hail = new ArtilleryTurret("hail"){{ hail = new ArtilleryTurret("hail"){{
ammoTypes = new AmmoType[]{AmmoTypes.artilleryDense, AmmoTypes.artilleryHoming, AmmoTypes.artilleryIncindiary}; ammoTypes = new AmmoType[]{AmmoTypes.artilleryDense, AmmoTypes.artilleryHoming, AmmoTypes.artilleryIncindiary};
reload = 100f; reload = 80f;
recoil = 2f; recoil = 2f;
range = 200f; range = 230f;
inaccuracy = 5f; inaccuracy = 1f;
health = 120; health = 120;
}}; }};
@@ -195,7 +195,7 @@ public class TurretBlocks extends BlockList implements ContentList{
restitution = 0.02f; restitution = 0.02f;
recoil = 6f; recoil = 6f;
shootShake = 2f; shootShake = 2f;
range = 300f; range = 320f;
health = 550; health = 550;
}}; }};

View File

@@ -36,7 +36,7 @@ public class TurretBullets extends BulletList implements ContentList{
@Override @Override
public void load(){ public void load(){
healBullet = new BulletType(5.2f, 16){ healBullet = new BulletType(5.2f, 13){
float healAmount = 21f; float healAmount = 21f;
{ {

View File

@@ -53,8 +53,10 @@ public class Shaders{
@Override @Override
public void apply(){ public void apply(){
time = time % 158;
shader.setUniformf("u_resolution", Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); shader.setUniformf("u_resolution", Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
shader.setUniformf("u_time", time += Gdx.graphics.getDeltaTime() * 60f); shader.setUniformi("u_time", (int)(time += Gdx.graphics.getDeltaTime() * 60f));
shader.setUniformf("u_uv", Draw.getBlankRegion().getU(), Draw.getBlankRegion().getV()); shader.setUniformf("u_uv", Draw.getBlankRegion().getU(), Draw.getBlankRegion().getV());
shader.setUniformf("u_scl", Unit.dp.scl(1f)); shader.setUniformf("u_scl", Unit.dp.scl(1f));
shader.setUniformf("u_uv2", Draw.getBlankRegion().getU2(), Draw.getBlankRegion().getV2()); shader.setUniformf("u_uv2", Draw.getBlankRegion().getU2(), Draw.getBlankRegion().getV2());

View File

@@ -2,6 +2,8 @@ package io.anuke.mindustry.world.meta;
import io.anuke.ucore.util.Bundles; import io.anuke.ucore.util.Bundles;
import java.util.Locale;
/** /**
* Describes one type of stat for a block. * Describes one type of stat for a block.
*/ */
@@ -53,6 +55,6 @@ public enum BlockStat{
} }
public String localized(){ public String localized(){
return Bundles.get("text.blocks." + name().toLowerCase()); return Bundles.get("text.blocks." + name().toLowerCase(Locale.ROOT));
} }
} }

View File

@@ -10,6 +10,8 @@ import io.anuke.mindustry.world.meta.values.*;
import io.anuke.ucore.util.Bundles; import io.anuke.ucore.util.Bundles;
import io.anuke.ucore.util.Log; import io.anuke.ucore.util.Log;
import java.util.Locale;
/** /**
* Hold and organizes a list of block stats. * Hold and organizes a list of block stats.
*/ */
@@ -71,7 +73,7 @@ public class BlockStats{
* Adds a stat value. * Adds a stat value.
*/ */
public void add(BlockStat stat, StatValue value){ public void add(BlockStat stat, StatValue value){
if(!Bundles.has("text.blocks." + stat.name().toLowerCase())){ if(!Bundles.has("text.blocks." + stat.name().toLowerCase(Locale.ROOT))){
if(!errorWhenMissing){ if(!errorWhenMissing){
Log.err("Warning: No bundle entry for stat type \"" + stat + "\"!"); Log.err("Warning: No bundle entry for stat type \"" + stat + "\"!");
}else{ }else{
@@ -79,9 +81,9 @@ public class BlockStats{
} }
} }
if(!Bundles.has("text.category." + stat.category.name().toLowerCase())){ if(!Bundles.has("text.category." + stat.category.name().toLowerCase(Locale.ROOT))){
if(!errorWhenMissing){ if(!errorWhenMissing){
Log.err("Warning: No bundle entry for stat cateogry \"" + stat.category + "\"!"); Log.err("Warning: No bundle entry for stat category \"" + stat.category + "\"!");
}else{ }else{
throw new RuntimeException("No bundle entry for stat category \"" + stat.category + "\"!"); throw new RuntimeException("No bundle entry for stat category \"" + stat.category + "\"!");
} }

View File

@@ -2,6 +2,8 @@ package io.anuke.mindustry.world.meta;
import io.anuke.ucore.util.Bundles; import io.anuke.ucore.util.Bundles;
import java.util.Locale;
/** /**
* Defines a unit of measurement for block stats. * Defines a unit of measurement for block stats.
*/ */
@@ -19,6 +21,6 @@ public enum StatUnit{
items; items;
public String localized(){ public String localized(){
return Bundles.get("text.unit." + name().toLowerCase()); return Bundles.get("text.unit." + name().toLowerCase(Locale.ROOT));
} }
} }