-
-
Notifications
You must be signed in to change notification settings - Fork 427
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
Add onClientBrowserConsoleMessage event #3676
base: master
Are you sure you want to change the base?
Changes from all commits
d8aeb85
651c101
5a72d04
e7857de
c9f8390
17d15f2
eaabc94
e823717
d39c679
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2778,6 +2778,7 @@ void CClientGame::AddBuiltInEvents() | |
m_Events.AddEvent("onClientBrowserTooltip", "text", NULL, false); | ||
m_Events.AddEvent("onClientBrowserInputFocusChanged", "gainedfocus", NULL, false); | ||
m_Events.AddEvent("onClientBrowserResourceBlocked", "url, domain, reason", NULL, false); | ||
m_Events.AddEvent("onClientBrowserConsoleMessage", "message, source, line, level", NULL, false); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change NULL to nullptr for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it doesn't change anything, it's like this everywhere, you can open pull request to refactor mta code There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It changes everything. Why should someone open a pull request just to clean after you? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
In accordance with the guidelines and current C++ conventions, you should use nullptr instead of NULL, as everyone else does in this repository. No one is going to clean up after you because you're too lazy to make the changes required by the coding standards. We follow the principle that when creating new code, we adhere to the latest guidelines and avoid creating more mess than there already is. If you don't follow the coding guidelines, your PR simply won't be considered, and no one will likely want to merge it. It's your choice whether to spend a minute making this change or risk having all the time you invested in this PR go to waste |
||
|
||
// Misc events | ||
m_Events.AddEvent("onClientFileDownloadComplete", "fileName, success", NULL, false); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -305,6 +305,16 @@ void CClientWebBrowser::Events_OnAjaxRequest(CAjaxResourceHandlerInterface* pHan | |
pHandler->SetResponse(result); | ||
} | ||
|
||
void CClientWebBrowser::Events_OnConsoleMessage(const SString& strMessage, const SString& strSource, int line, short level) | ||
{ | ||
CLuaArguments Arguments; | ||
Arguments.PushString(strMessage); | ||
Arguments.PushString(strSource); | ||
Arguments.PushNumber(line); | ||
Arguments.PushNumber(level); | ||
CallEvent("onClientBrowserConsoleMessage", Arguments, false); | ||
Comment on lines
+310
to
+315
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. camelCase There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. above, everywhere is used like this, it's not problem that needs to be fixed to get merged, if you really want to change things like this just create refactor pull request. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New PRs shouldn't introduce code that requires a refactor later to meet current standards. Could go even deeper, hungarian notation shouldn't be used anymore. |
||
} | ||
|
||
bool CClientWebBrowser::AddAjaxHandler(const SString& strURL, ajax_callback_t& handler) | ||
{ | ||
if (!m_pWebView->RegisterAjaxHandler(strURL)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nullptr
instead ofNULL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey tracerds, can I ask you to stop making random comments on random pull requests? here it would be absolutely radicoolous to change null to nullptr when ALL of events use null. this is public repo and not your private project where you change anything because you prefer nullptr over null. thanks 🙏👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That the older code in this file makes use of NULL is irrelevant. You are introducing new code and should therefore use the proper modern methods. In this case nullptr over NULL. It's a valid comment from Tracer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You come here edit code thats been created by the community.
Its not my preference. There are standards. Read them BEFORE creating a PR.
If you dont like the way it is, dont contribute.
If you want to contribute, follow the guidelines.
Dont resolve conversations when you dont change anything.
Just because in your opinion you can do whatever you want doesnt give you the right to do so. Either follow the guidelines or dont contribute