Coder Social home page Coder Social logo

wasabi's Introduction

Wasabi

This is an addon for the popular MMORPG "World of Warcraft".
It can be downloaded at Curse or at WoWInterface.

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.

wasabi's People

Contributors

p3lim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

kaytotes

wasabi's Issues

Database rework reminder!

This is just a reminder for the Database rework.

https://www.wowinterface.com/downloads/info24061-Wasabi.html#comments
From the link above you can see my examples.

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.

local General = LibStub("Wasabi"):New(K.Title, "GeneralDB", C.General)
General:AddSlash("/kkthnxui")
General:Initialize(function(self)
  local Title = self:CreateTitle()
    Title:SetPoint("TOPLEFT", 16, -16)
    Title:SetText("General Options")
 
    local AutoScale_OnEnter = function(self)
        GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT")
        GameTooltip:AddLine("Automatically scale the User Interface based on your screen resolution", 0, 1, 0)
        GameTooltip:Show()
    end
 
  local AutoScale = self:CreateCheckButton("AutoScale")
    AutoScale:SetPoint("TOPLEFT", Title, "BOTTOMLEFT", 0, -8)
    AutoScale:SetText("Auto Scale Resolution")
    AutoScale:SetScript("OnEnter", AutoScale_OnEnter)
    AutoScale:SetScript("OnLeave", GameTooltip_Hide)
 
    local FontSize_OnEnter = function(self)
        GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT")
        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)
        GameTooltip:Show()
    end
 
    local FontSize = self:CreateSlider("FontSize")
    FontSize:SetRange(10, 20)
    FontSize:SetStep(1)
    FontSize:SetPoint("TOPLEFT", AutoScale, "BOTTOMLEFT", 0, -8)
    FontSize:SetText("Set UI Font Size")
    FontSize:SetScript("OnEnter", FontSize_OnEnter)
    FontSize:SetScript("OnLeave", GameTooltip_Hide)
end)
 
local ActionBar = General:CreateChild("ActionBar", "ActionBarDB", C.ActionBar)
ActionBar:Initialize(function(self)
  local Title = self:CreateTitle()
    Title:SetPoint("TOPLEFT", 16, -16)
    Title:SetText("ActionBar Options")
 
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.

KkthnxUIData = {
    ["Stormreaver"] = {
        ["Gripsohard"] = {
            ["SplitBars"] = true,
            ["Movers"] = {
                ["Loot / Alert Frames"] = {
                    "CENTER", -- [1]
                    "UIParent", -- [2]
                    "CENTER", -- [3]
                    -334, -- [4]
                    60.9999656677246, -- [5]
                },
            },
            ["BottomBars"] = 2,
            ["RightBars"] = 1,
            ["InstallComplete"] = true,
            ["BarsLocked"] = true,
        },
        ["Pervie"] = {
            ["SplitBars"] = true,
            ["Movers"] = {
                ["Loot / Alert Frames"] = {
                    "CENTER", -- [1]
                    "UIParent", -- [2]
                    "CENTER", -- [3]
                    -334, -- [4]
                    60.9999656677246, -- [5]
                },
                ["KkthnxUIBuffHeader"] = {
                    "RIGHT", -- [1]
                    "UIParent", -- [2]
                    "RIGHT", -- [3]
                    -324.000183105469, -- [4]
                    119.999938964844, -- [5]
                },
            },
            ["BottomBars"] = 2,
            ["RightBars"] = 1,
            ["InstallComplete"] = true,
            ["BarsLocked"] = true,
        },
    },
}

Attempt to index global 'FramesDB' (a nil value)

I've been having in issue with Wasabi db7f114 for a short while but trying to finally tackle it now. In my addon Improved Blizzard UI I use Wasabi for the configuration.

I've been having an issue that only affects new users or when I add a new configuration option. Essentially due to them not having the saved variables any checks towards them are attempting to access a nil global and failing, doing a /reload (after the variables have been created) resolves the issue going forwards. At least until a new option is added.

I'm unsure if this is a bug or an implementation issue / misunderstanding on my part. How best should I be handling ensuring this can't be nil and deferring until they're set?

Here is an error message I'm getting however plenty are generated on first load.

3x ...ddOns\ImprovedBlizzardUI\modules\frames\killfeed.lua:170: attempt to index global 'FramesDB' (a nil value)
...ddOns\ImprovedBlizzardUI\modules\frames\killfeed.lua:170: in function <...ddOns\ImprovedBlizzardUI\modules\frames\killfeed.lua:167>

Locals:
event = "ADDON_LOADED"
(*temporary) = "attempt to index global 'FramesDB' (a nil value)"
KillFeed_Update = <function> defined @ImprovedBlizzardUI\modules\frames\killfeed.lua:55

This directly coincides with this line of code which makes sense to me because obviously it's before any addon loaded events etc. However in the same file during these lines I am waiting for addon loaded and yet this errors too.

Could you possibly advise on best practices for this situation if at all possible?

Can we support more color picker formats?

  • What version are you using?
    I am using the version of GitHub.

  • Can the issue be reproduced, and if so, how?
    Currently, the color picker will not accept color formats like so
    ["GoodColor"] = {75/255, 175/255, 76/255},

  • If there was an error message, please include it.

4x ...ns\KkthnxUI\Libraries\Wasabi\widgets\ColorPicker.lua:17: bad argument #1 to 'sub' (string expected, got nil)
[C]: in function `sub'
...ns\KkthnxUI\Libraries\Wasabi\widgets\ColorPicker.lua:17: in function <...ns\KkthnxUI\Libraries\Wasabi\widgets\ColorPicker.lua:16>
...ns\KkthnxUI\Libraries\Wasabi\widgets\ColorPicker.lua:24: in function `Update'
KkthnxUI\Libraries\Wasabi\Wasabi-3.lua:147: in function `refresh'
KkthnxUI\Libraries\Wasabi\Wasabi-3.lua:104: in function <KkthnxUI\Libraries\Wasabi\Wasabi.lua:82>
[C]: in function `Show'
FrameXML\InterfaceOptionsFrame.lua:28: in function `InterfaceOptionsList_DisplayPanel'
FrameXML\InterfaceOptionsFrame.lua:46: in function `InterfaceOptionsListButton_OnClick'
[string "*:OnClick"]:2: in function <[string "*:OnClick"]:1>

Locals:
(*temporary) = nil
(*temporary) = 3
(*temporary) = 4
(*temporary) = "string expected, got nil"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.