Guest telsor Posted March 31, 2012 Share Posted March 31, 2012 Всем доброго времени суток). Собственно сабж. Как в аддоне сохранять и затем загружать данные? Как я понимаю, стандартные функции lua для работы с файлами в аддонах не работают. common.LogInfo не предлагать) Quote Link to comment Share on other sites More sharing options...
Setras Posted April 1, 2012 Share Posted April 1, 2012 /Allods Online/data/Mods/Docs/Modding Docs 120222/LuaApi/CategoryConfig.html FunctionUserModsGetAvatarConfigSection FunctionUserModsGetGlobalConfigSection FunctionUserModsSetAvatarConfigSection FunctionUserModsSetGlobalConfigSection Пример: Code: local config = userMods.GetAvatarConfigSection( common.GetAddonName() ) or {} if config and config.size then local wPos = wTarget:GetPlacementPlain() wPos.sizeX, wPos.sizeY = config.size, config.size wTarget:SetPlacementPlain(wPos) end function Command(param) local a, b, size = string.find( userMods.FromWString( param.text ), "/setsize (%d+)" ) if size == nil then a, b, size = string.find( userMods.FromWString( param.text ), "/ыуеышяу (%d+)" ) end if size ~= nil then local wPos = wTarget:GetPlacementPlain() wPos.sizeX, wPos.sizeY = tonumber(size), tonumber(size) wTarget:SetPlacementPlain(wPos) config.size = tonumber(size) userMods.SetAvatarConfigSection( common.GetAddonName(), config ) end end common.RegisterEventHandler( Command, "EVENT_UNKNOWN_SLASH_COMMAND" ) Quote Link to comment Share on other sites More sharing options...
Guest telsor Posted April 1, 2012 Share Posted April 1, 2012 Спасибо) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.