New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ElytaHud #147
base: master
Are you sure you want to change the base?
ElytaHud #147
Conversation
|
||
public static final Identifier ID = new Identifier("kronhud", "elytrahud"); | ||
|
||
private final KronColor firstColor = new KronColor("positivespeed", ID.getPath(), ColorUtil.SELECTOR_GREEN); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add translations for these keys.
drawString(context, textRenderer, Text.of("VSpeed: "), pos.x()+3, pos.y()+3, thirdColor.getValue().color(), true); | ||
int currPos = textRenderer.getWidth("VSpeed: "); | ||
|
||
drawString(context, textRenderer, Text.of(String.valueOf(verticalSpeed)), pos.x()+3+currPos, pos.y()+3, vspeedColor.getValue().color(), true); | ||
currPos += textRenderer.getWidth(String.valueOf(verticalSpeed)); | ||
|
||
drawString(context, textRenderer, Text.of(" BPS"), pos.x()+3+currPos, pos.y()+3, thirdColor.getValue().color(), true); | ||
|
||
drawString(context, textRenderer, Text.of("HSpeed: "), pos.x()+3, pos.y()+13, thirdColor.getValue().color(), true); | ||
currPos = textRenderer.getWidth("HSpeed: "); | ||
|
||
drawString(context, textRenderer, Text.of(String.valueOf(horizontalSpeed)), pos.x()+3+currPos, pos.y()+13, hspeedColor.getValue().color(), true); | ||
currPos += textRenderer.getWidth(String.valueOf(horizontalSpeed)); | ||
|
||
drawString(context, textRenderer, Text.of(" BPS"), pos.x()+3+currPos, pos.y()+13, thirdColor.getValue().color(), true); | ||
currPos = 0; | ||
|
||
drawString(context, textRenderer, Text.of("Distance: "), pos.x()+3, pos.y()+23, thirdColor.getValue().color(), true); | ||
currPos = textRenderer.getWidth("Distance: "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These strings would benefit of translations as well
drawString(context, textRenderer, Text.of("VSpeed: "), pos.x()+3, pos.y()+3, thirdColor.getValue().color(), true); | ||
int currPos = textRenderer.getWidth("VSpeed: "); | ||
|
||
drawString(context, textRenderer, Text.of(String.valueOf(0d)), pos.x()+3+currPos, pos.y()+3, fourthColor.getValue().color(), true); | ||
currPos += textRenderer.getWidth(String.valueOf(0d)); | ||
|
||
drawString(context, textRenderer, Text.of(" BPS"), pos.x()+3+currPos, pos.y()+3, thirdColor.getValue().color(), true); | ||
|
||
drawString(context, textRenderer, Text.of("HSpeed: "), pos.x()+3, pos.y()+13, thirdColor.getValue().color(), true); | ||
currPos = textRenderer.getWidth("HSpeed: "); | ||
|
||
drawString(context, textRenderer, Text.of(String.valueOf(0d)), pos.x()+3+currPos, pos.y()+13, fourthColor.getValue().color(), true); | ||
currPos += textRenderer.getWidth(String.valueOf(0d)); | ||
|
||
drawString(context, textRenderer, Text.of(" BPS"), pos.x()+3+currPos, pos.y()+13, thirdColor.getValue().color(), true); | ||
currPos = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These as well
@Override | ||
public int getWidth() { | ||
return this.width; | ||
} | ||
|
||
@Override | ||
public int getHeight() { | ||
return this.height; | ||
} | ||
|
||
@Override | ||
public void setWidth(int width) { | ||
this.width = width; | ||
} | ||
|
||
@Override | ||
public void setHeight(int height) { | ||
this.height = height; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These methods are very likely just the same as in the superclass and therefore unnecessary
Added ElytraHud, which allows to calculate distance, that will be traveled on elytra
Fixed version in readme