mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-30 16:28:00 +01:00
Fixed abilities not displaying the correct state when gravity is inverted and flight controls are inverted
This commit is contained in:
parent
3024ebef0f
commit
c83dedb0a4
4 changed files with 6 additions and 6 deletions
|
@ -58,7 +58,7 @@ public interface Ability<T extends Hit> {
|
|||
* The icon representing this ability on the UI and HUD.
|
||||
* @return
|
||||
*/
|
||||
default Identifier getIcon(Pony player) {
|
||||
default Identifier getIcon(Pony player, boolean swap) {
|
||||
Identifier id = Abilities.REGISTRY.getId(this);
|
||||
return new Identifier(id.getNamespace(), "textures/gui/ability/" + id.getPath() + ".png");
|
||||
}
|
||||
|
|
|
@ -23,9 +23,9 @@ public class UnicornProjectileAbility implements Ability<Hit> {
|
|||
* The icon representing this ability on the UI and HUD.
|
||||
*/
|
||||
@Override
|
||||
public Identifier getIcon(Pony player) {
|
||||
public Identifier getIcon(Pony player, boolean swap) {
|
||||
Identifier id = Abilities.REGISTRY.getId(this);
|
||||
return new Identifier(id.getNamespace(), "textures/gui/ability/" + id.getPath() + (player.getEntity().isSneaking() ? "_focused" : "_unfocused") + ".png");
|
||||
return new Identifier(id.getNamespace(), "textures/gui/ability/" + id.getPath() + (swap ? "_focused" : "_unfocused") + ".png");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -34,9 +34,9 @@ public class UnicornTeleportAbility implements Ability<Pos> {
|
|||
* The icon representing this ability on the UI and HUD.
|
||||
*/
|
||||
@Override
|
||||
public Identifier getIcon(Pony player) {
|
||||
public Identifier getIcon(Pony player, boolean swap) {
|
||||
Identifier id = Abilities.REGISTRY.getId(this);
|
||||
return new Identifier(id.getNamespace(), "textures/gui/ability/" + id.getPath() + (player.getEntity().isSneaking() ? "_far" : "_near") + ".png");
|
||||
return new Identifier(id.getNamespace(), "textures/gui/ability/" + id.getPath() + (swap ? "_far" : "_near") + ".png");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -131,7 +131,7 @@ public class UHud extends DrawableHelper {
|
|||
|
||||
void renderAbilityIcon(MatrixStack matrices, AbilityDispatcher.Stat stat, int x, int y, int u, int v, int frameWidth, int frameHeight) {
|
||||
stat.getAbility(KeyBindingsHandler.INSTANCE.page).ifPresent(ability -> {
|
||||
client.getTextureManager().bindTexture(ability.getIcon(Pony.of(client.player)));
|
||||
client.getTextureManager().bindTexture(ability.getIcon(Pony.of(client.player), client.options.keySneak.isPressed()));
|
||||
drawTexture(matrices, x, y, 0, 0, frameWidth, frameHeight, u, v);
|
||||
client.getTextureManager().bindTexture(HUD_TEXTURE);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue