Change the license to the zlib license (Formerly LGPLv3). This license is more permissive than LGPLv3.
59 |
Increase compression speed by up to 25% on high compression level on non-JIT lua interpreter.
60 |
Bump the World of Warcraft toc version to 80300
61 |
62 |
63 |
v1.0.1-release
64 |
65 |
66 |
2019/11/18
67 |
No functional change
68 |
Bump the World of Warcraft toc version to 80205
69 |
No longer "Load on Demand" in Warcraft toc, because this library does not consume much memory. This makes easier to load and test this library.
70 |
Change the license to LGPLv3 (Formerly GPLv3)
71 |
72 |
73 |
v1.0.0-release
74 |
75 |
76 |
2018/7/30
77 |
Documentation updates.
78 |
79 |
80 |
v0.9.0-beta4
81 |
82 |
83 |
2018/5/25
84 |
"DecodeForPrint" always remove prefixed or trailing control or space characters before decoding. This makes this API easier to use.
85 |
86 |
87 |
v0.9.0-beta3
88 |
89 |
90 |
2018/5/23
91 |
Fix an issue in "DecodeForPrint" that certain undecodable string
92 | could cause an Lua error.
93 |
Add an parameter to "DecodeForPrint". If set, remove trailing spaces in the
94 | input string before decode it.
95 |
Add input type checks for all encode/decode functions.
96 |
97 |
98 |
v0.9.0-beta2
99 |
100 |
101 |
2018/5/22
102 |
API "Encode6Bit" is renamed to "EncodeForPrint"
103 |
API "Decode6Bit" is renamed to "DecodeForPrint"
104 |
105 |
106 |
v0.9.0-beta1
107 |
108 |
109 |
2018/5/22
110 |
No change
111 |
112 |
113 |
v0.9.0-alpha2
114 |
115 |
116 |
2018/5/21
117 |
Remove API LibDeflate:VerifyDictionary
118 |
Remove API LibDeflate:DictForWoW
119 |
Changed API LibDeflate:CreateDictionary
120 |
121 |
122 |
v0.9.0-alpha1
123 |
124 |
125 |
2018/5/20
126 |
The first working version.
127 |
128 |
129 |
130 |
131 |
132 |
133 | generated by LDoc 1.4.6
134 | Last updated 2020-06-26 22:05:55
135 |
136 |
137 |
138 |
139 |
--------------------------------------------------------------------------------
/Libs/LibDeflate/examples/example.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | This program is free software: you can redistribute it and/or modify
3 | it under the terms of the GNU Lesser General Public License as published by
4 | the Free Software Foundation, either version 3 of the License, or
5 | any later version.
6 |
7 | This program is distributed in the hope that it will be useful,
8 | but WITHOUT ANY WARRANTY; without even the implied warranty of
9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 | GNU Lesser General Public License for more details.
11 |
12 | You should have received a copy of the GNU Lesser General Public License
13 | along with this program. If not, see https://www.gnu.org/licenses/.
14 | --]]
15 |
16 | --- LibDeflate usage example
17 | -- @author Haoqian He
18 | -- @file example.lua
19 |
20 | local LibDeflate
21 |
22 | if LibStub then -- You are using LibDeflate as WoW addon
23 | LibDeflate = LibStub:GetLibrary("LibDeflate")
24 | else
25 | -- You are using LibDeflate as Lua library.
26 | -- Setup the path to locate LibDeflate.lua,
27 | -- if 'require("LibDeflate")' fails, for example:
28 | -- package.path = ("?.lua;../?.lua;")..(package.path or "")
29 | LibDeflate = require("LibDeflate")
30 | end
31 |
32 | local example_input = "12123123412345123456123456712345678123456789"
33 |
34 | -- Compress using raw deflate format
35 | local compress_deflate = LibDeflate:CompressDeflate(example_input)
36 |
37 | -- decompress
38 | local decompress_deflate = LibDeflate:DecompressDeflate(compress_deflate)
39 | -- Check if the first return value of DecompressXXXX is non-nil to know if the
40 | -- decompression succeeds.
41 | if decompress_deflate == nil then
42 | error("Decompression fails.")
43 | else
44 | -- Decompression succeeds.
45 | assert(example_input == decompress_deflate)
46 | end
47 |
48 |
49 | -- If it is to transmit through WoW addon channel,
50 | -- compressed data must be encoded so NULL ("\000") is not transmitted.
51 | local data_to_trasmit_WoW_addon = LibDeflate:EncodeForWoWAddonChannel(
52 | compress_deflate)
53 | -- When the receiver gets the data, decoded it first.
54 | local data_decoded_WoW_addon = LibDeflate:DecodeForWoWAddonChannel(
55 | data_to_trasmit_WoW_addon)
56 | -- Then decomrpess it
57 | assert(LibDeflate:DecompressDeflate(data_decoded_WoW_addon) == example_input)
58 |
59 | -- The compressed output is not printable. EncodeForPrint will convert to
60 | -- a printable format, in case you want to export to the user to
61 | -- copy and paste. This encoding will make the data 25% bigger.
62 | local printable_compressed = LibDeflate:EncodeForPrint(compress_deflate)
63 |
64 | -- DecodeForPrint to convert back.
65 | -- DecodeForPrint will remove prefixed and trailing control or space characters
66 | -- in the string before decode it.
67 | assert(LibDeflate:DecodeForPrint(printable_compressed) == compress_deflate)
68 |
69 |
70 | -------------------------------------------------------------------------------
71 | -------------------------------------------------------------------------------
72 | -------------------------------------------------------------------------------
73 |
74 | --- Compress and decompress using zlib format
75 | local compress_zlib = LibDeflate:CompressZlib(example_input)
76 | local decompress_zlib = LibDeflate:DecompressZlib(compress_zlib)
77 | assert(decompress_zlib == example_input)
78 |
79 | --- Control the compression level
80 | -- NOTE: High compression level does not make a difference here,
81 | -- because the input data is very small
82 | local compress_deflate_with_level = LibDeflate:CompressDeflate(example_input
83 | , {level = 9})
84 | local decompress_deflate_with_level = LibDeflate:DecompressDeflate(
85 | compress_deflate_with_level)
86 | assert(decompress_deflate_with_level == example_input)
87 |
88 |
89 | -- Compress with a preset dictionary
90 | local dict_str = "121231234" -- example preset dictionary string.
91 | -- print(LibDeflate:Adler32(dict_str), #dict_str)
92 | -- 9 147325380
93 | -- hardcode the print result above, the ensure it is not modified
94 | -- accidenttaly during the program development.
95 | --
96 | -- WARNING: The compressor and decompressor must use the same dictionary.
97 | -- You should be aware of this when tranmitting compressed data over the
98 | -- internet.
99 | local dict = LibDeflate:CreateDictionary(dict_str, 9, 147325380)
100 |
101 | -- Using the dictionary with raw deflate format
102 | local compress_deflate_with_dict = LibDeflate:CompressDeflateWithDict(
103 | example_input, dict)
104 | assert(#compress_deflate_with_dict < #compress_deflate)
105 | local decompress_deflate_with_dict = LibDeflate:DecompressDeflateWithDict(
106 | compress_deflate_with_dict, dict)
107 | assert(decompress_deflate_with_dict == example_input)
108 |
109 | -- Using the dictionary with zlib format, specifying compression level
110 | local compress_zlib_with_dict = LibDeflate:CompressZlibWithDict(
111 | example_input, dict, {level = 9})
112 | assert(#compress_zlib_with_dict < #compress_zlib)
113 | local decompress_zlib_with_dict = LibDeflate:DecompressZlibWithDict(
114 | compress_zlib_with_dict, dict)
115 | assert(decompress_zlib_with_dict == example_input)
116 |
--------------------------------------------------------------------------------
/Libs/LibDeflate/lib.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Libs/LibDeflate/libdeflate-1.0.2-1.rockspec:
--------------------------------------------------------------------------------
1 | package = "LibDeflate"
2 | version = "1.0.2-1"
3 | source = {
4 | url = "git+https://github.com/safeteeWow/LibDeflate.git",
5 | tag = "1.0.2-release",
6 | }
7 | description = {
8 | detailed = [[Pure Lua compressor and decompressor with high compression ratio using DEFLATE/zlib format.]],
9 | homepage = "https://github.com/safeteeWow/LibDeflate",
10 | license = "zlib",
11 | }
12 | dependencies = {
13 | "lua >= 5.1, < 5.5"
14 | }
15 | build = {
16 | type = "builtin",
17 | modules = {
18 | LibDeflate = "LibDeflate.lua",
19 | },
20 | copy_directories = {
21 | "docs",
22 | "examples",
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Libs/LibDualSpec-1.0/CHANGES.txt:
--------------------------------------------------------------------------------
1 | tag a5b4ce7dbb705cc1351553b1269c848bf58ef4a2 v1.22.1
2 | Author: Kyle Buller
3 | Date: Sun May 7 19:05:52 2023 -0500
4 |
5 | Tagging as v1.22.1
6 |
7 | commit 375df2c52cae7773f5c708857c2bcc06d8510e29
8 | Author: Kyle Buller
9 | Date: Sun May 7 19:05:18 2023 -0500
10 |
11 | Update TOC for 10.1 and 3.4.1
12 |
13 |
--------------------------------------------------------------------------------
/Libs/LibDualSpec-1.0/LibDualSpec-1.0.toc:
--------------------------------------------------------------------------------
1 | ## Interface: 100100
2 | ## LoadOnDemand: 1
3 | ## Title: Lib: DualSpec-1.0
4 | ## Version: v1.22.1
5 | ## X-Date: 2023-05-08T0:05:18Z
6 | ## Notes: Adds spec switching support to individual AceDB-3.0 databases.
7 | ## Author: Adirelle, Nebula
8 | ## OptionalDeps: Ace3
9 |
10 | LibStub.lua
11 | LibDualSpec-1.0.lua
12 |
--------------------------------------------------------------------------------
/Libs/LibDualSpec-1.0/LibDualSpec-1.0_Wrath.toc:
--------------------------------------------------------------------------------
1 | ## Interface: 30401
2 | ## LoadOnDemand: 1
3 | ## Title: Lib: DualSpec-1.0
4 | ## Version: v1.22.1
5 | ## X-Date: 2023-05-08T0:05:18Z
6 | ## Notes: Adds spec switching support to individual AceDB-3.0 databases.
7 | ## Author: Adirelle, Nebula
8 | ## OptionalDeps: Ace3
9 |
10 | LibStub.lua
11 | LibDualSpec-1.0.lua
12 |
--------------------------------------------------------------------------------
/Libs/LibDualSpec-1.0/LibStub.lua:
--------------------------------------------------------------------------------
1 | -- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
2 | -- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
3 | local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
4 | local LibStub = _G[LIBSTUB_MAJOR]
5 |
6 | if not LibStub or LibStub.minor < LIBSTUB_MINOR then
7 | LibStub = LibStub or {libs = {}, minors = {} }
8 | _G[LIBSTUB_MAJOR] = LibStub
9 | LibStub.minor = LIBSTUB_MINOR
10 |
11 | function LibStub:NewLibrary(major, minor)
12 | assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
13 | minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
14 |
15 | local oldminor = self.minors[major]
16 | if oldminor and oldminor >= minor then return nil end
17 | self.minors[major], self.libs[major] = minor, self.libs[major] or {}
18 | return self.libs[major], oldminor
19 | end
20 |
21 | function LibStub:GetLibrary(major, silent)
22 | if not self.libs[major] and not silent then
23 | error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
24 | end
25 | return self.libs[major], self.minors[major]
26 | end
27 |
28 | function LibStub:IterateLibraries() return pairs(self.libs) end
29 | setmetatable(LibStub, { __call = LibStub.GetLibrary })
30 | end
31 |
--------------------------------------------------------------------------------
/Libs/LibStub/LibStub.lua:
--------------------------------------------------------------------------------
1 | -- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
2 | -- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
3 | local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
4 | local LibStub = _G[LIBSTUB_MAJOR]
5 |
6 | if not LibStub or LibStub.minor < LIBSTUB_MINOR then
7 | LibStub = LibStub or {libs = {}, minors = {} }
8 | _G[LIBSTUB_MAJOR] = LibStub
9 | LibStub.minor = LIBSTUB_MINOR
10 |
11 | function LibStub:NewLibrary(major, minor)
12 | assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
13 | minor = assert(tonumber(string.match(minor, "%d+")), "Minor version must either be a number or contain a number.")
14 |
15 | local oldminor = self.minors[major]
16 | if oldminor and oldminor >= minor then return nil end
17 | self.minors[major], self.libs[major] = minor, self.libs[major] or {}
18 | return self.libs[major], oldminor
19 | end
20 |
21 | function LibStub:GetLibrary(major, silent)
22 | if not self.libs[major] and not silent then
23 | error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
24 | end
25 | return self.libs[major], self.minors[major]
26 | end
27 |
28 | function LibStub:IterateLibraries() return pairs(self.libs) end
29 | setmetatable(LibStub, { __call = LibStub.GetLibrary })
30 | end
31 |
--------------------------------------------------------------------------------
/Libs/embeds.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Libs/libdatabroker-1.1/Changelog-libdatabroker-1-1-v1.1.4.txt:
--------------------------------------------------------------------------------
1 | tag v1.1.4
2 | ddb0519a000c69ddf3a28c3f9fe2e62bb3fd00c5
3 | Tekkub
4 | 2008-11-06 22:03:04 -0700
5 |
6 | Build 1.1.4
7 |
8 |
9 | --------------------
10 |
11 | Tekkub:
12 | Add pairs and ipairs iters, since we can't use the normal iters on our dataobjs
13 | Simplify readme, all docs have been moved into GitHub wiki pages
14 | Documentation on how to use LDB data (for display addons)
15 | Add StatBlockCore forum link
16 | Add link to Fortress thread
17 | And rearrange the addon list a bit too
18 | Make field lists into nice pretty tables
19 | Add list of who is using LDB
20 | Always with the typos, I hate my fingers
21 | Add tooltiptext and OnTooltipShow to data addon spec
22 | Readme rejiggering
23 | Add in some documentation on how to push data into LDB
24 | Meh, fuck you textile
25 | Adding readme
26 | Pass current dataobj with attr change callbacks to avoid excessive calls to :GetDataObjectByName
27 | Tekkub Stoutwrithe:
28 | Make passed dataobj actually work
29 | I always forget the 'then'
30 | Minor memory optimization
31 | - Only hold upvalues to locals in the functions called frequently
32 | - Retain the metatable across future lib upgrades (the one in v1 will be lost)
33 | Allow caller to pass a pre-populated table to NewDataObject
34 |
--------------------------------------------------------------------------------
/Libs/libdatabroker-1.1/LibDataBroker-1.1.lua:
--------------------------------------------------------------------------------
1 |
2 | assert(LibStub, "LibDataBroker-1.1 requires LibStub")
3 | assert(LibStub:GetLibrary("CallbackHandler-1.0", true), "LibDataBroker-1.1 requires CallbackHandler-1.0")
4 |
5 | local lib, oldminor = LibStub:NewLibrary("LibDataBroker-1.1", 4)
6 | if not lib then return end
7 | oldminor = oldminor or 0
8 |
9 |
10 | lib.callbacks = lib.callbacks or LibStub:GetLibrary("CallbackHandler-1.0"):New(lib)
11 | lib.attributestorage, lib.namestorage, lib.proxystorage = lib.attributestorage or {}, lib.namestorage or {}, lib.proxystorage or {}
12 | local attributestorage, namestorage, callbacks = lib.attributestorage, lib.namestorage, lib.callbacks
13 |
14 | if oldminor < 2 then
15 | lib.domt = {
16 | __metatable = "access denied",
17 | __index = function(self, key) return attributestorage[self] and attributestorage[self][key] end,
18 | }
19 | end
20 |
21 | if oldminor < 3 then
22 | lib.domt.__newindex = function(self, key, value)
23 | if not attributestorage[self] then attributestorage[self] = {} end
24 | if attributestorage[self][key] == value then return end
25 | attributestorage[self][key] = value
26 | local name = namestorage[self]
27 | if not name then return end
28 | callbacks:Fire("LibDataBroker_AttributeChanged", name, key, value, self)
29 | callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value, self)
30 | callbacks:Fire("LibDataBroker_AttributeChanged_"..name.."_"..key, name, key, value, self)
31 | callbacks:Fire("LibDataBroker_AttributeChanged__"..key, name, key, value, self)
32 | end
33 | end
34 |
35 | if oldminor < 2 then
36 | function lib:NewDataObject(name, dataobj)
37 | if self.proxystorage[name] then return end
38 |
39 | if dataobj then
40 | assert(type(dataobj) == "table", "Invalid dataobj, must be nil or a table")
41 | self.attributestorage[dataobj] = {}
42 | for i,v in pairs(dataobj) do
43 | self.attributestorage[dataobj][i] = v
44 | dataobj[i] = nil
45 | end
46 | end
47 | dataobj = setmetatable(dataobj or {}, self.domt)
48 | self.proxystorage[name], self.namestorage[dataobj] = dataobj, name
49 | self.callbacks:Fire("LibDataBroker_DataObjectCreated", name, dataobj)
50 | return dataobj
51 | end
52 | end
53 |
54 | if oldminor < 1 then
55 | function lib:DataObjectIterator()
56 | return pairs(self.proxystorage)
57 | end
58 |
59 | function lib:GetDataObjectByName(dataobjectname)
60 | return self.proxystorage[dataobjectname]
61 | end
62 |
63 | function lib:GetNameByDataObject(dataobject)
64 | return self.namestorage[dataobject]
65 | end
66 | end
67 |
68 | if oldminor < 4 then
69 | local next = pairs(attributestorage)
70 | function lib:pairs(dataobject_or_name)
71 | local t = type(dataobject_or_name)
72 | assert(t == "string" or t == "table", "Usage: ldb:pairs('dataobjectname') or ldb:pairs(dataobject)")
73 |
74 | local dataobj = self.proxystorage[dataobject_or_name] or dataobject_or_name
75 | assert(attributestorage[dataobj], "Data object not found")
76 |
77 | return next, attributestorage[dataobj], nil
78 | end
79 |
80 | local ipairs_iter = ipairs(attributestorage)
81 | function lib:ipairs(dataobject_or_name)
82 | local t = type(dataobject_or_name)
83 | assert(t == "string" or t == "table", "Usage: ldb:ipairs('dataobjectname') or ldb:ipairs(dataobject)")
84 |
85 | local dataobj = self.proxystorage[dataobject_or_name] or dataobject_or_name
86 | assert(attributestorage[dataobj], "Data object not found")
87 |
88 | return ipairs_iter, attributestorage[dataobj], 0
89 | end
90 | end
91 |
--------------------------------------------------------------------------------
/Libs/libdatabroker-1.1/README.textile:
--------------------------------------------------------------------------------
1 | LibDataBroker is a small WoW addon library designed to provide a "MVC":http://en.wikipedia.org/wiki/Model-view-controller interface for use in various addons.
2 | LDB's primary goal is to "detach" plugins for TitanPanel and FuBar from the display addon.
3 | Plugins can provide data into a simple table, and display addons can receive callbacks to refresh their display of this data.
4 | LDB also provides a place for addons to register "quicklaunch" functions, removing the need for authors to embed many large libraries to create minimap buttons.
5 | Users who do not wish to be "plagued" by these buttons simply do not install an addon to render them.
6 |
7 | Due to it's simple generic design, LDB can be used for any design where you wish to have an addon notified of changes to a table.
8 |
9 | h2. Links
10 |
11 | * "API documentation":http://github.com/tekkub/libdatabroker-1-1/wikis/api
12 | * "Data specifications":http://github.com/tekkub/libdatabroker-1-1/wikis/data-specifications
13 | * "Addons using LDB":http://github.com/tekkub/libdatabroker-1-1/wikis/addons-using-ldb
14 |
--------------------------------------------------------------------------------
/Localizations/Neuron_Localizations.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Localizations/Neuron_X-deDE.lua:
--------------------------------------------------------------------------------
1 | -- Neuron is a World of Warcraft® user interface addon.
2 | -- Copyright (c) 2017-2023 Britt W. Yazel
3 | -- Copyright (c) 2006-2014 Connor H. Chenoweth
4 | -- This code is licensed under the MIT license (see LICENSE for details)
5 |
6 | local L = LibStub("AceLocale-3.0"):NewLocale("Neuron", "deDE", false)
7 |
8 | if not L then return end
9 |
10 | --@localization(locale="deDE", format="lua_additive_table")@
11 |
12 | --@do-not-package@
13 | ---exported translations go here:
14 |
15 | --@end-do-not-package@
--------------------------------------------------------------------------------
/Localizations/Neuron_X-esES.lua:
--------------------------------------------------------------------------------
1 | -- Neuron is a World of Warcraft® user interface addon.
2 | -- Copyright (c) 2017-2023 Britt W. Yazel
3 | -- Copyright (c) 2006-2014 Connor H. Chenoweth
4 | -- This code is licensed under the MIT license (see LICENSE for details)
5 |
6 | local L = LibStub("AceLocale-3.0"):NewLocale("Neuron", "esES", false)
7 |
8 | if not L then return end
9 |
10 | --@localization(locale="esES", format="lua_additive_table")@
11 |
12 | --@do-not-package@
13 | ---exported translations go here:
14 |
15 | --@end-do-not-package@
--------------------------------------------------------------------------------
/Localizations/Neuron_X-esMX.lua:
--------------------------------------------------------------------------------
1 | -- Neuron is a World of Warcraft® user interface addon.
2 | -- Copyright (c) 2017-2023 Britt W. Yazel
3 | -- Copyright (c) 2006-2014 Connor H. Chenoweth
4 | -- This code is licensed under the MIT license (see LICENSE for details)
5 |
6 | local L = LibStub("AceLocale-3.0"):NewLocale("Neuron", "esMX", false)
7 |
8 | if not L then return end
9 |
10 | --@localization(locale="esMX", format="lua_additive_table")@
11 |
12 | --@do-not-package@
13 | ---exported translations go here:
14 |
15 | --@end-do-not-package@
--------------------------------------------------------------------------------
/Localizations/Neuron_X-frFR.lua:
--------------------------------------------------------------------------------
1 | -- Neuron is a World of Warcraft® user interface addon.
2 | -- Copyright (c) 2017-2023 Britt W. Yazel
3 | -- Copyright (c) 2006-2014 Connor H. Chenoweth
4 | -- This code is licensed under the MIT license (see LICENSE for details)
5 |
6 | local L = LibStub("AceLocale-3.0"):NewLocale("Neuron", "frFR", false)
7 |
8 | if not L then return end
9 |
10 | --@localization(locale="frFR", format="lua_additive_table")@
11 |
12 | --@do-not-package@
13 | ---exported translations go here:
14 |
15 | --@end-do-not-package@
--------------------------------------------------------------------------------
/Localizations/Neuron_X-itIT.lua:
--------------------------------------------------------------------------------
1 | -- Neuron is a World of Warcraft® user interface addon.
2 | -- Copyright (c) 2017-2023 Britt W. Yazel
3 | -- Copyright (c) 2006-2014 Connor H. Chenoweth
4 | -- This code is licensed under the MIT license (see LICENSE for details)
5 |
6 | local L = LibStub("AceLocale-3.0"):NewLocale("Neuron", "itIT", false)
7 |
8 | if not L then return end
9 |
10 | --@localization(locale="itIT", format="lua_additive_table")@
11 |
12 | --@do-not-package@
13 | ---exported translations go here:
14 |
15 | --@end-do-not-package@
--------------------------------------------------------------------------------
/Localizations/Neuron_X-koKR.lua:
--------------------------------------------------------------------------------
1 | -- Neuron is a World of Warcraft® user interface addon.
2 | -- Copyright (c) 2017-2023 Britt W. Yazel
3 | -- Copyright (c) 2006-2014 Connor H. Chenoweth
4 | -- This code is licensed under the MIT license (see LICENSE for details)
5 |
6 | local L = LibStub("AceLocale-3.0"):NewLocale("Neuron", "koKR", false)
7 |
8 | if not L then return end
9 |
10 | --@localization(locale="koKR", format="lua_additive_table")@
11 |
12 | --@do-not-package@
13 | ---exported translations go here:
14 |
15 | --@end-do-not-package@
--------------------------------------------------------------------------------
/Localizations/Neuron_X-ptBR.lua:
--------------------------------------------------------------------------------
1 | -- Neuron is a World of Warcraft® user interface addon.
2 | -- Copyright (c) 2017-2023 Britt W. Yazel
3 | -- Copyright (c) 2006-2014 Connor H. Chenoweth
4 | -- This code is licensed under the MIT license (see LICENSE for details)
5 |
6 | local L = LibStub("AceLocale-3.0"):NewLocale("Neuron", "ptBR", false)
7 |
8 | if not L then return end
9 |
10 | --@localization(locale="ptBR", format="lua_additive_table")@
11 |
12 | --@do-not-package@
13 | ---exported translations go here:
14 |
15 | --@end-do-not-package@
--------------------------------------------------------------------------------
/Localizations/Neuron_X-ruRU.lua:
--------------------------------------------------------------------------------
1 | -- Neuron is a World of Warcraft® user interface addon.
2 | -- Copyright (c) 2017-2023 Britt W. Yazel
3 | -- Copyright (c) 2006-2014 Connor H. Chenoweth
4 | -- This code is licensed under the MIT license (see LICENSE for details)
5 |
6 | local L = LibStub("AceLocale-3.0"):NewLocale("Neuron", "ruRU", false)
7 |
8 | if not L then return end
9 |
10 | --@localization(locale="ruRU", format="lua_additive_table")@
11 |
12 | --@do-not-package@
13 | ---exported translations go here:
14 |
15 | --@end-do-not-package@
16 |
--------------------------------------------------------------------------------
/Localizations/Neuron_X-zhCN.lua:
--------------------------------------------------------------------------------
1 | -- Neuron is a World of Warcraft® user interface addon.
2 | -- Copyright (c) 2017-2023 Britt W. Yazel
3 | -- Copyright (c) 2006-2014 Connor H. Chenoweth
4 | -- This code is licensed under the MIT license (see LICENSE for details)
5 |
6 | local L = LibStub("AceLocale-3.0"):NewLocale("Neuron", "zhCN", false)
7 |
8 | if not L then return end
9 |
10 | --@localization(locale="zhCN", format="lua_additive_table")@
11 |
12 | --@do-not-package@
13 | ---exported translations go here:
14 |
15 | --@end-do-not-package@
--------------------------------------------------------------------------------
/Localizations/Neuron_X-zhTW.lua:
--------------------------------------------------------------------------------
1 | -- Neuron is a World of Warcraft® user interface addon.
2 | -- Copyright (c) 2017-2023 Britt W. Yazel
3 | -- Copyright (c) 2006-2014 Connor H. Chenoweth
4 | -- This code is licensed under the MIT license (see LICENSE for details)
5 |
6 | local L = LibStub("AceLocale-3.0"):NewLocale("Neuron", "zhTW", false)
7 |
8 | if not L then return end
9 |
10 | --@localization(locale="zhTW", format="lua_additive_table")@
11 |
12 | --@do-not-package@
13 | ---exported translations go here:
14 |
15 | --@end-do-not-package@
--------------------------------------------------------------------------------
/Neuron-MinimapIcon.lua:
--------------------------------------------------------------------------------
1 | -- Neuron is a World of Warcraft® user interface addon.
2 | -- Copyright (c) 2017-2023 Britt W. Yazel
3 | -- Copyright (c) 2006-2014 Connor H. Chenoweth
4 | -- This code is licensed under the MIT license (see LICENSE for details)
5 |
6 | local _, addonTable = ...
7 | local Neuron = addonTable.Neuron
8 |
9 | --Neuron MinimapIcon makes use of LibDBIcon and LibDataBroker to make sure we play
10 | --nicely with LDB addons and to simplify dramatically the minimap button
11 |
12 | local L = LibStub("AceLocale-3.0"):GetLocale("Neuron")
13 |
14 | local DB
15 | local neuronIconLDB
16 | local icon
17 |
18 | -------------------------------------------------------------------------
19 | -------------------------------------------------------------------------
20 | function Neuron:Minimap_IconInitialize()
21 | DB = Neuron.db.profile
22 |
23 | --show new compartment icon even when minimap icon is disabled
24 | DB.NeuronIcon.showInCompartment = true
25 |
26 | neuronIconLDB = LibStub("LibDataBroker-1.1"):NewDataObject("Neuron", {
27 | type = "launcher",
28 | text = "Neuron",
29 | icon = "Interface\\AddOns\\Neuron\\Images\\static_icon",
30 | OnClick = function(_, button) Neuron:Minimap_OnClickHandler(button) end,
31 | OnTooltipShow = function(tooltip) Neuron:Minimap_TooltipHandler(tooltip) end,
32 | })
33 |
34 | icon = LibStub("LibDBIcon-1.0")
35 | icon:Register("Neuron", neuronIconLDB, DB.NeuronIcon)
36 | end
37 |
38 | -------------------------------------------------------------------------------
39 | -------------------------------------------------------------------------------
40 |
41 | function Neuron:Minimap_OnClickHandler(button)
42 | if InCombatLockdown() then
43 | return
44 | end
45 |
46 | PlaySound(SOUNDKIT.IG_CHAT_SCROLL_DOWN)
47 |
48 | if button == "LeftButton" then
49 | if IsShiftKeyDown() then
50 | if not Neuron.bindingMode then
51 | Neuron:ToggleBindingMode(true)
52 | else
53 | Neuron:ToggleBindingMode(false)
54 | end
55 | else
56 | if not Neuron.barEditMode then
57 | Neuron:ToggleBarEditMode(true)
58 | if not addonTable.NeuronEditor then
59 | Neuron.NeuronGUI:CreateEditor("bar")
60 | else
61 | Neuron.NeuronGUI:RefreshEditor("bar")
62 | end
63 | else
64 | Neuron:ToggleBarEditMode(false)
65 | if addonTable.NeuronEditor then
66 | Neuron.NeuronGUI:DestroyEditor()
67 | end
68 | end
69 | end
70 | elseif button == "RightButton" then
71 | if IsShiftKeyDown() then
72 | if SettingsPanel and SettingsPanel:IsShown() then
73 | SettingsPanel:Hide()
74 | elseif InterfaceOptionsFrame and InterfaceOptionsFrame:IsShown() then --this is for pre-dragonflight compatibility
75 | InterfaceOptionsFrame:Hide();
76 | else
77 | Neuron:ToggleMainMenu()
78 | end
79 | else
80 | if not Neuron.buttonEditMode then
81 | Neuron:ToggleButtonEditMode(true)
82 | if not addonTable.NeuronEditor then
83 | Neuron.NeuronGUI:CreateEditor("button")
84 | else
85 | Neuron.NeuronGUI:RefreshEditor("button")
86 | end
87 | else
88 | Neuron:ToggleButtonEditMode(false)
89 | if addonTable.NeuronEditor then
90 | Neuron.NeuronGUI:DestroyEditor()
91 | end
92 | end
93 | end
94 | end
95 | end
96 |
97 | function Neuron:Minimap_TooltipHandler(tooltip)
98 | tooltip:SetText("Neuron", 1, 1, 1)
99 | --the formatting for the following strings is such that the key combo is in yellow, and the description is in white. This helps it be more readable at a glance
100 | --another route would be to use AddDoubleLine, to have a left justified string and a right justified string on the same line
101 | tooltip:AddLine(L["Left-Click"] .. ": " .. "|cFFFFFFFF"..L["Configure Bars"])
102 | tooltip:AddLine(L["Right-Click"] .. ": " .. "|cFFFFFFFF"..L["Configure Buttons"])
103 | tooltip:AddLine(L["Shift"] .. " + " .. L["Left-Click"] .. ": " .. "|cFFFFFFFF"..L["Toggle Keybind Mode"])
104 | tooltip:AddLine(L["Shift"] .. " + " .. L["Right-Click"] .. ": " .. "|cFFFFFFFF"..L["Open the Interface Menu"])
105 |
106 | tooltip:Show()
107 | end
108 |
109 | function Neuron:Minimap_ToggleIcon()
110 | if DB.NeuronIcon.hide == false then
111 | icon:Hide("Neuron")
112 | DB.NeuronIcon.hide = true
113 | elseif DB.NeuronIcon.hide == true then
114 | icon:Show("Neuron")
115 | DB.NeuronIcon.hide = false
116 | end
117 | end
--------------------------------------------------------------------------------
/Neuron-RegisteredBarData.lua:
--------------------------------------------------------------------------------
1 | -- Neuron is a World of Warcraft® user interface addon.
2 | -- Copyright (c) 2017-2023 Britt W. Yazel
3 | -- Copyright (c) 2006-2014 Connor H. Chenoweth
4 | -- This code is licensed under the MIT license (see LICENSE for details)
5 |
6 | local _, addonTable = ...
7 | local Neuron = addonTable.Neuron
8 |
9 | local L = LibStub("AceLocale-3.0"):GetLocale("Neuron")
10 |
11 | function Neuron:RegisterBars(DB)
12 | local allBars = {
13 | ActionBar = {
14 | class = "ActionBar",
15 | barType = "ActionBar",
16 | barLabel = L["Action Bar"],
17 | objType = "ActionButton",
18 | barDB = DB.ActionBar,
19 | objTemplate = Neuron.ActionButton,
20 | objMax = 250
21 | },
22 | --[[BagBar = {
23 | class = "BagBar",
24 | barType = "BagBar",
25 | barLabel = L["Bag Bar"],
26 | objType = "BagButton",
27 | barDB = DB.BagBar,
28 | objTemplate = Neuron.BagButton,
29 | objMax = Neuron.NUM_BAG_BUTTONS
30 | },]]
31 | --[[MenuBar = {
32 | class = "MenuBar",
33 | barType = "MenuBar",
34 | barLabel = L["Menu Bar"],
35 | objType = "MenuButton",
36 | barDB = DB.MenuBar,
37 | objTemplate = Neuron.MenuButton,
38 | objMax = 11
39 | },]]
40 | PetBar = {
41 | class = "PetBar",
42 | barType = "PetBar",
43 | barLabel = L["Pet Bar"],
44 | objType = "PetButton",
45 | barDB = DB.PetBar,
46 | objTemplate = Neuron.PetButton,
47 | objMax = 10
48 | },
49 | XPBar = {
50 | class = "XPBar",
51 | barType = "XPBar",
52 | barLabel = L["XP Bar"],
53 | objType = "ExpButton",
54 | barDB = DB.XPBar,
55 | objTemplate = Neuron.ExpButton,
56 | objMax = 10
57 | },
58 | RepBar = {
59 | class = "RepBar",
60 | barType = "RepBar",
61 | barLabel = L["Rep Bar"],
62 | objType = "RepButton",
63 | barDB = DB.RepBar,
64 | objTemplate = Neuron.RepButton,
65 | objMax = 10
66 | },
67 | CastBar = {
68 | class = "CastBar",
69 | barType = "CastBar",
70 | barLabel = L["Cast Bar"],
71 | objType = "CastButton",
72 | barDB = DB.CastBar,
73 | objTemplate = Neuron.CastButton,
74 | objMax = 10
75 | },
76 | MirrorBar = {
77 | class = "MirrorBar",
78 | barType = "MirrorBar",
79 | barLabel = L["Mirror Bar"],
80 | objType = "MirrorButton",
81 | barDB = DB.MirrorBar,
82 | objTemplate = Neuron.MirrorButton,
83 | objMax = 10
84 | },
85 | }
86 |
87 | if Neuron.isWoWRetail then
88 | MergeTable(allBars, {
89 | ZoneAbilityBar = {
90 | class = "ZoneAbilityBar",
91 | barType = "ZoneAbilityBar",
92 | barLabel = L["Zone Action Bar"],
93 | objType = "ZoneActionButton",
94 | barDB = DB.ZoneAbilityBar,
95 | objTemplate = Neuron.ZoneAbilityButton,
96 | objMax = 5, true
97 | },
98 | ExtraBar = {
99 | class = "ExtraBar",
100 | barType = "ExtraBar",
101 | barLabel = L["Extra Action Bar"],
102 | objType = "ExtraActionButton",
103 | barDB = DB.ExtraBar,
104 | objTemplate = Neuron.ExtraButton,
105 | objMax = 1
106 | },
107 | ExitBar = {
108 | class = "ExitBar",
109 | barType = "ExitBar",
110 | barLabel = L["Vehicle Exit Bar"],
111 | objType = "VehicleExitButton",
112 | barDB = DB.ExitBar,
113 | objTemplate = Neuron.ExitButton,
114 | objMax = 1
115 | },
116 | })
117 | end
118 |
119 | return allBars
120 | end
121 |
--------------------------------------------------------------------------------
/Neuron-Startup.lua:
--------------------------------------------------------------------------------
1 | -- Neuron is a World of Warcraft® user interface addon.
2 | -- Copyright (c) 2017-2023 Britt W. Yazel
3 | -- Copyright (c) 2006-2014 Connor H. Chenoweth
4 | -- This code is licensed under the MIT license (see LICENSE for details)
5 |
6 | local _, addonTable = ...
7 | local Neuron = addonTable.Neuron
8 |
9 | local L = LibStub("AceLocale-3.0"):GetLocale("Neuron")
10 | local Array = addonTable.utilities.Array
11 |
12 | -- this function takes a partial bar config and fills out the missing fields
13 | -- from the database default skeleton to create a complete bar database entry
14 | local function initializeBar(barClass)
15 | return function (bar)
16 | -- MergeTable modifies in place, so copy the default first
17 | local newBar = CopyTable(addonTable.databaseDefaults.profile[barClass]['*'])
18 |
19 | -- use the skeleton button from the default database to generate buttons
20 | local newButtons = Array.map(
21 | function(button)
22 | local newButton = CopyTable(newBar.buttons['*'])
23 | local newConfig = CopyTable(newButton.config)
24 |
25 | MergeTable(newConfig, button.config or {})
26 | MergeTable(newButton, button)
27 | MergeTable(newButton, {config = newConfig})
28 | return newButton
29 | end,
30 | bar.buttons
31 | )
32 |
33 | -- merge the bar config and then the buttons into the skeleton
34 | MergeTable(newBar, bar)
35 | MergeTable(newBar, {buttons=newButtons})
36 | return newBar
37 | end
38 | end
39 |
40 | --- this function has no business existing
41 | --- database defaults should be in the database
42 | --- but we have them scattered between neuron-defaults and neuron-db-defaults
43 | function Neuron:InitializeEmptyDatabase(DB)
44 | DB.firstRun = false
45 |
46 | --initialize default bars using the skeleton data in defaultProfile
47 | --and pulling from registeredBarData so we create the correct bars for classic/retail
48 | for barClass, registeredData in pairs(Neuron.registeredBarData) do
49 | local newBars = Array.map(
50 | initializeBar(barClass),
51 | addonTable.defaultProfile[barClass]
52 | )
53 | MergeTable(registeredData.barDB, newBars)
54 | end
55 | end
56 |
57 | function Neuron:CreateBarsAndButtons(profileData)
58 | -- remove blizzard controlled bars from the list of bars we will create
59 | -- but still keep neuron action bars regardless
60 | local neuronBars =
61 | Array.filter(
62 | function (barPair)
63 | local bar, _ = unpack(barPair)
64 | return not profileData.blizzBars[bar] or bar == "ActionBar"
65 | end,
66 | Array.fromIterator(pairs(Neuron.registeredBarData)))
67 |
68 | -- make the frames for the bars now
69 | for _, barData in pairs (neuronBars) do
70 | local barClass, barClassData = unpack(barData)
71 | for id,data in pairs(barClassData.barDB) do
72 | if data ~= nil then
73 | local newBar = Neuron.Bar.new(barClass, id) --this calls the bar constructor
74 |
75 | --create all the saved button objects for a given bar
76 | for buttonID=1,#newBar.data.buttons do
77 | newBar.objTemplate.new(newBar, buttonID) --newBar.objTemplate is something like ActionButton or ExtraButton, we just need to code it agnostic
78 | end
79 | end
80 | end
81 | end
82 | end
83 |
--------------------------------------------------------------------------------
/Neuron.toc:
--------------------------------------------------------------------------------
1 | ## Interface: 100100
2 | ## Interface-Wrath: 30401
3 | ## Interface-Classic: 11403
4 | ## Title: Neuron
5 | ## Notes: A macro-based action bar and object manager add-on
6 | ## IconTexture: Interface\AddOns\Neuron\Images\static_icon.tga
7 | ## Author: Britt W. Yazel
8 | ## Version: @project-version@
9 | ## DefaultState: enabled
10 | ## OptionalDeps: Masque
11 | ## SavedVariables: NeuronProfilesDB
12 | ## SavedVariablesPerCharacter:
13 | ## X-Credits-Maintainer: Britt W. Yazel
14 | ## X-Email: bwyazel@gmail.com
15 | ## X-License: MIT
16 | ## X-Curse-Project-ID: 279283
17 | ## X-Wago-ID: e56n1AN9
18 | ## X-WoWI-ID: 10636
19 |
20 | Libs\embeds.xml
21 | Localizations\Neuron_Localizations.xml
22 |
23 | Utilities\Array.lua
24 | Utilities\Spec.lua
25 | Utilities\DB-Fixer.lua
26 |
27 | Overlay\ButtonBinder.lua
28 | Overlay\ButtonEditor.lua
29 | Overlay\BarEditor.lua
30 |
31 | Neuron-DB-Defaults.lua
32 | Neuron.lua
33 | Neuron-States.lua
34 | Neuron-RegisteredBarData.lua
35 |
36 | Objects\Button.lua
37 | Objects\Bar.lua
38 | Objects\ActionButton.lua
39 | Objects\ActionButton_DragAndDrop.lua
40 | Objects\ActionButton_Flyout.lua
41 | Objects\BagButton.lua
42 | Objects\ExitButton.lua
43 | Objects\ExtraButton.lua
44 | Objects\MenuButton.lua
45 | Objects\PetButton.lua
46 | Objects\ZoneAbilityButton.lua
47 | Objects\Bar_SnapTo.lua
48 | Objects\StatusButton.lua
49 | Objects\ExpButton.lua
50 | Objects\RepButton.lua
51 | Objects\CastButton.lua
52 | Objects\MirrorButton.lua
53 |
54 | Neuron-DisableBlizzardUI.lua
55 | Neuron-Console.lua
56 | Neuron-MinimapIcon.lua
57 |
58 | XML\NeuronActionButtonTemplate.xml
59 | XML\NeuronAnchorButtonTemplate.xml
60 | XML\NeuronBarTemplate.xml
61 | XML\NeuronOverlayFrameTemplate.xml
62 | XML\NeuronStatusBarTemplate.xml
63 |
64 | Neuron-Default-Profile.lua
65 | Neuron-Startup.lua
66 |
67 | GUI\Neuron-GUI.xml
68 |
--------------------------------------------------------------------------------
/Objects/BagButton.lua:
--------------------------------------------------------------------------------
1 | -- Neuron is a World of Warcraft® user interface addon.
2 | -- Copyright (c) 2017-2023 Britt W. Yazel
3 | -- Copyright (c) 2006-2014 Connor H. Chenoweth
4 | -- This code is licensed under the MIT license (see LICENSE for details)
5 |
6 | local _, addonTable = ...
7 | local Neuron = addonTable.Neuron
8 |
9 | ---@class BagButton : Button @class BagButton inherits from class Button
10 | local BagButton = setmetatable({}, {__index = Neuron.Button})
11 | Neuron.BagButton = BagButton
12 |
13 | Neuron.NUM_BAG_BUTTONS = 6
14 |
15 | local blizzBagButtons = {
16 | --wow classic has a keyring button
17 | Neuron.isWoWRetail and CharacterReagentBag0Slot or KeyRingButton,
18 | CharacterBag3Slot,
19 | CharacterBag2Slot,
20 | CharacterBag1Slot,
21 | CharacterBag0Slot,
22 | MainMenuBarBackpackButton,
23 | }
24 |
25 | ---------------------------------------------------------
26 |
27 | ---Constructor: Create a new Neuron Button object (this is the base object for all Neuron button types)
28 | ---@param bar Bar @Bar Object this button will be a child of
29 | ---@param buttonID number @Button ID that this button will be assigned
30 | ---@param defaults table @Default options table to be loaded onto the given button
31 | ---@return BagButton @ A newly created BagButton object
32 | function BagButton.new(bar, buttonID, defaults)
33 | --call the parent object constructor with the provided information specific to this button type
34 | local newButton = Neuron.Button.new(bar, buttonID, BagButton, "BagBar", "BagButton", "NeuronAnchorButtonTemplate")
35 |
36 | if defaults then
37 | newButton:SetDefaults(defaults)
38 | end
39 |
40 | return newButton
41 | end
42 |
43 | --------------------------------------------------------
44 |
45 | --TODO: Bag bar seems totally broken after 10.0.5. The bar exists but none of the buttons are attached.
46 |
47 | function BagButton:InitializeButton()
48 | if blizzBagButtons[self.id] then
49 | self.hookedButton = blizzBagButtons[self.id]
50 | self.hookedButton:ClearAllPoints()
51 | self.hookedButton:SetParent(self)
52 | self.hookedButton:Show()
53 | if not Neuron.isWoWRetail and self.id==1 then --the keyring button should be aligned to the right because it's only 1/3 the width of the other bag buttons
54 | self.hookedButton:SetPoint("RIGHT", self, "RIGHT")
55 | else
56 | self.hookedButton:SetPoint("CENTER", self, "CENTER")
57 | end
58 | end
59 |
60 | self:InitializeButtonSettings()
61 | end
62 |
63 | function BagButton:InitializeButtonSettings()
64 | self:SetFrameStrata(Neuron.STRATAS[self.bar:GetStrata()-1])
65 | self:SetScale(self.bar:GetBarScale())
66 | self:SetSkinned()
67 | self.isShown = true
68 | end
69 |
70 | ---simplified SetSkinned for the Bag Buttons. They're unique in that they contain buttons inside of the buttons
71 | --[[function BagButton:SetSkinned()
72 | local SKIN = LibStub("Masque", true)
73 | if SKIN then
74 | local btnData = {
75 | Normal = self.hookedButton:GetNormalTexture(),
76 | Icon = self.hookedButton.icon,
77 | Count = self.hookedButton.Count,
78 | Pushed = self.hookedButton:GetPushedTexture(),
79 | Disabled = self.hookedButton:GetDisabledTexture(),
80 | Checked = self.hookedButton.SlotHighlightTexture, --blizzard in 8.1.5 took away GetCheckedTexture from the bag buttons for ~some~ reason. This is now the explicit location the element we want
81 | Highlight = self.hookedButton:GetHighlightTexture(),
82 | }
83 | SKIN:Group("Neuron", self.bar.data.name):AddButton(self, btnData, "Item")
84 | end
85 | end]]
86 |
87 |
88 | -----------------------------------------------------
89 | --------------------- Overrides ---------------------
90 | -----------------------------------------------------
91 |
92 | --overwrite function in parent class Button
93 | function BagButton:UpdateStatus()
94 | -- empty --
95 | end
96 | --overwrite function in parent class Button
97 | function BagButton:UpdateIcon()
98 | -- empty --
99 | end
100 | --overwrite function in parent class Button
101 | function BagButton:UpdateUsable()
102 | -- empty --
103 | end
104 | --overwrite function in parent class Button
105 | function BagButton:UpdateCount()
106 | -- empty --
107 | end
108 | --overwrite function in parent class Button
109 | function BagButton:UpdateCooldown()
110 | -- empty --
111 | end
112 | --overwrite function in parent class Button
113 | function BagButton:UpdateTooltip()
114 | -- empty --
115 | end
116 |
--------------------------------------------------------------------------------
/Objects/ExitButton.lua:
--------------------------------------------------------------------------------
1 | -- Neuron is a World of Warcraft® user interface addon.
2 | -- Copyright (c) 2017-2023 Britt W. Yazel
3 | -- Copyright (c) 2006-2014 Connor H. Chenoweth
4 | -- This code is licensed under the MIT license (see LICENSE for details)
5 |
6 | local _, addonTable = ...
7 | local Neuron = addonTable.Neuron
8 |
9 | ---@class ExitButton : Button @define class ExitButton inherits from class Button
10 | local ExitButton = setmetatable({}, { __index = Neuron.Button })
11 | Neuron.ExitButton = ExitButton
12 |
13 |
14 | ----------------------------------------------------------
15 |
16 | ---Constructor: Create a new Neuron Button object (this is the base object for all Neuron button types)
17 | ---@param bar Bar @Bar Object this button will be a child of
18 | ---@param buttonID number @Button ID that this button will be assigned
19 | ---@param defaults table @Default options table to be loaded onto the given button
20 | ---@return ExitButton @ A newly created ExitButton object
21 | function ExitButton.new(bar, buttonID, defaults)
22 | --call the parent object constructor with the provided information specific to this button type
23 | local newButton = Neuron.Button.new(bar, buttonID, ExitButton, "ExitBar", "VehicleExitButton", "NeuronActionButtonTemplate")
24 |
25 | if defaults then
26 | newButton:SetDefaults(defaults)
27 | end
28 |
29 | return newButton
30 | end
31 |
32 | ----------------------------------------------------------
33 |
34 | function ExitButton:InitializeButton()
35 | self:RegisterEvent("UPDATE_BONUS_ACTIONBAR", "OnEvent")
36 | self:RegisterEvent("UPDATE_VEHICLE_ACTIONBAR", "OnEvent")
37 | self:RegisterEvent("UPDATE_OVERRIDE_ACTIONBAR", "OnEvent");
38 | self:RegisterEvent("UNIT_ENTERED_VEHICLE", "OnEvent")
39 | self:RegisterEvent("UNIT_EXITED_VEHICLE", "OnEvent")
40 | self:RegisterEvent("VEHICLE_UPDATE", "OnEvent")
41 |
42 | self:SetScript("OnClick", function() self:OnClick() end)
43 | self:SetScript("PostClick", function() self:UpdateStatus() end)
44 | self:SetScript("OnEnter", function() self:UpdateTooltip() end)
45 | self:SetScript("OnLeave", GameTooltip_Hide)
46 |
47 | self:InitializeButtonSettings()
48 | end
49 |
50 | function ExitButton:InitializeButtonSettings()
51 | self.bar:SetShowGrid(false)
52 | self:SetFrameStrata(Neuron.STRATAS[self.bar:GetStrata()-1])
53 | self:SetSkinned()
54 | end
55 |
56 | function ExitButton:OnEvent(event, ...)
57 | --reset button back to normal in the case of setting a tint on prior taxi trip
58 | self.Icon:SetDesaturated(false)
59 | if not InCombatLockdown() then
60 | self:Enable()
61 | end
62 |
63 | self:UpdateIcon()
64 | self:UpdateVisibility()
65 | end
66 |
67 | function ExitButton:OnClick()
68 | if UnitOnTaxi("player") then
69 | TaxiRequestEarlyLanding()
70 | --desaturate the button if early landing is requested and disable it
71 | self.Icon:SetDesaturated(true);
72 | self:Disable()
73 | else
74 | VehicleExit()
75 | end
76 | end
77 |
78 |
79 | -----------------------------------------------------
80 | --------------------- Overrides ---------------------
81 | -----------------------------------------------------
82 |
83 | --overwrite function in parent class Button
84 | function ExitButton:UpdateVisibility()
85 | if CanExitVehicle() or UnitOnTaxi("player") then --set alpha instead of :Show or :Hide, to avoid taint and to allow the button to appear in combat
86 | self.isShown = true
87 | else
88 | self.isShown = false
89 | end
90 |
91 | Neuron.Button.UpdateVisibility(self) --call parent function
92 | end
93 |
94 | --overwrite function in parent class Button
95 | function ExitButton:UpdateIcon()
96 | self.Icon:SetTexture("Interface\\AddOns\\Neuron\\Images\\new_vehicle_exit")
97 | --make sure our button gets the correct Normal texture if we're not using a Masque skin
98 | self:UpdateNormalTexture()
99 | end
100 |
101 | --overwrite function in parent class Button
102 | function ExitButton:UpdateTooltip()
103 | if not self.isShown then
104 | return
105 | end
106 |
107 | if UnitOnTaxi("player") then
108 | GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
109 | GameTooltip:ClearLines()
110 | GameTooltip:SetText(TAXI_CANCEL, 1, 1, 1);
111 | GameTooltip:AddLine(TAXI_CANCEL_DESCRIPTION, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, true);
112 | GameTooltip:Show();
113 | else
114 | GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
115 | GameTooltip:ClearLines()
116 | GameTooltip:SetText(CANCEL);
117 | GameTooltip:Show();
118 | end
119 | end
--------------------------------------------------------------------------------
/Objects/ExtraButton.lua:
--------------------------------------------------------------------------------
1 | -- Neuron is a World of Warcraft® user interface addon.
2 | -- Copyright (c) 2017-2023 Britt W. Yazel
3 | -- Copyright (c) 2006-2014 Connor H. Chenoweth
4 | -- This code is licensed under the MIT license (see LICENSE for details)
5 |
6 | local _, addonTable = ...
7 | local Neuron = addonTable.Neuron
8 |
9 | ---@class ExtraButton : Button @define class ExtraButton inherits from class Button
10 | local ExtraButton = setmetatable({}, { __index = Neuron.Button })
11 | Neuron.ExtraButton = ExtraButton
12 |
13 | ----------------------------------------------------------
14 |
15 | ---Constructor: Create a new Neuron Button object (this is the base object for all Neuron button types)
16 | ---@param bar Bar @Bar Object this button will be a child of
17 | ---@param buttonID number @Button ID that this button will be assigned
18 | ---@param defaults table @Default options table to be loaded onto the given button
19 | ---@return ExtraButton @ A newly created ExtraButton object
20 | function ExtraButton.new(bar, buttonID, defaults)
21 | --call the parent object constructor with the provided information specific to this button type
22 | local newButton = Neuron.Button.new(bar, buttonID, ExtraButton, "ExtraBar", "ExtraActionButton", "NeuronActionButtonTemplate")
23 |
24 | if defaults then
25 | newButton:SetDefaults(defaults)
26 | end
27 |
28 | return newButton
29 | end
30 |
31 | ----------------------------------------------------------
32 |
33 | function ExtraButton:InitializeButton()
34 | self:RegisterEvent("UPDATE_EXTRA_ACTIONBAR", "OnEvent")
35 | self:RegisterEvent("ZONE_CHANGED", "OnEvent")
36 | self:RegisterEvent("SPELLS_CHANGED", "OnEvent")
37 | self:RegisterEvent("PLAYER_ENTERING_WORLD", "OnEvent")
38 | self:RegisterEvent("SPELL_UPDATE_COOLDOWN", "OnEvent")
39 | self:RegisterEvent("SPELL_UPDATE_CHARGES", "OnEvent")
40 | self:RegisterEvent("SPELL_UPDATE_USABLE", "OnEvent")
41 |
42 | self:SetAttribute("type1", "action")
43 |
44 | self:SetAttribute("action1", 169) --baseline actionID for most extra actions
45 |
46 | self:SetAttribute("hotkeypri", self.keys.hotKeyPri)
47 | self:SetAttribute("hotkeys", self.keys.hotKeys)
48 | self:SetSize(52,52)
49 | self.Style:SetPoint("CENTER", -2, 0)
50 |
51 | --action content gets set in UpdateData
52 | self:UpdateData()
53 |
54 | self:SetScript("PostClick", function() self:UpdateStatus() end)
55 | self:SetScript("OnEnter", function() self:UpdateTooltip() end)
56 | self:SetScript("OnLeave", GameTooltip_Hide)
57 |
58 | self:InitializeButtonSettings()
59 | end
60 |
61 | function ExtraButton:InitializeButtonSettings()
62 | self.bar:SetShowGrid(false)
63 | self:SetFrameStrata(Neuron.STRATAS[self.bar:GetStrata()-1])
64 | self:SetSkinned()
65 | end
66 |
67 | function ExtraButton:OnEvent(event, ...)
68 | self:UpdateData()
69 | if event == "PLAYER_ENTERING_WORLD" then
70 | self:ApplyBindings()
71 | self:UpdateIcon()
72 | end
73 | end
74 |
75 |
76 | -----------------------------------------------------
77 | --------------------- Overrides ---------------------
78 | -----------------------------------------------------
79 |
80 | --overwrite function in parent class Button
81 | function ExtraButton:UpdateData()
82 | --get specific extrabutton actionID. Try to query it long form, but if it can't will fall back to 169 (as is the 7.0+ default)
83 | if HasExtraActionBar() then
84 | --default to 169 as is the most of then the case as of 8.1
85 | self.actionID = 169
86 |
87 | local extraPage = GetExtraBarIndex()
88 | self.actionID = extraPage*12 - 11 --1st slot on the extraPage (page 15 as of 8.1, so 169)
89 |
90 | if not InCombatLockdown() then
91 | self:SetAttribute("action1", self.actionID)
92 | end
93 |
94 | _, self.spellID = GetActionInfo(self.actionID)
95 |
96 | if self.spellID then
97 | self.spell = GetSpellInfo(self.spellID);
98 | else
99 | self.spell = nil
100 | end
101 | else
102 | self.actionID = nil
103 | self.spellID = nil
104 | self.spell = nil
105 | end
106 |
107 | -----------------------
108 | self.Name:Hide()
109 |
110 | self:UpdateVisibility()
111 | self:UpdateIcon()
112 | self:UpdateCooldown()
113 | --extra button charges (some quests have ability charges)
114 | self:UpdateCount()
115 | end
116 |
117 | --overwrite function in parent class Button
118 | function ExtraButton:UpdateVisibility()
119 | if HasExtraActionBar() then --set alpha instead of :Show or :Hide, to avoid taint and to allow the button to appear in combat
120 | self.isShown = true
121 | else
122 | self.isShown = false
123 | end
124 | Neuron.Button.UpdateVisibility(self) --call parent function
125 | end
126 |
127 | --overwrite function in parent class Button
128 | function ExtraButton:UpdateIcon()
129 | local spellTexture = GetSpellTexture(self.spellID)
130 | self.Icon:SetTexture(spellTexture)
131 |
132 | local texture = GetOverrideBarSkin() or "Interface\\ExtraButton\\Default"
133 | self.Style:SetTexture(texture)
134 |
135 | if self.bar:GetShowBorderStyle() then
136 | self.Style:Show() --this actually show/hide the fancy button theme surrounding the bar. If you wanted to do a toggle for the style, it should be here.
137 | else
138 | self.Style:Hide()
139 | end
140 | --make sure our button gets the correct Normal texture if we're not using a Masque skin
141 | self:UpdateNormalTexture()
142 | end
143 |
144 | --overwrite function in parent class Button
145 | function ExtraButton:UpdateTooltip()
146 | if not self.isShown then
147 | return
148 | end
149 |
150 | --if we are in combat and we don't have tooltips enable in-combat, don't go any further
151 | if InCombatLockdown() and not self.bar:GetTooltipCombat() then
152 | return
153 | end
154 |
155 | if self.bar:GetTooltipOption() ~= "off" then
156 | GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
157 | if self.bar:GetTooltipOption() == "normal" and self.spellID then
158 | GameTooltip:SetSpellByID(self.spellID)
159 | elseif self.bar:GetTooltipOption() == "minimal" and self.spell then
160 | GameTooltip:SetText(self.spell)
161 | end
162 | GameTooltip:Show()
163 | end
164 | end
165 |
--------------------------------------------------------------------------------
/Objects/MenuButton.lua:
--------------------------------------------------------------------------------
1 | -- Neuron is a World of Warcraft® user interface addon.
2 | -- Copyright (c) 2017-2023 Britt W. Yazel
3 | -- Copyright (c) 2006-2014 Connor H. Chenoweth
4 | -- This code is licensed under the MIT license (see LICENSE for details)
5 |
6 | local _, addonTable = ...
7 | local Neuron = addonTable.Neuron
8 | local Array = addonTable.utilities.Array
9 |
10 |
11 | ---@class MenuButton : Button @define class MenuButton inherits from class Button
12 | local MenuButton = setmetatable({}, {__index = Neuron.Button})
13 | Neuron.MenuButton = MenuButton
14 |
15 | local blizzMenuButtons = not Neuron.isWoWRetail
16 | and Array.initialize(#MICRO_BUTTONS, function(i) return _G[MICRO_BUTTONS[i]] end)
17 | or {
18 | CharacterMicroButton,
19 | SpellbookMicroButton,
20 | TalentMicroButton,
21 | AchievementMicroButton,
22 | QuestLogMicroButton,
23 | GuildMicroButton,
24 | LFDMicroButton,
25 | CollectionsMicroButton,
26 | EJMicroButton,
27 | StoreMicroButton,
28 | MainMenuMicroButton,
29 | }
30 |
31 | ---------------------------------------------------------
32 |
33 | ---Constructor: Create a new Neuron Button object (this is the base object for all Neuron button types)
34 | ---@param bar Bar @Bar Object this button will be a child of
35 | ---@param buttonID number @Button ID that this button will be assigned
36 | ---@param defaults table @Default options table to be loaded onto the given button
37 | ---@return MenuButton @ A newly created MenuButton object
38 | function MenuButton.new(bar, buttonID, defaults)
39 | ---call the parent object constructor with the provided information specific to this button type
40 | local newButton = Neuron.Button.new(bar, buttonID, MenuButton, "MenuBar", "MenuButton", "NeuronAnchorButtonTemplate")
41 |
42 | if defaults then
43 | newButton:SetDefaults(defaults)
44 | end
45 |
46 | return newButton
47 | end
48 |
49 | ---------------------------------------------------------
50 |
51 | function MenuButton:InitializeButton()
52 | --TODO: Pet battles and anything using the vehicle bar will be missing these menu buttons.
53 |
54 | if blizzMenuButtons[self.id] then
55 | self:SetWidth(blizzMenuButtons[self.id]:GetWidth()-2)
56 | self:SetHeight(blizzMenuButtons[self.id]:GetHeight()-2)
57 |
58 | self:SetHitRectInsets(self:GetWidth()/2, self:GetWidth()/2, self:GetHeight()/2, self:GetHeight()/2)
59 |
60 | self.hookedButton = blizzMenuButtons[self.id]
61 |
62 | self.hookedButton:ClearAllPoints()
63 | self.hookedButton:SetParent(self)
64 | self.hookedButton:Show()
65 | self.hookedButton:SetPoint("CENTER", self, "CENTER")
66 | self.hookedButton:SetScale(1)
67 | end
68 |
69 | self:InitializeButtonSettings()
70 | end
71 |
72 | function MenuButton:InitializeButtonSettings()
73 | self:SetFrameStrata(Neuron.STRATAS[self.bar:GetStrata()-1])
74 | self:SetScale(self.bar:GetBarScale())
75 | self.isShown = true
76 | end
77 |
78 | -----------------------------------------------------
79 | --------------------- Overrides ---------------------
80 | -----------------------------------------------------
81 |
82 | --overwrite function in parent class Button
83 | function MenuButton:UpdateStatus()
84 | -- empty --
85 | end
86 | --overwrite function in parent class Button
87 | function MenuButton:UpdateIcon()
88 | -- empty --
89 | end
90 | --overwrite function in parent class Button
91 | function MenuButton:UpdateUsable()
92 | -- empty --
93 | end
94 | --overwrite function in parent class Button
95 | function MenuButton:UpdateCount()
96 | -- empty --
97 | end
98 | --overwrite function in parent class Button
99 | function MenuButton:UpdateCooldown()
100 | -- empty --
101 | end
102 | --overwrite function in parent class Button
103 | function MenuButton:UpdateTooltip()
104 | -- empty --
105 | end
106 |
--------------------------------------------------------------------------------
/Objects/MirrorButton.lua:
--------------------------------------------------------------------------------
1 | -- Neuron is a World of Warcraft® user interface addon.
2 | -- Copyright (c) 2017-2023 Britt W. Yazel
3 | -- Copyright (c) 2006-2014 Connor H. Chenoweth
4 | -- This code is licensed under the MIT license (see LICENSE for details)
5 |
6 | local _, addonTable = ...
7 | local Neuron = addonTable.Neuron
8 |
9 | ---@class MirrorButton : StatusButton @define class RepButton inherits from class StatusButton
10 | local MirrorButton = setmetatable({}, { __index = Neuron.StatusButton })
11 | Neuron.MirrorButton = MirrorButton
12 |
13 | local L = LibStub("AceLocale-3.0"):GetLocale("Neuron")
14 |
15 | local mirrorWatch, mirrorBars = {}, {}
16 |
17 | MirrorButton.sbStrings = {
18 | [1] = { L["None"], function(self) return "" end },
19 | [2] = { L["Type"], function(self) if mirrorWatch[self.mirror] then return mirrorWatch[self.mirror].label end end },
20 | [3] = { L["Timer"], function(self) if mirrorWatch[self.mirror] then return mirrorWatch[self.mirror].timer end end },
21 | }
22 |
23 | local CASTING_BAR_ALPHA_STEP = 0.05
24 |
25 | --this table of colors used to belong to the core UI, but was removed in 10.0
26 | local MirrorTimerColors = { };
27 | MirrorTimerColors["EXHAUSTION"] = {
28 | r = 1.00, g = 0.90, b = 0.00
29 | };
30 | MirrorTimerColors["BREATH"] = {
31 | r = 0.00, g = 0.50, b = 1.00
32 | };
33 | MirrorTimerColors["DEATH"] = {
34 | r = 1.00, g = 0.70, b = 0.00
35 | };
36 | MirrorTimerColors["FEIGNDEATH"] = {
37 | r = 1.00, g = 0.70, b = 0.00
38 | };
39 |
40 |
41 | ---Constructor: Create a new Neuron Button object (this is the base object for all Neuron button types)
42 | ---@param bar Bar @Bar Object this button will be a child of
43 | ---@param buttonID number @Button ID that this button will be assigned
44 | ---@param defaults table @Default options table to be loaded onto the given button
45 | ---@return MirrorButton @ A newly created StatusButton object
46 | function MirrorButton.new(bar, buttonID, defaults)
47 | --call the parent object constructor with the provided information specific to this button type
48 | local newButton = Neuron.StatusButton.new(bar, buttonID, defaults, MirrorButton, "MirrorBar", "Mirror Button")
49 |
50 | return newButton
51 | end
52 |
53 | function MirrorButton:InitializeButton()
54 | self:RegisterEvent("MIRROR_TIMER_START", "OnEvent")
55 | self:RegisterEvent("MIRROR_TIMER_STOP", "OnEvent")
56 | self:RegisterEvent("PLAYER_ENTERING_WORLD", "OnEvent")
57 |
58 | self:SetScript("OnUpdate", function() self:OnUpdate() end)
59 |
60 | table.insert(mirrorBars, self)
61 | self.StatusBar:Hide()
62 | self.typeString = L["Mirror Bar"]
63 |
64 | self:InitializeButtonSettings()
65 | end
66 |
67 | function MirrorButton:OnEvent(event, ...)
68 | if event == "MIRROR_TIMER_START" then
69 | self:Start(...)
70 |
71 | elseif event == "MIRROR_TIMER_STOP" then
72 | self:Stop(...)
73 |
74 | elseif event == "PLAYER_ENTERING_WORLD" then --this doesn't seem to be working as of 8.0, all report as UNKNOWN
75 | local type, value, maxvalue, scale, paused, label
76 | for i=1, MIRRORTIMER_NUMTIMERS do
77 | type, value, maxvalue, scale, paused, label = GetMirrorTimerInfo(i)
78 | if type ~= "UNKNOWN" then
79 | self:Start(type, value, maxvalue, scale, paused, label)
80 | end
81 | end
82 | end
83 | end
84 |
85 | function MirrorButton:Start(type, value, maxvalue, scale, paused, label)
86 |
87 | if not mirrorWatch[type] then
88 | mirrorWatch[type] = { active = false, mbar = nil, label = "", timer = "" }
89 | end
90 |
91 | if not mirrorWatch[type].active then
92 | local mbar = table.remove(mirrorBars, 1)
93 |
94 | if mbar then
95 | mirrorWatch[type].active = true
96 | mirrorWatch[type].mbar = mbar
97 | mirrorWatch[type].label = label
98 |
99 | mbar.mirror = type
100 | mbar.value = (value / 1000)
101 | mbar.maxvalue = (maxvalue / 1000)
102 |
103 | local color = MirrorTimerColors[type]
104 |
105 | mbar.StatusBar:SetMinMaxValues(0, (maxvalue / 1000))
106 | mbar.StatusBar:SetValue(mbar.value)
107 | mbar.StatusBar:SetStatusBarColor(color.r, color.g, color.b)
108 |
109 | mbar.StatusBar:SetAlpha(1)
110 | mbar.StatusBar:Show()
111 | end
112 | end
113 | end
114 |
115 | function MirrorButton:Stop(type)
116 | if mirrorWatch[type] and mirrorWatch[type].active then
117 |
118 | local mbar = mirrorWatch[type].mbar
119 | if mbar then
120 | table.insert(mirrorBars, 1, mbar)
121 | mirrorWatch[type].active = false
122 | mirrorWatch[type].mbar = nil
123 | mirrorWatch[type].label = ""
124 | mirrorWatch[type].timer = ""
125 | mbar.mirror = nil
126 | end
127 | end
128 | end
129 |
130 | function MirrorButton:OnUpdate()
131 | if self.mirror then
132 | self.value = GetMirrorTimerProgress(self.mirror)/1000
133 |
134 | if self.value > self.maxvalue then
135 | self.alpha = self.StatusBar:GetAlpha() - CASTING_BAR_ALPHA_STEP
136 | if self.alpha > 0 then
137 | self.StatusBar:SetAlpha(self.alpha)
138 | else
139 | self.StatusBar:Hide()
140 | end
141 |
142 | else
143 | self.StatusBar:SetValue(self.value)
144 | if self.value >= 60 then
145 | self.value = string.format("%0.1f", self.value/60)
146 | self.value = self.value.."m"
147 | else
148 | self.value = string.format("%0.0f", self.value)
149 | self.value = self.value.."s"
150 | end
151 |
152 | mirrorWatch[self.mirror].timer = self.value
153 | end
154 |
155 | elseif not Neuron.barEditMode and not Neuron.buttonEditMode then
156 | self.alpha = self.StatusBar:GetAlpha() - CASTING_BAR_ALPHA_STEP
157 | if self.alpha > 0 then
158 | self.StatusBar:SetAlpha(self.alpha)
159 | else
160 | self.StatusBar:Hide()
161 | end
162 | end
163 |
164 | if not Neuron.barEditMode and not Neuron.buttonEditMode then
165 | self.StatusBar.CenterText:SetText(self:cFunc())
166 | self.StatusBar.LeftText:SetText(self:lFunc())
167 | self.StatusBar.RightText:SetText(self:rFunc())
168 | self.StatusBar.MouseoverText:SetText(self:mFunc())
169 | end
170 | end
--------------------------------------------------------------------------------
/Overlay/ButtonEditor.lua:
--------------------------------------------------------------------------------
1 | -- Neuron is a World of Warcraft® user interface addon.
2 | -- Copyright (c) 2017-2023 Britt W. Yazel
3 | -- Copyright (c) 2006-2014 Connor H. Chenoweth
4 | -- This code is licensed under the MIT license (see LICENSE for details)
5 |
6 | local _, addonTable = ...
7 |
8 | addonTable.overlay = addonTable.overlay or {}
9 |
10 | local L = LibStub("AceLocale-3.0"):GetLocale("Neuron")
11 |
12 | ---type definition the contents of the xml file
13 | ---@class OverlayFrameSelect:Frame
14 | ---@field Left Texture
15 | ---@field Reticle Texture
16 | ---@field Right Texture
17 |
18 | ---@class ButtonOverlayFrame:Button,ScriptObject
19 | ---@field label FontString
20 | ---@field select OverlayFrameSelect
21 |
22 | ---@class ButtonOverlay
23 | ---@field active boolean
24 | ---@field button Button
25 | ---@field frame ButtonOverlayFrame
26 | ---@field onClick fun(button: Button):nil
27 |
28 | ---@type ButtonOverlayFrame[]
29 | local framePool = {}
30 |
31 | ---@param overlay ButtonOverlay
32 | local function onEnter(overlay)
33 | overlay.frame.select:Show()
34 | GameTooltip:SetOwner(overlay.frame, "ANCHOR_RIGHT")
35 | GameTooltip:Show()
36 | end
37 |
38 | ---@param overlay ButtonOverlay
39 | local function onLeave(overlay)
40 | if overlay.active == false then
41 | overlay.frame.select:Hide()
42 | end
43 | GameTooltip:Hide()
44 | end
45 |
46 | ---@param overlay ButtonOverlay
47 | local function onClick(overlay)
48 | overlay.onClick(overlay.button)
49 | end
50 |
51 | local ButtonEditor= {
52 | ---@param button Button
53 | ---@param recticle "sides"|"corners"
54 | ---@param onClickCallback fun(button: Button): nil
55 | ---@return ButtonOverlay
56 | allocate = function (button, recticle, onClickCallback)
57 | ---@type ButtonOverlay
58 | local overlay = {
59 | active = false,
60 | button = button,
61 | frame = -- try to pop a frame off the stack, otherwise make a new one
62 | table.remove(framePool) or
63 | CreateFrame("Button", nil, UIParent, "NeuronOverlayFrameTemplate") --[[@as ButtonOverlayFrame]],
64 | onClick = onClickCallback,
65 | }
66 |
67 | overlay.frame:EnableMouseWheel(true)
68 | overlay.frame:RegisterForClicks("AnyDown")
69 | overlay.frame:SetAllPoints(button)
70 | overlay.frame:SetScript("OnEnter", function() onEnter(overlay) end)
71 | overlay.frame:SetScript("OnLeave", function() onLeave(overlay) end)
72 | overlay.frame:SetScript("OnClick", function() onClick(overlay) end)
73 |
74 | overlay.frame.label:SetText(L["Edit"])
75 |
76 | if recticle == "corners" then
77 | overlay.frame.select.Left:Hide()
78 | overlay.frame.select.Right:Hide()
79 | overlay.frame.select.Reticle:Show()
80 | else
81 | overlay.frame.select.Left:ClearAllPoints()
82 | overlay.frame.select.Left:SetPoint("RIGHT", overlay.frame.select, "LEFT", 4, 0)
83 | overlay.frame.select.Left:SetTexture("Interface\\AddOns\\Neuron\\Images\\flyout.tga")
84 | overlay.frame.select.Left:SetTexCoord(0.71875, 1, 0, 1)
85 | overlay.frame.select.Left:SetWidth(16)
86 | overlay.frame.select.Left:SetHeight(55)
87 |
88 | overlay.frame.select.Right:ClearAllPoints()
89 | overlay.frame.select.Right:SetPoint("LEFT", overlay.frame.select, "RIGHT", -4, 0)
90 | overlay.frame.select.Right:SetTexture("Interface\\AddOns\\Neuron\\Images\\flyout.tga")
91 | overlay.frame.select.Right:SetTexCoord(0, 0.28125, 0, 1)
92 | overlay.frame.select.Right:SetWidth(16)
93 | overlay.frame.select.Right:SetHeight(55)
94 |
95 | overlay.frame.select.Left:Show()
96 | overlay.frame.select.Right:Show()
97 | overlay.frame.select.Reticle:Hide()
98 | end
99 |
100 | overlay.frame:Show()
101 |
102 | return overlay
103 | end,
104 |
105 | ---@param overlay ButtonOverlay
106 | activate = function(overlay)
107 | overlay.active = true
108 | overlay.frame.select:Show()
109 | end,
110 |
111 | ---@param overlay ButtonOverlay
112 | deactivate = function(overlay)
113 | overlay.active = false
114 | overlay.frame.select:Hide()
115 | end,
116 |
117 | ---@param overlay ButtonOverlay
118 | free = function (overlay)
119 | overlay.frame:SetScript("OnEnter", nil)
120 | overlay.frame:SetScript("OnLeave", nil)
121 | overlay.frame:SetScript("OnClick", nil)
122 | overlay.frame.select:Hide()
123 | overlay.frame:Hide()
124 | table.insert(framePool, overlay.frame)
125 |
126 | -- just for good measure to make sure nothing else can mess with
127 | -- the frame after we put it back into the pool
128 | overlay.frame = nil
129 | end,
130 | }
131 |
132 | addonTable.overlay.ButtonEditor = ButtonEditor
133 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Neuron
2 | Neuron is a full-featured action Bar addon for [World of Warcraft: Dragonflight](https://worldofwarcraft.com/en-us/), updated for Patch 10.0.0
3 |
4 |
5 | ## Manual Install:
6 | I do not recommend downloading this addon directly from Github, as there are CurseForge packaging modifications made to the addon upon release. These modifications include updating all included libraries to their latest release versions and pulling in all of the crowd sourced localizations. I have made an effort to pull in periodic samplings of these, but what you will find in the packaged versions on CurseForge or WowInterface will be much more up to date.
7 |
8 |
9 | ## Want to Donate?
10 | Making add-ons is a lot of work! Your help goes a huge way to making my add-on work possible. If you would like to Donate, [Github Sponsors](https://github.com/sponsors/brittyazel "Sponsor Me") is the preferred method as they are currently matching donations dollar for dollar and take zero cut.
11 |
12 |
13 | ## Translating
14 | The efforts to translate Neuron into many languages is a community project, and it could use your help!
15 |
16 | Head **[here](https://wow.curseforge.com/projects/neuron/localization)** to start translating.
17 |
18 |
19 | ## Download:
20 | The addon can be downloaded at these places:
21 | * **[Curse](https://www.curseforge.com/wow/addons/neuron)**
22 | * **[Curseforge](https://wow.curseforge.com/projects/neuron)**
23 | * **[WowInterface](https://www.wowinterface.com/downloads/info10636-Neuron.html)**
24 |
25 |
26 | ## Development:
27 | Neuron development is all done using the **[Intellij IDEA](https://www.jetbrains.com/idea/download/#section=windows)** Community Edition IDE and with the assistance of the fantastic **[EmmyLua](https://plugins.jetbrains.com/plugin/9768-emmylua)** plugin. Detailed instructions on how I set up my development environment can be found **[here](https://github.com/Ellypse/IntelliJ-IDEA-Lua-IDE-WoW-API/wiki)**. Likewise, in game I make use of the addons **[BugGrabber](https://www.curseforge.com/wow/addons/bug-grabber)**, **[BugSack](https://www.curseforge.com/wow/addons/bugsack)**, and **[ViragDevTool](https://www.curseforge.com/wow/addons/varrendevtool)**, and in game tools such as **"/eventtrace"** and **"/framestack"**
28 |
29 | Development of Neuron requires an understanding of **[Lua syntax](https://www.lua.org/manual/5.3/manual.html)**, the **[WoW API](https://wow.gamepedia.com/World_of_Warcraft_API)**, and a working understanding of Git/GitHub. If you want to help with Neuron's development, I suggest:
30 | 1. Forking the project on [GitHub](https://github.com/brittyazel/Neuron) (some people use [GitHub Desktop](https://desktop.github.com/), but I personally use [GitKraken](https://www.gitkraken.com/))
31 | 2. Setting up your aforementioned development environment
32 | 3. Backing up your WTF folder
33 | 4. [Symlinking](https://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/) your cloned Neuron git folder to your "World of Warcraft>\_retail_>Interface>Addons" folder
34 | 5. Making your first change
35 |
36 | A good place to start coding is by looking through the **[issue tracker](https://github.com/brittyazel/Neuron/issues)** to find any issues marked as "[good first issue](https://github.com/brittyazel/Neuron/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)". All code change submissions should come in the form of pull requests, so that I can review it and provide comments before merging.
37 |
38 | ## Alternative Development
39 | If an IDE is not your scene, then we have provided a Nix based development environment. If you need Nix, then see the following section. Once you have Nix then you can type `env NEURON_INSTALL_DIR="/Neuron" nix-shell --run make` and the build system will automatically install neuron and keep it synced with your changes
40 | ### Nix
41 | Installing Nix can probably be done from your package manage in Linux or WSL. Alternatively you can type `sh <(curl -L https://nixos.org/nix/install) --daemon`. See https://nixos.org for more details.
42 |
43 |
44 | ### Disclaimer:
45 |
46 | Neuron is a continuation of the amazing *Ion Action Bars* addon started by Connor H. Chenoweth. All credit for the work done prior to 2017 should go to him, accordingly.
47 |
--------------------------------------------------------------------------------
/Utilities/Array.lua:
--------------------------------------------------------------------------------
1 | -- Neuron is a World of Warcraft® user interface addon.
2 | -- Copyright (c) 2017-2023 Britt W. Yazel
3 | -- Copyright (c) 2006-2014 Connor H. Chenoweth
4 | -- This code is licensed under the MIT license (see LICENSE for details)
5 |
6 | local _, addonTable = ...
7 | addonTable.utilities = addonTable.utilities or {}
8 |
9 |
10 | local Array; Array = {
11 | ---create an array
12 | ---number -> (number -> A ) -> A[]
13 | ---@generic A
14 | ---@param n number @length of array
15 | ---@param fn fun(i:number):A @function takes index and returns array element
16 | ---@return A[] @an array of length n
17 | initialize = function (n, fn)
18 | local array = {}
19 | for i=1,n do
20 | array[i] = fn(i)
21 | end
22 | return array
23 | end,
24 |
25 | ---returns a new array, different from the components
26 | ---@param ... any[]
27 | ---@return any[]
28 | concatenate = function (...)
29 | local result = {}
30 | for _,array in ipairs({...}) do
31 | for _,element in ipairs(array) do
32 | table.insert(result, element)
33 | end
34 | end
35 |
36 | return result
37 | end,
38 |
39 | ---remove items from an array if a test function returns falsey
40 | ---@generic A
41 | ---@param fn fun(a:`A`):boolean @test function
42 | ---@param array A[] @input array
43 | ---@return A[] @filtered array
44 | filter = function (fn, array)
45 | local newArray = {}
46 |
47 | for _,v in ipairs(array) do
48 | if fn(v) then
49 | table.insert(newArray, v)
50 | end
51 | end
52 |
53 | return newArray
54 | end,
55 |
56 | ---remove items from an array if a test function returns falsey
57 | ---@generic A
58 | ---@param fn fun(a:`A`):boolean @test function
59 | ---@param array A[] @input array
60 | ---@return number|nil, A|nil @position of element
61 | find = function (fn, array)
62 | for i,v in ipairs(array) do
63 | if fn(v) then
64 | return i, v
65 | end
66 | end
67 |
68 | return nil
69 | end,
70 |
71 | ---aka reduce
72 | ---@generic A, B
73 | ---@param fn fun(a: `A`, b: `B`):A
74 | ---@param initial A @initial value
75 | ---@param array B[] @input array
76 | ---@return A @folded value
77 | foldl = function (fn, initial, array)
78 | for _,v in ipairs(array) do
79 | initial = fn(initial, v)
80 | end
81 | return initial
82 | end,
83 |
84 | ---converts an iterator to an array
85 | ---this exists because iterators are thruples, but lua has no real support
86 | ---for tuples outside of return/parameter values. this results in way to much
87 | ---boilerplate when packing/unpacking iterators<->arrays in order to
88 | ---pass them around as first class objects. not to mention that iterators
89 | ---themselves can return tuples, besides _being_ tuples
90 | ---@generic I, C, D
91 | ---@param iter fun(invariant: I, control: C):D|...
92 | ---@param invariant I
93 | ---@param control C
94 | ---@return D[]|...[]
95 | fromIterator = function(iter, invariant, control)
96 | local result = {}
97 | local index = 1
98 | repeat
99 | local nextValue = {iter(invariant, control)}
100 | -- if the iterator returned a single value, then insert that
101 | -- if the iterator returned a tuple, then insert that tuple as an array
102 | if #nextValue < 2 then
103 | table.insert(result, index, nextValue[1])
104 | else
105 | table.insert(result, index, nextValue)
106 | end
107 |
108 | control = unpack(nextValue)
109 | index = index + 1
110 | until control == nil
111 |
112 | return result
113 | end,
114 |
115 | ---map from one array to another
116 | ---(A->B) -> A[] -> B[]
117 | ---@generic A
118 | ---@generic B
119 | ---@param fn fun(a:A):B
120 | ---@param array A[] @source array
121 | ---@return B[] @remapped array
122 | map = function (fn, array)
123 | return Array.initialize(#array, function (i) return fn(array[i]) end)
124 | end,
125 | }
126 |
127 | addonTable.utilities.Array = Array
128 |
--------------------------------------------------------------------------------
/Utilities/Spec.lua:
--------------------------------------------------------------------------------
1 | -- Neuron is a World of Warcraft® user interface addon.
2 | -- Copyright (c) 2017-2023 Britt W. Yazel
3 | -- Copyright (c) 2006-2014 Connor H. Chenoweth
4 | -- This code is licensed under the MIT license (see LICENSE for details)
5 |
6 | local _, addonTable = ...
7 | addonTable.utilities = addonTable.utilities or {}
8 |
9 | local L = LibStub("AceLocale-3.0"):GetLocale("Neuron")
10 | local Array = addonTable.utilities.Array
11 |
12 | local wrathSpecNames = {TALENT_SPEC_PRIMARY, TALENT_SPEC_SECONDARY}
13 |
14 | local Spec; Spec = {
15 | --- get the currently active spec
16 | -- bool -> int, string
17 | --
18 | -- @param bool indicating whether we want multispec
19 | -- @return the spec index and name
20 | active = function (multiSpec)
21 | local index, name
22 | if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
23 | index = GetSpecialization()
24 | _, name = GetSpecializationInfo(index)
25 | elseif WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC then
26 | index = GetActiveTalentGroup()
27 | name = wrathSpecNames[index]
28 | else -- classic era or something we don't handle
29 | index, name = 1, ""
30 | end
31 |
32 | index = multiSpec and index or 1
33 |
34 | return index, name
35 | end,
36 |
37 | --- get a list of spec names
38 | -- boolean -> string[]
39 | --
40 | -- @param bool indicating whether we want multispec
41 | -- @return the names
42 | names = function(multiSpec)
43 | local names
44 | if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
45 | names = Array.initialize(
46 | GetNumSpecializations(),
47 | function(i) return select(2, GetSpecializationInfo(i)) end
48 | )
49 | elseif WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC then
50 | names = wrathSpecNames
51 | else
52 | names = {""}
53 | end
54 |
55 | return multiSpec and names or {""}
56 | end
57 | }
58 |
59 | addonTable.utilities.Spec = Spec
60 |
--------------------------------------------------------------------------------
/XML/NeuronAnchorButtonTemplate.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/XML/NeuronBarTemplate.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
8 |
9 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/XML/NeuronOverlayFrameTemplate.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
8 |
9 |
60 |
61 |
--------------------------------------------------------------------------------
/XML/NeuronStatusBarTemplate.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 | self:SetBackdrop({
95 | bgFile = "Interface\Tooltips\UI-Tooltip-Background",
96 | edgeFile = "Interface\Tooltips\UI-Tooltip-Border", tile = true, tileSize = 0, edgeSize = 12,
97 | insets = { left = 3, right = 3, top = 3, bottom = 3 }
98 | });
99 | self:SetBackdropColor(0, 0, 0, 0.8)
100 | self:SetBackdropBorderColor(0.8,0.8,0.8,0)
101 | self:SetFrameLevel(0)
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 | self:SetBackdrop({
117 | bgFile = "Interface\Tooltips\UI-Tooltip-Background",
118 | edgeFile = "Interface\Tooltips\UI-Tooltip-Border", tile = true, tileSize = 0, edgeSize = 12,
119 | insets = { left = 3, right = 3, top = 3, bottom = 3 }
120 | });
121 | self:SetBackdropColor(0, 0, 0, 0)
122 | self:SetBackdropBorderColor(0.8,0.8,0.8,0)
123 | self:SetFrameLevel(10)
124 |
125 |
126 |
127 |
128 |
129 |
130 | self:SetBackdrop({
131 | bgFile = "Interface\Tooltips\UI-Tooltip-Background",
132 | edgeFile = "Interface\Tooltips\UI-Tooltip-Border", tile = true, tileSize = 0, edgeSize = 15,
133 | insets = { left = 2, right = 2, top = 2, bottom = 2 }
134 | });
135 | self:SetBackdropColor(1, 1, 1, 0.5)
136 | self:SetBackdropBorderColor(1, 1, 1)
137 | self:SetFrameLevel(3)
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
--------------------------------------------------------------------------------
/XML/NeuronZoneAbilityButtonTemplate.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/pkgmeta.yaml:
--------------------------------------------------------------------------------
1 | package-as: Neuron
2 |
3 | enable-nolib-creation: no
4 | enable-toc-creation: yes
5 |
6 | optional-dependencies:
7 | - masque
8 | - masque-neuron
9 |
10 | embedded-libraries:
11 | - Ace3
12 | - LibDualSpec-1-0
13 | - LibDBIcon-1-0
14 | - LibDeflate
15 |
16 | # theoretically we can get rid of the ignore files now that we have the makefile
17 | ignore:
18 | - README.md
19 | - dist
20 |
--------------------------------------------------------------------------------