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

Allow RequestFrameCallback not require data param #1068

Merged

Conversation

@FortyTwoFortyTwo
Copy link
Contributor

FortyTwoFortyTwo commented Sep 2, 2019

When i want to call RequestFrame without any data param, RequestFrameCallback still requires me to add pointless data param.

public void OnPluginStart()
{
	RequestFrame(OnFrame);
}

public void OnFrame(int pointless)	//pointless param
{
	//do something
}

I want to allow plugin to be compiled without needing data param, making it look bit more nicer when not passing any data.

public void OnPluginStart()
{
	RequestFrame(OnFrame);
}

public void OnFrame()	//param not needed as RequestFrame not passing any data
{
	//do something
}
@Headline

This comment has been minimized.

Copy link
Member

Headline commented Sep 2, 2019

What are you using request frame for that made you want to make this contribution?

@FortyTwoFortyTwo

This comment has been minimized.

Copy link
Contributor Author

FortyTwoFortyTwo commented Sep 2, 2019

One simple reason is when i have global variable(s) for stuffs around the code, I may need RequestFrame to reset, set or increase by 1 a frame later, without needing any extra params to set.

I could say same thing to timers, and typeset Timer already supports data param not required.

Copy link
Member

Headline left a comment

lgtm

@KyleSanderson

This comment has been minimized.

Copy link
Member

KyleSanderson commented Sep 2, 2019

haha. The param is still there - it's just 0...

@KyleSanderson KyleSanderson merged commit 2075848 into alliedmodders:master Sep 2, 2019
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@FortyTwoFortyTwo FortyTwoFortyTwo deleted the FortyTwoFortyTwo:frame-dataparam branch Sep 2, 2019
BotoX added a commit to BotoX/sourcemod that referenced this pull request Sep 10, 2019
@FortyTwoFortyTwo FortyTwoFortyTwo restored the FortyTwoFortyTwo:frame-dataparam branch Sep 19, 2019
@FortyTwoFortyTwo FortyTwoFortyTwo deleted the FortyTwoFortyTwo:frame-dataparam branch Oct 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.