it never ends
This commit is contained in:
@@ -275,7 +275,7 @@ public class BlockRenderer implements Disposable{
|
||||
if(request.tile.entity != null && request.tile.entity.damaged()){
|
||||
block.drawCracks(request.tile);
|
||||
}
|
||||
if(block.synthetic() && request.tile.getTeam() != player.team()){
|
||||
if(block.synthetic() && request.tile.team() != player.team()){
|
||||
block.drawTeam(request.tile);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,23 +1,20 @@
|
||||
package mindustry.graphics;
|
||||
|
||||
import arc.Core;
|
||||
import arc.struct.Array;
|
||||
import arc.func.Floatc2;
|
||||
import arc.graphics.Camera;
|
||||
import arc.graphics.Color;
|
||||
import arc.*;
|
||||
import arc.func.*;
|
||||
import arc.graphics.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.graphics.gl.FrameBuffer;
|
||||
import arc.graphics.gl.*;
|
||||
import arc.math.*;
|
||||
import arc.scene.ui.layout.Scl;
|
||||
import arc.scene.ui.layout.*;
|
||||
import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import arc.util.noise.RidgedPerlin;
|
||||
import arc.util.noise.Simplex;
|
||||
import mindustry.content.Blocks;
|
||||
import mindustry.content.UnitTypes;
|
||||
import mindustry.ui.Cicon;
|
||||
import arc.util.noise.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.ui.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.Floor;
|
||||
import mindustry.world.blocks.OreBlock;
|
||||
import mindustry.world.blocks.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
@@ -33,7 +30,7 @@ public class MenuRenderer implements Disposable{
|
||||
private float time = 0f;
|
||||
private float flyerRot = 45f;
|
||||
private int flyers = Mathf.chance(0.2) ? Mathf.random(35) : Mathf.random(15);
|
||||
private UnitType flyerType = Structs.select(UnitTypes.wraith, UnitTypes.wraith, UnitTypes.ghoul, UnitTypes.phantom, UnitTypes.phantom, UnitTypes.revenant);
|
||||
private UnitDef flyerType = Structs.select(UnitTypes.wraith, UnitTypes.wraith, UnitTypes.ghoul, UnitTypes.phantom, UnitTypes.phantom, UnitTypes.revenant);
|
||||
|
||||
public MenuRenderer(){
|
||||
Time.mark();
|
||||
|
||||
@@ -76,7 +76,7 @@ public class MinimapRenderer implements Disposable{
|
||||
updateUnitArray();
|
||||
}else{
|
||||
units.clear();
|
||||
Units.all(units::add);
|
||||
Groups.unit.each(units::add);
|
||||
}
|
||||
|
||||
float sz = baseSize * zoom;
|
||||
@@ -88,20 +88,19 @@ public class MinimapRenderer implements Disposable{
|
||||
rect.set((dx - sz) * tilesize, (dy - sz) * tilesize, sz * 2 * tilesize, sz * 2 * tilesize);
|
||||
|
||||
for(Unitc unit : units){
|
||||
if(unit.isDead()) continue;
|
||||
float rx = !withLabels ? (unit.x - rect.x) / rect.width * w : unit.x / (world.width() * tilesize) * w;
|
||||
float ry = !withLabels ? (unit.y - rect.y) / rect.width * h : unit.y / (world.height() * tilesize) * h;
|
||||
float rx = !withLabels ? (unit.x() - rect.x) / rect.width * w : unit.x() / (world.width() * tilesize) * w;
|
||||
float ry = !withLabels ? (unit.y() - rect.y) / rect.width * h : unit.y() / (world.height() * tilesize) * h;
|
||||
|
||||
Draw.mixcol(unit.getTeam().color, 1f);
|
||||
Draw.mixcol(unit.team().color, 1f);
|
||||
float scale = Scl.scl(1f) / 2f * scaling * 32f;
|
||||
Draw.rect(unit.getIconRegion(), x + rx, y + ry, scale, scale, unit.rotation - 90);
|
||||
Draw.rect(unit.type().region, x + rx, y + ry, scale, scale, unit.rotation() - 90);
|
||||
Draw.reset();
|
||||
|
||||
if(withLabels && unit instanceof Playerc){
|
||||
Playerc pl = (Playerc) unit;
|
||||
if(!pl.isLocal){
|
||||
if(!pl.isLocal()){
|
||||
// Only display names for other players.
|
||||
drawLabel(x + rx, y + ry, pl.name, unit.getTeam().color);
|
||||
drawLabel(x + rx, y + ry, pl.name(), unit.team().color);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -162,7 +161,7 @@ public class MinimapRenderer implements Disposable{
|
||||
if(bc != 0){
|
||||
return bc;
|
||||
}
|
||||
return Tmp.c1.set(MapIO.colorFor(tile.floor(), tile.block(), tile.overlay(), tile.getTeam())).mul(tile.block().cacheLayer == CacheLayer.walls ? 1f - tile.rotation() / 4f : 1f).rgba();
|
||||
return Tmp.c1.set(MapIO.colorFor(tile.floor(), tile.block(), tile.overlay(), tile.team())).mul(tile.block().cacheLayer == CacheLayer.walls ? 1f - tile.rotation() / 4f : 1f).rgba();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,7 +8,6 @@ import arc.math.geom.*;
|
||||
import arc.util.*;
|
||||
import mindustry.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.input.*;
|
||||
import mindustry.type.*;
|
||||
@@ -36,12 +35,12 @@ public class OverlayRenderer{
|
||||
public void drawTop(){
|
||||
|
||||
if(Core.settings.getBool("indicators")){
|
||||
for(Playerc player : Groups.player.all()){
|
||||
for(Playerc player : Groups.player){
|
||||
if(Vars.player != player && Vars.player.team() == player.team()){
|
||||
if(!rect.setSize(Core.camera.width * 0.9f, Core.camera.height * 0.9f)
|
||||
.setCenter(Core.camera.position.x, Core.camera.position.y).contains(player.x, player.y)){
|
||||
.setCenter(Core.camera.position.x, Core.camera.position.y).contains(player.x(), player.y())){
|
||||
|
||||
Tmp.v1.set(player.x, player.y).sub(Core.camera.position.x, Core.camera.position.y).setLength(indicatorLength);
|
||||
Tmp.v1.set(player.x(), player.y()).sub(Core.camera.position.x, Core.camera.position.y).setLength(indicatorLength);
|
||||
|
||||
Lines.stroke(2f, player.team().color);
|
||||
Lines.lineAngle(Core.camera.position.x + Tmp.v1.x, Core.camera.position.y + Tmp.v1.y, Tmp.v1.angle(), 4f);
|
||||
@@ -50,15 +49,15 @@ public class OverlayRenderer{
|
||||
}
|
||||
}
|
||||
|
||||
Units.all(unit -> {
|
||||
if(unit != player && unit.team() != player.team() && !rect.setSize(Core.camera.width * 0.9f, Core.camera.height * 0.9f).setCenter(Core.camera.position.x, Core.camera.position.y).contains(unit.x, unit.y)){
|
||||
Tmp.v1.set(unit.x, unit.y).sub(Core.camera.position.x, Core.camera.position.y).setLength(indicatorLength);
|
||||
Groups.unit.each(unit -> {
|
||||
if(unit != player && unit.team() != player.team() && !rect.setSize(Core.camera.width * 0.9f, Core.camera.height * 0.9f).setCenter(Core.camera.position.x, Core.camera.position.y).contains(unit.x(), unit.y())){
|
||||
Tmp.v1.set(unit.x(), unit.y()).sub(Core.camera.position.x, Core.camera.position.y).setLength(indicatorLength);
|
||||
|
||||
Lines.stroke(1f, unit.team().color);
|
||||
Lines.lineAngle(Core.camera.position.x + Tmp.v1.x, Core.camera.position.y + Tmp.v1.y, Tmp.v1.angle(), 3f);
|
||||
Draw.reset();
|
||||
}
|
||||
});
|
||||
Lines.stroke(1f, unit.team().color);
|
||||
Lines.lineAngle(Core.camera.position.x + Tmp.v1.x, Core.camera.position.y + Tmp.v1.y, Tmp.v1.angle(), 3f);
|
||||
Draw.reset();
|
||||
}
|
||||
});
|
||||
|
||||
if(ui.hudfrag.blockfrag.currentCategory == Category.upgrade){
|
||||
for(Tile mechpad : indexer.getAllied(player.team(), BlockFlag.mechPad)){
|
||||
@@ -98,9 +97,9 @@ public class OverlayRenderer{
|
||||
float dst = core.dst(player);
|
||||
if(dst < state.rules.enemyCoreBuildRadius * 2.2f){
|
||||
Draw.color(Color.darkGray);
|
||||
Lines.circle(core.x, core.y - 2, state.rules.enemyCoreBuildRadius);
|
||||
Draw.color(Pal.accent, core.getTeam().color, 0.5f + Mathf.absin(Time.time(), 10f, 0.5f));
|
||||
Lines.circle(core.x, core.y, state.rules.enemyCoreBuildRadius);
|
||||
Lines.circle(core.x(), core.y() - 2, state.rules.enemyCoreBuildRadius);
|
||||
Draw.color(Pal.accent, core.team().color, 0.5f + Mathf.absin(Time.time(), 10f, 0.5f));
|
||||
Lines.circle(core.x(), core.y(), state.rules.enemyCoreBuildRadius);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -109,7 +108,7 @@ public class OverlayRenderer{
|
||||
Draw.color(Color.gray, Color.lightGray, Mathf.absin(Time.time(), 8f, 1f));
|
||||
|
||||
for(Tile tile : spawner.getGroundSpawns()){
|
||||
if(tile.withinDst(player.x, player.y, state.rules.dropZoneRadius + spawnerMargin)){
|
||||
if(tile.withinDst(player.x(), player.y(), state.rules.dropZoneRadius + spawnerMargin)){
|
||||
Draw.alpha(Mathf.clamp(1f - (player.dst(tile) - state.rules.dropZoneRadius) / spawnerMargin));
|
||||
Lines.dashCircle(tile.worldx(), tile.worldy(), state.rules.dropZoneRadius);
|
||||
}
|
||||
@@ -122,7 +121,7 @@ public class OverlayRenderer{
|
||||
Vec2 vec = Core.input.mouseWorld(input.getMouseX(), input.getMouseY());
|
||||
Tile tile = world.ltileWorld(vec.x, vec.y);
|
||||
|
||||
if(tile != null && tile.block() != Blocks.air && tile.getTeam() == player.team()){
|
||||
if(tile != null && tile.block() != Blocks.air && tile.team() == player.team()){
|
||||
tile.block().drawSelect(tile);
|
||||
|
||||
if(Core.input.keyDown(Binding.rotateplaced) && tile.block().rotate && tile.interactable(player.team())){
|
||||
@@ -138,13 +137,13 @@ public class OverlayRenderer{
|
||||
if(input.isDroppingItem()){
|
||||
Vec2 v = Core.input.mouseWorld(input.getMouseX(), input.getMouseY());
|
||||
float size = 8;
|
||||
Draw.rect(player.item().item.icon(Cicon.medium), v.x, v.y, size, size);
|
||||
Draw.rect(player.unit().item().icon(Cicon.medium), v.x, v.y, size, size);
|
||||
Draw.color(Pal.accent);
|
||||
Lines.circle(v.x, v.y, 6 + Mathf.absin(Time.time(), 5f, 1f));
|
||||
Draw.reset();
|
||||
|
||||
Tile tile = world.ltileWorld(v.x, v.y);
|
||||
if(tile != null && tile.interactable(player.team()) && tile.block().acceptStack(player.item().item, player.item().amount, tile, player) > 0){
|
||||
if(tile != null && tile.interactable(player.team()) && tile.block().acceptStack(player.unit().item(), player.unit().stack().amount, tile, player.unit()) > 0){
|
||||
Lines.stroke(3f, Pal.gray);
|
||||
Lines.square(tile.drawx(), tile.drawy(), tile.block().size * tilesize / 2f + 3 + Mathf.absin(Time.time(), 5f, 1f));
|
||||
Lines.stroke(1f, Pal.place);
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
package mindustry.graphics;
|
||||
|
||||
import arc.Core;
|
||||
import arc.graphics.Blending;
|
||||
import arc.graphics.Texture.TextureFilter;
|
||||
import arc.graphics.g2d.Draw;
|
||||
import arc.graphics.gl.FrameBuffer;
|
||||
import arc.util.Disposable;
|
||||
import mindustry.gen.*;
|
||||
import arc.*;
|
||||
import arc.graphics.*;
|
||||
import arc.graphics.Texture.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.graphics.gl.*;
|
||||
import arc.util.*;
|
||||
|
||||
import static arc.Core.camera;
|
||||
import static arc.Core.graphics;
|
||||
import static mindustry.Groups.player;
|
||||
import static arc.Core.*;
|
||||
import static mindustry.Vars.renderer;
|
||||
|
||||
public class Pixelator implements Disposable{
|
||||
@@ -55,7 +52,8 @@ public class Pixelator implements Disposable{
|
||||
Draw.rect(Draw.wrap(buffer.getTexture()), Core.camera.position.x, Core.camera.position.y, Core.camera.width, -Core.camera.height);
|
||||
Draw.blend();
|
||||
|
||||
Groups.player.draw(p -> !p.isDead(), Playerc::drawName);
|
||||
//TODO implement drawing functions, maybe
|
||||
//Groups.player.draw(p -> !p.isDead(), Playerc::drawName);
|
||||
|
||||
Core.camera.position.set(px, py);
|
||||
Core.settings.put("animatedwater", hadWater);
|
||||
|
||||
Reference in New Issue
Block a user