Checkable box code? (I made it)

Posts 14 of 4 · Page 1 of 1
Checkable box code? (I made it)
with the help of Acea (helped with isinRange function), I made my own clickable box function (with the use of public functions like DrawBorder and FillRGB). It works, but it gets glitchy sometimes. (idk how it happens (occurs randomly), but after clicking on it a few times, it goes from <option> to <off>) ex: for CrossHair: goes from: [Off] -> [Red] -> [Blue](turning on)... [Cyan] ->(Turning it off).... [Red] -> [On]. <- [On] isn't even a setting for my menuOption, yet I don't know why it appears. (that's the glitch)

Here is my current code; not really efficient (I "noob-proofed" some/added stuff, I hope they're easily noticeable) :

Code:
void CheckableTabs(int x, float y, int w, float h, int px, char* hackName, int MaxValue, int &hackVariable, char** menuOption, LPDIRECT3DDEVICE9 pDevice)

	cMenu->DrawBorder(x , y + 1 /*+3*/ , w, h, px, Black, pDevice);
	if(isTabClickedByMouse = false)
	{
		if(hackVariable = 0)

		cMenu->DrawText(pDevice, x - 100, y, BCGrey2, hackName);
		cMenu->DrawText(pDevice, x - 50, y, BCGrey2, menuOption[hackVariable]);
		if(hackVariable > 0)
		{
			cMenu->DrawText(pDevice, x - 100, y, BCBlue2, hackName);
		cMenu->FillRGB(x+1,y + 2.0,w - 2,h - 1.5, Green, pDevice);
		cMenu->DrawText(pDevice, x - 50, y, BCBlue2, menuOption[hackVariable]);
		}
		if(isTabClickedByMouse = false && GetAsyncKeyState(VK_RBUTTON)&1 && isMouseinRange(insert some params) = true && hackVariable > noVarValue)
	{ 

		hackVariable--;
		
	}
	}
	else if(isTabClickedByMouse = true)
	{
		cMenu->DrawText(pDevice, x - 100, y, BCBlue2, hackName);
		cMenu->DrawText(pDevice, x - 50, y, BCBlue2, menuOption[hackVariable]);
		cMenu->FillRGB(x+1,y + 2.0,w - 2,h - 1.5, Green, pDevice);
		if(isTabClickedByMouse = true && GetAsyncKeyState(VK_LBUTTON)&1 && isMouseinRange(insert some params) = true && hackVariable < MaxValue)
	{
		 
				hackVariable++;
			}
	}
	
	
	if(isMouseinRange(insert some params) = true && GetAsyncKeyState(VK_LBUTTON)&1)
	{
		 isTabClickedByMouse = true;
		 
	}
	else if(isMouseinRange(insert some params) = true && GetAsyncKeyState(VK_RBUTTON)&1)
	//	else
		{
			isTabClickedByMouse = false;
		 
		}
		
		 
	
}
This is the result of my code:
View xAeSox.png on ScreenSnapr
I do plan to change it so that it's controlled only with the Left mouse. I know it's lengthy and not the best, but I like it; it's something I made using my knowledge instead of c+ping.
If you're trying to fix your code, have a look at the redemption base I released, it uses checkboxes and it should help you out a little.
Quote Originally Posted by Shadow` View Post
If you're trying to fix your code, have a look at the redemption base I released, it uses checkboxes and it should help you out a little.
that's alot neater and shorter than mine.. thanks!
Nice job @merp. Sexy Color too
Posts 14 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?