WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Search/Requests (https://www.wowinterface.com/forums/forumdisplay.php?f=6)
-   -   Looking for an addon that has well designed Interface options panel. (https://www.wowinterface.com/forums/showthread.php?t=55379)

Layback_ 05-08-17 05:49 AM

Looking for an addon that has well designed Interface options panel.
 
Hi all,

The title says pretty much all :)

I'm currently looking for an addon which has a well designed Interface Options Panel so that I can use it as a learning reference.

The fundamental function of my Options panel would be adding/removing a spell id from db, SV.

So, I guess there should be at least:
  • Edit box to enter a spell id
  • Button to add a new spell to db
  • Scrollable list to display spell id and icon which player can select to remove
  • Button to remove a selected spell from db
  • 2~4 tabs attached to Scrollable list to select spec (2 for DH and 4 for Druid)

Could I get some recommendations?

Thank you!

syncrow 05-08-17 09:39 AM

I'm not advertising for lightspark's UI here, but it has exactly what you want!

Take a look at the 4th screenshot!

Kanegasi 05-08-17 09:45 AM

While building my addon Decliner, the two most helpful addons for learning the interface options frame for me were Work_Complete and BadBoy_CCleaner. The former has a ton of comments in their code which made understanding how the frame works a lot easier and the latter gave me the plan for using a displayed list with an input box and a button to add or remove things from the list.

lightspark 05-08-17 10:04 AM

Quote:

Originally Posted by syncrow (Post 323268)
I'm not advertising for lightspark's UI here, but it has exactly what you want!

Take a look at the 4th screenshot!

No! Just no!

Mate, config is the worst part of my UI, both code- and appearance-wise.

Layback_ 05-08-17 08:09 PM

Hi guys,

Thank you for the references :D!!

And lightspark, like syncrow said, your project is exactly what I've been looking for.

Please let me use your work as my learning reference :banana:!!

Layback_ 05-08-17 09:20 PM

I barely get how lightspark's config dialog works (as I am a slow learner), but I guess the challenge would be combining custom frames to AceConfig, haha!!

lightspark 05-09-17 01:38 AM

Quote:

Originally Posted by Layback_ (Post 323282)
I barely get how lightspark's config dialog works (as I am a slow learner), but I guess the challenge would be combining custom frames to AceConfig, haha!!

Mate, really, don't do it... At this point even I plan to move to Ace* libs.

I'm not saying it just to look humble/modest, I'm saying as a programmer, my config is not something you're looking for.

If you're already using Ace* libs, you're better off checking out elvUI config, it's well-organised, really clean and easy to use.

Layback_ 05-09-17 03:44 AM

Quote:

Originally Posted by lightspark (Post 323285)
Mate, really, don't do it... At this point even I plan to move to Ace* libs.

I'm not saying it just to look humble/modest, I'm saying as a programmer, my config is not something you're looking for.

If you're already using Ace* libs, you're better of checking out elvUI config, it's well-organised, really clean and easy to use.

If you say so, haha!

Hope to see a new version of your ls: UI soon :)!!

*EDIT: Just had a look at ElvUI's config and seems it's well designed like you said, but bit sad that there is no scrollable list T_T

p3lim 05-09-17 02:18 PM

Self-promoting but, if you want to try out something else you could take a look at my config library Wasabi.
It's widget-based and takes care of savedvariables automatically, implementing it is rather easy and has the possibility for plugins (although I do take suggestions/pullrequests if it's reasonable).

No wiki yet, although the test config should be easy enough to understand.
Also no profiles support yet, I'll be implementing that in June.

Using the ObjectContainer widget you should be able to implement a scrollable list like you want (everything in Wasabi is automatically made into a scrollable list if it exceeds the height of the parent container).

Layback_ 05-09-17 08:08 PM

Quote:

Originally Posted by p3lim (Post 323290)
Self-promoting but, if you want to try out something else you could take a look at my config library Wasabi.
It's widget-based and takes care of savedvariables automatically, implementing it is rather easy and has the possibility for plugins (although I do take suggestions/pullrequests if it's reasonable).

No wiki yet, although the test config should be easy enough to understand.
Also no profiles support yet, I'll be implementing that in June.

Using the ObjectContainer widget you should be able to implement a scrollable list like you want (everything in Wasabi is automatically made into a scrollable list if it exceeds the height of the parent container).

Sweet!!

Just had a time on testing your test code and got few questions.

(1) Is one WasabiOptionsPanel shared by all addons that uses Wasabi?

EDIT: My bad. It seems to create each panel via :New() and :CreateChild() functions.

(2) Would it be possible to modify position/size of sliders externally?
(I tried accessing either by calling ObjectSlider or object.Slider and neither of them worked.)

(3) What does this part of test code do?

Lua Code:
  1. -- Fill a table with random colors
  2. local defaults_objects = {objects={}}
  3. local r = math.random
  4. for index = 1, 100 do
  5.     defaults_objects.objects[index] = {r = r(), g = r(), b = r()}
  6. end
  7.  
  8. local ObjectContainer = Panel:CreateChild('ObjectContainer', 'WasabiObjectsDB', defaults_objects)

I get other two default tables and understand that you assigned a table with 100 different RGB colors, but I don't really see anything done with those values on ObjectContainer panel.

(4) Where could I find CreateObjectContainer function definition?

(5) This could be my personal preferences, but do you have any plans to implement faux scrollable list?

p3lim 05-11-17 06:37 AM

Quote:

Originally Posted by Layback_ (Post 323292)
(2) Would it be possible to modify position/size of sliders externally?
(I tried accessing either by calling ObjectSlider or object.Slider and neither of them worked.)

You can, within the Initialization function you can access the global slider for the whole options panel through self.Slider, and for the slider for each ObjectContainer it's through ObjectContainer.Slider.
The Thumb and Up/Down buttons are only accessible through their global name, but I can change that.


Quote:

Originally Posted by Layback_ (Post 323292)
(3) What does this part of test code do?

Lua Code:
  1. -- Fill a table with random colors
  2. local defaults_objects = {objects={}}
  3. local r = math.random
  4. for index = 1, 100 do
  5.     defaults_objects.objects[index] = {r = r(), g = r(), b = r()}
  6. end
  7.  
  8. local ObjectContainer = Panel:CreateChild('ObjectContainer', 'WasabiObjectsDB', defaults_objects)

I get other two default tables and understand that you assigned a table with 100 different RGB colors, but I don't really see anything done with those values on ObjectContainer panel.

It adds 100 random colors to a table, which is then used as the dummy data for the whole subpanel.
It not showing up is a bug I just fixed, forgot to update after some Texture method API was changed in Legion.
Latest GitHub source has that fixed, but since nothing changed in the core (just the test) I'm not updating it here on wowi.

Quote:

Originally Posted by Layback_ (Post 323292)
(4) Where could I find CreateObjectContainer function definition?

As of the current version, line 148 in widgets/ObjectContainer.lua.
Wasabi's internal system exposes the registered widgets to the options panel by prefixing the widget name with "Create", see line 293 and 100 in Wasabi.lua.

Quote:

Originally Posted by Layback_ (Post 323292)
(5) This could be my personal preferences, but do you have any plans to implement faux scrollable list?

No plans, but given a good reason I'll consider any feature request.

Layback_ 05-12-17 12:16 AM

Hi p3lim,

Quote:

Originally Posted by p3lim (Post 323325)
You can, within the Initialization function you can access the global slider for the whole options panel through self.Slider, and for the slider for each ObjectContainer it's through ObjectContainer.Slider.
The Thumb and Up/Down buttons are only accessible through their global name, but I can change that.

I've tested in each of Initialize function to call Slider and it seems to be returning a nil value.

Lua Code:
  1. local ObjectContainer = Panel:CreateChild('ObjectContainer', 'WasabiObjectsDB', defaults_objects)
  2. ObjectContainer:Initialize(function(self)
  3.     print(self.Slider);
  4.     print(ObjectContainer.Slider);
  5.  
  6.     -- Code...
  7. end

EDIT: According to UpdateSlider function in Wasabi.lua (L#252), it seems like Slider is not yet created until this function detects an overflow.

Does this mean that I should wait until it being created?

Quote:

Originally Posted by p3lim (Post 323325)
It adds 100 random colors to a table, which is then used as the dummy data for the whole subpanel.
It not showing up is a bug I just fixed, forgot to update after some Texture method API was changed in Legion.
Latest GitHub source has that fixed, but since nothing changed in the core (just the test) I'm not updating it here on wowi.

Yeap, that did solve the problem.

I wasn't aware of that the APIs changed for textures :p

Quote:

Originally Posted by p3lim (Post 323325)
As of the current version, line 148 in widgets/ObjectContainer.lua.
Wasabi's internal system exposes the registered widgets to the options panel by prefixing the widget name with "Create", see line 293 and 100 in Wasabi.lua.

Ah, that's why I could've not found it!

Thanks for letting me know :banana:

Quote:

Originally Posted by p3lim (Post 323325)
No plans, but given a good reason I'll consider any feature request.

Sweet!

Thank you for your consideration :)


All times are GMT -6. The time now is 06:32 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI