@@ -71,6 +71,7 @@ void _paint_transform(struct nk_context *ctx, struct ye_entity *ent){
71
71
if (nk_button_label (ctx , "Remove Component" )){
72
72
ye_remove_transform_component (ent );
73
73
editor_unsaved ();
74
+ editor_deselect_all ();
74
75
}
75
76
76
77
nk_tree_pop (ctx );
@@ -429,6 +430,10 @@ void _paint_renderer(struct nk_context *ctx, struct ye_entity *ent){
429
430
if (nk_button_label (ctx , "Remove Component" )){
430
431
ye_remove_renderer_component (ent );
431
432
editor_unsaved ();
433
+ editor_deselect_all ();
434
+
435
+ nk_tree_pop (ctx );
436
+ return ;
432
437
}
433
438
434
439
struct SDL_Rect bounds = ye_get_position_rect (ent , YE_COMPONENT_RENDERER );
@@ -561,6 +566,9 @@ void _paint_camera(struct nk_context *ctx, struct ye_entity *ent){
561
566
if (nk_button_label (ctx , "Remove Component" )){
562
567
ye_remove_camera_component (ent );
563
568
editor_unsaved ();
569
+ editor_deselect_all ();
570
+ nk_tree_pop (ctx );
571
+ return ;
564
572
}
565
573
566
574
SDL_Rect bounds = ye_get_position_rect (ent , YE_COMPONENT_CAMERA );
@@ -601,6 +609,9 @@ void _paint_collider(struct nk_context *ctx, struct ye_entity *ent){
601
609
if (nk_button_label (ctx , "Remove Component" )){
602
610
ye_remove_collider_component (ent );
603
611
editor_unsaved ();
612
+ editor_deselect_all ();
613
+ nk_tree_pop (ctx );
614
+ return ;
604
615
}
605
616
606
617
SDL_Rect bounds = ye_get_position_rect (ent , YE_COMPONENT_COLLIDER );
@@ -641,6 +652,9 @@ void _paint_physics(struct nk_context *ctx, struct ye_entity *ent){
641
652
if (nk_button_label (ctx , "Remove Component" )){
642
653
ye_remove_physics_component (ent );
643
654
editor_unsaved ();
655
+ editor_deselect_all ();
656
+ nk_tree_pop (ctx );
657
+ return ;
644
658
}
645
659
646
660
nk_tree_pop (ctx );
@@ -676,6 +690,9 @@ void _paint_tag(struct nk_context *ctx, struct ye_entity *ent){
676
690
if (nk_button_label (ctx , "Remove Component" )){
677
691
ye_remove_tag_component (ent );
678
692
editor_unsaved ();
693
+ editor_deselect_all ();
694
+ nk_tree_pop (ctx );
695
+ return ;
679
696
}
680
697
681
698
nk_tree_pop (ctx );
@@ -835,6 +852,9 @@ void _paint_script(struct nk_context *ctx, struct ye_entity *ent){
835
852
if (nk_button_label (ctx , "Remove Component" )){
836
853
ye_remove_lua_script_component (ent );
837
854
editor_unsaved ();
855
+ editor_deselect_all ();
856
+ nk_tree_pop (ctx );
857
+ return ;
838
858
}
839
859
840
860
nk_tree_pop (ctx );
@@ -972,6 +992,10 @@ void _paint_audiosource(struct nk_context *ctx, struct ye_entity *ent){
972
992
if (nk_button_label (ctx , "Remove Component" )){
973
993
ye_remove_audiosource_component (ent );
974
994
editor_unsaved ();
995
+ editor_deselect_all ();
996
+
997
+ nk_tree_pop (ctx );
998
+ return ;
975
999
}
976
1000
977
1001
SDL_Rect circ = ye_get_position_rect (ent , YE_COMPONENT_AUDIOSOURCE );
@@ -1012,6 +1036,9 @@ void _paint_button(struct nk_context *ctx, struct ye_entity *ent){
1012
1036
if (nk_button_label (ctx , "Remove Component" )){
1013
1037
ye_remove_button_component (ent );
1014
1038
editor_unsaved ();
1039
+ editor_deselect_all ();
1040
+ nk_tree_pop (ctx );
1041
+ return ;
1015
1042
}
1016
1043
1017
1044
SDL_Rect bounds = ye_get_position_rect (ent , YE_COMPONENT_BUTTON );
0 commit comments