mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-26 19:53:09 +00:00
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:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user