Added content unlock menu

This commit is contained in:
Anuken
2018-06-29 19:47:47 -04:00
parent b4151a256b
commit bebc1a22f3
25 changed files with 946 additions and 704 deletions

View File

@@ -8,8 +8,11 @@ import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.game.Team;
import io.anuke.mindustry.game.UnlockableContent;
import io.anuke.mindustry.type.Weapon;
import io.anuke.mindustry.ui.ContentDisplay;
import io.anuke.ucore.function.Supplier;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.scene.ui.layout.Table;
import io.anuke.ucore.util.Bundles;
//TODO merge unit type with mech
public class UnitType implements UnlockableContent{
@@ -54,6 +57,21 @@ public class UnitType implements UnlockableContent{
TypeTrait.registerType(type, mainConstructor);
}
@Override
public void displayInfo(Table table) {
ContentDisplay.displayUnit(table, this);
}
@Override
public String localizedName() {
return Bundles.get("unit." + name + ".name");
}
@Override
public TextureRegion getContentIcon() {
return iconRegion;
}
@Override
public void load() {
iconRegion = Draw.region("unit-icon-" + name);