Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Just a TimerBar. #4

Closed
Quadster opened this issue Oct 18, 2020 · 1 comment
Closed

Just a TimerBar. #4

Quadster opened this issue Oct 18, 2020 · 1 comment
Labels
priority: p4 not applicable Not a bug nor a feature status: completed The feature has been completed of the bug has been patched type: question A simple question

Comments

@Quadster
Copy link

There is no way of just using a TimerBar without menu. Or I am doing something wrong.. I have tried several diffrent approaches before opening the issue. I can use it if I use a collection with inside only the TimerBarProgress, but Visible bool is actually acting weird.

   class Bar : Script
    {
        private static float NewProgress = 0f;
        private static readonly ObjectPool pool = new ObjectPool();
        private static readonly TimerBar bar = new TimerBarProgress("Progress") { Progress = NewProgress };

        public Bar()
        {
            pool.Add(bar);
            
            Tick += Bar_Tick;
        }

        private async System.Threading.Tasks.Task Bar_Tick()
        {
            pool.Process();
            if (API.IsPlayerFreeAiming(Game.Player.Character.Handle) == true)
            { NewProgress += 1;  }

        }
    }

image

@justalemon
Copy link
Member

You need to:

  • Create a LemonUI.TimerBars.TimerBarCollection
  • Add the LemonUI.TimerBars.TimerBars onto it
  • Add the LemonUI.TimerBars.TimerBarCollection into the LemonUI.ObjectPool

@justalemon justalemon added priority: p4 not applicable Not a bug nor a feature status: completed The feature has been completed of the bug has been patched type: question A simple question labels Oct 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p4 not applicable Not a bug nor a feature status: completed The feature has been completed of the bug has been patched type: question A simple question
Projects
None yet
Development

No branches or pull requests

2 participants