Перейти к содержанию

Дайджесты за январь-февраль

Обновления гайдов и аддонов

Январь Февраль

Мониторинг серверов и редактор аддонов

Представляем вам две легенды. То, о чем можно было только мечтать, стало реальностью.

Мониторинг серверов Редактор аддонов

Подсказки из игры на вашем сайте

Теперь вы можете отображать сведения о внутриигровых элементах простым наведением курсора мыши.

Подробнее

Апдейтер аддонов

Представляем вам программу для автообновления аддонов и делимся подробностями.

Подробнее Скачать

the new ConfigSection API


Гость Morted

Рекомендуемые сообщения

Hi there,

if have a quick question about the new AP functions:

How can you save/load data in custom Config.txt files?

AddonsTools does so, and TargetManager as well.

But how the hell do you do it? (i tried understanding your code, of cause)

shouldnt this save an entry to the "local" config.txt:

local cfg = {}

cfg["test"] = "insert"

userMods.SetAvatarConfigSection(common.GetAddonName(),cfg)

but it doesnt work.

Could anyone tell me why?

Ссылка на комментарий
Поделиться на другие сайты

I use:

Code:
local lConfig = userMods.GetAvatarConfigSection( common.GetAddonName().."DnD" ) or {}

This creates "lConfig" variable. If there is data in section called "addonnameDnD" then lConfig takes that data, otherwise lConfig is an empty table.

Then i use:

I change lConfig variable (for example set lConfig.DNDenabled to true) and use:

Code:
userMods.SetAvatarConfigSection( common.GetAddonName().."DnD", lConfig )

And that works fine. Do you get any errors, or can you show a little bit more of code?

The data is not saved into some custom config.txt, it's saved into user.cfg and global.cfg files.

Ссылка на комментарий
Поделиться на другие сайты

well how DO you save/read the custom config.txt then?^^

There must be a way of accessing those files, this is from the AddonDesc of TargetsManager:

<Item href="Scripts/Globals.luac" />

<Item href="config.txt" />

<Item href="Locales/Locales.lua" />

but how the hell do they work with the config.txt?

Ссылка на комментарий
Поделиться на другие сайты

They do not work with config.txt.

Her config.txt is just a lua script, you can't change it from ingame.

"They" open config.txt and change it via text editor.

Ссылка на комментарий
Поделиться на другие сайты

Please ask icreator about her addons and stuff, but her config.txt is just a simple lua script. Cant modify it from ingame.

It's usefull since she has all files compiled and you can't change them, but that one is not compiled and you can change it. And it's extension is txt instead of lua so ppl can edit it with notepad without explanation.

But it's still a lua script. It's executable lua script. No more.

You may have

<Item href="config.txt" />

<Item href="Documents/Mypornmovie.avi" />

But it'll (i believe) still work if it's just a lua script.

Ссылка на комментарий
Поделиться на другие сайты

Гость
Ответить в этой теме...

×   Вставлено с форматированием.   Восстановить форматирование

  Разрешено использовать не более 75 эмодзи.

×   Ваша ссылка была автоматически встроена.   Отображать как обычную ссылку

×   Ваш предыдущий контент был восстановлен.   Очистить редактор

×   Вы не можете вставлять изображения напрямую. Загружайте или вставляйте изображения по ссылке.

×
×
  • Создать...

Важная информация

Пользуясь сайтом, вы принимаете Условия использования