Refactor all usage of RegisterFunction to ScriptFunction::Register

- Replace ScriptInterface::RegisterFunction with
ScriptFunction::Register
 - Mostly removing unused cmpPrivate*
 - Some usage introduces specific getters (mapgenerator, AIWorker,
XmppClient,...)
 - Several passthrough functions are simply removed in favour of calling
the original, reducing duplication
 - Make use of ScriptRequest/ScriptInterface capabilities where
relevant.
- Make JSI_* headers only expose necessary functions, lightening them
considerably and reducing duplication
 - Reuse namespaces in JSI_* implementations directly, reducing visual
noise there

Follows f3aedf88a6

Differential Revision: https://code.wildfiregames.com/D3626
This was SVN commit r24983.
This commit is contained in:
wraitii
2021-03-02 20:01:14 +00:00
parent 869076ebc5
commit cb346e207b
52 changed files with 820 additions and 1969 deletions
+3 -3
View File
@@ -23,7 +23,7 @@
#include "ps/CLogger.h"
#include "scriptinterface/FunctionWrapper.h"
namespace
namespace JSI_Console
{
CConsole* ConsoleGetter(const ScriptRequest&, JS::CallArgs&)
{
@@ -34,10 +34,10 @@ CConsole* ConsoleGetter(const ScriptRequest&, JS::CallArgs&)
}
return g_Console;
}
}
void JSI_Console::RegisterScriptFunctions(const ScriptRequest& rq)
void RegisterScriptFunctions(const ScriptRequest& rq)
{
ScriptFunction::Register<&CConsole::IsActive, ConsoleGetter>(rq, "Console_GetVisibleEnabled");
ScriptFunction::Register<&CConsole::SetVisible, ConsoleGetter>(rq, "Console_SetVisibleEnabled");
}
}