Skip to content

Commit

Permalink
Merge pull request #1 from speedwaystar/main
Browse files Browse the repository at this point in the history
v16beta.100002.speedwaystar
  • Loading branch information
Softrix authored Jan 15, 2023
2 parents 59229f5 + b489a6f commit e816413
Show file tree
Hide file tree
Showing 10 changed files with 1,599 additions and 939 deletions.
110 changes: 110 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"Lua.diagnostics.globals": [
"switch",
"tinsert",
"ceil",
"enum",
"dict",
"dictionary",
"myprint",
"printd",
"getValueFromKey",
"keyFromValue",
"valueToKey",
"test",
"keys",
"__key",
"tprint",
"tfindKey",
"tfindkey",
"printf",
"SmartBuff_KeyButton",
"SmartBuffOptionsFrame",
"SmartBuffSplashFrame",
"Parrot",
"LootFrame",
"SmartBuffTooltip",
"NUM_BAG_FRAMES",
"EarthFeature_AddButton",
"Cosmos_RegisterButton",
"SmartBuff_MiniMapButton",
"SmartBuffWNF_lblText",
"SmartBuffWNF",
"SmartBuffFrame",
"SmartBuff_BuffSetup",
"SmartBuff_PlayerSetup",
"SmartBuffOptionsCredits_lblText",
"SmartBuff_BuffSetup_BuffIcon2",
"SmartBuff_BuffSetup_BuffIcon1",
"SmartBuff_BuffSetup_cbSelf",
"SmartBuff_BuffSetup_cbSelfNot",
"SmartBuff_BuffSetup_cbCombatIn",
"SmartBuff_BuffSetup_cbCombatOut",
"SmartBuff_BuffSetup_cbMH",
"SmartBuff_BuffSetup_cbOH",
"SmartBuff_BuffSetup_cbReminder",
"SmartBuff_BuffSetup_cbRH",
"SmartBuff_BuffSetup_txtManaLimit",
"SmartBuff_BuffSetup_RBTime",
"SmartBuff_BuffSetup_btnPriorityList",
"SmartBuff_BuffSetup_btnIgnoreList",
"SmartBuff_BuffSetup_BuffText",
"SmartBuffOptionsFrame_cbSB",
"SmartBuffOptionsFrame_cbAuto",
"SmartBuffOptionsFrameAutoTimer",
"SmartBuffOptionsFrame_cbAutoCombat",
"SmartBuffOptionsFrame_cbAutoChat",
"SmartBuffOptionsFrame_cbAutoSplash",
"SmartBuffOptionsFrame_cbAutoSound",
"SmartBuffOptionsFrame_cbAutoSwitchTmp",
"SmartBuffOptionsFrame_cbBuffTarget",
"SmartBuffOptionsFrame_cbBuffPvP",
"SmartBuffOptionsFrame_cbAutoSwitchTmpInst",
"SmartBuffOptionsFrame_cbBuffInCities",
"SmartBuffOptionsFrame_cbInShapeshift",
"SmartBuffOptionsFrame_cbFixBuffIssue",
"SmartBuffOptionsFrame_cbAntiDaze",
"SmartBuffOptionsFrame_cbLinkSelfBuffCheck",
"SmartBuffOptionsFrame_cbLinkGrpBuffCheck",
"SmartBuffOptionsFrame_cbScrollWheelUp",
"SmartBuffOptionsFrame_cbScrollWheelDown",
"SmartBuffOptionsFrame_cbMsgNormal",
"SmartBuffOptionsFrame_cbMsgError",
"SmartBuffOptionsFrame_cbInCombat",
"SmartBuffOptionsFrame_cbIncludeToys",
"SmartBuffOptionsFrame_cbMsgWarning",
"SmartBuffOptionsFrame_cbHideMmButton",
"SmartBuffOptionsFrame_cbHideSAButton",
"SmartBuffOptionsFrameRebuffTimer",
"SmartBuffOptionsFrameBLDuration",
"SmartBuffOptionsFrame_cbSelfFirst",
"UIDropDownMenu_Initialize",
"UIDropDownMenu_SetSelectedValue",
"UIDropDownMenu_SetWidth",
"SmartBuffOptionsFrame_ddTemplates",
"UIDropDownMenu_CreateInfo",
"UIDropDownMenu_AddButton",
"SmartBuffSplashFrameOptions",
"SmartBuff_PlayerSetup_EditBox",
"SmartBuff_PlayerSetup_Title",
"TitanPanelBarButton",
"TitanPanelSmartBuffButton_SetIcon",
"SMARTBUFF_Fu_SetIcon",
"SmartBuffOptionsFrame_ScrollFrameBuffs",
"dump",
"ALL",
"SmartBuffOptionsFrame_TutorialButton",
"FauxScrollFrame_Update",
"HelpPlate_IsShowing",
"HelpPlate_Hide",
"HelpPlate_Show"
],
"Lua.diagnostics.disable": [
// "unused-function",
"need-check-nil",
"cast-local-type",
// "undefined-field",
// "param-type-mismatch"
],
"explorer.excludeGitIgnore": true
}
20 changes: 20 additions & 0 deletions Libs/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"Lua.diagnostics.globals": [
"LibStub",
"LibStub",
"SMARTBUFF_TITLE",
"SMARTBUFF_TITLE",
"SMARTBUFF_Options",
"SMARTBUFF_Options",
"SMARTBUFF_OToggleBuff",
"SMARTBUFF_OToggleBuff",
"SMARTDEBUFF_ToggleSF",
"SMARTDEBUFF_ToggleSF",
"SMARTBUFF_OptionsFrame_Toggle",
"SMARTBUFF_OptionsFrame_Toggle",
"SMARTBUFF_TITAN_TT",
"SMARTBUFF_TITAN_TT",
"SMARTBUFF_OToggle",
"SMARTBUFF_OToggle"
]
}
836 changes: 548 additions & 288 deletions SmartBuff.buffs.lua

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions SmartBuff.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"folders": [
{
"path": "."
},
{
"path": "Libs"
},
{
"path": "../../_WoW_API"
}
],
"settings": {
"todo-tree.tree.scanMode": "workspace only"
}
}
162 changes: 137 additions & 25 deletions SmartBuff.globals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,146 @@ SMARTBUFF_CONST_AUTOSOUND = "Deathbind Sound";
--SMARTBUFF_CONST_AUTOSOUND = "GLUECREATECHARACTERBUTTON";

--[[
SystemFont
GameFontNormal
GameFontNormalSmall
GameFontNormalLarge
GameFontHighlight
GameFontHighlightSmall
GameFontHighlightSmallOutline
GameFontHighlightLarge
GameFontDisable
GameFontDisableSmall
GameFontDisableLarge
GameFontGreen
GameFontGreenSmall
GameFontGreenLarge
GameFontRed
GameFontRedSmall
GameFontRedLarge
GameFontWhite
GameFontDarkGraySmall
NumberFontNormalYellow
NumberFontNormalSmallGray
QuestFontNormalSmall
SystemFont
GameFontNormal
GameFontNormalSmall
GameFontNormalLarge
GameFontHighlight
GameFontHighlightSmall
GameFontHighlightSmallOutline
GameFontHighlightLarge
GameFontDisable
GameFontDisableSmall
GameFontDisableLarge
GameFontGreen
GameFontGreenSmall
GameFontGreenLarge
GameFontRed
GameFontRedSmall
GameFontRedLarge
GameFontWhite
GameFontDarkGraySmall
NumberFontNormalYellow
NumberFontNormalSmallGray
QuestFontNormalSmall
DialogButtonHighlightText
ErrorFont
TextStatusBarText
CombatLogFont
ErrorFont
TextStatusBarText
CombatLogFont
NumberFontNormalLarge
NumberFontNormalHuge
]]--

----------------------------------------------------------------------------

-- Returns an unumerated table.
---## Example
---```
---Enum.Animals = Enum.MakeEnum ( "Dog", "Cat", "Rabbit" )
---print( Enum.Animals.Cat ) -- prints "Cat"
---```
---@param ... ...
---@return table
function Enum.MakeEnum(...)
return tInvert({...})
-- for i = 1, #t do
-- local v = t[i]
-- --t[i] = nil
-- t[v] = i
-- end
-- return t
end

-- Returns an unumerated table from an existing table.
---## Example
---```
---Fish = { "Loach", "Pike", "Herring" }
---Enum.Fish = Enum.MakeEnumFromTable(Fish)
---print(Enum.Fish.Herring) -- prints "Herring"
---```
function Enum.MakeEnumFromTable(t)
return tInvert(t)
end

-- Returns a table `t` of self-indexed values
-- ## Example
-- ```lua
-- t = dict( "foo", "bar")
-- print(t.foo) -- prints the string "foo"
-- ```
---@param tbl table
---@return table
function Enum.MakeDict(tbl)
local t = {};
for k, v in ipairs(tbl) do
t[v] = v;
end
return t;
end

-- Returns a copy of `list` with `keys` and `values` inverted
-- ## Example
---```
---t = { "foo" = 1, "bar" = 2};
---s = tinvert(t);
---print(t.foo); -- prints the number 1
---print(s[1]); -- prints the string "foo";
---```
---@param tbl table
---@return table out
function table.invert(tbl)
local out = {}
for k, v in pairs(tbl) do
out[v] = k
end
return out
end

local Default, Nil = {}, function () end -- for uniqueness
---@param case any
---@return any
-- Implements a `switch` statement in Lua.
-- ## Example
-- ```
-- switch(case) = {
-- [1] = function() print("one") end,
-- [2] = print,
-- [3] = math.sin,
-- default = function() print("default") end,
-- }
-- ```
function switch (case)
return setmetatable({ case }, {
__call = function (t, cases)
local item = #t == 0 and Nil or t[1]
return (cases[item] or cases[Default] or Nil)
end
})
end

-- Prints debuggin information using a formatted version of its variable
-- number of arguments following the description given in its first argument.
---
---[View documents](command:extension.lua.doc?["en-us/51/manual.html/pdf-string.format"])
---@param s any
---@param ... any
function printf(s, ...)
print(" ",addonName,"::",string.format(s, ...))
end

-- Prints debug information to `stdout`. Receives any number of arguments,
-- converting each argument to a string following the same rules of
-- [tostring](command:extension.lua.doc?["en-us/51/manual.html/pdf-tostring"]).
---
--- [View documents](command:extension.lua.doc?["en-us/51/manual.html/pdf-print"])
---
function printd(...)
print(" ",addonName,"::",...)
end

--- Prints the value of any global variable, table value, frame, function result, or any valid Lua expression. Output is color coded for easier reading. Tables display up to 30 values, the rest are skipped and a message is shown.
---@param t any
---@param startkey? any
function dump(t, startkey)
DevTools_Dump(t, startkey)
end
Loading

0 comments on commit e816413

Please sign in to comment.