@@ -28,6 +28,7 @@ use crate::{
2828pub struct EntityListPanel {
2929 gl : Arc < glow:: Context > ,
3030 entity_renderer : Option < EntityFrame > ,
31+ entity_label : String ,
3132
3233 entity_previews : FnvHashMap < u32 , Option < egui:: TextureHandle > > ,
3334
@@ -95,6 +96,7 @@ impl EntityListPanel {
9596 textures : Self :: load_textures ( & gl, textures) ,
9697 gl,
9798 entity_renderer : None ,
99+ entity_label : String :: new ( ) ,
98100 entities,
99101 skins,
100102 ref_entities,
@@ -139,10 +141,7 @@ impl EntityListPanel {
139141 self . entity_renderer = None ;
140142 return ;
141143 }
142- ui. heading ( format ! (
143- "{:x}" ,
144- self . entity_renderer. as_ref( ) . unwrap( ) . hashcode
145- ) ) ;
144+ ui. heading ( & self . entity_label ) ;
146145 } ) ;
147146 }
148147
@@ -247,6 +246,13 @@ impl EntityListPanel {
247246 . on_hover_cursor ( egui:: CursorIcon :: PointingHand )
248247 . clicked ( )
249248 {
249+ self . entity_label = match ty {
250+ 0 => format ! ( "Entity {:x}" , i) ,
251+ 1 => format ! ( "Ref Entity {}" , i) ,
252+ 2 => format ! ( "Animation Skin {:x}" , i) ,
253+ _ => unreachable ! ( ) ,
254+ } ;
255+
250256 if ty != 2 {
251257 self . entity_renderer = Some ( EntityFrame :: new (
252258 & self . gl ,
0 commit comments