File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed
Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -709,5 +709,6 @@ bool scripting_IsWindows();
709709bool scripting_IsLinux ();
710710std::string scripting_GetOS ();
711711GCCSGameRules *scripting_GetCCSGameRules ();
712+ std::string scripting_GetPluginPath (std::string plugin_name);
712713
713714#endif
Original file line number Diff line number Diff line change 22#include " ../../../sdk/entity/CGameRules.h"
33#include " ../../../hooks/FuncHook.h"
44#include " generated/classes.h"
5+ #include " ../../PluginManager.h"
56
67void Hook_CGameRules_Constructor (CGameRules *pThis);
78CCSGameRules *gameRules = nullptr ;
@@ -41,4 +42,12 @@ GCCSGameRules *scripting_GetCCSGameRules()
4142 }
4243
4344 return gameRulesPtr;
45+ }
46+
47+ std::string scripting_GetPluginPath (std::string plugin_name)
48+ {
49+ Plugin* plugin = g_pluginManager->FetchPlugin (plugin_name);
50+ if (!plugin) return " " ;
51+
52+ return string_format (" addons/swiftly/plugins/%s" , plugin->GetName ().c_str ());
4453}
Original file line number Diff line number Diff line change 33void SetupLuaUtils (LuaPlugin *plugin, lua_State *state)
44{
55 luabridge::getGlobalNamespace (state)
6+ .addFunction (" GetPluginPath" , scripting_GetPluginPath)
67 .addFunction (" GetTime" , GetTime)
78 .addFunction (" IsWindows" , scripting_IsWindows)
89 .addFunction (" IsLinux" , scripting_IsLinux)
You can’t perform that action at this time.
0 commit comments