Quantcast
Download
(13 Kb)
Download
Updated: 08-30-17 07:51 AM
Compatibility:
Shadows of Argus (7.3.0)
Updated:08-30-17 07:51 AM
Created:07-19-16 12:43 PM
Downloads:223
Favorites:3
MD5:
7.3.0

Wasabi

Version: 4
by: p3lim [More]

Description

Wasabi is a framework used to implement options for addons.
It has support for a multitude of different widgets, and will handle the savedvariables completely.

For details on how to implement this in your own addon, please see the wiki:
https://github.com/p3lim-wow/Wasabi/wiki

Feedback

If you have a question, please use the comments section on Curse/WoWInterface.
If you would like to report a bug or contribute to the project, please follow this link to get started.

Legal

Please see the LICENSE file.

Archived Files (3)
File Name
Version
Size
Author
Date
3
13kB
p3lim
04-29-17 02:46 PM
2
13kB
p3lim
08-25-16 07:11 AM
1
17kB
p3lim
07-19-16 12:43 PM


Post A Reply Comment Options
Unread 06-13-17, 04:07 AM  
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1596
File comments: 1216
Uploads: 30
Re: Database question.

Originally Posted by Kkthnx
...
I am in the process of reworking most of the database stuff, open up a ticket so I remember this.
Report comment to moderator  
Reply With Quote
Unread 06-12-17, 02:30 PM  
Kkthnx
A Cobalt Mageweaver
 
Kkthnx's Avatar
AddOn Author - Click to view AddOns

Forum posts: 226
File comments: 89
Uploads: 13
Database question.

Hey p3lim. Once again thank you for your work.

Currently, I noticed you have to use a Database for each module you make. The below example should explain more.

Lua Code:
  1. local General = LibStub("Wasabi"):New(K.Title, "GeneralDB", C.General)
  2. General:AddSlash("/kkthnxui")
  3. General:Initialize(function(self)
  4.   local Title = self:CreateTitle()
  5.     Title:SetPoint("TOPLEFT", 16, -16)
  6.     Title:SetText("General Options")
  7.  
  8.     local AutoScale_OnEnter = function(self)
  9.         GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT")
  10.         GameTooltip:AddLine("Automatically scale the User Interface based on your screen resolution", 0, 1, 0)
  11.         GameTooltip:Show()
  12.     end
  13.  
  14.   local AutoScale = self:CreateCheckButton("AutoScale")
  15.     AutoScale:SetPoint("TOPLEFT", Title, "BOTTOMLEFT", 0, -8)
  16.     AutoScale:SetText("Auto Scale Resolution")
  17.     AutoScale:SetScript("OnEnter", AutoScale_OnEnter)
  18.     AutoScale:SetScript("OnLeave", GameTooltip_Hide)
  19.  
  20.     local FontSize_OnEnter = function(self)
  21.         GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT")
  22.         GameTooltip:AddLine("Set the font size for everything in UI. Note: This doesn't effect somethings that have their own seperate options (UnitFrame Font, Datatext Font, ect..)", 0, 1, 0)
  23.         GameTooltip:Show()
  24.     end
  25.  
  26.     local FontSize = self:CreateSlider("FontSize")
  27.     FontSize:SetRange(10, 20)
  28.     FontSize:SetStep(1)
  29.     FontSize:SetPoint("TOPLEFT", AutoScale, "BOTTOMLEFT", 0, -8)
  30.     FontSize:SetText("Set UI Font Size")
  31.     FontSize:SetScript("OnEnter", FontSize_OnEnter)
  32.     FontSize:SetScript("OnLeave", GameTooltip_Hide)
  33. end)
  34.  
  35. local ActionBar = General:CreateChild("ActionBar", "ActionBarDB", C.ActionBar)
  36. ActionBar:Initialize(function(self)
  37.   local Title = self:CreateTitle()
  38.     Title:SetPoint("TOPLEFT", 16, -16)
  39.     Title:SetText("ActionBar Options")
  40.  
  41. end)

So, in theory, I am wondering something here. I am wanting to just use one SavedVariable for everything. I just want to use KkthnxUIDB instead of filling ActionBarDB, GeneralDB, NameplatesDB and so on. Now I could have overlooked this as I am still checking out your Lib.

To kinda show what I am wanting is more of a compact Database from your config. Would be a lot cleaner.

Lua Code:
  1. KkthnxUIData = {
  2.     ["Stormreaver"] = {
  3.         ["Gripsohard"] = {
  4.             ["SplitBars"] = true,
  5.             ["Movers"] = {
  6.                 ["Loot / Alert Frames"] = {
  7.                     "CENTER", -- [1]
  8.                     "UIParent", -- [2]
  9.                     "CENTER", -- [3]
  10.                     -334, -- [4]
  11.                     60.9999656677246, -- [5]
  12.                 },
  13.             },
  14.             ["BottomBars"] = 2,
  15.             ["RightBars"] = 1,
  16.             ["InstallComplete"] = true,
  17.             ["BarsLocked"] = true,
  18.         },
  19.         ["Pervie"] = {
  20.             ["SplitBars"] = true,
  21.             ["Movers"] = {
  22.                 ["Loot / Alert Frames"] = {
  23.                     "CENTER", -- [1]
  24.                     "UIParent", -- [2]
  25.                     "CENTER", -- [3]
  26.                     -334, -- [4]
  27.                     60.9999656677246, -- [5]
  28.                 },
  29.                 ["KkthnxUIBuffHeader"] = {
  30.                     "RIGHT", -- [1]
  31.                     "UIParent", -- [2]
  32.                     "RIGHT", -- [3]
  33.                     -324.000183105469, -- [4]
  34.                     119.999938964844, -- [5]
  35.                 },
  36.             },
  37.             ["BottomBars"] = 2,
  38.             ["RightBars"] = 1,
  39.             ["InstallComplete"] = true,
  40.             ["BarsLocked"] = true,
  41.         },
  42.     },
  43. }
__________________
Success isn't what you've done compared to others. Success is what you've done compared to what you were made to do.
Last edited by Kkthnx : 06-12-17 at 03:07 PM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump:

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.