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

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

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

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

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

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

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

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

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

Подробнее

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

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

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

Started coding an addon, need help with button resource


North

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

BINGO!?!?!?!?!?

I have an idea. Create a massive amount of functions whose purpose will be logging it's names.

Like function ABCDEFG() LogInfo("ABCDEFG") end

etc, billions of them. (use some function to register everything from A to ZZZZZZZZZZZZZZZZZZZZZZZZZZ, for example).

Then we make some developer's widgets children of our addon, and click their buttons. And voila - we see their reaction names.

I think this will require some function that creates functions from A to Z and subscribes them to respective reactions. I don't think that this may prevent the game from working properly as it does not seem to mind being unresponsible.

Also, if anyone has any kind of dictionary - it may be usefull to create only reactions that have words or parts of words (e.g. creating a function with name "AABCHHTTGERWFSF_ERDFSFD_F_TE" seems to be totally useless, we know that all reactions are created by adding words together, with underscore delimiter).

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

Quote:
I think this will require some function that creates functions from A to Z and subscribes them to respective reactions.


Or just a script, that creates the big among of lua code for it^^

@North: Nice idea, I will definitely test it, if i have time.

Quote:
- when opening the panel you will also have the normal buttons in the list. This isn't a big inconvenience because all the relevant buttons are first and have a different color.


You can easily set Widget:Show(false) for all standard radio buttons
Ссылка на комментарий
Поделиться на другие сайты

Quote:
You can easily set Widget:Show(false) for all standard radio buttons

I think you can use wtScrollableContainer:RemoveItems() to remove all items from that container before adding your ones.
Ссылка на комментарий
Поделиться на другие сайты

GODDAMN! Another idea. Does :Show(true/false) trigger EVENT_EFFECT_FINISHED?? If yes...

UPD: It does not :( Just tested.

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

If you are interested in reactions and such, all strings in a luac file can be read (open using noteapad++ for example). Extract LuaCompiledIngame.pak using WinZip and opend the file you are interested in. There is one thing you must keep in mind. Only widgets that are part of your form send reactions to your addon. What is useful in knowing the reactions is that you can move the panel to your form and rewrite all the functionality. You will only have the GUI.

I am using wtScrollableContainer:RemoveItems() to clear the container. As you can see, all other buttons are pushed after I've done my addition. The ContextNpcAddon sends an event when selecting the teleport option:

Code:
common.SendEvent( "SCRIPT_TOGGLE_TELEPORT", {} )

The original addon uses this event to add the buttons to the ScrollableContainer. Unfortunatly, it seems I don't get this event in my addon.

I know about using Widget:Show(false). I do use it in my addon. There is a problem though, namely, I don't have access to those buttons because they are not named resources. This is why I had to add my button.

LE: You can look in the sources of my addon. I think it is quite clean apart from some test code in init.lua; you will also see how you can use closures to your advantage. The best example is the cachedButtonList. It encapsulates all the behavior in one place. You have an object with state and functions that modify that state when called.

LLE: I want to align the text on my buttons to the left. Can anyone please help me with that? It doesn't seem to work for me.

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

You can not access these childs directly but you can iterate throw all child of the container and check if they are the one, you have created, if not you can delete/hide them. If there is no way to find a event, which is fired after the game is adding his radio buttons, you can still use EVENT_SECOND_TIMER to create a delay of 1 second after your adding code, where you can clean up all the radio buttons, the game has added (I think nearly nobody will scroll down the list in the first second)

Quote:
LLE: I want to align the text on my buttons to the left. Can anyone please help me with that? It doesn't seem to work for me.

I found this in the widgets "API"/example collection

Code:
<TextStyle>

<Align>ALIGNY_MIDDLE</Align>

</TextStyle>

so try ALIGNY_LEFT

BTW: One big improvement for the feature would be, if you could add a input field, which works as typeahead.

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

Quote:
LLE: I want to align the text on my buttons to the left. Can anyone please help me with that? It doesn't seem to work for me.


I didn't look your code/paneling over too much, but from what I can see North, you're using a Prototype button. Add alignx='left' to the ButtonFormatNormal.txt's <button> and it will align the Prototype to the left. Your text reference in the ListButton.(WidgetButton).xdb is unused.
Ссылка на комментарий
Поделиться на другие сайты

common.SendEvent() and userMods.SendEvent() send events to system state and addon state, they don't interact with each other.

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

I have added the search as you type feature. I would like to receive further feedback on the TeleportEnhancer forum

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

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

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

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

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

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

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

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

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

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