Using Two libs for a better UI integration
2 posters
Total RP 2 :: Development :: Discussion
Page 1 of 1
Using Two libs for a better UI integration
I modify a lot my user interface using a lot of addons (maybe too much)
Two of these addons is for my minimap and the other one to display Broker's addons.
I have modified for my own TRP2 file to use two specific libraries:
_LibDataBroker-1.1
_LibDBIcon-1.0
So what I did is not the best but it's a quick bit of code to use the two libraries:
In totalRP2.lua at the end of TRP2_OnLoaded() function I added this code:
Two of these addons is for my minimap and the other one to display Broker's addons.
I have modified for my own TRP2 file to use two specific libraries:
_LibDataBroker-1.1
_LibDBIcon-1.0
So what I did is not the best but it's a quick bit of code to use the two libraries:
In totalRP2.lua at the end of TRP2_OnLoaded() function I added this code:
- Code:
TRP2_MinimapButton:Hide()
local LDB = LibStub("LibDataBroker-1.1", true):NewDataObject("totalRP2", {
type = "launcher",
icon = [[Interface\AddOns\totalRP2\Images\icon]],
OnClick = function(clickedframe, button)
if button == "RightButton" then
if TRP2_RaccBar:IsVisible() then
TRP2_RaccBar:Hide();
else
TRP2_RaccBar:Show();
end
else
TRP2_OpenMainMenu(not TRP2MainFrame:IsVisible())
end
end,
OnTooltipShow = function(tt)
tt:AddLine("|cff1eff00Total RolePlay 2")
tt:AddLine("|cffffff00Click: |cffffffffShow/hide TRP2 window.", 1, 1, 1)
tt:AddLine("|cffffff00Right-click: |cffffffffShow/hide toolbar.", 1, 1, 1)
end
})
if LDB then
local LibDBIcon = LibStub("LibDBIcon-1.0", true)
if LibDBIcon and not IsAddOnLoaded("Broker2FuBar") then
LibDBIcon:Register("totalRP3", LDB, {hide=false,minimapPos=200,radius=80})
end
end
CMCCallaghan- Developer
- Posts : 25
Join date : 2014-02-18
Re: Using Two libs for a better UI integration
Thank you for this suggestion (and the other one in the translation section, I've seen it but I didn't have time to reply yet).
I like the idea of using libraries as, like you said, it would allow a better integration with other addons.
I will look at it. In the meantime, I'm moving this topic to the development section, which you now have access
I like the idea of using libraries as, like you said, it would allow a better integration with other addons.
I will look at it. In the meantime, I'm moving this topic to the development section, which you now have access
Ellypse- Admin
- Posts : 215
Join date : 2013-09-26
Age : 33
Location : Paris, France
Re: Using Two libs for a better UI integration
Thank you for the access.
I didn't had too much time to look into the code, but I will try to see if we could use more Ace3 libraries to make the addon somehow lighter.
I'm also trying to reduce the amount of frames and buttons registered by the addon in order to recycle a lot of them (changing size texture and scripts)
But this is not something that should be a priority as it means a complete or almost complete rewrite of the addon. It might be good for the third version of the addon. As for myself I'm working on something else not related to total RP 2
I didn't had too much time to look into the code, but I will try to see if we could use more Ace3 libraries to make the addon somehow lighter.
I'm also trying to reduce the amount of frames and buttons registered by the addon in order to recycle a lot of them (changing size texture and scripts)
But this is not something that should be a priority as it means a complete or almost complete rewrite of the addon. It might be good for the third version of the addon. As for myself I'm working on something else not related to total RP 2
CMCCallaghan- Developer
- Posts : 25
Join date : 2014-02-18
Re: Using Two libs for a better UI integration
The what?CMCCallaghan wrote:It might be good for the third version of the addon.
Ellypse- Admin
- Posts : 215
Join date : 2013-09-26
Age : 33
Location : Paris, France
Re: Using Two libs for a better UI integration
total RP 3 :p
In other words and it's the most important, not something to really focus on right now
In other words and it's the most important, not something to really focus on right now
CMCCallaghan- Developer
- Posts : 25
Join date : 2014-02-18
Re: Using Two libs for a better UI integration
What Total RP 3? I don't know what you are talking about !
Ellypse- Admin
- Posts : 215
Join date : 2013-09-26
Age : 33
Location : Paris, France
Re: Using Two libs for a better UI integration
total RP 2 is basically a total rewrite of total RP which was abandonned by it's first author.
So if you completely rewrite the code then you might change the total RP number from 2 to 3. But once again it's not something important right now.
Anyway forget about it it was just a lil joke nothing more
So if you completely rewrite the code then you might change the total RP number from 2 to 3. But once again it's not something important right now.
Anyway forget about it it was just a lil joke nothing more
CMCCallaghan- Developer
- Posts : 25
Join date : 2014-02-18
Re: Using Two libs for a better UI integration
Oh, okay x) Well it's one thing to maintain an addon and an other to write a new one from scratch. I'm fairly new to .lua and addon development, so making an addon from scratch by myself would take me months, maybe years, to create something at least equivalent to Total RP 2.
Ellypse- Admin
- Posts : 215
Join date : 2013-09-26
Age : 33
Location : Paris, France
Re: Using Two libs for a better UI integration
While using Ace3 libraries and many related libraries from wowace you can save a lot of time coding.
Also wowprogramming.com offers the complete api listing from wow interface and also all FrameXML files used by Blizzard for it's interface.
Of course it's long to develop an addon but once you have the basis of the addon then it's just how you are going to make your code.
For example in total RP2 I couldn't remove the minimap code from the xml file because the addon is testing something womewhere and I haven't found what and where. Due to this lack of knowledge from the addon's code I simply hide it and replace it with my own one.
Also wowprogramming.com offers the complete api listing from wow interface and also all FrameXML files used by Blizzard for it's interface.
Of course it's long to develop an addon but once you have the basis of the addon then it's just how you are going to make your code.
For example in total RP2 I couldn't remove the minimap code from the xml file because the addon is testing something womewhere and I haven't found what and where. Due to this lack of knowledge from the addon's code I simply hide it and replace it with my own one.
CMCCallaghan- Developer
- Posts : 25
Join date : 2014-02-18
Re: Using Two libs for a better UI integration
I use wowprogramming.com, along with www.wowwiki.com/World_of_Warcraft_API (which I find better to browse), and wowAce's forum Unfortunately, for times like yesterday's chaos, those sites are not always up to date. None of them were referencing the GetChatColored function. It's so sad Blizzard doesn't have a complete documentation for addon developers. I'm glad I had Telkostrasz to helped me yesterday
Ellypse- Admin
- Posts : 215
Join date : 2013-09-26
Age : 33
Location : Paris, France
Re: Using Two libs for a better UI integration
By the way, I was looking for stuff in wowprogramming's artwork browser yesterday and it seems that it hasn't been updated to MoP So you might want to be careful with the documentation there as it might not be up to date.
Ellypse- Admin
- Posts : 215
Join date : 2013-09-26
Age : 33
Location : Paris, France
Re: Using Two libs for a better UI integration
I don't use wowprogramming for the artwork browser but for the API listing.
Not all functions are documented though.
Not all functions are documented though.
CMCCallaghan- Developer
- Posts : 25
Join date : 2014-02-18
Total RP 2 :: Development :: Discussion
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|