Bugfixes from testing session 1

This commit is contained in:
Anuken 2022-04-09 13:03:51 -04:00
parent 22332b53c2
commit 5d79ad9363
8 changed files with 35 additions and 10 deletions

View File

@ -1445,7 +1445,9 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
public void displayBars(Table table){
for(Func<Building, Bar> bar : block.listBars()){
table.add(bar.get(self())).growX();
var result = bar.get(self());
if(result == null) continue;
table.add(result).growX();
table.row();
}
}

View File

@ -24,7 +24,9 @@ public class Objectives{
@Override
public String display(){
return Core.bundle.format("requirement.research", content.emoji() + " " + content.localizedName);
return Core.bundle.format("requirement.research",
(content.techNode == null || content.techNode.parent == null || content.techNode.parent.content.unlocked()) && !(content instanceof Item) ?
(content.emoji() + " " + content.localizedName) : "???");
}
}
@ -44,7 +46,8 @@ public class Objectives{
@Override
public String display(){
return Core.bundle.format("requirement.produce", content.emoji() + " " + content.localizedName);
return Core.bundle.format("requirement.produce",
content.unlocked() ? (content.emoji() + " " + content.localizedName) : "???");
}
}

View File

@ -744,7 +744,14 @@ public class DesktopInput extends InputHandler{
commandBuild = null;
}
}
}else if(button == KeyCode.mouseRight){
}
return super.tap(x, y, count, button);
}
@Override
public boolean touchDown(float x, float y, int pointer, KeyCode button){
if(button == KeyCode.mouseRight){
//right click: move to position
//move to location - TODO right click instead?
@ -771,7 +778,7 @@ public class DesktopInput extends InputHandler{
}
}
return super.tap(x, y, count, button);
return super.touchDown(x, y, pointer, button);
}
@Override

View File

@ -372,7 +372,11 @@ public class UnitType extends UnlockableContent{
if(mineTier >= 1){
stats.addPercent(Stat.mineSpeed, mineSpeed);
stats.add(Stat.mineTier, StatValues.blocks(b -> b instanceof Floor f && f.itemDrop != null && f.itemDrop.hardness <= mineTier && (!f.playerUnmineable || Core.settings.getBool("doubletapmine"))));
stats.add(Stat.mineTier, StatValues.blocks(b ->
b.itemDrop != null &&
(b instanceof Floor f && (((f.wallOre && mineWalls) || (!f.wallOre && mineFloor))) ||
(!(b instanceof Floor) && mineWalls)) &&
b.itemDrop.hardness <= mineTier && (!b.playerUnmineable || Core.settings.getBool("doubletapmine"))));
}
if(buildSpeed > 0){
stats.addPercent(Stat.buildSpeed, buildSpeed);

View File

@ -134,6 +134,8 @@ public class Block extends UnlockableContent implements Senseable{
public boolean useColor = true;
/** item that drops from this block, used for drills */
public @Nullable Item itemDrop = null;
/** if true, this block cannot be mined by players. useful for annoying things like sand. */
public boolean playerUnmineable = false;
/** Array of affinities to certain things. */
public Attributes attributes = new Attributes();
/** Health per square tile that this block occupies; essentially, this is multiplied by size * size. Overridden if health is > 0. If <0, the default is 40. */
@ -519,7 +521,7 @@ public class Block extends UnlockableContent implements Senseable{
}
public void addLiquidBar(Liquid liq){
addBar("liquid-" + liq.name, entity -> new Bar(
addBar("liquid-" + liq.name, entity -> !liq.unlocked() ? null : new Bar(
() -> liq.localizedName,
liq::barColor,
() -> entity.liquids.get(liq) / liquidCapacity

View File

@ -55,8 +55,6 @@ public class Floor extends Block{
public boolean supportsOverlay = false;
/** shallow water flag used for generation */
public boolean shallow = false;
/** if true, this block cannot be mined by players. useful for annoying things like sand. */
public boolean playerUnmineable = false;
/** Group of blocks that this block does not draw edges on. */
public Block blendGroup = this;
/** Whether this ore generates in maps by default. */

View File

@ -104,6 +104,13 @@ public class BeamNode extends PowerBlock{
}
}
@Override
public BlockStatus status(){
if(Mathf.equal(power.status, 0f, 0.001f)) return BlockStatus.noInput;
if(Mathf.equal(power.status, 1f, 0.001f)) return BlockStatus.active;
return BlockStatus.noOutput;
}
@Override
public void draw(){
super.draw();

View File

@ -145,7 +145,7 @@ public class StatValues{
return table -> table.stack(
new Image(floor.uiIcon).setScaling(Scaling.fit),
new Table(t -> t.top().right().add((multiplier < 0 ? "[scarlet]" : startZero ? "[accent]" : "[accent]+") + (int)((multiplier) * 100) + "%").style(Styles.outlineLabel))
);
).maxSize(64f);
}
public static StatValue blocks(Attribute attr, boolean floating, float scale, boolean startZero){
@ -204,6 +204,8 @@ public class StatValues{
for(int i = 0; i < list.size; i++){
var item = list.get(i);
if(item instanceof Block block && block.itemDrop != null && !block.itemDrop.unlocked()) continue;
l.image(item.uiIcon).size(iconSmall).padRight(2).padLeft(2).padTop(3).padBottom(3);
l.add(item.localizedName).left().padLeft(1).padRight(4);
if(i % 5 == 4){