HelpC#| Color slider issues!

Posts 1–8 of 8 · Page 1 of 1
C#| Color slider issues!
Hello i added a GUI to my C# hack and rewrote a bit of it to support the new way im handling functions now, I am trying to add a color slider which does work but GlowESP does not change in game. I know it works because i can print the Values to my Debug window.

This is where color is selected

Code:
                        if (Arrays.Entity[i].Team != LocalPlayer.Team)
                            Color = Color.FromArgb (50, GuiMain.re, GuiMain.ge, GuiMain.be); // ENEMY TEAM  = Alpha, Red, Green, Blue
                        else
                            Color = Color.FromArgb (50, GuiMain.rt, GuiMain.gt, GuiMain.bt); // MY TEAM = Alpha, Red, Green, Blue
This is the GuiMain color stuff

Code:
public partial class GuiMain : MetroFramework.Forms.MetroForm
    {
        public int rt = 0;
        public int gt = 0;
        public int bt = 255;

        public int re = 255;
        public int ge = 0;
        public int be = 0;

        public GuiMain()
        {
            InitializeComponent();
        }

        public void metroLabel3_Click(object sender, EventArgs e)
        {

        }

        public void GlowToggle_CheckedChanged(object sender, EventArgs e)
        {
            ESPGlow = !ESPGlow; //True && False
        }


        public void BhopToggle_CheckedChanged(object sender, EventArgs e)
        {
            Bhop = !Bhop;
        }

        public void NoFlashToggle_CheckedChanged(object sender, EventArgs e)
        {
            FlashOn = !FlashOn;
            NoFlash = !NoFlash;
        }

        public void TriggerToggle_CheckedChanged(object sender, EventArgs e)
        {
            Trigger1 = !Trigger1;
        }

        public void GuiMain_Load(object sender, EventArgs e)
        {

        }

        public void MyTeamRed_Scroll(object sender, ScrollEventArgs e)
        {
            
        }


        public void MyTeamGreen_Scroll(object sender, ScrollEventArgs e)
        {

        }

        public void MyTeamBlue_Scroll(object sender, ScrollEventArgs e)
        {

        }

        public void EnemyTeamRed_Scroll(object sender, ScrollEventArgs e)
        {

        }

        public void EnemyTeamGreen_Scroll(object sender, ScrollEventArgs e)
        {

        }

        public void EnemyTeamBlue_Scroll(object sender, ScrollEventArgs e)
        {

        }

        private void MyTeamRed_ValueChanged(object sender, EventArgs e)
        {
            rt = MyTeamRed.Value;
            Console.WriteLine("rt = " + rt);
        }

        private void MyTeamGreen_ValueChanged(object sender, EventArgs e)
        {
            gt = MyTeamGreen.Value;
            Console.WriteLine("gt = " + gt);
        }

        private void MyTeamBlue_ValueChanged(object sender, EventArgs e)
        {
            bt = MyTeamBlue.Value;
            Console.WriteLine("bt = " + bt);
        }

        private void EnemyTeamRed_ValueChanged(object sender, EventArgs e)
        {
            re = EnemyTeamRed.Value;
            Console.WriteLine("re = " + EnemyTeamRed.Value);
        }

        private void EnemyTeamGreen_ValueChanged(object sender, EventArgs e)
        {
            ge = EnemyTeamGreen.Value;
            Console.WriteLine("ge = " + EnemyTeamGreen.Value);
        }

        private void EnemyTeamBlue_ValueChanged(object sender, EventArgs e)
        {
            be = EnemyTeamBlue.Value;
            Console.WriteLine("be = " + EnemyTeamBlue.Value);
        }

        private void metroTabPage2_Click(object sender, EventArgs e)
        {

        }
    }
}
Color changer in action

https://gyazo.com/39eccf6be79327c72af00ef396c97f14ⓘ

https://gyazo.com/58af8f1df534643ef33a849894c7ef85ⓘ
Try to use the Scroll function of the slider instead of Value_Changed

Here's some of my code
private void enemyBlue_Scroll(object sender, EventArgs e)
{
Config.enemy_color_b = enemyBlue.Value;
button3.BackColor = Color.FromArgb(enemyAlpha.Value, enemyRed.Value, enemyGreen.Value, enemyBlue.Value);
lblEnemyBlue.Text = enemyBlue.Value.ToString();
}
The variable "enemy_color_b" gets the value from the slider, the button gets the color from all the sliders (just to see what color you're picking) and then the label gets the value from the slider to show the amount of blue (200 for example)

Sorry for my english if it's bad, hope it can help you! (:
If i remember right glow structure uses 0.0f - 1.0f, thats why your 50 at alpha channel doesnt work. divide that by 255
Quote Originally Posted by PhY'z View Post
If i remember right glow structure uses 0.0f - 1.0f, thats why your 50 at alpha channel doesnt work. divide that by 255
Actually the glow works it just doesn't change in game :/
Quote Originally Posted by jonluke View Post
Actually the glow works it just doesn't change in game :/
Ye thats what i mean, it will work cuz 255 is way higher than 1, did you tried to divide that number by 255? (dont forget to use float)
Quote Originally Posted by PhY'z View Post
Ye thats what i mean, it will work cuz 255 is way higher than 1, did you tried to divide that number by 255? (dont forget to use float)
Actually dude my Glow is using INT for color
Quote Originally Posted by jonluke View Post
Actually dude my Glow is using INT for color
Glow struct uses "Vector" - float[3] with a range of 0.f -> 1.f, to prove the following try and see if it does only set alpha to nothing or full when moving the bars to extreme, "0" or "255", same for red, green, blue sliders.


The fix is simple tho.
Quote Originally Posted by PhY'z View Post
Glow struct uses "Vector" - float[3] with a range of 0.f -> 1.f, to prove the following try and see if it does only set alpha to nothing or full when moving the bars to extreme, "0" or "255", same for red, green, blue sliders.


The fix is simple tho.
Did i forget to say this was fixed yesterday, 255, is the correct number also please note this is C# not C++, I was trying to retrieve info from a form which I now know can't be done more than once, To fix this i made a settings.cs where I store all my boolean values and public int stuff
Posts 1–8 of 8 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us