Abstract button widget renames (#2407)

* Abstract button widget renames

Fixes #1752 and closes #1770

Signed-off-by: liach <liach@users.noreply.github.com>

* About the message

Signed-off-by: liach <liach@users.noreply.github.com>

* Update mappings/net/minecraft/client/gui/widget/ClickableWidget.mapping

Co-authored-by: enbrain <69905075+enbrain@users.noreply.github.com>

* Reword javadoc for pressable widget

Co-authored-by: liach <liach@users.noreply.github.com>
Co-authored-by: enbrain <69905075+enbrain@users.noreply.github.com>
This commit is contained in:
liach 2021-05-19 19:43:44 +07:00 committed by GitHub
parent 0510c2b069
commit 784cc5b34b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 5 deletions

View File

@ -1,2 +0,0 @@
CLASS net/minecraft/class_4264 net/minecraft/client/gui/widget/AbstractPressableButtonWidget
METHOD method_25306 onPress ()V

View File

@ -1,8 +1,11 @@
CLASS net/minecraft/class_339 net/minecraft/client/gui/widget/AbstractButtonWidget
CLASS net/minecraft/class_339 net/minecraft/client/gui/widget/ClickableWidget
COMMENT A clickable widget is a GUI element that has many methods to handle different
COMMENT mouse actions. In addition, it allows a message to be rendered on the widget
COMMENT and narrated when the widget is selected.
FIELD field_22754 message Lnet/minecraft/class_2561;
FIELD field_22755 wasHovered Z
FIELD field_22756 focused Z
FIELD field_22757 WIDGETS_LOCATION Lnet/minecraft/class_2960;
FIELD field_22757 WIDGETS_TEXTURE Lnet/minecraft/class_2960;
FIELD field_22758 width I
FIELD field_22759 height I
FIELD field_22760 x I
@ -12,6 +15,8 @@ CLASS net/minecraft/class_339 net/minecraft/client/gui/widget/AbstractButtonWidg
FIELD field_22764 visible Z
FIELD field_22765 alpha F
FIELD field_22766 nextNarration J
FIELD field_32175 UNFOCUSED_NARRATION_DELAY I
FIELD field_32176 FOCUSED_NARRATION_DELAY I
METHOD <init> (IIIILnet/minecraft/class_2561;)V
ARG 1 x
ARG 2 y
@ -34,7 +39,7 @@ CLASS net/minecraft/class_339 net/minecraft/client/gui/widget/AbstractButtonWidg
ARG 1 matrices
ARG 2 mouseX
ARG 3 mouseY
METHOD method_25353 renderBg (Lnet/minecraft/class_4587;Lnet/minecraft/class_310;II)V
METHOD method_25353 renderBackground (Lnet/minecraft/class_4587;Lnet/minecraft/class_310;II)V
ARG 1 matrices
ARG 2 client
ARG 3 mouseX
@ -62,6 +67,7 @@ CLASS net/minecraft/class_339 net/minecraft/client/gui/widget/AbstractButtonWidg
METHOD method_25362 queueNarration (I)V
ARG 1 delay
METHOD method_25363 onFocusedChanged (Z)V
ARG 1 newFocused
METHOD method_25364 getHeight ()I
METHOD method_25365 setFocused (Z)V
ARG 1 focused

View File

@ -0,0 +1,4 @@
CLASS net/minecraft/class_4264 net/minecraft/client/gui/widget/PressableWidget
COMMENT A pressable widget has a press action. It is pressed when it is clicked. It is
COMMENT also pressed when enter or space keys are pressed when it is selected.
METHOD method_25306 onPress ()V

View File

@ -0,0 +1,7 @@
v2
constant clickable_widget_narration_delay net/minecraft/client/gui/widget/ClickableWidget FOCUSED_NARRATION_DELAY
constant clickable_widget_narration_delay net/minecraft/client/gui/widget/ClickableWidget UNFOCUSED_NARRATION_DELAY
target_method net/minecraft/client/gui/widget/ClickableWidget queueNarration (I)V
param 0 clickable_widget_narration_delay