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

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

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

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

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

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

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

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

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

Подробнее

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

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

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

North

Пользователь
  • Постов

    32
  • Зарегистрирован

  • Посещение

Весь контент North

  1. I have defined the button as a child of my widgets form. I got a reference to it and then duplicated it to add it to the standard NPC Teleport addon panel. I don't need a form. Can I add the button to the game so I can access it from lua without adding it to a form? I'll take a look at PaneLocker but I don't think it is the same context. Thank you.
  2. I imagined the reason why the reactions aren't sent to my addon is because I added my buttons to another form. I am used to functional programming, mainly JavaScript, and I was expecting the same type of flexibility. I don't know what you mean by copying the buttons. For one, as you know, we only have access to a very old version of that addon, and only the lua files for it. If you have the xdb files defining the gui elements could you please give me a link to them or tell me how I can get to them? Also, having a copy of those buttons isn't going to help me handle the reactions unless I replicate the panel. Replicating the panel doesn't help if I'm not mistaken. There needs to be interaction with a teleportNPC to be able to teleport (this claim isn't tested). Also, I would need to hide the original addon (easy part) and show mine when the teleport option is selected. This is the difficult part. I couldn't find events related to the Teleport Widget. I am starting to think that it is impossible to do what I want. The best I can think of is set the same reaction on click for my buttons and keep the name for each location button. This is how they seemed to keep their data. I think this is what you meant by copying their buttons. This is a poor replacement for what I had in mind in terms of usability. Also, I can't really get the actual buttons from the list because they are not named resources. So I don't have access to their name or label. The best I could do is guess what the order is. This means you could get scenarios when you click to teleport to a location and wake up to be in a totally different place. Thank you for your answer.
  3. I've made steady progress with this addon. Right now I don't know why I can't attach an event handler for Button clicked. Here is the addon code. From line 109 you can see where I tried this but without success. It would be great if anyone can tell me what I did wrong. http://www.2shared.com/file/3QvDHvjy/TeleportSort.html PS: Please don't mind the mess inside init.lua. That is the testing ground. After something works it gets refactored and done right. PPS: To test it you have to open the ContextNPCTeleport window (talk to the NPC) then unload and load the script from the addon manager.
  4. I don't think the button I was looking for was a named child. I inspected the widget with InterfaceManager to see what I can access and couldn't find it. If I'm not mistaken, the InterfaceManager uses GetNamedChildren to display the child list. I'll try to create my own resources (buttons). I'll keep you updated. Thank you for your quick replies.
  5. I already managed to delete all the container contents. I was also able to add a duplicate of the Teleport button (the one near Cancel). I think I'll also have to replace the Teleport button inside the widget. This is turning into an interesting challenge. I'll see to creating my own resources when I get home. I'll use the AOTextureViewer to see what I can use.
  6. Yes, the problem I have is how to get that description (wtTeleportButtonDesc). I looked into ContextNPCTeleport lua (the old one) to find the rest of the information. Code: -- wtMain - the widget for ContextNpcTeleport wtTeleportButton = wtMain:GetChildChecked( "TeleportButton", false ) wtTeleportButtonDesc = wtTeleportButton:GetWidgetDesc() The problem is I can't get wtTeleportButton because it is not named. I think it is not possible. I've looked though the API, and only named widgets can be accessed. I'm thinking of enhancing it anyhow. I want to list only the Map names. When clicked it either opens a drop down that lists all the locations on that map and select the first by default or clears the list and adds only the locations from that map. I'll try to dig some information on how to create the widgets (buttons). I think I can't get to the default buttons. LE: I just read the GUI tutorial here. I'll try creating my own resources.
  7. Hi, I've started working on an addon that revamps the Teleport dialog and the HearthStone dialog to fix those inconsistent map names. Example: Dead Thicket, Lightwood should be Lightwood, Dead Thicket .... First the map name and then the zone I have the code part for the locations list done: Code: function normalizeLocationName(name) local maps = { "Novograd", "Lightwood", "Siveria", "Frozen Frontier", "Darkwater", "Tenebra", "Asee-Teph", "Eljune", "Coba Plateau" }; for i, mapName in pairs(maps) do local pos = string.find(name, mapName); if pos and pos > 1 then return mapName .. ", " .. string.sub(name, 1, pos - 3); end end return name; end ------------------------------------------------------------------------------- function getSortedLocations() local locations = {}; local avatarTpLocations = avatar.GetTeleportLocations() for id, objectId in avatarTpLocations do local info = avatar.GetTeleportLocationInfo(objectId) if info then table.insert(locations, { id = info.id, name = normalizeLocationName(userMods.FromWString(info.name)) }); end end table.sort(locations, function (a, return a.name < b.name; end); return locations; end I also cleared the list of locations (populated by the script). The problem is I don't have the widget resource object to be able to call: Code: mainForm:CreateWidgetByDesc( wtTeleportButtonDesc ) I would use the one already defined by the game but I couldn't do it because it isn't named. Can anyone help me with this? PS: I learned the LUA programming language so that isn't a problem. The allods API is giving me a hard time.
×
×
  • Создать...

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

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