@@ -4,15 +4,11 @@ use bevy_egui::egui;
44use crate :: YoleckInternalSchedule ;
55use crate :: entity_ref:: resolve_entity_refs;
66
7- #[ cfg( feature = "vpeol" ) ]
87use crate :: entity_ref:: validate_entity_ref_requirements_for;
98
10- #[ cfg( feature = "vpeol" ) ]
119use crate :: entity_ref:: YoleckEntityRef ;
12- #[ cfg( feature = "vpeol" ) ]
1310use crate :: prelude:: YoleckUuidRegistry ;
1411
15- #[ cfg( feature = "vpeol" ) ]
1612use std:: collections:: HashMap ;
1713
1814/// Attributes that can be applied to fields for customizing their UI
@@ -528,14 +524,12 @@ impl<T: YoleckAutoEdit> YoleckAutoEdit for [T] {
528524 }
529525}
530526
531- #[ cfg( feature = "vpeol" ) ]
532527#[ derive( Clone ) ]
533528struct EntityRefDisplayInfo {
534529 pub type_name : String ,
535530 pub name : String ,
536531}
537532
538- #[ cfg( feature = "vpeol" ) ]
539533impl YoleckAutoEdit for YoleckEntityRef {
540534 fn auto_edit ( value : & mut Self , ui : & mut egui:: Ui ) {
541535 ui. horizontal ( |ui| {
@@ -625,17 +619,12 @@ use crate::YoleckExtForApp;
625619use crate :: editing:: { YoleckEdit , YoleckUi } ;
626620use crate :: specs_registration:: YoleckComponent ;
627621
628- #[ cfg( feature = "vpeol" ) ]
629622use crate :: entity_ref:: YoleckEntityRefAccessor ;
630- #[ cfg( feature = "vpeol" ) ]
631623use bevy:: ecs:: component:: Mutable ;
632624
633- #[ cfg( feature = "vpeol" ) ]
634625use crate :: YoleckManaged ;
635- #[ cfg( feature = "vpeol" ) ]
636626use crate :: entity_uuid:: YoleckEntityUuid ;
637627
638- #[ cfg( feature = "vpeol" ) ]
639628pub fn auto_edit_system < T : YoleckComponent + YoleckAutoEdit + YoleckEntityRefAccessor > (
640629 mut ui : ResMut < YoleckUi > ,
641630 mut edit : YoleckEdit < & mut T > ,
@@ -678,24 +667,7 @@ pub fn auto_edit_system<T: YoleckComponent + YoleckAutoEdit + YoleckEntityRefAcc
678667 component. resolve_entity_refs ( registry. as_ref ( ) ) ;
679668}
680669
681- #[ cfg( not( feature = "vpeol" ) ) ]
682- pub fn auto_edit_system < T : YoleckComponent + YoleckAutoEdit > (
683- mut ui : ResMut < YoleckUi > ,
684- mut edit : YoleckEdit < & mut T > ,
685- ) {
686- let Ok ( mut component) = edit. single_mut ( ) else {
687- return ;
688- } ;
689-
690- ui. group ( |ui| {
691- ui. label ( egui:: RichText :: new ( T :: KEY ) . strong ( ) ) ;
692- ui. separator ( ) ;
693- T :: auto_edit ( & mut component, ui) ;
694- } ) ;
695- }
696-
697670pub trait YoleckAutoEditExt {
698- #[ cfg( feature = "vpeol" ) ]
699671 fn add_yoleck_auto_edit <
700672 T : Component < Mutability = Mutable >
701673 + YoleckComponent
@@ -704,13 +676,9 @@ pub trait YoleckAutoEditExt {
704676 > (
705677 & mut self ,
706678 ) ;
707-
708- #[ cfg( not( feature = "vpeol" ) ) ]
709- fn add_yoleck_auto_edit < T : YoleckComponent + YoleckAutoEdit > ( & mut self ) ;
710679}
711680
712681impl YoleckAutoEditExt for App {
713- #[ cfg( feature = "vpeol" ) ]
714682 fn add_yoleck_auto_edit <
715683 T : Component < Mutability = Mutable >
716684 + YoleckComponent
@@ -733,17 +701,4 @@ impl YoleckAutoEditExt for App {
733701 validate_entity_ref_requirements_for :: < T > ( specs) ;
734702 }
735703 }
736-
737- #[ cfg( not( feature = "vpeol" ) ) ]
738- fn add_yoleck_auto_edit < T : YoleckComponent + YoleckAutoEdit + YoleckEntityRefAccessor > (
739- & mut self ,
740- ) {
741- use crate :: YoleckInternalSchedule ;
742-
743- self . add_yoleck_edit_system ( auto_edit_system :: < T > ) ;
744- self . add_systems (
745- YoleckInternalSchedule :: PostLoadResolutions ,
746- resolve_entity_refs :: < T > ,
747- ) ;
748- }
749704}
0 commit comments