Skip to content

Commit

Permalink
Abstract button widget renames (FabricMC#2407)
Browse files Browse the repository at this point in the history
* Abstract button widget renames

Fixes FabricMC#1752 and closes FabricMC#1770

Signed-off-by: liach <[email protected]>

* About the message

Signed-off-by: liach <[email protected]>

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

Co-authored-by: enbrain <[email protected]>

* Reword javadoc for pressable widget

Co-authored-by: liach <[email protected]>
Co-authored-by: enbrain <[email protected]>
  • Loading branch information
3 people authored May 19, 2021
1 parent 0510c2b commit 784cc5b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions unpick-definitions/gui_widget.unpick
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 784cc5b

Please sign in to comment.