Skip to content
This repository has been archived by the owner on Jul 29, 2020. It is now read-only.

Checkbox call function #12

Closed
Monsterxsync opened this issue Jan 12, 2018 · 3 comments
Closed

Checkbox call function #12

Monsterxsync opened this issue Jan 12, 2018 · 3 comments

Comments

@Monsterxsync
Copy link
Contributor

Is it possible to make it so a checkbox can call a function also?
E.g

void RecoilCrosshairToggle()
{
	if (g_Settings.Misc.bRecoilCrosshairEnabled)
		g_pEngine->ExecuteClientCmd("crosshair 0");
	else
		g_pEngine->ExecuteClientCmd("crosshair 1");

	g_Settings.Misc.bRecoilCrosshairEnabled = !g_Settings.Misc.bRecoilCrosshairEnabled;
}
@certmemer
Copy link
Collaborator

or dont be a retard and use a button instead?

@Monsterxsync
Copy link
Contributor Author

Or don't be a cunt and assume im not already doing that. Having a toggle on checkbox is extra functionality and alot of the time you need more that just toggling a bool.

@kwilcz
Copy link
Owner

kwilcz commented Jan 14, 2018

This is useless for me to be fair. You can just call your RecoilCrosshairToggle() function in createmove if your setting is true o just use a regular button (or create toggle-button, but w/e).
I generally would prefer to avoid calling any engine functions in drawing engine, as they don't like to cooperate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants