Jump to content

Digest Jan-Feb

We talk about what was done and updated in the past month. We help keep abreast of events.

January February

Servers monitoring and the Addons Editor

We present you two legends. All dreams come true.

Servers monitoring The Addons Editor

Game tooltips

Tooltips provide a way for 3rd party fansites and extensions to display detailed information on mouseover.

Read more

The Addons Updater

Let us to introduce the addons updating software and to share the details

Read more Download

Сохранение и загрузка данных


Guest telsor

Recommended Posts

Guest telsor

Всем доброго времени суток).

Собственно сабж. Как в аддоне сохранять и затем загружать данные? Как я понимаю, стандартные функции lua для работы с файлами в аддонах не работают.

common.LogInfo не предлагать)

Link to comment
Share on other sites

/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" )

Link to comment
Share on other sites

Guest telsor

Спасибо)

Link to comment
Share on other sites

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using our site you agree to the Terms of Use