File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed
src/TSMapEditor/UI/Windows Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -42,10 +42,26 @@ protected override void ListObjects()
4242 {
4343 Color color = lbObjectList . DefaultItemColor ;
4444 var trigger = tag . Trigger ;
45- if ( trigger != null && ! string . IsNullOrWhiteSpace ( trigger . EditorColor ) )
46- color = trigger . XNAColor ;
45+ string tagText = $ "{ tag . Name } ({ tag . ID } )";
4746
48- lbObjectList . AddItem ( new XNAListBoxItem ( ) { Text = $ "{ tag . Name } ({ tag . ID } )", TextColor = color , Tag = tag } ) ;
47+ if ( trigger != null )
48+ {
49+ if ( ! string . IsNullOrWhiteSpace ( trigger . EditorColor ) )
50+ color = trigger . XNAColor ;
51+
52+ string tagName = tag . Name ;
53+
54+ int index = tag . Name . IndexOf ( " (tag)" ) ;
55+ if ( index >= 0 )
56+ {
57+ tagName = tag . Name . Substring ( 0 , index ) . Trim ( ) ;
58+ }
59+
60+ if ( ! tagName . Equals ( trigger . Name . Trim ( ) ) )
61+ tagText += $ " [{ trigger . Name } ]";
62+ }
63+
64+ lbObjectList . AddItem ( new XNAListBoxItem ( ) { Text = tagText , TextColor = color , Tag = tag } ) ;
4965 if ( tag == SelectedObject )
5066 lbObjectList . SelectedIndex = lbObjectList . Items . Count - 1 ;
5167 }
You can’t perform that action at this time.
0 commit comments