├── media ├── gps.tga ├── clock.tga ├── equip.tga ├── memory.tga ├── rowbg.tga ├── stuff.tga ├── Server128.tga ├── calendar.tga ├── fps_blue.tga ├── fps_green.tga ├── fps_red.tga ├── friends.tga ├── latency.tga ├── mailalert.mp3 ├── volume_0.tga ├── volume_33.tga ├── volume_66.tga ├── GarrUpgrade.tga ├── LFG-Eye-Red.tga ├── fps_yellow.tga ├── nameplates.tga ├── reputation.tga ├── volume_100.tga ├── LFG-Eye-Blue.tga ├── LFG-Eye-Green.tga ├── countries │ ├── deDE.tga │ ├── enAU.tga │ ├── enGB.tga │ ├── enUS.tga │ ├── esES.tga │ ├── esMX.tga │ ├── frFR.tga │ ├── itIT.tga │ ├── koKR.tga │ ├── plPL.tga │ ├── ptBR.tga │ ├── ptPT.tga │ ├── ruRU.tga │ ├── zhCN.tga │ └── zhTW.tga ├── modlistbutton.tga ├── Battlenet-D4icon.tga ├── calendar_pending.tga ├── Battlenet-CODicon.tga ├── Battlenet-SORicon.tga ├── aio-reputation-bar.tga ├── INV_Misc_EngGizmos_20.tga ├── INV_Misc_PaperBundle04a.tga ├── INV_Misc_PaperBundle04b.tga ├── INV_Misc_PaperBundle04c.tga ├── Achievement_Reputation_01.tga ├── aio-reputation-bar_friend.tga ├── aio-reputation-bar_bodyguard.tga └── ACHIEVEMENT_GUILDPERK_QUICK AND DEAD.tga ├── .github ├── media │ ├── be_00.jpg │ ├── be_00t.jpg │ ├── be_01.png │ ├── be_01t.png │ ├── be_02.png │ └── be_02t.png └── workflows │ └── packager.yml ├── namespace.lua ├── ReadMe_iconset_support.txt ├── Broker_Everything.toc ├── .pkgmeta ├── modules ├── stuff.lua ├── wowtoken.lua ├── framenames.lua ├── surprise.lua ├── titles.lua ├── ammo_classic.lua ├── tracking.lua ├── chatchannels.lua ├── clock.lua ├── guildlog.lua ├── notes.lua ├── nameplates.lua ├── wardrobe.lua ├── invasions.lua ├── ids.lua ├── achievements.lua ├── calendar.lua ├── difficulty.lua └── orderhall.lua ├── core.lua ├── chatcommand.lua ├── README.md ├── modules.lua ├── localizations.lua └── Broker_Everything.xml /media/gps.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/gps.tga -------------------------------------------------------------------------------- /media/clock.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/clock.tga -------------------------------------------------------------------------------- /media/equip.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/equip.tga -------------------------------------------------------------------------------- /media/memory.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/memory.tga -------------------------------------------------------------------------------- /media/rowbg.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/rowbg.tga -------------------------------------------------------------------------------- /media/stuff.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/stuff.tga -------------------------------------------------------------------------------- /media/Server128.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/Server128.tga -------------------------------------------------------------------------------- /media/calendar.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/calendar.tga -------------------------------------------------------------------------------- /media/fps_blue.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/fps_blue.tga -------------------------------------------------------------------------------- /media/fps_green.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/fps_green.tga -------------------------------------------------------------------------------- /media/fps_red.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/fps_red.tga -------------------------------------------------------------------------------- /media/friends.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/friends.tga -------------------------------------------------------------------------------- /media/latency.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/latency.tga -------------------------------------------------------------------------------- /media/mailalert.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/mailalert.mp3 -------------------------------------------------------------------------------- /media/volume_0.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/volume_0.tga -------------------------------------------------------------------------------- /media/volume_33.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/volume_33.tga -------------------------------------------------------------------------------- /media/volume_66.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/volume_66.tga -------------------------------------------------------------------------------- /media/GarrUpgrade.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/GarrUpgrade.tga -------------------------------------------------------------------------------- /media/LFG-Eye-Red.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/LFG-Eye-Red.tga -------------------------------------------------------------------------------- /media/fps_yellow.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/fps_yellow.tga -------------------------------------------------------------------------------- /media/nameplates.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/nameplates.tga -------------------------------------------------------------------------------- /media/reputation.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/reputation.tga -------------------------------------------------------------------------------- /media/volume_100.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/volume_100.tga -------------------------------------------------------------------------------- /.github/media/be_00.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/.github/media/be_00.jpg -------------------------------------------------------------------------------- /.github/media/be_00t.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/.github/media/be_00t.jpg -------------------------------------------------------------------------------- /.github/media/be_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/.github/media/be_01.png -------------------------------------------------------------------------------- /.github/media/be_01t.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/.github/media/be_01t.png -------------------------------------------------------------------------------- /.github/media/be_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/.github/media/be_02.png -------------------------------------------------------------------------------- /.github/media/be_02t.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/.github/media/be_02t.png -------------------------------------------------------------------------------- /media/LFG-Eye-Blue.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/LFG-Eye-Blue.tga -------------------------------------------------------------------------------- /media/LFG-Eye-Green.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/LFG-Eye-Green.tga -------------------------------------------------------------------------------- /media/countries/deDE.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/countries/deDE.tga -------------------------------------------------------------------------------- /media/countries/enAU.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/countries/enAU.tga -------------------------------------------------------------------------------- /media/countries/enGB.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/countries/enGB.tga -------------------------------------------------------------------------------- /media/countries/enUS.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/countries/enUS.tga -------------------------------------------------------------------------------- /media/countries/esES.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/countries/esES.tga -------------------------------------------------------------------------------- /media/countries/esMX.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/countries/esMX.tga -------------------------------------------------------------------------------- /media/countries/frFR.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/countries/frFR.tga -------------------------------------------------------------------------------- /media/countries/itIT.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/countries/itIT.tga -------------------------------------------------------------------------------- /media/countries/koKR.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/countries/koKR.tga -------------------------------------------------------------------------------- /media/countries/plPL.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/countries/plPL.tga -------------------------------------------------------------------------------- /media/countries/ptBR.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/countries/ptBR.tga -------------------------------------------------------------------------------- /media/countries/ptPT.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/countries/ptPT.tga -------------------------------------------------------------------------------- /media/countries/ruRU.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/countries/ruRU.tga -------------------------------------------------------------------------------- /media/countries/zhCN.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/countries/zhCN.tga -------------------------------------------------------------------------------- /media/countries/zhTW.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/countries/zhTW.tga -------------------------------------------------------------------------------- /media/modlistbutton.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/modlistbutton.tga -------------------------------------------------------------------------------- /media/Battlenet-D4icon.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/Battlenet-D4icon.tga -------------------------------------------------------------------------------- /media/calendar_pending.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/calendar_pending.tga -------------------------------------------------------------------------------- /media/Battlenet-CODicon.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/Battlenet-CODicon.tga -------------------------------------------------------------------------------- /media/Battlenet-SORicon.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/Battlenet-SORicon.tga -------------------------------------------------------------------------------- /media/aio-reputation-bar.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/aio-reputation-bar.tga -------------------------------------------------------------------------------- /media/INV_Misc_EngGizmos_20.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/INV_Misc_EngGizmos_20.tga -------------------------------------------------------------------------------- /media/INV_Misc_PaperBundle04a.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/INV_Misc_PaperBundle04a.tga -------------------------------------------------------------------------------- /media/INV_Misc_PaperBundle04b.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/INV_Misc_PaperBundle04b.tga -------------------------------------------------------------------------------- /media/INV_Misc_PaperBundle04c.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/INV_Misc_PaperBundle04c.tga -------------------------------------------------------------------------------- /media/Achievement_Reputation_01.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/Achievement_Reputation_01.tga -------------------------------------------------------------------------------- /media/aio-reputation-bar_friend.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/aio-reputation-bar_friend.tga -------------------------------------------------------------------------------- /media/aio-reputation-bar_bodyguard.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/aio-reputation-bar_bodyguard.tga -------------------------------------------------------------------------------- /media/ACHIEVEMENT_GUILDPERK_QUICK AND DEAD.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HizurosWoWAddOns/Broker_Everything/HEAD/media/ACHIEVEMENT_GUILDPERK_QUICK AND DEAD.tga -------------------------------------------------------------------------------- /namespace.lua: -------------------------------------------------------------------------------- 1 | local _, ns = ...; 2 | 3 | local namespace = {}; 4 | 5 | setmetatable(ns,{ 6 | --__metatable = false 7 | __newindex = function(t,k,v) 8 | namespace[k]=v; 9 | end, 10 | __index = function(t,k) 11 | return namespace[k]; 12 | end, 13 | }); 14 | 15 | -- sometimes lua errors are filled with functions and tables from namespace 16 | -- and __metatable does not work for lua errors. 17 | -- this should prevent it. 18 | 19 | 20 | -------------------------------------------------------------------------------- /.github/workflows/packager.yml: -------------------------------------------------------------------------------- 1 | name: packager 2 | 3 | on: 4 | push: 5 | tags: 6 | - '**' 7 | 8 | jobs: 9 | release: 10 | runs-on: ubuntu-latest 11 | env: 12 | CF_API_KEY: ${{ secrets.CF_API_KEY }} 13 | WOWI_API_TOKEN: ${{ secrets.WOWI_API_TOKEN }} 14 | WAGO_API_TOKEN: ${{ secrets.WAGO_API_TOKEN }} 15 | GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }} 16 | # setup under repo > settings > secrets 17 | 18 | steps: 19 | - name: Install svn 20 | run: sudo apt-get install -y subversion 21 | 22 | - name: Clone project 23 | uses: actions/checkout@v4 24 | 25 | - name: Package and release 26 | uses: BigWigsMods/packager@v2 27 | 28 | -------------------------------------------------------------------------------- /ReadMe_iconset_support.txt: -------------------------------------------------------------------------------- 1 | 2 | Since v5.4.6 Broker_Everything supports custom Iconsets. 3 | (working example on http://www.wowinterface.com/downloads/info22790-Broker_Everything-DemoIconset.html) 4 | 5 | A little note about the icon files: 6 | Blizzard supports .tga and .blp for images. 7 | 8 | Important for both: 9 | The image size must be 16 or a multible of it. (example: 16x32 or 1024x64) 10 | 11 | .tga alias Targa File: 12 | Gimp and Photoshop and some other programs can save images in this image format. Compression (RLE) supported by blizzard. Important for this format are the color table. 13 | - 16 bit colors aren't supported by blizzard. 14 | - 24 bit colors usable without alpha channel. 15 | - 32 bit colors usable and support alpha channel. 16 | 17 | .blp are blizzard's own image format: 18 | Some programs can convert blp to png (Portable Network Graphic) and otherwise. 19 | (please use your preferred search engine) 20 | 21 | I recommend .tga with compression. it creates the lowest file size from all formats. 22 | 23 | greetings 24 | Hizuro 25 | 26 | -------------------------------------------------------------------------------- /Broker_Everything.toc: -------------------------------------------------------------------------------- 1 | ## Interface: 110205, 50501, 11507 2 | ## Title: Broker: Everything 3 | ## IconTexture: 892831 4 | ## Notes: A collection of modules to display various informations as Broker-buttons on Broker Display AddOns or minimap buttons. 5 | ## Author: Hizuro, Ekaterina, Hungtar 6 | ## Version: @project-version@ 7 | 8 | # https://warcraft.wiki.gg/wiki/Addon_Categories 9 | ## Category: Data Broker (need translation on https://warcraft.wiki.gg/wiki/Addon_Categories) 10 | ## Category-enUS: Data Broker 11 | ## Category-deDE: Datenbroker 12 | ## Category-esES: Intermediario de Datos 13 | ## Category-esMX: Intermediario de Datos 14 | ## Category-frFR: Courtier de Données 15 | ## Category--itIT: 16 | ## Category--koKR: 17 | ## Category-ptBR: Corretor de Dados 18 | ## Category-ruRU: Посредник данных 19 | ## Category-zhCN: 数据管理 20 | ## Category-zhTW: 資料管理 21 | 22 | ## SavedVariables: Broker_Everything_DataDB, Broker_Everything_CharacterDB, Broker_Everything_AceDB 23 | ## OptionalDeps: LibStub, CallbackHandler-1.0, LibSharedMedia-3.0, LibDataBroker-1.1, LibDBIcon-1.0, LibQTip-1.0, LibColors-1.0, LibRealmInfo, LibTime-1.0, Ace3, LibDropDownMenu 24 | 25 | ## X-Curse-Project-ID: 28750 26 | ## X-WoWI-ID: 18883 27 | ## X-Wago-ID: nQN5r76B 28 | 29 | libs\LibStub\LibStub.lua 30 | libs\CallbackHandler-1.0\CallbackHandler-1.0.lua 31 | libs\AceDB-3.0\AceDB-3.0.xml 32 | libs\AceDBOptions-3.0\AceDBOptions-3.0.xml 33 | libs\AceGUI-3.0\AceGUI-3.0.xml 34 | libs\AceConfig-3.0\AceConfig-3.0.xml 35 | libs\LibDataBroker-1.1\LibDataBroker-1.1.lua 36 | libs\LibDBIcon-1.0\LibDBIcon-1.0.lua 37 | libs\LibQTip-1.0\LibQTip-1.0.lua 38 | libs\LibSharedMedia-3.0\LibSharedMedia-3.0.lua 39 | libs\LibColors-1.0\LibColors-1.0.xml 40 | libs\LibTime-1.0\LibTime-1.0.xml 41 | libs\LibDropDownMenu\LibDropDownMenu.xml 42 | libs\LibRealmInfo\LibRealmInfo.lua 43 | libs\HizurosSharedTools\HizurosSharedTools.lua 44 | 45 | Broker_Everything.xml 46 | -------------------------------------------------------------------------------- /.pkgmeta: -------------------------------------------------------------------------------- 1 | package-as: Broker_Everything 2 | 3 | externals: 4 | libs/LibStub: 5 | url: https://repos.wowace.com/wow/libstub/trunk 6 | tag: latest 7 | 8 | libs/CallbackHandler-1.0: 9 | url: https://repos.wowace.com/wow/callbackhandler/trunk/CallbackHandler-1.0 10 | tag: latest 11 | 12 | libs/LibDataBroker-1.1: 13 | url: https://repos.wowace.com/wow/libdatabroker-1-1 14 | tag: latest 15 | 16 | libs/LibDBIcon-1.0: 17 | url: https://repos.wowace.com/wow/libdbicon-1-0/trunk/LibDBIcon-1.0 18 | tag: latest 19 | 20 | libs/LibQTip-1.0: 21 | url: https://github.com/Torhal/LibQTip-1.0.git 22 | tag: latest 23 | 24 | libs/LibSharedMedia-3.0: 25 | url: https://repos.wowace.com/wow/libsharedmedia-3-0/trunk/LibSharedMedia-3.0 26 | tag: latest 27 | 28 | libs/LibColors-1.0: 29 | url: https://github.com/HizurosWoWAddOns/LibColors-1.0 30 | tag: latest 31 | 32 | libs/LibTime-1.0: 33 | url: https://github.com/HizurosWoWAddOns/LibTime-1.0 34 | tag: latest 35 | 36 | libs/LibDropDownMenu: 37 | url: https://github.com/HizurosWoWAddOns/LibDropDownMenu 38 | tag: latest 39 | 40 | libs/LibRealmInfo: 41 | # url: https://github.com/phanx-wow/LibRealmInfo 42 | # url: https://github.com/janekjl/LibRealmInfo 43 | url: https://github.com/HizurosWoWAddOns/LibRealmInfo 44 | tag: latest 45 | 46 | libs/AceGUI-3.0: 47 | url: https://repos.wowace.com/wow/ace3/trunk/AceGUI-3.0 48 | tag: latest 49 | 50 | libs/AceConfig-3.0: 51 | url: https://repos.wowace.com/wow/ace3/trunk/AceConfig-3.0 52 | tag: latest 53 | 54 | libs/AceDB-3.0: 55 | url: https://repos.wowace.com/wow/ace3/trunk/AceDB-3.0 56 | tag: latest 57 | 58 | libs/AceDBOptions-3.0: 59 | url: https://repos.wowace.com/wow/ace3/trunk/AceDBOptions-3.0 60 | tag: latest 61 | 62 | libs/HizurosSharedTools: 63 | url: https://github.com/HizurosWoWAddOns/HizurosSharedTools 64 | 65 | enable-nolib-creation: no 66 | enable-toc-creation: yes 67 | 68 | ignore: 69 | - libs/LibStub/tests 70 | - libs/LibQTip-1.0/.pkgmeta 71 | - libs/LibColors-1.0/.pkgmeta 72 | - libs/LibColors-1.0/colors_fed_standard_595.lua 73 | - libs/LibColors-1.0/colors_web.lua 74 | - libs/LibColors-1.0/colors_x11.lua 75 | - libs/LibColors-1.0/LibColors-1.0-all.xml 76 | - libs/LibColors-1.0/LibColors-1.0-fed595.xml 77 | - libs/LibColors-1.0/LibColors-1.0-web.xml 78 | - libs/LibColors-1.0/LibColors-1.0-x11.xml 79 | - libs/LibColors-1.0/LibColors-1.0.toc 80 | - libs/HizurosSharedTools/README.md 81 | 82 | -------------------------------------------------------------------------------- /modules/stuff.lua: -------------------------------------------------------------------------------- 1 | 2 | -- module independent variables -- 3 | ---------------------------------- 4 | local addon, ns = ... 5 | local C, L, I = ns.LC.color, ns.L, ns.I 6 | 7 | 8 | -- module own local variables and local cached functions -- 9 | ----------------------------------------------------------- 10 | local name = "Stuff" -- L["Stuff"] L["ModDesc-Stuff"] 11 | local ttName,module,tt = name.."TT" 12 | 13 | 14 | -- register icon names and default files -- 15 | ------------------------------------------- 16 | I[name] = {iconfile="Interface\\Addons\\"..addon.."\\media\\stuff"}; --IconName::Stuff-- 17 | 18 | 19 | -- some local functions -- 20 | -------------------------- 21 | local function toggleFullscreen() 22 | C_CVar.SetCVar("gxMaximize",C_CVar.GetCVar("gxMaximize")=="1" and "0" or "1"); 23 | RestartGx(); 24 | end 25 | 26 | local function createTooltip(tt) 27 | if not (tt and tt.key and tt.key==ttName) then return end -- don't override other LibQTip tooltips... 28 | 29 | local line 30 | 31 | if tt.lines~=nil then tt:Clear(); end 32 | tt:AddHeader(C("dkyellow",L[name])) 33 | tt:AddLine(" ") 34 | 35 | line = tt:AddLine(L["ReloadUI"]) 36 | tt:SetLineScript(line, "OnMouseUp", C_UI.Reload); -- Use static Popup to avoid taint. 37 | 38 | tt:AddLine(" ") 39 | 40 | line = tt:AddLine(L["StuffToggleFullScreen"]) 41 | tt:SetLineScript(line,"OnMouseUp", toggleFullscreen); 42 | 43 | if ns.profile.GeneralOptions.showHints then 44 | tt:AddLine(" ") 45 | line = nil 46 | tt:AddLine( 47 | C("copper",L["ModKeyS"].."+"..L["MouseBtnL"]).." || "..C("green",L["ReloadUI"]) 48 | ) 49 | tt:AddLine( 50 | C("copper",L["ModKeyS"].."+"..L["MouseBtnR"]).." || "..C("green",L["StuffToggleFullScreen"]) 51 | ) 52 | end 53 | ns.roundupTooltip(tt); 54 | end 55 | 56 | 57 | -- module variables for registration -- 58 | --------------------------------------- 59 | module = { 60 | events = {}, 61 | config_defaults = { 62 | enabled = false, 63 | }, 64 | } 65 | 66 | -- function module.options() return {} end 67 | -- function module.init() end 68 | -- function module.onevent(self,event,msg) end 69 | -- function module.optionspanel(panel) end 70 | -- function module.onmousewheel(self,direction) end 71 | -- function module.ontooltip(tt) end 72 | 73 | function module.onenter(self) 74 | if (ns.tooltipChkOnShowModifier(false)) then return; end 75 | tt = ns.acquireTooltip({ttName, 1, "LEFT"},{false},{self}); 76 | createTooltip(tt); 77 | end 78 | 79 | -- function module.onleave(self) end 80 | 81 | function module.onclick(self,button) 82 | if ns.profile[name].disableOnClick then return end 83 | local shift = IsShiftKeyDown() 84 | 85 | if button=="LeftButton" and shift then 86 | C_UI.Reload(); 87 | elseif button=="RightButton" and shift then 88 | toggleFullscreen(); 89 | end 90 | end 91 | 92 | -- function module.ondblclick(self,button) end 93 | 94 | 95 | -- final module registration -- 96 | ------------------------------- 97 | ns.modules[name] = module; 98 | -------------------------------------------------------------------------------- /core.lua: -------------------------------------------------------------------------------- 1 | 2 | -- saved variables 3 | Broker_Everything_CharacterDB = {}; -- per character data 4 | Broker_Everything_DataDB = {forcePrefix=true}; -- global data 5 | Broker_Everything_AceDB = {}; -- config data table controlled by AceDB 6 | 7 | -- some usefull namespace to locals 8 | local addon, ns = ...; 9 | local C, L = ns.LC.color, ns.L; 10 | local wipe,ipairs,pairs,type=wipe,ipairs,pairs,type; 11 | local UnitLevel,UnitFactionGroup=UnitLevel,UnitFactionGroup; 12 | 13 | 14 | -- core event frame -- 15 | ---------------------- 16 | local Broker_Everything = CreateFrame("Frame"); 17 | 18 | function ns.resetAllSavedVariables() 19 | Broker_Everything_DataDB=nil 20 | Broker_Everything_CharacterDB=nil 21 | Broker_Everything_AceDB=nil 22 | Broker_Everything_DataDB.forcePrefix=true 23 | C_UI.Reload(); 24 | end 25 | 26 | function ns.resetCollectedData() 27 | Broker_Everything_DataDB=nil 28 | Broker_Everything_CharacterDB=nil 29 | C_UI.Reload(); 30 | end 31 | 32 | function ns.resetConfigs() 33 | Broker_Everything_AceDB=nil 34 | Broker_Everything_DataDB.forcePrefix=true 35 | C_UI.Reload(); 36 | end 37 | 38 | Broker_Everything:SetScript("OnEvent", function (self, event, ...) 39 | if event == "ADDON_LOADED" and addon==... then 40 | -- character cache 41 | local baseData={"name","class","faction","race"}; 42 | ns.toonsDB = Broker_Everything_CharacterDB; 43 | if ns.toonsDB.order==nil then 44 | ns.toonsDB.order={}; 45 | end 46 | local names = {}; 47 | for i=1, #ns.toonsDB.order do 48 | names[ns.toonsDB.order[i]]=1; 49 | end 50 | for name in pairs(ns.toonsDB)do 51 | if name~="order" and not names[name] then 52 | ns.toonsDB[name] = nil; 53 | end 54 | end 55 | if(not ns.toonsDB[ns.player.name_realm])then 56 | tinsert(ns.toonsDB.order,ns.player.name_realm); 57 | ns.toonsDB[ns.player.name_realm] = {orderId=#ns.toonsDB.order}; 58 | end 59 | for _,v in ipairs(baseData)do 60 | if(ns.player[v] and ns.toonsDB[ns.player.name_realm][v]~=ns.player[v])then 61 | ns.toonsDB[ns.player.name_realm][v] = ns.player[v]; 62 | end 63 | end 64 | ns.toon = ns.toonsDB[ns.player.name_realm]; 65 | ns.toon.level = UnitLevel("player"); 66 | ns.toon.lastLogin = time(); 67 | 68 | -- data cache 69 | ns.data = Broker_Everything_DataDB 70 | if ns.data.realms==nil then 71 | ns.data.realms = {}; 72 | end 73 | 74 | -- init ace option panel 75 | ns.RegisterOptions() 76 | 77 | -- modules 78 | ns.moduleInit(); 79 | 80 | -- slash command 81 | if ns.profile.GeneralOptions.chatCommands then 82 | ns.RegisterSlashCommand(); 83 | end 84 | 85 | if ns.profile.GeneralOptions.showAddOnLoaded or IsShiftKeyDown() then 86 | ns:print(L["AddOnLoaded"]); 87 | end 88 | 89 | ns.eventAddOnLoaded = true; 90 | 91 | self:UnregisterEvent(event); 92 | elseif event == "DISPLAY_SIZE_CHANGED" then 93 | ns.ui = {size={UIParent:GetSize()},center={UIParent:GetCenter()}}; 94 | elseif event=="PLAYER_LOGIN" then 95 | -- start PLAYER_LOGIN event queue for modules 96 | ns.modulePLQueueInit(); 97 | 98 | -- iconset 99 | ns.I(true); 100 | ns.updateIcons(true); 101 | 102 | ns.eventPlayerEnteredWorld=true; 103 | elseif event=="PLAYER_LEVEL_UP" then 104 | local lvl = UnitLevel("player"); 105 | if lvl~=ns.toon.level then 106 | ns.toon.level=lvl; 107 | else 108 | C_Timer.After(1,function() 109 | -- sometimes this function return old level directly on levelup event 110 | ns.toon.level = UnitLevel("player"); 111 | end); 112 | end 113 | elseif event=="NEUTRAL_FACTION_SELECT_RESULT" then 114 | ns.player.faction, ns.player.factionL = UnitFactionGroup("player"); 115 | L[ns.player.faction] = ns.player.factionL; 116 | ns.toon.faction = ns.player.faction; 117 | end 118 | end) 119 | 120 | Broker_Everything:RegisterEvent("ADDON_LOADED"); 121 | Broker_Everything:RegisterEvent("PLAYER_LOGIN"); 122 | Broker_Everything:RegisterEvent("PLAYER_LEVEL_UP"); 123 | Broker_Everything:RegisterEvent("DISPLAY_SIZE_CHANGED"); 124 | if ns.client_version>=5 then -- mop 125 | Broker_Everything:RegisterEvent("NEUTRAL_FACTION_SELECT_RESULT"); 126 | end 127 | -------------------------------------------------------------------------------- /chatcommand.lua: -------------------------------------------------------------------------------- 1 | 2 | -- some usefull namespace to locals 3 | local addon, ns = ... 4 | local C, L = ns.LC.color, ns.L 5 | local ACD = LibStub("AceConfigDialog-3.0"); 6 | 7 | -- 8 | -- Chat command handler 9 | -- 10 | local spacer = "||" 11 | 12 | local commands = { 13 | options = { 14 | desc = L["Option panel"], 15 | func = ns.ToggleBlizzOptionPanel 16 | }, 17 | broker = "options", 18 | config = "options", 19 | reset = { 20 | desc = L["CmdResetInfo"], 21 | func = ns.resetConfigs 22 | }, 23 | list = { 24 | desc = L["CmdStatusInfo"], 25 | func = function() 26 | ns:print(spacer, L["Modules"]) 27 | for k, v in ns.pairsByKeys(ns.modules) do 28 | if v and ns.profile[k] then 29 | local c,s = "red",OFF; 30 | if ns.profile[k].enabled==true then 31 | c,s = "green",L["On"]; 32 | end 33 | ns:print(spacer, (k==L[k] and "%s | %s" or "%s | %s - ( %s )"):format(C(c,s),C("ltyellow",k),L[k])) 34 | end 35 | end 36 | end, 37 | }, 38 | toggle = { 39 | desc = L["CmdToggleInfo"], 40 | func = function(arg) 41 | --cmd = cmd:gsub("^%l", string.upper); 42 | if not ns.modules[arg] then 43 | local lArg = arg:lower(); 44 | for k in pairs(ns.modules)do 45 | if k:lower() == lArg then 46 | arg = k; 47 | break; 48 | end 49 | end 50 | end 51 | if ns.modules[arg] then 52 | ns.profile[arg].enabled = not ns.profile[arg].enabled; 53 | if ns.profile[arg].enabled then 54 | ns.moduleInit(arg); 55 | ns:print(spacer,arg,ADDON_ENABLED); 56 | else 57 | ns:print(spacer,arg,ADDON_DISABLED,L["CmdNeedReload"]); 58 | end 59 | end 60 | end 61 | }, 62 | equip = { 63 | desc = L["CmdEquipInfo"], 64 | func = function(cmd) 65 | local num = C_EquipmentSet.GetNumEquipmentSets() 66 | if cmd == nil then 67 | ns:print(spacer,L["CmdEquipUsage"]); 68 | ns:print(spacer,L["CmdEquipSets"]); 69 | if num>0 then 70 | for i=0, num-1 do -- very rare in wow... equipment set index starts with 0 instead of 1 71 | local eName, _, _, isEquipped, _, _, _, missingItems = C_EquipmentSet.GetEquipmentSetInfo(i); 72 | ns:print(spacer,C((isEquipped and "yellow") or (missingItems>0 and "red") or "ltblue",eName),missingItems>0 and " - "..C("ltyellow",L["CmdEquipMiss"]:format(missingItems)) or nil); 73 | end 74 | else 75 | ns:print(spacer,L["No sets found"]); 76 | end 77 | else 78 | local validEquipment 79 | for i=1, C_EquipmentSet.GetNumEquipmentSets() do 80 | local eName, _, _, _, _, _, _, _ = C_EquipmentSet.GetEquipmentSetInfo(i) 81 | if cmd==eName then validEquipment = true end 82 | end 83 | if (not validEquipment) then 84 | ns:print(spacer,L["CmdEquipInvalid"]) 85 | else 86 | ns.toggleEquipment(cmd) 87 | end 88 | end 89 | end 90 | }, 91 | version = { 92 | desc = L["CmdVersion"], 93 | func = function() 94 | ns:print(GAME_VERSION_LABEL,"@project-version@"); 95 | end 96 | } 97 | } 98 | 99 | function ns.AddChatCommand(key,data) 100 | if not commands[key] then 101 | commands[key] = data; 102 | end 103 | end 104 | 105 | function ns.RegisterSlashCommand() 106 | SlashCmdList["BROKER_EVERYTHING"] = function(cmd) 107 | local cmd, arg = strsplit(" ", cmd, 2) 108 | cmd = cmd:lower() 109 | 110 | if cmd=="" then 111 | ns:print(spacer, L["CmdUsage"]) 112 | for name,obj in ns.pairsByKeys(commands) do 113 | if type(obj)=="string" and commands[obj] and commands[obj].desc then 114 | obj = commands[obj]; 115 | end 116 | if obj.desc then 117 | ns:print(spacer, ("%s - %s"):format(C("yellow",name),obj.desc)) 118 | end 119 | end 120 | ns:print(C("orange",L["CmdInfoOptional"])); 121 | return; 122 | end 123 | 124 | if commands[cmd]~=nil and type(commands[cmd])=="string" then 125 | cmd = commands[cmd]; 126 | end 127 | 128 | if commands[cmd]~=nil and type(commands[cmd].func)=="function" then 129 | commands[cmd].func(arg); 130 | ns:print(C("orange",L["CmdInfoOptional"])); 131 | end 132 | end 133 | 134 | 135 | SLASH_BROKER_EVERYTHING1 = "/broker_everything" 136 | SLASH_BROKER_EVERYTHING2 = "/be" 137 | end 138 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Broker_Everything (WoW AddOn) 2 | ![Build](https://img.shields.io/github/actions/workflow/status/HizurosWoWAddOns/Broker_Everything/packager.yml?style=flat-square) 3 | ![Tag](https://img.shields.io/github/v/tag/HizurosWoWAddOns/Broker_Everything?style=flat-square) 4 | ![Downloads](https://img.shields.io/github/downloads/HizurosWoWAddOns/Broker_Everything/total?style=flat-square) 5 | ![Downloads](https://img.shields.io/github/downloads/HizurosWoWAddOns/Broker_Everything/latest/total?style=flat-square) 6 |         7 | [![Patreon](https://img.shields.io/badge/‍-Patreon-gray?logo=patreon&color=red&style=flat-square)](https://www.patreon.com/bePatron?u=12558524) 8 | [![Paypal](https://img.shields.io/badge/‍-Paypal-gray?logo=paypal&color=blue&style=flat-square)](https://paypal.me/hizuro) 9 | ![Sponsors](https://img.shields.io/github/sponsors/HizurosWoWAddOns?logo=github&style=flat-square) 10 | 11 | ## Description 12 | This addon is a collection of modules to display various informations ingame about the game, your character, friends, guild and many many more. :-) 13 | 14 | [![BE Screenshot1](./.github/media/be_00t.jpg)](./.github/media/be_00.jpg) [![BE Screenshot2](./.github/media/be_01t.png)](./.github/media/be_01.png) [![BE Screenshot3](./.github/media/be_02t.png)](./.github/media/be_02.png) 15 | 16 | ## Recommentation 17 | It is recommended to use this addon with a data broker display addon... A little list of possible addons: 18 | * panel-addons:\ 19 | [Bazooka](https://www.curseforge.com/wow/addons/bazooka), [ChocolateBar](https://www.curseforge.com/wow/addons/chocolatebar), [DockingStation](https://www.wowinterface.com/downloads/info11831-DockingStationDisplay.html), [NinjaPanel](https://www.curseforge.com/wow/addons/ninjapanel), [TitanPanel](https://www.curseforge.com/wow/addons/titan-panel)\ 20 | ~~FuBar~~ *(was a good old partner in classic times, R.i.P.)* 21 | * single-button-addons:\ 22 | [Candy](https://www.curseforge.com/wow/addons/candy), [StatBlockCore](https://www.curseforge.com/wow/addons/stat-block-core)\ 23 | ~~[Fortress](https://www.wowace.com/addons/fortress/)~~ *(outdated/abandoned/owner is missing)* 24 | 25 | ## Broker (Modules) 26 | See [List of Modules](https://www.curseforge.com/wow/addons/broker-everything/pages/modules) 27 | 28 | ## Important 29 | * CPU / Memory Usage 30 | Any enabled module need cpu time and memory and this addon is a summary of modules. It is normal heavier than single broker addons but i try to 31 | * For Iconsets and Localization 32 | I have add some php scripts. the script generates the 3 example files for iconset and localization. 33 | I will try to use the php script in this folder to keep all examples up to date... :) 34 | * ElvUI / TukUI skin support missing? 35 | Please install/enable the addon AddOnSkins or AddOnSkins Classic. 36 | It is not a plugin from ElvUI/TukUI, but it is required to help other addons support ElvUI/TukUI skins. 37 | 38 | ## Known bugs 39 | * GPS/Location/ZoneText: Currently the transport menu has a problem with items that must be equipped before use. 40 | 41 | ## Icon sets support 42 | A few years ago i added support for icon sets. My coal was support third party addons to change the icons used by modules from broker_everything. An outdated demo can be found [here](https://www.wowinterface.com/downloads/info22790.html). 43 | 44 | ## Bug reports, feature requests and Support 45 | Please use the [Issues page](https://www.curseforge.com/wow/addons/broker-everything/issues) for bug reports and feature requests. 46 | 47 | ## Localization 48 | Do you want to help translate this addon?\ 49 | See [Curseforge localization tool](https://www.curseforge.com/wow/addons/broker-everything/localization) 50 | 51 | ## Credits 52 | Thanks to Hungtar for the original Broker_Everything and Ekaterina for futher developing. WowInterface and Curse community for an amazing amount of help. 53 | 54 | ## My other projects 55 | * [On Curseforge](https://www.curseforge.com/members/hizuro_de/projects) 56 | * [On Github](https://github.com/HizurosWoWAddOns?tab=repositories) 57 | 58 | ## Disclaimer 59 | > World of Warcraft© and Blizzard Entertainment© are all trademarks or registered trademarks of Blizzard Entertainment in the United States and/or other countries. These terms and all related materials, logos, and images are copyright © Blizzard Entertainment. 60 | -------------------------------------------------------------------------------- /modules/wowtoken.lua: -------------------------------------------------------------------------------- 1 | 2 | -- module independent variables -- 3 | ---------------------------------- 4 | local addon, ns = ... 5 | local C, L, I = ns.LC.color, ns.L, ns.I 6 | if ns.client_version<7 then return end 7 | 8 | 9 | -- module own local variables and local cached functions -- 10 | ----------------------------------------------------------- 11 | local name = "WoWToken"; -- L["ModDesc-WoWToken"] 12 | local ttName,ttColumns,tt,icon,module,_ = name.."TT",1; 13 | local price = {last=0,money=0,diff=0}; 14 | 15 | 16 | -- register icon names and default files -- 17 | ------------------------------------------- 18 | I[name] = {iconfile="Interface\\ICONS\\WoW_Token01",coords={0.05,0.95,0.05,0.95}}; --IconName::WoWToken-- 19 | 20 | 21 | -- some local functions -- 22 | -------------------------- 23 | 24 | 25 | -- module functions and variables -- 26 | ------------------------------------ 27 | module = { 28 | events = { 29 | "PLAYER_LOGIN", 30 | "TOKEN_MARKET_PRICE_UPDATED" 31 | }, 32 | onupdate_interval = 120, 33 | config_defaults = { 34 | enabled = false, 35 | diff=true, 36 | history=true 37 | }, 38 | }; 39 | 40 | function module.options() 41 | return { 42 | tooltip = { 43 | diff={ type="toggle", name=L["Difference"], desc=L["Show difference of last change in tooltip"]}, 44 | history={ type="toggle", name=L["Price history"], desc=L["Show price history of the 5 last changes in tooltip"]}, 45 | }, 46 | misc = { 47 | shortNumbers=true 48 | }, 49 | }; 50 | end 51 | 52 | -- function module.init() end 53 | 54 | function module.onevent(self,event,msg) 55 | if event=="PLAYER_LOGIN" then 56 | if ns.data[name]==nil then 57 | ns.data[name] = {}; 58 | end 59 | if(#ns.data[name]>0 and ns.data[name][1].last0 and ns.data[name][1].money~=price.money))then 65 | tinsert(ns.data[name],1,{money=price.money,last=price.last}); 66 | if(#ns.data[name]==7)then tremove(ns.data[name],7); end 67 | end 68 | 69 | local current = C_WowTokenPublic.GetCurrentMarketPrice(); 70 | 71 | if(current)then 72 | if(current~=price.money)then 73 | local prev=price.money; 74 | price = {last=time(),money=current}; 75 | if(prev>0)then 76 | price.diff=price.money-prev; 77 | end 78 | end 79 | 80 | local obj = ns.LDB:GetDataObjectByName(module.ldbName); 81 | obj.text = ns.GetCoinColorOrTextureString(name,current,{hideMoney=4}); 82 | end 83 | end 84 | end 85 | 86 | function module.onupdate() 87 | C_WowTokenPublic.UpdateMarketPrice(); 88 | end 89 | 90 | -- function module.optionspanel(panel) end 91 | -- function module.onmousewheel(self,direction) end 92 | 93 | function module.ontooltip(tt) 94 | local l; 95 | tt:AddLine(L[name]); 96 | tt:AddLine(" "); 97 | if(price.last~=0)then 98 | tt:AddDoubleLine( 99 | C("ltblue",L["Current price:"]), 100 | ns.GetCoinColorOrTextureString(name,price.money,{hideMoney=4,inTooltip=true}) 101 | ); 102 | tt:AddDoubleLine( 103 | C("ltblue",L["Last changed:"]), 104 | C("ltyellow",date("%Y-%m-%d %H:%M",price.last)) 105 | ); 106 | if(ns.profile[name].diff and price.diff)then 107 | local diff=""; 108 | if(price.diff<0)then 109 | diff = "- "..ns.GetCoinColorOrTextureString(name,-price.diff,{hideMoney=4,inTooltip=true}); 110 | else 111 | diff = ns.GetCoinColorOrTextureString(name,price.diff,{hideMoney=4,inTooltip=true}); 112 | end 113 | tt:AddDoubleLine( 114 | C("ltblue",L["Difference to previous:"]), 115 | diff 116 | ); 117 | end 118 | if(ns.profile[name].history and #ns.data[name]>1)then 119 | tt:AddLine(" "); 120 | tt:AddLine(C("ltblue",L["Price history (last 5 changes)"])); 121 | for i,v in ipairs(ns.data[name])do 122 | if(i>1 and v.money>0)then 123 | tt:AddDoubleLine(date("%Y-%m-%d %H:%M",v.last),ns.GetCoinColorOrTextureString(name,v.money,{hideMoney=4,inTooltip=true})); 124 | end 125 | end 126 | end 127 | else 128 | tt:AddLine(C("orange",L["Currently no price available..."])); 129 | end 130 | end 131 | 132 | -- function module.onenter(self) end 133 | -- function module.onleave(self) end 134 | -- function module.onclick(self,button) end 135 | -- function module.ondblclick(self,button) end 136 | 137 | 138 | -- final module registration -- 139 | ------------------------------- 140 | ns.modules[name] = module; 141 | -------------------------------------------------------------------------------- /modules/framenames.lua: -------------------------------------------------------------------------------- 1 | 2 | -- module independent variables -- 3 | ---------------------------------- 4 | local addon, ns = ... 5 | local C, L, I = ns.LC.color, ns.L, ns.I 6 | 7 | 8 | -- module own local variables and local cached functions -- 9 | ----------------------------------------------------------- 10 | local name = "Framenames" -- L["Framenames"] L["ModDesc-Framenames"] 11 | local ttName,ldbObject,module = name.."TT"; 12 | local lastFrame,lastMod,lastCombatState,ticker = nil,nil,nil; 13 | 14 | 15 | -- register icon names and default files -- 16 | ------------------------------------------- 17 | I[name] = {iconfile="Interface\\Addons\\"..addon.."\\media\\equip"}; --IconName::Framenames-- 18 | 19 | 20 | -- some local functions -- 21 | -------------------------- 22 | local function ownership(p,f) 23 | local secure, taint = issecurevariable(p,f); 24 | return secure==true and "Blizzard" or taint; 25 | end 26 | 27 | 28 | -- module functions and variables -- 29 | ------------------------------------ 30 | module = { 31 | events = {}, 32 | onupdate_interval = 0.2, 33 | config_defaults = { 34 | enabled = false, 35 | ownership = "shift", 36 | unitid = "shift" 37 | }, 38 | } 39 | 40 | function module.options() 41 | local values = {none=ADDON_DISABLED, shift=L["On hold shift key"], always=ALWAYS }; 42 | return { 43 | broker = { 44 | sep = {type="separator", order=1 }, 45 | ownership={ type="select", order=2, name=L["Show ownership"], desc=L["Display ownership on broker button"], values=values}, 46 | unitid={ type="select", order=3, name=L["Show unit id"], desc=L["Display unit id on broker button"], values=values}, 47 | } 48 | } 49 | end 50 | 51 | -- function module.onevent(self,event,msg) end 52 | 53 | function module.onupdate() 54 | local f; 55 | if GetMouseFoci then 56 | local objs = GetMouseFoci(); 57 | f = objs[1] or WorldFrame; -- WorldFrame no longer listed with GetMouseFoci 58 | else 59 | f = GetMouseFocus(); 60 | end 61 | if not f then return end 62 | local mod = IsShiftKeyDown(); 63 | local combat = InCombatLockdown(); 64 | 65 | if f~=WorldFrame and f==lastFrame and mod==lastMod and combat==lastCombatState then 66 | return 67 | end 68 | 69 | local F,O,P,A,I = nil,"?","","","" -- Frame, Owner, Prepend, Append, ID 70 | local ldbObject = ns.LDB:GetDataObjectByName(module.ldbName); 71 | lastFrame,lastMod,lastCombatState=f,mod,combat; 72 | 73 | if (not f) then 74 | if ldbObject.text~=UNKNOWN then 75 | ldbObject.text = UNKNOWN 76 | end 77 | else 78 | if f:IsForbidden() then 79 | F = ""; 80 | elseif f:IsProtected() and combat then 81 | F = ""; 82 | else 83 | F = f:GetName(); 84 | 85 | if F then 86 | O = ownership(f:GetParent() or _G,F); 87 | end 88 | 89 | if F=="WorldFrame" then 90 | -- Units 91 | local guid,id,_ = UnitGUID("mouseover"); 92 | local uName = UnitName("mouseover"); 93 | if guid and uName then 94 | O = false; 95 | P,_,_,_,_,id = strsplit("-",guid); 96 | if _G[P:upper()] then 97 | P = _G[P:upper()]; 98 | end 99 | F = uName or "?"; 100 | if ((ns.profile[name].unitid=="shift" and mod) or ns.profile[name].unitid=="always") and id~=nil then 101 | P = P.. ", id:"..id; 102 | end 103 | end 104 | end 105 | 106 | if f.id then 107 | I = "objectID: "..f.id; 108 | elseif f.GetID then 109 | local id = f:GetID(); 110 | if id and id~=0 then 111 | I = "frameID: "..id; 112 | end 113 | end 114 | 115 | if F == nil and type(f.key)=="string" then -- LibQTip tooltips returns nil on GetName but f.key contains the current name 116 | O = "LibQTip"; 117 | F = f.key; 118 | end 119 | 120 | if F == nil then 121 | --F = ""; 122 | F = f:GetDebugName(); 123 | local parent = f:GetParent(); 124 | if parent then 125 | for i,v in pairs(parent)do 126 | if v==f then 127 | P = "parentKey"; 128 | F = i; 129 | O = ownership(parent,i); 130 | break; 131 | end 132 | end 133 | end 134 | end 135 | end 136 | 137 | local str = F; 138 | 139 | if P and P~="" then 140 | str = "("..P..") "..str; 141 | end 142 | 143 | if A and A~="" then 144 | str = str .. " ("..A..")"; 145 | end 146 | 147 | if O~=false and ((ns.profile[name].ownership=="shift" and mod) or ns.profile[name].ownership=="always") then 148 | str = "["..O.."] "..str; 149 | if I~="" then 150 | str = str..", "..I; 151 | end 152 | end 153 | 154 | ldbObject.text = str; 155 | end 156 | end 157 | 158 | function module.init() 159 | --@do-not-package@ 160 | ns.profileSilenceFIXME=true; 161 | --@end-do-not-package@ 162 | if ns.profile[name].creatureid~=nil then 163 | ns.profile[name].unitid = ns.profile[name].creatureid; 164 | ns.profile[name].creatureid = nil; 165 | end 166 | end 167 | 168 | -- function module.optionspanel(panel) end 169 | -- function module.onmousewheel(self,direction) end 170 | 171 | function module.ontooltip(tt) 172 | tt:Hide(); 173 | end 174 | 175 | function module.onenter(self) end -- prevent displaying tt 176 | 177 | -- function module.onleave(self) end 178 | -- function module.onclick(self,button) end 179 | -- function module.ondblclick(self,button) end 180 | 181 | 182 | -- final module registration -- 183 | ------------------------------- 184 | ns.modules[name] = module; 185 | -------------------------------------------------------------------------------- /modules/surprise.lua: -------------------------------------------------------------------------------- 1 | 2 | -- module independent variables -- 3 | ---------------------------------- 4 | local addon, ns = ... 5 | local C, L, I = ns.LC.color, ns.L, ns.I 6 | if ns.client_version<4 then return end 7 | 8 | 9 | -- module own local variables and local cached functions -- 10 | ----------------------------------------------------------- 11 | local name = "Surprise" -- L["Surprise"] L["ModDesc-Surprise"] 12 | local ttName,ttColumns,tt,module = name.."TT",3,nil 13 | local ITEM_DURATION,ITEM_COOLDOWN,ITEM_LOOTABLE=1,2,3 14 | local founds,items = {}; 15 | 16 | 17 | -- register icon names and default files -- 18 | ------------------------------------------- 19 | I[name] = {iconfile="Interface\\Icons\\INV_misc_gift_01",coords={0.05,0.95,0.05,0.95}}; --IconName::Surprise-- 20 | 21 | 22 | -- some local functions -- 23 | -------------------------- 24 | local function updateBroker() 25 | local obj = ns.LDB:GetDataObjectByName(module.ldbName); 26 | local sum,finished = #founds,0; 27 | for i=1, sum do 28 | if items[founds[i].id] and items[founds[i].id][1]==ITEM_LOOTABLE then 29 | finished = finished+1; 30 | end 31 | end 32 | if sum>0 then 33 | obj.text = C(finished==0 and "gray" or "green",finished) .. "/" .. sum; 34 | else 35 | obj.text = C("gray",0).."/0"; 36 | end 37 | end 38 | 39 | local function ScanTT_Callback(data) 40 | tinsert(founds,data); 41 | updateBroker(); 42 | end 43 | 44 | local function bagCheck() 45 | wipe(founds); 46 | for sharedSlot,item in pairs(ns.items.bySlot) do 47 | if item.bag>=0 and items[item.id] then 48 | local t = CopyTable(item); 49 | t.type = "bag"; 50 | t.callback = ScanTT_Callback; 51 | ns.ScanTT.query(t); 52 | end 53 | end 54 | end 55 | 56 | local function createTooltip(tt) 57 | if not (tt and tt.key and tt.key==ttName) then return end -- don't override other LibQTip tooltips... 58 | 59 | if tt.lines~=nil then tt:Clear(); end 60 | tt:AddHeader(C("dkyellow",L[name])) 61 | tt:AddSeparator(4,0,0,0,0) 62 | 63 | if #founds>0 then 64 | tt:AddLine(C("ltblue",ITEMS)); 65 | tt:AddSeparator(); 66 | for _,item in ipairs(founds) do 67 | tt:AddLine( 68 | ("|T%s:12:12:0:-1:64:64:4:56:4:56|t |C%s%s|r"):format(item.itemTexture,C("quality"..item.itemRarity),item.itemName), 69 | C("dkyellow","||"), 70 | (type(items[item.id][2])=="function" and items[item.id][2]()) 71 | or (items[item.id][2]=="tooltip" and item.lines[items[item.id][3]]) 72 | or (items[item.id][2]=="duration" and tonumber(item.duraction) and SecondsToTime(item.duraction)) 73 | or (items[item.id][1]==ITEM_LOOTABLE and C("green",L["(finished)"])) 74 | or "("..UNKNOWN..")" 75 | ); 76 | end 77 | else 78 | tt:AddLine(L["No item found."]); 79 | end 80 | 81 | ns.roundupTooltip(tt); 82 | end 83 | 84 | 85 | -- module variables for registration -- 86 | --------------------------------------- 87 | module = { 88 | events = {}, 89 | config_defaults = { 90 | enabled = false, 91 | }, 92 | } 93 | 94 | -- function module.options() return {} end 95 | 96 | function module.init() 97 | -- see https://wow.curseforge.com/projects/broker-everything/pages/modules/surprise 98 | -- [] = {, "?", , } 99 | items = { 100 | -- 1. Unhatched Jubling Egg >> A Jubling's Tiny Home 101 | [19462] = {ITEM_COOLDOWN, "duration"}, 102 | [19450] = {ITEM_LOOTABLE}, 103 | 104 | -- 2. Mysterious Egg >> Cracked Egg 105 | [39878] = {ITEM_DURATION, "tooltip", 4}, 106 | [39883] = {ITEM_LOOTABLE}, 107 | 108 | -- 3. Disgusting Jar >> Ripe Disgusting Jar 109 | [44717] = {ITEM_DURATION, "tooltip", 4}, 110 | [44718] = {ITEM_LOOTABLE}, 111 | 112 | -- 4. Hyldnir Spoils (from daily quest) 113 | [44751] = {ITEM_LOOTABLE}, 114 | 115 | -- 5. Primal Egg >> Cracked Primal Egg 116 | [94295] = {ITEM_DURATION, "tooltip", 4}, 117 | [94296] = {ITEM_LOOTABLE}, 118 | 119 | -- 6. Warm Goren Egg >> Cracked Goren Egg 120 | [118705] = {ITEM_DURATION, "tooltip", 4}, 121 | [118706] = {ITEM_LOOTABLE}, 122 | 123 | -- 7. Strange Green Fruit >> Ripened Strange Fruit 124 | [127396] = {ITEM_DURATION, "tooltip", 4}, 125 | [127395] = {ITEM_LOOTABLE}, 126 | 127 | -- 8. Pulsating Sac >> Growling Sac 128 | [137599] = {ITEM_DURATION, "tooltip", 5}, 129 | [137608] = {ITEM_LOOTABLE}, 130 | 131 | -- 9. Time-Lost Wallet (from quest) 132 | [151482] = {ITEM_LOOTABLE}, 133 | 134 | -- 10. Fel-Spotted Egg >> Cracked Fel-Spotted Egg 135 | [153190] = {ITEM_DURATION, "tooltip", 3}, 136 | [153191] = {ITEM_LOOTABLE}, 137 | 138 | -- 11. Viable Cobra Egg >> Cracking Cobra Egg 139 | [160832] = {ITEM_DURATION, "tooltip", 3}, 140 | [160831] = {ITEM_LOOTABLE}, 141 | 142 | -- 12. Nightwreathed Egg >> Nightwreathed Watcher 143 | [166525] = {ITEM_DURATION, "tooltip", 3}, 144 | [166528] = {ITEM_LOOTABLE}, 145 | 146 | -- 13. hairy egg >> Bloodlouse Larva 147 | [182607] = {ITEM_DURATION, "tooltip", 4}, 148 | [182606] = {ITEM_LOOTABLE}, 149 | 150 | -- 14. Blight-Touched Egg >> Chewed Reins of the Callow Flayedwing 151 | [184104] = {ITEM_DURATION, "tooltip", 3}, 152 | [181818] = {ITEM_LOOTABLE}, 153 | 154 | -- 155 | } 156 | ns.items.RegisterCallback(name,bagCheck,"bags"); 157 | end 158 | 159 | function module.onevent(self,event,...) 160 | if event=="BE_UPDATE_CFG" then 161 | updateBroker(); 162 | end 163 | end 164 | 165 | -- function module.optionspanel(panel) end 166 | -- function module.onmousewheel(self,direction) end 167 | -- function module.ontooltip(tt) end 168 | 169 | function module.onenter(self) 170 | if (ns.tooltipChkOnShowModifier(false)) then return; end 171 | tt = ns.acquireTooltip({ttName, ttColumns, "LEFT", "RIGHT", "RIGHT"},{true},{self}) 172 | createTooltip(tt); 173 | end 174 | 175 | -- function module.onleave(self) end 176 | -- function module.onclick(self,button) end 177 | -- function module.ondblclick(self,button) end 178 | 179 | 180 | -- final module registration -- 181 | ------------------------------- 182 | ns.modules[name] = module; 183 | -------------------------------------------------------------------------------- /modules/titles.lua: -------------------------------------------------------------------------------- 1 | 2 | -- module independent variables -- 3 | ---------------------------------- 4 | local addon, ns = ... 5 | local C, L, I = ns.LC.color, ns.L, ns.I 6 | if ns.client_version<2 then return end 7 | 8 | -- module own local variables and local cached functions -- 9 | ----------------------------------------------------------- 10 | local name = "Titles"; L[name] = PAPERDOLL_SIDEBAR_TITLES; 11 | local ttName, ttColumns, tt, module = name.."TT", 6; 12 | local newTitles,knownTitles = {} 13 | 14 | 15 | -- register icon names and default files -- 16 | ------------------------------------------- 17 | I[name] = {iconfile="interface\\icons\\inv_misc_note_02", coords={.05,.95,.05,.95}, size={64,64}}; --IconName::Titles-- 18 | 19 | 20 | -- some local functions -- 21 | -------------------------- 22 | local function PlayerTitleSort(a, b) return a.name < b.name; end 23 | 24 | local createTooltip 25 | local function setTitle(self,id) 26 | SetCurrentTitle(id) 27 | ns.hideTooltip(tt) 28 | end 29 | 30 | local function updateBroker() 31 | local txt = {}; 32 | local current = GetCurrentTitle(); 33 | if current > 0 then 34 | local title, playerTitle = GetTitleName(current); 35 | tinsert(txt,title) 36 | end 37 | (ns.LDB:GetDataObjectByName(module.ldbName) or {}).text = #txt>0 and table.concat(txt," ") or PLAYER_TITLE_NONE; 38 | end 39 | 40 | function createTooltip(tt) 41 | if not (tt and tt.key and tt.key==ttName) then return end -- don't override other LibQTip tooltips... 42 | if tt.lines~=nil then tt:Clear(); end 43 | 44 | tt:SetCell(tt:AddLine(),1,C("dkyellow",L[name]),tt:GetHeaderFont(),"CENTER",0); 45 | tt:AddSeparator(4,0,0,0,0); 46 | 47 | local current = GetCurrentTitle(); 48 | local titles = GetKnownTitles(); 49 | local numRows = ns.profile[name].ttRows; --ceil(numTitles/40); 50 | local curCell,line; 51 | table.sort(titles,PlayerTitleSort) 52 | 53 | local l=tt:AddLine(); 54 | tt:SetCell(l,1,PLAYER_TITLE_NONE,nil,"CENTER",0) -- no title as separate line 55 | tt:SetLineScript(l,"OnMouseUp",setTitle,titles[1].id) 56 | tt:AddSeparator(1.1,.7,.7,.7); 57 | 58 | local index = 1; 59 | for i=2, #titles do 60 | if titles[i] and titles[i].name and not ns.profile[name]["title-"..titles[i].id] then 61 | curCell = index % numRows; 62 | if curCell==0 then 63 | curCell=numRows 64 | end 65 | if curCell==1 then 66 | line = tt:AddLine(); 67 | end 68 | local title = titles[i].name; 69 | if titles[i].id==current then 70 | title = C("dkyellow",title) 71 | elseif newTitles[title] then 72 | title = C("ltgreen",title) 73 | end 74 | tt:SetCell(line,curCell,title) 75 | tt:SetCellScript(line,curCell,"OnMouseUp",setTitle,titles[i].id) 76 | index = index+1 77 | end 78 | end 79 | 80 | if ns.profile.GeneralOptions.showHints then 81 | --tt:AddSeparator(4,0,0,0,0) 82 | --ns.ClickOpts.ttAddHints(tt,name); 83 | end 84 | 85 | ns.roundupTooltip(tt); 86 | end 87 | 88 | local function optHideTitle(info,value) 89 | local key = info[#info]; 90 | if value~=nil then 91 | ns.profile[name][key] = value==false and true or nil 92 | end 93 | return not ns.profile[name][key]; 94 | end 95 | 96 | 97 | -- module variables for registration -- 98 | --------------------------------------- 99 | module = { 100 | events = { 101 | --"PLAYER_LOGIN", 102 | "PLAYER_ENTERING_WORLD", 103 | "KNOWN_TITLES_UPDATE", 104 | "UNIT_NAME_UPDATE", 105 | }, 106 | config_defaults = { 107 | enabled = false, 108 | ttRows = 3, 109 | ttHideTitles = {} 110 | }, 111 | clickOptionsRename = {}, 112 | clickOptions = { 113 | --["menu"] = "OptionMenuCustom" 114 | --["ClearTitle"] = L["ClearTitle"] 115 | } 116 | }; 117 | 118 | --ns.ClickOpts.addDefaults(module,"menu","_RIGHT"); 119 | 120 | local options 121 | local function listOptTitles() 122 | local firstRun = knownTitles==nil 123 | if firstRun then 124 | knownTitles = {} 125 | end 126 | local titles,num = {},GetNumTitles() 127 | titles.desc = {type="description", order=1, name=L["TitlesShowDesc"]} 128 | for i=1, num do 129 | local tempName, playerTitle = GetTitleName(i); 130 | if tempName and IsTitleKnown(i) then 131 | titles["title-"..i] = { 132 | type = "toggle", 133 | order = 2, 134 | name = tempName, 135 | get = optHideTitle, 136 | set = optHideTitle, 137 | width = "half" 138 | } 139 | if not firstRun and not knownTitles[tempName] then 140 | newTitles[tempName] = true 141 | end 142 | knownTitles[tempName] = true; 143 | end 144 | end 145 | options.tooltip.ttShowTitles.args = titles 146 | end 147 | 148 | function module.options() 149 | options = { 150 | broker = {}, 151 | tooltip = { 152 | ttRows = {type = "range", order=1, name=L["TitlesRow"], desc=L["TitlesRowDesc"], min=1, max=8, step=1}, 153 | ttShowTitles = { 154 | type = "group", order = 2, 155 | name = L["TitlesShow"], 156 | args = {} -- filled by function 157 | } 158 | } 159 | }; 160 | return options; 161 | end 162 | 163 | -- function module.OptionMenu(self,button,modName) end 164 | 165 | -- function module.init() end 166 | 167 | function module.onevent(self,event,...) 168 | if event=="BE_UPDATE_CFG" and (...) and (...):find("^ClickOpt") then 169 | --ns.ClickOpts.update(name); 170 | return; 171 | end 172 | if event=="PLAYER_LOGIN" or event=="KNOWN_TITLES_UPDATE" then 173 | listOptTitles() 174 | end 175 | if event=="PLAYER_ENTERING_WORLD" or (event=="UNIT_NAME_UPDATE" and (...)=="player") then 176 | updateBroker() 177 | end 178 | end 179 | 180 | -- function module.optionspanel(panel) end 181 | -- function module.onmousewheel(self,direction) end 182 | -- function module.ontooltip(tooltip) end 183 | 184 | function module.onenter(self) 185 | if (ns.tooltipChkOnShowModifier(false)) then return; end 186 | tt = ns.acquireTooltip({ttName, ttColumns, "CENTER", "CENTER", "CENTER", "CENTER", "CENTER","CENTER","CENTER","CENTER"},{false},{self,mod=module},{OnHide=tooltipOnHide}); 187 | createTooltip(tt); 188 | end 189 | 190 | -- function module.onleave(self) end 191 | -- function module.onclick(self,button) end 192 | -- function module.ondblclick(self,button) end 193 | 194 | 195 | -- final module registration -- 196 | ------------------------------- 197 | ns.modules[name] = module; 198 | 199 | -------------------------------------------------------------------------------- /modules.lua: -------------------------------------------------------------------------------- 1 | local addon, ns = ...; 2 | local L = ns.L; 3 | local pairs,type=pairs,type; 4 | 5 | ns.modules = {}; 6 | local queue,queue_ticker = {}; 7 | 8 | local function queue_ticker_func() 9 | local mod 10 | if #queue>0 then 11 | mod = ns.modules[tremove(queue,1)]; 12 | mod.onevent(mod.eventFrame,"PLAYER_LOGIN"); 13 | elseif queue_ticker then 14 | queue_ticker:Cancel(); 15 | queue_ticker = nil; 16 | end 17 | end 18 | 19 | function ns.modulePLQueueInit() 20 | queue_ticker = C_Timer.NewTicker(0.001,queue_ticker_func); 21 | ns.modulePLQueueInit = nil; 22 | end 23 | 24 | function ns.updateMinimapButton(modName) 25 | local mod = ns.modules[modName]; 26 | local cfg = ns.profile[modName]; 27 | 28 | -- check config 29 | if type(cfg.minimap)~="table" then 30 | cfg.minimap = {hide=true}; 31 | end 32 | 33 | if ns.LDBI:IsRegistered(mod.ldbName) then 34 | -- perform refresh on minimap button if already exists 35 | ns.LDBI:Refresh(mod.ldbName); 36 | elseif not cfg.minimap.hide and cfg.enabled then 37 | -- register minimap button if not exists 38 | ns.LDBI:Register(mod.ldbName,mod.obj,cfg.minimap); 39 | end 40 | end 41 | 42 | -- [force] - used by child modules to enable core module (like gps and followers) 43 | local function moduleInit(name, force) 44 | if not ns.modules[name] then return end 45 | 46 | if ns.profile[name] and (ns.profile[name].enabled==true or force) then 47 | local mod = ns.modules[name]; 48 | 49 | mod.isEnabled = true; 50 | 51 | -- module init 52 | if mod.init then 53 | mod.init(); 54 | mod.init = nil; 55 | end 56 | 57 | if not mod.isHiddenModule then 58 | -- new clickOptions system 59 | local onclick; 60 | if (type(mod.clickOptions)=="table") then 61 | local active = ns.ClickOpts.update(name); 62 | if active then 63 | function onclick(self,button) 64 | ns.ClickOpts.func(self,button,name); 65 | end 66 | end 67 | elseif (type(mod.onclick)=="function") then 68 | onclick = mod.onclick; 69 | end 70 | 71 | -- LDB init 72 | if (not mod.onenter) and mod.ontooltip then 73 | mod.ontooltipshow = mod.ontooltip; 74 | end 75 | 76 | if not mod.iconName then 77 | mod.iconName = name; 78 | end 79 | local icon = ns.I(mod.iconName .. (mod.icon_suffix or "")); 80 | local iColor = ns.profile.GeneralOptions.iconcolor; 81 | local ldbOblectTable = { 82 | -- button data 83 | type = "data source", 84 | label = L[name], 85 | text = L[name], 86 | icon = icon.iconfile, -- default or custom icon 87 | staticIcon = icon.staticIcon or icon.iconfile, -- default icon only 88 | iconCoords = icon.coords or {0, 1, 0, 1}, 89 | 90 | -- button event functions 91 | OnEnter = mod.onenter or nil, 92 | OnLeave = mod.onleave or nil, 93 | OnClick = onclick, 94 | OnTooltipShow = mod.ontooltipshow or nil, 95 | 96 | -- let user know who registered the broker 97 | -- displayable by broker dispay addons... 98 | -- DataBrokerGroups using it in option panel. 99 | parent = addon 100 | }; 101 | 102 | mod.ldbName = (ns.profile.GeneralOptions.usePrefix and "BE.." or "")..name; 103 | mod.obj = ns.LDB:NewDataObject(mod.ldbName,ldbOblectTable); 104 | if not mod.obj then -- another addon has used the same name for registration 105 | mod.ldbName = "BE.."..mod.ldbName; 106 | mod.obj = ns.LDB:NewDataObject(mod.ldbName,ldbOblectTable); 107 | end 108 | 109 | ns.updateIcons(name); 110 | 111 | -- is possible that 112 | if mod.obj then 113 | -- register minimap button 114 | ns.updateMinimapButton(name); 115 | end 116 | end 117 | 118 | -- event handling 119 | if (mod.onevent and mod.events) or (mod.onupdate) then 120 | if not mod.noEventFrame then 121 | mod.eventFrame=CreateFrame("Frame"); 122 | else 123 | -- table as dummy to execute following BE_UPDATE_CFG, VARIABLES_LOADED and PLAYER_LOGIN only 124 | mod.eventFrame={}; 125 | end 126 | mod.eventFrame.modName = name; 127 | if type(mod.onevent)=="function" and type(mod.events)=="table" then 128 | mod.eventFrame:SetScript("OnEvent",mod.onevent); 129 | mod.onevent(mod.eventFrame,"BE_UPDATE_CFG"); 130 | if mod.clickOptions then 131 | mod.onevent(mod.eventFrame,"BE_UPDATE_CFG","ClickOpt"); 132 | end 133 | for _, e in pairs(mod.events) do 134 | if e=="VARIABLES_LOADED" then 135 | mod.onevent(mod.eventFrame,e,addon); 136 | elseif (e=="PLAYER_LOGIN" and ns.eventPlayerEnteredWorld) then 137 | mod.onevent(mod.eventFrame,e); 138 | end 139 | if e=="PLAYER_LOGIN" then 140 | tinsert(queue,name); 141 | else 142 | local retOK = pcall(mod.eventFrame.RegisterEvent,mod.eventFrame,e); 143 | if not retOK then 144 | ns:debug("","","",e,"for",name) 145 | end 146 | end 147 | end 148 | end 149 | end 150 | 151 | -- timeout function 152 | if type(mod.ontimeout)=="function" and type(mod.timeout)=="number" and mod.timeout>0 then 153 | C_Timer.After(mod.timeout,mod.ontimeout); 154 | end 155 | 156 | -- onupdate function 157 | -- frame script OnUpdate ticking too fast... C_Timer is better 158 | if type(mod.onupdate)=="function" and type(mod.onupdate_interval)=="number" and mod.onupdate_interval>0 then 159 | mod.onupdate_ticker = C_Timer.NewTicker(mod.onupdate_interval,mod.onupdate); 160 | end 161 | 162 | -- chat command registration 163 | if (mod.chatcommands) then 164 | for k,v in pairs(mod.chatcommands) do 165 | if (type(k)=="string") then 166 | -- Example: ns.AddChatCommand("",{desc="",func=function()end}); 167 | ns.AddChatCommand(k,v); 168 | end 169 | end 170 | end 171 | end 172 | end 173 | 174 | -- in core.lua on event ADDON_LOADED or option panel 175 | function ns.moduleInit(name,force) 176 | if (name) then 177 | -- enable module by name 178 | ns.Options_RegisterModule(name); 179 | ns.Options_RegisterDefaults(); 180 | moduleInit(name,force); 181 | else 182 | -- enable all registered modules 183 | for name, data in pairs(ns.modules) do 184 | ns.Options_RegisterModule(name); 185 | end 186 | ns.Options_RegisterDefaults(); 187 | for name, data in pairs(ns.modules) do 188 | moduleInit(name); 189 | end 190 | end 191 | end 192 | -------------------------------------------------------------------------------- /modules/ammo_classic.lua: -------------------------------------------------------------------------------- 1 | 2 | -- module independent variables -- 3 | ---------------------------------- 4 | local addon, ns = ... 5 | local classes = {HUNTER=true,ROGUE=true,WARRIOR=true,--[[WARLOCK=true]]}; 6 | if not (ns.client_version<5 and classes[ns.player.class]) then return end 7 | local C, L, I = ns.LC.color, ns.L, ns.I 8 | ns.ammo_classic = true; 9 | 10 | 11 | -- module own local variables and local cached functions -- 12 | ----------------------------------------------------------- 13 | local name = "Ammo"; -- INVTYPE_AMMO L["ModDesc-Ammo"] 14 | local ttName, ttColumns, tt, module, createTooltip = name.."TT", 2; 15 | local ammo = {sum=false,inUse=0,itemInfo={}}; 16 | local thrown = {sum=false,inUse=0,itemInfo={}}; 17 | 18 | 19 | -- register icon names and default files -- 20 | ------------------------------------------- 21 | I[name] = {iconfile=133581,coords={0.05,0.95,0.05,0.95}}; --IconName::Talents-- 22 | 23 | 24 | -- some local functions -- 25 | -------------------------- 26 | local function updateBroker() 27 | if not (ammo.sum or thrown.sum) then return end 28 | local obj,icon,text = ns.LDB:GetDataObjectByName(module.ldbName) or {}; 29 | local itemInfoInUse = false; 30 | if ammo.inUse and ammo.itemInfo[ammo.inUse] then 31 | itemInfoInUse = ammo.itemInfo[ammo.inUse]; 32 | elseif thrown.inUse and thrown.itemInfo[thrown.inUse] then 33 | itemInfoInUse = thrown.itemInfo[thrown.inUse]; 34 | end 35 | if itemInfoInUse then 36 | icon = itemInfoInUse.icon 37 | text = C( (itemInfoInUse.count<=10 and "red") or (itemInfoInUse.count<=25 and "orange") or (itemInfoInUse.count<=50 and "yellow") or "green",itemInfoInUse.count) 38 | if ns.profile[name].showNameBroker then 39 | text = text .. " " .. C("quality"..(itemInfoInUse.quality or 1),itemInfoInUse.name); 40 | end 41 | else 42 | icon,text = 133581,C("gray",L["No ammo attached"]); 43 | end 44 | obj.icon,obj.text = icon,text; 45 | end 46 | 47 | local function sortItems(a,b) 48 | return a.name>b.name; 49 | end 50 | 51 | function createTooltip(tt,update) 52 | if not (tt and tt.key and tt.key==ttName) then return end -- don't override other LibQTip tooltips... 53 | if tt.lines~=nil then tt:Clear(); end 54 | tt:SetCell(tt:AddLine(),1,C("dkyellow",INVTYPE_AMMO.." / "..INVTYPE_THROWN),tt:GetHeaderFont(),"LEFT",0); 55 | tt:AddSeparator(1); 56 | if ammo.sum>0 then 57 | tt:AddLine(C("ltgray",INVTYPE_AMMO)) 58 | table.sort(ammo.itemInfo,sortItems); 59 | for id,itemInfo in pairs(ammo.itemInfo) do 60 | tt:AddLine(" |T"..itemInfo.icon..":0|t "..C("quality"..itemInfo.quality,itemInfo.name)..(ammo.inUse==id and " "..C("green","("..CONTRIBUTION_ACTIVE..")") or ""),C("white",itemInfo.count)); 61 | end 62 | end 63 | if thrown.sum>0 then 64 | tt:AddLine(C("ltgray",INVTYPE_THROWN)) 65 | table.sort(thrown.itemInfo,sortItems); 66 | for id,itemInfo in pairs(thrown.itemInfo)do 67 | tt:AddLine(" |T"..itemInfo.icon..":0|t "..C("quality"..itemInfo.quality,itemInfo.name)..(thrown.inUse==id and " "..C("green","("..CONTRIBUTION_ACTIVE..")") or ""),C("white",itemInfo.count)); 68 | end 69 | end 70 | if ammo.sum==0 and thrown.sum==0 then 71 | tt:SetCell(tt:AddLine(),1,C("ltgray",L["No ammo or throwing weapon found..."]),nil,nil,0); 72 | end 73 | if ns.profile.GeneralOptions.showHints then 74 | tt:AddSeparator(4,0,0,0,0); 75 | ns.ClickOpts.ttAddHints(tt,name); 76 | end 77 | ns.roundupTooltip(tt); 78 | end 79 | 80 | local function updateItems() 81 | local sum,items,s,_ = {a=0,t=0},{a={},t={}},"a"; 82 | for sharedSlot in pairs(ns.items.ammo) do 83 | local item,count = ns.items.bySlot[sharedSlot],-1; 84 | if sharedSlot<0 then 85 | -- inventory 86 | count = GetInventoryItemCount("player",18); 87 | else 88 | -- container 89 | local info = C_Container.GetContainerItemInfo(item.bag,item.slot) 90 | if info then 91 | count = info.stackCount; 92 | end 93 | end 94 | if item.ammo==2 then 95 | s="t" 96 | end 97 | if count>0 then 98 | if not items[s][item.id] then 99 | items[s][item.id] = {count=count}; 100 | items[s][item.id].name,_,items[s][item.id].quality,_,_,_,_,_,_,items[s][item.id].icon = C_Item.GetItemInfo(item.id); 101 | else 102 | items[s][item.id].count = items[s][item.id].count + count; 103 | end 104 | sum[s] = sum[s] + count; 105 | else 106 | ns:debugPrint("Ammo",sharedSlot,count); 107 | end 108 | end 109 | ammo.inUse = GetInventoryItemID("player",0); 110 | ammo.sum = sum.a; 111 | ammo.itemInfo = items.a; 112 | 113 | thrown.inUse = GetInventoryItemID("player",18); 114 | thrown.sum = sum.t; 115 | thrown.itemInfo = items.t; 116 | 117 | updateBroker(); 118 | createTooltip(tt,true); 119 | end 120 | 121 | 122 | -- module functions and variables -- 123 | ------------------------------------ 124 | module = { 125 | events = { 126 | "PLAYER_LOGIN", 127 | "UNIT_RANGEDDAMAGE", 128 | }, 129 | config_defaults = { 130 | enabled = true, 131 | showNameBroker = true 132 | }, 133 | clickOptionsRename = {}, 134 | clickOptions = {} 135 | } 136 | 137 | --ns.ClickOpts.addDefaults(module,{}); 138 | 139 | function module.options() 140 | return { 141 | broker = { 142 | showNameBroker = { type="toggle", order=1, name=L["Show ammunition name"], desc=L["Display ammunition name on broker button"] } 143 | }, 144 | tooltip = nil, 145 | misc = nil, 146 | } 147 | end 148 | 149 | function module.init() 150 | ns.items.RegisterCallback(name,updateItems,"ammo"); 151 | end 152 | 153 | --[[ 154 | function module.createTalentMenu(self) 155 | if (tt~=nil) and (tt:IsShown()) then ns.hideTooltip(tt); end 156 | ns.EasyMenu:InitializeMenu(); 157 | ns.EasyMenu:ShowMenu(self); 158 | end 159 | --]] 160 | 161 | function module.onevent(self,event,arg1,...) 162 | if event=="BE_UPDATE_CFG" then 163 | if arg1 and arg1:find("^ClickOpt") then 164 | ns.ClickOpts.update(name); 165 | end 166 | elseif event=="UNIT_RANGEDDAMAGE" then 167 | updateItems(); 168 | return; 169 | end 170 | updateBroker(); 171 | end 172 | 173 | -- function module.onmousewheel(self,direction) end 174 | -- function module.optionspanel(panel) end 175 | -- function module.ontooltip(tt) end 176 | 177 | function module.onenter(self) 178 | if (ns.tooltipChkOnShowModifier(false)) then return; end 179 | tt = ns.acquireTooltip({ttName, ttColumns, "LEFT", "RIGHT", "CENTER", "CENTER"},{true},{self}); 180 | createTooltip(tt); 181 | end 182 | 183 | -- function module.onleave(self) end 184 | -- function module.onclick(self,button) end 185 | -- function module.ondblclick(self,button) end 186 | 187 | 188 | -- final module registration -- 189 | ------------------------------- 190 | ns.modules[name] = module; 191 | -------------------------------------------------------------------------------- /modules/tracking.lua: -------------------------------------------------------------------------------- 1 | 2 | -- module independent variables -- 3 | ---------------------------------- 4 | local addon, ns = ... 5 | local C, L, I = ns.LC.color, ns.L, ns.I 6 | if ns.client_version<2 then return end 7 | 8 | 9 | -- module own local variables and local cached functions -- 10 | ----------------------------------------------------------- 11 | local name,tt,module = "Tracking" -- TRACKING L["ModDesc-Tracking"] 12 | 13 | 14 | -- register icon names and default files -- 15 | ------------------------------------------- 16 | I[name] = {iconfile="Interface\\minimap\\tracking\\none"}; --IconName::Tracking-- 17 | 18 | 19 | -- some local functions -- 20 | -------------------------- 21 | 22 | local function updateTracking() 23 | local tbl = {} 24 | for i = 1, C_Minimap.GetNumTrackingTypes() do 25 | local info = C_Minimap.GetTrackingInfo(i) 26 | if info.active then 27 | tinsert(tbl,info) 28 | end 29 | end 30 | return tbl 31 | end 32 | 33 | local function updateBroker() 34 | -- broker button text 35 | local trackActive = updateTracking() 36 | local txt = TRACKING; 37 | if ns.profile[name].displaySelection then 38 | if #trackActive == 0 then 39 | txt = "None"; 40 | else 41 | txt = trackActive[1].name; 42 | if #trackActive>1 then 43 | txt = txt.." "..L["and %d more..."]:format(#trackActive-1) 44 | end 45 | end 46 | end 47 | ns.LDB:GetDataObjectByName(module.ldbName).text = txt; 48 | end 49 | 50 | -- module variables for registration -- 51 | --------------------------------------- 52 | module = { 53 | events = { 54 | "MINIMAP_UPDATE_TRACKING", 55 | "PLAYER_LOGIN" 56 | }, 57 | config_defaults = { 58 | enabled = false, 59 | displaySelection = true, 60 | hideMinimapButton = false 61 | } 62 | } 63 | 64 | function module.options() 65 | return { 66 | broker = { 67 | displaySelection={ type="toggle", name=L["Display selection"], desc=L["Display one of the selected tracking options in broker text."] }, 68 | }, 69 | tooltip = nil, 70 | misc = { 71 | hideMinimapButton={ type="toggle", order=1, name=L["Hide minimap button"], desc=L["Hide blizzard's tracking button on minimap"], width="full", disabled=ns.coexist.IsNotAlone }, 72 | hideMinimapButtonInfo={ type="description", order=2, name=ns.coexist.optionInfo, fontSize="medium", hidden=ns.coexist.IsNotAlone } 73 | } 74 | } 75 | end 76 | 77 | function module.init() 78 | if (not ns.coexist.IsNotAlone()) and ns.profile[name].hideMinimapButton then 79 | ns.hideFrames("MiniMapTracking",true); 80 | ns.hideFrames("MiniMapTrackingButton",true); 81 | end 82 | end 83 | 84 | function module.onevent(self,event,msg) 85 | if event=="BE_UPDATE_CFG" then 86 | if not ns.coexist.IsNotAlone() then 87 | ns.hideFrames("MiniMapTracking",ns.profile[name].hideMinimapButton); 88 | ns.hideFrames("MiniMapTrackingButton",ns.profile[name].hideMinimapButton); 89 | end 90 | elseif event=="MINIMAP_UPDATE_TRACKING" and _G.LibDropDownMenu_List1:IsShown() then 91 | ns.EasyMenu:Refresh(); 92 | end 93 | 94 | updateBroker(); 95 | end 96 | 97 | -- function module.optionspanel(panel) end 98 | -- function module.onmousewheel(self,direction) end 99 | 100 | function module.ontooltip(tooltip) 101 | tt=tooltip; 102 | if (ns.tooltipChkOnShowModifier(false)) then tt:Hide(); return; end 103 | 104 | local trackActive = updateTracking() 105 | tt:AddLine(TRACKING) 106 | tt:AddLine(" ") 107 | 108 | if #trackActive == 0 then 109 | tt:AddLine(C("white",L["No tracking option active."])) 110 | else 111 | for i = 1, #trackActive do 112 | tt:AddDoubleLine("|T"..trackActive[i].texture..":16:16:0:0:64:64:4:60:4:60|t "..C("white",trackActive[i].name)) 113 | end 114 | end 115 | 116 | if ns.profile.GeneralOptions.showHints then 117 | tt:AddLine(" ") 118 | tt:AddLine(C("copper",L["MouseBtn"]).." || "..C("green",L["Open tracking menu"])) 119 | end 120 | end 121 | 122 | -- function module.onenter(self) end 123 | -- function module.onleave(self) end 124 | 125 | local function trackingMenuOnClick(button) 126 | local info = C_Minimap.GetTrackingInfo(button.arg1); 127 | C_Minimap.SetTracking(button.arg1,not info.active); 128 | end 129 | 130 | local function trackingIsActive(button) 131 | local info = C_Minimap.GetTrackingInfo(button.arg1); 132 | return active or info.active; 133 | end 134 | 135 | function module.onclick(self,button) 136 | if tt then tt:Hide(); end 137 | local info, category 138 | local list,count = {},C_Minimap.GetNumTrackingTypes(); 139 | local _, class = UnitClass("player"); 140 | 141 | ns.EasyMenu:InitializeMenu(); 142 | ns.EasyMenu:AddEntry({label=L["Tracking options"], title=true}); 143 | ns.EasyMenu:AddEntry({label=MINIMAP_TRACKING_NONE, checked=MiniMapTrackingDropDown_IsNoTrackingActive, func=C_Minimap.ClearAllTracking }); 144 | ns.EasyMenu:AddEntry({separator=true}); 145 | 146 | local hunterHeader,townHeader = false; 147 | for id=1, count do 148 | info = C_Minimap.GetTrackingInfo(id); 149 | if info.subType==-1 then -- only show normal entries first in list 150 | local entry={label=info.name, icon=info.texture, arg1=id, checked=trackingIsActive, func=trackingMenuOnClick}; 151 | if info.category=="spell" then 152 | entry.tCoordLeft = 0.0625; 153 | entry.tCoordRight = 0.9; 154 | entry.tCoordTop = 0.0625; 155 | entry.tCoordBottom = 0.9; 156 | end 157 | ns.EasyMenu:AddEntry(entry); 158 | end 159 | tinsert(list,info); 160 | end 161 | 162 | for id=1, #list do 163 | -- add other subTypes with own header 164 | local entry; 165 | if list[id].subType==HUNTER_TRACKING and class == "HUNTER" then 166 | if not hunterHeader then 167 | ns.EasyMenu:AddEntry({separator=true}); 168 | ns.EasyMenu:AddEntry({label=HUNTER_TRACKING_TEXT, title=true}); 169 | hunterHeader=true; 170 | end 171 | 172 | entry = {label=list[id].name, icon=list[id].texture, arg1=id, checked=trackingIsActive, func=trackingMenuOnClick}; 173 | elseif list[id].subType==(TOWNSFOLK_TRACKING or 2) then 174 | if not townHeader then 175 | ns.EasyMenu:AddEntry({separator=true}); 176 | ns.EasyMenu:AddEntry({label=TOWNSFOLK_TRACKING_TEXT, title=true}); 177 | townHeader=true 178 | end 179 | entry = {label=list[id].name, icon=list[id].texture, arg1=id, checked=trackingIsActive, func=trackingMenuOnClick}; 180 | end 181 | if entry then 182 | if info.type=="spell" then 183 | entry.tCoordLeft = 0.0625; 184 | entry.tCoordRight = 0.9; 185 | entry.tCoordTop = 0.0625; 186 | entry.tCoordBottom = 0.9; 187 | end 188 | ns.EasyMenu:AddEntry(entry); 189 | end 190 | end 191 | 192 | ns.EasyMenu:ShowMenu(self,-20); 193 | end 194 | 195 | -- function module.ondblclick(self,button) end 196 | 197 | 198 | -- final module registration -- 199 | ------------------------------- 200 | ns.modules[name] = module; 201 | -------------------------------------------------------------------------------- /modules/chatchannels.lua: -------------------------------------------------------------------------------- 1 | 2 | -- module independent variables -- 3 | ---------------------------------- 4 | local addon, ns = ... 5 | local C, L, I = ns.LC.color, ns.L, ns.I 6 | 7 | 8 | -- module own local variables and local cached functions -- 9 | ----------------------------------------------------------- 10 | local name = "ChatChannels"; -- CHAT_CHANNELS L["ModDesc-ChatChannels"] 11 | local ttName,ttColumns,tt,module,ticker = name.."TT",2 12 | local iName, iHeader, iCollapsed, iChannelNumber, iCount, iActive, iCategory, iVoiceEnabled, iVoiceActive = 1,2,3,4,5,6,7,8,9; -- GetChannelDisplayInfo indexes 13 | local iLastUpdate, iNoUpdate = 10,11; -- custom indexes 14 | local channels,ChanIndex,updateChannelListLock,updateCountTicker={},0,"onlogin"; 15 | local wd = ({deDE="WeltVerteidigung",esES="DefensaGeneral",frFR="DéfenseUniverselle",itIT="DifesaMondiale",koKR="전쟁",ptBR="DefesaGlobal",ptPT="DefesaGlobal",ruRU="ОборонаГлобальный",zhCN="世界防务",zhTW="世界防務"})[ns.locale] or "WorldDefense"; 16 | 17 | 18 | -- register icon names and default files -- 19 | ------------------------------------------- 20 | I[name] = {iconfile="Interface\\chatframe\\ui-chatwhispericon",coords={0.05,0.95,0.05,0.95}} --IconName::ChatChannels-- 21 | 22 | 23 | -- some local functions -- 24 | -------------------------- 25 | local function updateBroker() 26 | local obj = ns.LDB:GetDataObjectByName(module.ldbName); 27 | local txt={}; 28 | for i,v in ipairs(channels)do 29 | if not v[iHeader] then 30 | local color,count = {.5,.5,.5},v[iCount] or 0; 31 | if(v.color and v[iActive])then 32 | color = v.color; 33 | end 34 | tinsert(txt,C(color,ns.FormatLargeNumber(name,count))); 35 | end 36 | end 37 | obj.text = #txt>0 and table.concat(txt,"/") or CHAT_CHANNELS; 38 | end 39 | 40 | local function addSystemChannel(tbl,index) 41 | local data = {GetChannelDisplayInfo(index)}; 42 | local chatTypeName = "SYSTEM"; 43 | if(type(data[iChannelNumber])=="number")then 44 | chatTypeName = "CHANNEL"..data[iChannelNumber]; 45 | elseif(data[iName]==GROUP)then 46 | chatTypeName = "PARTY"; 47 | if(not IsInGroup())then 48 | data[iActive]=false; 49 | end 50 | elseif(data[iName]==RAID)then 51 | chatTypeName = "RAID"; 52 | if(not IsInRaid())then 53 | data[iActive]=false; 54 | end 55 | elseif(data[iName]==INSTANCE_CHAT)then 56 | chatTypeName = "INSTANCE_CHAT"; 57 | if(not IsInInstance())then 58 | data[iActive]=false; 59 | end 60 | end 61 | local r,g,b = GetMessageTypeColor(chatTypeName); 62 | data.color = {r or 0.6, g or 0.6, b or 0.6}; 63 | if data[iName]==wd then 64 | -- exclude world defence channel from user count update. 65 | -- SetSelectedDisplayChannel on world defence results in error message 66 | data[iNoUpdate] = true; 67 | end 68 | if not tbl==channels then 69 | data[iLastUpdate] = (data[iCount]>0 and time()) or 0; 70 | end 71 | tbl[index]=data; 72 | end 73 | 74 | local function nextChannel() 75 | repeat 76 | ChanIndex=ChanIndex+1; 77 | until (channels[ChanIndex] and not channels[ChanIndex][iHeader] and channels[ChanIndex][iActive]) or not channels[ChanIndex]; 78 | 79 | if not channels[ChanIndex] then 80 | updateCountTicker:Cancel(); 81 | updateCountTicker = nil; 82 | elseif channels[ChanIndex] and channels[ChanIndex][iActive] then 83 | SetSelectedDisplayChannel(ChanIndex); -- trigger CHANNEL_COUNT_UPDATE 84 | end 85 | end 86 | 87 | local function updateChannelList() 88 | local tmp = {}; 89 | 90 | local numTotalChatChannels = GetNumDisplayChannels(); 91 | for i = 1, numTotalChatChannels do 92 | addSystemChannel(tmp,i); 93 | end 94 | channels = tmp; 95 | updateChannelListLock = false; 96 | 97 | updateBroker(); 98 | module.onupdate(); 99 | end 100 | 101 | local function createTooltip(tt,update) 102 | if not (tt and tt.key and tt.key==ttName) then return end -- don't override other LibQTip tooltips... 103 | 104 | if tt.lines~=nil then tt:Clear(); end 105 | tt:AddHeader(C("dkyellow",CHAT_CHANNELS)); 106 | 107 | for i,v in ipairs(channels) do 108 | local channel, header, collapsed, channelNumber, count, active, category = unpack(v); 109 | 110 | if header then 111 | tt:AddSeparator(4,0,0,0,0); 112 | local l=tt:AddLine(C("ltblue",channel)); 113 | if(collapsed)then 114 | tt:SetCell(l,2,C("gray","("..L["collapsed"]..")")); 115 | else 116 | tt:AddSeparator(); 117 | local n = ((not channels[i+1]) and true) or channels[i+1][2]; 118 | if(n)then 119 | tt:AddLine(C("gray",L["No channels listed..."])); 120 | end 121 | end 122 | 123 | elseif(active)then 124 | local color = "ltyellow"; 125 | if(v.color)then 126 | color = ("ff%02x%02x%02x"):format(v.color[1]*255,v.color[2]*255,v.color[3]*255); 127 | end 128 | tt:AddLine(C(color,(channelNumber~=nil and channelNumber..". " or "") ..channel), ns.FormatLargeNumber(name,count,true)); 129 | else 130 | tt:AddLine(C("gray",(channelNumber~=nil and channelNumber..". " or "") ..channel), C("gray",FACTION_INACTIVE)); 131 | end 132 | end 133 | if ns.profile.GeneralOptions.showHints then 134 | tt:AddSeparator(3,0,0,0,0); 135 | ns.ClickOpts.ttAddHints(tt,name); 136 | end 137 | if not update then 138 | ns.roundupTooltip(tt); 139 | end 140 | end 141 | 142 | 143 | -- module functions and variables -- 144 | ------------------------------------ 145 | module = { 146 | events = { 147 | "PLAYER_ENTERING_WORLD", 148 | "CHANNEL_UI_UPDATE", 149 | "CHANNEL_COUNT_UPDATE", 150 | }, 151 | onupdate_interval = 30, 152 | config_defaults = { 153 | enabled = false, 154 | }, 155 | clickOptionsRename = { 156 | ["chats"] = "1_open_chats", 157 | ["menu"] = "2_open_menu" 158 | }, 159 | clickOptions = { 160 | ["chats"] = {CHAT_CHANNELS,"call",{"ToggleFrame","ChannelFrame"}}, 161 | ["menu"] = "OptionMenu" 162 | } 163 | } 164 | 165 | ns.ClickOpts.addDefaults(module,{ 166 | chats = "_LEFT", 167 | menu = "_RIGHT" 168 | }); 169 | 170 | function module.options() 171 | return { 172 | broker = nil, 173 | tooltip = nil, 174 | misc = { 175 | shortNumbers=1, 176 | }, 177 | } 178 | end 179 | 180 | -- function module.init() end 181 | 182 | function module.onevent(self,event,...) 183 | local msg = ...; 184 | if event=="BE_UPDATE_CFG" and msg and msg:find("^ClickOpt") then 185 | ns.ClickOpts.update(name); 186 | elseif event=="CHANNEL_COUNT_UPDATE" then 187 | local index, count = ...; 188 | if channels[index]==nil then 189 | addSystemChannel(channels,index); 190 | end 191 | channels[index][iCount] = count or 0; 192 | channels[index][iLastUpdate] = time(); 193 | updateBroker(); 194 | elseif event=="PLAYER_ENTERING_WORLD" and updateChannelListLock=="onlogin" then 195 | updateChannelListLock = true; 196 | C_Timer.After(8, updateChannelList); 197 | elseif not updateChannelListLock and (event=="CHANNEL_UI_UPDATE" or (self.channelsReady and event=="PLAYER_ENTERING_WORLD")) then 198 | self.channelsReady = true; 199 | updateChannelListLock = true; 200 | C_Timer.After(.5, updateChannelList); 201 | end 202 | end 203 | 204 | function module.onupdate() 205 | if (ChannelFrame and ChannelFrame:IsShown()) or (updateCountTicker~=nil) then return end 206 | ChanIndex = 0; 207 | updateCountTicker = C_Timer.NewTicker(.5, nextChannel); 208 | end 209 | 210 | -- function module.optionspanel(panel) end 211 | -- function module.onmousewheel(self,direction) end 212 | -- function module.ontooltip(tooltip) end 213 | 214 | function module.onenter(self) 215 | if (ns.tooltipChkOnShowModifier(false)) then return; end 216 | tt = ns.acquireTooltip({ttName, ttColumns, "LEFT", "RIGHT","RIGHT"},{true},{self}); 217 | createTooltip(tt); 218 | end 219 | 220 | -- function module.onleave(self) end 221 | -- function module.onclick(self,button) end 222 | -- function module.ondblclick(self,button) end 223 | 224 | 225 | -- final module registration -- 226 | ------------------------------- 227 | ns.modules[name] = module; 228 | -------------------------------------------------------------------------------- /modules/clock.lua: -------------------------------------------------------------------------------- 1 | 2 | -- module independent variables -- 3 | ---------------------------------- 4 | local addon, ns = ... 5 | local C, L, I = ns.LC.color, ns.L, ns.I 6 | 7 | 8 | -- module own local variables and local cached functions -- 9 | ----------------------------------------------------------- 10 | local name = "Clock"; -- TIMEMANAGER_TITLE L["ModDesc-Clock"] 11 | local ttName,ttColumns, tt, module = name.."TT", 2; 12 | local _dateFormatValues = nil 13 | local IsPlayedTimeRequested = false 14 | 15 | 16 | -- register icon names and default files -- 17 | ------------------------------------------- 18 | I[name] = {iconfile="Interface\\Addons\\"..addon.."\\media\\clock"}; --IconName::Clock-- 19 | 20 | 21 | -- some local functions -- 22 | -------------------------- 23 | local function date(dateStr) 24 | local M = _G["MONTH_".._G.date("%B"):upper()]; 25 | if dateStr:find("_mm_") then 26 | dateStr = gsub(dateStr,"_mm_",M); 27 | end 28 | if dateStr:find("_m_") then 29 | dateStr = gsub(dateStr,"_m_",_G.date("%b.")); 30 | end 31 | return _G.date(dateStr); 32 | end 33 | 34 | local function createTooltip(tt,update) 35 | if not (tt and tt.key and tt.key==ttName) then return end -- don't override other LibQTip tooltips... 36 | local h24 = ns.profile[name].format24; 37 | local dSec = ns.profile[name].showSeconds; 38 | 39 | if tt.lines~=nil then tt:Clear(); end 40 | tt:AddHeader(C("dkyellow",TIMEMANAGER_TITLE)); 41 | tt:AddSeparator(); 42 | 43 | if ns.profile[name].showDate then 44 | tt:AddLine(C("ltyellow",L["Date"]), C("white",date(ns.profile[name].dateFormat))); 45 | end 46 | tt:AddLine(C("ltyellow",L["TimeLocal"]), C("white",ns.LT.GetTimeString("LocalTime",h24,dSec))); 47 | tt:AddLine(C("ltyellow",L["TimeRealm"]), C("white",ns.LT.GetTimeString("GameTime",h24,dSec))); 48 | if ns.profile[name].showUTC then 49 | tt:AddLine(C("ltyellow",L["TimeUTC"]), C("white",ns.LT.GetTimeString("UTCTime",h24,dSec))); 50 | end 51 | --tt:AddSeparator(3,0,0,0,0); 52 | --tt:AddLine(C("ltblue",L["Additional time zones"])); 53 | --tt:AddSeparator(); 54 | --tt:AddLine(C("gray","coming soon")); 55 | 56 | if ns.profile[name].showPlayed then 57 | local pT,pL,pS = ns.LT.GetPlayedTime(); 58 | tt:AddSeparator(3,0,0,0,0); 59 | tt:AddLine(C("ltblue",L["Playtime"])); 60 | tt:AddSeparator(); 61 | tt:AddLine(C("ltyellow",TOTAL),C(pT and "white" or "gray",pT and SecondsToTime(pT) or "requested...")); 62 | tt:AddLine(C("ltyellow",LEVEL),C(pL and "white" or "gray",pL and SecondsToTime(pL) or "requested...")); 63 | tt:AddLine(C("ltyellow",L["Session"]),C("white",SecondsToTime(pS))); 64 | end 65 | 66 | if ns.profile.GeneralOptions.showHints then 67 | tt:AddSeparator(3,0,0,0,0) 68 | ns.ClickOpts.ttAddHints(tt,name); 69 | end 70 | if not update then 71 | ns.roundupTooltip(tt); 72 | end 73 | end 74 | 75 | local function updateBroker() 76 | local obj = ns.LDB:GetDataObjectByName(module.ldbName); 77 | local h24 = ns.profile[name].format24; 78 | local dSec = ns.profile[name].showSeconds; 79 | local label = {"",""}; 80 | local t={}; 81 | if ns.profile[name].timeLabel then 82 | label[1] = L["TimeLabelLocal"].." "; 83 | label[2] = L["TimeLabelRealm"].." "; 84 | end 85 | if ns.profile[name].timeLocal then 86 | tinsert(t,label[1]..ns.LT.GetTimeString("LocalTime",h24,dSec)); 87 | end 88 | if ns.profile[name].timeRealm then 89 | tinsert(t,label[2]..ns.LT.GetTimeString("GameTime",h24,dSec)); 90 | end 91 | obj.text = table.concat(t,", "); 92 | end 93 | 94 | local function dateFormatValues() 95 | if not _dateFormatValues then 96 | _dateFormatValues = {}; 97 | for key,value in pairs({ 98 | ["%Y-%m-%d"] = "yyyy-mm-dd", 99 | ["%Y.%m.%d"] = "yyyy.mm.dd", 100 | ["%Y.%d.%m"] = "yyyy.dd.mm", 101 | ["%d.%m.%Y"] = "dd.mm.yyyy", 102 | ["%d/%m/%Y"] = "dd/mm/yyyy", 103 | ["%m/%d/%Y"] = "mm/dd/yyyy", 104 | ["%d. _mm_ %Y"] = "dd. mmmm yyyy", 105 | ["%d. _mm_ %y"] = "dd. mmmm yy", 106 | ["%d. _m_ %Y"] = "dd. mmm yyyy", 107 | ["%Y _mm_ %d."] = "yyyy mm dd.", 108 | })do 109 | _dateFormatValues[key] = date(key)..C("ltgray"," ("..value..")"); 110 | end 111 | end 112 | return _dateFormatValues; 113 | end 114 | 115 | -- module functions and variables -- 116 | ------------------------------------ 117 | module = { 118 | events = {}, 119 | onupdate_interval = 1, 120 | timeout = 30, 121 | config_defaults = { 122 | enabled = false, 123 | format24 = true, 124 | timeLabel = false, 125 | timeLocal = true, 126 | timeRealm = false, 127 | showSeconds = false, 128 | showDate = true, 129 | showPlayed = true, 130 | showUTC = true, 131 | dateFormat = "%Y-%m-%d" 132 | }, 133 | clickOptionsRename = { 134 | ["timemanager"] = "1_timemanager", 135 | ["time"] = "2_toggle_time", 136 | ["calendar"] = "3_calendar", 137 | ["hoursmode"] = "4_hours_mode", 138 | ["menu"] = "5_open_menu" 139 | }, 140 | clickOptions = { 141 | ["timemanager"] = {TIMEMANAGER_TITLE,"call","ToggleTimeManager"}, 142 | ["time"] = {"Switch (local or realm time)","module","switchTime"}, -- L["Switch (local or realm time)"] 143 | ["calendar"] = {"Calendar","call","ToggleCalendar"}, -- L["Calendar"] 144 | ["hoursmode"] = {"Switch (12 or 24 hours)","module","switchHoursMode"}, -- L["Switch (12 or 24 hours)"] 145 | ["stopwatch"] = {STOPWATCH_TITLE,"call","Stopwatch_Toggle"}, 146 | ["menu"] = "OptionMenu" 147 | } 148 | } 149 | 150 | ns.ClickOpts.addDefaults(module,{ 151 | timemanager = "_LEFT", 152 | calendar = "SHIFTRIGHT", 153 | hoursmode = "SHIFTLEFT", 154 | time = "_RIGHT", 155 | menu = "__NONE", 156 | stopwatch = "__NONE", 157 | }); 158 | 159 | function module.switchTime() 160 | if ns.profile[name].timeLocal and ns.profile[name].timeRealm then 161 | -- from both to local 162 | ns.profile[name].timeRealm = false; 163 | elseif ns.profile[name].timeLocal then 164 | -- from local to realm 165 | ns.profile[name].timeLocal = false; 166 | ns.profile[name].timeRealm = true; 167 | else 168 | -- from realm to both 169 | ns.profile[name].timeLocal = true; 170 | end 171 | end 172 | 173 | function module.switchHoursMode() 174 | ns.profile[name].format24 = not ns.profile[name].format24; 175 | end 176 | 177 | function module.options() 178 | return { 179 | broker = { 180 | timeLabel = { type="toggle", order=1, name=L["TimePrefix"], desc=L["TimePrefixDesc"]}, 181 | timeLocal = { type="toggle", order=2, name=L["TimeLocal"], desc=L["TimeLocalDesc"] }, 182 | timeRealm = { type="toggle", order=3, name=L["TimeRealm"], desc=L["TimeRealmDesc"] } 183 | }, 184 | tooltip = { 185 | showDate={ type="toggle", order=1, name=L["Show date"], desc=L["Display date in tooltip"] }, 186 | showUTC={ type="toggle", order=2, name=L["ClockUTC"], desc=L["ClockUTCDesc"]}, 187 | showPlayed={ type="toggle", order=3, name=L["ClockPlayedTime"], desc=L["ClockPlayedTimeDesc"]}, 188 | }, 189 | misc = { 190 | format24={ type="toggle", order=1, name=TIMEMANAGER_24HOURMODE, desc=L["Switch between time format 24 hours and 12 hours with AM/PM"] }, 191 | showSeconds={ type="toggle", order=2, name=L["Show seconds"], desc=L["Display the time with seconds in broker button and tooltip"] }, 192 | dateFormat={ type="select", order=3, name=L["Date format"], desc=L["Choose your favorite date format"], values=dateFormatValues, width="double" }, 193 | }, 194 | } 195 | end 196 | 197 | -- function module.init() end 198 | 199 | function module.onevent(self,event,...) 200 | if event=="BE_UPDATE_CFG" then 201 | ns.ClickOpts.update(name); 202 | end 203 | if ns.profile[name].showPlayed and not IsPlayedTimeRequested then 204 | ns.LT.RequestPlayedTime() 205 | IsPlayedTimeRequested = true 206 | end 207 | end 208 | 209 | function module.onupdate() 210 | updateBroker(); 211 | if tt~=nil and tt.key==name.."TT" and tt:IsShown() then 212 | createTooltip(tt,true); 213 | end 214 | end 215 | 216 | -- function module.optionspanel(panel) end 217 | -- function module.onmousewheel(self,direction) end 218 | -- function module.ontimeout(self)end 219 | -- function module.ontooltip(tt) end 220 | 221 | function module.onenter(self) 222 | if (ns.tooltipChkOnShowModifier(false)) then return; end 223 | tt = ns.acquireTooltip({ttName, ttColumns , "LEFT", "RIGHT"},{true},{self}) 224 | createTooltip(tt); 225 | end 226 | 227 | -- function module.onleave(self) end 228 | -- function module.ondblclick(self,button) end 229 | 230 | 231 | -- final module registration -- 232 | ------------------------------- 233 | ns.modules[name] = module; 234 | -------------------------------------------------------------------------------- /modules/guildlog.lua: -------------------------------------------------------------------------------- 1 | 2 | -- module independent variables -- 3 | ---------------------------------- 4 | local addon, ns = ... 5 | local C, L, I = ns.LC.color, ns.L, ns.I 6 | if ns.client_version<3 then return end 7 | 8 | 9 | -- module own local variables and local cached functions -- 10 | ----------------------------------------------------------- 11 | local name = "GuildLog" -- L["GuildLog"] L["ModDesc-GuildLog"] 12 | local ttName,ttColumns,tt,module = name.."TT",4 13 | local type2locale = { 14 | ["invite"] = C("cyan",CALENDAR_STATUS_INVITED), 15 | ["join"] = C("green",LFG_LIST_APP_INVITE_ACCEPTED), 16 | ["promote"] = C("yellow",L["Promoted"]), 17 | ["demote"] = C("orange",L["Demoted"]), 18 | ["remove"] = C("red",L["Removed"]), 19 | ["quit"] = C("red",L["Left the guild"]), 20 | } 21 | local logs = {}; 22 | 23 | 24 | -- register icon names and default files -- 25 | ------------------------------------------- 26 | I[name] = {iconfile="Interface\\icons\\inv_misc_note_05",coords={0.05,0.95,0.05,0.95}} --IconName::GuildLog-- 27 | 28 | 29 | -- some local functions -- 30 | -------------------------- 31 | local function createTooltip(tt) 32 | if not (tt and tt.key and tt.key==ttName) then return end -- don't override other LibQTip tooltips... 33 | local doHide = { 34 | ["join"] = ns.profile[name].hideJoin==true, 35 | ["quit"] = ns.profile[name].hideLeave==true, 36 | ["invite"] = ns.profile[name].hideInvite==true, 37 | ["promote"] = ns.profile[name].hidePromote==true, 38 | ["demote"] = ns.profile[name].hideDemote==true, 39 | ["remove"] = ns.profile[name].hideRemove==true 40 | } 41 | 42 | local limit,nolimit,tLimit = tonumber(ns.profile[name].max_entries),false; 43 | tLimit = limit; 44 | if (limit==0) then limit = #logs; nolimit=true; end 45 | if (limit > #logs) then limit = #logs; end 46 | 47 | if tt.lines~=nil then tt:Clear(); end 48 | if (ns.profile[name].displayMode=="NORMAL") then 49 | 50 | local l=tt:AddHeader(C("dkyellow",L[name])); 51 | if(not nolimit)then 52 | tt:SetCell(l,2,C("dkyellow","(" .. L["latest %d entries"]:format(tLimit) .. ")"),nil,"RIGHT",ttColumns-1); 53 | end 54 | l=nil; 55 | 56 | tt:AddSeparator(4,0,0,0,0); 57 | tt:AddLine( 58 | C("ltblue",L["Action"]), 59 | C("ltblue",CHARACTER), 60 | C("ltblue",L["By"]), 61 | C("ltblue",L["Recently"]) 62 | ); 63 | tt:AddSeparator(); 64 | 65 | 66 | for num=1, limit do 67 | if (not doHide[logs[num].type]) then 68 | local act = type2locale[logs[num].type]; 69 | if (logs[num].type=="promote" or logs[num].type=="demote") then 70 | act = act .. " ("..logs[num].rank..")"; 71 | end 72 | local Name,Realm,_ = strsplit("-", logs[num].char ,2); 73 | local byName,byRealm; 74 | if logs[num].by then 75 | byName,byRealm = strsplit("-", logs[num].by ,2); 76 | end 77 | tt:AddLine( 78 | act, 79 | Name .. ns.showRealmName(name,Realm), 80 | (byName) and byName .. ns.showRealmName(name,byRealm) or "", 81 | logs[num].recent 82 | ); 83 | end 84 | end 85 | elseif (ns.profile[name].displayMode=="SPLIT") then 86 | local actions,_ = {"invite","join","promote","demote","remove","quit"}; 87 | tt:AddHeader(C("dkyellow",L[name])); 88 | 89 | for _,action in ipairs(actions) do 90 | if (not doHide[action]) then 91 | tt:AddSeparator(4,0,0,0,0); 92 | tt:AddHeader(type2locale[action] .. ((not nolimit) and " ("..L["latest %d entries"]:format(tLimit)..")" or "")); 93 | if (action=="demote") or (action=="promote") then 94 | tt:AddLine( 95 | C("ltblue",CHARACTER), 96 | C("ltblue",L["By"]), 97 | C("ltblue",L["New rank"]), 98 | C("ltblue",L["Recently"]) 99 | ); 100 | else 101 | tt:AddLine( 102 | C("ltblue",CHARACTER), 103 | (action~="quit" and action~="join") and C("ltblue",L["By"]) or "", 104 | "", 105 | C("ltblue",L["Recently"]) 106 | ); 107 | end 108 | tt:AddSeparator(); 109 | local c = 0; 110 | for num=1, #logs do 111 | if (logs[num].type==action) and (c",kType,v,debugstack()); 23 | end 24 | if "@project-version@" == "@".."project-version".."@" then 25 | return "<"..k..">"; -- makes untranslated entries visible 26 | end 27 | --@end-do-not-package@ 28 | L[k] = v; 29 | return v; 30 | end, 31 | __newindex = function(t,k,v) 32 | L[k] = v; 33 | end 34 | }); 35 | 36 | -- It is not nice to read from a user the own addon or module offer more than implemented 37 | -- and a look into the code pointing on a globalstring from Blizzard. 38 | -- It sounds like another addon has changed the globalstring. 39 | -- Or Blizzard has changed the globalstring? Maybe... 40 | 41 | local lang = GetLocale(); 42 | local info,correct = {},{ 43 | RELOADUI = ({--[[enUS="Reload UI",]]deDE="Neu laden",esES="Reiniciar IU",esMX="Recargar",frFR="Recharger",itIT="Riavvio IU",koKR="UI 재시작",ptBR="Recarregar IU",ptPT="Recarregar IU",ruRU="Перезагрузка",zhCN="重新加载UI",zhTW="重新載入"})[lang] or "Reload UI" 44 | }; 45 | local function GetGlobalString(string) 46 | local result, warning, secure, foreign = _G[string], nil, issecurevariable(_G,string) 47 | local isChanged = correct[string]~=nil and _G[string]~=correct[string]; 48 | if not secure and not info[string] then 49 | local str = {L["Info: Globalstring \"%2\" was %3 by \"%1\"."]:format(foreign,string,isChanged and "modified" or "touched")}; 50 | info[string]=true; 51 | end 52 | if isChanged then 53 | result=correct[string]; 54 | if secure then 55 | ns:debugPrint("Warning: Blizzard has changed globalstring",string,"Old: "..correct[string],"New: ".._G[string]) 56 | end 57 | end 58 | return result; 59 | end 60 | 61 | -- localization by Blizzard - step 1 62 | L["Achievements"] = ACHIEVEMENTS 63 | L["Archaeology"] = PROFESSIONS_ARCHAEOLOGY 64 | L["ChatChannels"] = CHAT_CHANNELS 65 | L["Clock"] = TIMEMANAGER_TITLE 66 | L["Currency"] = CURRENCY 67 | L["Dungeon"] = LFG_TYPE_DUNGEON 68 | L["Dungeons"] = DUNGEONS 69 | L["Durability"] = DURABILITY 70 | L["Emissary Quests"] = BOUNTY_BOARD_LOCKED_TITLE 71 | L["Equipment"] = BAG_FILTER_EQUIPMENT 72 | L["Exalted"] = FACTION_STANDING_LABEL8 73 | L["Followers"] = GARRISON_FOLLOWERS 74 | L["Friendly"] = FACTION_STANDING_LABEL5 75 | L["Friends"] = FRIENDS 76 | L["Game Menu"] = MAINMENU_BUTTON 77 | L["Garrison"] = GARRISON_LOCATION_TOOLTIP 78 | L["Gold"] = BONUS_ROLL_REWARD_MONEY 79 | L["Guild"] = GUILD 80 | L["Hated"] = FACTION_STANDING_LABEL1 81 | L["Honoured"] = FACTION_STANDING_LABEL6 82 | L["Hostile"] = FACTION_STANDING_LABEL2 83 | L["Inn"] = HOME_INN 84 | L["Mail"] = BUTTON_LAG_MAIL 85 | L["Missions"] = GARRISON_MISSIONS 86 | L["Neutral"] = FACTION_STANDING_LABEL4 87 | L["OptGeneral"] = GENERAL 88 | L["OptMisc"] = AUCTION_SUBCATEGORY_OTHER 89 | L["Professions"] = TRADE_SKILLS 90 | L["Quest Log"] = QUESTLOG_BUTTON 91 | L["Raids"] = RAIDS 92 | L["Reputation"] = REPUTATION 93 | L["Revered"] = FACTION_STANDING_LABEL7 94 | L["Ships"] = GARRISON_SHIPYARD_FOLLOWERS 95 | L["Speed"] = SPEED 96 | L["System"] = CHAT_MSG_SYSTEM 97 | L["Tracking"] = TRACKING 98 | L["Unfriendly"] = FACTION_STANDING_LABEL3 99 | L["Volume"] = VOLUME 100 | L["Wardrobe"] = WARDROBE 101 | L["WorkOrders"] = CAPACITANCE_WORK_ORDERS 102 | L["XP"] = XP 103 | L["WoWProjectId2"] = EXPANSION_NAME0; 104 | L["ReloadUI"] = GetGlobalString("RELOADUI"); 105 | 106 | 107 | --@do-not-package@ 108 | -- found in globalstrings by script 109 | --L["Active"] = CONTRIBUTION_ACTIVE; -- Active 110 | --L["Average"] = GMSURVEYRATING3; -- Average 111 | --L["Completed"] = GOAL_COMPLETED; -- Completed 112 | --L["Hide"] = HIDE; -- Hide 113 | --L["Name"] = COMMUNITIES_SETTINGS_NAME_LABEL; -- Name 114 | --L["Note"] = COMMUNITIES_ROSTER_COLUMN_TITLE_NOTE; -- Note 115 | --L["PvE"] = TRANSMOG_SET_PVE; -- PvE 116 | --L["PvP"] = TRANSMOG_SET_PVP; -- PvP 117 | --L["Solo"] = SOLO; -- Solo 118 | --L["Rested"] = TUTORIAL_TITLE26; -- Rested 119 | --L["Sets"] = WARDROBE_SETS; -- Sets 120 | --L["Roles"] = COMMUNITY_MEMBER_LIST_DROP_DOWN_ROLES; -- Roles 121 | --@end-do-not-package@ 122 | 123 | -- localization by Blizzard - step 2 124 | L["FPS"] = FRAMERATE_LABEL:gsub(HEADER_COLON,""):gsub(":",""):trim(); 125 | L["Home"], L["World"] = MAINMENUBAR_LATENCY_LABEL:match("%((.*)%).*%((.*)%)"); 126 | L["Officer notes"] = OFFICER_NOTE_COLON:gsub(HEADER_COLON,""):gsub(":",""):trim(); 127 | L["Realm"] = FRIENDS_LIST_REALM:gsub(HEADER_COLON,""):gsub(":",""):trim(); -- "Realm: " 128 | 129 | -- localization by Blizzard - step 3 (by events) 130 | local byItemId = { 131 | -- [] = "", 132 | [113340] = "Blood Card" 133 | }; 134 | local byItemIdCount = 0; 135 | 136 | local frame = CreateFrame("Frame"); 137 | frame:SetScript("OnEvent",function(_,event,id) 138 | if event=="PLAYER_LOGIN" then 139 | local name; 140 | for ID, key in pairs(byItemId) do 141 | name = C_Item.GetItemInfo(ID); 142 | if name then 143 | L[key] = name; 144 | else 145 | byItemIdCount = byItemIdCount+1; 146 | end 147 | end 148 | if byItemIdCount>0 then 149 | frame:RegisterEvent("GET_ITEM_INFO_RECEIVED"); 150 | end 151 | elseif event=="GET_ITEM_INFO_RECEIVED" and byItemId[id] then 152 | L[byItemId[id]] = C_Item.GetItemInfo(id); 153 | byItemIdCount=byItemIdCount-1; 154 | if byItemIdCount==0 then 155 | frame:UnregisterEvent(event) 156 | end 157 | end 158 | end); 159 | frame:RegisterEvent("PLAYER_LOGIN"); 160 | 161 | -- localization by ;) - step 3 162 | local locale = GetLocale(); 163 | L["WoWToken"]=({deDE="WoW-Marke",esES="Ficha de WoW",esMX="Ficha de WoW",frFR="Jeton WoW",itIT="Gettone WoW",koKR="WoW 토큰",ptBR="Ficha de WoW",ptPT="Ficha de WoW",ruRU="Жетон WoW",zhCN="魔兽世界时光徽章",zhTW="魔獸代幣"})[locale] or "WoW Token"; 164 | L["Dungeons and raids"]=({deDE="Dungeons und Schlachtzüge",esES="Mazmorra y banda",esMX="Mazmorra y banda",frFR="Donjons & Raids",itIT="Spedizioni e Incursioni",ptBR="Masmorras e Raides",ptPT="Masmorras e Raides",ruRU="Подземелья и рейды",koKR="던전 및 공격대",zhCN="地下城与团队副本",zhTW="地下城与团队副本"})[locale] or "Dungeons and raids"; 165 | L["Hidden currencies"]=({deDE="Versteckte Währungen",esES="Monedas ocultas",esMX="Kaŝaj valutoj",frFR="Monnaies cachées",itIT="Valute nascoste",ptBR="Moedas ocultas",ptPT="Moedas ocultas",ruRU="Скрытые валюты",koKR="숨겨진 통화",zhCN="隐藏的货币",zhTW="隱藏的貨幣"})[locale] or "Hidden currencies"; 166 | L["Torghast"]=({frFR="Tourment",itIT="Torgast",ptBR="Thanator",ptPT="Thanator",ruRU="Торгаст",koKR="토르가스트",zhCN="托加斯特",zhTW="托加斯特"})[locale] or "Torghast" 167 | L["DragonRacing"]=({deDE="Drachenrennen",esES="Carreras de dragones",esMX="Carreras de dragones",frFR="Course de Dragons",itIT="Corsa dei Draghi",ptBR="Corrida de Dragões",ptPT="Corrida de Dragões",ruRU="Гонки драконов"})[locale] or "DragonRacing" 168 | 169 | L[addon.."_Shortcut"] = "BE"; 170 | 171 | -- last step: localization filled by BigWigsMods packager (source curseforge; see above if you want to help localize this addon) 172 | 173 | --@localization(locale="enUS", format="lua_additive_table", handle-subnamespaces="none", handle-unlocalized="ignore")@ 174 | 175 | if LOCALE_deDE then 176 | --@localization(locale="deDE", format="lua_additive_table", handle-subnamespaces="none", handle-unlocalized="ignore")@ 177 | elseif LOCALE_esES then 178 | --@localization(locale="esES", format="lua_additive_table", handle-subnamespaces="none", handle-unlocalized="ignore")@ 179 | elseif LOCALE_esMX then 180 | --@localization(locale="esMX", format="lua_additive_table", handle-subnamespaces="none", handle-unlocalized="ignore")@ 181 | elseif LOCALE_frFR then 182 | --@localization(locale="frFR", format="lua_additive_table", handle-subnamespaces="none", handle-unlocalized="ignore")@ 183 | elseif LOCALE_itIT then 184 | --@localization(locale="itIT", format="lua_additive_table", handle-subnamespaces="none", handle-unlocalized="ignore")@ 185 | elseif LOCALE_koKR then 186 | --@localization(locale="koKR", format="lua_additive_table", handle-subnamespaces="none", handle-unlocalized="ignore")@ 187 | elseif LOCALE_ptBR or LOCALE_ptPT then 188 | --@localization(locale="ptBR", format="lua_additive_table", handle-subnamespaces="none", handle-unlocalized="ignore")@ 189 | elseif LOCALE_ruRU then 190 | --@localization(locale="ruRU", format="lua_additive_table", handle-subnamespaces="none", handle-unlocalized="ignore")@ 191 | elseif LOCALE_zhCN then 192 | --@localization(locale="zhCN", format="lua_additive_table", handle-subnamespaces="none", handle-unlocalized="ignore")@ 193 | elseif LOCALE_zhTW then 194 | --@localization(locale="zhTW", format="lua_additive_table", handle-subnamespaces="none", handle-unlocalized="ignore")@ 195 | end 196 | -------------------------------------------------------------------------------- /modules/notes.lua: -------------------------------------------------------------------------------- 1 | 2 | -- module independent variables -- 3 | ---------------------------------- 4 | local addon, ns = ... 5 | local C, L, I = ns.LC.color, ns.L, ns.I 6 | 7 | 8 | -- module own local variables and local cached functions -- 9 | ----------------------------------------------------------- 10 | local name = "Notes" -- L["Notes"] L["ModDesc-Notes"] 11 | local ttName,ttColumns,tt,module = name.."TT",2; 12 | local delIndex,editor,createTooltip,note_edit 13 | local titleLimit,textLimit = 32,10000; 14 | 15 | 16 | -- register icon names and default files -- 17 | ------------------------------------------- 18 | I[name] = {iconfile="Interface\\Addons\\"..addon.."\\media\\INV_Misc_PaperBundle04a", coords={0.05,0.95,0.05,0.95}}; --IconName::Notes-- 19 | I[name..'_alliance'] = {iconfile="Interface\\Addons\\"..addon.."\\media\\INV_Misc_PaperBundle04c", coords={0.05,0.95,0.05,0.95}}; --IconName::Notes_alliance-- 20 | I[name..'_horde'] = {iconfile="Interface\\Addons\\"..addon.."\\media\\INV_Misc_PaperBundle04b", coords={0.05,0.95,0.05,0.95}}; --IconName::Notes_horde-- 21 | 22 | 23 | -- some local functions -- 24 | -------------------------- 25 | local function updateBroker() 26 | local icon,obj = I[name],ns.LDB:GetDataObjectByName(module.ldbName); 27 | local faction = UnitFactionGroup("player"):lower(); 28 | if faction~="neutral" then 29 | icon = I[name..'_'..faction]; 30 | end 31 | if icon then 32 | obj.icon = icon.iconfile; 33 | obj.iconCoords = icon.coords; 34 | end 35 | end 36 | 37 | local function note_save(self) 38 | if self~=editor then 39 | InputBoxInstructions_OnTextChanged(self==editor.title and editor.title or editor.text); 40 | end 41 | 42 | local title = editor.title:GetText():trim(); 43 | local text = editor.text:GetText():trim(); 44 | local titleCount,textCount = strlen(title),strlen(text); 45 | 46 | editor.titleCount:SetFormattedText("%d / %d",titleCount,32); 47 | editor.textCount:SetFormattedText("%s / %s",ns.FormatLargeNumber(name,textCount),ns.FormatLargeNumber(name,10000)); 48 | 49 | if textCount==0 then 50 | return; -- no text, no changes :) 51 | end 52 | 53 | if editor.index then 54 | ns.data[name][editor.index] = {title,text}; 55 | else 56 | tinsert(ns.data[name],{title,text}); 57 | editor.index = #ns.data[name]; 58 | end 59 | end 60 | 61 | -- local function updateBroker() end 62 | 63 | function note_edit(self,index) 64 | local title,text = "",""; 65 | if index then 66 | title = ns.data[name][index][1]; 67 | text = ns.data[name][index][2]; 68 | end 69 | editor.index = index or false; 70 | editor.title:SetText(title); 71 | editor.text:SetText(text); 72 | editor:Show(); 73 | end 74 | 75 | local function note_del(self,index) 76 | local index = index or self.note_index; 77 | if not index then 78 | return 79 | end 80 | if delIndex==index then 81 | tremove(ns.data[name],index); 82 | delIndex = nil; 83 | else 84 | delIndex = index; 85 | end 86 | createTooltip(tt); 87 | end 88 | 89 | local function note_options(self,index,button) 90 | if button=="LeftButton" then 91 | note_edit(self,index); 92 | elseif button=="RightButton" then 93 | note_del(self,index); 94 | end 95 | end 96 | 97 | local function note_show(self,index) 98 | GameTooltip:SetOwner(tt,"ANCHOR_NONE"); 99 | GameTooltip:SetPoint(ns.GetTipAnchor(tt,"horizontal")); 100 | GameTooltip:SetText(strlen(ns.data[name][index][1])>0 and ns.data[name][index][1] or COMMUNITIES_ROSTER_COLUMN_TITLE_NOTE); 101 | local text = ns.data[name][index][2]; 102 | if not text:match("\n") then 103 | text = ns.strWrap(text,64); 104 | end 105 | GameTooltip:AddLine(text,1,1,1); 106 | GameTooltip:Show(); 107 | end 108 | 109 | BrokerEverythingNotesEditorMixin = {} 110 | 111 | function BrokerEverythingNotesEditorMixin:OnLoad() 112 | editor = self 113 | ButtonFrameTemplate_HidePortrait(self); 114 | 115 | -- remember position & size 116 | self:SetUserPlaced(false) 117 | self:ClearAllPoints() 118 | self:SetPoint("CENTER",0,0) 119 | self:SetSize(410,240) 120 | self:SetUserPlaced(true) 121 | 122 | 123 | -- frame movable 124 | self:RegisterForDrag("LeftButton"); 125 | self:SetScript("OnDragStart", self.StartMoving); 126 | self:SetScript("OnDragStop", self.StopMovingOrSizing); 127 | 128 | -- frame resizable 129 | local minWidth,minHeight = 410,240; 130 | self.ResizeButton:Init(self,minWidth,minHeight,minWidth*3,minHeight*3); 131 | 132 | (self.TitleText or self.TitleContainer.TitleText):SetText(("%s - %s"):format(L["Notes"],C("gray",addon))); -- same template on differnt game clients retail/classic 133 | self.title.Instructions:SetText(L["Title (optional)"]); 134 | self.title:SetMaxLetters(titleLimit); 135 | self:SetScript("OnHide",note_save); 136 | self.title:SetScript("OnTextChanged",note_save); 137 | 138 | 139 | self.Scroll.ScrollBar:SetPoint("TOPLEFT",self.Scroll,"TOPRIGHT",5,-16); 140 | self.Scroll.ScrollBar:SetPoint("BOTTOMLEFT",self.Scroll,"BOTTOMRIGHT",5,15); 141 | 142 | self.text = self.Scroll.text; 143 | self.text.Left:Hide() 144 | self.text.Middle:Hide() 145 | self.text.Right:Hide() 146 | self.text.Instructions:SetText(L["Input your note here..."]); 147 | self.text:SetMaxLetters(textLimit); 148 | self.text:SetScript("OnTextChanged",note_save); 149 | 150 | -- hide window on escape and other reasons 151 | hooksecurefunc(_G,"CloseWindows",function() 152 | self:Hide(); 153 | end); 154 | end 155 | 156 | function BrokerEverythingNotesEditorMixin:OnShow() 157 | self.titleCount:SetText("0 / "..titleLimit); 158 | self.textCount:SetText("0 / "..ns.FormatLargeNumber(name,textLimit)); 159 | end 160 | 161 | function BrokerEverythingNotesEditorMixin:ResetFrame() 162 | self:SetUserPlaced(false) 163 | self:ClearAllPoints() 164 | self:SetPoint("CENTER",0,0) 165 | self:SetSize(410,240) 166 | self:SetUserPlaced(true) 167 | end 168 | 169 | function createTooltip(tt) 170 | if not (tt and tt.key and tt.key==ttName) then return end -- don't override other LibQTip tooltips... 171 | 172 | if tt.lines~=nil then tt:Clear(); end 173 | tt:AddHeader(C("dkyellow",L[name])); 174 | tt:AddSeparator(); 175 | for i=1, #ns.data[name] do 176 | local str = ns.data[name][i][1]; 177 | if strlen(str)==0 then 178 | str = strsplit("\n",ns.data[name][i][2]); 179 | str = ns.strCut(str,32); 180 | end 181 | local l=tt:AddLine(str); 182 | if delIndex==i then 183 | tt:SetCell(l,2,C("orange","("..L["really?"]..")")); 184 | end 185 | tt:SetLineScript(l,"OnMouseUp",note_options,i); 186 | tt:SetLineScript(l,"OnEnter",note_show,i); 187 | tt:SetLineScript(l,"OnLeave",GameTooltip_Hide); 188 | end 189 | if #ns.data[name]==0 then 190 | local l=tt:AddLine(); 191 | tt:SetCell(l,1,C("gray",L["No entries found"]),nil,"LEFT",0); 192 | end 193 | 194 | tt:AddSeparator(4,0,0,0,0); 195 | local l=tt:AddLine(); 196 | tt:SetCell(l,1,C("ltgray",L["Add new note"]),nil,"CENTER",0); 197 | tt:SetLineScript(l,"OnMouseUp",note_edit); 198 | 199 | if (ns.profile.GeneralOptions.showHints) then 200 | tt:AddSeparator(4,0,0,0,0); 201 | ns.AddSpannedLine(tt,C("ltblue",L["MouseBtnL"]).." || "..C("green",L["Edit note"])); 202 | ns.AddSpannedLine(tt,C("ltblue",L["MouseBtnR"]).." || "..C("green",L["Delete note"])); 203 | ns.ClickOpts.ttAddHints(tt,name); 204 | end 205 | ns.roundupTooltip(tt); 206 | end 207 | 208 | 209 | -- module functions and variables -- 210 | ------------------------------------ 211 | module = { 212 | events = { 213 | "PLAYER_LOGIN" 214 | }, 215 | config_defaults = { 216 | enabled = false, 217 | }, 218 | clickOptionsRename = { 219 | ["newnote"] = "1_new_note", 220 | ["resetwindow"] = "2_reset_frame", 221 | ["menu"] = "9_open_menu" 222 | }, 223 | clickOptions = { 224 | ["newnote"] = {"Add new note","module","newNote"}, 225 | ["resetwindow"] = {"Reset window size and position"}, 226 | ["menu"] = "OptionMenu" 227 | } 228 | } 229 | 230 | if ns.client_version>=5 then 231 | tinsert(module.events,"NEUTRAL_FACTION_SELECT_RESULT"); 232 | end 233 | 234 | ns.ClickOpts.addDefaults(module,{ 235 | newnote = "__NONE", 236 | resetwindow = "__NONE", 237 | menu = "_RIGHT" 238 | }); 239 | 240 | function module.newNote() 241 | note_edit({},nil); 242 | end 243 | 244 | function module.resetFrame() 245 | BrokerEverythingNotesEditor:ResetFrame() 246 | end 247 | 248 | function module.options() 249 | return { 250 | broker = nil, 251 | tooltip = nil, 252 | misc = { 253 | shortNumbers=true, 254 | resetwindow = {type="execute", name=RESET, desc=L["Reset window size and position"], func = function() BrokerEverythingNotesEditor:ResetFrame() end} 255 | }, 256 | } 257 | end 258 | 259 | function module.init() 260 | if ns.data[name]==nil then 261 | ns.data[name] = {}; 262 | end 263 | end 264 | 265 | function module.onevent(self,event,arg1,...) 266 | if event=="BE_UPDATE_CFG" and arg1 and arg1:find("^ClickOpt") then 267 | ns.ClickOpts.update(name); 268 | else 269 | updateBroker(); 270 | end 271 | end 272 | 273 | -- function module.optionspanel(panel) end 274 | -- function module.onmousewheel(self,direction) end 275 | -- function module.ontooltip(self) end 276 | 277 | function module.onenter(self) 278 | if (ns.tooltipChkOnShowModifier(false)) then return; end 279 | tt = ns.acquireTooltip({ttName,ttColumns, "LEFT","RIGHT"},{false},{self}); 280 | delIndex = nil; 281 | createTooltip(tt); 282 | end 283 | 284 | -- function module.onleave(self) end 285 | -- function module.onclick(self,button) end 286 | -- function module.ondblclick(self,button) end 287 | 288 | 289 | -- final module registration -- 290 | ------------------------------- 291 | ns.modules[name] = module; 292 | -------------------------------------------------------------------------------- /modules/nameplates.lua: -------------------------------------------------------------------------------- 1 | 2 | -- module independent variables -- 3 | ---------------------------------- 4 | local addon, ns = ... 5 | local C, L, I = ns.LC.color, ns.L, ns.I 6 | if ns.client_version<6 then return end 7 | 8 | 9 | -- module own local variables and local cached functions -- 10 | ----------------------------------------------------------- 11 | local name = "Nameplates" -- L["Nameplates"] L["ModDesc-Nameplates"] 12 | local ttName,ttColumns,tt,createTooltip,module = name.."TT",5 13 | local nameplateStatus = {}; 14 | 15 | 16 | -- register icon names and default files -- 17 | ------------------------------------------- 18 | I[name] = {iconfile="Interface\\Addons\\"..addon.."\\media\\nameplates"}; --IconName::Nameplates-- 19 | 20 | 21 | -- some local functions -- 22 | -------------------------- 23 | local function toggleCVar(self,v) 24 | if v.type=="single" then 25 | ns.SetCVar(v.cvar, v.state and 0 or 1, v.cvar); 26 | elseif v.type=="group" then 27 | for cvar, value in pairs(v.cvar)do 28 | if type(cvar)=="string" and GetCVar(cvar)~=value then 29 | ns.SetCVar(cvar, value, cvar); 30 | end 31 | end 32 | end 33 | if v.cvar and type(v.onChange)=="function" then 34 | v.onChange(); 35 | end 36 | createTooltip(tt); 37 | end 38 | 39 | function createTooltip(tt) 40 | if not (tt and tt.key and tt.key==ttName) then return end -- don't override other LibQTip tooltips... 41 | 42 | if tt.lines~=nil then tt:Clear(); end 43 | local l = tt:AddHeader() 44 | tt:SetCell(l, 1, C("dkyellow",L[name]), nil, nil, ttColumns); 45 | tt:AddSeparator(1,0,0,0,0) -- transparent 46 | 47 | local depend, dependName,color = 3,"","gray" 48 | local _, line, cell = nil,false,1 49 | 50 | for _,row in ipairs(nameplateStatus)do 51 | local l=tt:AddLine(); 52 | local cell = 1; 53 | for i,v in ipairs(row) do 54 | local color = "white"; 55 | if v.txt and v.txt:find("\124") then 56 | v.txt=gsub(v.txt,"\124T.+\124t",""); 57 | end 58 | v.txt = gsub(v.txt,"\n"," "); 59 | if v.cvar then 60 | v.state,v.dstate=nil,nil; -- cvar state, dependency cvar state 61 | if v.type=="single" then 62 | v.state = GetCVarBool(v.cvar); 63 | elseif v.type=="group" then 64 | v.state = true; 65 | for cvar, value in pairs(v.cvar)do 66 | if type(cvar)=="string" and GetCVar(cvar)~=value then 67 | v.state = false; 68 | end 69 | end 70 | end 71 | if v.cvar_depend then 72 | v.dstate = GetCVarBool(v.cvar_depend); 73 | elseif v.cvar_depend_inv then 74 | v.dstate = not GetCVarBool(v.cvar_depend_inv); 75 | end 76 | end 77 | local tColors = type(v.colors); 78 | if tColors=="table" then 79 | local cIndex = v.state and 1 or 2; 80 | if v.dstate==false then 81 | cIndex = cIndex+2; 82 | end 83 | color = v.colors[cIndex]; 84 | elseif tColors=="string" then 85 | color = v.colors; 86 | elseif v.state~=nil then 87 | color = v.state and "white" or "ltgray"; 88 | end 89 | tt:SetCell(l,cell,C(color,v.txt:trim()), nil, nil, v.rows); 90 | if v.cvar then 91 | tt:SetCellScript(l, cell, "OnMouseUp", toggleCVar, v); 92 | end 93 | cell = cell + (v.rows or 1); 94 | end 95 | if row.separator then 96 | if row.separator==1 then 97 | tt:AddSeparator(); 98 | else 99 | tt:AddSeparator(row.separator,0,0,0,0); 100 | end 101 | end 102 | end 103 | 104 | if ns.profile.GeneralOptions.showHints then 105 | tt:AddSeparator(4,0,0,0,0); 106 | tt:SetCell(tt:AddLine(), 1, C("ltblue",L["MouseBtn"]).." || "..C("green",L["Names/Nameplates on/off"]), nil, nil, ttColumns) 107 | ns.ClickOpts.ttAddHints(tt,name); 108 | end 109 | ns.roundupTooltip(tt); 110 | end 111 | 112 | 113 | -- module functions and variables -- 114 | ------------------------------------ 115 | module = { 116 | events = { 117 | "PLAYER_LOGIN", 118 | "CVAR_UPDATE" 119 | }, 120 | config_defaults = { 121 | enabled = false 122 | } 123 | } 124 | 125 | -- function module.options() return {} end 126 | 127 | function module.init() 128 | ttColumns = 6; 129 | local colors1,colors2,colors3 = {"white","gray"},{"white","gray","gray","dkgray"},{"dkgray","black","white","gray"}; 130 | local UNML = InterfaceOptionsNamesPanelUnitNameplatesMakeLarger 131 | local UpdateNamePlateOptions = function() NamePlateDriverFrame:UpdateNamePlateOptions() end 132 | nameplateStatus = { 133 | {{txt=PLAYER,colors="ltblue"}, {txt=FRIENDLY,colors="ltgreen",rows=2}, {txt=ENEMY,colors="ltred",rows=3}, separator=1}, 134 | { 135 | {txt=NAMES_LABEL, colors="ltyellow" }, 136 | {txt=PLAYER, type="single", cvar="UnitNameFriendlyPlayerName", colors=colors1 }, 137 | {txt=UNIT_NAME_FRIENDLY_MINIONS,type="single", cvar="UnitNameFriendlyMinionName", colors=colors2, cvar_depend="UnitNameFriendlyPlayerName" }, 138 | {txt=PLAYER, type="single", cvar="UnitNameEnemyPlayerName", colors=colors1 }, 139 | {txt=UNIT_NAME_ENEMY_MINIONS, type="single", cvar="UnitNameEnemyMinionName", colors=colors2, cvar_depend="UnitNameEnemyPlayerName" }, 140 | }, 141 | { 142 | {txt=L["Nameplates"], colors="ltyellow" }, 143 | {txt=PLAYER, type="single", cvar="nameplateShowFriends", colors=colors1 }, 144 | {txt=UNIT_NAMEPLATES_SHOW_FRIENDLY_MINIONS, type="single", cvar="nameplateShowFriendlyMinions", colors=colors2, cvar_depend="nameplateShowFriends" }, 145 | {txt=PLAYER, type="single", cvar="nameplateShowEnemies", colors=colors1 }, 146 | {txt=UNIT_NAMEPLATES_SHOW_ENEMY_MINIONS, type="single", cvar="nameplateShowEnemyMinions", colors=colors2, cvar_depend="nameplateShowEnemies" }, 147 | {txt=UNIT_NAMEPLATES_SHOW_ENEMY_MINUS, type="single", cvar="nameplateShowEnemyMinus", colors=colors2, cvar_depend="nameplateShowEnemies" }, 148 | }, 149 | 150 | {separator=4}, 151 | 152 | {{txt=UNIT_NAME_NPC,colors="ltblue"}, separator=1}, 153 | { 154 | {txt=NPC_NAMES_DROPDOWN_ALL,type="single", cvar="UnitNameNPC", colors=colors1 }, 155 | {txt=L["Interactive NPCs"], type="single", cvar="UnitNameInteractiveNPC", colors=colors2, cvar_depend_inv="UnitNameNPC", rows=2}, 156 | {txt=L["Special NPCs"], type="single", cvar="UnitNameFriendlySpecialNPCName", colors=colors2, cvar_depend_inv="UnitNameNPC", rows=2}, 157 | {txt=L["Hostile NPCs"], type="single", cvar="UnitNameHostleNPC", colors=colors2, cvar_depend_inv="UnitNameNPC"}, 158 | }, 159 | 160 | {separator=4}, 161 | 162 | {{txt=L["More names"], colors="ltblue" },separator=1}, 163 | { 164 | {txt=UNIT_NAME_OWN, type="single", cvar="UnitNameOwn", colors=colors1 }, 165 | {txt=UNIT_NAME_NONCOMBAT_CREATURE, type="single", cvar="UnitNameNonCombatCreatureName", colors=colors1, rows=3}, 166 | }, 167 | 168 | {separator=4}, 169 | 170 | {{txt=L["More nameplate options"], colors="ltblue" },separator=1}, 171 | { 172 | { txt=L["Nameplate size"], colors="dkyellow" }, 173 | 174 | { txt=PLAYER_DIFFICULTY1, 175 | colors=colors1, 176 | onChange=UpdateNamePlateOptions, 177 | type="group", cvar={NamePlateHorizontalScale="1", NamePlateVerticalScale="1", NamePlateClassificationScale="1"} -- 1, 1.4 178 | }, 179 | { txt=VIDEO_OPTIONS_FAIR, 180 | colors=colors1, 181 | onChange=UpdateNamePlateOptions, 182 | type="group", cvar={NamePlateHorizontalScale="1.18", NamePlateVerticalScale="1.9", NamePlateClassificationScale="1.25"} 183 | }, 184 | { txt=LARGE, 185 | colors=colors1, 186 | onChange=UpdateNamePlateOptions, 187 | type="group", cvar={NamePlateHorizontalScale="1.4", NamePlateVerticalScale="2.7", NamePlateClassificationScale="1.25"} -- 1.4, 2.7 188 | }, 189 | { txt=L["Larger"], colors=colors1, 190 | onChange=UpdateNamePlateOptions, 191 | type="group", cvar={NamePlateHorizontalScale="1.9", NamePlateVerticalScale="3.8", NamePlateClassificationScale="1.25"} 192 | }, 193 | { txt=L["Even larger"], colors=colors1, 194 | row=2, 195 | onChange=UpdateNamePlateOptions, 196 | type="group", cvar={NamePlateHorizontalScale="2.6", NamePlateVerticalScale="5.2", NamePlateClassificationScale="1.25"} 197 | }, 198 | }, 199 | { 200 | {txt=L["Nameplates out of combat"], type="single", cvar="nameplateShowAll", colors=colors1, rows=1}, 201 | {txt=SHOW_NAMEPLATE_LOSE_AGGRO_FLASH, type="single", cvar="ShowNamePlateLoseAggroFlash", colors=colors1, rows=4}, 202 | }, 203 | 204 | {separator=4}, 205 | 206 | {{txt=DISPLAY_PERSONAL_RESOURCE,colors="ltblue" },separator=1}, 207 | {{txt=DISPLAY_PERSONAL_RESOURCE,type="single", cvar="nameplateShowSelf", colors=colors1,rows=ttColumns}}, 208 | {{txt=DISPLAY_PERSONAL_RESOURCE_ON_ENEMY,type="single", cvar="nameplateResourceOnTarget", colors=colors1, rows=ttColumns}}, 209 | 210 | {separator=4}, 211 | 212 | {{txt=AUCTION_SUBCATEGORY_OTHER,colors="ltblue"},separator=1}, 213 | {{txt=L["Show quest unit circles"],type="single", cvar="ShowQuestUnitCircles", colors=colors1,rows=ttColumns}} 214 | }; 215 | end 216 | 217 | function module.onevent(self,event,msg,msg2) 218 | local dataobj = ns.LDB:GetDataObjectByName(module.ldbName) 219 | local allFriends, friends = GetCVar("nameplateShowFriends"), GetCVar("UnitNameFriendlyPlayerName") 220 | local allEnemies, enemy = GetCVar("nameplateShowEnemies"), GetCVar("UnitNameEnemyPlayerName") 221 | 222 | if (friends == "1" or allFriends == "1") and (enemy == "1" or allEnemies == "1") then 223 | dataobj.text = FRIENDLY .. " & " .. ENEMY 224 | elseif (friends == "1" or allFriends == "1") then 225 | dataobj.text = FRIENDLY 226 | elseif (enemy == "1" or allEnemies == "1") then 227 | dataobj.text = ENEMY 228 | else 229 | dataobj.text = NONE 230 | end 231 | end 232 | 233 | -- function module.optionspanel(panel) end 234 | -- function module.onmousewheel(self,direction) end 235 | -- function module.ontooltip(tt) end 236 | 237 | function module.onenter(self) 238 | if (ns.tooltipChkOnShowModifier(false)) then return; end 239 | tt = ns.acquireTooltip({ttName, ttColumns, "LEFT", "LEFT","LEFT","LEFT","LEFT","LEFT"},{false},{self}); 240 | createTooltip(tt); 241 | end 242 | 243 | -- function module.onleave(self) end 244 | -- function module.onclick(self,button) end 245 | -- function module.ondblclick(self,button) end 246 | 247 | 248 | -- final module registration -- 249 | ------------------------------- 250 | ns.modules[name] = module; 251 | -------------------------------------------------------------------------------- /Broker_Everything.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 |