Skip to content

Commit

Permalink
small change for 1.19 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
kurrycat committed Apr 29, 2023
1 parent 02bf7d4 commit 9399d5c
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import io.github.kurrycat.mpkmod.compatability.MCClasses.Renderer2D;
import io.github.kurrycat.mpkmod.util.Colors;
import io.github.kurrycat.mpkmod.util.Mouse;
import io.github.kurrycat.mpkmod.util.StringUtil;
import io.github.kurrycat.mpkmod.util.Vector2D;

import java.awt.*;
Expand All @@ -33,8 +34,12 @@ public class KeyBindingLabel extends ResizableComponent {
public KeyBindingLabel(Vector2D pos, Vector2D size, String name) {
super(pos, size);
this.name = name;
updateKeyBinding();
}

private void updateKeyBinding() {
this.keyBinding = KeyBinding.getByName(name);
this.displayName = keyBinding == null ? name : keyBinding.getDisplayName();
this.displayName = keyBinding == null ? name : StringUtil.capitalize(keyBinding.getDisplayName());
}

@JsonCreator
Expand Down

0 comments on commit 9399d5c

Please sign in to comment.