Skip to content
Discussion options

You must be logged in to vote

I got it to work by changing generics impls of ButtonInteraction<Up/Down> to mirror the trait bounds button_system_with_generic.
So putting the SpinnerInteraction constraint on T::Item and then dealing with the lifetimes with a for<'w1, s1>.

:

#[derive(Debug, Component, Clone, Copy)]
pub struct Up<C>(Entity, PhantomData<C>);
impl<'w, 's, C, T> ButtonInteraction<Up<C>> for SpinnerParmeter<'w, 's, C, T>
where
    C: Component,
    T: SystemParam,
    for<'w1, 's1> T::Item<'w1, 's1>: SpinnerButtonInteraction<C>,
{
    fn interact(&mut self, c: &Up<C>) {
        if let Ok(c) = self.0.get(c.0) {
            self.1.increment(c)
        }
    }

    fn verify(&mut self, c: &Up<C>) -> bool {

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mendelsshop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant