argh
This commit is contained in:
@@ -338,7 +338,7 @@ public class SchematicsDialog extends BaseDialog{
|
||||
for(ItemStack s : arr){
|
||||
r.image(s.item.icon(Cicon.small)).left();
|
||||
r.label(() -> {
|
||||
Tilec core = player.core();
|
||||
Building core = player.core();
|
||||
if(core == null || state.rules.infiniteResources || core.items().has(s.item, s.amount)) return "[lightgray]" + s.amount + "";
|
||||
return (core.items().has(s.item, s.amount) ? "[lightgray]" : "[scarlet]") + Math.min(core.items().get(s.item), s.amount) + "[lightgray]/" + s.amount;
|
||||
}).padLeft(2).left().padRight(4);
|
||||
|
||||
@@ -14,7 +14,7 @@ public class TraceDialog extends BaseDialog{
|
||||
setFillParent(false);
|
||||
}
|
||||
|
||||
public void show(Playerc player, TraceInfo info){
|
||||
public void show(Player player, TraceInfo info){
|
||||
cont.clear();
|
||||
|
||||
Table table = new Table(Tex.clear);
|
||||
|
||||
@@ -13,7 +13,7 @@ import static mindustry.Vars.*;
|
||||
|
||||
public class BlockConfigFragment extends Fragment{
|
||||
private Table table = new Table();
|
||||
private Tilec configTile;
|
||||
private Building configTile;
|
||||
|
||||
@Override
|
||||
public void build(Group parent){
|
||||
@@ -38,11 +38,11 @@ public class BlockConfigFragment extends Fragment{
|
||||
return table.isVisible() && configTile != null;
|
||||
}
|
||||
|
||||
public Tilec getSelectedTile(){
|
||||
public Building getSelectedTile(){
|
||||
return configTile;
|
||||
}
|
||||
|
||||
public void showConfig(Tilec tile){
|
||||
public void showConfig(Building tile){
|
||||
if(tile.configTapped()){
|
||||
configTile = tile;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public class BlockInventoryFragment extends Fragment{
|
||||
private final static float holdShrink = 120f;
|
||||
|
||||
private Table table = new Table();
|
||||
private Tilec tile;
|
||||
private Building tile;
|
||||
private float holdTime = 0f, emptyTime;
|
||||
private boolean holding;
|
||||
private float[] shrinkHoldTimes = new float[content.items().size];
|
||||
@@ -43,7 +43,7 @@ public class BlockInventoryFragment extends Fragment{
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server, targets = Loc.both, forward = true)
|
||||
public static void requestItem(Playerc player, Tilec tile, Item item, int amount){
|
||||
public static void requestItem(Player player, Building tile, Item item, int amount){
|
||||
if(player == null || tile == null || !tile.interactable(player.team())) return;
|
||||
amount = Mathf.clamp(amount, 0, player.unit().itemCapacity());
|
||||
int fa = amount;
|
||||
@@ -71,13 +71,13 @@ public class BlockInventoryFragment extends Fragment{
|
||||
parent.addChild(table);
|
||||
}
|
||||
|
||||
public void showFor(Tilec t){
|
||||
public void showFor(Building t){
|
||||
if(this.tile == t){
|
||||
hide();
|
||||
return;
|
||||
}
|
||||
this.tile = t;
|
||||
if(tile == null || !tile.block().isAccessible() || tile.items().total() == 0)
|
||||
if(tile == null || !tile.block().isAccessible() || tile.items.total() == 0)
|
||||
return;
|
||||
rebuild(true);
|
||||
}
|
||||
@@ -109,7 +109,7 @@ public class BlockInventoryFragment extends Fragment{
|
||||
if(state.isMenu() || tile == null || !tile.isValid() || !tile.block().isAccessible() || emptyTime >= holdShrink){
|
||||
hide();
|
||||
}else{
|
||||
if(tile.items().total() == 0){
|
||||
if(tile.items.total() == 0){
|
||||
emptyTime += Time.delta();
|
||||
}else{
|
||||
emptyTime = 0f;
|
||||
@@ -119,7 +119,7 @@ public class BlockInventoryFragment extends Fragment{
|
||||
holdTime += Time.delta();
|
||||
|
||||
if(holdTime >= holdWithdraw){
|
||||
int amount = Math.min(tile.items().get(lastItem), player.unit().maxAccepted(lastItem));
|
||||
int amount = Math.min(tile.items.get(lastItem), player.unit().maxAccepted(lastItem));
|
||||
Call.requestItem(player, tile, lastItem, amount);
|
||||
holding = false;
|
||||
holdTime = 0f;
|
||||
@@ -134,7 +134,7 @@ public class BlockInventoryFragment extends Fragment{
|
||||
if(shrinkHoldTimes.length != content.items().size) shrinkHoldTimes = new float[content.items().size];
|
||||
|
||||
for(int i = 0; i < content.items().size; i++){
|
||||
boolean has = tile.items().has(content.item(i));
|
||||
boolean has = tile.items.has(content.item(i));
|
||||
boolean had = container.contains(i);
|
||||
if(has){
|
||||
shrinkHoldTimes[i] = 0f;
|
||||
@@ -159,7 +159,7 @@ public class BlockInventoryFragment extends Fragment{
|
||||
|
||||
for(int i = 0; i < content.items().size; i++){
|
||||
Item item = content.item(i);
|
||||
if(!tile.items().has(item)) continue;
|
||||
if(!tile.items.has(item)) continue;
|
||||
|
||||
container.add(i);
|
||||
|
||||
@@ -172,14 +172,14 @@ public class BlockInventoryFragment extends Fragment{
|
||||
if(tile == null || !tile.isValid()){
|
||||
return "";
|
||||
}
|
||||
return round(tile.items().get(item));
|
||||
return round(tile.items.get(item));
|
||||
});
|
||||
image.addListener(l);
|
||||
|
||||
image.addListener(new InputListener(){
|
||||
@Override
|
||||
public boolean touchDown(InputEvent event, float x, float y, int pointer, KeyCode button){
|
||||
if(!canPick.get() || tile == null || !tile.isValid() || tile.items() == null || !tile.items().has(item)) return false;
|
||||
if(!canPick.get() || tile == null || !tile.isValid() || tile.items == null || !tile.items.has(item)) return false;
|
||||
int amount = Math.min(1, player.unit().maxAccepted(item));
|
||||
if(amount > 0){
|
||||
Call.requestItem(player, tile, item, amount);
|
||||
|
||||
@@ -373,7 +373,7 @@ public class HudFragment extends Fragment{
|
||||
}
|
||||
|
||||
@Remote(targets = Loc.both, forward = true, called = Loc.both)
|
||||
public static void setPlayerTeamEditor(Playerc player, Team team){
|
||||
public static void setPlayerTeamEditor(Player player, Team team){
|
||||
if(state.isEditor() && player != null){
|
||||
player.team(team);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ public class PlacementFragment extends Fragment{
|
||||
scrollPositions.put(currentCategory, blockPane.getScrollY());
|
||||
|
||||
if(Core.input.keyDown(Binding.pick) && player.isBuilder()){ //mouse eyedropper select
|
||||
Tilec tile = world.entWorld(Core.input.mouseWorld().x, Core.input.mouseWorld().y);
|
||||
Building tile = world.entWorld(Core.input.mouseWorld().x, Core.input.mouseWorld().y);
|
||||
Block tryRecipe = tile == null ? null : tile.block();
|
||||
Object tryConfig = tile == null ? null : tile.config();
|
||||
|
||||
@@ -224,7 +224,7 @@ public class PlacementFragment extends Fragment{
|
||||
button.resizeImage(Cicon.medium.size);
|
||||
|
||||
button.update(() -> { //color unplacable things gray
|
||||
Tilec core = player.core();
|
||||
Building core = player.core();
|
||||
Color color = (state.rules.infiniteResources || (core != null && (core.items().has(block.requirements, state.rules.buildCostMultiplier) || state.rules.infiniteResources))) && player.isBuilder() ? Color.white : Color.gray;
|
||||
button.forEach(elem -> elem.setColor(color));
|
||||
button.setChecked(control.input.block == block);
|
||||
@@ -317,7 +317,7 @@ public class PlacementFragment extends Fragment{
|
||||
line.image(stack.item.icon(Cicon.small)).size(8 * 2);
|
||||
line.add(stack.item.localizedName).maxWidth(140f).fillX().color(Color.lightGray).padLeft(2).left().get().setEllipsis(true);
|
||||
line.labelWrap(() -> {
|
||||
Tilec core = player.core();
|
||||
Building core = player.core();
|
||||
if(core == null || state.rules.infiniteResources) return "*/*";
|
||||
|
||||
int amount = core.items().get(stack.item);
|
||||
@@ -442,7 +442,7 @@ public class PlacementFragment extends Fragment{
|
||||
if(Core.scene.hasMouse() || topTable.hit(v.x, v.y, false) != null) return null;
|
||||
|
||||
//check for a unit
|
||||
Unitc unit = Units.closestOverlap(player.team(), Core.input.mouseWorldX(), Core.input.mouseWorldY(), 5f, u -> !u.isLocal());
|
||||
Unit unit = Units.closestOverlap(player.team(), Core.input.mouseWorldX(), Core.input.mouseWorldY(), 5f, u -> !u.isLocal());
|
||||
//if cursor has a unit, display it
|
||||
if(unit != null) return unit;
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ public class PlayerListFragment extends Fragment{
|
||||
float h = 74f;
|
||||
found = false;
|
||||
|
||||
Groups.player.sort(Structs.comparing(Playerc::team));
|
||||
Groups.player.sort(Structs.comparing(Player::team));
|
||||
Groups.player.each(user -> {
|
||||
found = true;
|
||||
NetConnection connection = user.con();
|
||||
|
||||
Reference in New Issue
Block a user