@@ -34,14 +34,14 @@ mend-projector-top
|
|||||||
index: -1
|
index: -1
|
||||||
mender
|
mender
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1071, 467
|
xy: 969, 331
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
mender-top
|
mender-top
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 969, 331
|
xy: 1003, 365
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -384,42 +384,42 @@ conveyor-4-3
|
|||||||
index: -1
|
index: -1
|
||||||
plastanium-conveyor
|
plastanium-conveyor
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1003, 297
|
xy: 1037, 331
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
plastanium-conveyor-0
|
plastanium-conveyor-0
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1037, 331
|
xy: 1071, 365
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
plastanium-conveyor-1
|
plastanium-conveyor-1
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1071, 365
|
xy: 1105, 399
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
plastanium-conveyor-2
|
plastanium-conveyor-2
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1105, 399
|
xy: 1139, 433
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
plastanium-conveyor-edge
|
plastanium-conveyor-edge
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1139, 433
|
xy: 1173, 467
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
plastanium-conveyor-stack
|
plastanium-conveyor-stack
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1173, 467
|
xy: 969, 229
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -615,35 +615,35 @@ mass-driver-base
|
|||||||
index: -1
|
index: -1
|
||||||
overflow-gate
|
overflow-gate
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1037, 399
|
xy: 1071, 433
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
phase-conveyor
|
phase-conveyor
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1037, 365
|
xy: 1071, 399
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
phase-conveyor-arrow
|
phase-conveyor-arrow
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1071, 399
|
xy: 1105, 433
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
phase-conveyor-bridge
|
phase-conveyor-bridge
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1105, 433
|
xy: 1139, 467
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
phase-conveyor-end
|
phase-conveyor-end
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1139, 467
|
xy: 969, 263
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -867,7 +867,7 @@ conduit-liquid
|
|||||||
index: -1
|
index: -1
|
||||||
message
|
message
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1003, 365
|
xy: 1037, 399
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -1096,135 +1096,149 @@ mechanical-pump
|
|||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
phase-conduit
|
mechanical-pump-liquid
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1071, 433
|
xy: 1037, 433
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
phase-conduit-arrow
|
rotary-pump-liquid
|
||||||
|
rotate: false
|
||||||
|
xy: 1037, 433
|
||||||
|
size: 32, 32
|
||||||
|
orig: 32, 32
|
||||||
|
offset: 0, 0
|
||||||
|
index: -1
|
||||||
|
thermal-pump-liquid
|
||||||
|
rotate: false
|
||||||
|
xy: 1037, 433
|
||||||
|
size: 32, 32
|
||||||
|
orig: 32, 32
|
||||||
|
offset: 0, 0
|
||||||
|
index: -1
|
||||||
|
phase-conduit
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1105, 467
|
xy: 1105, 467
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
phase-conduit-bridge
|
phase-conduit-arrow
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 969, 297
|
xy: 969, 297
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
phase-conduit-end
|
phase-conduit-bridge
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1003, 331
|
xy: 1003, 331
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
plated-conduit-cap
|
phase-conduit-end
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1003, 263
|
xy: 1037, 365
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
plated-conduit-top-0
|
plated-conduit-cap
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1037, 297
|
xy: 1037, 297
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
plated-conduit-top-1
|
plated-conduit-top-0
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1071, 331
|
xy: 1071, 331
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
plated-conduit-top-2
|
plated-conduit-top-1
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1105, 365
|
xy: 1105, 365
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
plated-conduit-top-3
|
plated-conduit-top-2
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1139, 399
|
xy: 1139, 399
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
plated-conduit-top-4
|
plated-conduit-top-3
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1173, 433
|
xy: 1173, 433
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
plated-conduit-top-5
|
plated-conduit-top-4
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1207, 467
|
xy: 1207, 467
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
plated-conduit-top-6
|
plated-conduit-top-5
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 969, 195
|
xy: 969, 195
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
pulse-conduit-top-0
|
plated-conduit-top-6
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1105, 331
|
xy: 1003, 229
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
pulse-conduit-top-1
|
pulse-conduit-top-0
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1139, 365
|
xy: 1139, 365
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
pulse-conduit-top-2
|
pulse-conduit-top-1
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1173, 399
|
xy: 1173, 399
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
pulse-conduit-top-4
|
pulse-conduit-top-2
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1207, 433
|
xy: 1207, 433
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
pulse-conduit-top-5
|
pulse-conduit-top-4
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1241, 467
|
xy: 1241, 467
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
pulse-conduit-top-6
|
pulse-conduit-top-5
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1003, 195
|
xy: 1003, 195
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
pump-liquid
|
pulse-conduit-top-6
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1105, 297
|
xy: 1037, 229
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -1441,7 +1455,7 @@ impact-reactor-plasma-3
|
|||||||
index: -1
|
index: -1
|
||||||
power-node
|
power-node
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1003, 229
|
xy: 1037, 263
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -1455,14 +1469,14 @@ power-node-large
|
|||||||
index: -1
|
index: -1
|
||||||
power-source
|
power-source
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1037, 263
|
xy: 1071, 297
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
power-void
|
power-void
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1071, 297
|
xy: 1105, 331
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -1693,7 +1707,7 @@ liquid-void
|
|||||||
index: -1
|
index: -1
|
||||||
melter
|
melter
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1037, 433
|
xy: 1071, 467
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -1742,14 +1756,14 @@ plastanium-compressor-top
|
|||||||
index: -1
|
index: -1
|
||||||
pulverizer
|
pulverizer
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1037, 229
|
xy: 1071, 263
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
pulverizer-rotator
|
pulverizer-rotator
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1071, 263
|
xy: 1105, 297
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -2330,7 +2344,7 @@ door-open
|
|||||||
index: -1
|
index: -1
|
||||||
phase-wall
|
phase-wall
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 969, 263
|
xy: 1003, 297
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -2344,7 +2358,7 @@ phase-wall-large
|
|||||||
index: -1
|
index: -1
|
||||||
plastanium-wall
|
plastanium-wall
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 969, 229
|
xy: 1003, 263
|
||||||
size: 32, 32
|
size: 32, 32
|
||||||
orig: 32, 32
|
orig: 32, 32
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 716 KiB After Width: | Height: | Size: 716 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 127 KiB |
@@ -184,39 +184,8 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
|
|||||||
return relativeTo(tile.x, tile.y);
|
return relativeTo(tile.x, tile.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return relative rotation to a coordinate. Returns -1 if the coordinate is not near this tile. */
|
|
||||||
public byte relativeTo(int cx, int cy){
|
public byte relativeTo(int cx, int cy){
|
||||||
int x = tile.x, y = tile.y;
|
return tile.absoluteRelativeTo(cx, cy);
|
||||||
if(x == cx && y == cy - 1) return 1;
|
|
||||||
if(x == cx && y == cy + 1) return 3;
|
|
||||||
if(x == cx - 1 && y == cy) return 0;
|
|
||||||
if(x == cx + 1 && y == cy) return 2;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public byte absoluteRelativeTo(int cx, int cy){
|
|
||||||
int x = tile.x, y = tile.y;
|
|
||||||
|
|
||||||
//very straightforward for odd sizes
|
|
||||||
if(block.size % 2 == 1){
|
|
||||||
if(Math.abs(x - cx) > Math.abs(y - cy)){
|
|
||||||
if(x <= cx - 1) return 0;
|
|
||||||
if(x >= cx + 1) return 2;
|
|
||||||
}else{
|
|
||||||
if(y <= cy - 1) return 1;
|
|
||||||
if(y >= cy + 1) return 3;
|
|
||||||
}
|
|
||||||
}else{ //need offsets here
|
|
||||||
if(Math.abs(x - cx + 0.5f) > Math.abs(y - cy + 0.5f)){
|
|
||||||
if(x+0.5f <= cx - 1) return 0;
|
|
||||||
if(x+0.5f >= cx + 1) return 2;
|
|
||||||
}else{
|
|
||||||
if(y+0.5f <= cy - 1) return 1;
|
|
||||||
if(y+0.5f >= cy + 1) return 3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public @Nullable Tilec front(){
|
public @Nullable Tilec front(){
|
||||||
|
|||||||
@@ -153,8 +153,8 @@ public class DesktopInput extends InputHandler{
|
|||||||
if(block.saveConfig && block.lastConfig != null){
|
if(block.saveConfig && block.lastConfig != null){
|
||||||
brequest.set(cursorX, cursorY, rotation, block);
|
brequest.set(cursorX, cursorY, rotation, block);
|
||||||
brequest.config = block.lastConfig;
|
brequest.config = block.lastConfig;
|
||||||
|
|
||||||
block.drawRequestConfig(brequest, allRequests());
|
block.drawRequestConfig(brequest, allRequests());
|
||||||
|
brequest.config = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -508,7 +508,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||||||
protected void drawRequest(BuildRequest request){
|
protected void drawRequest(BuildRequest request){
|
||||||
request.block.drawRequest(request, allRequests(), validPlace(request.x, request.y, request.block, request.rotation));
|
request.block.drawRequest(request, allRequests(), validPlace(request.x, request.y, request.block, request.rotation));
|
||||||
|
|
||||||
if(request.block.saveConfig && request.block.lastConfig != null){
|
if(request.block.saveConfig && request.block.lastConfig != null && !request.hasConfig){
|
||||||
Object conf = request.config;
|
Object conf = request.config;
|
||||||
request.config = request.block.lastConfig;
|
request.config = request.block.lastConfig;
|
||||||
request.block.drawRequestConfig(request, allRequests());
|
request.block.drawRequestConfig(request, allRequests());
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import arc.scene.actions.*;
|
|||||||
import arc.scene.event.*;
|
import arc.scene.event.*;
|
||||||
import arc.scene.ui.*;
|
import arc.scene.ui.*;
|
||||||
import arc.scene.ui.layout.*;
|
import arc.scene.ui.layout.*;
|
||||||
|
import arc.scene.ui.layout.Stack;
|
||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.annotations.Annotations.*;
|
import mindustry.annotations.Annotations.*;
|
||||||
@@ -22,6 +23,8 @@ import mindustry.net.*;
|
|||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class BlockInventoryFragment extends Fragment{
|
public class BlockInventoryFragment extends Fragment{
|
||||||
@@ -94,6 +97,9 @@ public class BlockInventoryFragment extends Fragment{
|
|||||||
private void rebuild(boolean actions){
|
private void rebuild(boolean actions){
|
||||||
IntSet container = new IntSet();
|
IntSet container = new IntSet();
|
||||||
|
|
||||||
|
Arrays.fill(shrinkHoldTimes, 0);
|
||||||
|
holdTime = emptyTime = 0f;
|
||||||
|
|
||||||
table.clearChildren();
|
table.clearChildren();
|
||||||
table.clearActions();
|
table.clearActions();
|
||||||
table.background(Tex.inventory);
|
table.background(Tex.inventory);
|
||||||
|
|||||||
@@ -80,18 +80,26 @@ public class Tile implements Position, QuadTreeObject{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public byte absoluteRelativeTo(int cx, int cy){
|
public byte absoluteRelativeTo(int cx, int cy){
|
||||||
if(x == cx && y <= cy - 1) return 1;
|
|
||||||
if(x == cx && y >= cy + 1) return 3;
|
|
||||||
if(x <= cx - 1 && y == cy) return 0;
|
|
||||||
if(x >= cx + 1 && y == cy) return 2;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static byte absoluteRelativeTo(int x, int y, int cx, int cy){
|
//very straightforward for odd sizes
|
||||||
if(x == cx && y <= cy - 1) return 1;
|
if(block.size % 2 == 1){
|
||||||
if(x == cx && y >= cy + 1) return 3;
|
if(Math.abs(x - cx) > Math.abs(y - cy)){
|
||||||
if(x <= cx - 1 && y == cy) return 0;
|
if(x <= cx - 1) return 0;
|
||||||
if(x >= cx + 1 && y == cy) return 2;
|
if(x >= cx + 1) return 2;
|
||||||
|
}else{
|
||||||
|
if(y <= cy - 1) return 1;
|
||||||
|
if(y >= cy + 1) return 3;
|
||||||
|
}
|
||||||
|
}else{ //need offsets here
|
||||||
|
if(Math.abs(x - cx + 0.5f) > Math.abs(y - cy + 0.5f)){
|
||||||
|
if(x+0.5f <= cx - 1) return 0;
|
||||||
|
if(x+0.5f >= cx + 1) return 2;
|
||||||
|
}else{
|
||||||
|
if(y+0.5f <= cy - 1) return 1;
|
||||||
|
if(y+0.5f >= cy + 1) return 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ public class ItemBridge extends Block{
|
|||||||
float opacity = Core.settings.getInt("bridgeopacity") / 100f;
|
float opacity = Core.settings.getInt("bridgeopacity") / 100f;
|
||||||
if(Mathf.zero(opacity)) return;
|
if(Mathf.zero(opacity)) return;
|
||||||
|
|
||||||
int i = tile.absoluteRelativeTo(other.x, other.y);
|
int i = relativeTo(other.x, other.y);
|
||||||
|
|
||||||
Draw.color(Color.white, Color.black, Mathf.absin(Time.time(), 6f, 0.07f));
|
Draw.color(Color.white, Color.black, Mathf.absin(Time.time(), 6f, 0.07f));
|
||||||
Draw.alpha(Math.max(uptime, 0.25f) * opacity);
|
Draw.alpha(Math.max(uptime, 0.25f) * opacity);
|
||||||
@@ -275,8 +275,8 @@ public class ItemBridge extends Block{
|
|||||||
Tile other = world.tile(link);
|
Tile other = world.tile(link);
|
||||||
|
|
||||||
if(linkValid(tile, other)){
|
if(linkValid(tile, other)){
|
||||||
int rel = tile.absoluteRelativeTo(other.x, other.y);
|
int rel = relativeTo(other.x, other.y);
|
||||||
int rel2 = tile.relativeTo(source.tileX(), source.tileY());
|
int rel2 = relativeTo(source.tileX(), source.tileY());
|
||||||
|
|
||||||
if(rel == rel2) return false;
|
if(rel == rel2) return false;
|
||||||
}else{
|
}else{
|
||||||
@@ -292,21 +292,21 @@ public class ItemBridge extends Block{
|
|||||||
Tile other = world.tile(link);
|
Tile other = world.tile(link);
|
||||||
if(!linkValid(tile, other)){
|
if(!linkValid(tile, other)){
|
||||||
Tile edge = Edges.getFacingEdge(to.tile(), tile);
|
Tile edge = Edges.getFacingEdge(to.tile(), tile);
|
||||||
int i = tile.absoluteRelativeTo(edge.x, edge.y);
|
int i = relativeTo(edge.x, edge.y);
|
||||||
|
|
||||||
IntSetIterator it = incoming.iterator();
|
IntSetIterator it = incoming.iterator();
|
||||||
|
|
||||||
while(it.hasNext){
|
while(it.hasNext){
|
||||||
int v = it.next();
|
int v = it.next();
|
||||||
if(tile.absoluteRelativeTo(Point2.x(v), Point2.y(v)) == i){
|
if(relativeTo(Point2.x(v), Point2.y(v)) == i){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int rel = tile.absoluteRelativeTo(other.x, other.y);
|
int rel = relativeTo(other.x, other.y);
|
||||||
int rel2 = tile.relativeTo(to.tileX(), to.tileY());
|
int rel2 = relativeTo(to.tileX(), to.tileY());
|
||||||
|
|
||||||
return rel != rel2;
|
return rel != rel2;
|
||||||
}
|
}
|
||||||
@@ -318,8 +318,8 @@ public class ItemBridge extends Block{
|
|||||||
Tile other = world.tile(link);
|
Tile other = world.tile(link);
|
||||||
|
|
||||||
if(linkValid(tile, other)){
|
if(linkValid(tile, other)){
|
||||||
int rel = tile.absoluteRelativeTo(other.x, other.y);
|
int rel = relativeTo(other.x, other.y);
|
||||||
int rel2 = tile.relativeTo(source.tileX(), source.tileY());
|
int rel2 = relativeTo(source.tileX(), source.tileY());
|
||||||
|
|
||||||
if(rel == rel2) return false;
|
if(rel == rel2) return false;
|
||||||
}else if(!(source.block() instanceof ItemBridge && ((ItemBridgeEntity)source).link == tile.pos())){
|
}else if(!(source.block() instanceof ItemBridge && ((ItemBridgeEntity)source).link == tile.pos())){
|
||||||
@@ -334,21 +334,21 @@ public class ItemBridge extends Block{
|
|||||||
Tile other = world.tile(link);
|
Tile other = world.tile(link);
|
||||||
if(!linkValid(tile, other)){
|
if(!linkValid(tile, other)){
|
||||||
Tile edge = Edges.getFacingEdge(to.tile(), tile);
|
Tile edge = Edges.getFacingEdge(to.tile(), tile);
|
||||||
int i = tile.absoluteRelativeTo(edge.x, edge.y);
|
int i = relativeTo(edge.x, edge.y);
|
||||||
|
|
||||||
IntSetIterator it = incoming.iterator();
|
IntSetIterator it = incoming.iterator();
|
||||||
|
|
||||||
while(it.hasNext){
|
while(it.hasNext){
|
||||||
int v = it.next();
|
int v = it.next();
|
||||||
if(tile.absoluteRelativeTo(Point2.x(v), Point2.y(v)) == i){
|
if(relativeTo(Point2.x(v), Point2.y(v)) == i){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int rel = tile.absoluteRelativeTo(other.x, other.y);
|
int rel = relativeTo(other.x, other.y);
|
||||||
int rel2 = tile.relativeTo(to.tileX(), to.tileY());
|
int rel2 = relativeTo(to.tileX(), to.tileY());
|
||||||
|
|
||||||
return rel != rel2;
|
return rel != rel2;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,13 +63,13 @@ public class Junction extends Block{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleItem(Tilec source, Item item){
|
public void handleItem(Tilec source, Item item){
|
||||||
int relative = source.relativeTo(tile.x, tile.y);
|
int relative = source.relativeTo(tile);
|
||||||
buffer.accept(relative, item);
|
buffer.accept(relative, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean acceptItem(Tilec source, Item item){
|
public boolean acceptItem(Tilec source, Item item){
|
||||||
int relative = source.relativeTo(tile.x, tile.y);
|
int relative = source.relativeTo(tile);
|
||||||
|
|
||||||
if(relative == -1 || !buffer.accepts(relative)) return false;
|
if(relative == -1 || !buffer.accepts(relative)) return false;
|
||||||
Tilec to = nearby(relative);
|
Tilec to = nearby(relative);
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ public class Sorter extends Block{
|
|||||||
}
|
}
|
||||||
|
|
||||||
Tilec getTileTarget(Item item, Tilec source, boolean flip){
|
Tilec getTileTarget(Item item, Tilec source, boolean flip){
|
||||||
int dir = source.absoluteRelativeTo(tile.x, tile.y);
|
int dir = source.relativeTo(tile.x, tile.y);
|
||||||
if(dir == -1) return null;
|
if(dir == -1) return null;
|
||||||
Tilec to;
|
Tilec to;
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ public class Conduit extends LiquidBlock implements Autotiler{
|
|||||||
public boolean acceptLiquid(Tilec source, Liquid liquid, float amount){
|
public boolean acceptLiquid(Tilec source, Liquid liquid, float amount){
|
||||||
noSleep();
|
noSleep();
|
||||||
return liquids.get(liquid) + amount < liquidCapacity && (liquids.current() == liquid || liquids.currentAmount() < 0.2f)
|
return liquids.get(liquid) + amount < liquidCapacity && (liquids.current() == liquid || liquids.currentAmount() < 0.2f)
|
||||||
&& ((source.absoluteRelativeTo(tile.x, tile.y) + 2) % 4 != tile.rotation());
|
&& ((source.relativeTo(tile.x, tile.y) + 2) % 4 != tile.rotation());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class LiquidJunction extends LiquidBlock{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Tilec getLiquidDestination(Tilec source, Liquid liquid){
|
public Tilec getLiquidDestination(Tilec source, Liquid liquid){
|
||||||
int dir = source.absoluteRelativeTo(tile.x, tile.y);
|
int dir = source.relativeTo(tile.x, tile.y);
|
||||||
dir = (dir + 4) % 4;
|
dir = (dir + 4) % 4;
|
||||||
Tilec next = nearby(dir);
|
Tilec next = nearby(dir);
|
||||||
if(next == null || (!next.acceptLiquid(this, liquid, 0f) && !(next.block() instanceof LiquidJunction))){
|
if(next == null || (!next.acceptLiquid(this, liquid, 0f) && !(next.block() instanceof LiquidJunction))){
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package mindustry.world.blocks.production;
|
|||||||
import arc.*;
|
import arc.*;
|
||||||
import arc.graphics.*;
|
import arc.graphics.*;
|
||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import mindustry.annotations.Annotations.*;
|
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
@@ -13,7 +12,6 @@ import mindustry.world.meta.*;
|
|||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class Pump extends LiquidBlock{
|
public class Pump extends LiquidBlock{
|
||||||
public @Load("pump-liquid") TextureRegion liquidRegion;
|
|
||||||
public final int timerContentCheck = timers++;
|
public final int timerContentCheck = timers++;
|
||||||
|
|
||||||
/** Pump amount, total. */
|
/** Pump amount, total. */
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import arc.graphics.g2d.*;
|
|||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import arc.util.ArcAnnotate.*;
|
import arc.util.ArcAnnotate.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
|
import mindustry.annotations.Annotations.*;
|
||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.entities.*;
|
import mindustry.entities.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
@@ -24,6 +25,8 @@ public class SolidPump extends Pump{
|
|||||||
/** Attribute that is checked when calculating output. */
|
/** Attribute that is checked when calculating output. */
|
||||||
public @Nullable Attribute attribute;
|
public @Nullable Attribute attribute;
|
||||||
|
|
||||||
|
public @Load("@-rotator") TextureRegion rotatorRegion;
|
||||||
|
|
||||||
public SolidPump(String name){
|
public SolidPump(String name){
|
||||||
super(name);
|
super(name);
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
@@ -94,8 +97,8 @@ public class SolidPump extends Pump{
|
|||||||
Draw.alpha(liquids.total() / liquidCapacity);
|
Draw.alpha(liquids.total() / liquidCapacity);
|
||||||
Draw.rect(liquidRegion, x, y);
|
Draw.rect(liquidRegion, x, y);
|
||||||
Draw.color();
|
Draw.color();
|
||||||
Draw.rect(name + "-rotator", x, y, pumpTime * rotateSpeed);
|
Draw.rect(rotatorRegion, x, y, pumpTime * rotateSpeed);
|
||||||
Draw.rect(name + "-top", x, y);
|
Draw.rect(topRegion, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=cb632c0f88ced85999a3b78e6b79e3056e1d15e1
|
archash=67e3b0ca53bfe86fd5d195cbc9ffd392f8e13e98
|
||||||
|
|||||||
Reference in New Issue
Block a user