Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想从插件中的其他代码访问 VERSION 字段(在 Info.lua 中返回)。我找不到关于从 Info.lua 返回的信息存储位置的文档。有没有办法访问它?
我不认为有官方的方式,但由于它只是另一个返回表的 lua 文件并且它位于插件路径内,您可以简单地导入它:
local Info = require 'Info.lua'
在我的插件中,我使用 Info.VERSION.revision 并将其传递给所有后端请求,以便服务器知道使用的插件版本。