@@ -57,8 +57,8 @@ public class TriggerEditorList extends OptionList {
5757 private boolean restyle ;
5858 private MultiLineTextField textDisplayField ;
5959 private String displayText = "" ;
60- private TextField keyDisplayField ;
61- private String displayKey = "" ;
60+ private MultiLineTextField keyDisplayField ;
61+ private String displayKeys = "" ;
6262
6363 public TriggerEditorList (
6464 Minecraft mc ,
@@ -116,13 +116,17 @@ protected void addEntries() {
116116 ));
117117
118118 // Key display field
119- keyDisplayField = new TextField (dynWideEntryX , 0 , dynWideEntryWidth , entryHeight );
120- keyDisplayField .setMaxLength (256 );
121- keyDisplayField .setValue (displayKey );
122- addEntry (new Entry .DisplayField (
119+ keyDisplayField = new MultiLineTextField (
123120 dynWideEntryX ,
121+ 0 ,
124122 dynWideEntryWidth ,
125- entryHeight ,
123+ entryHeight
124+ );
125+ keyDisplayField .setValue (displayKeys );
126+ addSpacedEntry (new Entry .DisplayField (
127+ dynWideEntryX ,
128+ dynWideEntryWidth ,
129+ entryHeight + itemHeight ,
126130 keyDisplayField ,
127131 localized ("option" , "notif.trigger.editor.display.key" )
128132 ));
@@ -141,9 +145,9 @@ private void setTextDisplayValue(String text) {
141145 textDisplayField .setValue (displayText );
142146 }
143147
144- private void setKeyDisplayValue (String key ) {
145- displayKey = key ;
146- keyDisplayField .setValue (displayKey );
148+ private void setKeyDisplayValue (String keys ) {
149+ displayKeys = keys ;
150+ keyDisplayField .setValue (displayKeys );
147151 }
148152
149153 // Chat message list
@@ -503,12 +507,26 @@ private static class MessageEntry extends Entry {
503507 @ Override
504508 public boolean mouseClicked (double mouseX , double mouseY , int button ) {
505509 list .setTextDisplayValue (FormatUtil .stripCodes (msg .getString ()));
506- list .setKeyDisplayValue (msg .getContents () instanceof TranslatableContents tc
507- ? tc .getKey ()
508- : localized ("option" , "notif.trigger.editor.display.key.none" ).getString ());
510+
511+ List <String > keys = new ArrayList <>();
512+ getKeys (msg , keys );
513+ list .setKeyDisplayValue (keys .isEmpty ()
514+ ? localized ("option" , "notif.trigger.editor.display.key.none" ).getString ()
515+ : String .join ("\n " , keys ));
516+
509517 list .setScrollAmount (0 );
510518 return true ;
511519 }
520+
521+ private static void getKeys (Component msg , List <String > keys ) {
522+ if (msg .getContents () instanceof TranslatableContents tc ) {
523+ keys .add (tc .getKey ());
524+ }
525+
526+ for (Component sibling : msg .getSiblings ()) {
527+ getKeys (sibling , keys );
528+ }
529+ }
512530 }
513531 }
514532}
0 commit comments