mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-13 12:16:53 +07:00
Fixed: map mirror / crashes / mech pads / player list / mobile placement
This commit is contained in:
parent
a29f95194d
commit
8e952a550b
@ -27,7 +27,7 @@ allprojects {
|
||||
appName = 'Mindustry'
|
||||
gdxVersion = '1.9.8'
|
||||
roboVMVersion = '2.3.0'
|
||||
uCoreVersion = '7143baa7e05e4e852e0c299d631b291ca37950b0'
|
||||
uCoreVersion = '53f99fbdc50910a15b4f55e9739385f47cf800cf'
|
||||
|
||||
getVersionString = {
|
||||
String buildVersion = getBuildVersion()
|
||||
|
@ -460,7 +460,7 @@ text.none=<none>
|
||||
text.sector.corrupted=[orange]A save file for this sector was found, but loading failed.\nA new one has been created.
|
||||
text.mission.complete=Mission complete!
|
||||
text.mission.complete.body=Sector {0},{1} has been conquered.
|
||||
text.mission.resource=Obtain {0} x{1}
|
||||
text.mission.resource=Obtain {0}:\n[accent]{1}/{2}[]
|
||||
text.unit.health=[LIGHT_GRAY]Health: {0}
|
||||
text.unit.speed=[LIGHT_GRAY]Speed: {0}
|
||||
block.mass-driver.name=Mass Driver
|
||||
|
@ -460,7 +460,7 @@ text.none=<none>
|
||||
text.sector.corrupted=[orange]A save file for this sector was found, but loading failed.\nA new one has been created.
|
||||
text.mission.complete=Mission complete!
|
||||
text.mission.complete.body=Sector {0},{1} has been conquered.
|
||||
text.mission.resource=Obtain {0} x{1}
|
||||
text.mission.resource=Obtain {0}:\n[accent]{1}/{2}[]
|
||||
text.unit.health=[LIGHT_GRAY]Health: {0}
|
||||
text.unit.speed=[LIGHT_GRAY]Speed: {0}
|
||||
block.mass-driver.name=Mass Driver
|
||||
|
@ -474,7 +474,7 @@ text.none=<없음>
|
||||
text.sector.corrupted=[orange]저장 파일에서 구역을 발견했으나 불러오지 못했습니다.\n새로 생성되었습니다.
|
||||
text.mission.complete=미션 성공!
|
||||
text.mission.complete.body=구역 {0},{1} 탐색 성공.
|
||||
text.mission.resource=Obtain {0} x{1}
|
||||
text.mission.resource=Obtain {0}:\n[accent]{1}/{2}[]
|
||||
text.unit.health=[LIGHT_GRAY]체력:{0}
|
||||
text.unit.speed=[LIGHT_GRAY]속도:{0}
|
||||
block.mass-driver.name=물질 이동기
|
||||
|
@ -460,7 +460,7 @@ text.none=<none>
|
||||
text.sector.corrupted=[orange]A save file for this sector was found, but loading failed.\nA new one has been created.
|
||||
text.mission.complete=Mission complete!
|
||||
text.mission.complete.body=Sector {0},{1} has been conquered.
|
||||
text.mission.resource=Obtain {0} x{1}
|
||||
text.mission.resource=Obtain {0}:\n[accent]{1}/{2}[]
|
||||
text.unit.health=[LIGHT_GRAY]Health: {0}
|
||||
text.unit.speed=[LIGHT_GRAY]Speed: {0}
|
||||
block.mass-driver.name=Mass Driver
|
||||
|
@ -459,7 +459,7 @@ text.none=<none>
|
||||
text.sector.corrupted=[orange]Um arquivo de save Foi encontrado neste setor, Mas o login falhou.\nUm novo foi criado.
|
||||
text.mission.complete=Mission complete!
|
||||
text.mission.complete.body=Sector {0},{1} has been conquered.
|
||||
text.mission.resource=Obtain {0} x{1}
|
||||
text.mission.resource=Obtain {0}:\n[accent]{1}/{2}[]
|
||||
text.join.info=Here, you can enter a [accent]server IP[] to connect to, or discover [accent]local network[] servers to connect to.\nBoth LAN and WAN multiplayer is supported.\n\n[LIGHT_GRAY]Note: There is no automatic global server list; if you want to connect to someone by IP, you would need to ask the host for their IP.
|
||||
text.unit.health=[LIGHT_GRAY]Health: {0}
|
||||
text.unit.speed=[LIGHT_GRAY]Speed: {0}
|
||||
|
@ -460,7 +460,7 @@ text.none=<none>
|
||||
text.sector.corrupted=[orange]A save file for this sector was found, but loading failed.\nA new one has been created.
|
||||
text.mission.complete=Mission complete!
|
||||
text.mission.complete.body=Sector {0},{1} has been conquered.
|
||||
text.mission.resource=Obtain {0} x{1}
|
||||
text.mission.resource=Obtain {0}:\n[accent]{1}/{2}[]
|
||||
text.unit.health=[LIGHT_GRAY]Health: {0}
|
||||
text.unit.speed=[LIGHT_GRAY]Speed: {0}
|
||||
block.mass-driver.name=Mass Driver
|
||||
|
@ -460,7 +460,7 @@ text.none=<none>
|
||||
text.sector.corrupted=[orange]A save file for this sector was found, but loading failed.\nA new one has been created.
|
||||
text.mission.complete=Mission complete!
|
||||
text.mission.complete.body=Sector {0},{1} has been conquered.
|
||||
text.mission.resource=Obtain {0} x{1}
|
||||
text.mission.resource=Obtain {0}:\n[accent]{1}/{2}[]
|
||||
text.unit.health=[LIGHT_GRAY]Health: {0}
|
||||
text.unit.speed=[LIGHT_GRAY]Speed: {0}
|
||||
block.mass-driver.name=Mass Driver
|
||||
|
@ -75,7 +75,7 @@ public class WaveSpawner{
|
||||
int amount = group.getGroupsSpawned(state.wave);
|
||||
if(group.type.isFlying){
|
||||
flyGroups += amount;
|
||||
}else{
|
||||
}else if(dynamicSpawn){
|
||||
groundGroups += amount;
|
||||
}
|
||||
}
|
||||
@ -109,6 +109,8 @@ public class WaveSpawner{
|
||||
float spawnX, spawnY;
|
||||
float spread;
|
||||
|
||||
if(!group.type.isFlying && groundCount >= groundSpawns.size) continue;
|
||||
|
||||
if(group.type.isFlying){
|
||||
FlyerSpawn spawn = flySpawns.get(flyCount);
|
||||
//TODO verify flyer spawn
|
||||
@ -119,7 +121,7 @@ public class WaveSpawner{
|
||||
spread = margin / 1.5f;
|
||||
|
||||
flyCount++;
|
||||
}else{
|
||||
}else{ //make sure it works for non-dynamic spawns
|
||||
GroundSpawn spawn = groundSpawns.get(groundCount);
|
||||
|
||||
if(dynamicSpawn){
|
||||
|
@ -12,7 +12,6 @@ import io.anuke.annotations.Annotations.Variant;
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.entities.traits.BuilderTrait.BuildRequest;
|
||||
import io.anuke.mindustry.entities.traits.SyncTrait;
|
||||
import io.anuke.mindustry.entities.traits.TypeTrait;
|
||||
@ -24,6 +23,7 @@ import io.anuke.mindustry.net.NetworkIO;
|
||||
import io.anuke.mindustry.net.Packets.*;
|
||||
import io.anuke.mindustry.net.TraceInfo;
|
||||
import io.anuke.mindustry.net.ValidateException;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.modules.InventoryModule;
|
||||
import io.anuke.ucore.core.Core;
|
||||
import io.anuke.ucore.core.Settings;
|
||||
@ -292,9 +292,9 @@ public class NetClient extends Module{
|
||||
byte cores = input.readByte();
|
||||
for(int i = 0; i < cores; i++){
|
||||
int pos = input.readInt();
|
||||
TileEntity entity = world.tile(pos).entity;
|
||||
if(entity != null){
|
||||
entity.items.read(input);
|
||||
Tile tile = world.tile(pos);
|
||||
if(tile != null && tile.entity != null){
|
||||
tile.entity.items.read(input);
|
||||
}else{
|
||||
new InventoryModule().read(input);
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ public class ItemTransfer extends TimedEntity implements DrawTrait{
|
||||
|
||||
@Remote(called = Loc.server)
|
||||
public static void transferItemTo(Item item, int amount, float x, float y, Tile tile){
|
||||
if(tile == null) return;
|
||||
if(tile == null || tile.entity == null || tile.entity.items == null) return;
|
||||
for(int i = 0; i < Mathf.clamp(amount / 3, 1, 8); i++){
|
||||
Timers.run(i * 3, () -> create(item, x, y, tile, () -> {
|
||||
}));
|
||||
|
@ -14,7 +14,7 @@ public interface TypeTrait{
|
||||
*/
|
||||
static <T extends TypeTrait> void registerType(Class<T> type, Supplier<T> supplier){
|
||||
if(typeToID.get(type, -1) != -1){
|
||||
throw new RuntimeException("Type is already registered: '" + type + "'!");
|
||||
return; //already registered
|
||||
}
|
||||
|
||||
registeredTypes.add(supplier);
|
||||
|
@ -107,6 +107,7 @@ public class DesktopInput extends InputHandler{
|
||||
}
|
||||
}
|
||||
|
||||
Draw.color(Palette.remove);
|
||||
Lines.rect(result.x, result.y, result.x2 - result.x, result.y2 - result.y);
|
||||
}else if(isPlacing()){
|
||||
if(recipe.result.rotate){
|
||||
|
@ -178,11 +178,13 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
request.recipe.result.rotate ? request.rotation * 90 : 0);
|
||||
}
|
||||
}else{
|
||||
float rad = (tile.block().size * tilesize / 2f - 1) * request.scale;
|
||||
Draw.alpha(0f);
|
||||
//draw removing request
|
||||
Draw.color(Palette.removeBack);
|
||||
Lines.square(tile.drawx(), tile.drawy()-1, tile.block().size * tilesize / 2f);
|
||||
Draw.color(Palette.remove);
|
||||
Lines.square(tile.drawx(), tile.drawy(), tile.block().size * tilesize / 2f);
|
||||
Draw.tint(Palette.removeBack);
|
||||
Lines.square(tile.drawx(), tile.drawy()-1, rad);
|
||||
Draw.tint(Palette.remove);
|
||||
Lines.square(tile.drawx(), tile.drawy(), rad);
|
||||
}
|
||||
}
|
||||
|
||||
@ -242,7 +244,7 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
}
|
||||
}
|
||||
|
||||
//move all current requests to removal array to they fade out
|
||||
//move all current requests to removal array so they fade out
|
||||
removals.addAll(selection);
|
||||
selection.clear();
|
||||
selecting = false;
|
||||
@ -383,12 +385,13 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
other = other.target();
|
||||
|
||||
Draw.color(Palette.removeBack);
|
||||
Lines.square(other.drawx(), other.drawy()-1, other.block().size * tilesize / 2f);
|
||||
Lines.square(other.drawx(), other.drawy()-1, other.block().size * tilesize / 2f - 1);
|
||||
Draw.color(Palette.remove);
|
||||
Lines.square(other.drawx(), other.drawy(), other.block().size * tilesize / 2f);
|
||||
Lines.square(other.drawx(), other.drawy(), other.block().size * tilesize / 2f - 1);
|
||||
}
|
||||
}
|
||||
|
||||
Draw.color(Palette.remove);
|
||||
Lines.rect(result.x, result.y, result.x2 - result.x, result.y2 - result.y);
|
||||
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ public class MapIO{
|
||||
|
||||
for(int x = 0; x < data.width(); x++){
|
||||
for(int y = 0; y < data.height(); y++){
|
||||
int color = pixmap.getPixel(y, pixmap.getWidth() - 1 - x);
|
||||
int color = pixmap.getPixel(x, pixmap.getHeight() - 1 - y);
|
||||
LegacyBlock block = LegacyColorMapper.get(color);
|
||||
|
||||
data.write(x, y, DataPosition.floor, block.floor.id);
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.anuke.mindustry.ui.fragments;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
@ -8,6 +9,7 @@ import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.mindustry.net.NetConnection;
|
||||
import io.anuke.mindustry.net.Packets.AdminAction;
|
||||
import io.anuke.ucore.core.Core;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.graphics.Lines;
|
||||
@ -36,6 +38,10 @@ public class PlayerListFragment extends Fragment{
|
||||
|
||||
if(visible && Timers.get("player-list-rebuild", 20)){
|
||||
rebuild();
|
||||
content.pack();
|
||||
content.act(Gdx.graphics.getDeltaTime());
|
||||
//TODO hack
|
||||
Core.scene.act(0f);
|
||||
}
|
||||
});
|
||||
|
||||
@ -104,7 +110,7 @@ public class PlayerListFragment extends Fragment{
|
||||
|
||||
t.addImageButton("icon-ban", 14 * 2,
|
||||
() -> ui.showConfirm("$text.confirm", "$text.confirmban", () -> Call.onAdminRequest(player, AdminAction.ban))).padBottom(-5.1f);
|
||||
t.addImageButton("icon-cancel", 14 * 2,
|
||||
t.addImageButton("icon-cancel", 16 * 2,
|
||||
() -> ui.showConfirm("$text.confirm", "$text.confirmkick", () -> Call.onAdminRequest(player, AdminAction.kick))).padBottom(-5.1f);
|
||||
|
||||
t.row();
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.anuke.mindustry.world.consumers;
|
||||
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
|
||||
public class ConsumePowerExact extends ConsumePower{
|
||||
@ -8,7 +9,8 @@ public class ConsumePowerExact extends ConsumePower{
|
||||
super(use);
|
||||
}
|
||||
|
||||
protected float use(Block block){
|
||||
@Override
|
||||
protected float use(Block block, TileEntity entity){
|
||||
return this.use;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user