Fixes to shader code, collapsible placement menu
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,5 +1,7 @@
|
|||||||
##Packr, build stuff
|
##Packr, build stuff
|
||||||
|
|
||||||
|
/core/assets/mindustry-saves/
|
||||||
|
/core/assets/mindustry-maps/
|
||||||
/deploy/
|
/deploy/
|
||||||
/desktop/packr-out/
|
/desktop/packr-out/
|
||||||
/desktop/packr-export/
|
/desktop/packr-export/
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="io.anuke.mindustry"
|
package="io.anuke.mindustry"
|
||||||
android:versionCode="47"
|
android:versionCode="48"
|
||||||
android:versionName="3.2" >
|
android:versionName="3.2.1" >
|
||||||
|
|
||||||
<uses-permission android:name="com.android.vending.BILLING" />
|
<uses-permission android:name="com.android.vending.BILLING" />
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
|
|||||||
BIN
core/assets-raw/sprites/ui/icons/icon-arrow-down.png
Normal file
BIN
core/assets-raw/sprites/ui/icons/icon-arrow-down.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 168 B |
BIN
core/assets-raw/sprites/ui/icons/icon-arrow-up.png
Normal file
BIN
core/assets-raw/sprites/ui/icons/icon-arrow-up.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 201 B |
@@ -7,6 +7,7 @@ import io.anuke.ucore.core.Core;
|
|||||||
import io.anuke.ucore.core.Settings;
|
import io.anuke.ucore.core.Settings;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.graphics.Shader;
|
import io.anuke.ucore.graphics.Shader;
|
||||||
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
import io.anuke.ucore.util.Tmp;
|
import io.anuke.ucore.util.Tmp;
|
||||||
|
|
||||||
public class Shaders{
|
public class Shaders{
|
||||||
@@ -45,8 +46,9 @@ public class Shaders{
|
|||||||
shader.setUniform3fv("u_hits[0]", hits.items, 0, Math.min(hits.size, MAX_HITS));
|
shader.setUniform3fv("u_hits[0]", hits.items, 0, Math.min(hits.size, MAX_HITS));
|
||||||
shader.setUniformi("u_hitamount", Math.min(hits.size, MAX_HITS)/3);
|
shader.setUniformi("u_hitamount", Math.min(hits.size, MAX_HITS)/3);
|
||||||
}
|
}
|
||||||
|
shader.setUniformf("u_dp", Unit.dp.scl(1f));
|
||||||
shader.setUniformf("u_color", color);
|
shader.setUniformf("u_color", color);
|
||||||
shader.setUniformf("u_time", Timers.time());
|
shader.setUniformf("u_time", Timers.time() / Unit.dp.scl(1f));
|
||||||
shader.setUniformf("u_scaling", scaling);
|
shader.setUniformf("u_scaling", scaling);
|
||||||
shader.setUniformf("u_offset", Tmp.v1.set(Core.camera.position.x, Core.camera.position.y));
|
shader.setUniformf("u_offset", Tmp.v1.set(Core.camera.position.x, Core.camera.position.y));
|
||||||
shader.setUniformf("u_texsize", Tmp.v1.set(region.getTexture().getWidth() / scale,
|
shader.setUniformf("u_texsize", Tmp.v1.set(region.getTexture().getWidth() / scale,
|
||||||
|
|||||||
@@ -140,6 +140,7 @@ public class MapView extends Element implements GestureListener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(updated){
|
if(updated){
|
||||||
|
if(op == null) op = new DrawOperation(editor.pixmap());
|
||||||
Pixmap next = Pixmaps.copy(editor.pixmap());
|
Pixmap next = Pixmaps.copy(editor.pixmap());
|
||||||
op.add(current, next);
|
op.add(current, next);
|
||||||
current = next;
|
current = next;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import io.anuke.mindustry.resource.ItemStack;
|
|||||||
import io.anuke.mindustry.resource.Recipe;
|
import io.anuke.mindustry.resource.Recipe;
|
||||||
import io.anuke.mindustry.resource.Section;
|
import io.anuke.mindustry.resource.Section;
|
||||||
import io.anuke.mindustry.ui.FloatingDialog;
|
import io.anuke.mindustry.ui.FloatingDialog;
|
||||||
|
import io.anuke.ucore.core.Core;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.core.Draw;
|
||||||
import io.anuke.ucore.graphics.Hue;
|
import io.anuke.ucore.graphics.Hue;
|
||||||
import io.anuke.ucore.scene.builders.button;
|
import io.anuke.ucore.scene.builders.button;
|
||||||
@@ -35,6 +36,8 @@ public class BlocksFragment implements Fragment{
|
|||||||
abottom();
|
abottom();
|
||||||
aright();
|
aright();
|
||||||
|
|
||||||
|
visible(() -> !GameState.is(State.menu));
|
||||||
|
|
||||||
new table(){{
|
new table(){{
|
||||||
|
|
||||||
new table("button") {{
|
new table("button") {{
|
||||||
@@ -133,8 +136,6 @@ public class BlocksFragment implements Fragment{
|
|||||||
get().marginLeft(0f);
|
get().marginLeft(0f);
|
||||||
get().marginRight(0f);
|
get().marginRight(0f);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end();
|
end();
|
||||||
}}.right().bottom().uniformX();
|
}}.right().bottom().uniformX();
|
||||||
|
|
||||||
@@ -142,10 +143,12 @@ public class BlocksFragment implements Fragment{
|
|||||||
|
|
||||||
}}.end();
|
}}.end();
|
||||||
|
|
||||||
//new imagebutton("icon-arrow-right", 10*2, () -> {
|
row();
|
||||||
// shown = !shown;
|
|
||||||
//}).uniformY().fillY();
|
|
||||||
|
|
||||||
|
new imagebutton("icon-arrow-down", 10*2, () -> {
|
||||||
|
shown = !shown;
|
||||||
|
}).padBottom(-5).uniformX().fillX()
|
||||||
|
.update(i -> i.getStyle().imageUp = Core.skin.getDrawable(shown ? "icon-arrow-down" : "icon-arrow-up"));
|
||||||
}}.end();
|
}}.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -257,8 +257,8 @@ public class ProductionBlocks{
|
|||||||
formalName = "RTG generator";
|
formalName = "RTG generator";
|
||||||
generateItem = Item.uranium;
|
generateItem = Item.uranium;
|
||||||
powerCapacity = 40f;
|
powerCapacity = 40f;
|
||||||
powerOutput = 0.05f;
|
powerOutput = 0.04f;
|
||||||
itemDuration = 250f;
|
itemDuration = 240f;
|
||||||
description = "Generates power from uranium.";
|
description = "Generates power from uranium.";
|
||||||
fullDescription = "Generates small amounts of power from the radioactive decay of uranium. Outputs power as lasers to its 4 sides.";
|
fullDescription = "Generates small amounts of power from the radioactive decay of uranium. Outputs power as lasers to its 4 sides.";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ public class WeaponBlocks{
|
|||||||
bullet = BulletType.flame;
|
bullet = BulletType.flame;
|
||||||
ammo = Item.coal;
|
ammo = Item.coal;
|
||||||
health = 90;
|
health = 90;
|
||||||
fullDescription = "Advanced close-range turret. Uses coal for ammo. Has very low range, but very high damage and damage. "
|
fullDescription = "Advanced close-range turret. Uses coal for ammo. Has very low range, but very high damage. "
|
||||||
+ "Good for close quarters. Recommended to be used behind walls.";
|
+ "Good for close quarters. Recommended to be used behind walls.";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ import io.anuke.ucore.util.Strings;
|
|||||||
public class ShieldBlock extends PowerBlock{
|
public class ShieldBlock extends PowerBlock{
|
||||||
public float shieldRadius = 40f;
|
public float shieldRadius = 40f;
|
||||||
public float powerDrain = 0.005f;
|
public float powerDrain = 0.005f;
|
||||||
public float powerPerDamage = 0.2f;
|
public float powerPerDamage = 0.13f;
|
||||||
public float maxRadius = 40f;
|
public float maxRadius = 40f;
|
||||||
public float radiusScale = 160f;
|
public float radiusScale = 200f;
|
||||||
|
|
||||||
public ShieldBlock(String name) {
|
public ShieldBlock(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ public class Conveyor extends Block{
|
|||||||
private static ItemPos pos1 = new ItemPos();
|
private static ItemPos pos1 = new ItemPos();
|
||||||
private static ItemPos pos2 = new ItemPos();
|
private static ItemPos pos2 = new ItemPos();
|
||||||
private static IntArray removals = new IntArray();
|
private static IntArray removals = new IntArray();
|
||||||
|
private static final float itemSpace = 0.135f;
|
||||||
|
private static final float offsetScl = 128f*3f;
|
||||||
|
private static final float itemSize = 4f;
|
||||||
|
|
||||||
public float speed = 0.02f;
|
public float speed = 0.02f;
|
||||||
|
|
||||||
@@ -68,7 +71,7 @@ public class Conveyor extends Block{
|
|||||||
|
|
||||||
Draw.rect("icon-" + pos.item.name(),
|
Draw.rect("icon-" + pos.item.name(),
|
||||||
tile.x * tilesize + Tmp.v1.x * pos.y + Tmp.v2.x,
|
tile.x * tilesize + Tmp.v1.x * pos.y + Tmp.v2.x,
|
||||||
tile.y * tilesize + Tmp.v1.y * pos.y + Tmp.v2.y, 4, 4);
|
tile.y * tilesize + Tmp.v1.y * pos.y + Tmp.v2.y, itemSize, itemSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,13 +88,13 @@ public class Conveyor extends Block{
|
|||||||
ItemPos pos = pos1.set(value);
|
ItemPos pos = pos1.set(value);
|
||||||
|
|
||||||
boolean canmove = i == entity.convey.size - 1 ||
|
boolean canmove = i == entity.convey.size - 1 ||
|
||||||
!(pos2.set(entity.convey.get(i + 1)).y - pos.y < 0.135 * Timers.delta());
|
!(pos2.set(entity.convey.get(i + 1)).y - pos.y < itemSpace * Timers.delta());
|
||||||
|
|
||||||
if(canmove){
|
if(canmove){
|
||||||
pos.y += Math.max(speed * Timers.delta(), 1f/252f); //TODO fix precision issues?
|
pos.y += Math.max(speed * Timers.delta(), 1f/252f); //TODO fix precision issues?
|
||||||
pos.x = Mathf.lerpDelta(pos.x, 0, 0.06f);
|
pos.x = Mathf.lerpDelta(pos.x, 0, 0.06f);
|
||||||
}else{
|
}else{
|
||||||
pos.x = Mathf.lerpDelta(pos.x, pos.seed/128f/3f, 0.1f);
|
pos.x = Mathf.lerpDelta(pos.x, pos.seed/offsetScl, 0.1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
pos.y = Mathf.clamp(pos.y);
|
pos.y = Mathf.clamp(pos.y);
|
||||||
|
|||||||
@@ -25,14 +25,14 @@ public class NuclearReactor extends LiquidItemPowerGenerator{
|
|||||||
|
|
||||||
protected Color coolColor = new Color(1, 1, 1, 0f);
|
protected Color coolColor = new Color(1, 1, 1, 0f);
|
||||||
protected Color hotColor = Color.valueOf("ff9575a3");
|
protected Color hotColor = Color.valueOf("ff9575a3");
|
||||||
protected int fuelUseTime = 120; //time to consume 1 fuel
|
protected int fuelUseTime = 140; //time to consume 1 fuel
|
||||||
protected float powerMultiplier = 0.3f; //power per frame, depends on full capacity
|
protected float powerMultiplier = 0.4f; //power per frame, depends on full capacity
|
||||||
protected float heating = 0.007f; //heating per frame
|
protected float heating = 0.007f; //heating per frame
|
||||||
protected float coolantPower = 0.007f; //how much heat decreases per coolant unit
|
protected float coolantPower = 0.007f; //how much heat decreases per coolant unit
|
||||||
protected float smokeThreshold = 0.3f; //threshold at which block starts smoking
|
protected float smokeThreshold = 0.3f; //threshold at which block starts smoking
|
||||||
protected int explosionRadius = 19;
|
protected int explosionRadius = 19;
|
||||||
protected int explosionDamage = 135;
|
protected int explosionDamage = 135;
|
||||||
protected float flashThreshold = 0.46f;
|
protected float flashThreshold = 0.46f; //heat threshold at which the lights start flashing
|
||||||
|
|
||||||
public NuclearReactor(String name) {
|
public NuclearReactor(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
|
|||||||
Reference in New Issue
Block a user