Fixed copper/water not getting unlocked immediately
This commit is contained in:
@@ -17,6 +17,7 @@ public class Items implements ContentList{
|
|||||||
hardness = 1;
|
hardness = 1;
|
||||||
cost = 0.6f;
|
cost = 0.6f;
|
||||||
genOre = true;
|
genOre = true;
|
||||||
|
alwaysUnlocked = true;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
lead = new Item("lead", Color.valueOf("8c7fa9")){{
|
lead = new Item("lead", Color.valueOf("8c7fa9")){{
|
||||||
|
|||||||
@@ -17,6 +17,11 @@ public class Liquids implements ContentList{
|
|||||||
tier = 0;
|
tier = 0;
|
||||||
effect = StatusEffects.wet;
|
effect = StatusEffects.wet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean alwaysUnlocked() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
lava = new Liquid("lava", Color.valueOf("e37341")){
|
lava = new Liquid("lava", Color.valueOf("e37341")){
|
||||||
|
|||||||
@@ -129,10 +129,11 @@ public class DebugBlocks extends BlockList implements ContentList{
|
|||||||
Table cont = new Table();
|
Table cont = new Table();
|
||||||
|
|
||||||
for(int i = 0; i < items.size; i++){
|
for(int i = 0; i < items.size; i++){
|
||||||
|
if(!control.unlocks().isUnlocked(items.get(i))) continue;
|
||||||
|
|
||||||
final int f = i;
|
final int f = i;
|
||||||
ImageButton button = cont.addImageButton("liquid-icon-" + items.get(i).name, "toggle", 24, () -> {
|
ImageButton button = cont.addImageButton("liquid-icon-" + items.get(i).name, "toggle", 24,
|
||||||
Call.setLiquidSourceLiquid(null, tile, items.get(f));
|
() -> Call.setLiquidSourceLiquid(null, tile, items.get(f))).size(38, 42).padBottom(-5.1f).group(group).get();
|
||||||
}).size(38, 42).padBottom(-5.1f).group(group).get();
|
|
||||||
button.setChecked(entity.source.id == f);
|
button.setChecked(entity.source.id == f);
|
||||||
|
|
||||||
if(i % 4 == 3){
|
if(i % 4 == 3){
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ public class Item extends UnlockableContent implements Comparable<Item>{
|
|||||||
public float cost = 3f;
|
public float cost = 3f;
|
||||||
/**Whether this item has ores generated for it.*/
|
/**Whether this item has ores generated for it.*/
|
||||||
public boolean genOre = false;
|
public boolean genOre = false;
|
||||||
|
/**If true, item is always unlocked.*/
|
||||||
|
public boolean alwaysUnlocked = false;
|
||||||
|
|
||||||
public Item(String name, Color color){
|
public Item(String name, Color color){
|
||||||
this.name = name;
|
this.name = name;
|
||||||
@@ -45,7 +47,7 @@ public class Item extends UnlockableContent implements Comparable<Item>{
|
|||||||
this.description = Bundles.getOrNull("item." + this.name + ".description");
|
this.description = Bundles.getOrNull("item." + this.name + ".description");
|
||||||
|
|
||||||
if(!Bundles.has("item." + this.name + ".name")){
|
if(!Bundles.has("item." + this.name + ".name")){
|
||||||
Log.err("Warning: item '" + name + "' is missing a localized name. Add the follow to bundle.properties:");
|
Log.err("Warning: item '" + name + "' is missing a localized name. Add the following to bundle.properties:");
|
||||||
Log.err("item." + this.name + ".name=" + Strings.capitalize(name.replace('-', '_')));
|
Log.err("item." + this.name + ".name=" + Strings.capitalize(name.replace('-', '_')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -54,6 +56,11 @@ public class Item extends UnlockableContent implements Comparable<Item>{
|
|||||||
this.region = Draw.region("item-" + name);
|
this.region = Draw.region("item-" + name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean alwaysUnlocked() {
|
||||||
|
return alwaysUnlocked;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void displayInfo(Table table){
|
public void displayInfo(Table table){
|
||||||
ContentDisplay.displayItem(table, this);
|
ContentDisplay.displayItem(table, this);
|
||||||
|
|||||||
Reference in New Issue
Block a user