Add HUD elements for tranquility (#1233)
This commit is contained in:
parent
ea47db3e5d
commit
c5b0b61315
4 changed files with 108 additions and 43 deletions
|
@ -1,6 +1,7 @@
|
|||
package WayofTime.bloodmagic.proxy;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.client.hud.Elements;
|
||||
import WayofTime.bloodmagic.util.Constants;
|
||||
import WayofTime.bloodmagic.soul.DemonWillHolder;
|
||||
import WayofTime.bloodmagic.client.IMeshProvider;
|
||||
|
@ -121,46 +122,7 @@ public class ClientProxy extends CommonProxy {
|
|||
|
||||
@Override
|
||||
public void postInit() {
|
||||
new HUDElementHolding();
|
||||
new HUDElementDemonWillAura();
|
||||
new HUDElementCornerTile.BloodAltar(true) { // Divination Sigil
|
||||
@Override
|
||||
protected void addInformation(List<Pair<Sprite, Function<TileAltar, String>>> information) {
|
||||
information.add(Pair.of(new Sprite(new ResourceLocation(BloodMagic.MODID, "textures/gui/widgets.png"), 0, 46, 16, 16), altar -> NumeralHelper.toRoman(altar.getTier().toInt())));
|
||||
information.add(Pair.of(new Sprite(new ResourceLocation(BloodMagic.MODID, "textures/gui/widgets.png"), 16, 46, 16, 16), altar -> String.format("%d/%d", altar.getCurrentBlood(), altar.getCapacity())));
|
||||
}
|
||||
};
|
||||
new HUDElementCornerTile.BloodAltar(false) { // Seer Sigil
|
||||
@Override
|
||||
protected void addInformation(List<Pair<Sprite, Function<TileAltar, String>>> information) {
|
||||
information.add(Pair.of(
|
||||
new Sprite(new ResourceLocation(BloodMagic.MODID, "textures/gui/widgets.png"), 0, 46, 16, 16),
|
||||
altar -> NumeralHelper.toRoman(altar.getTier().toInt())
|
||||
));
|
||||
information.add(Pair.of(
|
||||
new Sprite(new ResourceLocation(BloodMagic.MODID, "textures/gui/widgets.png"), 16, 46, 16, 16),
|
||||
altar -> String.format("%d/%d", altar.getCurrentBlood(), altar.getCapacity())
|
||||
));
|
||||
information.add(Pair.of( // Craft Progress
|
||||
new Sprite(new ResourceLocation(BloodMagic.MODID, "textures/gui/widgets.png"), 32, 46, 16, 16),
|
||||
altar -> {
|
||||
if (!altar.isActive())
|
||||
return "Inactive"; // FIXME localize
|
||||
int progress = altar.getProgress();
|
||||
int totalLiquidRequired = altar.getLiquidRequired() * altar.getStackInSlot(0).getCount();
|
||||
return String.format("%d/%d", progress, totalLiquidRequired);
|
||||
}
|
||||
));
|
||||
information.add(Pair.of(
|
||||
new Sprite(new ResourceLocation(BloodMagic.MODID, "textures/gui/widgets.png"), 48, 46, 16, 16),
|
||||
altar -> String.valueOf((int) (altar.getConsumptionRate() * (altar.getConsumptionMultiplier() + 1)))
|
||||
));
|
||||
information.add(Pair.of(
|
||||
new Sprite(new ResourceLocation(BloodMagic.MODID, "textures/gui/widgets.png"), 64, 46, 16, 16),
|
||||
altar -> String.valueOf(altar.getTotalCharge())
|
||||
));
|
||||
}
|
||||
};
|
||||
Elements.createHUDElements();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue