{"action":"created","comment":{"url":"https://api.github.com/repos/zibbizor/FLHook/pulls/comments/173639976","pull_request_review_id":102867815,"id":173639976,"diff_hunk":"@@ -0,0 +1,336 @@\n+// Expanded Help Menu - Customisable Help Commands\n+// By Laz, w/ help from @Alex.\n+//\n+// This is free software; you can redistribute it and/or modify it as\n+// you wish without restriction. If you do then I would appreciate\n+// being notified and/or mentioned somewhere.\n+\n+///////////////////////////////////////////////////////////////////////////////////////////////////////////////\n+//Includes\n+///////////////////////////////////////////////////////////////////////////////////////////////////////////////\n+\n+#include <windows.h>\n+#include <stdio.h>\n+#include <string>\n+#include <time.h>\n+#include <math.h>\n+#include <list>\n+#include <map>\n+#include <algorithm>\n+#include <FLHook.h>\n+#include <plugin.h>\n+#include <PluginUtilities.h>\n+#include \"Main.h\"\n+\n+#include \"../hookext_plugin/hookext_exports.h\"\n+\n+/// A return code to indicate to FLHook if we want the hook processing to continue.\n+PLUGIN_RETURNCODE returncode;\n+\n+void LoadSettings();\n+\n+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)\n+{\n+\tsrand((uint)time(0));\n+\t// If we're being loaded from the command line while FLHook is running then\n+\t// set_scCfgFile will not be empty so load the settings as FLHook only\n+\t// calls load settings on FLHook startup and .rehash.\n+\tif(fdwReason == DLL_PROCESS_ATTACH)\n+\t{\n+\t\tif (set_scCfgFile.length()>0)\n+\t\t\tLoadSettings();\n+\t}\n+\telse if (fdwReason == DLL_PROCESS_DETACH)\n+\t{\n+\t}\n+\treturn true;\n+}\n+\n+/// Hook will call this function after calling a plugin function to see if we the\n+/// processing to continue\n+EXPORT PLUGIN_RETURNCODE Get_PluginReturnCode()\n+{\n+\treturn returncode;\n+}\n+\n+struct HELPSTRUCT\n+{\n+\twstring wscTitle; // What will the title of our text box be called?\n+\twstring wscContent; // What content will it hold?\n+};\n+\n+bool bPluginEnabled = true; // So we can disable it with ease.\n+map<wstring, HELPSTRUCT> mapHelp; \n+list<wstring> lstHelpCommands; // So we have a list of help commands that can be iterated over\n+\n+///////////////////////////////////////////////////////////////////////////////////////////////////////////////\n+//Loading Settings\n+///////////////////////////////////////////////////////////////////////////////////////////////////////////////\n+\n+void LoadSettings()\n+{\n+\tint intHelpCommands = 0; // Loading amount for console\n+\tlstHelpCommands.clear(); // This is to ensure that during .rehash the lists are empty\n+\tmapHelp.clear();\n+\treturncode = DEFAULT_RETURNCODE;\n+\n+\tchar szCurDir[MAX_PATH];\n+\tGetCurrentDirectory(sizeof(szCurDir), szCurDir);\n+\tstring scPluginCfgFile = string(szCurDir) + \"\\\\flhook_plugins\\\\laz_help.cfg\";\n+\tbPluginEnabled = IniGetB(scPluginCfgFile, \"Config\", \"Enabled\", true);\n+\n+\tINI_Reader ini;\n+\tif (ini.open(scPluginCfgFile.c_str(), false))\n+\t{\n+\t\twhile (ini.read_header())\n+\t\t{\n+\t\t\tHELPSTRUCT helpstruct;\n+\t\t\tif (ini.is_header(\"Commands\"))\n+\t\t\t{\n+\t\t\t\twhile (ini.read_value())\n+\t\t\t\t{\n+\t\t\t\t\tif (ini.is_value(\"help\"))\n+\t\t\t\t\t{\n+\t\t\t\t\t\twstring getValueString = stows(ini.get_value_string()); // Get each line and turn it into a string\n+\t\t\t\t\t\tint firstComma = getValueString.find(','); // Get index of first comma\n+\t\t\t\t\t\tint secondComma = getValueString.substr(firstComma + 1).find(','); // Get index of second comma\n+\t\t\t\t\t\twstring wscParam = getValueString.substr(0, firstComma); // Our param for the command\n+\t\t\t\t\t\thelpstruct.wscTitle = Trim(getValueString.substr(firstComma + 1, secondComma)); // The title for our text box\n+\t\t\t\t\t\thelpstruct.wscContent = Trim(getValueString.substr(firstComma + secondComma + 2)); // The content of our text box. XML String.\n+\n+\t\t\t\t\t\tmapHelp[wscParam] = helpstruct;\n+\t\t\t\t\t\tlstHelpCommands.push_back(wscParam); // So we can iterate through the list\n+\t\t\t\t\t\tintHelpCommands++;\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\t\tini.close();\n+\t\tConPrint(L\"HELP EXPANDED: Commands Loaded: %u \\n\", intHelpCommands);\n+\t}\n+}\n+\n+///////////////////////////////////////////////////////////////////////////////////////////////////////////////\n+//Functions\n+///////////////////////////////////////////////////////////////////////////////////////////////////////////////\n+\n+void HelpInfo(uint iClientID)\n+{\n+\tPrintUserCmdText(iClientID, L\"The current help commands available are as follows:\");\n+\tforeach(lstHelpCommands, wstring, iter)\n+\t{\n+\t\twstring wscIter = *iter;\n+\t\tPrintUserCmdText(iClientID, L\"helpmenu %s\", wscIter.c_str());\n+\t\t// Iterate through all possible help commands\n+\t}\n+}\n+\n+bool ValidityCheck(uint iClientID)\n+{\n+\tif (!bPluginEnabled)\n+\t{\n+\t\tPrintUserCmdText(iClientID, L\"The extended help menu is currently disabled.\");\n+\t\treturn false;\n+\t}\n+\n+\t// Stops people locking themselves out by using the command when dead.\n+\tif (HkIsOnDeathMenu(iClientID))\n+\t{\n+\t\tPrintUserCmdText(iClientID, L\"ERR: You must be alive to use this command.\"); // Dummy msg\n+\t\treturn false;\n+\t}\n+\treturn true;\n+}\n+\n+void TextboxPopUp(uint iClientID, const wstring &wscTitle, const wstring &wscXML)\n+{\n+\tstruct PlayerData *pPD = 0;\n+\twhile (pPD = Players.traverse_active(pPD))\n+\t{\n+\t\tuint iClientID = HkGetClientIdFromPD(pPD);","path":"Plugins/Public/help_expanded/Main.cpp","position":150,"original_position":150,"commit_id":"5a2933ede5584f37dda1034c682bf7f1df0418fb","original_commit_id":"5a2933ede5584f37dda1034c682bf7f1df0418fb","user":{"login":"dsyalex","id":18709025,"avatar_url":"https://avatars3.githubusercontent.com/u/18709025?v=4","gravatar_id":"","url":"https://api.github.com/users/dsyalex","html_url":"https://github.com/dsyalex","followers_url":"https://api.github.com/users/dsyalex/followers","following_url":"https://api.github.com/users/dsyalex/following{/other_user}","gists_url":"https://api.github.com/users/dsyalex/gists{/gist_id}","starred_url":"https://api.github.com/users/dsyalex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsyalex/subscriptions","organizations_url":"https://api.github.com/users/dsyalex/orgs","repos_url":"https://api.github.com/users/dsyalex/repos","events_url":"https://api.github.com/users/dsyalex/events{/privacy}","received_events_url":"https://api.github.com/users/dsyalex/received_events","type":"User","site_admin":false},"body":"but you already have an iClientID","created_at":"2018-03-11T00:59:02Z","updated_at":"2018-03-11T01:02:45Z","html_url":"https://github.com/zibbizor/FLHook/pull/25#discussion_r173639976","pull_request_url":"https://api.github.com/repos/zibbizor/FLHook/pulls/25","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/zibbizor/FLHook/pulls/comments/173639976"},"html":{"href":"https://github.com/zibbizor/FLHook/pull/25#discussion_r173639976"},"pull_request":{"href":"https://api.github.com/repos/zibbizor/FLHook/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/zibbizor/FLHook/pulls/25","id":174196801,"html_url":"https://github.com/zibbizor/FLHook/pull/25","diff_url":"https://github.com/zibbizor/FLHook/pull/25.diff","patch_url":"https://github.com/zibbizor/FLHook/pull/25.patch","issue_url":"https://api.github.com/repos/zibbizor/FLHook/issues/25","number":25,"state":"open","locked":false,"title":"Help Expanded","user":{"login":"LazDisco","id":16494336,"avatar_url":"https://avatars0.githubusercontent.com/u/16494336?v=4","gravatar_id":"","url":"https://api.github.com/users/LazDisco","html_url":"https://github.com/LazDisco","followers_url":"https://api.github.com/users/LazDisco/followers","following_url":"https://api.github.com/users/LazDisco/following{/other_user}","gists_url":"https://api.github.com/users/LazDisco/gists{/gist_id}","starred_url":"https://api.github.com/users/LazDisco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LazDisco/subscriptions","organizations_url":"https://api.github.com/users/LazDisco/orgs","repos_url":"https://api.github.com/users/LazDisco/repos","events_url":"https://api.github.com/users/LazDisco/events{/privacy}","received_events_url":"https://api.github.com/users/LazDisco/received_events","type":"User","site_admin":false},"body":"New Command: /helpmenu - This command allows user to bring up message boxes that contain helpful information. Aside from two, these are all controlled by a cfg file. Typing the command without any parameters will cause it to list all possible combinations. The two that are hardcoded in are \"/helpmenu rules\" & \"/helpmenu start\". This is done because there are existing infocards in game for these, and doing it this way will circumvent the HkChangeIDSString bug that causes xml strings to break.\r\n\r\nEdit: I somehow duplicated my commits. I've never used branches before, forgive the mistakes. ^-^\r\n","created_at":"2018-03-11T00:17:35Z","updated_at":"2018-03-11T01:02:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2e5b70105255edea34a0a85bf4d8c78cfd347fab","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/zibbizor/FLHook/pulls/25/commits","review_comments_url":"https://api.github.com/repos/zibbizor/FLHook/pulls/25/comments","review_comment_url":"https://api.github.com/repos/zibbizor/FLHook/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zibbizor/FLHook/issues/25/comments","statuses_url":"https://api.github.com/repos/zibbizor/FLHook/statuses/5a2933ede5584f37dda1034c682bf7f1df0418fb","head":{"label":"LazDisco:help_expanded","ref":"help_expanded","sha":"5a2933ede5584f37dda1034c682bf7f1df0418fb","user":{"login":"LazDisco","id":16494336,"avatar_url":"https://avatars0.githubusercontent.com/u/16494336?v=4","gravatar_id":"","url":"https://api.github.com/users/LazDisco","html_url":"https://github.com/LazDisco","followers_url":"https://api.github.com/users/LazDisco/followers","following_url":"https://api.github.com/users/LazDisco/following{/other_user}","gists_url":"https://api.github.com/users/LazDisco/gists{/gist_id}","starred_url":"https://api.github.com/users/LazDisco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LazDisco/subscriptions","organizations_url":"https://api.github.com/users/LazDisco/orgs","repos_url":"https://api.github.com/users/LazDisco/repos","events_url":"https://api.github.com/users/LazDisco/events{/privacy}","received_events_url":"https://api.github.com/users/LazDisco/received_events","type":"User","site_admin":false},"repo":{"id":124707731,"name":"FLHook","full_name":"LazDisco/FLHook","owner":{"login":"LazDisco","id":16494336,"avatar_url":"https://avatars0.githubusercontent.com/u/16494336?v=4","gravatar_id":"","url":"https://api.github.com/users/LazDisco","html_url":"https://github.com/LazDisco","followers_url":"https://api.github.com/users/LazDisco/followers","following_url":"https://api.github.com/users/LazDisco/following{/other_user}","gists_url":"https://api.github.com/users/LazDisco/gists{/gist_id}","starred_url":"https://api.github.com/users/LazDisco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LazDisco/subscriptions","organizations_url":"https://api.github.com/users/LazDisco/orgs","repos_url":"https://api.github.com/users/LazDisco/repos","events_url":"https://api.github.com/users/LazDisco/events{/privacy}","received_events_url":"https://api.github.com/users/LazDisco/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/LazDisco/FLHook","description":"FLHook for Discovery Freelancer","fork":true,"url":"https://api.github.com/repos/LazDisco/FLHook","forks_url":"https://api.github.com/repos/LazDisco/FLHook/forks","keys_url":"https://api.github.com/repos/LazDisco/FLHook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LazDisco/FLHook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LazDisco/FLHook/teams","hooks_url":"https://api.github.com/repos/LazDisco/FLHook/hooks","issue_events_url":"https://api.github.com/repos/LazDisco/FLHook/issues/events{/number}","events_url":"https://api.github.com/repos/LazDisco/FLHook/events","assignees_url":"https://api.github.com/repos/LazDisco/FLHook/assignees{/user}","branches_url":"https://api.github.com/repos/LazDisco/FLHook/branches{/branch}","tags_url":"https://api.github.com/repos/LazDisco/FLHook/tags","blobs_url":"https://api.github.com/repos/LazDisco/FLHook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LazDisco/FLHook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LazDisco/FLHook/git/refs{/sha}","trees_url":"https://api.github.com/repos/LazDisco/FLHook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LazDisco/FLHook/statuses/{sha}","languages_url":"https://api.github.com/repos/LazDisco/FLHook/languages","stargazers_url":"https://api.github.com/repos/LazDisco/FLHook/stargazers","contributors_url":"https://api.github.com/repos/LazDisco/FLHook/contributors","subscribers_url":"https://api.github.com/repos/LazDisco/FLHook/subscribers","subscription_url":"https://api.github.com/repos/LazDisco/FLHook/subscription","commits_url":"https://api.github.com/repos/LazDisco/FLHook/commits{/sha}","git_commits_url":"https://api.github.com/repos/LazDisco/FLHook/git/commits{/sha}","comments_url":"https://api.github.com/repos/LazDisco/FLHook/comments{/number}","issue_comment_url":"https://api.github.com/repos/LazDisco/FLHook/issues/comments{/number}","contents_url":"https://api.github.com/repos/LazDisco/FLHook/contents/{+path}","compare_url":"https://api.github.com/repos/LazDisco/FLHook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LazDisco/FLHook/merges","archive_url":"https://api.github.com/repos/LazDisco/FLHook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LazDisco/FLHook/downloads","issues_url":"https://api.github.com/repos/LazDisco/FLHook/issues{/number}","pulls_url":"https://api.github.com/repos/LazDisco/FLHook/pulls{/number}","milestones_url":"https://api.github.com/repos/LazDisco/FLHook/milestones{/number}","notifications_url":"https://api.github.com/repos/LazDisco/FLHook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LazDisco/FLHook/labels{/name}","releases_url":"https://api.github.com/repos/LazDisco/FLHook/releases{/id}","deployments_url":"https://api.github.com/repos/LazDisco/FLHook/deployments","created_at":"2018-03-10T23:38:52Z","updated_at":"2018-03-10T23:38:55Z","pushed_at":"2018-03-11T00:14:03Z","git_url":"git://github.com/LazDisco/FLHook.git","ssh_url":"git@github.com:LazDisco/FLHook.git","clone_url":"https://github.com/LazDisco/FLHook.git","svn_url":"https://github.com/LazDisco/FLHook","homepage":null,"size":33365,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"zibbizor:master","ref":"master","sha":"358686fb8e73e36415abc884f75959f27fab9182","user":{"login":"zibbizor","id":885211,"avatar_url":"https://avatars3.githubusercontent.com/u/885211?v=4","gravatar_id":"","url":"https://api.github.com/users/zibbizor","html_url":"https://github.com/zibbizor","followers_url":"https://api.github.com/users/zibbizor/followers","following_url":"https://api.github.com/users/zibbizor/following{/other_user}","gists_url":"https://api.github.com/users/zibbizor/gists{/gist_id}","starred_url":"https://api.github.com/users/zibbizor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zibbizor/subscriptions","organizations_url":"https://api.github.com/users/zibbizor/orgs","repos_url":"https://api.github.com/users/zibbizor/repos","events_url":"https://api.github.com/users/zibbizor/events{/privacy}","received_events_url":"https://api.github.com/users/zibbizor/received_events","type":"User","site_admin":false},"repo":{"id":48846080,"name":"FLHook","full_name":"zibbizor/FLHook","owner":{"login":"zibbizor","id":885211,"avatar_url":"https://avatars3.githubusercontent.com/u/885211?v=4","gravatar_id":"","url":"https://api.github.com/users/zibbizor","html_url":"https://github.com/zibbizor","followers_url":"https://api.github.com/users/zibbizor/followers","following_url":"https://api.github.com/users/zibbizor/following{/other_user}","gists_url":"https://api.github.com/users/zibbizor/gists{/gist_id}","starred_url":"https://api.github.com/users/zibbizor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zibbizor/subscriptions","organizations_url":"https://api.github.com/users/zibbizor/orgs","repos_url":"https://api.github.com/users/zibbizor/repos","events_url":"https://api.github.com/users/zibbizor/events{/privacy}","received_events_url":"https://api.github.com/users/zibbizor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zibbizor/FLHook","description":"FLHook for Discovery Freelancer","fork":false,"url":"https://api.github.com/repos/zibbizor/FLHook","forks_url":"https://api.github.com/repos/zibbizor/FLHook/forks","keys_url":"https://api.github.com/repos/zibbizor/FLHook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zibbizor/FLHook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zibbizor/FLHook/teams","hooks_url":"https://api.github.com/repos/zibbizor/FLHook/hooks","issue_events_url":"https://api.github.com/repos/zibbizor/FLHook/issues/events{/number}","events_url":"https://api.github.com/repos/zibbizor/FLHook/events","assignees_url":"https://api.github.com/repos/zibbizor/FLHook/assignees{/user}","branches_url":"https://api.github.com/repos/zibbizor/FLHook/branches{/branch}","tags_url":"https://api.github.com/repos/zibbizor/FLHook/tags","blobs_url":"https://api.github.com/repos/zibbizor/FLHook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zibbizor/FLHook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zibbizor/FLHook/git/refs{/sha}","trees_url":"https://api.github.com/repos/zibbizor/FLHook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zibbizor/FLHook/statuses/{sha}","languages_url":"https://api.github.com/repos/zibbizor/FLHook/languages","stargazers_url":"https://api.github.com/repos/zibbizor/FLHook/stargazers","contributors_url":"https://api.github.com/repos/zibbizor/FLHook/contributors","subscribers_url":"https://api.github.com/repos/zibbizor/FLHook/subscribers","subscription_url":"https://api.github.com/repos/zibbizor/FLHook/subscription","commits_url":"https://api.github.com/repos/zibbizor/FLHook/commits{/sha}","git_commits_url":"https://api.github.com/repos/zibbizor/FLHook/git/commits{/sha}","comments_url":"https://api.github.com/repos/zibbizor/FLHook/comments{/number}","issue_comment_url":"https://api.github.com/repos/zibbizor/FLHook/issues/comments{/number}","contents_url":"https://api.github.com/repos/zibbizor/FLHook/contents/{+path}","compare_url":"https://api.github.com/repos/zibbizor/FLHook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zibbizor/FLHook/merges","archive_url":"https://api.github.com/repos/zibbizor/FLHook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zibbizor/FLHook/downloads","issues_url":"https://api.github.com/repos/zibbizor/FLHook/issues{/number}","pulls_url":"https://api.github.com/repos/zibbizor/FLHook/pulls{/number}","milestones_url":"https://api.github.com/repos/zibbizor/FLHook/milestones{/number}","notifications_url":"https://api.github.com/repos/zibbizor/FLHook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zibbizor/FLHook/labels{/name}","releases_url":"https://api.github.com/repos/zibbizor/FLHook/releases{/id}","deployments_url":"https://api.github.com/repos/zibbizor/FLHook/deployments","created_at":"2015-12-31T10:38:18Z","updated_at":"2017-11-15T22:57:01Z","pushed_at":"2018-03-11T00:20:48Z","git_url":"git://github.com/zibbizor/FLHook.git","ssh_url":"git@github.com:zibbizor/FLHook.git","clone_url":"https://github.com/zibbizor/FLHook.git","svn_url":"https://github.com/zibbizor/FLHook","homepage":null,"size":33341,"stargazers_count":13,"watchers_count":13,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":8,"open_issues":3,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zibbizor/FLHook/pulls/25"},"html":{"href":"https://github.com/zibbizor/FLHook/pull/25"},"issue":{"href":"https://api.github.com/repos/zibbizor/FLHook/issues/25"},"comments":{"href":"https://api.github.com/repos/zibbizor/FLHook/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/zibbizor/FLHook/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/zibbizor/FLHook/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zibbizor/FLHook/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/zibbizor/FLHook/statuses/5a2933ede5584f37dda1034c682bf7f1df0418fb"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dsyalex"}}