├── media
├── Wglass.tga
├── gloss.tga
├── shield.blp
├── spark.tga
├── Minimalist.tga
├── icon_border.blp
├── Designosaur-Italic.ttf
└── Designosaur-Regular.ttf
├── libs
├── AceDB-3.0
│ └── AceDB-3.0.xml
├── DRData-1.0
│ ├── DRData-1.0.xml
│ ├── Changelog-DRData-1.0-v2.7.txt
│ └── DRData-1.0.toc
├── AceAddon-3.0
│ └── AceAddon-3.0.xml
├── AceEvent-3.0
│ ├── AceEvent-3.0.xml
│ └── AceEvent-3.0.lua
├── AceHook-3.0
│ └── AceHook-3.0.xml
├── AceTab-3.0
│ └── AceTab-3.0.xml
├── AceTimer-3.0
│ └── AceTimer-3.0.xml
├── LibFunctional-1.0
│ ├── lib.xml
│ ├── LibFunctional-1.0.toc
│ └── libs
│ │ └── LibStub
│ │ ├── LibStub.toc
│ │ ├── tests
│ │ ├── test3.lua
│ │ ├── test4.lua
│ │ ├── test2.lua
│ │ └── test.lua
│ │ └── LibStub.lua
├── AceBucket-3.0
│ └── AceBucket-3.0.xml
├── AceConsole-3.0
│ └── AceConsole-3.0.xml
├── AceLocale-3.0
│ ├── AceLocale-3.0.xml
│ └── AceLocale-3.0.lua
├── AceDBOptions-3.0
│ └── AceDBOptions-3.0.xml
├── AceSerializer-3.0
│ └── AceSerializer-3.0.xml
├── LibSharedMedia-3.0
│ ├── lib.xml
│ ├── LibSharedMedia-3.0
│ │ └── lib.xml
│ ├── LibSharedMedia-3.0.toc
│ └── LibStub
│ │ └── LibStub.lua
├── CallbackHandler-1.0
│ └── CallbackHandler-1.0.xml
├── AceConfig-3.0
│ ├── AceConfigCmd-3.0
│ │ └── AceConfigCmd-3.0.xml
│ ├── AceConfigDialog-3.0
│ │ └── AceConfigDialog-3.0.xml
│ ├── AceConfigRegistry-3.0
│ │ └── AceConfigRegistry-3.0.xml
│ ├── AceConfig-3.0.xml
│ └── AceConfig-3.0.lua
├── AceComm-3.0
│ └── AceComm-3.0.xml
├── LibRangeCheck-2.0
│ ├── CallbackHandler-1.0
│ │ └── CallbackHandler-1.0.xml
│ ├── notes.txt
│ ├── LibStub-1.0
│ │ ├── LibStub.toc
│ │ └── LibStub.lua
│ ├── LibRangeCheck-2.0.toc
│ └── Changelog-LibRangeCheck-2.0-r112.txt
├── LibAuraInfo-1.0
│ └── lib.xml
├── AceGUI-3.0-SharedMediaWidgets
│ ├── Libs
│ │ ├── CallbackHandler-1.0
│ │ │ └── CallbackHandler-1.0.xml
│ │ ├── LibStub
│ │ │ ├── LibStub.toc
│ │ │ └── LibStub.lua
│ │ └── AceGUI-3.0
│ │ │ ├── AceGUI-3.0.xml
│ │ │ └── widgets
│ │ │ ├── AceGUIContainer-SimpleGroup.lua
│ │ │ ├── AceGUIWidget-Heading.lua
│ │ │ ├── AceGUIWidget-InteractiveLabel.lua
│ │ │ ├── AceGUIWidget-Button.lua
│ │ │ ├── AceGUIContainer-InlineGroup.lua
│ │ │ ├── AceGUIContainer-BlizOptionsGroup.lua
│ │ │ ├── AceGUIWidget-Icon.lua
│ │ │ ├── AceGUIWidget-Label.lua
│ │ │ ├── AceGUIContainer-DropDownGroup.lua
│ │ │ ├── AceGUIWidget-ColorPicker.lua
│ │ │ └── AceGUIContainer-ScrollFrame.lua
│ ├── widget.xml
│ ├── AceGUI-3.0-SharedMediaWidgets
│ │ ├── widget.xml
│ │ ├── FontWidget.lua
│ │ └── StatusbarWidget.lua
│ ├── AceGUI-3.0-SharedMediaWidgets.toc
│ ├── Changelog-AceGUI-3.0-SharedMediaWidgets-r32.txt
│ ├── FontWidget.lua
│ ├── StatusbarWidget.lua
│ └── BorderWidget.lua
├── LibStub
│ ├── LibStub.toc
│ ├── Changelog-LibStub-1.0.txt
│ ├── tests
│ │ ├── test3.lua
│ │ ├── test4.lua
│ │ ├── test2.lua
│ │ └── test.lua
│ └── LibStub.lua
├── LibDispellable-1.0
│ ├── LibDispellable-1.0.toc
│ ├── README.textile
│ ├── Changelog-LibDispellable-1.0-1.0.txt
│ └── LibStub.lua
├── LibDualSpec-1.0
│ ├── LibDualSpec-1.0.toc
│ └── LibStub.lua
├── Changelog-Ace3-Release-r1041.txt
├── AceGUI-3.0
│ ├── AceGUI-3.0.xml
│ └── widgets
│ │ ├── AceGUIContainer-SimpleGroup.lua
│ │ ├── AceGUIWidget-Heading.lua
│ │ ├── AceGUIWidget-InteractiveLabel.lua
│ │ ├── AceGUIWidget-Button.lua
│ │ ├── AceGUIContainer-InlineGroup.lua
│ │ ├── AceGUIContainer-BlizOptionsGroup.lua
│ │ ├── AceGUIWidget-Icon.lua
│ │ ├── AceGUIContainer-DropDownGroup.lua
│ │ ├── AceGUIWidget-Label.lua
│ │ └── AceGUIWidget-ColorPicker.lua
└── LICENSE.txt
├── .gitmodules
├── .gitignore
├── .gitattributes
├── GladiusEx.toc
├── modules
├── targetbar.lua
├── petbar.lua
└── interrupts.lua
├── embeds.xml
├── README.md
└── .github
└── workflows
└── release.yml
/media/Wglass.tga:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ManneN1/GladiusEx-WotLK/HEAD/media/Wglass.tga
--------------------------------------------------------------------------------
/media/gloss.tga:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ManneN1/GladiusEx-WotLK/HEAD/media/gloss.tga
--------------------------------------------------------------------------------
/media/shield.blp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ManneN1/GladiusEx-WotLK/HEAD/media/shield.blp
--------------------------------------------------------------------------------
/media/spark.tga:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ManneN1/GladiusEx-WotLK/HEAD/media/spark.tga
--------------------------------------------------------------------------------
/media/Minimalist.tga:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ManneN1/GladiusEx-WotLK/HEAD/media/Minimalist.tga
--------------------------------------------------------------------------------
/media/icon_border.blp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ManneN1/GladiusEx-WotLK/HEAD/media/icon_border.blp
--------------------------------------------------------------------------------
/media/Designosaur-Italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ManneN1/GladiusEx-WotLK/HEAD/media/Designosaur-Italic.ttf
--------------------------------------------------------------------------------
/media/Designosaur-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ManneN1/GladiusEx-WotLK/HEAD/media/Designosaur-Regular.ttf
--------------------------------------------------------------------------------
/libs/AceDB-3.0/AceDB-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/libs/DRData-1.0/DRData-1.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/libs/AceAddon-3.0/AceAddon-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/libs/AceEvent-3.0/AceEvent-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/libs/AceHook-3.0/AceHook-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/libs/AceTab-3.0/AceTab-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/libs/AceTimer-3.0/AceTimer-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/libs/LibFunctional-1.0/lib.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/libs/AceBucket-3.0/AceBucket-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/libs/AceConsole-3.0/AceConsole-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/libs/AceLocale-3.0/AceLocale-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/libs/AceDBOptions-3.0/AceDBOptions-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/libs/AceSerializer-3.0/AceSerializer-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/libs/LibSharedMedia-3.0/lib.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/libs/CallbackHandler-1.0/CallbackHandler-1.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/libs/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/libs/LibSharedMedia-3.0/LibSharedMedia-3.0/lib.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/libs/AceComm-3.0/AceComm-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/libs/LibRangeCheck-2.0/CallbackHandler-1.0/CallbackHandler-1.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/libs/LibAuraInfo-1.0/lib.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "libs/LibSpecDetection-1.0"]
2 | path = libs/LibSpecDetection-1.0
3 | url = https://github.com/ManneN1/LibSpecDetection-1.0.git
4 | [submodule "libs/LibCooldownTracker-1.0"]
5 | path = libs/LibCooldownTracker-1.0
6 | url = https://github.com/ManneN1/LibCooldownTracker-1.0-3.3.5.git
7 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0-SharedMediaWidgets/Libs/CallbackHandler-1.0/CallbackHandler-1.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/libs/LibStub/LibStub.toc:
--------------------------------------------------------------------------------
1 | ## Interface: 20400
2 | ## Title: Lib: LibStub
3 | ## Notes: Universal Library Stub
4 | ## Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel
5 | ## X-Website: http://jira.wowace.com/browse/LS
6 | ## X-Category: Library
7 | ## X-License: Public Domain
8 |
9 | LibStub.lua
10 |
--------------------------------------------------------------------------------
/libs/DRData-1.0/Changelog-DRData-1.0-v2.7.txt:
--------------------------------------------------------------------------------
1 | tag v2.7
2 | e75daae598a08888f3945d2238be76854eafd1f0
3 | Adirelle
4 | 2012-04-14 18:54:56 +0200
5 |
6 | Tagging as v2.7.
7 |
8 |
9 | --------------------
10 |
11 | Adirelle:
12 | - Updated for 4.3 DR according to http://www.wowhead.com/forums&topic=190141/4-3-crowd-controls-dispels-pvp-de-buffs.
13 |
--------------------------------------------------------------------------------
/libs/LibRangeCheck-2.0/notes.txt:
--------------------------------------------------------------------------------
1 | - You should list all spells that can have different ranges depending on
2 | talents (that's why Scorch, Arcane Missiles and Frostbolt are all listed,
3 | even though they all have a 30 yd range initially).
4 |
5 | - Interact distances are a bit off with regards to spell ranges. I decided to
6 | keep spell ranges as the "standard" and adjusted the interact distances
7 | to fit in
8 |
9 |
--------------------------------------------------------------------------------
/libs/LibStub/Changelog-LibStub-1.0.txt:
--------------------------------------------------------------------------------
1 | ------------------------------------------------------------------------
2 | r90 | nevcairiel | 2008-09-30 06:01:35 +0000 (Tue, 30 Sep 2008) | 1 line
3 | Changed paths:
4 | A /tags/1.0
5 | A /tags/1.0/.pkgmeta
6 | A /tags/1.0/LibStub.lua
7 | A /tags/1.0/LibStub.toc
8 |
9 | Add 1.0 tag
10 | ------------------------------------------------------------------------
11 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Windows thumbnail cache files
2 | Thumbs.db
3 | ehthumbs.db
4 | ehthumbs_vista.db
5 |
6 | # Folder config file
7 | Desktop.ini
8 |
9 | # Recycle Bin used on file shares
10 | $RECYCLE.BIN/
11 |
12 | # Windows Installer files
13 | *.cab
14 | *.msi
15 | *.msm
16 | *.msp
17 |
18 | # Windows shortcuts
19 | *.lnk
20 |
21 | # =========================
22 | # Operating System Files
23 | # =========================
24 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0-SharedMediaWidgets/widget.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
--------------------------------------------------------------------------------
/libs/LibFunctional-1.0/LibFunctional-1.0.toc:
--------------------------------------------------------------------------------
1 | ## Interface: 50400
2 | ## Title: Lib: Functional-1.0
3 | ## Notes: Helper functions to enable functional style programming in lua
4 | ## Author: Slaren
5 | ## X-Category: Library
6 | ## X-Curse-Packaged-Version: v1.1-1-g2f57cf3
7 | ## X-Curse-Project-Name: LibFunctional-1.0
8 | ## X-Curse-Project-ID: libfunctional-1-0
9 | ## X-Curse-Repository-ID: wow/libfunctional-1-0/mainline
10 |
11 | Libs\LibStub\LibStub.lua
12 |
13 | lib.xml
14 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/widget.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/libs/DRData-1.0/DRData-1.0.toc:
--------------------------------------------------------------------------------
1 | ## Interface: 40300
2 | ## Title: Lib: Diminishing Returns Data-1.0
3 | ## Notes: Database of Diminishing return categories and general data
4 | ## Author: Mayen
5 | ## X-Category: Library
6 | ## X-Curse-Packaged-Version: v2.7
7 | ## X-Curse-Project-Name: DRData-1.0
8 | ## X-Curse-Project-ID: drdata-1-0
9 | ## X-Curse-Repository-ID: wow/drdata-1-0/mainline
10 |
11 | #@no-lib-strip@
12 | libs\LibStub\LibStub.lua
13 | #@end-no-lib-strip@
14 |
15 | DRData-1.0.xml
16 |
--------------------------------------------------------------------------------
/libs/LibRangeCheck-2.0/LibStub-1.0/LibStub.toc:
--------------------------------------------------------------------------------
1 | ## Interface: 20400
2 | ## Title: Lib: LibStub
3 | ## Notes: Universal Library Stub
4 | ## Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel
5 | ## X-Website: http://jira.wowace.com/browse/LS
6 | ## X-Category: Library
7 | ## X-License: Public Domain
8 | ## X-Curse-Packaged-Version: 1.0
9 | ## X-Curse-Project-Name: LibStub
10 | ## X-Curse-Project-ID: libstub
11 | ## X-Curse-Repository-ID: wow/libstub/mainline
12 |
13 | LibStub.lua
14 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0-SharedMediaWidgets/Libs/LibStub/LibStub.toc:
--------------------------------------------------------------------------------
1 | ## Interface: 20400
2 | ## Title: Lib: LibStub
3 | ## Notes: Universal Library Stub
4 | ## Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel
5 | ## X-Website: http://jira.wowace.com/browse/LS
6 | ## X-Category: Library
7 | ## X-License: Public Domain
8 | ## X-Curse-Packaged-Version: 1.0
9 | ## X-Curse-Project-Name: LibStub
10 | ## X-Curse-Project-ID: libstub
11 | ## X-Curse-Repository-ID: wow/libstub/mainline
12 |
13 | LibStub.lua
14 |
--------------------------------------------------------------------------------
/libs/LibFunctional-1.0/libs/LibStub/LibStub.toc:
--------------------------------------------------------------------------------
1 | ## Interface: 50001
2 | ## Title: Lib: LibStub
3 | ## Notes: Universal Library Stub
4 | ## Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel
5 | ## X-Website: http://www.wowace.com/addons/libstub/
6 | ## X-Category: Library
7 | ## X-License: Public Domain
8 | ## X-Curse-Packaged-Version: 1.0.3-50001
9 | ## X-Curse-Project-Name: LibStub
10 | ## X-Curse-Project-ID: libstub
11 | ## X-Curse-Repository-ID: wow/libstub/mainline
12 |
13 | LibStub.lua
14 |
--------------------------------------------------------------------------------
/libs/AceConfig-3.0/AceConfig-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/libs/LibDispellable-1.0/LibDispellable-1.0.toc:
--------------------------------------------------------------------------------
1 | ## Interface: 40100
2 | ## LoadOnDemand: 1
3 | ## Title: Lib: Dispellable-1.0
4 | ## Version: 1.0
5 | ## X-Date: @project-date@
6 | ## Notes: Test whether the player can really dispell a buff or debuff, given its talents.
7 | ## Author: Adirelle
8 | ## X-Curse-Packaged-Version: 1.0
9 | ## X-Curse-Project-Name: LibDispellable-1.0
10 | ## X-Curse-Project-ID: libdispellable-1-0
11 | ## X-Curse-Repository-ID: wow/libdispellable-1-0/mainline
12 |
13 | LibStub.lua
14 | LibDispellable-1.0.lua
15 |
16 |
--------------------------------------------------------------------------------
/libs/LibDualSpec-1.0/LibDualSpec-1.0.toc:
--------------------------------------------------------------------------------
1 | ## Interface: 50200
2 | ## LoadOnDemand: 1
3 | ## Title: Lib: DualSpec-1.0
4 | ## Version: v1.9
5 | ## X-Date: 2013-03-27T13:46:53Z
6 | ## Notes: Adds dual spec support to individual AceDB-3.0 databases
7 | ## Author: Adirelle
8 | ## OptionalDeps: LibStub, Ace3
9 | ## X-Curse-Packaged-Version: v1.9
10 | ## X-Curse-Project-Name: LibDualSpec-1.0
11 | ## X-Curse-Project-ID: libdualspec-1-0
12 | ## X-Curse-Repository-ID: wow/libdualspec-1-0/mainline
13 |
14 | LibStub.lua
15 | LibDualSpec-1.0.lua
16 |
17 |
--------------------------------------------------------------------------------
/libs/LibDispellable-1.0/README.textile:
--------------------------------------------------------------------------------
1 | LibDispellable-1.0 aims at helping to test if the player can really dispel an enemy buff or a friend debuff.
2 |
3 | The current Blizzard implementation of cureable buff filter ("HARMFUL RAID") does not take talents into account. There is no way to test for buffs the player can dispel on her enemies. LibDispellable-1.0 provides methods to test both defensive, taking care of healer talents for Magic dispel, and offensive dispel, using a comprehensive list of enrage effects.
4 |
5 | See the "API page on wowace.com":http://www.wowace.com/addons/libdispellable-1-0/pages/api/ for usage.
6 |
7 |
--------------------------------------------------------------------------------
/libs/LibRangeCheck-2.0/LibRangeCheck-2.0.toc:
--------------------------------------------------------------------------------
1 | ## Interface: 30300
2 | ## Title: Lib: RangeCheck-2.0
3 | ## Notes: A library to determine estimated range.
4 | ## Author: mitch0
5 | ## Version: 3.5.5
6 | ## LoadOnDemand: 1
7 | ## X-Category: Library
8 | ## X-AceLibrary-LibRangeCheck-2.0: true
9 | ## X-License: Public Domain
10 | ## X-Curse-Packaged-Version: r112
11 | ## X-Curse-Project-Name: LibRangeCheck-2.0
12 | ## X-Curse-Project-ID: librangecheck-2-0
13 | ## X-Curse-Repository-ID: wow/librangecheck-2-0/mainline
14 |
15 | LibStub-1.0\LibStub.lua
16 | CallbackHandler-1.0\CallbackHandler-1.0.xml
17 | LibRangeCheck-2.0\LibRangeCheck-2.0.lua
18 |
--------------------------------------------------------------------------------
/libs/LibStub/tests/test3.lua:
--------------------------------------------------------------------------------
1 | debugstack = debug.traceback
2 | strmatch = string.match
3 |
4 | loadfile("../LibStub.lua")()
5 |
6 | local proxy = newproxy() -- non-string
7 |
8 | assert(not pcall(LibStub.NewLibrary, LibStub, proxy, 1)) -- should error, proxy is not a string, it's userdata
9 | local success, ret = pcall(LibStub.GetLibrary, proxy, true)
10 | assert(not success or not ret) -- either error because proxy is not a string or because it's not actually registered.
11 |
12 | assert(not pcall(LibStub.NewLibrary, LibStub, "Something", "No number in here")) -- should error, minor has no string in it.
13 |
14 | assert(not LibStub:GetLibrary("Something", true)) -- shouldn't've created it from the above statement
--------------------------------------------------------------------------------
/libs/LibFunctional-1.0/libs/LibStub/tests/test3.lua:
--------------------------------------------------------------------------------
1 | debugstack = debug.traceback
2 | strmatch = string.match
3 |
4 | loadfile("../LibStub.lua")()
5 |
6 | local proxy = newproxy() -- non-string
7 |
8 | assert(not pcall(LibStub.NewLibrary, LibStub, proxy, 1)) -- should error, proxy is not a string, it's userdata
9 | local success, ret = pcall(LibStub.GetLibrary, proxy, true)
10 | assert(not success or not ret) -- either error because proxy is not a string or because it's not actually registered.
11 |
12 | assert(not pcall(LibStub.NewLibrary, LibStub, "Something", "No number in here")) -- should error, minor has no string in it.
13 |
14 | assert(not LibStub:GetLibrary("Something", true)) -- shouldn't've created it from the above statement
--------------------------------------------------------------------------------
/libs/LibSharedMedia-3.0/LibSharedMedia-3.0.toc:
--------------------------------------------------------------------------------
1 | ## Interface: 40000
2 | ## LoadOnDemand: 1
3 | ## X-Curse-Packaged-Version: 4
4 | ## X-Curse-Project-Name: LibSharedMedia-3.0
5 | ## X-Curse-Project-ID: libsharedmedia-3-0
6 | ## X-Curse-Repository-ID: wow/libsharedmedia-3-0/mainline
7 |
8 | ## Title: Lib: SharedMedia-3.0
9 | ## Notes: Shared handling of media data (fonts, sounds, textures, ...) between addons.
10 | ## Author: Elkano
11 | ## Version: 3.0-62
12 | ## X-Website: http://www.wowace.com/projects/libsharedmedia-3-0/
13 | ## X-Category: Library
14 |
15 | ## X-Revision: 62
16 | ## X-Date: 2010-10-27T09:05:19Z
17 |
18 | LibStub\LibStub.lua
19 | CallbackHandler-1.0\CallbackHandler-1.0.lua
20 |
21 | LibSharedMedia-3.0\lib.xml
22 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets.toc:
--------------------------------------------------------------------------------
1 | ## Interface: 50300
2 | ## X-Curse-Packaged-Version: r47
3 | ## X-Curse-Project-Name: AceGUI-3.0-SharedMediaWidgets
4 | ## X-Curse-Project-ID: ace-gui-3-0-shared-media-widgets
5 | ## X-Curse-Repository-ID: wow/ace-gui-3-0-shared-media-widgets/mainline
6 |
7 | ## Title: Lib: AceGUI-3.0-SharedMediaWidgets
8 | ## Notes: Enables AceGUI-3.0 widgets for the 5 basic SharedMedia-3.0 types
9 | ## Author: Yssaril
10 | ## OptionalDeps: Ace3, LibSharedMedia-3.0, Libstub, CallbackHandler-1.0
11 | ## X-Category: Library
12 |
13 | #@no-lib-strip@
14 | Libs\Libstub\Libstub.lua
15 | Libs\CallbackHandler-1.0\CallbackHandler-1.0.xml
16 | Libs\AceGUI-3.0\AceGUI-3.0.xml
17 | #@end-no-lib-strip@
18 |
19 | widget.xml
--------------------------------------------------------------------------------
/libs/LibDispellable-1.0/Changelog-LibDispellable-1.0-1.0.txt:
--------------------------------------------------------------------------------
1 | tag 1.0
2 | 672807b247d3c9a3cdfb4131074d2306dfb19c98
3 | Adirelle
4 | 2011-05-03 21:25:05 +0200
5 |
6 | Tagging as 1.0.
7 |
8 |
9 | --------------------
10 |
11 | Adirelle:
12 | - TOC bump.
13 | - Added a method to test enrage by spell IDs: lib:IsEnrageEffect(spellID).
14 | - Have the iterators returns the additional Unit(De)Buff return values.
15 | - Added a parameter to CanDispell to properly handle offensive/defensive dispel tests.
16 | - Removed left-over code.
17 | - Added a README file.
18 | - Use a datamined, comprehensive list of enrage spell IDs instead of names.
19 | - Properly iterate over enrage effects.
20 | - Doc typo.
21 | - Doc updated.
22 | - Minor bump.
23 | - Fixed iterators.
24 | - Typo.
25 | - Fixed the .docmeta file.
26 | - Added support for rage effects.
27 | - Developper version should always be used.
28 | - First version.
29 |
--------------------------------------------------------------------------------
/GladiusEx.toc:
--------------------------------------------------------------------------------
1 | ## Interface: 30300
2 | ## Title: GladiusEx
3 | ## Notes: Arena unit frames
4 | ## SavedVariables: GladiusExDB
5 | ## OptionalDeps: LibStub, LibFunctional-1.0, Ace3, DRData-1.0, LibSharedMedia-3.0, AceTimer3-0, AceGUI-3.0-SharedMediaWidgets, AceGUI-3.0-Spell-EditBox, LibCooldownTracker-1.0, LibDualSpec-1.0, LibRangeCheck-2.0, LibAuraInfo-1.0, LibDispellable-1.0, Clique, ButtonFacade
6 |
7 | embeds.xml
8 |
9 | localization\enUS.lua
10 | localization\locales.lua
11 |
12 | GladiusEx.lua
13 | Data_TBC.lua
14 | Data_WOTLK.lua
15 |
16 | options.lua
17 |
18 | modules\spectate.lua
19 | modules\alerts.lua
20 | modules\announcements.lua
21 | modules\auras.lua
22 | modules\castbar.lua
23 | modules\classicon.lua
24 | modules\clicks.lua
25 | modules\cooldowns.lua
26 | modules\drtracker.lua
27 | modules\healthbar.lua
28 | modules\highlight.lua
29 | modules\powerbar.lua
30 | modules\skill_history.lua
31 | modules\tags.lua
32 | modules\unitbar.lua
33 | modules\targetbar.lua
34 | modules\petbar.lua
35 | modules\interrupts.lua
36 |
--------------------------------------------------------------------------------
/libs/LibStub/tests/test4.lua:
--------------------------------------------------------------------------------
1 | debugstack = debug.traceback
2 | strmatch = string.match
3 |
4 | loadfile("../LibStub.lua")()
5 |
6 |
7 | -- Pretend like loaded libstub is old and doesn't have :IterateLibraries
8 | assert(LibStub.minor)
9 | LibStub.minor = LibStub.minor - 0.0001
10 | LibStub.IterateLibraries = nil
11 |
12 | loadfile("../LibStub.lua")()
13 |
14 | assert(type(LibStub.IterateLibraries)=="function")
15 |
16 |
17 | -- Now pretend that we're the same version -- :IterateLibraries should NOT be re-created
18 | LibStub.IterateLibraries = 123
19 |
20 | loadfile("../LibStub.lua")()
21 |
22 | assert(LibStub.IterateLibraries == 123)
23 |
24 |
25 | -- Now pretend that a newer version is loaded -- :IterateLibraries should NOT be re-created
26 | LibStub.minor = LibStub.minor + 0.0001
27 |
28 | loadfile("../LibStub.lua")()
29 |
30 | assert(LibStub.IterateLibraries == 123)
31 |
32 |
33 | -- Again with a huge number
34 | LibStub.minor = LibStub.minor + 1234567890
35 |
36 | loadfile("../LibStub.lua")()
37 |
38 | assert(LibStub.IterateLibraries == 123)
39 |
40 |
41 | print("OK")
--------------------------------------------------------------------------------
/libs/LibFunctional-1.0/libs/LibStub/tests/test4.lua:
--------------------------------------------------------------------------------
1 | debugstack = debug.traceback
2 | strmatch = string.match
3 |
4 | loadfile("../LibStub.lua")()
5 |
6 |
7 | -- Pretend like loaded libstub is old and doesn't have :IterateLibraries
8 | assert(LibStub.minor)
9 | LibStub.minor = LibStub.minor - 0.0001
10 | LibStub.IterateLibraries = nil
11 |
12 | loadfile("../LibStub.lua")()
13 |
14 | assert(type(LibStub.IterateLibraries)=="function")
15 |
16 |
17 | -- Now pretend that we're the same version -- :IterateLibraries should NOT be re-created
18 | LibStub.IterateLibraries = 123
19 |
20 | loadfile("../LibStub.lua")()
21 |
22 | assert(LibStub.IterateLibraries == 123)
23 |
24 |
25 | -- Now pretend that a newer version is loaded -- :IterateLibraries should NOT be re-created
26 | LibStub.minor = LibStub.minor + 0.0001
27 |
28 | loadfile("../LibStub.lua")()
29 |
30 | assert(LibStub.IterateLibraries == 123)
31 |
32 |
33 | -- Again with a huge number
34 | LibStub.minor = LibStub.minor + 1234567890
35 |
36 | loadfile("../LibStub.lua")()
37 |
38 | assert(LibStub.IterateLibraries == 123)
39 |
40 |
41 | print("OK")
--------------------------------------------------------------------------------
/libs/LibStub/tests/test2.lua:
--------------------------------------------------------------------------------
1 | debugstack = debug.traceback
2 | strmatch = string.match
3 |
4 | loadfile("../LibStub.lua")()
5 |
6 | for major, library in LibStub:IterateLibraries() do
7 | -- check that MyLib doesn't exist yet, by iterating through all the libraries
8 | assert(major ~= "MyLib")
9 | end
10 |
11 | assert(not LibStub:GetLibrary("MyLib", true)) -- check that MyLib doesn't exist yet by direct checking
12 | assert(not pcall(LibStub.GetLibrary, LibStub, "MyLib")) -- don't silently fail, thus it should raise an error.
13 | local lib = LibStub:NewLibrary("MyLib", 1) -- create the lib
14 | assert(lib) -- check it exists
15 | assert(rawequal(LibStub:GetLibrary("MyLib"), lib)) -- verify that :GetLibrary("MyLib") properly equals the lib reference
16 |
17 | assert(LibStub:NewLibrary("MyLib", 2)) -- create a new version
18 |
19 | local count=0
20 | for major, library in LibStub:IterateLibraries() do
21 | -- check that MyLib exists somewhere in the libraries, by iterating through all the libraries
22 | if major == "MyLib" then -- we found it!
23 | count = count +1
24 | assert(rawequal(library, lib)) -- verify that the references are equal
25 | end
26 | end
27 | assert(count == 1) -- verify that we actually found it, and only once
28 |
--------------------------------------------------------------------------------
/libs/LibFunctional-1.0/libs/LibStub/tests/test2.lua:
--------------------------------------------------------------------------------
1 | debugstack = debug.traceback
2 | strmatch = string.match
3 |
4 | loadfile("../LibStub.lua")()
5 |
6 | for major, library in LibStub:IterateLibraries() do
7 | -- check that MyLib doesn't exist yet, by iterating through all the libraries
8 | assert(major ~= "MyLib")
9 | end
10 |
11 | assert(not LibStub:GetLibrary("MyLib", true)) -- check that MyLib doesn't exist yet by direct checking
12 | assert(not pcall(LibStub.GetLibrary, LibStub, "MyLib")) -- don't silently fail, thus it should raise an error.
13 | local lib = LibStub:NewLibrary("MyLib", 1) -- create the lib
14 | assert(lib) -- check it exists
15 | assert(rawequal(LibStub:GetLibrary("MyLib"), lib)) -- verify that :GetLibrary("MyLib") properly equals the lib reference
16 |
17 | assert(LibStub:NewLibrary("MyLib", 2)) -- create a new version
18 |
19 | local count=0
20 | for major, library in LibStub:IterateLibraries() do
21 | -- check that MyLib exists somewhere in the libraries, by iterating through all the libraries
22 | if major == "MyLib" then -- we found it!
23 | count = count +1
24 | assert(rawequal(library, lib)) -- verify that the references are equal
25 | end
26 | end
27 | assert(count == 1) -- verify that we actually found it, and only once
28 |
--------------------------------------------------------------------------------
/libs/Changelog-Ace3-Release-r1041.txt:
--------------------------------------------------------------------------------
1 | ------------------------------------------------------------------------
2 | r1043 | nevcairiel | 2011-11-29 16:38:43 +0000 (Tue, 29 Nov 2011) | 1 line
3 | Changed paths:
4 | A /tags/Release-r1041 (from /trunk:1042)
5 |
6 | Tag Release-r1041 for WoW 4.3
7 | ------------------------------------------------------------------------
8 | r1042 | nevcairiel | 2011-11-29 16:36:50 +0000 (Tue, 29 Nov 2011) | 1 line
9 | Changed paths:
10 | M /trunk/changelog.txt
11 |
12 | Update changelog
13 | ------------------------------------------------------------------------
14 | r1041 | nevcairiel | 2011-11-29 16:24:56 +0000 (Tue, 29 Nov 2011) | 1 line
15 | Changed paths:
16 | M /trunk/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua
17 |
18 | AceGUI-3.0: Frame: Add :EnableResize (Ticket #214)
19 | ------------------------------------------------------------------------
20 | r1040 | nevcairiel | 2011-11-29 16:20:28 +0000 (Tue, 29 Nov 2011) | 1 line
21 | Changed paths:
22 | M /trunk/Ace3.toc
23 |
24 | Bump .toc for 4.3
25 | ------------------------------------------------------------------------
26 | r1039 | mikk | 2011-10-03 01:42:11 +0000 (Mon, 03 Oct 2011) | 1 line
27 | Changed paths:
28 | M /trunk/tests/AceSerializer-3.0.lua
29 |
30 | Tests for AceSerializer-3.0 r4 (no more NaN support)
31 | ------------------------------------------------------------------------
32 |
--------------------------------------------------------------------------------
/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(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/LibDispellable-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/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/LibSharedMedia-3.0/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(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/LibRangeCheck-2.0/LibStub-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/AceGUI-3.0-SharedMediaWidgets/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(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 |
--------------------------------------------------------------------------------
/modules/targetbar.lua:
--------------------------------------------------------------------------------
1 | local GladiusEx = _G.GladiusEx
2 | local L = LibStub("AceLocale-3.0"):GetLocale("GladiusEx")
3 | local fn = LibStub("LibFunctional-1.0")
4 |
5 | local defaults = {
6 | OffsetX = 0,
7 | OffsetY = 0,
8 | Height = 20,
9 | Width = 100,
10 | Inverse = false,
11 | Color = { r = 1, g = 1, b = 1, a = 1 },
12 | ClassColor = true,
13 | BackgroundColor = { r = 1, g = 1, b = 1, a = 0.3 },
14 | GlobalTexture = true,
15 | Texture = GladiusEx.default_bar_texture,
16 | Icon = true,
17 | IconCrop = true,
18 | }
19 |
20 | local TargetBar = GladiusEx:NewUnitBarModule("TargetBar",
21 | fn.merge(defaults, {
22 | AttachTo = "Frame",
23 | RelativePoint = "TOPLEFT",
24 | Anchor = "BOTTOMLEFT",
25 | IconPosition = "LEFT",
26 | }),
27 | fn.merge(defaults, {
28 | AttachTo = "Frame",
29 | RelativePoint = "TOPRIGHT",
30 | Anchor = "BOTTOMRIGHT",
31 | IconPosition = "RIGHT",
32 | }))
33 |
34 | function TargetBar:GetFrameUnit(unit)
35 | if unit == "player" then
36 | return "target", false
37 | else
38 | return unit .. "target", true
39 | end
40 | end
41 |
42 | function TargetBar:RegisterCustomEvents()
43 | self:RegisterEvent("UNIT_TARGET")
44 | self:RegisterEvent("PLAYER_TARGET_CHANGED", function() self:UNIT_TARGET("PLAYER_TARGET_CHANGED", "player") end)
45 | end
46 |
47 | function TargetBar:UNIT_TARGET(event, unit)
48 | if self.frame[unit] then
49 | self:Refresh(unit)
50 | end
51 | end
52 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0/AceGUI-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/AceGUI-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/embeds.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/modules/petbar.lua:
--------------------------------------------------------------------------------
1 | local GladiusEx = _G.GladiusEx
2 | local L = LibStub("AceLocale-3.0"):GetLocale("GladiusEx")
3 | local fn = LibStub("LibFunctional-1.0")
4 |
5 | local defaults = {
6 | OffsetX = 0,
7 | OffsetY = 0,
8 | Height = 20,
9 | Width = 100,
10 | Inverse = false,
11 | Color = { r = 0, g = 1, b = 0, a = 1 },
12 | ClassColor = false,
13 | BackgroundColor = { r = 1, g = 1, b = 1, a = 0.3 },
14 | GlobalTexture = true,
15 | Texture = GladiusEx.default_bar_texture,
16 | Icon = false,
17 | IconCrop = true,
18 | }
19 |
20 | local PetBar = GladiusEx:NewUnitBarModule("PetBar",
21 | fn.merge(defaults, {
22 | AttachTo = "Frame",
23 | RelativePoint = "TOPRIGHT",
24 | Anchor = "BOTTOMRIGHT",
25 | IconPosition = "RIGHT",
26 | }),
27 | fn.merge(defaults, {
28 | AttachTo = "Frame",
29 | RelativePoint = "TOPLEFT",
30 | Anchor = "BOTTOMLEFT",
31 | IconPosition = "LEFT",
32 | }))
33 |
34 | function PetBar:GetFrameUnit(unit)
35 | if unit == "player" then
36 | return "pet", false
37 | else
38 | local utype, n = strmatch(unit, "^(%a+)(%d+)$")
39 | return utype .. "pet" .. n, false
40 | end
41 | end
42 |
43 | function PetBar:RegisterCustomEvents()
44 | self:RegisterEvent("UNIT_PET")
45 | -- self:RegisterEvent("PLAYER_TARGET_CHANGED", function() self:UNIT_TARGET("PLAYER_TARGET_CHANGED", "player") end)
46 | end
47 |
48 | function PetBar:UNIT_PET(event, unit)
49 | if self.frame[unit] then
50 | self:Refresh(unit)
51 | end
52 | end
53 |
54 | function PetBar:UNIT_HEALTH_PET(event, unit)
55 | if self.frame[unit] then
56 | self:Refresh(unit)
57 | end
58 | end
59 |
--------------------------------------------------------------------------------
/libs/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2007, Ace3 Development Team
2 |
3 | All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | * Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 | * Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 | * Redistribution of a stand alone version is strictly prohibited without
14 | prior written authorization from the Lead of the Ace3 Development Team.
15 | * Neither the name of the Ace3 Development Team nor the names of its contributors
16 | may be used to endorse or promote products derived from this software without
17 | specific prior written permission.
18 |
19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
23 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # GladiusEx - WotLK
2 |
3 | The famous (and imo, far superior) arena frame AddOn GladiusEx - now for WotLK 3.3.5!
4 |
5 | The AddOn will not work on Classic WotLK, it will only work on the original WotLK client.
6 |
7 | # Installing
8 |
9 | To download the addon, go to the [release page](https://github.com/ManneN1/GladiusEx-WotLK/releases/) and download the latest version as a zip file. Unzip it.
10 |
11 | *Note: If you're daring, download the pre-release version and provide feedback.*
12 |
13 | The Addon is to be placed in /Interface/AddOns (relative the WoW root folder).
14 |
15 | **Do not use the Code -> Download ZIP - it will not work. It's only for developers who know how to use git submodules.**
16 |
17 | # Notes
18 |
19 | If you find a bug, feel free to report it as an [issue](https://github.com/ManneN1/GladiusEx-WotLK/issues). Don't expect immediate fixes, and some proposals will be rejected (GladiusEx is an arena AddOn, not a complete unitframe replacement AddOn).
20 |
21 | Supports spectating based on [ArenaSpectator](https://github.com/azerothcore/azerothcore-wotlk/blob/master/src/server/game/ArenaSpectator/ArenaSpectator.cpp) (or variants thereof) which is available on some servers. Don't expect it to be perfect.
22 |
23 | The "Incoming" Absorb/Heal portion of the healthbar module has been removed as the underlying API is non-existent in WotLK.
24 |
25 | The "Cooldowns" module is only in beta mode. It works, but some abilities might be missing / having an incorrect spell ID (thus not working) / have an incorrect CD / be missing some conditional. Feel free to [report](https://github.com/ManneN1/LibCooldownTracker-1.0-3.3.5/issues) specific improvements that can be done, or create a pull request in [LibCooldownTracker-1.0 (3.3.5)](https://github.com/ManneN1/LibCooldownTracker-1.0-3.3.5/pulls).
26 |
27 | # Screenshots
28 |
29 | 
30 |
31 |
--------------------------------------------------------------------------------
/libs/LibStub/tests/test.lua:
--------------------------------------------------------------------------------
1 | debugstack = debug.traceback
2 | strmatch = string.match
3 |
4 | loadfile("../LibStub.lua")()
5 |
6 | local lib, oldMinor = LibStub:NewLibrary("Pants", 1) -- make a new thingy
7 | assert(lib) -- should return the library table
8 | assert(not oldMinor) -- should not return the old minor, since it didn't exist
9 |
10 | -- the following is to create data and then be able to check if the same data exists after the fact
11 | function lib:MyMethod()
12 | end
13 | local MyMethod = lib.MyMethod
14 | lib.MyTable = {}
15 | local MyTable = lib.MyTable
16 |
17 | local newLib, newOldMinor = LibStub:NewLibrary("Pants", 1) -- try to register a library with the same version, should silently fail
18 | assert(not newLib) -- should not return since out of date
19 |
20 | local newLib, newOldMinor = LibStub:NewLibrary("Pants", 0) -- try to register a library with a previous, should silently fail
21 | assert(not newLib) -- should not return since out of date
22 |
23 | local newLib, newOldMinor = LibStub:NewLibrary("Pants", 2) -- register a new version
24 | assert(newLib) -- library table
25 | assert(rawequal(newLib, lib)) -- should be the same reference as the previous
26 | assert(newOldMinor == 1) -- should return the minor version of the previous version
27 |
28 | assert(rawequal(lib.MyMethod, MyMethod)) -- verify that values were saved
29 | assert(rawequal(lib.MyTable, MyTable)) -- verify that values were saved
30 |
31 | local newLib, newOldMinor = LibStub:NewLibrary("Pants", "Blah 3 Blah") -- register a new version with a string minor version (instead of a number)
32 | assert(newLib) -- library table
33 | assert(newOldMinor == 2) -- previous version was 2
34 |
35 | local newLib, newOldMinor = LibStub:NewLibrary("Pants", "Blah 4 and please ignore 15 Blah") -- register a new version with a string minor version (instead of a number)
36 | assert(newLib)
37 | assert(newOldMinor == 3) -- previous version was 3 (even though it gave a string)
38 |
39 | local newLib, newOldMinor = LibStub:NewLibrary("Pants", 5) -- register a new library, using a normal number instead of a string
40 | assert(newLib)
41 | assert(newOldMinor == 4) -- previous version was 4 (even though it gave a string)
--------------------------------------------------------------------------------
/libs/LibFunctional-1.0/libs/LibStub/tests/test.lua:
--------------------------------------------------------------------------------
1 | debugstack = debug.traceback
2 | strmatch = string.match
3 |
4 | loadfile("../LibStub.lua")()
5 |
6 | local lib, oldMinor = LibStub:NewLibrary("Pants", 1) -- make a new thingy
7 | assert(lib) -- should return the library table
8 | assert(not oldMinor) -- should not return the old minor, since it didn't exist
9 |
10 | -- the following is to create data and then be able to check if the same data exists after the fact
11 | function lib:MyMethod()
12 | end
13 | local MyMethod = lib.MyMethod
14 | lib.MyTable = {}
15 | local MyTable = lib.MyTable
16 |
17 | local newLib, newOldMinor = LibStub:NewLibrary("Pants", 1) -- try to register a library with the same version, should silently fail
18 | assert(not newLib) -- should not return since out of date
19 |
20 | local newLib, newOldMinor = LibStub:NewLibrary("Pants", 0) -- try to register a library with a previous, should silently fail
21 | assert(not newLib) -- should not return since out of date
22 |
23 | local newLib, newOldMinor = LibStub:NewLibrary("Pants", 2) -- register a new version
24 | assert(newLib) -- library table
25 | assert(rawequal(newLib, lib)) -- should be the same reference as the previous
26 | assert(newOldMinor == 1) -- should return the minor version of the previous version
27 |
28 | assert(rawequal(lib.MyMethod, MyMethod)) -- verify that values were saved
29 | assert(rawequal(lib.MyTable, MyTable)) -- verify that values were saved
30 |
31 | local newLib, newOldMinor = LibStub:NewLibrary("Pants", "Blah 3 Blah") -- register a new version with a string minor version (instead of a number)
32 | assert(newLib) -- library table
33 | assert(newOldMinor == 2) -- previous version was 2
34 |
35 | local newLib, newOldMinor = LibStub:NewLibrary("Pants", "Blah 4 and please ignore 15 Blah") -- register a new version with a string minor version (instead of a number)
36 | assert(newLib)
37 | assert(newOldMinor == 3) -- previous version was 3 (even though it gave a string)
38 |
39 | local newLib, newOldMinor = LibStub:NewLibrary("Pants", 5) -- register a new library, using a normal number instead of a string
40 | assert(newLib)
41 | assert(newOldMinor == 4) -- previous version was 4 (even though it gave a string)
--------------------------------------------------------------------------------
/libs/AceGUI-3.0/widgets/AceGUIContainer-SimpleGroup.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | SimpleGroup Container
3 | Simple container widget that just groups widgets.
4 | -------------------------------------------------------------------------------]]
5 | local Type, Version = "SimpleGroup", 20
6 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
7 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
8 |
9 | -- Lua APIs
10 | local pairs = pairs
11 |
12 | -- WoW APIs
13 | local CreateFrame, UIParent = CreateFrame, UIParent
14 |
15 |
16 | --[[-----------------------------------------------------------------------------
17 | Methods
18 | -------------------------------------------------------------------------------]]
19 | local methods = {
20 | ["OnAcquire"] = function(self)
21 | self:SetWidth(300)
22 | self:SetHeight(100)
23 | end,
24 |
25 | -- ["OnRelease"] = nil,
26 |
27 | ["LayoutFinished"] = function(self, width, height)
28 | if self.noAutoHeight then return end
29 | self:SetHeight(height or 0)
30 | end,
31 |
32 | ["OnWidthSet"] = function(self, width)
33 | local content = self.content
34 | content:SetWidth(width)
35 | content.width = width
36 | end,
37 |
38 | ["OnHeightSet"] = function(self, height)
39 | local content = self.content
40 | content:SetHeight(height)
41 | content.height = height
42 | end
43 | }
44 |
45 | --[[-----------------------------------------------------------------------------
46 | Constructor
47 | -------------------------------------------------------------------------------]]
48 | local function Constructor()
49 | local frame = CreateFrame("Frame", nil, UIParent)
50 | frame:SetFrameStrata("FULLSCREEN_DIALOG")
51 |
52 | --Container Support
53 | local content = CreateFrame("Frame", nil, frame)
54 | content:SetPoint("TOPLEFT")
55 | content:SetPoint("BOTTOMRIGHT")
56 |
57 | local widget = {
58 | frame = frame,
59 | content = content,
60 | type = Type
61 | }
62 | for method, func in pairs(methods) do
63 | widget[method] = func
64 | end
65 |
66 | return AceGUI:RegisterAsContainer(widget)
67 | end
68 |
69 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
70 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIContainer-SimpleGroup.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | SimpleGroup Container
3 | Simple container widget that just groups widgets.
4 | -------------------------------------------------------------------------------]]
5 | local Type, Version = "SimpleGroup", 20
6 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
7 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
8 |
9 | -- Lua APIs
10 | local pairs = pairs
11 |
12 | -- WoW APIs
13 | local CreateFrame, UIParent = CreateFrame, UIParent
14 |
15 |
16 | --[[-----------------------------------------------------------------------------
17 | Methods
18 | -------------------------------------------------------------------------------]]
19 | local methods = {
20 | ["OnAcquire"] = function(self)
21 | self:SetWidth(300)
22 | self:SetHeight(100)
23 | end,
24 |
25 | -- ["OnRelease"] = nil,
26 |
27 | ["LayoutFinished"] = function(self, width, height)
28 | if self.noAutoHeight then return end
29 | self:SetHeight(height or 0)
30 | end,
31 |
32 | ["OnWidthSet"] = function(self, width)
33 | local content = self.content
34 | content:SetWidth(width)
35 | content.width = width
36 | end,
37 |
38 | ["OnHeightSet"] = function(self, height)
39 | local content = self.content
40 | content:SetHeight(height)
41 | content.height = height
42 | end
43 | }
44 |
45 | --[[-----------------------------------------------------------------------------
46 | Constructor
47 | -------------------------------------------------------------------------------]]
48 | local function Constructor()
49 | local frame = CreateFrame("Frame", nil, UIParent)
50 | frame:SetFrameStrata("FULLSCREEN_DIALOG")
51 |
52 | --Container Support
53 | local content = CreateFrame("Frame", nil, frame)
54 | content:SetPoint("TOPLEFT")
55 | content:SetPoint("BOTTOMRIGHT")
56 |
57 | local widget = {
58 | frame = frame,
59 | content = content,
60 | type = Type
61 | }
62 | for method, func in pairs(methods) do
63 | widget[method] = func
64 | end
65 |
66 | return AceGUI:RegisterAsContainer(widget)
67 | end
68 |
69 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
70 |
--------------------------------------------------------------------------------
/libs/LibFunctional-1.0/libs/LibStub/LibStub.lua:
--------------------------------------------------------------------------------
1 | -- $Id: LibStub.lua 76 2007-09-03 01:50:17Z mikk $
2 | -- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
3 | -- LibStub is hereby placed in the Public Domain
4 | -- Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
5 | local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
6 | local LibStub = _G[LIBSTUB_MAJOR]
7 |
8 | -- Check to see is this version of the stub is obsolete
9 | if not LibStub or LibStub.minor < LIBSTUB_MINOR then
10 | LibStub = LibStub or {libs = {}, minors = {} }
11 | _G[LIBSTUB_MAJOR] = LibStub
12 | LibStub.minor = LIBSTUB_MINOR
13 |
14 | -- LibStub:NewLibrary(major, minor)
15 | -- major (string) - the major version of the library
16 | -- minor (string or number ) - the minor version of the library
17 | --
18 | -- returns nil if a newer or same version of the lib is already present
19 | -- returns empty library object or old library object if upgrade is needed
20 | function LibStub:NewLibrary(major, minor)
21 | assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
22 | minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
23 |
24 | local oldminor = self.minors[major]
25 | if oldminor and oldminor >= minor then return nil end
26 | self.minors[major], self.libs[major] = minor, self.libs[major] or {}
27 | return self.libs[major], oldminor
28 | end
29 |
30 | -- LibStub:GetLibrary(major, [silent])
31 | -- major (string) - the major version of the library
32 | -- silent (boolean) - if true, library is optional, silently return nil if its not found
33 | --
34 | -- throws an error if the library can not be found (except silent is set)
35 | -- returns the library object if found
36 | function LibStub:GetLibrary(major, silent)
37 | if not self.libs[major] and not silent then
38 | error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
39 | end
40 | return self.libs[major], self.minors[major]
41 | end
42 |
43 | -- LibStub:IterateLibraries()
44 | --
45 | -- Returns an iterator for the currently registered libraries
46 | function LibStub:IterateLibraries()
47 | return pairs(self.libs)
48 | end
49 |
50 | setmetatable(LibStub, { __call = LibStub.GetLibrary })
51 | end
52 |
--------------------------------------------------------------------------------
/libs/AceConfig-3.0/AceConfig-3.0.lua:
--------------------------------------------------------------------------------
1 | --- AceConfig-3.0 wrapper library.
2 | -- Provides an API to register an options table with the config registry,
3 | -- as well as associate it with a slash command.
4 | -- @class file
5 | -- @name AceConfig-3.0
6 | -- @release $Id: AceConfig-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
7 |
8 | --[[
9 | AceConfig-3.0
10 |
11 | Very light wrapper library that combines all the AceConfig subcomponents into one more easily used whole.
12 |
13 | ]]
14 |
15 | local cfgreg = LibStub("AceConfigRegistry-3.0")
16 | local cfgcmd = LibStub("AceConfigCmd-3.0")
17 |
18 | local MAJOR, MINOR = "AceConfig-3.0", 3
19 | local AceConfig = LibStub:NewLibrary(MAJOR, MINOR)
20 |
21 | if not AceConfig then return end
22 |
23 | --TODO: local cfgdlg = LibStub("AceConfigDialog-3.0", true)
24 | --TODO: local cfgdrp = LibStub("AceConfigDropdown-3.0", true)
25 |
26 | -- Lua APIs
27 | local pcall, error, type, pairs = pcall, error, type, pairs
28 |
29 | -- -------------------------------------------------------------------
30 | -- :RegisterOptionsTable(appName, options, slashcmd, persist)
31 | --
32 | -- - appName - (string) application name
33 | -- - options - table or function ref, see AceConfigRegistry
34 | -- - slashcmd - slash command (string) or table with commands, or nil to NOT create a slash command
35 |
36 | --- Register a option table with the AceConfig registry.
37 | -- You can supply a slash command (or a table of slash commands) to register with AceConfigCmd directly.
38 | -- @paramsig appName, options [, slashcmd]
39 | -- @param appName The application name for the config table.
40 | -- @param options The option table (or a function to generate one on demand). http://www.wowace.com/addons/ace3/pages/ace-config-3-0-options-tables/
41 | -- @param slashcmd A slash command to register for the option table, or a table of slash commands.
42 | -- @usage
43 | -- local AceConfig = LibStub("AceConfig-3.0")
44 | -- AceConfig:RegisterOptionsTable("MyAddon", myOptions, {"/myslash", "/my"})
45 | function AceConfig:RegisterOptionsTable(appName, options, slashcmd)
46 | local ok,msg = pcall(cfgreg.RegisterOptionsTable, self, appName, options)
47 | if not ok then error(msg, 2) end
48 |
49 | if slashcmd then
50 | if type(slashcmd) == "table" then
51 | for _,cmd in pairs(slashcmd) do
52 | cfgcmd:CreateChatCommand(cmd, appName)
53 | end
54 | else
55 | cfgcmd:CreateChatCommand(slashcmd, appName)
56 | end
57 | end
58 | end
59 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | Heading Widget
3 | -------------------------------------------------------------------------------]]
4 | local Type, Version = "Heading", 20
5 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
6 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
7 |
8 | -- Lua APIs
9 | local pairs = pairs
10 |
11 | -- WoW APIs
12 | local CreateFrame, UIParent = CreateFrame, UIParent
13 |
14 | --[[-----------------------------------------------------------------------------
15 | Methods
16 | -------------------------------------------------------------------------------]]
17 | local methods = {
18 | ["OnAcquire"] = function(self)
19 | self:SetText()
20 | self:SetFullWidth()
21 | self:SetHeight(18)
22 | end,
23 |
24 | -- ["OnRelease"] = nil,
25 |
26 | ["SetText"] = function(self, text)
27 | self.label:SetText(text or "")
28 | if text and text ~= "" then
29 | self.left:SetPoint("RIGHT", self.label, "LEFT", -5, 0)
30 | self.right:Show()
31 | else
32 | self.left:SetPoint("RIGHT", -3, 0)
33 | self.right:Hide()
34 | end
35 | end
36 | }
37 |
38 | --[[-----------------------------------------------------------------------------
39 | Constructor
40 | -------------------------------------------------------------------------------]]
41 | local function Constructor()
42 | local frame = CreateFrame("Frame", nil, UIParent)
43 | frame:Hide()
44 |
45 | local label = frame:CreateFontString(nil, "BACKGROUND", "GameFontNormal")
46 | label:SetPoint("TOP")
47 | label:SetPoint("BOTTOM")
48 | label:SetJustifyH("CENTER")
49 |
50 | local left = frame:CreateTexture(nil, "BACKGROUND")
51 | left:SetHeight(8)
52 | left:SetPoint("LEFT", 3, 0)
53 | left:SetPoint("RIGHT", label, "LEFT", -5, 0)
54 | left:SetTexture("Interface\\Tooltips\\UI-Tooltip-Border")
55 | left:SetTexCoord(0.81, 0.94, 0.5, 1)
56 |
57 | local right = frame:CreateTexture(nil, "BACKGROUND")
58 | right:SetHeight(8)
59 | right:SetPoint("RIGHT", -3, 0)
60 | right:SetPoint("LEFT", label, "RIGHT", 5, 0)
61 | right:SetTexture("Interface\\Tooltips\\UI-Tooltip-Border")
62 | right:SetTexCoord(0.81, 0.94, 0.5, 1)
63 |
64 | local widget = {
65 | label = label,
66 | left = left,
67 | right = right,
68 | frame = frame,
69 | type = Type
70 | }
71 | for method, func in pairs(methods) do
72 | widget[method] = func
73 | end
74 |
75 | return AceGUI:RegisterAsWidget(widget)
76 | end
77 |
78 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
79 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | Heading Widget
3 | -------------------------------------------------------------------------------]]
4 | local Type, Version = "Heading", 20
5 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
6 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
7 |
8 | -- Lua APIs
9 | local pairs = pairs
10 |
11 | -- WoW APIs
12 | local CreateFrame, UIParent = CreateFrame, UIParent
13 |
14 | --[[-----------------------------------------------------------------------------
15 | Methods
16 | -------------------------------------------------------------------------------]]
17 | local methods = {
18 | ["OnAcquire"] = function(self)
19 | self:SetText()
20 | self:SetFullWidth()
21 | self:SetHeight(18)
22 | end,
23 |
24 | -- ["OnRelease"] = nil,
25 |
26 | ["SetText"] = function(self, text)
27 | self.label:SetText(text or "")
28 | if text and text ~= "" then
29 | self.left:SetPoint("RIGHT", self.label, "LEFT", -5, 0)
30 | self.right:Show()
31 | else
32 | self.left:SetPoint("RIGHT", -3, 0)
33 | self.right:Hide()
34 | end
35 | end
36 | }
37 |
38 | --[[-----------------------------------------------------------------------------
39 | Constructor
40 | -------------------------------------------------------------------------------]]
41 | local function Constructor()
42 | local frame = CreateFrame("Frame", nil, UIParent)
43 | frame:Hide()
44 |
45 | local label = frame:CreateFontString(nil, "BACKGROUND", "GameFontNormal")
46 | label:SetPoint("TOP")
47 | label:SetPoint("BOTTOM")
48 | label:SetJustifyH("CENTER")
49 |
50 | local left = frame:CreateTexture(nil, "BACKGROUND")
51 | left:SetHeight(8)
52 | left:SetPoint("LEFT", 3, 0)
53 | left:SetPoint("RIGHT", label, "LEFT", -5, 0)
54 | left:SetTexture("Interface\\Tooltips\\UI-Tooltip-Border")
55 | left:SetTexCoord(0.81, 0.94, 0.5, 1)
56 |
57 | local right = frame:CreateTexture(nil, "BACKGROUND")
58 | right:SetHeight(8)
59 | right:SetPoint("RIGHT", -3, 0)
60 | right:SetPoint("LEFT", label, "RIGHT", 5, 0)
61 | right:SetTexture("Interface\\Tooltips\\UI-Tooltip-Border")
62 | right:SetTexCoord(0.81, 0.94, 0.5, 1)
63 |
64 | local widget = {
65 | label = label,
66 | left = left,
67 | right = right,
68 | frame = frame,
69 | type = Type
70 | }
71 | for method, func in pairs(methods) do
72 | widget[method] = func
73 | end
74 |
75 | return AceGUI:RegisterAsWidget(widget)
76 | end
77 |
78 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
79 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | InteractiveLabel Widget
3 | -------------------------------------------------------------------------------]]
4 | local Type, Version = "InteractiveLabel", 21
5 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
6 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
7 |
8 | -- Lua APIs
9 | local select, pairs = select, pairs
10 |
11 | --[[-----------------------------------------------------------------------------
12 | Scripts
13 | -------------------------------------------------------------------------------]]
14 | local function Control_OnEnter(frame)
15 | frame.obj:Fire("OnEnter")
16 | end
17 |
18 | local function Control_OnLeave(frame)
19 | frame.obj:Fire("OnLeave")
20 | end
21 |
22 | local function Label_OnClick(frame, button)
23 | frame.obj:Fire("OnClick", button)
24 | AceGUI:ClearFocus()
25 | end
26 |
27 | --[[-----------------------------------------------------------------------------
28 | Methods
29 | -------------------------------------------------------------------------------]]
30 | local methods = {
31 | ["OnAcquire"] = function(self)
32 | self:LabelOnAcquire()
33 | self:SetHighlight()
34 | self:SetHighlightTexCoord()
35 | self:SetDisabled(false)
36 | end,
37 |
38 | -- ["OnRelease"] = nil,
39 |
40 | ["SetHighlight"] = function(self, ...)
41 | self.highlight:SetTexture(...)
42 | end,
43 |
44 | ["SetHighlightTexCoord"] = function(self, ...)
45 | local c = select("#", ...)
46 | if c == 4 or c == 8 then
47 | self.highlight:SetTexCoord(...)
48 | else
49 | self.highlight:SetTexCoord(0, 1, 0, 1)
50 | end
51 | end,
52 |
53 | ["SetDisabled"] = function(self,disabled)
54 | self.disabled = disabled
55 | if disabled then
56 | self.frame:EnableMouse(false)
57 | self.label:SetTextColor(0.5, 0.5, 0.5)
58 | else
59 | self.frame:EnableMouse(true)
60 | self.label:SetTextColor(1, 1, 1)
61 | end
62 | end
63 | }
64 |
65 | --[[-----------------------------------------------------------------------------
66 | Constructor
67 | -------------------------------------------------------------------------------]]
68 | local function Constructor()
69 | -- create a Label type that we will hijack
70 | local label = AceGUI:Create("Label")
71 |
72 | local frame = label.frame
73 | frame:EnableMouse(true)
74 | frame:SetScript("OnEnter", Control_OnEnter)
75 | frame:SetScript("OnLeave", Control_OnLeave)
76 | frame:SetScript("OnMouseDown", Label_OnClick)
77 |
78 | local highlight = frame:CreateTexture(nil, "HIGHLIGHT")
79 | highlight:SetTexture(nil)
80 | highlight:SetAllPoints()
81 | highlight:SetBlendMode("ADD")
82 |
83 | label.highlight = highlight
84 | label.type = Type
85 | label.LabelOnAcquire = label.OnAcquire
86 | for method, func in pairs(methods) do
87 | label[method] = func
88 | end
89 |
90 | return label
91 | end
92 |
93 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
94 |
95 |
--------------------------------------------------------------------------------
/libs/LibRangeCheck-2.0/Changelog-LibRangeCheck-2.0-r112.txt:
--------------------------------------------------------------------------------
1 | ------------------------------------------------------------------------
2 | r112 | mitch0 | 2010-10-16 22:49:00 +0000 (Sat, 16 Oct 2010) | 1 line
3 | Changed paths:
4 | M /trunk/LibRangeCheck-2.0/LibRangeCheck-2.0.lua
5 |
6 | DK spells
7 | ------------------------------------------------------------------------
8 | r111 | mitch0 | 2010-10-16 22:05:28 +0000 (Sat, 16 Oct 2010) | 1 line
9 | Changed paths:
10 | M /trunk/LibRangeCheck-2.0/LibRangeCheck-2.0.lua
11 |
12 | warrior spells
13 | ------------------------------------------------------------------------
14 | r110 | mitch0 | 2010-10-16 21:49:14 +0000 (Sat, 16 Oct 2010) | 1 line
15 | Changed paths:
16 | M /trunk/LibRangeCheck-2.0/LibRangeCheck-2.0.lua
17 |
18 | warlock spells
19 | ------------------------------------------------------------------------
20 | r109 | mitch0 | 2010-10-16 21:25:24 +0000 (Sat, 16 Oct 2010) | 1 line
21 | Changed paths:
22 | M /trunk/LibRangeCheck-2.0/LibRangeCheck-2.0.lua
23 |
24 | shaman spells
25 | ------------------------------------------------------------------------
26 | r108 | mitch0 | 2010-10-16 21:05:42 +0000 (Sat, 16 Oct 2010) | 1 line
27 | Changed paths:
28 | M /trunk/LibRangeCheck-2.0/LibRangeCheck-2.0.lua
29 |
30 | rogue spells, pick pocket and ambush are commented out, must check if they work always or only while stealthed
31 | ------------------------------------------------------------------------
32 | r107 | mitch0 | 2010-10-16 20:45:21 +0000 (Sat, 16 Oct 2010) | 1 line
33 | Changed paths:
34 | M /trunk/LibRangeCheck-2.0/LibRangeCheck-2.0.lua
35 |
36 | priest spells
37 | ------------------------------------------------------------------------
38 | r106 | mitch0 | 2010-10-16 20:22:46 +0000 (Sat, 16 Oct 2010) | 1 line
39 | Changed paths:
40 | M /trunk/LibRangeCheck-2.0/LibRangeCheck-2.0.lua
41 |
42 | paladin spells
43 | ------------------------------------------------------------------------
44 | r105 | mitch0 | 2010-10-16 19:19:40 +0000 (Sat, 16 Oct 2010) | 1 line
45 | Changed paths:
46 | M /trunk/LibRangeCheck-2.0/LibRangeCheck-2.0.lua
47 |
48 | mage spells
49 | ------------------------------------------------------------------------
50 | r104 | mitch0 | 2010-10-16 18:45:50 +0000 (Sat, 16 Oct 2010) | 1 line
51 | Changed paths:
52 | M /trunk/LibRangeCheck-2.0/LibRangeCheck-2.0.lua
53 |
54 | hunter spells cleanup
55 | ------------------------------------------------------------------------
56 | r103 | mitch0 | 2010-10-14 09:24:46 +0000 (Thu, 14 Oct 2010) | 1 line
57 | Changed paths:
58 | M /trunk/LibRangeCheck-2.0/LibRangeCheck-2.0.lua
59 |
60 | druid spells updated
61 | ------------------------------------------------------------------------
62 | r102 | mitch0 | 2010-09-03 14:47:24 +0000 (Fri, 03 Sep 2010) | 1 line
63 | Changed paths:
64 | M /trunk/LibRangeCheck-2.0/LibRangeCheck-2.0.lua
65 |
66 | use GetSpellBookItemName instead of GetSpellName if that's not available (cata fix)
67 | ------------------------------------------------------------------------
68 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0/widgets/AceGUIWidget-Button.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | Button Widget
3 | Graphical Button.
4 | -------------------------------------------------------------------------------]]
5 | local Type, Version = "Button", 23
6 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
7 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
8 |
9 | -- Lua APIs
10 | local pairs = pairs
11 |
12 | -- WoW APIs
13 | local _G = _G
14 | local PlaySound, CreateFrame, UIParent = PlaySound, CreateFrame, UIParent
15 |
16 | --[[-----------------------------------------------------------------------------
17 | Scripts
18 | -------------------------------------------------------------------------------]]
19 | local function Button_OnClick(frame, ...)
20 | AceGUI:ClearFocus()
21 | PlaySound("igMainMenuOption")
22 | frame.obj:Fire("OnClick", ...)
23 | end
24 |
25 | local function Control_OnEnter(frame)
26 | frame.obj:Fire("OnEnter")
27 | end
28 |
29 | local function Control_OnLeave(frame)
30 | frame.obj:Fire("OnLeave")
31 | end
32 |
33 | --[[-----------------------------------------------------------------------------
34 | Methods
35 | -------------------------------------------------------------------------------]]
36 | local methods = {
37 | ["OnAcquire"] = function(self)
38 | -- restore default values
39 | self:SetHeight(24)
40 | self:SetWidth(200)
41 | self:SetDisabled(false)
42 | self:SetAutoWidth(false)
43 | self:SetText()
44 | end,
45 |
46 | -- ["OnRelease"] = nil,
47 |
48 | ["SetText"] = function(self, text)
49 | self.text:SetText(text)
50 | if self.autoWidth then
51 | self:SetWidth(self.text:GetStringWidth() + 30)
52 | end
53 | end,
54 |
55 | ["SetAutoWidth"] = function(self, autoWidth)
56 | self.autoWidth = autoWidth
57 | if self.autoWidth then
58 | self:SetWidth(self.text:GetStringWidth() + 30)
59 | end
60 | end,
61 |
62 | ["SetDisabled"] = function(self, disabled)
63 | self.disabled = disabled
64 | if disabled then
65 | self.frame:Disable()
66 | else
67 | self.frame:Enable()
68 | end
69 | end
70 | }
71 |
72 | --[[-----------------------------------------------------------------------------
73 | Constructor
74 | -------------------------------------------------------------------------------]]
75 | local function Constructor()
76 | local name = "AceGUI30Button" .. AceGUI:GetNextWidgetNum(Type)
77 | local frame = CreateFrame("Button", name, UIParent, "UIPanelButtonTemplate2")
78 | frame:Hide()
79 |
80 | frame:EnableMouse(true)
81 | frame:SetScript("OnClick", Button_OnClick)
82 | frame:SetScript("OnEnter", Control_OnEnter)
83 | frame:SetScript("OnLeave", Control_OnLeave)
84 |
85 | local text = frame:GetFontString()
86 | text:ClearAllPoints()
87 | text:SetPoint("TOPLEFT", 15, -1)
88 | text:SetPoint("BOTTOMRIGHT", -15, 1)
89 | text:SetJustifyV("MIDDLE")
90 |
91 | local widget = {
92 | text = text,
93 | frame = frame,
94 | type = Type
95 | }
96 | for method, func in pairs(methods) do
97 | widget[method] = func
98 | end
99 |
100 | return AceGUI:RegisterAsWidget(widget)
101 | end
102 |
103 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
104 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | InteractiveLabel Widget
3 | -------------------------------------------------------------------------------]]
4 | local Type, Version = "InteractiveLabel", 20
5 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
6 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
7 |
8 | -- Lua APIs
9 | local select, pairs = select, pairs
10 |
11 | -- WoW APIs
12 | local CreateFrame, UIParent = CreateFrame, UIParent
13 |
14 | -- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
15 | -- List them here for Mikk's FindGlobals script
16 | -- GLOBALS: GameFontHighlightSmall
17 |
18 | --[[-----------------------------------------------------------------------------
19 | Scripts
20 | -------------------------------------------------------------------------------]]
21 | local function Control_OnEnter(frame)
22 | frame.obj:Fire("OnEnter")
23 | end
24 |
25 | local function Control_OnLeave(frame)
26 | frame.obj:Fire("OnLeave")
27 | end
28 |
29 | local function Label_OnClick(frame, button)
30 | frame.obj:Fire("OnClick", button)
31 | AceGUI:ClearFocus()
32 | end
33 |
34 | --[[-----------------------------------------------------------------------------
35 | Methods
36 | -------------------------------------------------------------------------------]]
37 | local methods = {
38 | ["OnAcquire"] = function(self)
39 | self:LabelOnAcquire()
40 | self:SetHighlight()
41 | self:SetHighlightTexCoord()
42 | self:SetDisabled(false)
43 | end,
44 |
45 | -- ["OnRelease"] = nil,
46 |
47 | ["SetHighlight"] = function(self, ...)
48 | self.highlight:SetTexture(...)
49 | end,
50 |
51 | ["SetHighlightTexCoord"] = function(self, ...)
52 | local c = select("#", ...)
53 | if c == 4 or c == 8 then
54 | self.highlight:SetTexCoord(...)
55 | else
56 | self.highlight:SetTexCoord(0, 1, 0, 1)
57 | end
58 | end,
59 |
60 | ["SetDisabled"] = function(self,disabled)
61 | self.disabled = disabled
62 | if disabled then
63 | self.frame:EnableMouse(false)
64 | self.label:SetTextColor(0.5, 0.5, 0.5)
65 | else
66 | self.frame:EnableMouse(true)
67 | self.label:SetTextColor(1, 1, 1)
68 | end
69 | end
70 | }
71 |
72 | --[[-----------------------------------------------------------------------------
73 | Constructor
74 | -------------------------------------------------------------------------------]]
75 | local function Constructor()
76 | -- create a Label type that we will hijack
77 | local label = AceGUI:Create("Label")
78 |
79 | local frame = label.frame
80 | frame:EnableMouse(true)
81 | frame:SetScript("OnEnter", Control_OnEnter)
82 | frame:SetScript("OnLeave", Control_OnLeave)
83 | frame:SetScript("OnMouseDown", Label_OnClick)
84 |
85 | local highlight = frame:CreateTexture(nil, "HIGHLIGHT")
86 | highlight:SetTexture(nil)
87 | highlight:SetAllPoints()
88 | highlight:SetBlendMode("ADD")
89 |
90 | label.highlight = highlight
91 | label.type = Type
92 | label.LabelOnAcquire = label.OnAcquire
93 | for method, func in pairs(methods) do
94 | label[method] = func
95 | end
96 |
97 | return label
98 | end
99 |
100 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
101 |
102 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-Button.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | Button Widget
3 | Graphical Button.
4 | -------------------------------------------------------------------------------]]
5 | local Type, Version = "Button", 23
6 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
7 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
8 |
9 | -- Lua APIs
10 | local pairs = pairs
11 |
12 | -- WoW APIs
13 | local _G = _G
14 | local PlaySound, CreateFrame, UIParent = PlaySound, CreateFrame, UIParent
15 |
16 | local wowMoP
17 | do
18 | local _, _, _, interface = GetBuildInfo()
19 | wowMoP = (interface >= 50000)
20 | end
21 |
22 | --[[-----------------------------------------------------------------------------
23 | Scripts
24 | -------------------------------------------------------------------------------]]
25 | local function Button_OnClick(frame, ...)
26 | AceGUI:ClearFocus()
27 | PlaySound("igMainMenuOption")
28 | frame.obj:Fire("OnClick", ...)
29 | end
30 |
31 | local function Control_OnEnter(frame)
32 | frame.obj:Fire("OnEnter")
33 | end
34 |
35 | local function Control_OnLeave(frame)
36 | frame.obj:Fire("OnLeave")
37 | end
38 |
39 | --[[-----------------------------------------------------------------------------
40 | Methods
41 | -------------------------------------------------------------------------------]]
42 | local methods = {
43 | ["OnAcquire"] = function(self)
44 | -- restore default values
45 | self:SetHeight(24)
46 | self:SetWidth(200)
47 | self:SetDisabled(false)
48 | self:SetAutoWidth(false)
49 | self:SetText()
50 | end,
51 |
52 | -- ["OnRelease"] = nil,
53 |
54 | ["SetText"] = function(self, text)
55 | self.text:SetText(text)
56 | if self.autoWidth then
57 | self:SetWidth(self.text:GetStringWidth() + 30)
58 | end
59 | end,
60 |
61 | ["SetAutoWidth"] = function(self, autoWidth)
62 | self.autoWidth = autoWidth
63 | if self.autoWidth then
64 | self:SetWidth(self.text:GetStringWidth() + 30)
65 | end
66 | end,
67 |
68 | ["SetDisabled"] = function(self, disabled)
69 | self.disabled = disabled
70 | if disabled then
71 | self.frame:Disable()
72 | else
73 | self.frame:Enable()
74 | end
75 | end
76 | }
77 |
78 | --[[-----------------------------------------------------------------------------
79 | Constructor
80 | -------------------------------------------------------------------------------]]
81 | local function Constructor()
82 | local name = "AceGUI30Button" .. AceGUI:GetNextWidgetNum(Type)
83 | local frame = CreateFrame("Button", name, UIParent, wowMoP and "UIPanelButtonTemplate" or "UIPanelButtonTemplate2")
84 | frame:Hide()
85 |
86 | frame:EnableMouse(true)
87 | frame:SetScript("OnClick", Button_OnClick)
88 | frame:SetScript("OnEnter", Control_OnEnter)
89 | frame:SetScript("OnLeave", Control_OnLeave)
90 |
91 | local text = frame:GetFontString()
92 | text:ClearAllPoints()
93 | text:SetPoint("TOPLEFT", 15, -1)
94 | text:SetPoint("BOTTOMRIGHT", -15, 1)
95 | text:SetJustifyV("MIDDLE")
96 |
97 | local widget = {
98 | text = text,
99 | frame = frame,
100 | type = Type
101 | }
102 | for method, func in pairs(methods) do
103 | widget[method] = func
104 | end
105 |
106 | return AceGUI:RegisterAsWidget(widget)
107 | end
108 |
109 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
110 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0/widgets/AceGUIContainer-InlineGroup.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | InlineGroup Container
3 | Simple container widget that creates a visible "box" with an optional title.
4 | -------------------------------------------------------------------------------]]
5 | local Type, Version = "InlineGroup", 21
6 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
7 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
8 |
9 | -- Lua APIs
10 | local pairs = pairs
11 |
12 | -- WoW APIs
13 | local CreateFrame, UIParent = CreateFrame, UIParent
14 |
15 | --[[-----------------------------------------------------------------------------
16 | Methods
17 | -------------------------------------------------------------------------------]]
18 | local methods = {
19 | ["OnAcquire"] = function(self)
20 | self:SetWidth(300)
21 | self:SetHeight(100)
22 | self:SetTitle("")
23 | end,
24 |
25 | -- ["OnRelease"] = nil,
26 |
27 | ["SetTitle"] = function(self,title)
28 | self.titletext:SetText(title)
29 | end,
30 |
31 |
32 | ["LayoutFinished"] = function(self, width, height)
33 | if self.noAutoHeight then return end
34 | self:SetHeight((height or 0) + 40)
35 | end,
36 |
37 | ["OnWidthSet"] = function(self, width)
38 | local content = self.content
39 | local contentwidth = width - 20
40 | if contentwidth < 0 then
41 | contentwidth = 0
42 | end
43 | content:SetWidth(contentwidth)
44 | content.width = contentwidth
45 | end,
46 |
47 | ["OnHeightSet"] = function(self, height)
48 | local content = self.content
49 | local contentheight = height - 20
50 | if contentheight < 0 then
51 | contentheight = 0
52 | end
53 | content:SetHeight(contentheight)
54 | content.height = contentheight
55 | end
56 | }
57 |
58 | --[[-----------------------------------------------------------------------------
59 | Constructor
60 | -------------------------------------------------------------------------------]]
61 | local PaneBackdrop = {
62 | bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
63 | edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
64 | tile = true, tileSize = 16, edgeSize = 16,
65 | insets = { left = 3, right = 3, top = 5, bottom = 3 }
66 | }
67 |
68 | local function Constructor()
69 | local frame = CreateFrame("Frame", nil, UIParent)
70 | frame:SetFrameStrata("FULLSCREEN_DIALOG")
71 |
72 | local titletext = frame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
73 | titletext:SetPoint("TOPLEFT", 14, 0)
74 | titletext:SetPoint("TOPRIGHT", -14, 0)
75 | titletext:SetJustifyH("LEFT")
76 | titletext:SetHeight(18)
77 |
78 | local border = CreateFrame("Frame", nil, frame)
79 | border:SetPoint("TOPLEFT", 0, -17)
80 | border:SetPoint("BOTTOMRIGHT", -1, 3)
81 | border:SetBackdrop(PaneBackdrop)
82 | border:SetBackdropColor(0.1, 0.1, 0.1, 0.5)
83 | border:SetBackdropBorderColor(0.4, 0.4, 0.4)
84 |
85 | --Container Support
86 | local content = CreateFrame("Frame", nil, border)
87 | content:SetPoint("TOPLEFT", 10, -10)
88 | content:SetPoint("BOTTOMRIGHT", -10, 10)
89 |
90 | local widget = {
91 | frame = frame,
92 | content = content,
93 | titletext = titletext,
94 | type = Type
95 | }
96 | for method, func in pairs(methods) do
97 | widget[method] = func
98 | end
99 |
100 | return AceGUI:RegisterAsContainer(widget)
101 | end
102 |
103 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
104 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIContainer-InlineGroup.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | InlineGroup Container
3 | Simple container widget that creates a visible "box" with an optional title.
4 | -------------------------------------------------------------------------------]]
5 | local Type, Version = "InlineGroup", 21
6 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
7 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
8 |
9 | -- Lua APIs
10 | local pairs = pairs
11 |
12 | -- WoW APIs
13 | local CreateFrame, UIParent = CreateFrame, UIParent
14 |
15 | --[[-----------------------------------------------------------------------------
16 | Methods
17 | -------------------------------------------------------------------------------]]
18 | local methods = {
19 | ["OnAcquire"] = function(self)
20 | self:SetWidth(300)
21 | self:SetHeight(100)
22 | self:SetTitle("")
23 | end,
24 |
25 | -- ["OnRelease"] = nil,
26 |
27 | ["SetTitle"] = function(self,title)
28 | self.titletext:SetText(title)
29 | end,
30 |
31 |
32 | ["LayoutFinished"] = function(self, width, height)
33 | if self.noAutoHeight then return end
34 | self:SetHeight((height or 0) + 40)
35 | end,
36 |
37 | ["OnWidthSet"] = function(self, width)
38 | local content = self.content
39 | local contentwidth = width - 20
40 | if contentwidth < 0 then
41 | contentwidth = 0
42 | end
43 | content:SetWidth(contentwidth)
44 | content.width = contentwidth
45 | end,
46 |
47 | ["OnHeightSet"] = function(self, height)
48 | local content = self.content
49 | local contentheight = height - 20
50 | if contentheight < 0 then
51 | contentheight = 0
52 | end
53 | content:SetHeight(contentheight)
54 | content.height = contentheight
55 | end
56 | }
57 |
58 | --[[-----------------------------------------------------------------------------
59 | Constructor
60 | -------------------------------------------------------------------------------]]
61 | local PaneBackdrop = {
62 | bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
63 | edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
64 | tile = true, tileSize = 16, edgeSize = 16,
65 | insets = { left = 3, right = 3, top = 5, bottom = 3 }
66 | }
67 |
68 | local function Constructor()
69 | local frame = CreateFrame("Frame", nil, UIParent)
70 | frame:SetFrameStrata("FULLSCREEN_DIALOG")
71 |
72 | local titletext = frame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
73 | titletext:SetPoint("TOPLEFT", 14, 0)
74 | titletext:SetPoint("TOPRIGHT", -14, 0)
75 | titletext:SetJustifyH("LEFT")
76 | titletext:SetHeight(18)
77 |
78 | local border = CreateFrame("Frame", nil, frame)
79 | border:SetPoint("TOPLEFT", 0, -17)
80 | border:SetPoint("BOTTOMRIGHT", -1, 3)
81 | border:SetBackdrop(PaneBackdrop)
82 | border:SetBackdropColor(0.1, 0.1, 0.1, 0.5)
83 | border:SetBackdropBorderColor(0.4, 0.4, 0.4)
84 |
85 | --Container Support
86 | local content = CreateFrame("Frame", nil, border)
87 | content:SetPoint("TOPLEFT", 10, -10)
88 | content:SetPoint("BOTTOMRIGHT", -10, 10)
89 |
90 | local widget = {
91 | frame = frame,
92 | content = content,
93 | titletext = titletext,
94 | type = Type
95 | }
96 | for method, func in pairs(methods) do
97 | widget[method] = func
98 | end
99 |
100 | return AceGUI:RegisterAsContainer(widget)
101 | end
102 |
103 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
104 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0/widgets/AceGUIContainer-BlizOptionsGroup.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | BlizOptionsGroup Container
3 | Simple container widget for the integration of AceGUI into the Blizzard Interface Options
4 | -------------------------------------------------------------------------------]]
5 | local Type, Version = "BlizOptionsGroup", 21
6 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
7 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
8 |
9 | -- Lua APIs
10 | local pairs = pairs
11 |
12 | -- WoW APIs
13 | local CreateFrame = CreateFrame
14 |
15 | --[[-----------------------------------------------------------------------------
16 | Scripts
17 | -------------------------------------------------------------------------------]]
18 |
19 | local function OnShow(frame)
20 | frame.obj:Fire("OnShow")
21 | end
22 |
23 | local function OnHide(frame)
24 | frame.obj:Fire("OnHide")
25 | end
26 |
27 | --[[-----------------------------------------------------------------------------
28 | Support functions
29 | -------------------------------------------------------------------------------]]
30 |
31 | local function okay(frame)
32 | frame.obj:Fire("okay")
33 | end
34 |
35 | local function cancel(frame)
36 | frame.obj:Fire("cancel")
37 | end
38 |
39 | local function default(frame)
40 | frame.obj:Fire("default")
41 | end
42 |
43 | local function refresh(frame)
44 | frame.obj:Fire("refresh")
45 | end
46 |
47 | --[[-----------------------------------------------------------------------------
48 | Methods
49 | -------------------------------------------------------------------------------]]
50 |
51 | local methods = {
52 | ["OnAcquire"] = function(self)
53 | self:SetName()
54 | self:SetTitle()
55 | end,
56 |
57 | -- ["OnRelease"] = nil,
58 |
59 | ["OnWidthSet"] = function(self, width)
60 | local content = self.content
61 | local contentwidth = width - 63
62 | if contentwidth < 0 then
63 | contentwidth = 0
64 | end
65 | content:SetWidth(contentwidth)
66 | content.width = contentwidth
67 | end,
68 |
69 | ["OnHeightSet"] = function(self, height)
70 | local content = self.content
71 | local contentheight = height - 26
72 | if contentheight < 0 then
73 | contentheight = 0
74 | end
75 | content:SetHeight(contentheight)
76 | content.height = contentheight
77 | end,
78 |
79 | ["SetName"] = function(self, name, parent)
80 | self.frame.name = name
81 | self.frame.parent = parent
82 | end,
83 |
84 | ["SetTitle"] = function(self, title)
85 | local content = self.content
86 | content:ClearAllPoints()
87 | if not title or title == "" then
88 | content:SetPoint("TOPLEFT", 10, -10)
89 | self.label:SetText("")
90 | else
91 | content:SetPoint("TOPLEFT", 10, -40)
92 | self.label:SetText(title)
93 | end
94 | content:SetPoint("BOTTOMRIGHT", -10, 10)
95 | end
96 | }
97 |
98 | --[[-----------------------------------------------------------------------------
99 | Constructor
100 | -------------------------------------------------------------------------------]]
101 | local function Constructor()
102 | local frame = CreateFrame("Frame")
103 | frame:Hide()
104 |
105 | -- support functions for the Blizzard Interface Options
106 | frame.okay = okay
107 | frame.cancel = cancel
108 | frame.default = default
109 | frame.refresh = refresh
110 |
111 | frame:SetScript("OnHide", OnHide)
112 | frame:SetScript("OnShow", OnShow)
113 |
114 | local label = frame:CreateFontString(nil, "OVERLAY", "GameFontNormalLarge")
115 | label:SetPoint("TOPLEFT", 10, -15)
116 | label:SetPoint("BOTTOMRIGHT", frame, "TOPRIGHT", 10, -45)
117 | label:SetJustifyH("LEFT")
118 | label:SetJustifyV("TOP")
119 |
120 | --Container Support
121 | local content = CreateFrame("Frame", nil, frame)
122 | content:SetPoint("TOPLEFT", 10, -10)
123 | content:SetPoint("BOTTOMRIGHT", -10, 10)
124 |
125 | local widget = {
126 | label = label,
127 | frame = frame,
128 | content = content,
129 | type = Type
130 | }
131 | for method, func in pairs(methods) do
132 | widget[method] = func
133 | end
134 |
135 | return AceGUI:RegisterAsContainer(widget)
136 | end
137 |
138 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
139 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIContainer-BlizOptionsGroup.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | BlizOptionsGroup Container
3 | Simple container widget for the integration of AceGUI into the Blizzard Interface Options
4 | -------------------------------------------------------------------------------]]
5 | local Type, Version = "BlizOptionsGroup", 21
6 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
7 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
8 |
9 | -- Lua APIs
10 | local pairs = pairs
11 |
12 | -- WoW APIs
13 | local CreateFrame = CreateFrame
14 |
15 | --[[-----------------------------------------------------------------------------
16 | Scripts
17 | -------------------------------------------------------------------------------]]
18 |
19 | local function OnShow(frame)
20 | frame.obj:Fire("OnShow")
21 | end
22 |
23 | local function OnHide(frame)
24 | frame.obj:Fire("OnHide")
25 | end
26 |
27 | --[[-----------------------------------------------------------------------------
28 | Support functions
29 | -------------------------------------------------------------------------------]]
30 |
31 | local function okay(frame)
32 | frame.obj:Fire("okay")
33 | end
34 |
35 | local function cancel(frame)
36 | frame.obj:Fire("cancel")
37 | end
38 |
39 | local function default(frame)
40 | frame.obj:Fire("default")
41 | end
42 |
43 | local function refresh(frame)
44 | frame.obj:Fire("refresh")
45 | end
46 |
47 | --[[-----------------------------------------------------------------------------
48 | Methods
49 | -------------------------------------------------------------------------------]]
50 |
51 | local methods = {
52 | ["OnAcquire"] = function(self)
53 | self:SetName()
54 | self:SetTitle()
55 | end,
56 |
57 | -- ["OnRelease"] = nil,
58 |
59 | ["OnWidthSet"] = function(self, width)
60 | local content = self.content
61 | local contentwidth = width - 63
62 | if contentwidth < 0 then
63 | contentwidth = 0
64 | end
65 | content:SetWidth(contentwidth)
66 | content.width = contentwidth
67 | end,
68 |
69 | ["OnHeightSet"] = function(self, height)
70 | local content = self.content
71 | local contentheight = height - 26
72 | if contentheight < 0 then
73 | contentheight = 0
74 | end
75 | content:SetHeight(contentheight)
76 | content.height = contentheight
77 | end,
78 |
79 | ["SetName"] = function(self, name, parent)
80 | self.frame.name = name
81 | self.frame.parent = parent
82 | end,
83 |
84 | ["SetTitle"] = function(self, title)
85 | local content = self.content
86 | content:ClearAllPoints()
87 | if not title or title == "" then
88 | content:SetPoint("TOPLEFT", 10, -10)
89 | self.label:SetText("")
90 | else
91 | content:SetPoint("TOPLEFT", 10, -40)
92 | self.label:SetText(title)
93 | end
94 | content:SetPoint("BOTTOMRIGHT", -10, 10)
95 | end
96 | }
97 |
98 | --[[-----------------------------------------------------------------------------
99 | Constructor
100 | -------------------------------------------------------------------------------]]
101 | local function Constructor()
102 | local frame = CreateFrame("Frame")
103 | frame:Hide()
104 |
105 | -- support functions for the Blizzard Interface Options
106 | frame.okay = okay
107 | frame.cancel = cancel
108 | frame.default = default
109 | frame.refresh = refresh
110 |
111 | frame:SetScript("OnHide", OnHide)
112 | frame:SetScript("OnShow", OnShow)
113 |
114 | local label = frame:CreateFontString(nil, "OVERLAY", "GameFontNormalLarge")
115 | label:SetPoint("TOPLEFT", 10, -15)
116 | label:SetPoint("BOTTOMRIGHT", frame, "TOPRIGHT", 10, -45)
117 | label:SetJustifyH("LEFT")
118 | label:SetJustifyV("TOP")
119 |
120 | --Container Support
121 | local content = CreateFrame("Frame", nil, frame)
122 | content:SetPoint("TOPLEFT", 10, -10)
123 | content:SetPoint("BOTTOMRIGHT", -10, 10)
124 |
125 | local widget = {
126 | label = label,
127 | frame = frame,
128 | content = content,
129 | type = Type
130 | }
131 | for method, func in pairs(methods) do
132 | widget[method] = func
133 | end
134 |
135 | return AceGUI:RegisterAsContainer(widget)
136 | end
137 |
138 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
139 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | Icon Widget
3 | -------------------------------------------------------------------------------]]
4 | local Type, Version = "Icon", 21
5 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
6 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
7 |
8 | -- Lua APIs
9 | local select, pairs, print = select, pairs, print
10 |
11 | -- WoW APIs
12 | local CreateFrame, UIParent = CreateFrame, UIParent
13 |
14 | --[[-----------------------------------------------------------------------------
15 | Scripts
16 | -------------------------------------------------------------------------------]]
17 | local function Control_OnEnter(frame)
18 | frame.obj:Fire("OnEnter")
19 | end
20 |
21 | local function Control_OnLeave(frame)
22 | frame.obj:Fire("OnLeave")
23 | end
24 |
25 | local function Button_OnClick(frame, button)
26 | frame.obj:Fire("OnClick", button)
27 | AceGUI:ClearFocus()
28 | end
29 |
30 | --[[-----------------------------------------------------------------------------
31 | Methods
32 | -------------------------------------------------------------------------------]]
33 | local methods = {
34 | ["OnAcquire"] = function(self)
35 | self:SetHeight(110)
36 | self:SetWidth(110)
37 | self:SetLabel()
38 | self:SetImage(nil)
39 | self:SetImageSize(64, 64)
40 | self:SetDisabled(false)
41 | end,
42 |
43 | -- ["OnRelease"] = nil,
44 |
45 | ["SetLabel"] = function(self, text)
46 | if text and text ~= "" then
47 | self.label:Show()
48 | self.label:SetText(text)
49 | self:SetHeight(self.image:GetHeight() + 25)
50 | else
51 | self.label:Hide()
52 | self:SetHeight(self.image:GetHeight() + 10)
53 | end
54 | end,
55 |
56 | ["SetImage"] = function(self, path, ...)
57 | local image = self.image
58 | image:SetTexture(path)
59 |
60 | if image:GetTexture() then
61 | local n = select("#", ...)
62 | if n == 4 or n == 8 then
63 | image:SetTexCoord(...)
64 | else
65 | image:SetTexCoord(0, 1, 0, 1)
66 | end
67 | end
68 | end,
69 |
70 | ["SetImageSize"] = function(self, width, height)
71 | self.image:SetWidth(width)
72 | self.image:SetHeight(height)
73 | --self.frame:SetWidth(width + 30)
74 | if self.label:IsShown() then
75 | self:SetHeight(height + 25)
76 | else
77 | self:SetHeight(height + 10)
78 | end
79 | end,
80 |
81 | ["SetDisabled"] = function(self, disabled)
82 | self.disabled = disabled
83 | if disabled then
84 | self.frame:Disable()
85 | self.label:SetTextColor(0.5, 0.5, 0.5)
86 | self.image:SetVertexColor(0.5, 0.5, 0.5, 0.5)
87 | else
88 | self.frame:Enable()
89 | self.label:SetTextColor(1, 1, 1)
90 | self.image:SetVertexColor(1, 1, 1, 1)
91 | end
92 | end
93 | }
94 |
95 | --[[-----------------------------------------------------------------------------
96 | Constructor
97 | -------------------------------------------------------------------------------]]
98 | local function Constructor()
99 | local frame = CreateFrame("Button", nil, UIParent)
100 | frame:Hide()
101 |
102 | frame:EnableMouse(true)
103 | frame:SetScript("OnEnter", Control_OnEnter)
104 | frame:SetScript("OnLeave", Control_OnLeave)
105 | frame:SetScript("OnClick", Button_OnClick)
106 |
107 | local label = frame:CreateFontString(nil, "BACKGROUND", "GameFontHighlight")
108 | label:SetPoint("BOTTOMLEFT")
109 | label:SetPoint("BOTTOMRIGHT")
110 | label:SetJustifyH("CENTER")
111 | label:SetJustifyV("TOP")
112 | label:SetHeight(18)
113 |
114 | local image = frame:CreateTexture(nil, "BACKGROUND")
115 | image:SetWidth(64)
116 | image:SetHeight(64)
117 | image:SetPoint("TOP", 0, -5)
118 |
119 | local highlight = frame:CreateTexture(nil, "HIGHLIGHT")
120 | highlight:SetAllPoints(image)
121 | highlight:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-Tab-Highlight")
122 | highlight:SetTexCoord(0, 1, 0.23, 0.77)
123 | highlight:SetBlendMode("ADD")
124 |
125 | local widget = {
126 | label = label,
127 | image = image,
128 | frame = frame,
129 | type = Type
130 | }
131 | for method, func in pairs(methods) do
132 | widget[method] = func
133 | end
134 |
135 | widget.SetText = widget.SetLabel
136 |
137 | return AceGUI:RegisterAsWidget(widget)
138 | end
139 |
140 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
141 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | Icon Widget
3 | -------------------------------------------------------------------------------]]
4 | local Type, Version = "Icon", 21
5 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
6 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
7 |
8 | -- Lua APIs
9 | local select, pairs, print = select, pairs, print
10 |
11 | -- WoW APIs
12 | local CreateFrame, UIParent, GetBuildInfo = CreateFrame, UIParent, GetBuildInfo
13 |
14 | --[[-----------------------------------------------------------------------------
15 | Scripts
16 | -------------------------------------------------------------------------------]]
17 | local function Control_OnEnter(frame)
18 | frame.obj:Fire("OnEnter")
19 | end
20 |
21 | local function Control_OnLeave(frame)
22 | frame.obj:Fire("OnLeave")
23 | end
24 |
25 | local function Button_OnClick(frame, button)
26 | frame.obj:Fire("OnClick", button)
27 | AceGUI:ClearFocus()
28 | end
29 |
30 | --[[-----------------------------------------------------------------------------
31 | Methods
32 | -------------------------------------------------------------------------------]]
33 | local methods = {
34 | ["OnAcquire"] = function(self)
35 | self:SetHeight(110)
36 | self:SetWidth(110)
37 | self:SetLabel()
38 | self:SetImage(nil)
39 | self:SetImageSize(64, 64)
40 | self:SetDisabled(false)
41 | end,
42 |
43 | -- ["OnRelease"] = nil,
44 |
45 | ["SetLabel"] = function(self, text)
46 | if text and text ~= "" then
47 | self.label:Show()
48 | self.label:SetText(text)
49 | self:SetHeight(self.image:GetHeight() + 25)
50 | else
51 | self.label:Hide()
52 | self:SetHeight(self.image:GetHeight() + 10)
53 | end
54 | end,
55 |
56 | ["SetImage"] = function(self, path, ...)
57 | local image = self.image
58 | image:SetTexture(path)
59 |
60 | if image:GetTexture() then
61 | local n = select("#", ...)
62 | if n == 4 or n == 8 then
63 | image:SetTexCoord(...)
64 | else
65 | image:SetTexCoord(0, 1, 0, 1)
66 | end
67 | end
68 | end,
69 |
70 | ["SetImageSize"] = function(self, width, height)
71 | self.image:SetWidth(width)
72 | self.image:SetHeight(height)
73 | --self.frame:SetWidth(width + 30)
74 | if self.label:IsShown() then
75 | self:SetHeight(height + 25)
76 | else
77 | self:SetHeight(height + 10)
78 | end
79 | end,
80 |
81 | ["SetDisabled"] = function(self, disabled)
82 | self.disabled = disabled
83 | if disabled then
84 | self.frame:Disable()
85 | self.label:SetTextColor(0.5, 0.5, 0.5)
86 | self.image:SetVertexColor(0.5, 0.5, 0.5, 0.5)
87 | else
88 | self.frame:Enable()
89 | self.label:SetTextColor(1, 1, 1)
90 | self.image:SetVertexColor(1, 1, 1, 1)
91 | end
92 | end
93 | }
94 |
95 | --[[-----------------------------------------------------------------------------
96 | Constructor
97 | -------------------------------------------------------------------------------]]
98 | local function Constructor()
99 | local frame = CreateFrame("Button", nil, UIParent)
100 | frame:Hide()
101 |
102 | frame:EnableMouse(true)
103 | frame:SetScript("OnEnter", Control_OnEnter)
104 | frame:SetScript("OnLeave", Control_OnLeave)
105 | frame:SetScript("OnClick", Button_OnClick)
106 |
107 | local label = frame:CreateFontString(nil, "BACKGROUND", "GameFontHighlight")
108 | label:SetPoint("BOTTOMLEFT")
109 | label:SetPoint("BOTTOMRIGHT")
110 | label:SetJustifyH("CENTER")
111 | label:SetJustifyV("TOP")
112 | label:SetHeight(18)
113 |
114 | local image = frame:CreateTexture(nil, "BACKGROUND")
115 | image:SetWidth(64)
116 | image:SetHeight(64)
117 | image:SetPoint("TOP", 0, -5)
118 |
119 | local highlight = frame:CreateTexture(nil, "HIGHLIGHT")
120 | highlight:SetAllPoints(image)
121 | highlight:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-Tab-Highlight")
122 | highlight:SetTexCoord(0, 1, 0.23, 0.77)
123 | highlight:SetBlendMode("ADD")
124 |
125 | local widget = {
126 | label = label,
127 | image = image,
128 | frame = frame,
129 | type = Type
130 | }
131 | for method, func in pairs(methods) do
132 | widget[method] = func
133 | end
134 | -- SetText is deprecated, but keep it around for a while. (say, to WoW 4.0)
135 | if (select(4, GetBuildInfo()) < 40000) then
136 | widget.SetText = widget.SetLabel
137 | else
138 | widget.SetText = function(self, ...) print("AceGUI-3.0-Icon: SetText is deprecated! Use SetLabel instead!"); self:SetLabel(...) end
139 | end
140 |
141 | return AceGUI:RegisterAsWidget(widget)
142 | end
143 |
144 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
145 |
--------------------------------------------------------------------------------
/libs/AceEvent-3.0/AceEvent-3.0.lua:
--------------------------------------------------------------------------------
1 | --- AceEvent-3.0 provides event registration and secure dispatching.
2 | -- All dispatching is done using **CallbackHandler-1.0**. AceEvent is a simple wrapper around
3 | -- CallbackHandler, and dispatches all game events or addon message to the registrees.
4 | --
5 | -- **AceEvent-3.0** can be embeded into your addon, either explicitly by calling AceEvent:Embed(MyAddon) or by
6 | -- specifying it as an embeded library in your AceAddon. All functions will be available on your addon object
7 | -- and can be accessed directly, without having to explicitly call AceEvent itself.\\
8 | -- It is recommended to embed AceEvent, otherwise you'll have to specify a custom `self` on all calls you
9 | -- make into AceEvent.
10 | -- @class file
11 | -- @name AceEvent-3.0
12 | -- @release $Id$
13 | local CallbackHandler = LibStub("CallbackHandler-1.0")
14 |
15 | local MAJOR, MINOR = "AceEvent-3.0", 4
16 | local AceEvent = LibStub:NewLibrary(MAJOR, MINOR)
17 |
18 | if not AceEvent then return end
19 |
20 | -- Lua APIs
21 | local pairs = pairs
22 |
23 | AceEvent.frame = AceEvent.frame or CreateFrame("Frame", "AceEvent30Frame") -- our event frame
24 | AceEvent.embeds = AceEvent.embeds or {} -- what objects embed this lib
25 |
26 | -- APIs and registry for blizzard events, using CallbackHandler lib
27 | if not AceEvent.events then
28 | AceEvent.events = CallbackHandler:New(AceEvent,
29 | "RegisterEvent", "UnregisterEvent", "UnregisterAllEvents")
30 | end
31 |
32 | function AceEvent.events:OnUsed(target, eventname)
33 | AceEvent.frame:RegisterEvent(eventname)
34 | end
35 |
36 | function AceEvent.events:OnUnused(target, eventname)
37 | AceEvent.frame:UnregisterEvent(eventname)
38 | end
39 |
40 |
41 | -- APIs and registry for IPC messages, using CallbackHandler lib
42 | if not AceEvent.messages then
43 | AceEvent.messages = CallbackHandler:New(AceEvent,
44 | "RegisterMessage", "UnregisterMessage", "UnregisterAllMessages"
45 | )
46 | AceEvent.SendMessage = AceEvent.messages.Fire
47 | end
48 |
49 | --- embedding and embed handling
50 | local mixins = {
51 | "RegisterEvent", "UnregisterEvent",
52 | "RegisterMessage", "UnregisterMessage",
53 | "SendMessage",
54 | "UnregisterAllEvents", "UnregisterAllMessages",
55 | }
56 |
57 | --- Register for a Blizzard Event.
58 | -- The callback will be called with the optional `arg` as the first argument (if supplied), and the event name as the second (or first, if no arg was supplied)
59 | -- Any arguments to the event will be passed on after that.
60 | -- @name AceEvent:RegisterEvent
61 | -- @class function
62 | -- @paramsig event[, callback [, arg]]
63 | -- @param event The event to register for
64 | -- @param callback The callback function to call when the event is triggered (funcref or method, defaults to a method with the event name)
65 | -- @param arg An optional argument to pass to the callback function
66 |
67 | --- Unregister an event.
68 | -- @name AceEvent:UnregisterEvent
69 | -- @class function
70 | -- @paramsig event
71 | -- @param event The event to unregister
72 |
73 | --- Register for a custom AceEvent-internal message.
74 | -- The callback will be called with the optional `arg` as the first argument (if supplied), and the event name as the second (or first, if no arg was supplied)
75 | -- Any arguments to the event will be passed on after that.
76 | -- @name AceEvent:RegisterMessage
77 | -- @class function
78 | -- @paramsig message[, callback [, arg]]
79 | -- @param message The message to register for
80 | -- @param callback The callback function to call when the message is triggered (funcref or method, defaults to a method with the event name)
81 | -- @param arg An optional argument to pass to the callback function
82 |
83 | --- Unregister a message
84 | -- @name AceEvent:UnregisterMessage
85 | -- @class function
86 | -- @paramsig message
87 | -- @param message The message to unregister
88 |
89 | --- Send a message over the AceEvent-3.0 internal message system to other addons registered for this message.
90 | -- @name AceEvent:SendMessage
91 | -- @class function
92 | -- @paramsig message, ...
93 | -- @param message The message to send
94 | -- @param ... Any arguments to the message
95 |
96 |
97 | -- Embeds AceEvent into the target object making the functions from the mixins list available on target:..
98 | -- @param target target object to embed AceEvent in
99 | function AceEvent:Embed(target)
100 | for k, v in pairs(mixins) do
101 | target[v] = self[v]
102 | end
103 | self.embeds[target] = true
104 | return target
105 | end
106 |
107 | -- AceEvent:OnEmbedDisable( target )
108 | -- target (object) - target object that is being disabled
109 | --
110 | -- Unregister all events messages etc when the target disables.
111 | -- this method should be called by the target manually or by an addon framework
112 | function AceEvent:OnEmbedDisable(target)
113 | target:UnregisterAllEvents()
114 | target:UnregisterAllMessages()
115 | end
116 |
117 | -- Script to fire blizzard events into the event listeners
118 | local events = AceEvent.events
119 | AceEvent.frame:SetScript("OnEvent", function(this, event, ...)
120 | events:Fire(event, ...)
121 | end)
122 |
123 | --- Finally: upgrade our old embeds
124 | for target, v in pairs(AceEvent.embeds) do
125 | AceEvent:Embed(target)
126 | end
127 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0/widgets/AceGUIContainer-DropDownGroup.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | DropdownGroup Container
3 | Container controlled by a dropdown on the top.
4 | -------------------------------------------------------------------------------]]
5 | local Type, Version = "DropdownGroup", 21
6 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
7 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
8 |
9 | -- Lua APIs
10 | local assert, pairs, type = assert, pairs, type
11 |
12 | -- WoW APIs
13 | local CreateFrame = CreateFrame
14 |
15 | --[[-----------------------------------------------------------------------------
16 | Scripts
17 | -------------------------------------------------------------------------------]]
18 | local function SelectedGroup(self, event, value)
19 | local group = self.parentgroup
20 | local status = group.status or group.localstatus
21 | status.selected = value
22 | self.parentgroup:Fire("OnGroupSelected", value)
23 | end
24 |
25 | --[[-----------------------------------------------------------------------------
26 | Methods
27 | -------------------------------------------------------------------------------]]
28 | local methods = {
29 | ["OnAcquire"] = function(self)
30 | self.dropdown:SetText("")
31 | self:SetDropdownWidth(200)
32 | self:SetTitle("")
33 | end,
34 |
35 | ["OnRelease"] = function(self)
36 | self.dropdown.list = nil
37 | self.status = nil
38 | for k in pairs(self.localstatus) do
39 | self.localstatus[k] = nil
40 | end
41 | end,
42 |
43 | ["SetTitle"] = function(self, title)
44 | self.titletext:SetText(title)
45 | self.dropdown.frame:ClearAllPoints()
46 | if title and title ~= "" then
47 | self.dropdown.frame:SetPoint("TOPRIGHT", -2, 0)
48 | else
49 | self.dropdown.frame:SetPoint("TOPLEFT", -1, 0)
50 | end
51 | end,
52 |
53 | ["SetGroupList"] = function(self,list,order)
54 | self.dropdown:SetList(list,order)
55 | end,
56 |
57 | ["SetStatusTable"] = function(self, status)
58 | assert(type(status) == "table")
59 | self.status = status
60 | end,
61 |
62 | ["SetGroup"] = function(self,group)
63 | self.dropdown:SetValue(group)
64 | local status = self.status or self.localstatus
65 | status.selected = group
66 | self:Fire("OnGroupSelected", group)
67 | end,
68 |
69 | ["OnWidthSet"] = function(self, width)
70 | local content = self.content
71 | local contentwidth = width - 26
72 | if contentwidth < 0 then
73 | contentwidth = 0
74 | end
75 | content:SetWidth(contentwidth)
76 | content.width = contentwidth
77 | end,
78 |
79 | ["OnHeightSet"] = function(self, height)
80 | local content = self.content
81 | local contentheight = height - 63
82 | if contentheight < 0 then
83 | contentheight = 0
84 | end
85 | content:SetHeight(contentheight)
86 | content.height = contentheight
87 | end,
88 |
89 | ["LayoutFinished"] = function(self, width, height)
90 | self:SetHeight((height or 0) + 63)
91 | end,
92 |
93 | ["SetDropdownWidth"] = function(self, width)
94 | self.dropdown:SetWidth(width)
95 | end
96 | }
97 |
98 | --[[-----------------------------------------------------------------------------
99 | Constructor
100 | -------------------------------------------------------------------------------]]
101 | local PaneBackdrop = {
102 | bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
103 | edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
104 | tile = true, tileSize = 16, edgeSize = 16,
105 | insets = { left = 3, right = 3, top = 5, bottom = 3 }
106 | }
107 |
108 | local function Constructor()
109 | local frame = CreateFrame("Frame")
110 | frame:SetHeight(100)
111 | frame:SetWidth(100)
112 | frame:SetFrameStrata("FULLSCREEN_DIALOG")
113 |
114 | local titletext = frame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
115 | titletext:SetPoint("TOPLEFT", 4, -5)
116 | titletext:SetPoint("TOPRIGHT", -4, -5)
117 | titletext:SetJustifyH("LEFT")
118 | titletext:SetHeight(18)
119 |
120 | local dropdown = AceGUI:Create("Dropdown")
121 | dropdown.frame:SetParent(frame)
122 | dropdown.frame:SetFrameLevel(dropdown.frame:GetFrameLevel() + 2)
123 | dropdown:SetCallback("OnValueChanged", SelectedGroup)
124 | dropdown.frame:SetPoint("TOPLEFT", -1, 0)
125 | dropdown.frame:Show()
126 | dropdown:SetLabel("")
127 |
128 | local border = CreateFrame("Frame", nil, frame)
129 | border:SetPoint("TOPLEFT", 0, -26)
130 | border:SetPoint("BOTTOMRIGHT", 0, 3)
131 | border:SetBackdrop(PaneBackdrop)
132 | border:SetBackdropColor(0.1,0.1,0.1,0.5)
133 | border:SetBackdropBorderColor(0.4,0.4,0.4)
134 |
135 | --Container Support
136 | local content = CreateFrame("Frame", nil, border)
137 | content:SetPoint("TOPLEFT", 10, -10)
138 | content:SetPoint("BOTTOMRIGHT", -10, 10)
139 |
140 | local widget = {
141 | frame = frame,
142 | localstatus = {},
143 | titletext = titletext,
144 | dropdown = dropdown,
145 | border = border,
146 | content = content,
147 | type = Type
148 | }
149 | for method, func in pairs(methods) do
150 | widget[method] = func
151 | end
152 | dropdown.parentgroup = widget
153 |
154 | return AceGUI:RegisterAsContainer(widget)
155 | end
156 |
157 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
158 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-Label.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | Label Widget
3 | Displays text and optionally an icon.
4 | -------------------------------------------------------------------------------]]
5 | local Type, Version = "Label", 23
6 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
7 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
8 |
9 | -- Lua APIs
10 | local max, select, pairs = math.max, select, pairs
11 |
12 | -- WoW APIs
13 | local CreateFrame, UIParent = CreateFrame, UIParent
14 |
15 | -- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
16 | -- List them here for Mikk's FindGlobals script
17 | -- GLOBALS: GameFontHighlightSmall
18 |
19 | --[[-----------------------------------------------------------------------------
20 | Support functions
21 | -------------------------------------------------------------------------------]]
22 |
23 | local function UpdateImageAnchor(self)
24 | if self.resizing then return end
25 | local frame = self.frame
26 | local width = frame.width or frame:GetWidth() or 0
27 | local image = self.image
28 | local label = self.label
29 | local height
30 |
31 | label:ClearAllPoints()
32 | image:ClearAllPoints()
33 |
34 | if self.imageshown then
35 | local imagewidth = image:GetWidth()
36 | if (width - imagewidth) < 200 or (label:GetText() or "") == "" then
37 | -- image goes on top centered when less than 200 width for the text, or if there is no text
38 | image:SetPoint("TOP")
39 | label:SetPoint("TOP", image, "BOTTOM")
40 | label:SetPoint("LEFT")
41 | label:SetWidth(width)
42 | height = image:GetHeight() + label:GetHeight()
43 | else
44 | -- image on the left
45 | image:SetPoint("TOPLEFT")
46 | if image:GetHeight() > label:GetHeight() then
47 | label:SetPoint("LEFT", image, "RIGHT", 4, 0)
48 | else
49 | label:SetPoint("TOPLEFT", image, "TOPRIGHT", 4, 0)
50 | end
51 | label:SetWidth(width - imagewidth - 4)
52 | height = max(image:GetHeight(), label:GetHeight())
53 | end
54 | else
55 | -- no image shown
56 | label:SetPoint("TOPLEFT")
57 | label:SetWidth(width)
58 | height = label:GetHeight()
59 | end
60 |
61 | self.resizing = true
62 | frame:SetHeight(height)
63 | frame.height = height
64 | self.resizing = nil
65 | end
66 |
67 | --[[-----------------------------------------------------------------------------
68 | Methods
69 | -------------------------------------------------------------------------------]]
70 | local methods = {
71 | ["OnAcquire"] = function(self)
72 | -- set the flag to stop constant size updates
73 | self.resizing = true
74 | -- height is set dynamically by the text and image size
75 | self:SetWidth(200)
76 | self:SetText()
77 | self:SetImage(nil)
78 | self:SetImageSize(16, 16)
79 | self:SetColor()
80 | self:SetFontObject()
81 |
82 | -- reset the flag
83 | self.resizing = nil
84 | -- run the update explicitly
85 | UpdateImageAnchor(self)
86 | end,
87 |
88 | -- ["OnRelease"] = nil,
89 |
90 | ["OnWidthSet"] = function(self, width)
91 | UpdateImageAnchor(self)
92 | end,
93 |
94 | ["SetText"] = function(self, text)
95 | self.label:SetText(text)
96 | UpdateImageAnchor(self)
97 | end,
98 |
99 | ["SetColor"] = function(self, r, g, b)
100 | if not (r and g and b) then
101 | r, g, b = 1, 1, 1
102 | end
103 | self.label:SetVertexColor(r, g, b)
104 | end,
105 |
106 | ["SetImage"] = function(self, path, ...)
107 | local image = self.image
108 | image:SetTexture(path)
109 |
110 | if image:GetTexture() then
111 | self.imageshown = true
112 | local n = select("#", ...)
113 | if n == 4 or n == 8 then
114 | image:SetTexCoord(...)
115 | else
116 | image:SetTexCoord(0, 1, 0, 1)
117 | end
118 | else
119 | self.imageshown = nil
120 | end
121 | UpdateImageAnchor(self)
122 | end,
123 |
124 | ["SetFont"] = function(self, font, height, flags)
125 | self.label:SetFont(font, height, flags)
126 | end,
127 |
128 | ["SetFontObject"] = function(self, font)
129 | self:SetFont((font or GameFontHighlightSmall):GetFont())
130 | end,
131 |
132 | ["SetImageSize"] = function(self, width, height)
133 | self.image:SetWidth(width)
134 | self.image:SetHeight(height)
135 | UpdateImageAnchor(self)
136 | end,
137 | }
138 |
139 | --[[-----------------------------------------------------------------------------
140 | Constructor
141 | -------------------------------------------------------------------------------]]
142 | local function Constructor()
143 | local frame = CreateFrame("Frame", nil, UIParent)
144 | frame:Hide()
145 |
146 | local label = frame:CreateFontString(nil, "BACKGROUND", "GameFontHighlightSmall")
147 | label:SetJustifyH("LEFT")
148 | label:SetJustifyV("TOP")
149 |
150 | local image = frame:CreateTexture(nil, "BACKGROUND")
151 |
152 | -- create widget
153 | local widget = {
154 | label = label,
155 | image = image,
156 | frame = frame,
157 | type = Type
158 | }
159 | for method, func in pairs(methods) do
160 | widget[method] = func
161 | end
162 |
163 | return AceGUI:RegisterAsWidget(widget)
164 | end
165 |
166 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
167 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIContainer-DropDownGroup.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | DropdownGroup Container
3 | Container controlled by a dropdown on the top.
4 | -------------------------------------------------------------------------------]]
5 | local Type, Version = "DropdownGroup", 21
6 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
7 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
8 |
9 | -- Lua APIs
10 | local assert, pairs, type = assert, pairs, type
11 |
12 | -- WoW APIs
13 | local CreateFrame = CreateFrame
14 |
15 | --[[-----------------------------------------------------------------------------
16 | Scripts
17 | -------------------------------------------------------------------------------]]
18 | local function SelectedGroup(self, event, value)
19 | local group = self.parentgroup
20 | local status = group.status or group.localstatus
21 | status.selected = value
22 | self.parentgroup:Fire("OnGroupSelected", value)
23 | end
24 |
25 | --[[-----------------------------------------------------------------------------
26 | Methods
27 | -------------------------------------------------------------------------------]]
28 | local methods = {
29 | ["OnAcquire"] = function(self)
30 | self.dropdown:SetText("")
31 | self:SetDropdownWidth(200)
32 | self:SetTitle("")
33 | end,
34 |
35 | ["OnRelease"] = function(self)
36 | self.dropdown.list = nil
37 | self.status = nil
38 | for k in pairs(self.localstatus) do
39 | self.localstatus[k] = nil
40 | end
41 | end,
42 |
43 | ["SetTitle"] = function(self, title)
44 | self.titletext:SetText(title)
45 | self.dropdown.frame:ClearAllPoints()
46 | if title and title ~= "" then
47 | self.dropdown.frame:SetPoint("TOPRIGHT", -2, 0)
48 | else
49 | self.dropdown.frame:SetPoint("TOPLEFT", -1, 0)
50 | end
51 | end,
52 |
53 | ["SetGroupList"] = function(self,list,order)
54 | self.dropdown:SetList(list,order)
55 | end,
56 |
57 | ["SetStatusTable"] = function(self, status)
58 | assert(type(status) == "table")
59 | self.status = status
60 | end,
61 |
62 | ["SetGroup"] = function(self,group)
63 | self.dropdown:SetValue(group)
64 | local status = self.status or self.localstatus
65 | status.selected = group
66 | self:Fire("OnGroupSelected", group)
67 | end,
68 |
69 | ["OnWidthSet"] = function(self, width)
70 | local content = self.content
71 | local contentwidth = width - 26
72 | if contentwidth < 0 then
73 | contentwidth = 0
74 | end
75 | content:SetWidth(contentwidth)
76 | content.width = contentwidth
77 | end,
78 |
79 | ["OnHeightSet"] = function(self, height)
80 | local content = self.content
81 | local contentheight = height - 63
82 | if contentheight < 0 then
83 | contentheight = 0
84 | end
85 | content:SetHeight(contentheight)
86 | content.height = contentheight
87 | end,
88 |
89 | ["LayoutFinished"] = function(self, width, height)
90 | self:SetHeight((height or 0) + 63)
91 | end,
92 |
93 | ["SetDropdownWidth"] = function(self, width)
94 | self.dropdown:SetWidth(width)
95 | end
96 | }
97 |
98 | --[[-----------------------------------------------------------------------------
99 | Constructor
100 | -------------------------------------------------------------------------------]]
101 | local PaneBackdrop = {
102 | bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
103 | edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
104 | tile = true, tileSize = 16, edgeSize = 16,
105 | insets = { left = 3, right = 3, top = 5, bottom = 3 }
106 | }
107 |
108 | local function Constructor()
109 | local frame = CreateFrame("Frame")
110 | frame:SetHeight(100)
111 | frame:SetWidth(100)
112 | frame:SetFrameStrata("FULLSCREEN_DIALOG")
113 |
114 | local titletext = frame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
115 | titletext:SetPoint("TOPLEFT", 4, -5)
116 | titletext:SetPoint("TOPRIGHT", -4, -5)
117 | titletext:SetJustifyH("LEFT")
118 | titletext:SetHeight(18)
119 |
120 | local dropdown = AceGUI:Create("Dropdown")
121 | dropdown.frame:SetParent(frame)
122 | dropdown.frame:SetFrameLevel(dropdown.frame:GetFrameLevel() + 2)
123 | dropdown:SetCallback("OnValueChanged", SelectedGroup)
124 | dropdown.frame:SetPoint("TOPLEFT", -1, 0)
125 | dropdown.frame:Show()
126 | dropdown:SetLabel("")
127 |
128 | local border = CreateFrame("Frame", nil, frame)
129 | border:SetPoint("TOPLEFT", 0, -26)
130 | border:SetPoint("BOTTOMRIGHT", 0, 3)
131 | border:SetBackdrop(PaneBackdrop)
132 | border:SetBackdropColor(0.1,0.1,0.1,0.5)
133 | border:SetBackdropBorderColor(0.4,0.4,0.4)
134 |
135 | --Container Support
136 | local content = CreateFrame("Frame", nil, border)
137 | content:SetPoint("TOPLEFT", 10, -10)
138 | content:SetPoint("BOTTOMRIGHT", -10, 10)
139 |
140 | local widget = {
141 | frame = frame,
142 | localstatus = {},
143 | titletext = titletext,
144 | dropdown = dropdown,
145 | border = border,
146 | content = content,
147 | type = Type
148 | }
149 | for method, func in pairs(methods) do
150 | widget[method] = func
151 | end
152 | dropdown.parentgroup = widget
153 |
154 | return AceGUI:RegisterAsContainer(widget)
155 | end
156 |
157 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
158 |
--------------------------------------------------------------------------------
/modules/interrupts.lua:
--------------------------------------------------------------------------------
1 | local GladiusEx = _G.GladiusEx
2 | local L = LibStub("AceLocale-3.0"):GetLocale("GladiusEx")
3 | local fn = LibStub("LibFunctional-1.0")
4 | local timer
5 |
6 |
7 |
8 | -- V: heavily inspired by Jaxington's Gladius-With-Interrupts
9 | -- K: Improved
10 |
11 | local defaults = {
12 | interruptPrio = 3.0,
13 | }
14 |
15 | local Interrupt = GladiusEx:NewGladiusExModule("InterruptsEx", defaults, defaults)
16 |
17 | local INTERRUPTS = {
18 | [6552] = { duration = 4 }, -- [Warrior] Pummel
19 | [48827] = { duration = 3 }, -- [Paladin] Avenger's Shield
20 | [1766] = { duration = 5 }, -- [Rogue] Kick
21 | [47528] = { duration = 3 }, -- [DK] Mind Freeze
22 | [57994] = { duration = 3 }, -- [Shaman] Wind Shear
23 | [19647] = { duration = 6 }, -- [Warlock] Spell Lock
24 | [2139] = { duration = 6 }, -- [Mage] Counterspell
25 | [16979] = { duration = 4 }, -- [Feral] Feral Charge - Bear
26 | }
27 |
28 | function Interrupt:OnEnable()
29 | self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
30 |
31 | if not self.frame then
32 | self.frame = {}
33 | end
34 | self.interrupts = {}
35 | end
36 |
37 | function Interrupt:OnDisable()
38 | self:UnregisterAllEvents()
39 | for unit in pairs(self.frame) do
40 | self.frame[unit]:SetAlpha(0)
41 | end
42 | end
43 |
44 | function Interrupt:COMBAT_LOG_EVENT_UNFILTERED(event, ...)
45 | local subEvent = select(2, ...)
46 | local destGUID = select(6, ...)
47 | local spellID = select(9, ...)
48 |
49 | local unit = GladiusEx:GetUnitIdByGUID(destGUID)
50 | if not unit then return end
51 | local button = GladiusEx.buttons[unit]
52 | if not button then return end
53 |
54 |
55 | if subEvent ~= "SPELL_CAST_SUCCESS" and subEvent ~= "SPELL_INTERRUPT" then
56 | return
57 | end
58 | -- it is necessary to check ~= false, as if the unit isn't casting a channeled spell, it will be nil
59 | if subEvent == "SPELL_CAST_SUCCESS" and select(8, UnitChannelInfo(unit)) ~= false then
60 | -- not interruptible
61 | return
62 | end
63 |
64 | if INTERRUPTS[spellID] == nil then return end
65 | local duration = INTERRUPTS[spellID].duration
66 | if not duration then return end
67 |
68 |
69 | self:UpdateInterrupt(unit, spellID, duration)
70 |
71 | end
72 |
73 | function Interrupt:UpdateInterrupt(unit, spellID, duration)
74 | local t = GetTime()
75 |
76 | -- new interrupt
77 | if spellID and duration then
78 | if self.interrupts[unit] == nil then self.interrupts[unit] = {} end
79 | self.interrupts[unit][spellID] = {started = t, duration = duration}
80 | -- old interrupt expiring
81 | elseif spellID and duration == nil then
82 | if self.interrupts[unit] and self.interrupts[unit][spellID] and
83 | t > self.interrupts[unit][spellID].started + self.interrupts[unit][spellID].duration then
84 | self.interrupts[unit][spellID] = nil
85 | end
86 | end
87 |
88 | -- force update now, rather than at next AURA_UNIT event
89 | -- K: sending message is more modular than calling the function directly
90 | self:SendMessage("GLADIUSEX_INTERRUPT", unit)
91 |
92 | -- K: Clears the interrupt after end of duration
93 | if duration then
94 | GladiusEx:ScheduleTimer(self.UpdateInterrupt, duration+0.1, self, unit, spellID)
95 | end
96 | end
97 |
98 | function Interrupt:GetInterruptFor(unit)
99 | local interrupts = self.interrupts[unit]
100 | if interrupts == nil then return end
101 |
102 | local aSpellID, icon, duration, endsAt
103 |
104 | -- iterate over all interrupt spellIDs to find the one of highest duration
105 | for spellID, intdata in pairs(interrupts) do
106 | local tmpstartedAt = intdata.started
107 | local dur = intdata.duration
108 | local tmpendsAt = tmpstartedAt + dur
109 | if GetTime() > tmpendsAt then
110 | self.interrupts[unit][spellID] = nil
111 | elseif endsAt == nil or tmpendsAt > endsAt then
112 | endsAt = tmpendsAt
113 | duration = dur
114 | aSpellID, _, icon = GetSpellInfo(spellID)
115 | end
116 | end
117 |
118 | if aSpellID then
119 | return aSpellID, icon, duration, endsAt, self.db[unit].interruptPrio
120 | end
121 | end
122 |
123 | function Interrupt:GetOptions(unit)
124 | -- TODO: enable/disable INTERRUPT_SPEC_MODIFIER, since they are talents, we're just guessing
125 | return {
126 | general = {
127 | type = "group",
128 | name = L["General"],
129 | order = 1,
130 | args = {
131 | sep2 = {
132 | type = "description",
133 | name = "This module shows interrupt durations over the Arena Enemy Class Icons when they are interrupted.",
134 | width = "full",
135 | order = 17,
136 | },
137 | interruptPrio = {
138 | type = "range",
139 | name = "InterruptPrio",
140 | desc = "Sets the priority of interrupts (as compared to regular Class Icon auras)",
141 | disabled = function() return not self:IsUnitEnabled(unit) end,
142 | softMin = 0.0, softMax = 10, step = 0.1,
143 | order = 19,
144 | },
145 | },
146 | },
147 | }
148 | end
149 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0/widgets/AceGUIWidget-Label.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | Label Widget
3 | Displays text and optionally an icon.
4 | -------------------------------------------------------------------------------]]
5 | local Type, Version = "Label", 26
6 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
7 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
8 |
9 | -- Lua APIs
10 | local max, select, pairs = math.max, select, pairs
11 |
12 | -- WoW APIs
13 | local CreateFrame, UIParent = CreateFrame, UIParent
14 |
15 | -- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
16 | -- List them here for Mikk's FindGlobals script
17 | -- GLOBALS: GameFontHighlightSmall
18 |
19 | --[[-----------------------------------------------------------------------------
20 | Support functions
21 | -------------------------------------------------------------------------------]]
22 |
23 | local function UpdateImageAnchor(self)
24 | if self.resizing then return end
25 | local frame = self.frame
26 | local width = frame.width or frame:GetWidth() or 0
27 | local image = self.image
28 | local label = self.label
29 | local height
30 |
31 | label:ClearAllPoints()
32 | image:ClearAllPoints()
33 |
34 | if self.imageshown then
35 | local imagewidth = image:GetWidth()
36 | if (width - imagewidth) < 200 or (label:GetText() or "") == "" then
37 | -- image goes on top centered when less than 200 width for the text, or if there is no text
38 | image:SetPoint("TOP")
39 | label:SetPoint("TOP", image, "BOTTOM")
40 | label:SetPoint("LEFT")
41 | label:SetWidth(width)
42 | height = image:GetHeight() + label:GetStringHeight()
43 | else
44 | -- image on the left
45 | image:SetPoint("TOPLEFT")
46 | if image:GetHeight() > label:GetStringHeight() then
47 | label:SetPoint("LEFT", image, "RIGHT", 4, 0)
48 | else
49 | label:SetPoint("TOPLEFT", image, "TOPRIGHT", 4, 0)
50 | end
51 | label:SetWidth(width - imagewidth - 4)
52 | height = max(image:GetHeight(), label:GetStringHeight())
53 | end
54 | else
55 | -- no image shown
56 | label:SetPoint("TOPLEFT")
57 | label:SetWidth(width)
58 | height = label:GetStringHeight()
59 | end
60 |
61 | -- avoid zero-height labels, since they can used as spacers
62 | if not height or height == 0 then
63 | height = 1
64 | end
65 |
66 | self.resizing = true
67 | frame:SetHeight(height)
68 | frame.height = height
69 | self.resizing = nil
70 | end
71 |
72 | --[[-----------------------------------------------------------------------------
73 | Methods
74 | -------------------------------------------------------------------------------]]
75 | local methods = {
76 | ["OnAcquire"] = function(self)
77 | -- set the flag to stop constant size updates
78 | self.resizing = true
79 | -- height is set dynamically by the text and image size
80 | self:SetWidth(200)
81 | self:SetText()
82 | self:SetImage(nil)
83 | self:SetImageSize(16, 16)
84 | self:SetColor()
85 | self:SetFontObject()
86 | self:SetJustifyH("LEFT")
87 | self:SetJustifyV("TOP")
88 |
89 | -- reset the flag
90 | self.resizing = nil
91 | -- run the update explicitly
92 | UpdateImageAnchor(self)
93 | end,
94 |
95 | -- ["OnRelease"] = nil,
96 |
97 | ["OnWidthSet"] = function(self, width)
98 | UpdateImageAnchor(self)
99 | end,
100 |
101 | ["SetText"] = function(self, text)
102 | self.label:SetText(text)
103 | UpdateImageAnchor(self)
104 | end,
105 |
106 | ["SetColor"] = function(self, r, g, b)
107 | if not (r and g and b) then
108 | r, g, b = 1, 1, 1
109 | end
110 | self.label:SetVertexColor(r, g, b)
111 | end,
112 |
113 | ["SetImage"] = function(self, path, ...)
114 | local image = self.image
115 | image:SetTexture(path)
116 |
117 | if image:GetTexture() then
118 | self.imageshown = true
119 | local n = select("#", ...)
120 | if n == 4 or n == 8 then
121 | image:SetTexCoord(...)
122 | else
123 | image:SetTexCoord(0, 1, 0, 1)
124 | end
125 | else
126 | self.imageshown = nil
127 | end
128 | UpdateImageAnchor(self)
129 | end,
130 |
131 | ["SetFont"] = function(self, font, height, flags)
132 | self.label:SetFont(font, height, flags)
133 | end,
134 |
135 | ["SetFontObject"] = function(self, font)
136 | self:SetFont((font or GameFontHighlightSmall):GetFont())
137 | end,
138 |
139 | ["SetImageSize"] = function(self, width, height)
140 | self.image:SetWidth(width)
141 | self.image:SetHeight(height)
142 | UpdateImageAnchor(self)
143 | end,
144 |
145 | ["SetJustifyH"] = function(self, justifyH)
146 | self.label:SetJustifyH(justifyH)
147 | end,
148 |
149 | ["SetJustifyV"] = function(self, justifyV)
150 | self.label:SetJustifyV(justifyV)
151 | end,
152 | }
153 |
154 | --[[-----------------------------------------------------------------------------
155 | Constructor
156 | -------------------------------------------------------------------------------]]
157 | local function Constructor()
158 | local frame = CreateFrame("Frame", nil, UIParent)
159 | frame:Hide()
160 |
161 | local label = frame:CreateFontString(nil, "BACKGROUND", "GameFontHighlightSmall")
162 | local image = frame:CreateTexture(nil, "BACKGROUND")
163 |
164 | -- create widget
165 | local widget = {
166 | label = label,
167 | image = image,
168 | frame = frame,
169 | type = Type
170 | }
171 | for method, func in pairs(methods) do
172 | widget[method] = func
173 | end
174 |
175 | return AceGUI:RegisterAsWidget(widget)
176 | end
177 |
178 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
179 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Release New Version
2 |
3 | on:
4 | push:
5 | tags:
6 | - 'v*' # Trigger on new tags prefixed with 'v'
7 | workflow_dispatch:
8 | inputs:
9 | tag_name:
10 | description: 'Tag to release (e.g., v1.0.0)'
11 | required: true
12 | branch:
13 | description: 'Branch to use for release'
14 | required: false
15 | default: '' # Default is the branch triggering the workflow
16 | draft:
17 | description: 'Whether the release should be a draft'
18 | required: false
19 | default: 'false' # Default: Not a draft
20 |
21 | env:
22 | PROJECT_NAME: "GladiusEx" # Change this to your project folder name in the .zip
23 |
24 | jobs:
25 | release:
26 | runs-on: ubuntu-latest
27 |
28 | steps:
29 | - name: Determine branch and repo details
30 | id: repo-details
31 | run: |
32 | # Determine branch
33 | if [ "${{ github.event_name }}" == "workflow_dispatch" ] && [ -n "${{ github.event.inputs.branch }}" ]; then
34 | echo "BRANCH=${{ github.event.inputs.branch }}" >> $GITHUB_ENV
35 | else
36 | echo "BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
37 | fi
38 |
39 | # Use GITHUB_REPOSITORY to determine repo name
40 | REPO_NAME=$(echo "${GITHUB_REPOSITORY}" | cut -d '/' -f 2)
41 | if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
42 | TAG="${{ github.event.inputs.tag_name }}"
43 | else
44 | TAG=${{ github.ref_name }}
45 | fi
46 | FINAL_FOLDER="${PROJECT_NAME}"
47 | echo "REPO_NAME=${REPO_NAME}" >> $GITHUB_ENV
48 | echo "TAG=${TAG}" >> $GITHUB_ENV
49 | echo "FINAL_FOLDER=${FINAL_FOLDER}" >> $GITHUB_ENV
50 |
51 | - name: Checkout repository
52 | uses: actions/checkout@v3
53 | with:
54 | ref: ${{ env.BRANCH }}
55 | submodules: recursive # Ensures submodules are checked out
56 | fetch-depth: 0 # Fetch all history and tags
57 |
58 | - name: Update submodules to latest release
59 | run: |
60 | git submodule foreach --recursive '
61 | echo "Processing submodule: $name"
62 | LATEST_TAG=$(git tag --sort=-v:refname | head -n 1)
63 | if [ -z "$LATEST_TAG" ]; then
64 | echo "No tags found for $name; using latest commit."
65 | git checkout HEAD
66 | else
67 | echo "Checking out latest release tag: $LATEST_TAG"
68 | git checkout $LATEST_TAG
69 | fi
70 | '
71 |
72 | - name: Configure Git user
73 | run: |
74 | git config user.name "github-actions[bot]"
75 | git config user.email "github-actions[bot]@users.noreply.github.com"
76 |
77 | - name: Prepare release folder
78 | run: |
79 | # Create a clean folder for the project
80 | rm -rf ${{ env.FINAL_FOLDER }}
81 | mkdir -p ${{ env.FINAL_FOLDER }}
82 |
83 | # Use rsync to copy all repository content into FINAL_FOLDER, while excluding unwanted files
84 | rsync -av --exclude='.github/' --exclude='*.txt' --exclude='README*' \
85 | --exclude='.git*' --exclude='.gitmodules' ./ ${{ env.FINAL_FOLDER }}/
86 |
87 | # Check for any nested duplication of FINAL_FOLDER and remove it
88 | if [ -d "${{ env.FINAL_FOLDER }}/${{ env.FINAL_FOLDER }}" ]; then
89 | echo "Removing nested duplicate folder..."
90 | rm -rf ${{ env.FINAL_FOLDER }}/${{ env.FINAL_FOLDER }}
91 | fi
92 |
93 | - name: Create a zip file with a clean structure
94 | run: |
95 | # Create a release folder and move FINAL_FOLDER contents into PROJECT_NAME
96 | mkdir -p release/${{ env.PROJECT_NAME }}
97 | mv ${{ env.FINAL_FOLDER }}/* release/${{ env.PROJECT_NAME }}/
98 | rm -rf ${{ env.FINAL_FOLDER }}
99 |
100 | # Create the zip from the release folder, keeping the desired structure
101 | cd release
102 | zip -r "${{ env.PROJECT_NAME }}-${{ env.TAG }}.zip" "${{ env.PROJECT_NAME }}"
103 | mv "${{ env.PROJECT_NAME }}-${{ env.TAG }}.zip" ../
104 |
105 | # Cleanup the release folder after zipping
106 | cd ..
107 | rm -rf release
108 |
109 |
110 | - name: Generate release notes file
111 | env:
112 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
113 | run: |
114 | # Get the last non-draft release tag
115 | LAST_RELEASE=$(gh release list --exclude-drafts --limit 1 --json tagName --jq '.[].tagName')
116 |
117 | if [ -z "$LAST_RELEASE" ]; then
118 | echo "No previous release found; using initial commit."
119 | echo -e "Content:\n\nInitial release." > release-notes.txt
120 | else
121 | echo "Last release: $LAST_RELEASE"
122 | echo -e "Content:\n" > release-notes.txt
123 | git log $LAST_RELEASE..HEAD --pretty=format:"* %s" >> release-notes.txt
124 | fi
125 |
126 | - name: Verify zip contents
127 | run: |
128 | echo "Contents of the zip file:"
129 | unzip -l "${{ env.PROJECT_NAME }}-${{ env.TAG }}.zip"
130 |
131 | - name: Create GitHub release with zip and notes file
132 | run: |
133 | if [ "${{ github.event.inputs.draft }}" == "true" ]; then
134 | gh release create "${{ env.TAG }}" \
135 | --title "${{ env.PROJECT_NAME }}-${{ env.TAG }}" \
136 | --notes-file release-notes.txt \
137 | --draft \
138 | "${{ env.PROJECT_NAME }}-${{ env.TAG }}.zip"
139 | else
140 | gh release create "${{ env.TAG }}" \
141 | --title "${{ env.PROJECT_NAME }}-${{ env.TAG }}" \
142 | --notes-file release-notes.txt \
143 | "${{ env.PROJECT_NAME }}-${{ env.TAG }}.zip"
144 | fi
145 | env:
146 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
147 |
148 | - name: Verify GitHub release
149 | run: |
150 | gh release view "${{ env.TAG }}"
151 | env:
152 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
--------------------------------------------------------------------------------
/libs/AceGUI-3.0-SharedMediaWidgets/Changelog-AceGUI-3.0-SharedMediaWidgets-r32.txt:
--------------------------------------------------------------------------------
1 | ------------------------------------------------------------------------
2 | r32 | yssaril | 2010-07-22 19:41:17 +0000 (Thu, 22 Jul 2010) | 1 line
3 | Changed paths:
4 | M /trunk/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua
5 | M /trunk/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua
6 | M /trunk/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua
7 | M /trunk/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua
8 | M /trunk/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua
9 |
10 | forgot to bump the widget version numbers
11 | ------------------------------------------------------------------------
12 | r31 | yssaril | 2010-07-21 21:27:09 +0000 (Wed, 21 Jul 2010) | 1 line
13 | Changed paths:
14 | M /trunk/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua
15 | M /trunk/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua
16 | M /trunk/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua
17 | M /trunk/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua
18 | M /trunk/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua
19 |
20 | fix a backward compatibility issue with addons still using t[name] = name tables instead of the LSM hash table t[name] = path. (should now give those addons previews of the selections again)
21 | ------------------------------------------------------------------------
22 | r30 | yssaril | 2010-07-21 19:56:18 +0000 (Wed, 21 Jul 2010) | 1 line
23 | Changed paths:
24 | M /trunk/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua
25 | M /trunk/AceGUI-3.0-SharedMediaWidgets/prototypes.lua
26 |
27 | cosmetic alignment fix of the StatusbarWidget
28 | ------------------------------------------------------------------------
29 | r28 | yssaril | 2010-07-14 04:11:26 +0000 (Wed, 14 Jul 2010) | 1 line
30 | Changed paths:
31 | M /trunk/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua
32 | M /trunk/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua
33 | M /trunk/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua
34 | M /trunk/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua
35 | M /trunk/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua
36 |
37 | Get AceGUI focus before we generate the dropdown (reduces frame creation)
38 | ------------------------------------------------------------------------
39 | r27 | yssaril | 2010-07-13 14:51:57 +0000 (Tue, 13 Jul 2010) | 1 line
40 | Changed paths:
41 | M /trunk/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua
42 | M /trunk/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua
43 | M /trunk/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua
44 | M /trunk/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua
45 | M /trunk/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua
46 | M /trunk/AceGUI-3.0-SharedMediaWidgets/prototypes.lua
47 |
48 | widgets could error out if the old ones loaded after the new ones. Should be fixed now (LibStub to the rescue)
49 | ------------------------------------------------------------------------
50 | r26 | yssaril | 2010-07-12 22:09:59 +0000 (Mon, 12 Jul 2010) | 1 line
51 | Changed paths:
52 | M /trunk/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua
53 | M /trunk/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua
54 | M /trunk/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua
55 | M /trunk/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua
56 | M /trunk/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua
57 |
58 | widgets will now once again auto populate if a nil list is set
59 | ------------------------------------------------------------------------
60 | r25 | yssaril | 2010-07-12 19:45:14 +0000 (Mon, 12 Jul 2010) | 1 line
61 | Changed paths:
62 | M /trunk/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua
63 | M /trunk/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua
64 | M /trunk/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua
65 | M /trunk/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua
66 | M /trunk/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua
67 |
68 | forgot to bump widget version number
69 | ------------------------------------------------------------------------
70 | r24 | yssaril | 2010-07-12 19:44:14 +0000 (Mon, 12 Jul 2010) | 1 line
71 | Changed paths:
72 | M /trunk/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua
73 | M /trunk/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua
74 | M /trunk/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua
75 | M /trunk/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua
76 | M /trunk/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua
77 | M /trunk/AceGUI-3.0-SharedMediaWidgets/prototypes.lua
78 |
79 | fixed global number nil error. sorry about that. (also removed all trailing spaces)
80 | ------------------------------------------------------------------------
81 | r23 | yssaril | 2010-07-12 06:55:27 +0000 (Mon, 12 Jul 2010) | 1 line
82 | Changed paths:
83 | M /trunk/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua
84 | M /trunk/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua
85 | M /trunk/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua
86 | D /trunk/AceGUI-3.0-SharedMediaWidgets/SharedFunctions.lua
87 | M /trunk/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua
88 | M /trunk/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua
89 | A /trunk/AceGUI-3.0-SharedMediaWidgets/prototypes.lua
90 | M /trunk/AceGUI-3.0-SharedMediaWidgets/widget.xml
91 | M /trunk/AceGUI-3.0-SharedMediaWidgets.toc
92 |
93 | Complete recoding of all widgets. They no longer leach of the Dropdown widget. Nothing changed API wise.
94 | ------------------------------------------------------------------------
95 | r22 | nevcairiel | 2010-02-09 20:09:10 +0000 (Tue, 09 Feb 2010) | 1 line
96 | Changed paths:
97 | M /trunk/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua
98 | M /trunk/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua
99 | M /trunk/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua
100 | M /trunk/AceGUI-3.0-SharedMediaWidgets/SharedFunctions.lua
101 | M /trunk/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua
102 | M /trunk/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua
103 |
104 | Check if the pullout is still open before trying to close it, hopefully fixing a rare error occuring when selecting an option in the dropdown.
105 | ------------------------------------------------------------------------
106 |
--------------------------------------------------------------------------------
/libs/AceLocale-3.0/AceLocale-3.0.lua:
--------------------------------------------------------------------------------
1 | --- **AceLocale-3.0** manages localization in addons, allowing for multiple locale to be registered with fallback to the base locale for untranslated strings.
2 | -- @class file
3 | -- @name AceLocale-3.0
4 | -- @release $Id: AceLocale-3.0.lua 895 2009-12-06 16:28:55Z nevcairiel $
5 | local MAJOR,MINOR = "AceLocale-3.0", 2
6 |
7 | local AceLocale, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
8 |
9 | if not AceLocale then return end -- no upgrade needed
10 |
11 | -- Lua APIs
12 | local assert, tostring, error = assert, tostring, error
13 | local setmetatable, rawset, rawget = setmetatable, rawset, rawget
14 |
15 | -- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
16 | -- List them here for Mikk's FindGlobals script
17 | -- GLOBALS: GAME_LOCALE, geterrorhandler
18 |
19 | local gameLocale = GetLocale()
20 | if gameLocale == "enGB" then
21 | gameLocale = "enUS"
22 | end
23 |
24 | AceLocale.apps = AceLocale.apps or {} -- array of ["AppName"]=localetableref
25 | AceLocale.appnames = AceLocale.appnames or {} -- array of [localetableref]="AppName"
26 |
27 | -- This metatable is used on all tables returned from GetLocale
28 | local readmeta = {
29 | __index = function(self, key) -- requesting totally unknown entries: fire off a nonbreaking error and return key
30 | rawset(self, key, key) -- only need to see the warning once, really
31 | geterrorhandler()(MAJOR..": "..tostring(AceLocale.appnames[self])..": Missing entry for '"..tostring(key).."'")
32 | return key
33 | end
34 | }
35 |
36 | -- This metatable is used on all tables returned from GetLocale if the silent flag is true, it does not issue a warning on unknown keys
37 | local readmetasilent = {
38 | __index = function(self, key) -- requesting totally unknown entries: return key
39 | rawset(self, key, key) -- only need to invoke this function once
40 | return key
41 | end
42 | }
43 |
44 | -- Remember the locale table being registered right now (it gets set by :NewLocale())
45 | -- NOTE: Do never try to register 2 locale tables at once and mix their definition.
46 | local registering
47 |
48 | -- local assert false function
49 | local assertfalse = function() assert(false) end
50 |
51 | -- This metatable proxy is used when registering nondefault locales
52 | local writeproxy = setmetatable({}, {
53 | __newindex = function(self, key, value)
54 | rawset(registering, key, value == true and key or value) -- assigning values: replace 'true' with key string
55 | end,
56 | __index = assertfalse
57 | })
58 |
59 | -- This metatable proxy is used when registering the default locale.
60 | -- It refuses to overwrite existing values
61 | -- Reason 1: Allows loading locales in any order
62 | -- Reason 2: If 2 modules have the same string, but only the first one to be
63 | -- loaded has a translation for the current locale, the translation
64 | -- doesn't get overwritten.
65 | --
66 | local writedefaultproxy = setmetatable({}, {
67 | __newindex = function(self, key, value)
68 | if not rawget(registering, key) then
69 | rawset(registering, key, value == true and key or value)
70 | end
71 | end,
72 | __index = assertfalse
73 | })
74 |
75 | --- Register a new locale (or extend an existing one) for the specified application.
76 | -- :NewLocale will return a table you can fill your locale into, or nil if the locale isn't needed for the players
77 | -- game locale.
78 | -- @paramsig application, locale[, isDefault[, silent]]
79 | -- @param application Unique name of addon / module
80 | -- @param locale Name of the locale to register, e.g. "enUS", "deDE", etc.
81 | -- @param isDefault If this is the default locale being registered (your addon is written in this language, generally enUS)
82 | -- @param silent If true, the locale will not issue warnings for missing keys. Can only be set on the default locale.
83 | -- @usage
84 | -- -- enUS.lua
85 | -- local L = LibStub("AceLocale-3.0"):NewLocale("TestLocale", "enUS", true)
86 | -- L["string1"] = true
87 | --
88 | -- -- deDE.lua
89 | -- local L = LibStub("AceLocale-3.0"):NewLocale("TestLocale", "deDE")
90 | -- if not L then return end
91 | -- L["string1"] = "Zeichenkette1"
92 | -- @return Locale Table to add localizations to, or nil if the current locale is not required.
93 | function AceLocale:NewLocale(application, locale, isDefault, silent)
94 |
95 | if silent and not isDefault then
96 | error("Usage: NewLocale(application, locale[, isDefault[, silent]]): 'silent' can only be specified for the default locale", 2)
97 | end
98 |
99 | -- GAME_LOCALE allows translators to test translations of addons without having that wow client installed
100 | -- Ammo: I still think this is a bad idea, for instance an addon that checks for some ingame string will fail, just because some other addon
101 | -- gives the user the illusion that they can run in a different locale? Ditch this whole thing or allow a setting per 'application'. I'm of the
102 | -- opinion to remove this.
103 | local gameLocale = GAME_LOCALE or gameLocale
104 |
105 | if locale ~= gameLocale and not isDefault then
106 | return -- nop, we don't need these translations
107 | end
108 |
109 | local app = AceLocale.apps[application]
110 |
111 | if not app then
112 | app = setmetatable({}, silent and readmetasilent or readmeta)
113 | AceLocale.apps[application] = app
114 | AceLocale.appnames[app] = application
115 | end
116 |
117 | registering = app -- remember globally for writeproxy and writedefaultproxy
118 |
119 | if isDefault then
120 | return writedefaultproxy
121 | end
122 |
123 | return writeproxy
124 | end
125 |
126 | --- Returns localizations for the current locale (or default locale if translations are missing).
127 | -- Errors if nothing is registered (spank developer, not just a missing translation)
128 | -- @param application Unique name of addon / module
129 | -- @param silent If true, the locale is optional, silently return nil if it's not found (defaults to false, optional)
130 | -- @return The locale table for the current language.
131 | function AceLocale:GetLocale(application, silent)
132 | if not silent and not AceLocale.apps[application] then
133 | error("Usage: GetLocale(application[, silent]): 'application' - No locales registered for '"..tostring(application).."'", 2)
134 | end
135 | return AceLocale.apps[application]
136 | end
137 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | ColorPicker Widget
3 | -------------------------------------------------------------------------------]]
4 | local Type, Version = "ColorPicker", 22
5 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
6 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
7 |
8 | -- Lua APIs
9 | local pairs = pairs
10 |
11 | -- WoW APIs
12 | local CreateFrame, UIParent = CreateFrame, UIParent
13 |
14 | -- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
15 | -- List them here for Mikk's FindGlobals script
16 | -- GLOBALS: ShowUIPanel, HideUIPanel, ColorPickerFrame, OpacitySliderFrame
17 |
18 | --[[-----------------------------------------------------------------------------
19 | Support functions
20 | -------------------------------------------------------------------------------]]
21 | local function ColorCallback(self, r, g, b, a, isAlpha)
22 | if not self.HasAlpha then
23 | a = 1
24 | end
25 | self:SetColor(r, g, b, a)
26 | if ColorPickerFrame:IsVisible() then
27 | --colorpicker is still open
28 | self:Fire("OnValueChanged", r, g, b, a)
29 | else
30 | --colorpicker is closed, color callback is first, ignore it,
31 | --alpha callback is the final call after it closes so confirm now
32 | if isAlpha then
33 | self:Fire("OnValueConfirmed", r, g, b, a)
34 | end
35 | end
36 | end
37 |
38 | --[[-----------------------------------------------------------------------------
39 | Scripts
40 | -------------------------------------------------------------------------------]]
41 | local function Control_OnEnter(frame)
42 | frame.obj:Fire("OnEnter")
43 | end
44 |
45 | local function Control_OnLeave(frame)
46 | frame.obj:Fire("OnLeave")
47 | end
48 |
49 | local function ColorSwatch_OnClick(frame)
50 | HideUIPanel(ColorPickerFrame)
51 | local self = frame.obj
52 | if not self.disabled then
53 | ColorPickerFrame:SetFrameStrata("FULLSCREEN_DIALOG")
54 | ColorPickerFrame:SetFrameLevel(frame:GetFrameLevel() + 10)
55 | ColorPickerFrame:SetClampedToScreen(true)
56 |
57 | ColorPickerFrame.func = function()
58 | local r, g, b = ColorPickerFrame:GetColorRGB()
59 | local a = 1 - OpacitySliderFrame:GetValue()
60 | ColorCallback(self, r, g, b, a)
61 | end
62 |
63 | ColorPickerFrame.hasOpacity = self.HasAlpha
64 | ColorPickerFrame.opacityFunc = function()
65 | local r, g, b = ColorPickerFrame:GetColorRGB()
66 | local a = 1 - OpacitySliderFrame:GetValue()
67 | ColorCallback(self, r, g, b, a, true)
68 | end
69 |
70 | local r, g, b, a = self.r, self.g, self.b, self.a
71 | if self.HasAlpha then
72 | ColorPickerFrame.opacity = 1 - (a or 0)
73 | end
74 | ColorPickerFrame:SetColorRGB(r, g, b)
75 |
76 | ColorPickerFrame.cancelFunc = function()
77 | ColorCallback(self, r, g, b, a, true)
78 | end
79 |
80 | ShowUIPanel(ColorPickerFrame)
81 | end
82 | AceGUI:ClearFocus()
83 | end
84 |
85 | --[[-----------------------------------------------------------------------------
86 | Methods
87 | -------------------------------------------------------------------------------]]
88 | local methods = {
89 | ["OnAcquire"] = function(self)
90 | self:SetHeight(24)
91 | self:SetWidth(200)
92 | self:SetHasAlpha(false)
93 | self:SetColor(0, 0, 0, 1)
94 | self:SetDisabled(nil)
95 | self:SetLabel(nil)
96 | end,
97 |
98 | -- ["OnRelease"] = nil,
99 |
100 | ["SetLabel"] = function(self, text)
101 | self.text:SetText(text)
102 | end,
103 |
104 | ["SetColor"] = function(self, r, g, b, a)
105 | self.r = r
106 | self.g = g
107 | self.b = b
108 | self.a = a or 1
109 | self.colorSwatch:SetVertexColor(r, g, b, a)
110 | end,
111 |
112 | ["SetHasAlpha"] = function(self, HasAlpha)
113 | self.HasAlpha = HasAlpha
114 | end,
115 |
116 | ["SetDisabled"] = function(self, disabled)
117 | self.disabled = disabled
118 | if self.disabled then
119 | self.frame:Disable()
120 | self.text:SetTextColor(0.5, 0.5, 0.5)
121 | else
122 | self.frame:Enable()
123 | self.text:SetTextColor(1, 1, 1)
124 | end
125 | end
126 | }
127 |
128 | --[[-----------------------------------------------------------------------------
129 | Constructor
130 | -------------------------------------------------------------------------------]]
131 | local function Constructor()
132 | local frame = CreateFrame("Button", nil, UIParent)
133 | frame:Hide()
134 |
135 | frame:EnableMouse(true)
136 | frame:SetScript("OnEnter", Control_OnEnter)
137 | frame:SetScript("OnLeave", Control_OnLeave)
138 | frame:SetScript("OnClick", ColorSwatch_OnClick)
139 |
140 | local colorSwatch = frame:CreateTexture(nil, "OVERLAY")
141 | colorSwatch:SetWidth(19)
142 | colorSwatch:SetHeight(19)
143 | colorSwatch:SetTexture("Interface\\ChatFrame\\ChatFrameColorSwatch")
144 | colorSwatch:SetPoint("LEFT")
145 |
146 | local texture = frame:CreateTexture(nil, "BACKGROUND")
147 | texture:SetWidth(16)
148 | texture:SetHeight(16)
149 | texture:SetTexture(1, 1, 1)
150 | texture:SetPoint("CENTER", colorSwatch)
151 | texture:Show()
152 |
153 | local checkers = frame:CreateTexture(nil, "BACKGROUND")
154 | checkers:SetWidth(14)
155 | checkers:SetHeight(14)
156 | checkers:SetTexture("Tileset\\Generic\\Checkers")
157 | checkers:SetTexCoord(.25, 0, 0.5, .25)
158 | checkers:SetDesaturated(true)
159 | checkers:SetVertexColor(1, 1, 1, 0.75)
160 | checkers:SetPoint("CENTER", colorSwatch)
161 | checkers:Show()
162 |
163 | local text = frame:CreateFontString(nil,"OVERLAY","GameFontHighlight")
164 | text:SetHeight(24)
165 | text:SetJustifyH("LEFT")
166 | text:SetTextColor(1, 1, 1)
167 | text:SetPoint("LEFT", colorSwatch, "RIGHT", 2, 0)
168 | text:SetPoint("RIGHT")
169 |
170 | --local highlight = frame:CreateTexture(nil, "HIGHLIGHT")
171 | --highlight:SetTexture("Interface\\QuestFrame\\UI-QuestTitleHighlight")
172 | --highlight:SetBlendMode("ADD")
173 | --highlight:SetAllPoints(frame)
174 |
175 | local widget = {
176 | colorSwatch = colorSwatch,
177 | text = text,
178 | frame = frame,
179 | type = Type
180 | }
181 | for method, func in pairs(methods) do
182 | widget[method] = func
183 | end
184 |
185 | return AceGUI:RegisterAsWidget(widget)
186 | end
187 |
188 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
189 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | ColorPicker Widget
3 | -------------------------------------------------------------------------------]]
4 | local Type, Version = "ColorPicker", 25
5 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
6 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
7 |
8 | -- Lua APIs
9 | local pairs = pairs
10 |
11 | -- WoW APIs
12 | local CreateFrame, UIParent = CreateFrame, UIParent
13 |
14 | -- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
15 | -- List them here for Mikk's FindGlobals script
16 | -- GLOBALS: ColorPickerFrame, OpacitySliderFrame
17 |
18 | --[[-----------------------------------------------------------------------------
19 | Support functions
20 | -------------------------------------------------------------------------------]]
21 | local function ColorCallback(self, r, g, b, a, isAlpha)
22 | if not self.HasAlpha then
23 | a = 1
24 | end
25 | self:SetColor(r, g, b, a)
26 | if ColorPickerFrame:IsVisible() then
27 | --colorpicker is still open
28 | self:Fire("OnValueChanged", r, g, b, a)
29 | else
30 | --colorpicker is closed, color callback is first, ignore it,
31 | --alpha callback is the final call after it closes so confirm now
32 | if isAlpha then
33 | self:Fire("OnValueConfirmed", r, g, b, a)
34 | end
35 | end
36 | end
37 |
38 | --[[-----------------------------------------------------------------------------
39 | Scripts
40 | -------------------------------------------------------------------------------]]
41 | local function Control_OnEnter(frame)
42 | frame.obj:Fire("OnEnter")
43 | end
44 |
45 | local function Control_OnLeave(frame)
46 | frame.obj:Fire("OnLeave")
47 | end
48 |
49 | local function ColorSwatch_OnClick(frame)
50 | ColorPickerFrame:Hide()
51 | local self = frame.obj
52 | if not self.disabled then
53 | ColorPickerFrame:SetFrameStrata("FULLSCREEN_DIALOG")
54 | ColorPickerFrame:SetFrameLevel(frame:GetFrameLevel() + 10)
55 | ColorPickerFrame:SetClampedToScreen(true)
56 |
57 | ColorPickerFrame.func = function()
58 | local r, g, b = ColorPickerFrame:GetColorRGB()
59 | local a = 1 - OpacitySliderFrame:GetValue()
60 | ColorCallback(self, r, g, b, a)
61 | end
62 |
63 | ColorPickerFrame.hasOpacity = self.HasAlpha
64 | ColorPickerFrame.opacityFunc = function()
65 | local r, g, b = ColorPickerFrame:GetColorRGB()
66 | local a = 1 - OpacitySliderFrame:GetValue()
67 | ColorCallback(self, r, g, b, a, true)
68 | end
69 |
70 | local r, g, b, a = self.r, self.g, self.b, self.a
71 | if self.HasAlpha then
72 | ColorPickerFrame.opacity = 1 - (a or 0)
73 | end
74 | ColorPickerFrame:SetColorRGB(r, g, b)
75 |
76 | ColorPickerFrame.cancelFunc = function()
77 | ColorCallback(self, r, g, b, a, true)
78 | end
79 |
80 | ColorPickerFrame:Show()
81 | end
82 | AceGUI:ClearFocus()
83 | end
84 |
85 | --[[-----------------------------------------------------------------------------
86 | Methods
87 | -------------------------------------------------------------------------------]]
88 | local methods = {
89 | ["OnAcquire"] = function(self)
90 | self:SetHeight(24)
91 | self:SetWidth(200)
92 | self:SetHasAlpha(false)
93 | self:SetColor(0, 0, 0, 1)
94 | self:SetDisabled(nil)
95 | self:SetLabel(nil)
96 | end,
97 |
98 | -- ["OnRelease"] = nil,
99 |
100 | ["SetLabel"] = function(self, text)
101 | self.text:SetText(text)
102 | end,
103 |
104 | ["SetColor"] = function(self, r, g, b, a)
105 | self.r = r
106 | self.g = g
107 | self.b = b
108 | self.a = a or 1
109 | self.colorSwatch:SetVertexColor(r, g, b, a)
110 | end,
111 |
112 | ["SetHasAlpha"] = function(self, HasAlpha)
113 | self.HasAlpha = HasAlpha
114 | end,
115 |
116 | ["SetDisabled"] = function(self, disabled)
117 | self.disabled = disabled
118 | if self.disabled then
119 | self.frame:Disable()
120 | self.text:SetTextColor(0.5, 0.5, 0.5)
121 | else
122 | self.frame:Enable()
123 | self.text:SetTextColor(1, 1, 1)
124 | end
125 | end
126 | }
127 |
128 | --[[-----------------------------------------------------------------------------
129 | Constructor
130 | -------------------------------------------------------------------------------]]
131 | local function Constructor()
132 | local frame = CreateFrame("Button", nil, UIParent)
133 | frame:Hide()
134 |
135 | frame:EnableMouse(true)
136 | frame:SetScript("OnEnter", Control_OnEnter)
137 | frame:SetScript("OnLeave", Control_OnLeave)
138 | frame:SetScript("OnClick", ColorSwatch_OnClick)
139 |
140 | local colorSwatch = frame:CreateTexture(nil, "OVERLAY")
141 | colorSwatch:SetWidth(19)
142 | colorSwatch:SetHeight(19)
143 | colorSwatch:SetTexture("Interface\\ChatFrame\\ChatFrameColorSwatch")
144 | colorSwatch:SetPoint("LEFT")
145 |
146 | local texture = frame:CreateTexture(nil, "BACKGROUND")
147 | colorSwatch.background = texture
148 | texture:SetWidth(16)
149 | texture:SetHeight(16)
150 | texture:SetTexture(1, 1, 1)
151 | texture:SetPoint("CENTER", colorSwatch)
152 | texture:Show()
153 |
154 | local checkers = frame:CreateTexture(nil, "BACKGROUND")
155 | colorSwatch.checkers = checkers
156 | checkers:SetWidth(14)
157 | checkers:SetHeight(14)
158 | checkers:SetTexture("Tileset\\Generic\\Checkers")
159 | checkers:SetTexCoord(.25, 0, 0.5, .25)
160 | checkers:SetDesaturated(true)
161 | checkers:SetVertexColor(1, 1, 1, 0.75)
162 | checkers:SetPoint("CENTER", colorSwatch)
163 | checkers:Show()
164 |
165 | local text = frame:CreateFontString(nil,"OVERLAY","GameFontHighlight")
166 | text:SetHeight(24)
167 | text:SetJustifyH("LEFT")
168 | text:SetTextColor(1, 1, 1)
169 | text:SetPoint("LEFT", colorSwatch, "RIGHT", 2, 0)
170 | text:SetPoint("RIGHT")
171 |
172 | --local highlight = frame:CreateTexture(nil, "HIGHLIGHT")
173 | --highlight:SetTexture("Interface\\QuestFrame\\UI-QuestTitleHighlight")
174 | --highlight:SetBlendMode("ADD")
175 | --highlight:SetAllPoints(frame)
176 |
177 | local widget = {
178 | colorSwatch = colorSwatch,
179 | text = text,
180 | frame = frame,
181 | type = Type
182 | }
183 | for method, func in pairs(methods) do
184 | widget[method] = func
185 | end
186 |
187 | return AceGUI:RegisterAsWidget(widget)
188 | end
189 |
190 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
191 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua:
--------------------------------------------------------------------------------
1 | -- Widget is based on the AceGUIWidget-DropDown.lua supplied with AceGUI-3.0
2 | -- Widget created by Yssaril
3 |
4 | local AceGUI = LibStub("AceGUI-3.0")
5 | local Media = LibStub("LibSharedMedia-3.0")
6 |
7 | local AGSMW = LibStub("AceGUISharedMediaWidgets-1.0")
8 |
9 | do
10 | local widgetType = "LSM30_Font"
11 | local widgetVersion = 12
12 |
13 | local contentFrameCache = {}
14 | local function ReturnSelf(self)
15 | self:ClearAllPoints()
16 | self:Hide()
17 | self.check:Hide()
18 | table.insert(contentFrameCache, self)
19 | end
20 |
21 | local function ContentOnClick(this, button)
22 | local self = this.obj
23 | self:Fire("OnValueChanged", this.text:GetText())
24 | if self.dropdown then
25 | self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
26 | end
27 | end
28 |
29 | local function GetContentLine()
30 | local frame
31 | if next(contentFrameCache) then
32 | frame = table.remove(contentFrameCache)
33 | else
34 | frame = CreateFrame("Button", nil, UIParent)
35 | --frame:SetWidth(200)
36 | frame:SetHeight(18)
37 | frame:SetHighlightTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]], "ADD")
38 | frame:SetScript("OnClick", ContentOnClick)
39 | local check = frame:CreateTexture("OVERLAY")
40 | check:SetWidth(16)
41 | check:SetHeight(16)
42 | check:SetPoint("LEFT",frame,"LEFT",1,-1)
43 | check:SetTexture("Interface\\Buttons\\UI-CheckBox-Check")
44 | check:Hide()
45 | frame.check = check
46 | local text = frame:CreateFontString(nil,"OVERLAY","GameFontWhite")
47 | text:SetPoint("TOPLEFT", check, "TOPRIGHT", 1, 0)
48 | text:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -2, 0)
49 | text:SetJustifyH("LEFT")
50 | text:SetText("Test Test Test Test Test Test Test")
51 | frame.text = text
52 | frame.ReturnSelf = ReturnSelf
53 | end
54 | frame:Show()
55 | return frame
56 | end
57 |
58 | local function OnAcquire(self)
59 | self:SetHeight(44)
60 | self:SetWidth(200)
61 | end
62 |
63 | local function OnRelease(self)
64 | self:SetText("")
65 | self:SetLabel("")
66 | self:SetDisabled(false)
67 |
68 | self.value = nil
69 | self.list = nil
70 | self.open = nil
71 | self.hasClose = nil
72 |
73 | self.frame:ClearAllPoints()
74 | self.frame:Hide()
75 | end
76 |
77 | local function SetValue(self, value) -- Set the value to an item in the List.
78 | if self.list then
79 | self:SetText(value or "")
80 | end
81 | self.value = value
82 | end
83 |
84 | local function GetValue(self)
85 | return self.value
86 | end
87 |
88 | local function SetList(self, list) -- Set the list of values for the dropdown (key => value pairs)
89 | self.list = list or Media:HashTable("font")
90 | end
91 |
92 | local function SetText(self, text) -- Set the text displayed in the box.
93 | self.frame.text:SetText(text or "")
94 | local font = self.list[text] ~= text and self.list[text] or Media:Fetch('font',text)
95 | local _, size, outline= self.frame.text:GetFont()
96 | self.frame.text:SetFont(font,size,outline)
97 | end
98 |
99 | local function SetLabel(self, text) -- Set the text for the label.
100 | self.frame.label:SetText(text or "")
101 | end
102 |
103 | local function AddItem(self, key, value) -- Add an item to the list.
104 | self.list = self.list or {}
105 | self.list[key] = value
106 | end
107 | local SetItemValue = AddItem -- Set the value of a item in the list. <>
108 |
109 | local function SetMultiselect(self, flag) end -- Toggle multi-selecting. <>
110 | local function GetMultiselect() return false end-- Query the multi-select flag. <>
111 | local function SetItemDisabled(self, key) end-- Disable one item in the list. <>
112 |
113 | local function SetDisabled(self, disabled) -- Disable the widget.
114 | self.disabled = disabled
115 | if disabled then
116 | self.frame:Disable()
117 | else
118 | self.frame:Enable()
119 | end
120 | end
121 |
122 | local function textSort(a,b)
123 | return string.upper(a) < string.upper(b)
124 | end
125 |
126 | local sortedlist = {}
127 | local function ToggleDrop(this)
128 | local self = this.obj
129 | if self.dropdown then
130 | self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
131 | AceGUI:ClearFocus()
132 | else
133 | AceGUI:SetFocus(self)
134 | self.dropdown = AGSMW:GetDropDownFrame()
135 | local width = self.frame:GetWidth()
136 | self.dropdown:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT")
137 | self.dropdown:SetPoint("TOPRIGHT", self.frame, "BOTTOMRIGHT", width < 160 and (160 - width) or 0, 0)
138 | for k, v in pairs(self.list) do
139 | sortedlist[#sortedlist+1] = k
140 | end
141 | table.sort(sortedlist, textSort)
142 | for i, k in ipairs(sortedlist) do
143 | local f = GetContentLine()
144 | local _, size, outline= f.text:GetFont()
145 | local font = self.list[k] ~= k and self.list[k] or Media:Fetch('font',k)
146 | f.text:SetFont(font,size,outline)
147 | f.text:SetText(k)
148 | if k == self.value then
149 | f.check:Show()
150 | end
151 | f.obj = self
152 | self.dropdown:AddFrame(f)
153 | end
154 | wipe(sortedlist)
155 | end
156 | end
157 |
158 | local function ClearFocus(self)
159 | if self.dropdown then
160 | self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
161 | end
162 | end
163 |
164 | local function OnHide(this)
165 | local self = this.obj
166 | if self.dropdown then
167 | self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
168 | end
169 | end
170 |
171 | local function Drop_OnEnter(this)
172 | this.obj:Fire("OnEnter")
173 | end
174 |
175 | local function Drop_OnLeave(this)
176 | this.obj:Fire("OnLeave")
177 | end
178 |
179 | local function Constructor()
180 | local frame = AGSMW:GetBaseFrame()
181 | local self = {}
182 |
183 | self.type = widgetType
184 | self.frame = frame
185 | frame.obj = self
186 | frame.dropButton.obj = self
187 | frame.dropButton:SetScript("OnEnter", Drop_OnEnter)
188 | frame.dropButton:SetScript("OnLeave", Drop_OnLeave)
189 | frame.dropButton:SetScript("OnClick",ToggleDrop)
190 | frame:SetScript("OnHide", OnHide)
191 |
192 | self.alignoffset = 31
193 |
194 | self.OnRelease = OnRelease
195 | self.OnAcquire = OnAcquire
196 | self.ClearFocus = ClearFocus
197 | self.SetText = SetText
198 | self.SetValue = SetValue
199 | self.GetValue = GetValue
200 | self.SetList = SetList
201 | self.SetLabel = SetLabel
202 | self.SetDisabled = SetDisabled
203 | self.AddItem = AddItem
204 | self.SetMultiselect = SetMultiselect
205 | self.GetMultiselect = GetMultiselect
206 | self.SetItemValue = SetItemValue
207 | self.SetItemDisabled = SetItemDisabled
208 | self.ToggleDrop = ToggleDrop
209 |
210 | AceGUI:RegisterAsWidget(self)
211 | return self
212 | end
213 |
214 | AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion)
215 |
216 | end
217 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua:
--------------------------------------------------------------------------------
1 | -- Widget is based on the AceGUIWidget-DropDown.lua supplied with AceGUI-3.0
2 | -- Widget created by Yssaril
3 |
4 | local AceGUI = LibStub("AceGUI-3.0")
5 | local Media = LibStub("LibSharedMedia-3.0")
6 |
7 | local AGSMW = LibStub("AceGUISharedMediaWidgets-1.0")
8 |
9 | do
10 | local widgetType = "LSM30_Font"
11 | local widgetVersion = 10
12 |
13 | local contentFrameCache = {}
14 | local function ReturnSelf(self)
15 | self:ClearAllPoints()
16 | self:Hide()
17 | self.check:Hide()
18 | table.insert(contentFrameCache, self)
19 | end
20 |
21 | local function ContentOnClick(this, button)
22 | local self = this.obj
23 | self:Fire("OnValueChanged", this.text:GetText())
24 | if self.dropdown then
25 | self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
26 | end
27 | end
28 |
29 | local function GetContentLine()
30 | local frame
31 | if next(contentFrameCache) then
32 | frame = table.remove(contentFrameCache)
33 | else
34 | frame = CreateFrame("Button", nil, UIParent)
35 | --frame:SetWidth(200)
36 | frame:SetHeight(18)
37 | frame:SetHighlightTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]], "ADD")
38 | frame:SetScript("OnClick", ContentOnClick)
39 | local check = frame:CreateTexture("OVERLAY")
40 | check:SetWidth(16)
41 | check:SetHeight(16)
42 | check:SetPoint("LEFT",frame,"LEFT",1,-1)
43 | check:SetTexture("Interface\\Buttons\\UI-CheckBox-Check")
44 | check:Hide()
45 | frame.check = check
46 | local text = frame:CreateFontString(nil,"OVERLAY","GameFontWhite")
47 | text:SetPoint("LEFT", check, "RIGHT", 1, 0)
48 | text:SetPoint("RIGHT", frame, "RIGHT", -2, 0)
49 | text:SetJustifyH("LEFT")
50 | text:SetText("Test Test Test Test Test Test Test")
51 | frame.text = text
52 | frame.ReturnSelf = ReturnSelf
53 | end
54 | frame:Show()
55 | return frame
56 | end
57 |
58 | local function OnAcquire(self)
59 | self:SetHeight(44)
60 | self:SetWidth(200)
61 | end
62 |
63 | local function OnRelease(self)
64 | self:SetText("")
65 | self:SetLabel("")
66 | self:SetDisabled(false)
67 |
68 | self.value = nil
69 | self.list = nil
70 | self.open = nil
71 | self.hasClose = nil
72 |
73 | self.frame:ClearAllPoints()
74 | self.frame:Hide()
75 | end
76 |
77 | local function SetValue(self, value) -- Set the value to an item in the List.
78 | if self.list then
79 | self:SetText(value or "")
80 | end
81 | self.value = value
82 | end
83 |
84 | local function GetValue(self)
85 | return self.value
86 | end
87 |
88 | local function SetList(self, list) -- Set the list of values for the dropdown (key => value pairs)
89 | self.list = list or Media:HashTable("font")
90 | end
91 |
92 | local function SetText(self, text) -- Set the text displayed in the box.
93 | self.frame.text:SetText(text or "")
94 | local font = self.list[text] ~= text and self.list[text] or Media:Fetch('font',text)
95 | local _, size, outline= self.frame.text:GetFont()
96 | self.frame.text:SetFont(font,size,outline)
97 | end
98 |
99 | local function SetLabel(self, text) -- Set the text for the label.
100 | self.frame.label:SetText(text or "")
101 | end
102 |
103 | local function AddItem(self, key, value) -- Add an item to the list.
104 | self.list = self.list or {}
105 | self.list[key] = value
106 | end
107 | local SetItemValue = AddItem -- Set the value of a item in the list. <>
108 |
109 | local function SetMultiselect(self, flag) end -- Toggle multi-selecting. <>
110 | local function GetMultiselect() return false end-- Query the multi-select flag. <>
111 | local function SetItemDisabled(self, key) end-- Disable one item in the list. <>
112 |
113 | local function SetDisabled(self, disabled) -- Disable the widget.
114 | self.disabled = disabled
115 | if disabled then
116 | self.frame:Disable()
117 | else
118 | self.frame:Enable()
119 | end
120 | end
121 |
122 | local function textSort(a,b)
123 | return string.upper(a) < string.upper(b)
124 | end
125 |
126 | local sortedlist = {}
127 | local function ToggleDrop(this)
128 | local self = this.obj
129 | if self.dropdown then
130 | self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
131 | AceGUI:ClearFocus()
132 | else
133 | AceGUI:SetFocus(self)
134 | self.dropdown = AGSMW:GetDropDownFrame()
135 | local width = self.frame:GetWidth()
136 | self.dropdown:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT")
137 | self.dropdown:SetPoint("TOPRIGHT", self.frame, "BOTTOMRIGHT", width < 160 and (160 - width) or 0, 0)
138 | for k, v in pairs(self.list) do
139 | sortedlist[#sortedlist+1] = k
140 | end
141 | table.sort(sortedlist, textSort)
142 | for i, k in ipairs(sortedlist) do
143 | local f = GetContentLine()
144 | local _, size, outline= f.text:GetFont()
145 | local font = self.list[k] ~= k and self.list[k] or Media:Fetch('font',k)
146 | f.text:SetFont(font,size,outline)
147 | f.text:SetText(k)
148 | if k == self.value then
149 | f.check:Show()
150 | end
151 | f.obj = self
152 | self.dropdown:AddFrame(f)
153 | end
154 | wipe(sortedlist)
155 | end
156 | end
157 |
158 | local function ClearFocus(self)
159 | if self.dropdown then
160 | self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
161 | end
162 | end
163 |
164 | local function OnHide(this)
165 | local self = this.obj
166 | if self.dropdown then
167 | self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
168 | end
169 | end
170 |
171 | local function Drop_OnEnter(this)
172 | this.obj:Fire("OnEnter")
173 | end
174 |
175 | local function Drop_OnLeave(this)
176 | this.obj:Fire("OnLeave")
177 | end
178 |
179 | local function Constructor()
180 | local frame = AGSMW:GetBaseFrame()
181 | local self = {}
182 |
183 | self.type = widgetType
184 | self.frame = frame
185 | frame.obj = self
186 | frame.dropButton.obj = self
187 | frame.dropButton:SetScript("OnEnter", Drop_OnEnter)
188 | frame.dropButton:SetScript("OnLeave", Drop_OnLeave)
189 | frame.dropButton:SetScript("OnClick",ToggleDrop)
190 | frame:SetScript("OnHide", OnHide)
191 |
192 | self.alignoffset = 31
193 |
194 | self.OnRelease = OnRelease
195 | self.OnAcquire = OnAcquire
196 | self.ClearFocus = ClearFocus
197 | self.SetText = SetText
198 | self.SetValue = SetValue
199 | self.GetValue = GetValue
200 | self.SetList = SetList
201 | self.SetLabel = SetLabel
202 | self.SetDisabled = SetDisabled
203 | self.AddItem = AddItem
204 | self.SetMultiselect = SetMultiselect
205 | self.GetMultiselect = GetMultiselect
206 | self.SetItemValue = SetItemValue
207 | self.SetItemDisabled = SetItemDisabled
208 | self.ToggleDrop = ToggleDrop
209 |
210 | AceGUI:RegisterAsWidget(self)
211 | return self
212 | end
213 |
214 | AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion)
215 |
216 | end
217 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | ScrollFrame Container
3 | Plain container that scrolls its content and doesn't grow in height.
4 | -------------------------------------------------------------------------------]]
5 | local Type, Version = "ScrollFrame", 23
6 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
7 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
8 |
9 | -- Lua APIs
10 | local pairs, assert, type = pairs, assert, type
11 | local min, max, floor, abs = math.min, math.max, math.floor, math.abs
12 |
13 | -- WoW APIs
14 | local CreateFrame, UIParent = CreateFrame, UIParent
15 |
16 | --[[-----------------------------------------------------------------------------
17 | Support functions
18 | -------------------------------------------------------------------------------]]
19 | local function FixScrollOnUpdate(frame)
20 | frame:SetScript("OnUpdate", nil)
21 | frame.obj:FixScroll()
22 | end
23 |
24 | --[[-----------------------------------------------------------------------------
25 | Scripts
26 | -------------------------------------------------------------------------------]]
27 | local function ScrollFrame_OnMouseWheel(frame, value)
28 | frame.obj:MoveScroll(value)
29 | end
30 |
31 | local function ScrollFrame_OnSizeChanged(frame)
32 | frame:SetScript("OnUpdate", FixScrollOnUpdate)
33 | end
34 |
35 | local function ScrollBar_OnScrollValueChanged(frame, value)
36 | frame.obj:SetScroll(value)
37 | end
38 |
39 | --[[-----------------------------------------------------------------------------
40 | Methods
41 | -------------------------------------------------------------------------------]]
42 | local methods = {
43 | ["OnAcquire"] = function(self)
44 | self:SetScroll(0)
45 | self.scrollframe:SetScript("OnUpdate", FixScrollOnUpdate)
46 | end,
47 |
48 | ["OnRelease"] = function(self)
49 | self.status = nil
50 | for k in pairs(self.localstatus) do
51 | self.localstatus[k] = nil
52 | end
53 | self.scrollframe:SetPoint("BOTTOMRIGHT")
54 | self.scrollbar:Hide()
55 | self.scrollBarShown = nil
56 | self.content.height, self.content.width = nil, nil
57 | end,
58 |
59 | ["SetScroll"] = function(self, value)
60 | local status = self.status or self.localstatus
61 | local viewheight = self.scrollframe:GetHeight()
62 | local height = self.content:GetHeight()
63 | local offset
64 |
65 | if viewheight > height then
66 | offset = 0
67 | else
68 | offset = floor((height - viewheight) / 1000.0 * value)
69 | end
70 | self.content:ClearAllPoints()
71 | self.content:SetPoint("TOPLEFT", 0, offset)
72 | self.content:SetPoint("TOPRIGHT", 0, offset)
73 | status.offset = offset
74 | status.scrollvalue = value
75 | end,
76 |
77 | ["MoveScroll"] = function(self, value)
78 | local status = self.status or self.localstatus
79 | local height, viewheight = self.scrollframe:GetHeight(), self.content:GetHeight()
80 |
81 | if self.scrollBarShown then
82 | local diff = height - viewheight
83 | local delta = 1
84 | if value < 0 then
85 | delta = -1
86 | end
87 | self.scrollbar:SetValue(min(max(status.scrollvalue + delta*(1000/(diff/45)),0), 1000))
88 | end
89 | end,
90 |
91 | ["FixScroll"] = function(self)
92 | if self.updateLock then return end
93 | self.updateLock = true
94 | local status = self.status or self.localstatus
95 | local height, viewheight = self.scrollframe:GetHeight(), self.content:GetHeight()
96 | local offset = status.offset or 0
97 | local curvalue = self.scrollbar:GetValue()
98 | -- Give us a margin of error of 2 pixels to stop some conditions that i would blame on floating point inaccuracys
99 | -- No-one is going to miss 2 pixels at the bottom of the frame, anyhow!
100 | if viewheight < height + 2 then
101 | if self.scrollBarShown then
102 | self.scrollBarShown = nil
103 | self.scrollbar:Hide()
104 | self.scrollbar:SetValue(0)
105 | self.scrollframe:SetPoint("BOTTOMRIGHT")
106 | self:DoLayout()
107 | end
108 | else
109 | if not self.scrollBarShown then
110 | self.scrollBarShown = true
111 | self.scrollbar:Show()
112 | self.scrollframe:SetPoint("BOTTOMRIGHT", -20, 0)
113 | self:DoLayout()
114 | end
115 | local value = (offset / (viewheight - height) * 1000)
116 | if value > 1000 then value = 1000 end
117 | self.scrollbar:SetValue(value)
118 | self:SetScroll(value)
119 | if value < 1000 then
120 | self.content:ClearAllPoints()
121 | self.content:SetPoint("TOPLEFT", 0, offset)
122 | self.content:SetPoint("TOPRIGHT", 0, offset)
123 | status.offset = offset
124 | end
125 | end
126 | self.updateLock = nil
127 | end,
128 |
129 | ["LayoutFinished"] = function(self, width, height)
130 | self.content:SetHeight(height or 0 + 20)
131 | self.scrollframe:SetScript("OnUpdate", FixScrollOnUpdate)
132 | end,
133 |
134 | ["SetStatusTable"] = function(self, status)
135 | assert(type(status) == "table")
136 | self.status = status
137 | if not status.scrollvalue then
138 | status.scrollvalue = 0
139 | end
140 | end,
141 |
142 | ["OnWidthSet"] = function(self, width)
143 | local content = self.content
144 | content.width = width
145 | end,
146 |
147 | ["OnHeightSet"] = function(self, height)
148 | local content = self.content
149 | content.height = height
150 | end
151 | }
152 | --[[-----------------------------------------------------------------------------
153 | Constructor
154 | -------------------------------------------------------------------------------]]
155 | local function Constructor()
156 | local frame = CreateFrame("Frame", nil, UIParent)
157 | local num = AceGUI:GetNextWidgetNum(Type)
158 |
159 | local scrollframe = CreateFrame("ScrollFrame", nil, frame)
160 | scrollframe:SetPoint("TOPLEFT")
161 | scrollframe:SetPoint("BOTTOMRIGHT")
162 | scrollframe:EnableMouseWheel(true)
163 | scrollframe:SetScript("OnMouseWheel", ScrollFrame_OnMouseWheel)
164 | scrollframe:SetScript("OnSizeChanged", ScrollFrame_OnSizeChanged)
165 |
166 | local scrollbar = CreateFrame("Slider", ("AceConfigDialogScrollFrame%dScrollBar"):format(num), scrollframe, "UIPanelScrollBarTemplate")
167 | scrollbar:SetPoint("TOPLEFT", scrollframe, "TOPRIGHT", 4, -16)
168 | scrollbar:SetPoint("BOTTOMLEFT", scrollframe, "BOTTOMRIGHT", 4, 16)
169 | scrollbar:SetMinMaxValues(0, 1000)
170 | scrollbar:SetValueStep(1)
171 | scrollbar:SetValue(0)
172 | scrollbar:SetWidth(16)
173 | scrollbar:Hide()
174 | -- set the script as the last step, so it doesn't fire yet
175 | scrollbar:SetScript("OnValueChanged", ScrollBar_OnScrollValueChanged)
176 |
177 | local scrollbg = scrollbar:CreateTexture(nil, "BACKGROUND")
178 | scrollbg:SetAllPoints(scrollbar)
179 | scrollbg:SetTexture(0, 0, 0, 0.4)
180 |
181 | --Container Support
182 | local content = CreateFrame("Frame", nil, scrollframe)
183 | content:SetPoint("TOPLEFT")
184 | content:SetPoint("TOPRIGHT")
185 | content:SetHeight(400)
186 | scrollframe:SetScrollChild(content)
187 |
188 | local widget = {
189 | localstatus = { scrollvalue = 0 },
190 | scrollframe = scrollframe,
191 | scrollbar = scrollbar,
192 | content = content,
193 | frame = frame,
194 | type = Type
195 | }
196 | for method, func in pairs(methods) do
197 | widget[method] = func
198 | end
199 | scrollframe.obj, scrollbar.obj = widget, widget
200 |
201 | return AceGUI:RegisterAsContainer(widget)
202 | end
203 |
204 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
205 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua:
--------------------------------------------------------------------------------
1 | -- Widget is based on the AceGUIWidget-DropDown.lua supplied with AceGUI-3.0
2 | -- Widget created by Yssaril
3 |
4 | local AceGUI = LibStub("AceGUI-3.0")
5 | local Media = LibStub("LibSharedMedia-3.0")
6 |
7 | local AGSMW = LibStub("AceGUISharedMediaWidgets-1.0")
8 |
9 | do
10 | local widgetType = "LSM30_Statusbar"
11 | local widgetVersion = 12
12 |
13 | local contentFrameCache = {}
14 | local function ReturnSelf(self)
15 | self:ClearAllPoints()
16 | self:Hide()
17 | self.check:Hide()
18 | table.insert(contentFrameCache, self)
19 | end
20 |
21 | local function ContentOnClick(this, button)
22 | local self = this.obj
23 | self:Fire("OnValueChanged", this.text:GetText())
24 | if self.dropdown then
25 | self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
26 | end
27 | end
28 |
29 | local function GetContentLine()
30 | local frame
31 | if next(contentFrameCache) then
32 | frame = table.remove(contentFrameCache)
33 | else
34 | frame = CreateFrame("Button", nil, UIParent)
35 | --frame:SetWidth(200)
36 | frame:SetHeight(18)
37 | frame:SetHighlightTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]], "ADD")
38 | frame:SetScript("OnClick", ContentOnClick)
39 | local check = frame:CreateTexture("OVERLAY")
40 | check:SetWidth(16)
41 | check:SetHeight(16)
42 | check:SetPoint("LEFT",frame,"LEFT",1,-1)
43 | check:SetTexture("Interface\\Buttons\\UI-CheckBox-Check")
44 | check:Hide()
45 | frame.check = check
46 | local bar = frame:CreateTexture("ARTWORK")
47 | bar:SetHeight(16)
48 | bar:SetPoint("LEFT",check,"RIGHT",1,0)
49 | bar:SetPoint("RIGHT",frame,"RIGHT",-1,0)
50 | frame.bar = bar
51 | local text = frame:CreateFontString(nil,"OVERLAY","GameFontWhite")
52 |
53 | local font, size = text:GetFont()
54 | text:SetFont(font,size,"OUTLINE")
55 |
56 | text:SetPoint("TOPLEFT", check, "TOPRIGHT", 3, 0)
57 | text:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -2, 0)
58 | text:SetJustifyH("LEFT")
59 | text:SetText("Test Test Test Test Test Test Test")
60 | frame.text = text
61 | frame.ReturnSelf = ReturnSelf
62 | end
63 | frame:Show()
64 | return frame
65 | end
66 |
67 | local function OnAcquire(self)
68 | self:SetHeight(44)
69 | self:SetWidth(200)
70 | end
71 |
72 | local function OnRelease(self)
73 | self:SetText("")
74 | self:SetLabel("")
75 | self:SetDisabled(false)
76 |
77 | self.value = nil
78 | self.list = nil
79 | self.open = nil
80 | self.hasClose = nil
81 |
82 | self.frame:ClearAllPoints()
83 | self.frame:Hide()
84 | end
85 |
86 | local function SetValue(self, value) -- Set the value to an item in the List.
87 | if self.list then
88 | self:SetText(value or "")
89 | end
90 | self.value = value
91 | end
92 |
93 | local function GetValue(self)
94 | return self.value
95 | end
96 |
97 | local function SetList(self, list) -- Set the list of values for the dropdown (key => value pairs)
98 | self.list = list or Media:HashTable("statusbar")
99 | end
100 |
101 |
102 | local function SetText(self, text) -- Set the text displayed in the box.
103 | self.frame.text:SetText(text or "")
104 | local statusbar = self.list[text] ~= text and self.list[text] or Media:Fetch('statusbar',text)
105 | self.bar:SetTexture(statusbar)
106 | end
107 |
108 | local function SetLabel(self, text) -- Set the text for the label.
109 | self.frame.label:SetText(text or "")
110 | end
111 |
112 | local function AddItem(self, key, value) -- Add an item to the list.
113 | self.list = self.list or {}
114 | self.list[key] = value
115 | end
116 | local SetItemValue = AddItem -- Set the value of a item in the list. <>
117 |
118 | local function SetMultiselect(self, flag) end -- Toggle multi-selecting. <>
119 | local function GetMultiselect() return false end-- Query the multi-select flag. <>
120 | local function SetItemDisabled(self, key) end-- Disable one item in the list. <>
121 |
122 | local function SetDisabled(self, disabled) -- Disable the widget.
123 | self.disabled = disabled
124 | if disabled then
125 | self.frame:Disable()
126 | else
127 | self.frame:Enable()
128 | end
129 | end
130 |
131 | local function textSort(a,b)
132 | return string.upper(a) < string.upper(b)
133 | end
134 |
135 | local sortedlist = {}
136 | local function ToggleDrop(this)
137 | local self = this.obj
138 | if self.dropdown then
139 | self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
140 | AceGUI:ClearFocus()
141 | else
142 | AceGUI:SetFocus(self)
143 | self.dropdown = AGSMW:GetDropDownFrame()
144 | local width = self.frame:GetWidth()
145 | self.dropdown:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT")
146 | self.dropdown:SetPoint("TOPRIGHT", self.frame, "BOTTOMRIGHT", width < 160 and (160 - width) or 0, 0)
147 | for k, v in pairs(self.list) do
148 | sortedlist[#sortedlist+1] = k
149 | end
150 | table.sort(sortedlist, textSort)
151 | for i, k in ipairs(sortedlist) do
152 | local f = GetContentLine()
153 | f.text:SetText(k)
154 | --print(k)
155 | if k == self.value then
156 | f.check:Show()
157 | end
158 |
159 | local statusbar = self.list[k] ~= k and self.list[k] or Media:Fetch('statusbar',k)
160 | f.bar:SetTexture(statusbar)
161 | f.obj = self
162 | f.dropdown = self.dropdown
163 | self.dropdown:AddFrame(f)
164 | end
165 | wipe(sortedlist)
166 | end
167 | end
168 |
169 | local function ClearFocus(self)
170 | if self.dropdown then
171 | self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
172 | end
173 | end
174 |
175 | local function OnHide(this)
176 | local self = this.obj
177 | if self.dropdown then
178 | self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
179 | end
180 | end
181 |
182 | local function Drop_OnEnter(this)
183 | this.obj:Fire("OnEnter")
184 | end
185 |
186 | local function Drop_OnLeave(this)
187 | this.obj:Fire("OnLeave")
188 | end
189 |
190 | local function Constructor()
191 | local frame = AGSMW:GetBaseFrame()
192 | local self = {}
193 |
194 | self.type = widgetType
195 | self.frame = frame
196 | frame.obj = self
197 | frame.dropButton.obj = self
198 | frame.dropButton:SetScript("OnEnter", Drop_OnEnter)
199 | frame.dropButton:SetScript("OnLeave", Drop_OnLeave)
200 | frame.dropButton:SetScript("OnClick",ToggleDrop)
201 | frame:SetScript("OnHide", OnHide)
202 |
203 | local bar = frame:CreateTexture(nil, "OVERLAY")
204 | bar:SetPoint("TOPLEFT", frame,"TOPLEFT",6,-25)
205 | bar:SetPoint("BOTTOMRIGHT", frame,"BOTTOMRIGHT", -21, 5)
206 | bar:SetAlpha(0.5)
207 | self.bar = bar
208 |
209 | self.alignoffset = 31
210 |
211 | self.OnRelease = OnRelease
212 | self.OnAcquire = OnAcquire
213 | self.ClearFocus = ClearFocus
214 | self.SetText = SetText
215 | self.SetValue = SetValue
216 | self.GetValue = GetValue
217 | self.SetList = SetList
218 | self.SetLabel = SetLabel
219 | self.SetDisabled = SetDisabled
220 | self.AddItem = AddItem
221 | self.SetMultiselect = SetMultiselect
222 | self.GetMultiselect = GetMultiselect
223 | self.SetItemValue = SetItemValue
224 | self.SetItemDisabled = SetItemDisabled
225 | self.ToggleDrop = ToggleDrop
226 |
227 | AceGUI:RegisterAsWidget(self)
228 | return self
229 | end
230 |
231 | AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion)
232 |
233 | end
234 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua:
--------------------------------------------------------------------------------
1 | -- Widget is based on the AceGUIWidget-DropDown.lua supplied with AceGUI-3.0
2 | -- Widget created by Yssaril
3 |
4 | local AceGUI = LibStub("AceGUI-3.0")
5 | local Media = LibStub("LibSharedMedia-3.0")
6 |
7 | local AGSMW = LibStub("AceGUISharedMediaWidgets-1.0")
8 |
9 | do
10 | local widgetType = "LSM30_Statusbar"
11 | local widgetVersion = 10
12 |
13 | local contentFrameCache = {}
14 | local function ReturnSelf(self)
15 | self:ClearAllPoints()
16 | self:Hide()
17 | self.check:Hide()
18 | table.insert(contentFrameCache, self)
19 | end
20 |
21 | local function ContentOnClick(this, button)
22 | local self = this.obj
23 | self:Fire("OnValueChanged", this.text:GetText())
24 | if self.dropdown then
25 | self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
26 | end
27 | end
28 |
29 | local function GetContentLine()
30 | local frame
31 | if next(contentFrameCache) then
32 | frame = table.remove(contentFrameCache)
33 | else
34 | frame = CreateFrame("Button", nil, UIParent)
35 | --frame:SetWidth(200)
36 | frame:SetHeight(18)
37 | frame:SetHighlightTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]], "ADD")
38 | frame:SetScript("OnClick", ContentOnClick)
39 | local check = frame:CreateTexture("OVERLAY")
40 | check:SetWidth(16)
41 | check:SetHeight(16)
42 | check:SetPoint("LEFT",frame,"LEFT",1,-1)
43 | check:SetTexture("Interface\\Buttons\\UI-CheckBox-Check")
44 | check:Hide()
45 | frame.check = check
46 | local bar = frame:CreateTexture("ARTWORK")
47 | bar:SetHeight(16)
48 | bar:SetPoint("LEFT",check,"RIGHT",1,0)
49 | bar:SetPoint("RIGHT",frame,"RIGHT",-1,0)
50 | frame.bar = bar
51 | local text = frame:CreateFontString(nil,"OVERLAY","GameFontWhite")
52 |
53 | local font, size = text:GetFont()
54 | text:SetFont(font,size,"OUTLINE")
55 |
56 | text:SetPoint("LEFT", check, "RIGHT", 3, 0)
57 | text:SetPoint("RIGHT", frame, "RIGHT", -2, 0)
58 | text:SetJustifyH("LEFT")
59 | text:SetText("Test Test Test Test Test Test Test")
60 | frame.text = text
61 | frame.ReturnSelf = ReturnSelf
62 | end
63 | frame:Show()
64 | return frame
65 | end
66 |
67 | local function OnAcquire(self)
68 | self:SetHeight(44)
69 | self:SetWidth(200)
70 | end
71 |
72 | local function OnRelease(self)
73 | self:SetText("")
74 | self:SetLabel("")
75 | self:SetDisabled(false)
76 |
77 | self.value = nil
78 | self.list = nil
79 | self.open = nil
80 | self.hasClose = nil
81 |
82 | self.frame:ClearAllPoints()
83 | self.frame:Hide()
84 | end
85 |
86 | local function SetValue(self, value) -- Set the value to an item in the List.
87 | if self.list then
88 | self:SetText(value or "")
89 | end
90 | self.value = value
91 | end
92 |
93 | local function GetValue(self)
94 | return self.value
95 | end
96 |
97 | local function SetList(self, list) -- Set the list of values for the dropdown (key => value pairs)
98 | self.list = list or Media:HashTable("statusbar")
99 | end
100 |
101 |
102 | local function SetText(self, text) -- Set the text displayed in the box.
103 | self.frame.text:SetText(text or "")
104 | local statusbar = self.list[text] ~= text and self.list[text] or Media:Fetch('statusbar',text)
105 | self.bar:SetTexture(statusbar)
106 | end
107 |
108 | local function SetLabel(self, text) -- Set the text for the label.
109 | self.frame.label:SetText(text or "")
110 | end
111 |
112 | local function AddItem(self, key, value) -- Add an item to the list.
113 | self.list = self.list or {}
114 | self.list[key] = value
115 | end
116 | local SetItemValue = AddItem -- Set the value of a item in the list. <>
117 |
118 | local function SetMultiselect(self, flag) end -- Toggle multi-selecting. <>
119 | local function GetMultiselect() return false end-- Query the multi-select flag. <>
120 | local function SetItemDisabled(self, key) end-- Disable one item in the list. <>
121 |
122 | local function SetDisabled(self, disabled) -- Disable the widget.
123 | self.disabled = disabled
124 | if disabled then
125 | self.frame:Disable()
126 | else
127 | self.frame:Enable()
128 | end
129 | end
130 |
131 | local function textSort(a,b)
132 | return string.upper(a) < string.upper(b)
133 | end
134 |
135 | local sortedlist = {}
136 | local function ToggleDrop(this)
137 | local self = this.obj
138 | if self.dropdown then
139 | self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
140 | AceGUI:ClearFocus()
141 | else
142 | AceGUI:SetFocus(self)
143 | self.dropdown = AGSMW:GetDropDownFrame()
144 | local width = self.frame:GetWidth()
145 | self.dropdown:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT")
146 | self.dropdown:SetPoint("TOPRIGHT", self.frame, "BOTTOMRIGHT", width < 160 and (160 - width) or 0, 0)
147 | for k, v in pairs(self.list) do
148 | sortedlist[#sortedlist+1] = k
149 | end
150 | table.sort(sortedlist, textSort)
151 | for i, k in ipairs(sortedlist) do
152 | local f = GetContentLine()
153 | f.text:SetText(k)
154 | --print(k)
155 | if k == self.value then
156 | f.check:Show()
157 | end
158 |
159 | local statusbar = self.list[k] ~= k and self.list[k] or Media:Fetch('statusbar',k)
160 | f.bar:SetTexture(statusbar)
161 | f.obj = self
162 | f.dropdown = self.dropdown
163 | self.dropdown:AddFrame(f)
164 | end
165 | wipe(sortedlist)
166 | end
167 | end
168 |
169 | local function ClearFocus(self)
170 | if self.dropdown then
171 | self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
172 | end
173 | end
174 |
175 | local function OnHide(this)
176 | local self = this.obj
177 | if self.dropdown then
178 | self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
179 | end
180 | end
181 |
182 | local function Drop_OnEnter(this)
183 | this.obj:Fire("OnEnter")
184 | end
185 |
186 | local function Drop_OnLeave(this)
187 | this.obj:Fire("OnLeave")
188 | end
189 |
190 | local function Constructor()
191 | local frame = AGSMW:GetBaseFrame()
192 | local self = {}
193 |
194 | self.type = widgetType
195 | self.frame = frame
196 | frame.obj = self
197 | frame.dropButton.obj = self
198 | frame.dropButton:SetScript("OnEnter", Drop_OnEnter)
199 | frame.dropButton:SetScript("OnLeave", Drop_OnLeave)
200 | frame.dropButton:SetScript("OnClick",ToggleDrop)
201 | frame:SetScript("OnHide", OnHide)
202 |
203 | local bar = frame:CreateTexture(nil, "OVERLAY")
204 | bar:SetPoint("TOPLEFT", frame,"TOPLEFT",6,-25)
205 | bar:SetPoint("BOTTOMRIGHT", frame,"BOTTOMRIGHT", -21, 5)
206 | bar:SetAlpha(0.5)
207 | self.bar = bar
208 |
209 | self.alignoffset = 31
210 |
211 | self.OnRelease = OnRelease
212 | self.OnAcquire = OnAcquire
213 | self.ClearFocus = ClearFocus
214 | self.SetText = SetText
215 | self.SetValue = SetValue
216 | self.GetValue = GetValue
217 | self.SetList = SetList
218 | self.SetLabel = SetLabel
219 | self.SetDisabled = SetDisabled
220 | self.AddItem = AddItem
221 | self.SetMultiselect = SetMultiselect
222 | self.GetMultiselect = GetMultiselect
223 | self.SetItemValue = SetItemValue
224 | self.SetItemDisabled = SetItemDisabled
225 | self.ToggleDrop = ToggleDrop
226 |
227 | AceGUI:RegisterAsWidget(self)
228 | return self
229 | end
230 |
231 | AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion)
232 |
233 | end
234 |
--------------------------------------------------------------------------------
/libs/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua:
--------------------------------------------------------------------------------
1 | -- Widget is based on the AceGUIWidget-DropDown.lua supplied with AceGUI-3.0
2 | -- Widget created by Yssaril
3 |
4 | local AceGUI = LibStub("AceGUI-3.0")
5 | local Media = LibStub("LibSharedMedia-3.0")
6 |
7 | local AGSMW = LibStub("AceGUISharedMediaWidgets-1.0")
8 |
9 | do
10 | local widgetType = "LSM30_Border"
11 | local widgetVersion = 12
12 |
13 | local contentFrameCache = {}
14 | local function ReturnSelf(self)
15 | self:ClearAllPoints()
16 | self:Hide()
17 | self.check:Hide()
18 | table.insert(contentFrameCache, self)
19 | end
20 |
21 | local function ContentOnClick(this, button)
22 | local self = this.obj
23 | self:Fire("OnValueChanged", this.text:GetText())
24 | if self.dropdown then
25 | self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
26 | end
27 | end
28 |
29 | local function ContentOnEnter(this, button)
30 | local self = this.obj
31 | local text = this.text:GetText()
32 | local border = self.list[text] ~= text and self.list[text] or Media:Fetch('border',text)
33 | this.dropdown:SetBackdrop({edgeFile = border,
34 | bgFile=[[Interface\DialogFrame\UI-DialogBox-Background-Dark]],
35 | tile = true, tileSize = 16, edgeSize = 16,
36 | insets = { left = 4, right = 4, top = 4, bottom = 4 }})
37 | end
38 |
39 | local function GetContentLine()
40 | local frame
41 | if next(contentFrameCache) then
42 | frame = table.remove(contentFrameCache)
43 | else
44 | frame = CreateFrame("Button", nil, UIParent)
45 | --frame:SetWidth(200)
46 | frame:SetHeight(18)
47 | frame:SetHighlightTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]], "ADD")
48 | frame:SetScript("OnClick", ContentOnClick)
49 | frame:SetScript("OnEnter", ContentOnEnter)
50 | local check = frame:CreateTexture("OVERLAY")
51 | check:SetWidth(16)
52 | check:SetHeight(16)
53 | check:SetPoint("LEFT",frame,"LEFT",1,-1)
54 | check:SetTexture("Interface\\Buttons\\UI-CheckBox-Check")
55 | check:Hide()
56 | frame.check = check
57 | local text = frame:CreateFontString(nil,"OVERLAY","GameFontWhite")
58 | text:SetPoint("TOPLEFT", check, "TOPRIGHT", 1, 0)
59 | text:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -2, 0)
60 | text:SetJustifyH("LEFT")
61 | text:SetText("Test Test Test Test Test Test Test")
62 | frame.text = text
63 | frame.ReturnSelf = ReturnSelf
64 | end
65 | frame:Show()
66 | return frame
67 | end
68 |
69 | local function OnAcquire(self)
70 | self:SetHeight(44)
71 | self:SetWidth(200)
72 | end
73 |
74 | local function OnRelease(self)
75 | self:SetText("")
76 | self:SetLabel("")
77 | self:SetDisabled(false)
78 |
79 | self.value = nil
80 | self.list = nil
81 | self.open = nil
82 | self.hasClose = nil
83 |
84 | self.frame:ClearAllPoints()
85 | self.frame:Hide()
86 | end
87 |
88 | local function SetValue(self, value) -- Set the value to an item in the List.
89 | if self.list then
90 | self:SetText(value or "")
91 | end
92 | self.value = value
93 | end
94 |
95 | local function GetValue(self)
96 | return self.value
97 | end
98 |
99 | local function SetList(self, list) -- Set the list of values for the dropdown (key => value pairs)
100 | self.list = list or Media:HashTable("border")
101 | end
102 |
103 |
104 | local function SetText(self, text) -- Set the text displayed in the box.
105 | self.frame.text:SetText(text or "")
106 | local border = self.list[text] ~= text and self.list[text] or Media:Fetch('border',text)
107 |
108 | self.frame.displayButton:SetBackdrop({edgeFile = border,
109 | bgFile=[[Interface\DialogFrame\UI-DialogBox-Background-Dark]],
110 | tile = true, tileSize = 16, edgeSize = 16,
111 | insets = { left = 4, right = 4, top = 4, bottom = 4 }})
112 | end
113 |
114 | local function SetLabel(self, text) -- Set the text for the label.
115 | self.frame.label:SetText(text or "")
116 | end
117 |
118 | local function AddItem(self, key, value) -- Add an item to the list.
119 | self.list = self.list or {}
120 | self.list[key] = value
121 | end
122 | local SetItemValue = AddItem -- Set the value of a item in the list. <>
123 |
124 | local function SetMultiselect(self, flag) end -- Toggle multi-selecting. <>
125 | local function GetMultiselect() return false end-- Query the multi-select flag. <>
126 | local function SetItemDisabled(self, key) end-- Disable one item in the list. <>
127 |
128 | local function SetDisabled(self, disabled) -- Disable the widget.
129 | self.disabled = disabled
130 | if disabled then
131 | self.frame:Disable()
132 | else
133 | self.frame:Enable()
134 | end
135 | end
136 |
137 | local function textSort(a,b)
138 | return string.upper(a) < string.upper(b)
139 | end
140 |
141 | local sortedlist = {}
142 | local function ToggleDrop(this)
143 | local self = this.obj
144 | if self.dropdown then
145 | self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
146 | AceGUI:ClearFocus()
147 | else
148 | AceGUI:SetFocus(self)
149 | self.dropdown = AGSMW:GetDropDownFrame()
150 | local width = self.frame:GetWidth()
151 | self.dropdown:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT")
152 | self.dropdown:SetPoint("TOPRIGHT", self.frame, "BOTTOMRIGHT", width < 160 and (160 - width) or 0, 0)
153 | for k, v in pairs(self.list) do
154 | sortedlist[#sortedlist+1] = k
155 | end
156 | table.sort(sortedlist, textSort)
157 | for i, k in ipairs(sortedlist) do
158 | local f = GetContentLine()
159 | f.text:SetText(k)
160 | --print(k)
161 | if k == self.value then
162 | f.check:Show()
163 | end
164 | f.obj = self
165 | f.dropdown = self.dropdown
166 | self.dropdown:AddFrame(f)
167 | end
168 | wipe(sortedlist)
169 | end
170 | end
171 |
172 | local function ClearFocus(self)
173 | if self.dropdown then
174 | self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
175 | end
176 | end
177 |
178 | local function OnHide(this)
179 | local self = this.obj
180 | if self.dropdown then
181 | self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
182 | end
183 | end
184 |
185 | local function Drop_OnEnter(this)
186 | this.obj:Fire("OnEnter")
187 | end
188 |
189 | local function Drop_OnLeave(this)
190 | this.obj:Fire("OnLeave")
191 | end
192 |
193 | local function Constructor()
194 | local frame = AGSMW:GetBaseFrameWithWindow()
195 | local self = {}
196 |
197 | self.type = widgetType
198 | self.frame = frame
199 | frame.obj = self
200 | frame.dropButton.obj = self
201 | frame.dropButton:SetScript("OnEnter", Drop_OnEnter)
202 | frame.dropButton:SetScript("OnLeave", Drop_OnLeave)
203 | frame.dropButton:SetScript("OnClick",ToggleDrop)
204 | frame:SetScript("OnHide", OnHide)
205 |
206 | self.alignoffset = 31
207 |
208 | self.OnRelease = OnRelease
209 | self.OnAcquire = OnAcquire
210 | self.ClearFocus = ClearFocus
211 | self.SetText = SetText
212 | self.SetValue = SetValue
213 | self.GetValue = GetValue
214 | self.SetList = SetList
215 | self.SetLabel = SetLabel
216 | self.SetDisabled = SetDisabled
217 | self.AddItem = AddItem
218 | self.SetMultiselect = SetMultiselect
219 | self.GetMultiselect = GetMultiselect
220 | self.SetItemValue = SetItemValue
221 | self.SetItemDisabled = SetItemDisabled
222 | self.ToggleDrop = ToggleDrop
223 |
224 | AceGUI:RegisterAsWidget(self)
225 | return self
226 | end
227 |
228 | AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion)
229 |
230 | end
231 |
--------------------------------------------------------------------------------