Compare commits
	
		
			407 Commits
		
	
	
		
			v1.0.3-Bet
			...
			v2.20-Rele
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					9be1195f88 | ||
| 
						 | 
					9f6c3bd180 | ||
| 
						 | 
					ed291376aa | ||
| 
						 | 
					fea116a72e | ||
| 
						 | 
					bbe272bb48 | ||
| 
						 | 
					b2b4848ff4 | ||
| 
						 | 
					aa66a9a10c | ||
| 
						 | 
					cf64424080 | ||
| 
						 | 
					db66226209 | ||
| 
						 | 
					f2df08feac | ||
| 
						 | 
					02de969fa4 | ||
| 
						 | 
					b413d4ee49 | ||
| 
						 | 
					8e477b96e3 | ||
| 
						 | 
					5642cf686d | ||
| 
						 | 
					330e207761 | ||
| 
						 | 
					7f17ebc442 | ||
| 
						 | 
					a9247e1f76 | ||
| 
						 | 
					e86acf0cb2 | ||
| 
						 | 
					c9fab2d8c2 | ||
| 
						 | 
					32d4ae6a5c | ||
| 
						 | 
					8cec363d5e | ||
| 
						 | 
					c49fff4bd1 | ||
| 
						 | 
					5f1e1da895 | ||
| 
						 | 
					14dc227c86 | ||
| 
						 | 
					7d86078c8c | ||
| 
						 | 
					6b7b3ce3c9 | ||
| 
						 | 
					8727482b96 | ||
| 
						 | 
					6e6673c4fd | ||
| 
						 | 
					fccc31b6f5 | ||
| 
						 | 
					7c2cd5092e | ||
| 
						 | 
					b9f696675b | ||
| 
						 | 
					7c3906533b | ||
| 
						 | 
					cacf464818 | ||
| 
						 | 
					a089172201 | ||
| 
						 | 
					c00710f110 | ||
| 
						 | 
					e507d70eca | ||
| 
						 | 
					379040426c | ||
| 
						 | 
					86bf851c64 | ||
| 
						 | 
					f1652e2b42 | ||
| 
						 | 
					23097951e3 | ||
| 
						 | 
					be1d4475d1 | ||
| 
						 | 
					674eabd489 | ||
| 
						 | 
					e68dea3f22 | ||
| 
						 | 
					a87455e7bd | ||
| 
						 | 
					2a12f35e58 | ||
| 
						 | 
					1cf5f3df25 | ||
| 
						 | 
					13a26d82c6 | ||
| 
						 | 
					c408448aad | ||
| 
						 | 
					c576adec2f | ||
| 
						 | 
					b8e75b6804 | ||
| 
						 | 
					eaf7c6a517 | ||
| 
						 | 
					764c8a971b | ||
| 
						 | 
					dbaaccd3ec | ||
| 
						 | 
					02e9b2e41a | ||
| 
						 | 
					96c42b1522 | ||
| 
						 | 
					29c3a7596c | ||
| 
						 | 
					f1fde07e6c | ||
| 
						 | 
					73a54b4489 | ||
| 
						 | 
					6f50bc96ef | ||
| 
						 | 
					9afc359b57 | ||
| 
						 | 
					f673850eb0 | ||
| 
						 | 
					45eacbde7f | ||
| 
						 | 
					80eee574a9 | ||
| 
						 | 
					cb6de72b93 | ||
| 
						 | 
					2720e25cea | ||
| 
						 | 
					7d77054a7b | ||
| 
						 | 
					3d4479cc06 | ||
| 
						 | 
					d43d8e9284 | ||
| 
						 | 
					a8a6002f47 | ||
| 
						 | 
					f283ea994a | ||
| 
						 | 
					15fb697258 | ||
| 
						 | 
					eddd7588f4 | ||
| 
						 | 
					5b32b8c793 | ||
| 
						 | 
					10caa05e31 | ||
| 
						 | 
					c6c3d23074 | ||
| 
						 | 
					1a8cd81f7a | ||
| 
						 | 
					d348b87ddf | ||
| 
						 | 
					2f20d305b6 | ||
| 
						 | 
					24bb84663f | ||
| 
						 | 
					d6351dbe88 | ||
| 
						 | 
					26241d73d6 | ||
| 
						 | 
					8fa481affe | ||
| 
						 | 
					3c82edc441 | ||
| 
						 | 
					d23d749f1e | ||
| 
						 | 
					34b0a18d9a | ||
| 
						 | 
					ad4ba087f5 | ||
| 
						 | 
					b14406f75f | ||
| 
						 | 
					907c64a864 | ||
| 
						 | 
					27573b7530 | ||
| 
						 | 
					051571f4ef | ||
| 
						 | 
					3e59a03ce9 | ||
| 
						 | 
					86337919b8 | ||
| 
						 | 
					5212479dae | ||
| 
						 | 
					09bfb99681 | ||
| 
						 | 
					803abd6f07 | ||
| 
						 | 
					41b299e0b1 | ||
| 
						 | 
					d8391b0f66 | ||
| 
						 | 
					ce3812d234 | ||
| 
						 | 
					23729f5960 | ||
| 
						 | 
					0b512af2b7 | ||
| 
						 | 
					5ceedb53de | ||
| 
						 | 
					66931e18f9 | ||
| 
						 | 
					27eeade507 | ||
| 
						 | 
					37902e37e7 | ||
| 
						 | 
					9266274c16 | ||
| 
						 | 
					19eba81faa | ||
| 
						 | 
					2d58d3fb77 | ||
| 
						 | 
					016327c659 | ||
| 
						 | 
					4885e11b10 | ||
| 
						 | 
					4583cbdf24 | ||
| 
						 | 
					35e119160a | ||
| 
						 | 
					ddccf7a62e | ||
| 
						 | 
					89a5511fb9 | ||
| 
						 | 
					874d8471e8 | ||
| 
						 | 
					7c145752f7 | ||
| 
						 | 
					47a15bd2a1 | ||
| 
						 | 
					cd64e8b481 | ||
| 
						 | 
					7ce6cdd5e0 | ||
| 
						 | 
					5f94e971f0 | ||
| 
						 | 
					fd37f588ac | ||
| 
						 | 
					038688bd5b | ||
| 
						 | 
					cf485a91a1 | ||
| 
						 | 
					9dbab9939f | ||
| 
						 | 
					0d9e9735da | ||
| 
						 | 
					83763aa016 | ||
| 
						 | 
					b22756b6ab | ||
| 
						 | 
					5f4bf034e5 | ||
| 
						 | 
					042a8f7812 | ||
| 
						 | 
					ea10481c13 | ||
| 
						 | 
					99fa6c0664 | ||
| 
						 | 
					61c50b3e32 | ||
| 
						 | 
					e5151f1605 | ||
| 
						 | 
					d24b330411 | ||
| 
						 | 
					298ce642fc | ||
| 
						 | 
					061bc5859c | ||
| 
						 | 
					12abedfd0f | ||
| 
						 | 
					22526c0386 | ||
| 
						 | 
					1e926024ce | ||
| 
						 | 
					1dd411fed7 | ||
| 
						 | 
					242c45b8c4 | ||
| 
						 | 
					2edca9b11e | ||
| 
						 | 
					55860fc157 | ||
| 
						 | 
					6954fb05d0 | ||
| 
						 | 
					114a7b14e4 | ||
| 
						 | 
					978ba56f85 | ||
| 
						 | 
					61e49ffb8c | ||
| 
						 | 
					b351bd9c23 | ||
| 
						 | 
					2c4308712d | ||
| 
						 | 
					91f7fcb998 | ||
| 
						 | 
					5766484f92 | ||
| 
						 | 
					035942abbe | ||
| 
						 | 
					2e3fb06269 | ||
| 
						 | 
					b5f67d066f | ||
| 
						 | 
					c3a7c6cbc8 | ||
| 
						 | 
					65daef4cd4 | ||
| 
						 | 
					6b94fdc32f | ||
| 
						 | 
					2571df3052 | ||
| 
						 | 
					1c42523a2f | ||
| 
						 | 
					114c0ac96d | ||
| 
						 | 
					59da6f34c6 | ||
| 
						 | 
					adb06d0c7f | ||
| 
						 | 
					be292401cc | ||
| 
						 | 
					8df7aae3b6 | ||
| 
						 | 
					1b2311fea2 | ||
| 
						 | 
					0a5176aaed | ||
| 
						 | 
					f923f471d8 | ||
| 
						 | 
					2dcdc9c978 | ||
| 
						 | 
					7db32cceef | ||
| 
						 | 
					e2a78c717b | ||
| 
						 | 
					b2c8ed9c44 | ||
| 
						 | 
					fed5d1c341 | ||
| 
						 | 
					92322a4d9b | ||
| 
						 | 
					91c25edcfe | ||
| 
						 | 
					41f74f5896 | ||
| 
						 | 
					69c1eca49b | ||
| 
						 | 
					09a47e81f1 | ||
| 
						 | 
					ebb56c4127 | ||
| 
						 | 
					fabd9ae048 | ||
| 
						 | 
					3f28947b05 | ||
| 
						 | 
					1010d59bd3 | ||
| 
						 | 
					069ca47210 | ||
| 
						 | 
					d2f307fca0 | ||
| 
						 | 
					033aa260f4 | ||
| 
						 | 
					4925195de6 | ||
| 
						 | 
					ff4799ceef | ||
| 
						 | 
					548234aaaa | ||
| 
						 | 
					df2721f1cf | ||
| 
						 | 
					01f907f71c | ||
| 
						 | 
					94efa7a112 | ||
| 
						 | 
					e93f7c54c6 | ||
| 
						 | 
					7a7c50e283 | ||
| 
						 | 
					f29e8eff3b | ||
| 
						 | 
					a0ed3be791 | ||
| 
						 | 
					95106eab1e | ||
| 
						 | 
					2c845547a4 | ||
| 
						 | 
					b861091d44 | ||
| 
						 | 
					c3a1555932 | ||
| 
						 | 
					f36883df31 | ||
| 
						 | 
					f9b1ac9c51 | ||
| 
						 | 
					b6d243b8c0 | ||
| 
						 | 
					ce5c8fc5a0 | ||
| 
						 | 
					60c823fa07 | ||
| 
						 | 
					f1e1ee4e0b | ||
| 
						 | 
					d2884e777a | ||
| 
						 | 
					b651eb39ce | ||
| 
						 | 
					73b01c28d7 | ||
| 
						 | 
					dd75f267f4 | ||
| 
						 | 
					7108598603 | ||
| 
						 | 
					6b4c35c66b | ||
| 
						 | 
					75d4dfe9fe | ||
| 
						 | 
					776464f551 | ||
| 
						 | 
					dd8a35857d | ||
| 
						 | 
					1c93e4ce4d | ||
| 
						 | 
					e2d0af1e2b | ||
| 
						 | 
					9e81455ec5 | ||
| 
						 | 
					fad4321bf6 | ||
| 
						 | 
					9c8c78bb83 | ||
| 
						 | 
					bb7b820cbb | ||
| 
						 | 
					890cf80531 | ||
| 
						 | 
					f7f703d33a | ||
| 
						 | 
					a7cdacb55d | ||
| 
						 | 
					237130e3ce | ||
| 
						 | 
					2c73188e15 | ||
| 
						 | 
					5da6d1d7c9 | ||
| 
						 | 
					8a17592842 | ||
| 
						 | 
					51cd2b7311 | ||
| 
						 | 
					720e5b63ec | ||
| 
						 | 
					74753e327c | ||
| 
						 | 
					0d5b5644a9 | ||
| 
						 | 
					d53f89c6d4 | ||
| 
						 | 
					79371b72b0 | ||
| 
						 | 
					b73bc33630 | ||
| 
						 | 
					4c239cd599 | ||
| 
						 | 
					6de5a60309 | ||
| 
						 | 
					31360bf695 | ||
| 
						 | 
					599fde6581 | ||
| 
						 | 
					382e5c3948 | ||
| 
						 | 
					582ca88b59 | ||
| 
						 | 
					aa53bfc241 | ||
| 
						 | 
					bd2c15088d | ||
| 
						 | 
					d2da0a22ae | ||
| 
						 | 
					915c213eb5 | ||
| 
						 | 
					0cfba040f1 | ||
| 
						 | 
					2a5a0fa394 | ||
| 
						 | 
					a1387f8ecd | ||
| 
						 | 
					e7a83d61f3 | ||
| 
						 | 
					90b146e433 | ||
| 
						 | 
					61f79adda2 | ||
| 
						 | 
					9b8c6a1426 | ||
| 
						 | 
					d44ac29f43 | ||
| 
						 | 
					751e84c61d | ||
| 
						 | 
					f92b3a4964 | ||
| 
						 | 
					c2fec39202 | ||
| 
						 | 
					9f1bda3e80 | ||
| 
						 | 
					fdeea258be | ||
| 
						 | 
					960a98d244 | ||
| 
						 | 
					82ec1460f8 | ||
| 
						 | 
					23b9e2dfae | ||
| 
						 | 
					755a3e52b5 | ||
| 
						 | 
					5767bc7ae3 | ||
| 
						 | 
					b1070d070a | ||
| 
						 | 
					5f4ab71a5a | ||
| 
						 | 
					c43228f0b9 | ||
| 
						 | 
					b54ed1cda1 | ||
| 
						 | 
					19d0460501 | ||
| 
						 | 
					cb6e519afe | ||
| 
						 | 
					d9f0c1491a | ||
| 
						 | 
					17a983fad6 | ||
| 
						 | 
					4e0ea70bfa | ||
| 
						 | 
					da54c659bc | ||
| 
						 | 
					6be94215b9 | ||
| 
						 | 
					964a4b4f88 | ||
| 
						 | 
					03a55395b8 | ||
| 
						 | 
					8409ac1b96 | ||
| 
						 | 
					d653c76e37 | ||
| 
						 | 
					984c22a861 | ||
| 
						 | 
					ede4b93ad8 | ||
| 
						 | 
					ca211e047f | ||
| 
						 | 
					8121cf3c6c | ||
| 
						 | 
					5b348b760c | ||
| 
						 | 
					6a66bcb0ca | ||
| 
						 | 
					50716f3f63 | ||
| 
						 | 
					9dab6b7299 | ||
| 
						 | 
					43bd5af2cc | ||
| 
						 | 
					9780922fec | ||
| 
						 | 
					2c21a6e770 | ||
| 
						 | 
					88b769c12d | ||
| 
						 | 
					4ff3ed487b | ||
| 
						 | 
					92dc847909 | ||
| 
						 | 
					fa01d38989 | ||
| 
						 | 
					326af8e796 | ||
| 
						 | 
					af17c7e1b9 | ||
| 
						 | 
					4148e775a9 | ||
| 
						 | 
					0d7bd3c688 | ||
| 
						 | 
					2988177128 | ||
| 
						 | 
					b17e58f558 | ||
| 
						 | 
					9edb632efc | ||
| 
						 | 
					56de506ef1 | ||
| 
						 | 
					6c471a0fad | ||
| 
						 | 
					6f5cb0498b | ||
| 
						 | 
					df2ff4c9e7 | ||
| 
						 | 
					b03b05b2bb | ||
| 
						 | 
					09a07c7201 | ||
| 
						 | 
					152573124f | ||
| 
						 | 
					3378cfcd0b | ||
| 
						 | 
					53228a0e39 | ||
| 
						 | 
					cbf8c1a13b | ||
| 
						 | 
					993de572cd | ||
| 
						 | 
					f0c0286708 | ||
| 
						 | 
					20a654c810 | ||
| 
						 | 
					c5f2ee1eff | ||
| 
						 | 
					4eda8cea8f | ||
| 
						 | 
					fb953530b6 | ||
| 
						 | 
					bc1a617b6e | ||
| 
						 | 
					505154e699 | ||
| 
						 | 
					5776dde270 | ||
| 
						 | 
					0b9c33b867 | ||
| 
						 | 
					d7f31dbdab | ||
| 
						 | 
					b363df73a3 | ||
| 
						 | 
					54e0aa4a47 | ||
| 
						 | 
					c970fe576f | ||
| 
						 | 
					2be103fb88 | ||
| 
						 | 
					4cd4ff982c | ||
| 
						 | 
					9d26713dc1 | ||
| 
						 | 
					db1e3da6fc | ||
| 
						 | 
					5cad55e91a | ||
| 
						 | 
					5972ef8c05 | ||
| 
						 | 
					779e81727c | ||
| 
						 | 
					0c4409fe16 | ||
| 
						 | 
					85f63e590b | ||
| 
						 | 
					da5a8ea67d | ||
| 
						 | 
					4f370f4e63 | ||
| 
						 | 
					06884ae043 | ||
| 
						 | 
					7b0bf921c4 | ||
| 
						 | 
					a83c1ad0c2 | ||
| 
						 | 
					8ba1f84047 | ||
| 
						 | 
					4721324a2a | ||
| 
						 | 
					51e484eadd | ||
| 
						 | 
					46f379c1e4 | ||
| 
						 | 
					5e42a9b51f | ||
| 
						 | 
					df58544f6e | ||
| 
						 | 
					43518055f0 | ||
| 
						 | 
					9ef174e290 | ||
| 
						 | 
					a60119caa2 | ||
| 
						 | 
					1546e3db6e | ||
| 
						 | 
					82a9a014e4 | ||
| 
						 | 
					a9a1a77dd3 | ||
| 
						 | 
					084fad0074 | ||
| 
						 | 
					2b9e219839 | ||
| 
						 | 
					ba8ea87863 | ||
| 
						 | 
					f498a0dde1 | ||
| 
						 | 
					673dc72b3b | ||
| 
						 | 
					6da33b6c68 | ||
| 
						 | 
					0c6cae0b04 | ||
| 
						 | 
					ded321e772 | ||
| 
						 | 
					7015bb989e | ||
| 
						 | 
					eaeccf5595 | ||
| 
						 | 
					c7d07c62ee | ||
| 
						 | 
					cf804546c2 | ||
| 
						 | 
					467b459898 | ||
| 
						 | 
					0d9cbc8f45 | ||
| 
						 | 
					2c858e1c84 | ||
| 
						 | 
					ffc5d32b80 | ||
| 
						 | 
					1956b3a568 | ||
| 
						 | 
					84f542b3b8 | ||
| 
						 | 
					ccf7d08832 | ||
| 
						 | 
					2e093950e2 | ||
| 
						 | 
					2f9356f8de | ||
| 
						 | 
					8c4a70fd04 | ||
| 
						 | 
					cac0124f1a | ||
| 
						 | 
					cef9de3819 | ||
| 
						 | 
					a84178edbf | ||
| 
						 | 
					c05fab9454 | ||
| 
						 | 
					be54619576 | ||
| 
						 | 
					c70560e66a | ||
| 
						 | 
					de4adaec16 | ||
| 
						 | 
					01d748f37e | ||
| 
						 | 
					ad130af188 | ||
| 
						 | 
					67edecf8d1 | ||
| 
						 | 
					e01b86e1e6 | ||
| 
						 | 
					8b69f5ef93 | ||
| 
						 | 
					4f774b1ddb | ||
| 
						 | 
					3a846add3b | ||
| 
						 | 
					9dfec29f16 | ||
| 
						 | 
					28d33d2f9a | ||
| 
						 | 
					2d53df2b5f | ||
| 
						 | 
					cddea2e094 | ||
| 
						 | 
					ee1a78000e | ||
| 
						 | 
					57036a77c1 | ||
| 
						 | 
					fb46b97e73 | ||
| 
						 | 
					35d49b61ee | ||
| 
						 | 
					f2bfbe3211 | ||
| 
						 | 
					8a27f88014 | ||
| 
						 | 
					2db3db21ec | ||
| 
						 | 
					eaf8129143 | ||
| 
						 | 
					1fb3fce980 | ||
| 
						 | 
					a152cb6045 | ||
| 
						 | 
					267d37b32e | ||
| 
						 | 
					7bdc417b30 | ||
| 
						 | 
					af6eb61c56 | ||
| 
						 | 
					fd5183cf5d | ||
| 
						 | 
					edb5608a38 | ||
| 
						 | 
					f640f6fa6a | ||
| 
						 | 
					cf8b961a1b | ||
| 
						 | 
					03d127fd39 | ||
| 
						 | 
					4722bbc9bd | ||
| 
						 | 
					ea44a9d5f2 | 
							
								
								
									
										4
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -5,4 +5,6 @@ BuffLib
 | 
				
			|||||||
*.psd
 | 
					*.psd
 | 
				
			||||||
Ace-Libs
 | 
					Ace-Libs
 | 
				
			||||||
Images_Raw
 | 
					Images_Raw
 | 
				
			||||||
Gladdy_old
 | 
					Gladdy_old
 | 
				
			||||||
 | 
					untracked
 | 
				
			||||||
 | 
					Gladdy_TW
 | 
				
			||||||
							
								
								
									
										57
									
								
								Bindings.xml
									
									
									
									
									
								
							
							
						
						
									
										57
									
								
								Bindings.xml
									
									
									
									
									
								
							@@ -1,38 +1,31 @@
 | 
				
			|||||||
<Bindings>
 | 
					<Bindings>
 | 
				
			||||||
    <Binding name="GLADDYBUTTON1_LEFT" header="GLADDY" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON1_LEFT" header="GLADDY" Category="Gladdy"/>
 | 
				
			||||||
    <Binding name="GLADDYBUTTON2_LEFT" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON2_LEFT" Category="Gladdy"/>
 | 
				
			||||||
    <Binding name="GLADDYBUTTON3_LEFT" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON3_LEFT" Category="Gladdy"/>
 | 
				
			||||||
    <Binding name="GLADDYBUTTON4_LEFT" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON4_LEFT" Category="Gladdy"/>
 | 
				
			||||||
    <Binding name="GLADDYBUTTON5_LEFT" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON5_LEFT" Category="Gladdy"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <Binding name="GLADDYBUTTON1_RIGHT" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON1_RIGHT" Category="Gladdy"/>
 | 
				
			||||||
    <Binding name="GLADDYBUTTON2_RIGHT" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON2_RIGHT" Category="Gladdy"/>
 | 
				
			||||||
    <Binding name="GLADDYBUTTON3_RIGHT" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON3_RIGHT" Category="Gladdy"/>
 | 
				
			||||||
    <Binding name="GLADDYBUTTON4_RIGHT" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON4_RIGHT" Category="Gladdy"/>
 | 
				
			||||||
    <Binding name="GLADDYBUTTON5_RIGHT" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON5_RIGHT" Category="Gladdy"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <Binding name="GLADDYBUTTON1_MIDDLE" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON1_MIDDLE" Category="Gladdy"/>
 | 
				
			||||||
    <Binding name="GLADDYBUTTON2_MIDDLE" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON2_MIDDLE" Category="Gladdy"/>
 | 
				
			||||||
    <Binding name="GLADDYBUTTON3_MIDDLE" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON3_MIDDLE" Category="Gladdy"/>
 | 
				
			||||||
    <Binding name="GLADDYBUTTON4_MIDDLE" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON4_MIDDLE" Category="Gladdy"/>
 | 
				
			||||||
    <Binding name="GLADDYBUTTON5_MIDDLE" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON5_MIDDLE" Category="Gladdy"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <Binding name="GLADDYBUTTON1_BUTTON4" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON1_BUTTON4" Category="Gladdy"/>
 | 
				
			||||||
    <Binding name="GLADDYBUTTON2_BUTTON4" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON2_BUTTON4" Category="Gladdy"/>
 | 
				
			||||||
    <Binding name="GLADDYBUTTON3_BUTTON4" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON3_BUTTON4" Category="Gladdy"/>
 | 
				
			||||||
    <Binding name="GLADDYBUTTON4_BUTTON4" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON4_BUTTON4" Category="Gladdy"/>
 | 
				
			||||||
    <Binding name="GLADDYBUTTON5_BUTTON4" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON5_BUTTON4" Category="Gladdy"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <Binding name="GLADDYBUTTON1_BUTTON5" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON1_BUTTON5" Category="Gladdy"/>
 | 
				
			||||||
    <Binding name="GLADDYBUTTON2_BUTTON5" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON2_BUTTON5" Category="Gladdy"/>
 | 
				
			||||||
    <Binding name="GLADDYBUTTON3_BUTTON5" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON3_BUTTON5" Category="Gladdy"/>
 | 
				
			||||||
    <Binding name="GLADDYBUTTON4_BUTTON5" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON4_BUTTON5" Category="Gladdy"/>
 | 
				
			||||||
    <Binding name="GLADDYBUTTON5_BUTTON5" category="ADDONS"/>
 | 
					    <Binding name="GLADDYBUTTON5_BUTTON5" Category="Gladdy"/>
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	<Binding header="GLADDYTRINKET" name="GLADDYTRINKET1" category="ADDONS"/>
 | 
					 | 
				
			||||||
	<Binding name="GLADDYTRINKET2"  category="ADDONS"/>
 | 
					 | 
				
			||||||
	<Binding name="GLADDYTRINKET3"  category="ADDONS"/>
 | 
					 | 
				
			||||||
	<Binding name="GLADDYTRINKET4"  category="ADDONS"/>
 | 
					 | 
				
			||||||
	<Binding name="GLADDYTRINKET5"  category="ADDONS"/>
 | 
					 | 
				
			||||||
</Bindings>
 | 
					</Bindings>
 | 
				
			||||||
							
								
								
									
										610
									
								
								Constants.lua
									
									
									
									
									
								
							
							
						
						
									
										610
									
								
								Constants.lua
									
									
									
									
									
								
							@@ -1,610 +0,0 @@
 | 
				
			|||||||
local GetSpellInfo = GetSpellInfo
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local Gladdy = LibStub("Gladdy")
 | 
					 | 
				
			||||||
local L = Gladdy.L
 | 
					 | 
				
			||||||
local AURA_TYPE_DEBUFF, AURA_TYPE_BUFF = AURA_TYPE_DEBUFF, AURA_TYPE_BUFF
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
function Gladdy:GetSpecBuffs()
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
        -- DRUID
 | 
					 | 
				
			||||||
        [GetSpellInfo(45283)] = L["Restoration"], -- Natural Perfection
 | 
					 | 
				
			||||||
        [GetSpellInfo(16880)] = L["Restoration"], -- Nature's Grace; Dreamstate spec in TBC equals Restoration
 | 
					 | 
				
			||||||
        [GetSpellInfo(24858)] = L["Restoration"], -- Moonkin Form; Dreamstate spec in TBC equals Restoration
 | 
					 | 
				
			||||||
        [GetSpellInfo(17007)] = L["Feral"], -- Leader of the Pack
 | 
					 | 
				
			||||||
        [GetSpellInfo(16188)] = L["Restoration"], -- Nature's Swiftness
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- HUNTER
 | 
					 | 
				
			||||||
        [GetSpellInfo(34692)] = L["Beast Mastery"], -- The Beast Within
 | 
					 | 
				
			||||||
        [GetSpellInfo(20895)] = L["Beast Mastery"], -- Spirit Bond
 | 
					 | 
				
			||||||
        [GetSpellInfo(34455)] = L["Beast Mastery"], -- Ferocious Inspiration
 | 
					 | 
				
			||||||
        [GetSpellInfo(27066)] = L["Marksmanship"], -- Trueshot Aura
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- MAGE
 | 
					 | 
				
			||||||
        [GetSpellInfo(33405)] = L["Frost"], -- Ice Barrier
 | 
					 | 
				
			||||||
        [GetSpellInfo(11129)] = L["Fire"], -- Combustion
 | 
					 | 
				
			||||||
        [GetSpellInfo(12042)] = L["Arcane"], -- Arcane Power
 | 
					 | 
				
			||||||
        [GetSpellInfo(12043)] = L["Arcane"], -- Presence of Mind
 | 
					 | 
				
			||||||
        [GetSpellInfo(12472)] = L["Frost"], -- Icy Veins
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- PALADIN
 | 
					 | 
				
			||||||
        [GetSpellInfo(31836)] = L["Holy"], -- Light's Grace
 | 
					 | 
				
			||||||
        [GetSpellInfo(31842)] = L["Holy"], -- Divine Illumination
 | 
					 | 
				
			||||||
        [GetSpellInfo(20216)] = L["Holy"], -- Divine Favor
 | 
					 | 
				
			||||||
        [GetSpellInfo(20375)] = L["Retribution"], -- Seal of Command
 | 
					 | 
				
			||||||
        [GetSpellInfo(20049)] = L["Retribution"], -- Vengeance
 | 
					 | 
				
			||||||
        [GetSpellInfo(20218)] = L["Retribution"], -- Sanctity Aura
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- PRIEST
 | 
					 | 
				
			||||||
        [GetSpellInfo(15473)] = L["Shadow"], -- Shadowform
 | 
					 | 
				
			||||||
        [GetSpellInfo(45234)] = L["Discipline"], -- Focused Will
 | 
					 | 
				
			||||||
        [GetSpellInfo(27811)] = L["Discipline"], -- Blessed Recovery
 | 
					 | 
				
			||||||
        [GetSpellInfo(33142)] = L["Holy"], -- Blessed Resilience
 | 
					 | 
				
			||||||
        [GetSpellInfo(14752)] = L["Discipline"], -- Divine Spirit
 | 
					 | 
				
			||||||
        [GetSpellInfo(27681)] = L["Discipline"], -- Prayer of Spirit
 | 
					 | 
				
			||||||
        [GetSpellInfo(10060)] = L["Discipline"], -- Power Infusion
 | 
					 | 
				
			||||||
        [GetSpellInfo(33206)] = L["Discipline"], -- Pain Suppression
 | 
					 | 
				
			||||||
        [GetSpellInfo(14893)] = L["Discipline"], -- Inspiration
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- ROGUE
 | 
					 | 
				
			||||||
        [GetSpellInfo(36554)] = L["Subtlety"], -- Shadowstep
 | 
					 | 
				
			||||||
        [GetSpellInfo(44373)] = L["Subtlety"], -- Shadowstep Speed
 | 
					 | 
				
			||||||
        [GetSpellInfo(36563)] = L["Subtlety"], -- Shadowstep DMG
 | 
					 | 
				
			||||||
        [GetSpellInfo(14278)] = L["Subtlety"], -- Ghostly Strike
 | 
					 | 
				
			||||||
        [GetSpellInfo(31233)] = L["Assassination"], -- Find Weakness
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        --Shaman
 | 
					 | 
				
			||||||
        [GetSpellInfo(16190)] = L["Restoration"], -- Mana Tide Totem
 | 
					 | 
				
			||||||
        [GetSpellInfo(32594)] = L["Restoration"], -- Earth Shield
 | 
					 | 
				
			||||||
        [GetSpellInfo(30823)] = L["Enhancement"], -- Shamanistic Rage
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- WARLOCK
 | 
					 | 
				
			||||||
        [GetSpellInfo(19028)] = L["Demonology"], -- Soul Link
 | 
					 | 
				
			||||||
        [GetSpellInfo(23759)] = L["Demonology"], -- Master Demonologist
 | 
					 | 
				
			||||||
        [GetSpellInfo(30302)] = L["Destruction"], -- Nether Protection
 | 
					 | 
				
			||||||
        [GetSpellInfo(34935)] = L["Destruction"], -- Backlash
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- WARRIOR
 | 
					 | 
				
			||||||
        [GetSpellInfo(29838)] = L["Arms"], -- Second Wind
 | 
					 | 
				
			||||||
        [GetSpellInfo(12292)] = L["Arms"], -- Death Wish
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
function Gladdy:GetSpecSpells()
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
        -- DRUID
 | 
					 | 
				
			||||||
        [GetSpellInfo(33831)] = L["Balance"], -- Force of Nature
 | 
					 | 
				
			||||||
        [GetSpellInfo(33983)] = L["Feral"], -- Mangle (Cat)
 | 
					 | 
				
			||||||
        [GetSpellInfo(33987)] = L["Feral"], -- Mangle (Bear)
 | 
					 | 
				
			||||||
        [GetSpellInfo(18562)] = L["Restoration"], -- Swiftmend
 | 
					 | 
				
			||||||
        [GetSpellInfo(16188)] = L["Restoration"], -- Nature's Swiftness
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- HUNTER
 | 
					 | 
				
			||||||
        [GetSpellInfo(19577)] = L["Beast Mastery"], -- Intimidation
 | 
					 | 
				
			||||||
        [GetSpellInfo(34490)] = L["Marksmanship"], -- Silencing Shot
 | 
					 | 
				
			||||||
        [GetSpellInfo(27068)] = L["Survival"], -- Wyvern Sting
 | 
					 | 
				
			||||||
        [GetSpellInfo(19306)] = L["Survival"], -- Counterattack
 | 
					 | 
				
			||||||
        [GetSpellInfo(27066)] = L["Marksmanship"], -- Trueshot Aura
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- MAGE
 | 
					 | 
				
			||||||
        [GetSpellInfo(12042)] = L["Arcane"], -- Arcane Power
 | 
					 | 
				
			||||||
        [GetSpellInfo(33043)] = L["Fire"], -- Dragon's Breath
 | 
					 | 
				
			||||||
        [GetSpellInfo(33933)] = L["Fire"], -- Blast Wave
 | 
					 | 
				
			||||||
        [GetSpellInfo(33405)] = L["Frost"], -- Ice Barrier
 | 
					 | 
				
			||||||
        [GetSpellInfo(31687)] = L["Frost"], -- Summon Water Elemental
 | 
					 | 
				
			||||||
        [GetSpellInfo(12472)] = L["Frost"], -- Icy Veins
 | 
					 | 
				
			||||||
        [GetSpellInfo(11958)] = L["Frost"], -- Cold Snap
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- PALADIN
 | 
					 | 
				
			||||||
        [GetSpellInfo(33072)] = L["Holy"], -- Holy Shock
 | 
					 | 
				
			||||||
        [GetSpellInfo(20216)] = L["Holy"], -- Divine Favor
 | 
					 | 
				
			||||||
        [GetSpellInfo(31842)] = L["Holy"], -- Divine Illumination
 | 
					 | 
				
			||||||
        [GetSpellInfo(32700)] = L["Protection"], -- Avenger's Shield
 | 
					 | 
				
			||||||
        [GetSpellInfo(27170)] = L["Retribution"], -- Seal of Command
 | 
					 | 
				
			||||||
        [GetSpellInfo(35395)] = L["Retribution"], -- Crusader Strike
 | 
					 | 
				
			||||||
        [GetSpellInfo(20066)] = L["Retribution"], -- Repentance
 | 
					 | 
				
			||||||
        [GetSpellInfo(20218)] = L["Retribution"], -- Sanctity Aura
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- PRIEST
 | 
					 | 
				
			||||||
        [GetSpellInfo(10060)] = L["Discipline"], -- Power Infusion
 | 
					 | 
				
			||||||
        [GetSpellInfo(33206)] = L["Discipline"], -- Pain Suppression
 | 
					 | 
				
			||||||
        [GetSpellInfo(14752)] = L["Discipline"], -- Divine Spirit
 | 
					 | 
				
			||||||
        [GetSpellInfo(33143)] = L["Holy"], -- Blessed Resilience
 | 
					 | 
				
			||||||
        [GetSpellInfo(34861)] = L["Holy"], -- Circle of Healing
 | 
					 | 
				
			||||||
        [GetSpellInfo(15473)] = L["Shadow"], -- Shadowform
 | 
					 | 
				
			||||||
        [GetSpellInfo(34917)] = L["Shadow"], -- Vampiric Touch
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- ROGUE
 | 
					 | 
				
			||||||
        [GetSpellInfo(34413)] = L["Assassination"], -- Mutilate
 | 
					 | 
				
			||||||
        [GetSpellInfo(14177)] = L["Assassination"], -- Cold Blood
 | 
					 | 
				
			||||||
        [GetSpellInfo(13750)] = L["Combat"], -- Adrenaline Rush
 | 
					 | 
				
			||||||
        [GetSpellInfo(14185)] = L["Subtlety"], -- Preparation
 | 
					 | 
				
			||||||
        [GetSpellInfo(16511)] = L["Subtlety"], -- Hemorrhage
 | 
					 | 
				
			||||||
        [GetSpellInfo(36554)] = L["Subtlety"], -- Shadowstep
 | 
					 | 
				
			||||||
        [GetSpellInfo(14278)] = L["Subtlety"], -- Ghostly Strike
 | 
					 | 
				
			||||||
        [GetSpellInfo(14183)] = L["Subtlety"], -- Premeditation
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- SHAMAN
 | 
					 | 
				
			||||||
        [GetSpellInfo(16166)] = L["Elemental"], -- Elemental Mastery
 | 
					 | 
				
			||||||
        [GetSpellInfo(30823)] = L["Enhancement"], -- Shamanistic Rage
 | 
					 | 
				
			||||||
        [GetSpellInfo(17364)] = L["Enhancement"], -- Stormstrike
 | 
					 | 
				
			||||||
        [GetSpellInfo(16190)] = L["Restoration"], -- Mana Tide Totem
 | 
					 | 
				
			||||||
        [GetSpellInfo(32594)] = L["Restoration"], -- Earth Shield
 | 
					 | 
				
			||||||
        --[GetSpellInfo(16188)] = L["Restoration"], -- Nature's Swiftness
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- WARLOCK
 | 
					 | 
				
			||||||
        [GetSpellInfo(30405)] = L["Affliction"], -- Unstable Affliction
 | 
					 | 
				
			||||||
        --[GetSpellInfo(30911)] = L["Affliction"], -- Siphon Life
 | 
					 | 
				
			||||||
        [GetSpellInfo(30414)] = L["Destruction"], -- Shadowfury
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- WARRIOR
 | 
					 | 
				
			||||||
        [GetSpellInfo(30330)] = L["Arms"], -- Mortal Strike
 | 
					 | 
				
			||||||
        [GetSpellInfo(12292)] = L["Arms"], -- Death Wish
 | 
					 | 
				
			||||||
        [GetSpellInfo(30335)] = L["Fury"], -- Bloodthirst
 | 
					 | 
				
			||||||
        [GetSpellInfo(12809)] = L["Protection"], -- Concussion Blow
 | 
					 | 
				
			||||||
        [GetSpellInfo(30022)] = L["Protection"], -- Devastation
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
function Gladdy:GetImportantAuras()
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
        -- Cyclone
 | 
					 | 
				
			||||||
        [GetSpellInfo(33786)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 6,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            spellID = 33786,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Hibername
 | 
					 | 
				
			||||||
        [GetSpellInfo(18658)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 10,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            magic = true,
 | 
					 | 
				
			||||||
            spellID = 18658,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Entangling Roots
 | 
					 | 
				
			||||||
        [GetSpellInfo(26989)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 10,
 | 
					 | 
				
			||||||
            priority = 30,
 | 
					 | 
				
			||||||
            onDamage = true,
 | 
					 | 
				
			||||||
            magic = true,
 | 
					 | 
				
			||||||
            root = true,
 | 
					 | 
				
			||||||
            spellID = 26989,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Feral Charge
 | 
					 | 
				
			||||||
        [GetSpellInfo(16979)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 4,
 | 
					 | 
				
			||||||
            priority = 30,
 | 
					 | 
				
			||||||
            root = true,
 | 
					 | 
				
			||||||
            spellID = 16979,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Bash
 | 
					 | 
				
			||||||
        [GetSpellInfo(8983)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 4,
 | 
					 | 
				
			||||||
            priority = 30,
 | 
					 | 
				
			||||||
            spellID = 8983,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Pounce
 | 
					 | 
				
			||||||
        [GetSpellInfo(9005)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 3,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            spellID = 9005,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Maim
 | 
					 | 
				
			||||||
        [GetSpellInfo(22570)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 6,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            incapacite = true,
 | 
					 | 
				
			||||||
            spellID = 22570,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Innervate
 | 
					 | 
				
			||||||
        [GetSpellInfo(29166)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_BUFF,
 | 
					 | 
				
			||||||
            duration = 20,
 | 
					 | 
				
			||||||
            priority = 10,
 | 
					 | 
				
			||||||
            spellID = 29166,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Imp Starfire Stun
 | 
					 | 
				
			||||||
        [GetSpellInfo(16922)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 3,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            spellSchool = "physical",
 | 
					 | 
				
			||||||
            spellID = 16922,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- Freezing Trap Effect
 | 
					 | 
				
			||||||
        [GetSpellInfo(14309)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 10,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            onDamage = true,
 | 
					 | 
				
			||||||
            magic = true,
 | 
					 | 
				
			||||||
            spellID = 14309,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Wyvern Sting
 | 
					 | 
				
			||||||
        [GetSpellInfo(19386)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 10,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            onDamage = true,
 | 
					 | 
				
			||||||
            poison = true,
 | 
					 | 
				
			||||||
            sleep = true,
 | 
					 | 
				
			||||||
            spellID = 19386,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Scatter Shot
 | 
					 | 
				
			||||||
        [GetSpellInfo(19503)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 4,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            onDamage = true,
 | 
					 | 
				
			||||||
            spellID = 19503,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Silencing Shot
 | 
					 | 
				
			||||||
        [GetSpellInfo(34490)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 3,
 | 
					 | 
				
			||||||
            priority = 15,
 | 
					 | 
				
			||||||
            magic = true,
 | 
					 | 
				
			||||||
            spellID = 34490,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Intimidation
 | 
					 | 
				
			||||||
        [GetSpellInfo(19577)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 2,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            spellID = 19577,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- The Beast Within
 | 
					 | 
				
			||||||
        [GetSpellInfo(34692)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_BUFF,
 | 
					 | 
				
			||||||
            duration = 18,
 | 
					 | 
				
			||||||
            priority = 20,
 | 
					 | 
				
			||||||
            spellID = 34692,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- Polymorph
 | 
					 | 
				
			||||||
        [GetSpellInfo(12826)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 10,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            onDamage = true,
 | 
					 | 
				
			||||||
            magic = true,
 | 
					 | 
				
			||||||
            spellID = 12826,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Dragon's Breath
 | 
					 | 
				
			||||||
        [GetSpellInfo(31661)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 3,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            onDamage = true,
 | 
					 | 
				
			||||||
            magic = true,
 | 
					 | 
				
			||||||
            spellID = 31661,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Frost Nova
 | 
					 | 
				
			||||||
        [GetSpellInfo(27088)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 8,
 | 
					 | 
				
			||||||
            priority = 30,
 | 
					 | 
				
			||||||
            onDamage = true,
 | 
					 | 
				
			||||||
            magic = true,
 | 
					 | 
				
			||||||
            root = true,
 | 
					 | 
				
			||||||
            spellID = 27088,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Freeze (Water Elemental)
 | 
					 | 
				
			||||||
        [GetSpellInfo(33395)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 8,
 | 
					 | 
				
			||||||
            priority = 30,
 | 
					 | 
				
			||||||
            onDamage = true,
 | 
					 | 
				
			||||||
            magic = true,
 | 
					 | 
				
			||||||
            root = true,
 | 
					 | 
				
			||||||
            spellID = 33395,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Counterspell - Silence
 | 
					 | 
				
			||||||
        [GetSpellInfo(18469)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 4,
 | 
					 | 
				
			||||||
            priority = 15,
 | 
					 | 
				
			||||||
            magic = true,
 | 
					 | 
				
			||||||
            spellID = 18469,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Ice Block
 | 
					 | 
				
			||||||
        [GetSpellInfo(45438)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_BUFF,
 | 
					 | 
				
			||||||
            duration = 10,
 | 
					 | 
				
			||||||
            priority = 20,
 | 
					 | 
				
			||||||
            spellID = 45438,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Impact
 | 
					 | 
				
			||||||
        [GetSpellInfo(12355)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 2,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            spellID = 12355,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- Hammer of Justice
 | 
					 | 
				
			||||||
        [GetSpellInfo(10308)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 6,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            magic = true,
 | 
					 | 
				
			||||||
            spellID = 10308,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Repentance
 | 
					 | 
				
			||||||
        [GetSpellInfo(20066)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 6,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            onDamage = true,
 | 
					 | 
				
			||||||
            magic = true,
 | 
					 | 
				
			||||||
            incapacite = true,
 | 
					 | 
				
			||||||
            spellID = 20066,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Blessing of Protection
 | 
					 | 
				
			||||||
        [GetSpellInfo(10278)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_BUFF,
 | 
					 | 
				
			||||||
            duration = 10,
 | 
					 | 
				
			||||||
            priority = 10,
 | 
					 | 
				
			||||||
            spellID = 10278,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Blessing of Freedom
 | 
					 | 
				
			||||||
        [GetSpellInfo(1044)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_BUFF,
 | 
					 | 
				
			||||||
            duration = 14,
 | 
					 | 
				
			||||||
            priority = 10,
 | 
					 | 
				
			||||||
            spellID = 1044,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Divine Shield
 | 
					 | 
				
			||||||
        [GetSpellInfo(642)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_BUFF,
 | 
					 | 
				
			||||||
            duration = 12,
 | 
					 | 
				
			||||||
            priority = 20,
 | 
					 | 
				
			||||||
            spellID = 642,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- Psychic Scream
 | 
					 | 
				
			||||||
        [GetSpellInfo(8122)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 8,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            onDamage = true,
 | 
					 | 
				
			||||||
            fear = true,
 | 
					 | 
				
			||||||
            magic = true,
 | 
					 | 
				
			||||||
            spellID = 8122,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Chastise
 | 
					 | 
				
			||||||
        [GetSpellInfo(44047)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 8,
 | 
					 | 
				
			||||||
            priority = 30,
 | 
					 | 
				
			||||||
            root = true,
 | 
					 | 
				
			||||||
            spellID = 44047,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Mind Control
 | 
					 | 
				
			||||||
        [GetSpellInfo(605)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 10,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            magic = true,
 | 
					 | 
				
			||||||
            spellID = 605,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Silence
 | 
					 | 
				
			||||||
        [GetSpellInfo(15487)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 5,
 | 
					 | 
				
			||||||
            priority = 15,
 | 
					 | 
				
			||||||
            magic = true,
 | 
					 | 
				
			||||||
            spellID = 15487,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Pain Suppression
 | 
					 | 
				
			||||||
        [GetSpellInfo(33206)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_BUFF,
 | 
					 | 
				
			||||||
            duration = 8,
 | 
					 | 
				
			||||||
            priority = 10,
 | 
					 | 
				
			||||||
            spellID = 33206,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- Sap
 | 
					 | 
				
			||||||
        [GetSpellInfo(6770)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 10,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            onDamage = true,
 | 
					 | 
				
			||||||
            incapacite = true,
 | 
					 | 
				
			||||||
            spellID = 6770,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Blind
 | 
					 | 
				
			||||||
        [GetSpellInfo(2094)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 10,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            onDamage = true,
 | 
					 | 
				
			||||||
            spellID = 2094,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Cheap Shot
 | 
					 | 
				
			||||||
        [GetSpellInfo(1833)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 4,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            spellID = 1833,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Kidney Shot
 | 
					 | 
				
			||||||
        [GetSpellInfo(8643)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 6,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            spellID = 8643,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Gouge
 | 
					 | 
				
			||||||
        [GetSpellInfo(1776)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 4,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            onDamage = true,
 | 
					 | 
				
			||||||
            incapacite = true,
 | 
					 | 
				
			||||||
            spellID = 1776,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Kick - Silence
 | 
					 | 
				
			||||||
        [GetSpellInfo(18425)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 2,
 | 
					 | 
				
			||||||
            priority = 15,
 | 
					 | 
				
			||||||
            spellID = 18425,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Garrote - Silence
 | 
					 | 
				
			||||||
        [GetSpellInfo(1330)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 3,
 | 
					 | 
				
			||||||
            priority = 15,
 | 
					 | 
				
			||||||
            spellID = 1330,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Cloak of Shadows
 | 
					 | 
				
			||||||
        [GetSpellInfo(31224)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_BUFF,
 | 
					 | 
				
			||||||
            duration = 5,
 | 
					 | 
				
			||||||
            priority = 20,
 | 
					 | 
				
			||||||
            spellID = 31224,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- Fear
 | 
					 | 
				
			||||||
        [GetSpellInfo(5782)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 10,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            onDamage = true,
 | 
					 | 
				
			||||||
            fear = true,
 | 
					 | 
				
			||||||
            magic = true,
 | 
					 | 
				
			||||||
            spellID = 5782,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Death Coil
 | 
					 | 
				
			||||||
        [GetSpellInfo(27223)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 3,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            spellID = 27223,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Shadowfury
 | 
					 | 
				
			||||||
        [GetSpellInfo(30283)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 2,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            magic = true,
 | 
					 | 
				
			||||||
            spellID = 30283,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Seduction (Succubus)
 | 
					 | 
				
			||||||
        [GetSpellInfo(6358)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 10,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            onDamage = true,
 | 
					 | 
				
			||||||
            fear = true,
 | 
					 | 
				
			||||||
            magic = true,
 | 
					 | 
				
			||||||
            spellID = 6358,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Howl of Terror
 | 
					 | 
				
			||||||
        [GetSpellInfo(5484)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 8,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            onDamage = true,
 | 
					 | 
				
			||||||
            fear = true,
 | 
					 | 
				
			||||||
            magic = true,
 | 
					 | 
				
			||||||
            spellID = 5484,
 | 
					 | 
				
			||||||
            texture = select(3, GetSpellInfo(5484))
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Spell Lock (Felhunter)
 | 
					 | 
				
			||||||
        [GetSpellInfo(24259)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 3,
 | 
					 | 
				
			||||||
            priority = 15,
 | 
					 | 
				
			||||||
            magic = true,
 | 
					 | 
				
			||||||
            spellID = 24259,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Unstable Affliction Silence
 | 
					 | 
				
			||||||
        ["Unstable Affliction Silence"] = { -- GetSpellInfo returns "Unstable Affliction"
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 5,
 | 
					 | 
				
			||||||
            priority = 15,
 | 
					 | 
				
			||||||
            magic = true,
 | 
					 | 
				
			||||||
            spellID = 31117,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- Intimidating Shout
 | 
					 | 
				
			||||||
        [GetSpellInfo(5246)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 8,
 | 
					 | 
				
			||||||
            priority = 15,
 | 
					 | 
				
			||||||
            onDamage = true,
 | 
					 | 
				
			||||||
            fear = true,
 | 
					 | 
				
			||||||
            spellID = 5246,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Concussion Blow
 | 
					 | 
				
			||||||
        [GetSpellInfo(12809)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 5,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            spellID = 12809,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Intercept Stun
 | 
					 | 
				
			||||||
        [GetSpellInfo(25274)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 3,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            spellID = 25274,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Spell Reflection
 | 
					 | 
				
			||||||
        [GetSpellInfo(23920)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_BUFF,
 | 
					 | 
				
			||||||
            duration = 5,
 | 
					 | 
				
			||||||
            priority = 50,
 | 
					 | 
				
			||||||
            spellID = 23920,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Shield Bash - Silenced
 | 
					 | 
				
			||||||
        [GetSpellInfo(18498)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 3,
 | 
					 | 
				
			||||||
            priority = 15,
 | 
					 | 
				
			||||||
            spellSchool = "magic",
 | 
					 | 
				
			||||||
            spellID = 18498,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- Grounding Totem Effect
 | 
					 | 
				
			||||||
        [GetSpellInfo(8178)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_BUFF,
 | 
					 | 
				
			||||||
            duration = 0,
 | 
					 | 
				
			||||||
            priority = 20,
 | 
					 | 
				
			||||||
            spellID = 8178
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        -- War Stomp
 | 
					 | 
				
			||||||
        [GetSpellInfo(20549)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 2,
 | 
					 | 
				
			||||||
            priority = 40,
 | 
					 | 
				
			||||||
            spellID = 20549,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        -- Arcane Torrent
 | 
					 | 
				
			||||||
        [GetSpellInfo(28730)] = {
 | 
					 | 
				
			||||||
            track = AURA_TYPE_DEBUFF,
 | 
					 | 
				
			||||||
            duration = 2,
 | 
					 | 
				
			||||||
            priority = 15,
 | 
					 | 
				
			||||||
            magic = true,
 | 
					 | 
				
			||||||
            spellID = 28730,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
							
								
								
									
										1453
									
								
								Constants_BCC.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1453
									
								
								Constants_BCC.lua
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										1383
									
								
								Constants_Wrath.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1383
									
								
								Constants_Wrath.lua
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										295
									
								
								Constants_shared.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										295
									
								
								Constants_shared.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,295 @@
 | 
				
			|||||||
 | 
					local tbl_sort, select, string_lower = table.sort, select, string.lower
 | 
				
			||||||
 | 
					local GetLocale = GetLocale
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local Gladdy = LibStub("Gladdy")
 | 
				
			||||||
 | 
					local L = Gladdy.L
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Gladdy.RACES = {"Scourge", "BloodElf", "Tauren", "Orc", "Troll", "NightElf", "Draenei", "Human", "Gnome", "Dwarf"}
 | 
				
			||||||
 | 
					tbl_sort(Gladdy.RACES)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local RACE_ICON_TCOORDS = {
 | 
				
			||||||
 | 
					    ["HUMAN_MALE"] = { 0, 0.125, 0, 0.25 },
 | 
				
			||||||
 | 
					    ["DWARF_MALE"] = { 0.125, 0.25, 0, 0.25 },
 | 
				
			||||||
 | 
					    ["GNOME_MALE"] = { 0.25, 0.375, 0, 0.25 },
 | 
				
			||||||
 | 
					    ["NIGHTELF_MALE"] = { 0.375, 0.5, 0, 0.25 },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ["TAUREN_MALE"] = { 0, 0.125, 0.25, 0.5 },
 | 
				
			||||||
 | 
					    ["SCOURGE_MALE"] = { 0.125, 0.25, 0.25, 0.5 },
 | 
				
			||||||
 | 
					    ["TROLL_MALE"] = { 0.25, 0.375, 0.25, 0.5 },
 | 
				
			||||||
 | 
					    ["ORC_MALE"] = { 0.375, 0.5, 0.25, 0.5 },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ["HUMAN_FEMALE"] = { 0, 0.125, 0.5, 0.75 },
 | 
				
			||||||
 | 
					    ["DWARF_FEMALE"] = { 0.125, 0.25, 0.5, 0.75 },
 | 
				
			||||||
 | 
					    ["GNOME_FEMALE"] = { 0.25, 0.375, 0.5, 0.75 },
 | 
				
			||||||
 | 
					    ["NIGHTELF_FEMALE"] = { 0.375, 0.5, 0.5, 0.75 },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ["TAUREN_FEMALE"] = { 0, 0.125, 0.75, 1.0 },
 | 
				
			||||||
 | 
					    ["SCOURGE_FEMALE"] = { 0.125, 0.25, 0.75, 1.0 },
 | 
				
			||||||
 | 
					    ["TROLL_FEMALE"] = { 0.25, 0.375, 0.75, 1.0 },
 | 
				
			||||||
 | 
					    ["ORC_FEMALE"] = { 0.375, 0.5, 0.75, 1.0 },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ["BLOODELF_MALE"] = { 0.5, 0.625, 0.25, 0.5 },
 | 
				
			||||||
 | 
					    ["BLOODELF_FEMALE"] = { 0.5, 0.625, 0.75, 1.0 },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ["DRAENEI_MALE"] = { 0.5, 0.625, 0, 0.25 },
 | 
				
			||||||
 | 
					    ["DRAENEI_FEMALE"] = { 0.5, 0.625, 0.5, 0.75 },
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local arenaTimer = {
 | 
				
			||||||
 | 
					    ["default"] = {
 | 
				
			||||||
 | 
					        [60] = "One minute until the Arena battle begins!",
 | 
				
			||||||
 | 
					        [30] = "Thirty seconds until the Arena battle begins!",
 | 
				
			||||||
 | 
					        [15] = "Fifteen seconds until the Arena battle begins!",
 | 
				
			||||||
 | 
					        [0] = "The Arena battle has begun!",
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    ["esES"] = {
 | 
				
			||||||
 | 
					        [60] = "¡Un minuto hasta que dé comienzo la batalla en arena!",
 | 
				
			||||||
 | 
					        [30] = "¡Treinta segundos hasta que comience la batalla en arena!",
 | 
				
			||||||
 | 
					        [15] = "¡Quince segundos hasta que comience la batalla en arena!",
 | 
				
			||||||
 | 
					        [0] = "¡La batalla en arena ha comenzado!",
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    ["ptBR"] = {
 | 
				
			||||||
 | 
					        [60] = "Um minuto até a batalha na Arena começar!",
 | 
				
			||||||
 | 
					        [30] = "Trinta segundos até a batalha na Arena começar!",
 | 
				
			||||||
 | 
					        [15] = "Quinze segundos até a batalha na Arena começar!",
 | 
				
			||||||
 | 
					        [0] = "A batalha na Arena começou!",
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    ["deDE"] = {
 | 
				
			||||||
 | 
					        [60] = "Noch eine Minute bis der Arenakampf beginnt!",
 | 
				
			||||||
 | 
					        [30] = "Noch dreißig Sekunden bis der Arenakampf beginnt!",
 | 
				
			||||||
 | 
					        [15] = "Noch fünfzehn Sekunden bis der Arenakampf beginnt!",
 | 
				
			||||||
 | 
					        [0] = "Der Arenakampf hat begonnen!",
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    ["frFR"] = {
 | 
				
			||||||
 | 
					        [60] = "Le combat d'arène commence dans une minute\194\160!",
 | 
				
			||||||
 | 
					        [30] = "Le combat d'arène commence dans trente secondes\194\160!",
 | 
				
			||||||
 | 
					        [15] = "Le combat d'arène commence dans quinze secondes\194\160!",
 | 
				
			||||||
 | 
					        [0] = "Le combat d'arène commence\194\160!",
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    ["ruRU"] = {
 | 
				
			||||||
 | 
					        [60] = "Одна минута до начала боя на арене!",
 | 
				
			||||||
 | 
					        [30] = "Тридцать секунд до начала боя на арене!",
 | 
				
			||||||
 | 
					        [15] = "До начала боя на арене осталось 15 секунд.",
 | 
				
			||||||
 | 
					        [0] = "Бой начался!",
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    ["itIT"] = { -- TODO
 | 
				
			||||||
 | 
					        -- Beta has no itIT version available?
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    ["koKR"] = {
 | 
				
			||||||
 | 
					        [60] = "투기장 전투 시작 1분 전입니다!",
 | 
				
			||||||
 | 
					        [30] = "투기장 전투 시작 30초 전입니다!",
 | 
				
			||||||
 | 
					        [15] = "투기장 전투 시작 15초 전입니다!",
 | 
				
			||||||
 | 
					        [0] = "투기장 전투가 시작되었습니다!",
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    ["zhCN"] = {
 | 
				
			||||||
 | 
					        [60] = "竞技场战斗将在一分钟后开始!",
 | 
				
			||||||
 | 
					        [30] = "竞技场战斗将在三十秒后开始!",
 | 
				
			||||||
 | 
					        [15] = "竞技场战斗将在十五秒后开始!",
 | 
				
			||||||
 | 
					        [0] = "竞技场的战斗开始了!",
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    ["zhTW"] = {
 | 
				
			||||||
 | 
					        [60] = "1分鐘後競技場戰鬥開始!",
 | 
				
			||||||
 | 
					        [30] = "30秒後競技場戰鬥開始!",
 | 
				
			||||||
 | 
					        [15] = "15秒後競技場戰鬥開始!",
 | 
				
			||||||
 | 
					        [0] = "競技場戰鬥開始了!",
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					arenaTimer["esMX"] = arenaTimer["esES"]
 | 
				
			||||||
 | 
					arenaTimer["ptPT"] = arenaTimer["ptBR"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Gladdy:GetArenaTimer()
 | 
				
			||||||
 | 
					    if arenaTimer[GetLocale()] then
 | 
				
			||||||
 | 
					        return arenaTimer[GetLocale()]
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        return arenaTimer["default"]
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Gladdy.legacy = {
 | 
				
			||||||
 | 
					    castBarPos = "LEFT",
 | 
				
			||||||
 | 
					    buffsCooldownPos = "TOP",
 | 
				
			||||||
 | 
					    buffsBuffsCooldownPos = "BOTTOM",
 | 
				
			||||||
 | 
					    classIconPos = "LEFT",
 | 
				
			||||||
 | 
					    ciAnchor = "healthBar",
 | 
				
			||||||
 | 
					    ciPos = "TOP",
 | 
				
			||||||
 | 
					    cooldownYPos = "TOP",
 | 
				
			||||||
 | 
					    cooldownXPos = "LEFT",
 | 
				
			||||||
 | 
					    drCooldownPos = "RIGHT",
 | 
				
			||||||
 | 
					    racialAnchor = "trinket",
 | 
				
			||||||
 | 
					    racialPos = "RIGHT",
 | 
				
			||||||
 | 
					    trinketPos = "RIGHT",
 | 
				
			||||||
 | 
					    padding = 1,
 | 
				
			||||||
 | 
					    growUp = false,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Gladdy.newDefaults = {
 | 
				
			||||||
 | 
					    ["bottomMargin"] = 94.99996948242188,
 | 
				
			||||||
 | 
					    ["newLayout"] = true,
 | 
				
			||||||
 | 
					    Pets = {
 | 
				
			||||||
 | 
					        ["petYOffset"] = -81.99993896484375,
 | 
				
			||||||
 | 
					        ["petXOffset"] = 181,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    ClassIcon = {
 | 
				
			||||||
 | 
					        ["classIconXOffset"] = -74.90008544921875,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    Racial = {
 | 
				
			||||||
 | 
					        ["racialXOffset"] = 255.9000244140625,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    Trinket = {
 | 
				
			||||||
 | 
					        ["trinketXOffset"] = 182,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    ["Combat Indicator"] = {
 | 
				
			||||||
 | 
					        ["ciXOffset"] = 79.99993896484375,
 | 
				
			||||||
 | 
					        ["ciYOffset"] = -10.99993896484375,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    Cooldowns = {
 | 
				
			||||||
 | 
					        ["cooldownYOffset"] = 31,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    ["Buffs and Debuffs"] = {
 | 
				
			||||||
 | 
					        ["buffsBuffsXOffset"] = 29,
 | 
				
			||||||
 | 
					        ["buffsBuffsYOffset"] = -82.99993896484375,
 | 
				
			||||||
 | 
					        ["buffsXOffset"] = 29,
 | 
				
			||||||
 | 
					        ["buffsYOffset"] = 62.00006103515625,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    Diminishings = {
 | 
				
			||||||
 | 
					        ["drXOffset"] = 329.7999877929688,
 | 
				
			||||||
 | 
					        ["drYOffset"] = -22.5,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    ["Cast Bar"] = {
 | 
				
			||||||
 | 
					        ["castBarXOffset"] = -235.900146484375,
 | 
				
			||||||
 | 
					        ["castBarYOffset"] = -30.5,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Gladdy.frameStrata = {
 | 
				
			||||||
 | 
					    BACKGROUND = L["Background"] .. "(0)",
 | 
				
			||||||
 | 
					    LOW = L["Low"] .. "(1)",
 | 
				
			||||||
 | 
					    MEDIUM = L["Medium"] .. "(2)",
 | 
				
			||||||
 | 
					    HIGH = L["High"] .. "(3)",
 | 
				
			||||||
 | 
					    DIALOG = L["Dialog"] .. "(4)",
 | 
				
			||||||
 | 
					    FULLSCREEN = L["Fullscreen"] .. "(5)",
 | 
				
			||||||
 | 
					    FULLSCREEN_DIALOG = L["Fullscreen Dialog"] .. "(6)",
 | 
				
			||||||
 | 
					    TOOLTIP = L["Tooltip"] .. "(7)",
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Gladdy.frameStrataSorting = {
 | 
				
			||||||
 | 
					    [1] = "BACKGROUND",
 | 
				
			||||||
 | 
					    [2] = "LOW",
 | 
				
			||||||
 | 
					    [3] = "MEDIUM",
 | 
				
			||||||
 | 
					    [4] = "HIGH",
 | 
				
			||||||
 | 
					    [5] = "DIALOG",
 | 
				
			||||||
 | 
					    [6] = "FULLSCREEN",
 | 
				
			||||||
 | 
					    [7] = "FULLSCREEN_DIALOG",
 | 
				
			||||||
 | 
					    [8] = "TOOLTIP",
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local dispelTypeColors = {}
 | 
				
			||||||
 | 
					dispelTypeColors["none"] = { r = 0.80, g = 0, b = 0, a = 1 }
 | 
				
			||||||
 | 
					dispelTypeColors["magic"] = { r = 0.20, g = 0.60, b = 1.00, a = 1 }
 | 
				
			||||||
 | 
					dispelTypeColors["curse"] = { r = 0.60, g = 0.00, b = 1.00, a = 1 }
 | 
				
			||||||
 | 
					dispelTypeColors["disease"] = { r = 0.60, g = 0.40, b = 0, a = 1 }
 | 
				
			||||||
 | 
					dispelTypeColors["poison"] = { r = 0.00, g = 0.60, b = 0, a = 1 }
 | 
				
			||||||
 | 
					dispelTypeColors["immune"] = { r = 1.00, g = 0.02, b = 0.99, a = 1 }
 | 
				
			||||||
 | 
					dispelTypeColors["enrage"] = dispelTypeColors["none"]
 | 
				
			||||||
 | 
					dispelTypeColors["form"] = dispelTypeColors["none"]
 | 
				
			||||||
 | 
					dispelTypeColors["aura"] = dispelTypeColors["none"]
 | 
				
			||||||
 | 
					dispelTypeColors[""] = dispelTypeColors["none"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Gladdy:GetDispelTypeColors()
 | 
				
			||||||
 | 
					    return dispelTypeColors
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--[[schoolColoring = {
 | 
				
			||||||
 | 
					    [SCHOOL_MASK_NONE]	= {a=1.0,r=1.00,g=1.00,b=1.00};
 | 
				
			||||||
 | 
					    [SCHOOL_MASK_PHYSICAL]	= {a=1.0,r=1.00,g=1.00,b=0.00};
 | 
				
			||||||
 | 
					    [SCHOOL_MASK_HOLY] 	= {a=1.0,r=1.00,g=0.90,b=0.50};
 | 
				
			||||||
 | 
					    [SCHOOL_MASK_FIRE] 	= {a=1.0,r=1.00,g=0.50,b=0.00};
 | 
				
			||||||
 | 
					    [SCHOOL_MASK_NATURE] 	= {a=1.0,r=0.30,g=1.00,b=0.30};
 | 
				
			||||||
 | 
					    [SCHOOL_MASK_FROST] 	= {a=1.0,r=0.50,g=1.00,b=1.00};
 | 
				
			||||||
 | 
					    [SCHOOL_MASK_SHADOW] 	= {a=1.0,r=0.50,g=0.50,b=1.00};
 | 
				
			||||||
 | 
					    [SCHOOL_MASK_ARCANE] 	= {a=1.0,r=1.00,g=0.50,b=1.00};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SCHOOL_MASK_NONE		= 0x00;
 | 
				
			||||||
 | 
					SCHOOL_MASK_PHYSICAL	= 0x01;
 | 
				
			||||||
 | 
					SCHOOL_MASK_HOLY		= 0x02;
 | 
				
			||||||
 | 
					SCHOOL_MASK_FIRE		= 0x04;
 | 
				
			||||||
 | 
					SCHOOL_MASK_NATURE		= 0x08;
 | 
				
			||||||
 | 
					SCHOOL_MASK_FROST		= 0x10;
 | 
				
			||||||
 | 
					SCHOOL_MASK_SHADOW		= 0x20;
 | 
				
			||||||
 | 
					SCHOOL_MASK_ARCANE		= 0x40;
 | 
				
			||||||
 | 
					--]]
 | 
				
			||||||
 | 
					local spellSchoolColors = {}
 | 
				
			||||||
 | 
					spellSchoolColors[1] = { r = 1, g = 1, b = 0, a = 1, type = "Physical" } -- "physical" 255, 255, 0
 | 
				
			||||||
 | 
					spellSchoolColors[2] = { r = 1, g = 0.901, b = 0.501, a = 1, type = "Holy" } --"holy" -- 255, 230, 128
 | 
				
			||||||
 | 
					spellSchoolColors[4] = { r = 1, g = 0.501, b = 0, a = 1, type = "Fire" } --"fire" --  255, 128, 0
 | 
				
			||||||
 | 
					spellSchoolColors[8] = { r = 0.302, g = 1, b = 0.302, a = 1, type = "Nature" } --"nature" --  77, 255, 77
 | 
				
			||||||
 | 
					spellSchoolColors[16] = { r = 0.501, g = 1, b = 1, a = 1, type = "Frost" } --"frost" -- 128, 255, 255
 | 
				
			||||||
 | 
					spellSchoolColors[32] = { r = 0.501, g = 0.501, b = 1, a = 1, type = "Shadow" } --"shadow" --128, 128, 255
 | 
				
			||||||
 | 
					spellSchoolColors[64] = { r = 1, g = 0.501, b = 1, a = 1, type = "Arcane" } --"arcane" -- 255, 128, 255
 | 
				
			||||||
 | 
					spellSchoolColors["unknown"] = { r = 0, g = 0, b = 0, a = 1, type = "Unknown" } --"unknown spell school"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Gladdy:GetSpellSchoolColors()
 | 
				
			||||||
 | 
					    return spellSchoolColors
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------
 | 
				
			||||||
 | 
					-- TRINKET STUFF
 | 
				
			||||||
 | 
					---------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local pvpTrinkets = { -- [itemID] = cd in ms
 | 
				
			||||||
 | 
					    --wotlk
 | 
				
			||||||
 | 
					    [59752] = 120000,
 | 
				
			||||||
 | 
					    [51377] = 120000,
 | 
				
			||||||
 | 
					    [51378] = 120000,
 | 
				
			||||||
 | 
					    [46083] = 120000,
 | 
				
			||||||
 | 
					    [46085] = 120000,
 | 
				
			||||||
 | 
					    [46081] = 120000,
 | 
				
			||||||
 | 
					    [46084] = 120000,
 | 
				
			||||||
 | 
					    [46082] = 120000,
 | 
				
			||||||
 | 
					    [42122] = 120000,
 | 
				
			||||||
 | 
					    [42123] = 120000,
 | 
				
			||||||
 | 
					    --tbc
 | 
				
			||||||
 | 
					    [37864] = 120000,
 | 
				
			||||||
 | 
					    [37865] = 120000,
 | 
				
			||||||
 | 
					    [28235] = 120000,
 | 
				
			||||||
 | 
					    [30348] = 120000,
 | 
				
			||||||
 | 
					    [28238] = 120000,
 | 
				
			||||||
 | 
					    [30351] = 120000,
 | 
				
			||||||
 | 
					    [28236] = 120000,
 | 
				
			||||||
 | 
					    [30349] = 120000,
 | 
				
			||||||
 | 
					    [28234] = 120000,
 | 
				
			||||||
 | 
					    [28237] = 120000,
 | 
				
			||||||
 | 
					    [30350] = 120000,
 | 
				
			||||||
 | 
					    [28240] = 120000,
 | 
				
			||||||
 | 
					    [28243] = 120000,
 | 
				
			||||||
 | 
					    [30345] = 120000,
 | 
				
			||||||
 | 
					    [28241] = 120000,
 | 
				
			||||||
 | 
					    [30343] = 120000,
 | 
				
			||||||
 | 
					    [28239] = 120000,
 | 
				
			||||||
 | 
					    [30346] = 120000,
 | 
				
			||||||
 | 
					    [28242] = 120000,
 | 
				
			||||||
 | 
					    [30344] = 120000,
 | 
				
			||||||
 | 
					    [29593] = 120000,
 | 
				
			||||||
 | 
					    [29593] = 300000,
 | 
				
			||||||
 | 
					    [18859] = 300000,
 | 
				
			||||||
 | 
					    [18857] = 300000,
 | 
				
			||||||
 | 
					    [18864] = 300000,
 | 
				
			||||||
 | 
					    [18854] = 300000,
 | 
				
			||||||
 | 
					    [18862] = 300000,
 | 
				
			||||||
 | 
					    [18858] = 300000,
 | 
				
			||||||
 | 
					    [18856] = 300000,
 | 
				
			||||||
 | 
					    [18863] = 300000,
 | 
				
			||||||
 | 
					    [18834] = 300000,
 | 
				
			||||||
 | 
					    [18851] = 300000,
 | 
				
			||||||
 | 
					    [18845] = 300000,
 | 
				
			||||||
 | 
					    [18852] = 300000,
 | 
				
			||||||
 | 
					    [29592] = 300000,
 | 
				
			||||||
 | 
					    [18850] = 300000,
 | 
				
			||||||
 | 
					    [18846] = 300000,
 | 
				
			||||||
 | 
					    [18853] = 300000,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Gladdy:GetPvpTrinkets()
 | 
				
			||||||
 | 
					    return pvpTrinkets
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
@@ -1,20 +1,21 @@
 | 
				
			|||||||
local select, string_gsub = select, string.gsub
 | 
					local select, string_gsub, tostring, pairs, ipairs = select, string.gsub, tostring, pairs, ipairs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local CombatLogGetCurrentEventInfo = CombatLogGetCurrentEventInfo
 | 
					local CombatLogGetCurrentEventInfo = CombatLogGetCurrentEventInfo
 | 
				
			||||||
local RAID_CLASS_COLORS = RAID_CLASS_COLORS
 | 
					 | 
				
			||||||
local AURA_TYPE_DEBUFF = AURA_TYPE_DEBUFF
 | 
					local AURA_TYPE_DEBUFF = AURA_TYPE_DEBUFF
 | 
				
			||||||
local AURA_TYPE_BUFF = AURA_TYPE_BUFF
 | 
					local AURA_TYPE_BUFF = AURA_TYPE_BUFF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local UnitName, UnitAura, UnitRace, UnitClass, UnitGUID, UnitIsUnit = UnitName, UnitAura, UnitRace, UnitClass, UnitGUID, UnitIsUnit
 | 
					local UnitName, UnitAura, UnitRace, UnitClass, UnitGUID, UnitIsUnit, UnitExists = UnitName, UnitAura, UnitRace, UnitClass, UnitGUID, UnitIsUnit, UnitExists
 | 
				
			||||||
local UnitCastingInfo, UnitChannelInfo = UnitCastingInfo, UnitChannelInfo
 | 
					local UnitCastingInfo, UnitChannelInfo = UnitCastingInfo, UnitChannelInfo
 | 
				
			||||||
local GetSpellInfo = GetSpellInfo
 | 
					local GetSpellInfo = GetSpellInfo
 | 
				
			||||||
local FindAuraByName = AuraUtil.FindAuraByName
 | 
					local FindAuraByName = AuraUtil.FindAuraByName
 | 
				
			||||||
 | 
					local GetTime = GetTime
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local Gladdy = LibStub("Gladdy")
 | 
					local Gladdy = LibStub("Gladdy")
 | 
				
			||||||
 | 
					local L = Gladdy.L
 | 
				
			||||||
local Cooldowns = Gladdy.modules["Cooldowns"]
 | 
					local Cooldowns = Gladdy.modules["Cooldowns"]
 | 
				
			||||||
local Diminishings = Gladdy.modules["Diminishings"]
 | 
					local Diminishings = Gladdy.modules["Diminishings"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local EventListener = Gladdy:NewModule("EventListener", nil, {
 | 
					local EventListener = Gladdy:NewModule("EventListener", 101, {
 | 
				
			||||||
    test = true,
 | 
					    test = true,
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -34,7 +35,16 @@ function EventListener:JOINED_ARENA()
 | 
				
			|||||||
    self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START")
 | 
					    self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START")
 | 
				
			||||||
    self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
 | 
					    self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
 | 
				
			||||||
    self:SetScript("OnEvent", EventListener.OnEvent)
 | 
					    self:SetScript("OnEvent", EventListener.OnEvent)
 | 
				
			||||||
    Gladdy:SendCommMessage("GladdyVCheck", Gladdy.version, "RAID", UnitName("player"))
 | 
					
 | 
				
			||||||
 | 
					    -- in case arena has started already we check for units
 | 
				
			||||||
 | 
					    for i=1,Gladdy.curBracket do
 | 
				
			||||||
 | 
					        if UnitExists("arena" .. i) then
 | 
				
			||||||
 | 
					            Gladdy:SpotEnemy("arena" .. i, true)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if UnitExists("arenapet" .. i) then
 | 
				
			||||||
 | 
					            Gladdy:SendMessage("PET_SPOTTED", "arenapet" .. i)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function EventListener:Reset()
 | 
					function EventListener:Reset()
 | 
				
			||||||
@@ -42,88 +52,135 @@ function EventListener:Reset()
 | 
				
			|||||||
    self:SetScript("OnEvent", nil)
 | 
					    self:SetScript("OnEvent", nil)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Gladdy:DetectSpec(unit, specSpell)
 | 
					 | 
				
			||||||
    if specSpell then
 | 
					 | 
				
			||||||
        self.modules["Cooldowns"]:DetectSpec(unit, specSpell)
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
function Gladdy:SpotEnemy(unit, auraScan)
 | 
					function Gladdy:SpotEnemy(unit, auraScan)
 | 
				
			||||||
    local button = self.buttons[unit]
 | 
					    local button = self.buttons[unit]
 | 
				
			||||||
    button.raceLoc = UnitRace(unit)
 | 
					    if not unit or not button then
 | 
				
			||||||
    button.race = select(2, UnitRace(unit))
 | 
					        return
 | 
				
			||||||
    button.classLoc = select(1, UnitClass(unit))
 | 
					    end
 | 
				
			||||||
    button.class = select(2, UnitClass(unit))
 | 
					 | 
				
			||||||
    button.name = UnitName(unit)
 | 
					 | 
				
			||||||
    button.stealthed = false
 | 
					    button.stealthed = false
 | 
				
			||||||
    Gladdy.guids[UnitGUID(unit)] = unit
 | 
					    if UnitExists(unit) then
 | 
				
			||||||
    Gladdy:SendMessage("ENEMY_SPOTTED", unit)
 | 
					        button.raceLoc = UnitRace(unit)
 | 
				
			||||||
 | 
					        button.race = select(2, UnitRace(unit))
 | 
				
			||||||
 | 
					        button.classLoc = select(1, UnitClass(unit))
 | 
				
			||||||
 | 
					        button.class = select(2, UnitClass(unit))
 | 
				
			||||||
 | 
					        button.name = UnitName(unit)
 | 
				
			||||||
 | 
					        Gladdy.guids[UnitGUID(unit)] = unit
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if button.class and button.race then
 | 
				
			||||||
 | 
					        Gladdy:SendMessage("ENEMY_SPOTTED", unit)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
    if auraScan and not button.spec then
 | 
					    if auraScan and not button.spec then
 | 
				
			||||||
 | 
					        Gladdy:SendMessage("AURA_FADE", unit, "HELPFUL")
 | 
				
			||||||
        for n = 1, 30 do
 | 
					        for n = 1, 30 do
 | 
				
			||||||
            local spellName,_,_,_,_,_,unitCaster = UnitAura(unit, n, "HELPFUL")
 | 
					            local spellName, texture, count, dispelType, duration, expirationTime, unitCaster, _, _, spellID = UnitAura(unit, n, "HELPFUL")
 | 
				
			||||||
            if ( not spellName ) then
 | 
					            if ( not spellName ) then
 | 
				
			||||||
 | 
					                Gladdy:SendMessage("AURA_GAIN_LIMIT", unit, AURA_TYPE_BUFF, n - 1)
 | 
				
			||||||
                break
 | 
					                break
 | 
				
			||||||
            end
 | 
					            end
 | 
				
			||||||
            if Gladdy.specBuffs[spellName] then
 | 
					            if Gladdy.specBuffs[spellName] and unitCaster then -- Check for auras that detect a spec
 | 
				
			||||||
                local unitPet = string_gsub(unit, "%d$", "pet%1")
 | 
					                local unitPet = string_gsub(unit, "%d$", "pet%1")
 | 
				
			||||||
                if UnitIsUnit(unit, unitCaster) or UnitIsUnit(unitPet, unitCaster) then
 | 
					                if UnitIsUnit(unit, unitCaster) or UnitIsUnit(unitPet, unitCaster) then
 | 
				
			||||||
                    Gladdy:DetectSpec(unit, Gladdy.specBuffs[spellName])
 | 
					                    EventListener:DetectSpec(unit, Gladdy.specBuffs[spellName])
 | 
				
			||||||
                end
 | 
					                end
 | 
				
			||||||
            end
 | 
					            end
 | 
				
			||||||
 | 
					            if Gladdy.cooldownBuffs[spellName] and unitCaster then -- Check for auras that detect used CDs (like Fear Ward)
 | 
				
			||||||
 | 
					                for arenaUnit,v in pairs(self.buttons) do
 | 
				
			||||||
 | 
					                    if (UnitIsUnit(arenaUnit, unitCaster)) then
 | 
				
			||||||
 | 
					                        Cooldowns:CooldownUsed(arenaUnit, v.class, Gladdy.cooldownBuffs[spellName].spellId, Gladdy.cooldownBuffs[spellName].cd(expirationTime - GetTime()))
 | 
				
			||||||
 | 
					                        -- /run LibStub("Gladdy").modules["Cooldowns"]:CooldownUsed("arena5", "PRIEST", 6346, 10)
 | 
				
			||||||
 | 
					                    end
 | 
				
			||||||
 | 
					                end
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					            if Gladdy.cooldownBuffs.racials[spellName] and Gladdy.cooldownBuffs.racials[spellName] then
 | 
				
			||||||
 | 
					                Gladdy:SendMessage("RACIAL_USED", unit, spellName, Gladdy.cooldownBuffs.racials[spellName].cd(expirationTime - GetTime()), spellName)
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					            Gladdy:SendMessage("AURA_GAIN", unit, AURA_TYPE_BUFF, spellID, spellName, texture, duration, expirationTime, count, dispelType, n, unitCaster)
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function EventListener:COMBAT_LOG_EVENT_UNFILTERED()
 | 
					function EventListener:COMBAT_LOG_EVENT_UNFILTERED()
 | 
				
			||||||
    -- timestamp,eventType,hideCaster,sourceGUID,sourceName,sourceFlags,sourceRaidFlags,destGUID,destName,destFlags,destRaidFlags,spellId,spellName,spellSchool
 | 
					    -- timestamp,eventType,hideCaster,sourceGUID,sourceName,sourceFlags,sourceRaidFlags,destGUID,destName,destFlags,destRaidFlags,spellId,spellName,spellSchool
 | 
				
			||||||
    local _,eventType,_,sourceGUID,_,_,_,destGUID,_,_,_,spellID,spellName = CombatLogGetCurrentEventInfo()
 | 
					    local _,eventType,_,sourceGUID,_,_,_,destGUID,_,_,_,spellID,spellName,spellSchool,extraSpellId,extraSpellName,extraSpellSchool = CombatLogGetCurrentEventInfo()
 | 
				
			||||||
    local srcUnit = Gladdy.guids[sourceGUID]
 | 
					    local srcUnit = Gladdy.guids[sourceGUID] -- can be a PET
 | 
				
			||||||
    local destUnit = Gladdy.guids[destGUID]
 | 
					    local destUnit = Gladdy.guids[destGUID] -- can be a PET
 | 
				
			||||||
 | 
					    if (Gladdy.db.shadowsightTimerEnabled and eventType == "SPELL_AURA_APPLIED" and spellID == 34709) then
 | 
				
			||||||
    if Gladdy.specSpells[spellName] and srcUnit then
 | 
					        Gladdy.modules["Shadowsight Timer"]:AURA_GAIN(nil, nil, 34709)
 | 
				
			||||||
        --Gladdy:Print(eventType, spellName, Gladdy.specSpells[spellName], srcUnit)
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
    if (eventType == "UNIT_DIED" or eventType == "PARTY_KILL" or eventType == "SPELL_INSTAKILL") then
 | 
					 | 
				
			||||||
        if destUnit then
 | 
					 | 
				
			||||||
            --Gladdy:Print(eventType, "destUnit", destUnit)
 | 
					 | 
				
			||||||
        elseif srcUnit then
 | 
					 | 
				
			||||||
            --Gladdy:Print(eventType, "srcUnit", srcUnit)
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if destUnit then
 | 
					    if destUnit then
 | 
				
			||||||
 | 
					        -- cooldown
 | 
				
			||||||
 | 
					        if (Gladdy.db.cooldown and Cooldowns.cooldownSpellIds[spellName]) then
 | 
				
			||||||
 | 
					            local spellId = Cooldowns.cooldownSpellIds[spellName] -- don't use spellId from combatlog, in case of different spellrank
 | 
				
			||||||
 | 
					            if spellID == 16188 or spellID == 17116 then -- Nature's Swiftness (same name for druid and shaman)
 | 
				
			||||||
 | 
					                spellId = spellID
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					            Cooldowns:AURA_FADE(destUnit, spellID)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
        -- diminish tracker
 | 
					        -- diminish tracker
 | 
				
			||||||
        if (Gladdy.db.drEnabled and (eventType == "SPELL_AURA_REMOVED" or eventType == "SPELL_AURA_REFRESH")) then
 | 
					        if Gladdy.buttons[destUnit] and Gladdy.db.drEnabled and extraSpellId == AURA_TYPE_DEBUFF then
 | 
				
			||||||
            Diminishings:AuraFade(destUnit, spellID)
 | 
					            if (eventType == "SPELL_AURA_REMOVED") then
 | 
				
			||||||
 | 
					                Diminishings:AuraFade(destUnit, spellID)
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					            if (eventType == "SPELL_AURA_REFRESH") then
 | 
				
			||||||
 | 
					                Diminishings:AuraGain(destUnit, spellID)
 | 
				
			||||||
 | 
					                --Diminishings:AuraFade(destUnit, spellID)
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					            if (eventType == "SPELL_AURA_APPLIED") then
 | 
				
			||||||
 | 
					                Diminishings:AuraGain(destUnit, spellID)
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
        -- death detection
 | 
					        -- death detection
 | 
				
			||||||
        if (eventType == "UNIT_DIED" or eventType == "PARTY_KILL" or eventType == "SPELL_INSTAKILL") then
 | 
					        if (Gladdy.buttons[destUnit] and eventType == "UNIT_DIED" or eventType == "PARTY_KILL" or eventType == "SPELL_INSTAKILL") then
 | 
				
			||||||
            Gladdy:SendMessage("UNIT_DEATH", destUnit)
 | 
					            if not Gladdy:isFeignDeath(destUnit) then
 | 
				
			||||||
 | 
					                Gladdy:SendMessage("UNIT_DEATH", destUnit)
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
        -- spec detection
 | 
					        -- spec detection
 | 
				
			||||||
        if not Gladdy.buttons[destUnit].class then
 | 
					        if Gladdy.buttons[destUnit] and (not Gladdy.buttons[destUnit].class or not Gladdy.buttons[destUnit].race) then
 | 
				
			||||||
            Gladdy:SpotEnemy(destUnit, true)
 | 
					            Gladdy:SpotEnemy(destUnit, true)
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
 | 
					        --interrupt detection
 | 
				
			||||||
 | 
					        if Gladdy.buttons[destUnit] and eventType == "SPELL_INTERRUPT" then
 | 
				
			||||||
 | 
					            Gladdy:SendMessage("SPELL_INTERRUPT", destUnit,spellID,spellName,spellSchool,extraSpellId,extraSpellName,extraSpellSchool)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    if srcUnit then
 | 
					    if srcUnit then
 | 
				
			||||||
        -- cooldown tracker
 | 
					        srcUnit = string_gsub(srcUnit, "pet", "")
 | 
				
			||||||
        if Gladdy.db.cooldown and Cooldowns.cooldownSpellIds[spellName] then
 | 
					        if (not UnitExists(srcUnit)) then
 | 
				
			||||||
            local unitClass
 | 
					            return
 | 
				
			||||||
            local spellId = Cooldowns.cooldownSpellIds[spellName] -- don't use spellId from combatlog, in case of different spellrank
 | 
					 | 
				
			||||||
            if (Cooldowns.cooldownSpells[Gladdy.buttons[srcUnit].class][spellId]) then
 | 
					 | 
				
			||||||
                unitClass = Gladdy.buttons[srcUnit].class
 | 
					 | 
				
			||||||
            else
 | 
					 | 
				
			||||||
                unitClass = Gladdy.buttons[srcUnit].race
 | 
					 | 
				
			||||||
            end
 | 
					 | 
				
			||||||
            Cooldowns:CooldownUsed(srcUnit, unitClass, spellId, spellName)
 | 
					 | 
				
			||||||
            Gladdy:DetectSpec(srcUnit, Gladdy.specSpells[spellName])
 | 
					 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
 | 
					        if not Gladdy.buttons[srcUnit].class or not Gladdy.buttons[srcUnit].race then
 | 
				
			||||||
        if not Gladdy.buttons[srcUnit].class then
 | 
					 | 
				
			||||||
            Gladdy:SpotEnemy(srcUnit, true)
 | 
					            Gladdy:SpotEnemy(srcUnit, true)
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
        if not Gladdy.buttons[srcUnit].spec then
 | 
					        if not Gladdy.buttons[srcUnit].spec then
 | 
				
			||||||
            Gladdy:DetectSpec(srcUnit, Gladdy.specSpells[spellName])
 | 
					            self:DetectSpec(srcUnit, Gladdy.specSpells[spellName])
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if (eventType == "SPELL_CAST_SUCCESS" or eventType == "SPELL_AURA_APPLIED" or eventType == "SPELL_MISSED") then
 | 
				
			||||||
 | 
					            self:DetectSpec(srcUnit, Gladdy.specSpells[spellName])
 | 
				
			||||||
 | 
					            -- cooldown tracker
 | 
				
			||||||
 | 
					            if Gladdy.db.cooldown and Cooldowns.cooldownSpellIds[spellName] then
 | 
				
			||||||
 | 
					                local unitClass
 | 
				
			||||||
 | 
					                local spellId = Cooldowns.cooldownSpellIds[spellName] -- don't use spellId from combatlog, in case of different spellrank
 | 
				
			||||||
 | 
					                if spellID == 16188 or spellID == 17116 then -- Nature's Swiftness (same name for druid and shaman)
 | 
				
			||||||
 | 
					                    spellId = spellID
 | 
				
			||||||
 | 
					                end
 | 
				
			||||||
 | 
					                if Gladdy.db.cooldownCooldowns[tostring(spellId)] then
 | 
				
			||||||
 | 
					                    if (Gladdy:GetCooldownList()[Gladdy.buttons[srcUnit].class][spellId]) then
 | 
				
			||||||
 | 
					                        unitClass = Gladdy.buttons[srcUnit].class
 | 
				
			||||||
 | 
					                    else
 | 
				
			||||||
 | 
					                        unitClass = Gladdy.buttons[srcUnit].race
 | 
				
			||||||
 | 
					                    end
 | 
				
			||||||
 | 
					                    if spellID ~= 16188 and spellID ~= 17116 then -- Nature's Swiftness CD starts when buff fades
 | 
				
			||||||
 | 
					                        Gladdy:Debug("INFO", "SPELL_CAST_SUCCESS - CooldownUsed", srcUnit, "spellID:", spellID)
 | 
				
			||||||
 | 
					                        Cooldowns:CooldownUsed(srcUnit, unitClass, spellId)
 | 
				
			||||||
 | 
					                    end
 | 
				
			||||||
 | 
					                end
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if (eventType == "SPELL_AURA_REMOVED" and (spellID == 16188 or spellID == 17116) and Gladdy.buttons[srcUnit].class) then
 | 
				
			||||||
 | 
					            Gladdy:Debug("INFO", "SPELL_AURA_REMOVED - CooldownUsed", srcUnit, "spellID:", spellID)
 | 
				
			||||||
 | 
					            Cooldowns:CooldownUsed(srcUnit, Gladdy.buttons[srcUnit].class, spellID)
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
@@ -131,17 +188,18 @@ end
 | 
				
			|||||||
function EventListener:ARENA_OPPONENT_UPDATE(unit, updateReason)
 | 
					function EventListener:ARENA_OPPONENT_UPDATE(unit, updateReason)
 | 
				
			||||||
    --[[ updateReason: seen, unseen, destroyed, cleared ]]
 | 
					    --[[ updateReason: seen, unseen, destroyed, cleared ]]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    unit = Gladdy:GetArenaUnit(unit)
 | 
				
			||||||
    local button = Gladdy.buttons[unit]
 | 
					    local button = Gladdy.buttons[unit]
 | 
				
			||||||
    local pet = Gladdy.modules["Pets"].frames[unit]
 | 
					    local pet = Gladdy.modules["Pets"].frames[unit]
 | 
				
			||||||
 | 
					    Gladdy:Debug("INFO", "ARENA_OPPONENT_UPDATE", unit, updateReason)
 | 
				
			||||||
    if button or pet then
 | 
					    if button or pet then
 | 
				
			||||||
        if updateReason == "seen" then
 | 
					        if updateReason == "seen" then
 | 
				
			||||||
            -- ENEMY_SPOTTED
 | 
					            -- ENEMY_SPOTTED
 | 
				
			||||||
            if button and not button.class then
 | 
					            if button then
 | 
				
			||||||
                Gladdy:SpotEnemy(unit, true)
 | 
					                Gladdy:SendMessage("ENEMY_STEALTH", unit, false)
 | 
				
			||||||
            end
 | 
					                if not button.class or not button.race then
 | 
				
			||||||
            if button and button.stealthed then
 | 
					                    Gladdy:SpotEnemy(unit, true)
 | 
				
			||||||
                local class = Gladdy.buttons[unit].class
 | 
					                end
 | 
				
			||||||
                button.healthBar.hp:SetStatusBarColor(RAID_CLASS_COLORS[class].r, RAID_CLASS_COLORS[class].g, RAID_CLASS_COLORS[class].b, 1)
 | 
					 | 
				
			||||||
            end
 | 
					            end
 | 
				
			||||||
            if pet then
 | 
					            if pet then
 | 
				
			||||||
                Gladdy:SendMessage("PET_SPOTTED", unit)
 | 
					                Gladdy:SendMessage("PET_SPOTTED", unit)
 | 
				
			||||||
@@ -149,9 +207,7 @@ function EventListener:ARENA_OPPONENT_UPDATE(unit, updateReason)
 | 
				
			|||||||
        elseif updateReason == "unseen" then
 | 
					        elseif updateReason == "unseen" then
 | 
				
			||||||
            -- STEALTH
 | 
					            -- STEALTH
 | 
				
			||||||
            if button then
 | 
					            if button then
 | 
				
			||||||
                Gladdy:SendMessage("ENEMY_STEALTH", unit)
 | 
					                Gladdy:SendMessage("ENEMY_STEALTH", unit, true)
 | 
				
			||||||
                button.healthBar.hp:SetStatusBarColor(0.66, 0.66, 0.66, 1)
 | 
					 | 
				
			||||||
                button.stealthed = true
 | 
					 | 
				
			||||||
            end
 | 
					            end
 | 
				
			||||||
            if pet then
 | 
					            if pet then
 | 
				
			||||||
                Gladdy:SendMessage("PET_STEALTH", unit)
 | 
					                Gladdy:SendMessage("PET_STEALTH", unit)
 | 
				
			||||||
@@ -170,13 +226,15 @@ function EventListener:ARENA_OPPONENT_UPDATE(unit, updateReason)
 | 
				
			|||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local exceptionNames = {
 | 
					Gladdy.exceptionNames = { -- TODO MOVE ME TO CLASSBUFFS LIB
 | 
				
			||||||
    [31117] = GetSpellInfo(30405) .. " Silence", -- Unstable Affliction Silence
 | 
					    [31117] = GetSpellInfo(30405) .. " Silence", -- Unstable Affliction Silence
 | 
				
			||||||
    [43523] = GetSpellInfo(30405) .. " Silence",
 | 
					    [43523] = GetSpellInfo(30405) .. " Silence",
 | 
				
			||||||
    [24131] = select(1, GetSpellInfo(19386)) .. " Dot", -- Wyvern Sting Dot
 | 
					    [24131] = select(1, GetSpellInfo(19386)) .. " Dot", -- Wyvern Sting Dot
 | 
				
			||||||
    [24134] = select(1, GetSpellInfo(19386)) .. " Dot",
 | 
					    [24134] = select(1, GetSpellInfo(19386)) .. " Dot",
 | 
				
			||||||
    [24135] = select(1, GetSpellInfo(19386)) .. " Dot",
 | 
					    [24135] = select(1, GetSpellInfo(19386)) .. " Dot",
 | 
				
			||||||
    [27069] = select(1, GetSpellInfo(19386)) .. " Dot",
 | 
					    [27069] = select(1, GetSpellInfo(19386)) .. " Dot",
 | 
				
			||||||
 | 
					    [49009] = select(1, GetSpellInfo(19386)) .. " Dot",
 | 
				
			||||||
 | 
					    [49010] = select(1, GetSpellInfo(19386)) .. " Dot",
 | 
				
			||||||
    [19975] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)), -- Entangling Roots Nature's Grasp
 | 
					    [19975] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)), -- Entangling Roots Nature's Grasp
 | 
				
			||||||
    [19974] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
 | 
					    [19974] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
 | 
				
			||||||
    [19973] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
 | 
					    [19973] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
 | 
				
			||||||
@@ -184,37 +242,73 @@ local exceptionNames = {
 | 
				
			|||||||
    [19971] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
 | 
					    [19971] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
 | 
				
			||||||
    [19971] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
 | 
					    [19971] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
 | 
				
			||||||
    [27010] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
 | 
					    [27010] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
 | 
				
			||||||
 | 
					    [53312] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function EventListener:UNIT_AURA(unit)
 | 
					Gladdy.cooldownBuffs = {
 | 
				
			||||||
 | 
					    [GetSpellInfo(6346)] = { cd = function(expTime) -- 180s uptime == cd
 | 
				
			||||||
 | 
					        return expTime
 | 
				
			||||||
 | 
					    end, spellId = 6346 }, -- Fear Ward
 | 
				
			||||||
 | 
					    [GetSpellInfo(11305)] = { cd = function(expTime) -- 15s uptime
 | 
				
			||||||
 | 
					        return 300 - (15 - expTime)
 | 
				
			||||||
 | 
					    end, spellId = 11305 }, -- Sprint
 | 
				
			||||||
 | 
					    [36554] = { cd = function(expTime) -- 3s uptime
 | 
				
			||||||
 | 
					        return 30 - (3 - expTime)
 | 
				
			||||||
 | 
					    end, spellId = 36554 }, -- Shadowstep speed buff
 | 
				
			||||||
 | 
					    [36563] = { cd = function(expTime) -- 10s uptime
 | 
				
			||||||
 | 
					        return 30 - (10 - expTime)
 | 
				
			||||||
 | 
					    end, spellId = 36554 }, -- Shadowstep dmg buff
 | 
				
			||||||
 | 
					    [GetSpellInfo(26889)] = { cd = function(expTime) -- 3s uptime
 | 
				
			||||||
 | 
					        return 180 - (10 - expTime)
 | 
				
			||||||
 | 
					    end, spellId = 26889 }, -- Vanish
 | 
				
			||||||
 | 
					    racials = {
 | 
				
			||||||
 | 
					        [GetSpellInfo(20600)] = { cd = function(expTime) -- 20s uptime
 | 
				
			||||||
 | 
					            return GetTime() - (20 - expTime)
 | 
				
			||||||
 | 
					        end, spellId = 20600 }, -- Perception
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					--[[
 | 
				
			||||||
 | 
					/run local f,sn,dt for i=1,2 do f=(i==1 and "HELPFUL"or"HARMFUL")for n=1,30 do sn,_,_,dt=UnitAura("player",n,f) if(not sn)then break end print(sn,dt,dt and dt:len())end end
 | 
				
			||||||
 | 
					--]]
 | 
				
			||||||
 | 
					function EventListener:UNIT_AURA(unit, isFullUpdate, updatedAuras)
 | 
				
			||||||
    local button = Gladdy.buttons[unit]
 | 
					    local button = Gladdy.buttons[unit]
 | 
				
			||||||
    if not button then
 | 
					    if not button then
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    for i = 1, 2 do
 | 
					    for i = 1, 2 do
 | 
				
			||||||
        if not Gladdy.buttons[unit].class then
 | 
					        if not Gladdy.buttons[unit].class or not Gladdy.buttons[unit].race then
 | 
				
			||||||
            Gladdy:SpotEnemy(unit, false)
 | 
					            Gladdy:SpotEnemy(unit, false)
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
        local filter = (i == 1 and "HELPFUL" or "HARMFUL")
 | 
					        local filter = (i == 1 and "HELPFUL" or "HARMFUL")
 | 
				
			||||||
        local auraType = i == 1 and AURA_TYPE_BUFF or AURA_TYPE_DEBUFF
 | 
					        local auraType = i == 1 and AURA_TYPE_BUFF or AURA_TYPE_DEBUFF
 | 
				
			||||||
        Gladdy:SendMessage("AURA_FADE", unit, auraType)
 | 
					        Gladdy:SendMessage("AURA_FADE", unit, auraType)
 | 
				
			||||||
        for n = 1, 30 do
 | 
					        for n = 1, 30 do
 | 
				
			||||||
            local spellName, texture, count, debuffType, duration, expirationTime, unitCaster, _, shouldConsolidate, spellID = UnitAura(unit, n, filter)
 | 
					            local spellName, texture, count, dispelType, duration, expirationTime, unitCaster, _, shouldConsolidate, spellID = UnitAura(unit, n, filter)
 | 
				
			||||||
            if ( not spellID ) then
 | 
					            if ( not spellID ) then
 | 
				
			||||||
                Gladdy:SendMessage("AURA_GAIN_LIMIT", unit, auraType, n - 1)
 | 
					                Gladdy:SendMessage("AURA_GAIN_LIMIT", unit, auraType, n - 1)
 | 
				
			||||||
                break
 | 
					                break
 | 
				
			||||||
            end
 | 
					            end
 | 
				
			||||||
            if not button.spec and Gladdy.specBuffs[spellName] then
 | 
					            if not button.spec and Gladdy.specBuffs[spellName] and unitCaster then
 | 
				
			||||||
                local unitPet = string_gsub(unit, "%d$", "pet%1")
 | 
					                local unitPet = string_gsub(unit, "%d$", "pet%1")
 | 
				
			||||||
                if UnitIsUnit(unit, unitCaster) or UnitIsUnit(unitPet, unitCaster) then
 | 
					                if unitCaster and (UnitIsUnit(unit, unitCaster) or UnitIsUnit(unitPet, unitCaster)) then
 | 
				
			||||||
                    Gladdy:DetectSpec(unit, Gladdy.specBuffs[spellName])
 | 
					                    self:DetectSpec(unit, Gladdy.specBuffs[spellName])
 | 
				
			||||||
                end
 | 
					                end
 | 
				
			||||||
            end
 | 
					            end
 | 
				
			||||||
            if exceptionNames[spellID] then
 | 
					            if (Gladdy.cooldownBuffs[spellName] or Gladdy.cooldownBuffs[spellID]) and unitCaster then -- Check for auras that hint used CDs (like Fear Ward)
 | 
				
			||||||
                spellName = exceptionNames[spellID]
 | 
					                local cooldownBuff = Gladdy.cooldownBuffs[spellID] or Gladdy.cooldownBuffs[spellName]
 | 
				
			||||||
 | 
					                for arenaUnit,v in pairs(Gladdy.buttons) do
 | 
				
			||||||
 | 
					                    if (UnitIsUnit(arenaUnit, unitCaster)) then
 | 
				
			||||||
 | 
					                        Cooldowns:CooldownUsed(arenaUnit, v.class, cooldownBuff.spellId, cooldownBuff.cd(expirationTime - GetTime()))
 | 
				
			||||||
 | 
					                    end
 | 
				
			||||||
 | 
					                end
 | 
				
			||||||
            end
 | 
					            end
 | 
				
			||||||
            Gladdy:SendMessage("AURA_GAIN", unit, auraType, spellID, spellName, texture, duration, expirationTime, count, debuffType, i)
 | 
					            if Gladdy.cooldownBuffs.racials[spellName] then
 | 
				
			||||||
            Gladdy:Call("Announcements", "CheckDrink", unit, spellName)
 | 
					                Gladdy:SendMessage("RACIAL_USED", unit, spellName, Gladdy.cooldownBuffs.racials[spellName].cd(expirationTime - GetTime()), spellName)
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					            if Gladdy.exceptionNames[spellID] then
 | 
				
			||||||
 | 
					                spellName = Gladdy.exceptionNames[spellID]
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					            Gladdy:SendMessage("AURA_GAIN", unit, auraType, spellID, spellName, texture, duration, expirationTime, count, dispelType, i, unitCaster)
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
@@ -223,7 +317,7 @@ function EventListener:UNIT_SPELLCAST_START(unit)
 | 
				
			|||||||
    if Gladdy.buttons[unit] then
 | 
					    if Gladdy.buttons[unit] then
 | 
				
			||||||
        local spellName = UnitCastingInfo(unit)
 | 
					        local spellName = UnitCastingInfo(unit)
 | 
				
			||||||
        if Gladdy.specSpells[spellName] and not Gladdy.buttons[unit].spec then
 | 
					        if Gladdy.specSpells[spellName] and not Gladdy.buttons[unit].spec then
 | 
				
			||||||
            Gladdy:DetectSpec(unit, Gladdy.specSpells[spellName])
 | 
					            self:DetectSpec(unit, Gladdy.specSpells[spellName])
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
@@ -232,20 +326,65 @@ function EventListener:UNIT_SPELLCAST_CHANNEL_START(unit)
 | 
				
			|||||||
    if Gladdy.buttons[unit] then
 | 
					    if Gladdy.buttons[unit] then
 | 
				
			||||||
        local spellName = UnitChannelInfo(unit)
 | 
					        local spellName = UnitChannelInfo(unit)
 | 
				
			||||||
        if Gladdy.specSpells[spellName] and not Gladdy.buttons[unit].spec then
 | 
					        if Gladdy.specSpells[spellName] and not Gladdy.buttons[unit].spec then
 | 
				
			||||||
            Gladdy:DetectSpec(unit, Gladdy.specSpells[spellName])
 | 
					            self:DetectSpec(unit, Gladdy.specSpells[spellName])
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function EventListener:UNIT_SPELLCAST_SUCCEEDED(unit)
 | 
					function EventListener:UNIT_SPELLCAST_SUCCEEDED(...)
 | 
				
			||||||
 | 
					    local unit, castGUID, spellID = ...
 | 
				
			||||||
 | 
					    unit = Gladdy:GetArenaUnit(unit, true)
 | 
				
			||||||
    if Gladdy.buttons[unit] then
 | 
					    if Gladdy.buttons[unit] then
 | 
				
			||||||
        local spellName = UnitCastingInfo(unit)
 | 
					        local unitRace = Gladdy.buttons[unit].race
 | 
				
			||||||
 | 
					        local spellName = GetSpellInfo(spellID)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        -- spec detection
 | 
				
			||||||
        if Gladdy.specSpells[spellName] and not Gladdy.buttons[unit].spec then
 | 
					        if Gladdy.specSpells[spellName] and not Gladdy.buttons[unit].spec then
 | 
				
			||||||
            Gladdy:DetectSpec(unit, Gladdy.specSpells[spellName])
 | 
					            self:DetectSpec(unit, Gladdy.specSpells[spellName])
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        -- trinket
 | 
				
			||||||
 | 
					        if spellID == 42292 or spellID == 59752 then
 | 
				
			||||||
 | 
					            Gladdy:Debug("INFO", "UNIT_SPELLCAST_SUCCEEDED - TRINKET_USED", unit, spellID)
 | 
				
			||||||
 | 
					            Gladdy:SendMessage("TRINKET_USED", unit)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        -- racial
 | 
				
			||||||
 | 
					        if Gladdy:Racials()[unitRace].spellName == spellName and Gladdy:Racials()[unitRace][spellID] then
 | 
				
			||||||
 | 
					            Gladdy:Debug("INFO", "UNIT_SPELLCAST_SUCCEEDED - RACIAL_USED", unit, spellID)
 | 
				
			||||||
 | 
					            Gladdy:SendMessage("RACIAL_USED", unit)
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function EventListener:GetOptions()
 | 
					function EventListener:DetectSpec(unit, spec)
 | 
				
			||||||
    return nil
 | 
					    local button = Gladdy.buttons[unit]
 | 
				
			||||||
 | 
					    if (not button or not spec or button.spec) then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if button.class == "PALADIN" and Gladdy:contains(spec, {L["Holy"], L["Retribution"], L["Protection"]})
 | 
				
			||||||
 | 
					            or button.class == "SHAMAN" and not Gladdy:contains(spec, {L["Restoration"], L["Enhancement"], L["Elemental"]})
 | 
				
			||||||
 | 
					            or button.class == "ROGUE" and not Gladdy:contains(spec, {L["Subtlety"], L["Assassination"], L["Combat"]})
 | 
				
			||||||
 | 
					            or button.class == "WARLOCK" and not Gladdy:contains(spec, {L["Demonology"], L["Destruction"], L["Affliction"]})
 | 
				
			||||||
 | 
					            or button.class == "PRIEST" and not Gladdy:contains(spec, {L["Shadow"], L["Discipline"], L["Holy"]})
 | 
				
			||||||
 | 
					            or button.class == "MAGE" and not Gladdy:contains(spec, {L["Frost"], L["Fire"], L["Arcane"]})
 | 
				
			||||||
 | 
					            or button.class == "DRUID" and not Gladdy:contains(spec, {L["Restoration"], L["Feral"], L["Balance"]})
 | 
				
			||||||
 | 
					            or button.class == "HUNTER" and not Gladdy:contains(spec, {L["Beast Mastery"], L["Marksmanship"], L["Survival"]})
 | 
				
			||||||
 | 
					            or button.class == "WARRIOR" and not Gladdy:contains(spec, {L["Arms"], L["Protection"], L["Fury"]})
 | 
				
			||||||
 | 
					            or button.class == "DEATHKNIGHT" and not Gladdy:contains(spec, {L["Unholy"], L["Blood"], L["Frost"]}) then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if not button.spec then
 | 
				
			||||||
 | 
					        button.spec = spec
 | 
				
			||||||
 | 
					        Gladdy:SendMessage("UNIT_SPEC", unit, spec)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function EventListener:Test(unit)
 | 
				
			||||||
 | 
					    local button = Gladdy.buttons[unit]
 | 
				
			||||||
 | 
					    if (button and Gladdy.testData[unit].testSpec) then
 | 
				
			||||||
 | 
					        button.spec = nil
 | 
				
			||||||
 | 
					        Gladdy:SpotEnemy(unit, false)
 | 
				
			||||||
 | 
					        self:DetectSpec(unit, button.testSpec)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										440
									
								
								Frame.lua
									
									
									
									
									
								
							
							
						
						
									
										440
									
								
								Frame.lua
									
									
									
									
									
								
							@@ -1,6 +1,9 @@
 | 
				
			|||||||
local CreateFrame = CreateFrame
 | 
					local CreateFrame = CreateFrame
 | 
				
			||||||
local UIParent = UIParent
 | 
					local UIParent = UIParent
 | 
				
			||||||
local InCombatLockdown = InCombatLockdown
 | 
					local InCombatLockdown = InCombatLockdown
 | 
				
			||||||
 | 
					local math_abs = math.abs
 | 
				
			||||||
 | 
					local pairs = pairs
 | 
				
			||||||
 | 
					local LibStub = LibStub
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local Gladdy = LibStub("Gladdy")
 | 
					local Gladdy = LibStub("Gladdy")
 | 
				
			||||||
local L = Gladdy.L
 | 
					local L = Gladdy.L
 | 
				
			||||||
@@ -26,15 +29,26 @@ Gladdy.BUTTON_DEFAULTS = {
 | 
				
			|||||||
    damaged = 0,
 | 
					    damaged = 0,
 | 
				
			||||||
    click = false,
 | 
					    click = false,
 | 
				
			||||||
    stealthed = false,
 | 
					    stealthed = false,
 | 
				
			||||||
 | 
					    classColors = {},
 | 
				
			||||||
 | 
					    lastState = 0,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Gladdy:CreateFrame()
 | 
					function Gladdy:CreateFrame()
 | 
				
			||||||
    self.frame = CreateFrame("Frame", "GladdyFrame", UIParent)
 | 
					    self.frame = CreateFrame("Frame", "GladdyFrame", UIParent)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    self.frame.background = CreateFrame("Frame", nil, self.frame, BackdropTemplateMixin and "BackdropTemplate")
 | 
				
			||||||
 | 
					    self.frame.background:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = false, tileSize = 16})
 | 
				
			||||||
 | 
					    self.frame.background:SetFrameStrata("BACKGROUND")
 | 
				
			||||||
 | 
					    self.frame.background:SetBackdropColor(Gladdy:SetColor(self.db.backgroundColor))
 | 
				
			||||||
 | 
					    self.frame.background:SetAllPoints(self.frame)
 | 
				
			||||||
 | 
					    --self.frame.texture = self.frame:CreateTexture(nil, "OVERLAY")
 | 
				
			||||||
 | 
					    --self.frame.texture:SetAllPoints(self.frame)
 | 
				
			||||||
 | 
					    --self.frame.texture:SetTexture("Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    self.frame:SetClampedToScreen(true)
 | 
					    self.frame:SetClampedToScreen(true)
 | 
				
			||||||
    self.frame:EnableMouse(true)
 | 
					    self.frame:EnableMouse(false)
 | 
				
			||||||
    self.frame:SetMovable(true)
 | 
					    self.frame:SetMovable(true)
 | 
				
			||||||
    self.frame:RegisterForDrag("LeftButton")
 | 
					    --self.frame:RegisterForDrag("LeftButton")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    self.frame:SetScript("OnDragStart", function(f)
 | 
					    self.frame:SetScript("OnDragStart", function(f)
 | 
				
			||||||
        if (not InCombatLockdown() and not self.db.locked) then
 | 
					        if (not InCombatLockdown() and not self.db.locked) then
 | 
				
			||||||
@@ -47,7 +61,7 @@ function Gladdy:CreateFrame()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            local scale = f:GetEffectiveScale()
 | 
					            local scale = f:GetEffectiveScale()
 | 
				
			||||||
            self.db.x = f:GetLeft() * scale
 | 
					            self.db.x = f:GetLeft() * scale
 | 
				
			||||||
            self.db.y = (self.db.growUp and f:GetBottom() or f:GetTop()) * scale
 | 
					            self.db.y = (self.db.growDirection == "TOP" and f:GetBottom() or f:GetTop()) * scale
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    end)
 | 
					    end)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -71,7 +85,7 @@ function Gladdy:CreateFrame()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            local scale = self.frame:GetEffectiveScale()
 | 
					            local scale = self.frame:GetEffectiveScale()
 | 
				
			||||||
            self.db.x = self.frame:GetLeft() * scale
 | 
					            self.db.x = self.frame:GetLeft() * scale
 | 
				
			||||||
            self.db.y = (self.db.growUp and self.frame:GetBottom() or self.frame:GetTop()) * scale
 | 
					            self.db.y = (self.db.growDirection == "TOP" and self.frame:GetBottom() or self.frame:GetTop()) * scale
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    end)
 | 
					    end)
 | 
				
			||||||
    self.anchor:SetScript("OnClick", function()
 | 
					    self.anchor:SetScript("OnClick", function()
 | 
				
			||||||
@@ -104,133 +118,175 @@ end
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
function Gladdy:UpdateFrame()
 | 
					function Gladdy:UpdateFrame()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (InCombatLockdown()) then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (not self.frame) then
 | 
					    if (not self.frame) then
 | 
				
			||||||
        self:CreateFrame()
 | 
					        self:CreateFrame()
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    local teamSize = self.curBracket or 0
 | 
					    local teamSize = self.curBracket or 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local iconSize = self.db.healthBarHeight
 | 
					    local highlightBorderSize = (self.db.highlightInset and 0 or self.db.highlightBorderSize * 2)
 | 
				
			||||||
    local margin = 0
 | 
					    local powerBarHeight = self.db.powerBarEnabled and (self.db.powerBarHeight + 1) or 0
 | 
				
			||||||
    local width = self.db.barWidth + self.db.padding * 2 + 5
 | 
					 | 
				
			||||||
    local height = self.db.healthBarHeight * teamSize + margin * (teamSize - 1) + self.db.padding * 2 + 5
 | 
					 | 
				
			||||||
    local extraBarWidth = 0
 | 
					 | 
				
			||||||
    local extraBarHeight = 0
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    -- Powerbar
 | 
					    local margin = powerBarHeight
 | 
				
			||||||
    iconSize = iconSize + self.db.powerBarHeight
 | 
					    local height = (self.db.healthBarHeight + powerBarHeight) * teamSize
 | 
				
			||||||
    margin = margin + self.db.powerBarHeight
 | 
					            + (self.db.highlightInset and 0 or self.db.highlightBorderSize * 2 * teamSize)
 | 
				
			||||||
    height = height + self.db.powerBarHeight * teamSize
 | 
					            + self.db.bottomMargin * (teamSize - 1)
 | 
				
			||||||
    extraBarHeight = extraBarHeight + self.db.powerBarHeight
 | 
					    local singleFrameHeight = self.db.healthBarHeight + powerBarHeight +
 | 
				
			||||||
 | 
					            (self.db.highlightInset and 0 or self.db.highlightBorderSize * 2) + self.db.bottomMargin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    -- Cooldown
 | 
					    -- Highlight
 | 
				
			||||||
    margin = margin + 1 + self.db.highlightBorderSize * 2 + 1 -- + 1 space between health and power bar
 | 
					    margin = margin + highlightBorderSize
 | 
				
			||||||
    height = height + self.db.highlightBorderSize * teamSize
 | 
					    margin, height = Gladdy:LegacyPositioning(margin, height, teamSize)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (self.db.cooldownYPos == "TOP" or self.db.cooldownYPos == "BOTTOM") and self.db.cooldown then
 | 
					    -- GrowDirection
 | 
				
			||||||
        margin = margin + self.db.cooldownSize
 | 
					    if (self.db.growDirection == "LEFT" or self.db.growDirection == "RIGHT") then
 | 
				
			||||||
        height = height + self.db.cooldownSize * teamSize
 | 
					        height = self.db.healthBarHeight + powerBarHeight
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    if (self.db.buffsCooldownPos == "TOP" or self.db.buffsCooldownPos == "BOTTOM") and self.db.buffsEnabled then
 | 
					 | 
				
			||||||
        margin = margin + self.db.buffsIconSize
 | 
					 | 
				
			||||||
        height = height + self.db.buffsIconSize * teamSize
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
    if (self.db.buffsBuffsCooldownPos == "TOP" or self.db.buffsBuffsCooldownPos == "BOTTOM") and self.db.buffsEnabled then
 | 
					 | 
				
			||||||
        margin = margin + self.db.buffsBuffsIconSize
 | 
					 | 
				
			||||||
        height = height + self.db.buffsBuffsIconSize * teamSize
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
    if self.db.buffsCooldownPos == "TOP" and self.db.cooldownYPos == "TOP" and self.db.cooldown and self.db.buffsEnabled then
 | 
					 | 
				
			||||||
        margin = margin + 1
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
    if self.db.buffsCooldownPos == "BOTTOM" and self.db.cooldownYPos == "BOTTOM" and self.db.cooldown and self.db.buffsEnabled then
 | 
					 | 
				
			||||||
        margin = margin + 1
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    -- Classicon
 | 
					 | 
				
			||||||
    width = width + iconSize
 | 
					 | 
				
			||||||
    extraBarWidth = extraBarWidth + iconSize
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    -- Trinket
 | 
					 | 
				
			||||||
    width = width + iconSize
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    self.frame:SetScale(self.db.frameScale)
 | 
					    self.frame:SetScale(self.db.frameScale)
 | 
				
			||||||
    self.frame:SetWidth(width)
 | 
					    self:PixelPerfectScale(false)
 | 
				
			||||||
 | 
					    self.frame:SetWidth(self.db.barWidth + highlightBorderSize)
 | 
				
			||||||
    self.frame:SetHeight(height)
 | 
					    self.frame:SetHeight(height)
 | 
				
			||||||
    --self.frame:SetBackdropColor(self.db.frameColor.r, self.db.frameColor.g, self.db.frameColor.b, self.db.frameColor.a)
 | 
					    self.frame:ClearAllPoints()
 | 
				
			||||||
 | 
					    self.frame.background:SetBackdropColor(Gladdy:SetColor(self.db.backgroundColor))
 | 
				
			||||||
    self.frame:ClearAllPoints()
 | 
					    self.frame:ClearAllPoints()
 | 
				
			||||||
    if (self.db.x == 0 and self.db.y == 0) then
 | 
					    if (self.db.x == 0 and self.db.y == 0) then
 | 
				
			||||||
        self.frame:SetPoint("CENTER")
 | 
					        self.frame:SetPoint("CENTER")
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        local scale = self.frame:GetEffectiveScale()
 | 
					        local scale = self.frame:GetEffectiveScale()
 | 
				
			||||||
        if (self.db.growUp) then
 | 
					        local growMiddle = self.db.growMiddle and teamSize > 0 and teamSize / 2 >= 1 and (teamSize - 1) * (singleFrameHeight / 2) or 0
 | 
				
			||||||
            self.frame:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", self.db.x / scale, self.db.y / scale)
 | 
					        if (self.db.growDirection == "TOP") then
 | 
				
			||||||
 | 
					            self.frame:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", self.db.x / scale, (self.db.y / scale) - growMiddle)
 | 
				
			||||||
 | 
					        elseif self.db.growDirection == "BOTTOM" then
 | 
				
			||||||
 | 
					            self.frame:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", self.db.x / scale, (self.db.y / scale) + growMiddle)
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
            self.frame:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", self.db.x / scale, self.db.y / scale)
 | 
					            self.frame:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", self.db.x / scale, (self.db.y / scale))
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    self.anchor:SetWidth(width)
 | 
					    --Anchor
 | 
				
			||||||
 | 
					    self.anchor:SetWidth(self.db.barWidth * 2 + highlightBorderSize)
 | 
				
			||||||
    self.anchor:ClearAllPoints()
 | 
					    self.anchor:ClearAllPoints()
 | 
				
			||||||
    if (self.db.growUp) then
 | 
					    if (self.db.growDirection == "TOP") then
 | 
				
			||||||
        self.anchor:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT")
 | 
					        self.anchor:SetPoint("TOP", self.frame, "BOTTOM")
 | 
				
			||||||
 | 
					    elseif self.growDirection == "BOTTOM" or self.growDirection == "RIGHT" then
 | 
				
			||||||
 | 
					        self.anchor:SetPoint("BOTTOM", self.frame, "TOP")
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        self.anchor:SetPoint("BOTTOMLEFT", self.frame, "TOPLEFT")
 | 
					        self.anchor:SetPoint("BOTTOM", self.frame, "TOP")
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (self.db.locked) then
 | 
					    if (self.db.locked) then
 | 
				
			||||||
        self.anchor:Hide()
 | 
					        self.anchor:Hide()
 | 
				
			||||||
        self.anchor:Hide()
 | 
					 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        self.anchor:Show()
 | 
					        self.anchor:Show()
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for i = 1, teamSize do
 | 
					    for i = 1, teamSize do
 | 
				
			||||||
        local button = self.buttons["arena" .. i]
 | 
					        local button = self.buttons["arena" .. i]
 | 
				
			||||||
        button:SetWidth(self.db.barWidth + extraBarWidth)
 | 
					        button:SetWidth(self.db.barWidth)
 | 
				
			||||||
        button:SetHeight(self.db.healthBarHeight)
 | 
					        button:SetHeight(self.db.healthBarHeight)
 | 
				
			||||||
        button.secure:SetWidth(self.db.barWidth + extraBarWidth)
 | 
					        button.secure:SetWidth(self.db.barWidth)
 | 
				
			||||||
        button.secure:SetHeight(self.db.healthBarHeight + extraBarHeight)
 | 
					        button.secure:SetHeight(self.db.healthBarHeight + powerBarHeight)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        button:ClearAllPoints()
 | 
					        button:ClearAllPoints()
 | 
				
			||||||
        button.secure:ClearAllPoints()
 | 
					        button.secure:ClearAllPoints()
 | 
				
			||||||
        if (self.db.growUp) then
 | 
					        if (self.db.growDirection == "TOP") then
 | 
				
			||||||
            if (i == 1) then
 | 
					            if (i == 1) then
 | 
				
			||||||
                button:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT", self.db.padding + 2, 0)
 | 
					                button:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT", 0, powerBarHeight)
 | 
				
			||||||
                button.secure:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT", self.db.padding + 2, 0)
 | 
					                button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
                button:SetPoint("BOTTOMLEFT", self.buttons["arena" .. (i - 1)], "TOPLEFT", 0, margin + self.db.bottomMargin)
 | 
					                button:SetPoint("BOTTOMLEFT", self.buttons["arena" .. (i - 1)], "TOPLEFT", 0, margin + self.db.bottomMargin)
 | 
				
			||||||
                button.secure:SetPoint("BOTTOMLEFT", self.buttons["arena" .. (i - 1)], "TOPLEFT", 0, margin + self.db.bottomMargin)
 | 
					                button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
 | 
				
			||||||
            end
 | 
					            end
 | 
				
			||||||
        else
 | 
					        elseif (self.db.growDirection == "BOTTOM") then
 | 
				
			||||||
            if (i == 1) then
 | 
					            if (i == 1) then
 | 
				
			||||||
                button:SetPoint("TOPLEFT", self.frame, "TOPLEFT", self.db.padding + 2, 0)
 | 
					                button:SetPoint("TOPLEFT", self.frame, "TOPLEFT", 0, 0)
 | 
				
			||||||
                button.secure:SetPoint("TOPLEFT", self.frame, "TOPLEFT", self.db.padding + 2, 0)
 | 
					                button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
                button:SetPoint("TOPLEFT", self.buttons["arena" .. (i - 1)], "BOTTOMLEFT", 0, -margin - self.db.bottomMargin)
 | 
					                button:SetPoint("TOPLEFT", self.buttons["arena" .. (i - 1)], "BOTTOMLEFT", 0, -margin - self.db.bottomMargin)
 | 
				
			||||||
                button.secure:SetPoint("TOPLEFT", self.buttons["arena" .. (i - 1)], "BOTTOMLEFT", 0, -margin - self.db.bottomMargin)
 | 
					                button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        elseif (self.db.growDirection == "LEFT") then
 | 
				
			||||||
 | 
					            if (i == 1) then
 | 
				
			||||||
 | 
					                button:SetPoint("TOPRIGHT", self.frame, "TOPRIGHT", -0, 0)
 | 
				
			||||||
 | 
					                button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					                button:SetPoint("TOPRIGHT", self.buttons["arena" .. (i - 1)], "TOPLEFT", - self.db.bottomMargin, 0)
 | 
				
			||||||
 | 
					                button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        elseif (self.db.growDirection == "RIGHT") then
 | 
				
			||||||
 | 
					            if (i == 1) then
 | 
				
			||||||
 | 
					                button:SetPoint("TOPLEFT", self.frame, "TOPLEFT", 0, 0)
 | 
				
			||||||
 | 
					                button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					                button:SetPoint("TOPLEFT", self.buttons["arena" .. (i - 1)], "TOPRIGHT", self.db.bottomMargin, 0)
 | 
				
			||||||
 | 
					                button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
 | 
				
			||||||
            end
 | 
					            end
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for k, v in self:IterModules() do
 | 
					        for _, v in self:IterModules() do
 | 
				
			||||||
            self:Call(v, "UpdateFrame", button.unit)
 | 
					            self:Call(v, "UpdateFrame", "arena" .. i)
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    for k, v in self:IterModules() do
 | 
					    for _, v in self:IterModules() do
 | 
				
			||||||
        self:Call(v, "UpdateFrameOnce")
 | 
					        self:Call(v, "UpdateFrameOnce")
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					    if Gladdy.db.hideBlizzard == "always" then
 | 
				
			||||||
 | 
					        Gladdy:BlizzArenaSetAlpha(0)
 | 
				
			||||||
 | 
					    elseif Gladdy.db.hideBlizzard == "arena" then
 | 
				
			||||||
 | 
					        if Gladdy.curBracket then
 | 
				
			||||||
 | 
					            Gladdy:BlizzArenaSetAlpha(0)
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            Gladdy:BlizzArenaSetAlpha(1)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    elseif Gladdy.db.hideBlizzard == "never" then
 | 
				
			||||||
 | 
					        Gladdy:BlizzArenaSetAlpha(1)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if (not Gladdy.db.newLayout) then
 | 
				
			||||||
 | 
					        Gladdy.db.newLayout = true
 | 
				
			||||||
 | 
					        --get margin
 | 
				
			||||||
 | 
					        local arena1Bottom
 | 
				
			||||||
 | 
					        local arena2Top
 | 
				
			||||||
 | 
					        if (self.db.growDirection == "BOTTOM") then
 | 
				
			||||||
 | 
					            arena1Bottom = self.buttons["arena1"].secure:GetBottom()
 | 
				
			||||||
 | 
					            arena2Top = self.buttons["arena2"].secure:GetTop()
 | 
				
			||||||
 | 
					        elseif (self.db.growDirection == "TOP") then
 | 
				
			||||||
 | 
					            arena1Bottom = self.buttons["arena1"].secure:GetTop()
 | 
				
			||||||
 | 
					            arena2Top = self.buttons["arena2"].secure:GetBottom()
 | 
				
			||||||
 | 
					        elseif (self.db.growDirection == "LEFT") then
 | 
				
			||||||
 | 
					            arena1Bottom = self.buttons["arena1"].secure:GetLeft()
 | 
				
			||||||
 | 
					            arena2Top = self.buttons["arena2"].secure:GetRight()
 | 
				
			||||||
 | 
					        elseif (self.db.growDirection == "RIGHT") then
 | 
				
			||||||
 | 
					            arena1Bottom = self.buttons["arena1"].secure:GetRight()
 | 
				
			||||||
 | 
					            arena2Top = self.buttons["arena2"].secure:GetLeft()
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        Gladdy.db.bottomMargin = math_abs(arena1Bottom - arena2Top)
 | 
				
			||||||
 | 
					        Gladdy:UpdateFrame()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Gladdy:HideFrame()
 | 
					function Gladdy:HideFrame()
 | 
				
			||||||
    if (self.frame) then
 | 
					    if (self.frame) then
 | 
				
			||||||
        self.frame:Hide()
 | 
					        if InCombatLockdown() then
 | 
				
			||||||
 | 
					            self.startTest = nil
 | 
				
			||||||
 | 
					            self.hideFrame = true
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            self:Reset()
 | 
				
			||||||
 | 
					            self.frame:Hide()
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.frame.testing = nil
 | 
					        self.frame.testing = nil
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Gladdy:ToggleFrame(i)
 | 
					function Gladdy:ToggleFrame(i)
 | 
				
			||||||
    self:Reset()
 | 
					    self:Reset()
 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (self.frame and self.frame:IsShown() and i == self.curBracket) then
 | 
					    if (self.frame and self.frame:IsShown() and i == self.curBracket) then
 | 
				
			||||||
 | 
					        self.frame.testing = nil
 | 
				
			||||||
        self:HideFrame()
 | 
					        self:HideFrame()
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        self.curBracket = i
 | 
					        self.curBracket = i
 | 
				
			||||||
@@ -238,6 +294,7 @@ function Gladdy:ToggleFrame(i)
 | 
				
			|||||||
        if (not self.frame) then
 | 
					        if (not self.frame) then
 | 
				
			||||||
            self:CreateFrame()
 | 
					            self:CreateFrame()
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
 | 
					        self.frame.testing = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for o = 1, self.curBracket do
 | 
					        for o = 1, self.curBracket do
 | 
				
			||||||
            local unit = "arena" .. o
 | 
					            local unit = "arena" .. o
 | 
				
			||||||
@@ -245,9 +302,17 @@ function Gladdy:ToggleFrame(i)
 | 
				
			|||||||
                self:CreateButton(o)
 | 
					                self:CreateButton(o)
 | 
				
			||||||
            end
 | 
					            end
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
 | 
					        self:Reset()
 | 
				
			||||||
 | 
					        self.curBracket = i
 | 
				
			||||||
        self:UpdateFrame()
 | 
					        self:UpdateFrame()
 | 
				
			||||||
        self:Test()
 | 
					        if InCombatLockdown() then
 | 
				
			||||||
        self.frame:Show()
 | 
					            Gladdy:Print("Gladdy frames show as soon as you leave combat")
 | 
				
			||||||
 | 
					            self.showFrame = true
 | 
				
			||||||
 | 
					            self.startTest = true
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            self:Test()
 | 
				
			||||||
 | 
					            self.frame:Show()
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -257,31 +322,238 @@ function Gladdy:CreateButton(i)
 | 
				
			|||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local button = CreateFrame("Frame", "GladdyButtonFrame" .. i, self.frame)
 | 
					    local button = CreateFrame("Frame", "GladdyButtonFrame" .. i, self.frame)
 | 
				
			||||||
    button:SetAlpha(0)
 | 
					    button:EnableMouse(false)
 | 
				
			||||||
 | 
					    --button:SetAlpha(0)
 | 
				
			||||||
 | 
					    --button.texture = button:CreateTexture(nil, "OVERLAY")
 | 
				
			||||||
 | 
					    --button.texture:SetAllPoints(button)
 | 
				
			||||||
 | 
					    --button.texture:SetTexture("Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local secure = CreateFrame("Button", "GladdyButton" .. i, button, "SecureActionButtonTemplate")
 | 
					    local secure = CreateFrame("Button", "GladdyButton" .. i, button, "SecureActionButtonTemplate, SecureHandlerEnterLeaveTemplate")
 | 
				
			||||||
    secure:RegisterForClicks("AnyUp")
 | 
					    secure:RegisterForClicks("AnyUp")
 | 
				
			||||||
    secure:RegisterForClicks("AnyUp")
 | 
					    secure:RegisterForClicks("AnyDown")
 | 
				
			||||||
    secure:SetAttribute("*type1", "target")
 | 
					
 | 
				
			||||||
    secure:SetAttribute("*type2", "focus")
 | 
					    secure:SetAttribute("target", "arena" .. i)
 | 
				
			||||||
 | 
					    secure:SetAttribute("focus", "arena" .. i)
 | 
				
			||||||
    secure:SetAttribute("unit", "arena" .. i)
 | 
					    secure:SetAttribute("unit", "arena" .. i)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    button:RegisterEvent("UNIT_NAME_UPDATE")
 | 
					    --[[
 | 
				
			||||||
    button:RegisterEvent("ARENA_OPPONENT_UPDATE")
 | 
					    secure:SetAttribute("target", i == 1 and "player" or "focus")
 | 
				
			||||||
    button:RegisterEvent("ARENA_COOLDOWNS_UPDATE")
 | 
					    secure:SetAttribute("focus", i == 1 and "player" or "focus")
 | 
				
			||||||
    button:RegisterEvent("ARENA_CROWD_CONTROL_SPELL_UPDATE")
 | 
					    secure:SetAttribute("unit", i == 1 and "player" or "focus")
 | 
				
			||||||
    button:RegisterUnitEvent("UNIT_CONNECTION", "arena" .. i)
 | 
					    --]]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    --secure.texture = secure:CreateTexture(nil, "OVERLAY")
 | 
				
			||||||
 | 
					    --secure.texture:SetAllPoints(secure)
 | 
				
			||||||
 | 
					    --secure.texture:SetTexture("Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    button.id = i
 | 
					    button.id = i
 | 
				
			||||||
 | 
					    --button.unit = i == 1 and "player" or "focus"
 | 
				
			||||||
    button.unit = "arena" .. i
 | 
					    button.unit = "arena" .. i
 | 
				
			||||||
    button.secure = secure
 | 
					    button.secure = secure
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    self:ResetButton(button.unit)
 | 
					    self:ResetButton("arena" .. i)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    self.buttons[button.unit] = button
 | 
					    self.buttons["arena" .. i] = button
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for k, v in self:IterModules() do
 | 
					    for _, v in self:IterModules() do
 | 
				
			||||||
        self:Call(v, "CreateFrame", button.unit)
 | 
					        self:Call(v, "CreateFrame", "arena" .. i)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					    self:ResetButton("arena" .. i)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Gladdy:SetPosition(frame, unit, xOffsetDB, yOffsetDB, newLayout, module)
 | 
				
			||||||
 | 
					    local button = self.buttons[unit]
 | 
				
			||||||
 | 
					    if not button or not frame or not xOffsetDB or not yOffsetDB then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (not newLayout) then
 | 
				
			||||||
 | 
					        --Gladdy:Debug("INFO", name, "old X/Y:", frame:GetCenter())
 | 
				
			||||||
 | 
					        local xOffset, yOffset = frame:GetLeft(), frame:GetTop()
 | 
				
			||||||
 | 
					        if not xOffset or not yOffset then
 | 
				
			||||||
 | 
					            xOffset = frame:GetCenter()-- - frame:GetWidth()/2
 | 
				
			||||||
 | 
					            yOffset = select(2, frame:GetCenter())-- + frame:GetHeight()/2
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        local x,y = button.healthBar:GetLeft(), button.healthBar:GetTop()
 | 
				
			||||||
 | 
					        local newXOffset = math_abs(x - xOffset) * (x > xOffset and -1 or 1)
 | 
				
			||||||
 | 
					        local newYOffset = math_abs(y - yOffset) * (y > yOffset and -1 or 1)
 | 
				
			||||||
 | 
					        frame:ClearAllPoints()
 | 
				
			||||||
 | 
					        frame:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT", newXOffset, newYOffset)
 | 
				
			||||||
 | 
					        --Gladdy:Debug("INFO", name, "new X/Y:", frame:GetCenter())
 | 
				
			||||||
 | 
					        if unit == "arena1" then
 | 
				
			||||||
 | 
					            Gladdy.db[xOffsetDB] = newXOffset
 | 
				
			||||||
 | 
					            Gladdy.db[yOffsetDB] = newYOffset
 | 
				
			||||||
 | 
					            LibStub("AceConfigRegistry-3.0"):NotifyChange("Gladdy")
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        frame:ClearAllPoints()
 | 
				
			||||||
 | 
					        frame:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT", Gladdy.db[xOffsetDB], Gladdy.db[yOffsetDB])
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if (self.newDefaults[module.name]) then
 | 
				
			||||||
 | 
					        for k,v in pairs(self.newDefaults[module.name]) do
 | 
				
			||||||
 | 
					            module.defaults[k] = v
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Gladdy:CreateMover(frame, xConfig, yConfig, name, points, width, height, xOffset, yOffset, activated)
 | 
				
			||||||
 | 
					    if not frame.mover then
 | 
				
			||||||
 | 
					        frame:EnableMouse(false)
 | 
				
			||||||
 | 
					        frame:SetMovable(true)
 | 
				
			||||||
 | 
					        frame.mover = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate")
 | 
				
			||||||
 | 
					        frame.mover:SetFrameStrata("TOOLTIP")
 | 
				
			||||||
 | 
					        frame.mover:SetPoint(points[1], frame, points[2], xOffset or 0, yOffset or 0)
 | 
				
			||||||
 | 
					        frame.mover:SetHeight(height or frame:GetHeight())
 | 
				
			||||||
 | 
					        frame.mover:SetWidth(width or frame:GetWidth())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        local backdrop = {
 | 
				
			||||||
 | 
					            bgFile = "Interface/Tooltips/UI-Tooltip-Background",
 | 
				
			||||||
 | 
					            edgeFile = "",
 | 
				
			||||||
 | 
					            tile = true, tileSize = 16, edgeSize = 10,
 | 
				
			||||||
 | 
					            insets = {left = 0, right = 0, top = 0, bottom = 0}
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        frame.mover:SetBackdrop(backdrop)
 | 
				
			||||||
 | 
					        frame.mover:SetBackdropColor(0,1,0,0.5)
 | 
				
			||||||
 | 
					        frame.mover.border = CreateFrame("Frame", nil, frame.mover, BackdropTemplateMixin and "BackdropTemplate")
 | 
				
			||||||
 | 
					        frame.mover.border:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "highlightBorderStyle"), edgeSize = 2 })
 | 
				
			||||||
 | 
					        frame.mover.border:SetAllPoints(frame.mover)
 | 
				
			||||||
 | 
					        frame.mover.border:SetBackdropBorderColor(0,1,0,1)
 | 
				
			||||||
 | 
					        frame.mover.border:SetFrameStrata("TOOLTIP")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        frame.mover.text = frame.mover.border:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
 | 
				
			||||||
 | 
					        frame.mover.text:SetText(name)
 | 
				
			||||||
 | 
					        frame.mover.text:SetPoint("CENTER")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        frame.mover:SetMovable(true)
 | 
				
			||||||
 | 
					        frame.mover:EnableMouse(true)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        frame.mover:SetScript("OnMouseDown", function(self)
 | 
				
			||||||
 | 
					            self.point = { frame:GetPoint() }
 | 
				
			||||||
 | 
					            self.start = { frame:GetCenter() }
 | 
				
			||||||
 | 
					            frame:StartMoving()
 | 
				
			||||||
 | 
					            self:StartMoving()
 | 
				
			||||||
 | 
					        end)
 | 
				
			||||||
 | 
					        frame.mover:SetScript("OnMouseUp", function(self)
 | 
				
			||||||
 | 
					            frame:StopMovingOrSizing()
 | 
				
			||||||
 | 
					            self:StopMovingOrSizing()
 | 
				
			||||||
 | 
					            self.stop = { frame:GetCenter() }
 | 
				
			||||||
 | 
					            local diffX = math_abs(self.start[1] - self.stop[1])
 | 
				
			||||||
 | 
					            diffX = self.start[1] > self.stop[1] and -diffX or diffX
 | 
				
			||||||
 | 
					            local diffY = math_abs(self.start[2] - self.stop[2])
 | 
				
			||||||
 | 
					            diffY = self.start[2] > self.stop[2] and -diffY or diffY
 | 
				
			||||||
 | 
					            frame:ClearAllPoints()
 | 
				
			||||||
 | 
					            frame:SetPoint(self.point[1], self.point[2], self.point[3], self.point[4] + diffX, self.point[5] + diffY)
 | 
				
			||||||
 | 
					            Gladdy.db[xConfig] = self.point[4] + diffX
 | 
				
			||||||
 | 
					            Gladdy.db[yConfig] = self.point[5] + diffY
 | 
				
			||||||
 | 
					            LibStub("AceConfigRegistry-3.0"):NotifyChange("Gladdy")
 | 
				
			||||||
 | 
					            Gladdy:UpdateFrame()
 | 
				
			||||||
 | 
					        end)
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        frame.mover:ClearAllPoints()
 | 
				
			||||||
 | 
					        frame.mover:SetPoint(points[1], frame, points[2], xOffset or 0, yOffset or 0)
 | 
				
			||||||
 | 
					        frame.mover:SetHeight(height or frame:GetHeight())
 | 
				
			||||||
 | 
					        frame.mover:SetWidth(width or frame:GetWidth())
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if self.frame and self.frame.testing and self.db.showMover then
 | 
				
			||||||
 | 
					        if (activated ~= nil and not Gladdy.db[activated]) then
 | 
				
			||||||
 | 
					            frame.mover:Hide()
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            frame.mover:Show()
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        frame.mover:Hide()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- LAGACY SUPPORT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Gladdy:LegacyPositioning(margin, height, teamSize)
 | 
				
			||||||
 | 
					    if not Gladdy.db.newLayout then
 | 
				
			||||||
 | 
					        for k,v in pairs(Gladdy.legacy) do
 | 
				
			||||||
 | 
					            if Gladdy.db[k] == nil then
 | 
				
			||||||
 | 
					                Gladdy:Debug("INFO", "Gladdy:LegacyPositioning write", k,v)
 | 
				
			||||||
 | 
					                Gladdy.db[k] = v
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					                Gladdy:Debug("INFO", "Gladdy:LegacyPositioning found", k,v)
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if (self.db.cooldownYPos == "TOP" or self.db.cooldownYPos == "BOTTOM") and self.db.cooldown then
 | 
				
			||||||
 | 
					            margin = margin + self.db.cooldownSize
 | 
				
			||||||
 | 
					            height = height + self.db.cooldownSize * (teamSize - 1)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if (self.db.buffsCooldownPos == "TOP" or self.db.buffsCooldownPos == "BOTTOM") and self.db.buffsEnabled then
 | 
				
			||||||
 | 
					            margin = margin + self.db.buffsIconSize
 | 
				
			||||||
 | 
					            height = height + self.db.buffsIconSize * (teamSize - 1)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if (self.db.buffsBuffsCooldownPos == "TOP" or self.db.buffsBuffsCooldownPos == "BOTTOM") and self.db.buffsEnabled then
 | 
				
			||||||
 | 
					            margin = margin + self.db.buffsBuffsIconSize
 | 
				
			||||||
 | 
					            height = height + self.db.buffsBuffsIconSize * (teamSize - 1)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if self.db.buffsCooldownPos == "TOP" and self.db.cooldownYPos == "TOP" and self.db.cooldown and self.db.buffsEnabled then
 | 
				
			||||||
 | 
					            margin = margin + 1
 | 
				
			||||||
 | 
					            height = height + (teamSize - 1)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if self.db.buffsCooldownPos == "BOTTOM" and self.db.cooldownYPos == "BOTTOM" and self.db.cooldown and self.db.buffsEnabled then
 | 
				
			||||||
 | 
					            margin = margin + 1
 | 
				
			||||||
 | 
					            height = height + (teamSize - 1)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    return margin, height
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Gladdy:PositionButton(button, i, leftSize, rightSize, powerBarHeight, margin)
 | 
				
			||||||
 | 
					    if (self.db.growDirection == "TOP") then
 | 
				
			||||||
 | 
					        if (i == 1) then
 | 
				
			||||||
 | 
					            button:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT", leftSize, powerBarHeight)
 | 
				
			||||||
 | 
					            button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            button:SetPoint("BOTTOMLEFT", self.buttons["arena" .. (i - 1)], "TOPLEFT", 0, margin + self.db.bottomMargin)
 | 
				
			||||||
 | 
					            button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    elseif (self.db.growDirection == "BOTTOM") then
 | 
				
			||||||
 | 
					        if (i == 1) then
 | 
				
			||||||
 | 
					            button:SetPoint("TOPLEFT", self.frame, "TOPLEFT", leftSize, 0)
 | 
				
			||||||
 | 
					            button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            button:SetPoint("TOPLEFT", self.buttons["arena" .. (i - 1)], "BOTTOMLEFT", 0, -margin - self.db.bottomMargin)
 | 
				
			||||||
 | 
					            button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    elseif (self.db.growDirection == "LEFT") then
 | 
				
			||||||
 | 
					        if (i == 1) then
 | 
				
			||||||
 | 
					            button:SetPoint("TOPRIGHT", self.frame, "TOPRIGHT", -rightSize, 0)
 | 
				
			||||||
 | 
					            button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            button:SetPoint("TOPRIGHT", self.buttons["arena" .. (i - 1)], "TOPLEFT", -rightSize - leftSize - self.db.bottomMargin, 0)
 | 
				
			||||||
 | 
					            button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    elseif (self.db.growDirection == "RIGHT") then
 | 
				
			||||||
 | 
					        if (i == 1) then
 | 
				
			||||||
 | 
					            button:SetPoint("TOPLEFT", self.frame, "TOPLEFT", leftSize, 0)
 | 
				
			||||||
 | 
					            button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            button:SetPoint("TOPLEFT", self.buttons["arena" .. (i - 1)], "TOPRIGHT", leftSize + rightSize + self.db.bottomMargin, 0)
 | 
				
			||||||
 | 
					            button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Gladdy:GetAnchor(unit, position)
 | 
				
			||||||
 | 
					    local anchor = "healthBar"
 | 
				
			||||||
 | 
					    if Gladdy.db.classIconPos == position then
 | 
				
			||||||
 | 
					        anchor = "classIcon"
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if Gladdy.db.trinketPos == position then
 | 
				
			||||||
 | 
					        anchor = "trinket"
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if anchor == Gladdy.db.racialAnchor and Gladdy.db.racialPos == position then
 | 
				
			||||||
 | 
					        anchor = "racial"
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    return Gladdy.buttons[unit][anchor]
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
							
								
								
									
										325
									
								
								Gladdy.lua
									
									
									
									
									
								
							
							
						
						
									
										325
									
								
								Gladdy.lua
									
									
									
									
									
								
							@@ -5,12 +5,21 @@ local select = select
 | 
				
			|||||||
local pairs = pairs
 | 
					local pairs = pairs
 | 
				
			||||||
local tinsert = table.insert
 | 
					local tinsert = table.insert
 | 
				
			||||||
local tsort = table.sort
 | 
					local tsort = table.sort
 | 
				
			||||||
 | 
					local str_lower = string.lower
 | 
				
			||||||
 | 
					local GetTime = GetTime
 | 
				
			||||||
 | 
					local GetPhysicalScreenSize = GetPhysicalScreenSize
 | 
				
			||||||
 | 
					local InCombatLockdown = InCombatLockdown
 | 
				
			||||||
local CreateFrame = CreateFrame
 | 
					local CreateFrame = CreateFrame
 | 
				
			||||||
local DEFAULT_CHAT_FRAME = DEFAULT_CHAT_FRAME
 | 
					local DEFAULT_CHAT_FRAME = DEFAULT_CHAT_FRAME
 | 
				
			||||||
local IsAddOnLoaded = IsAddOnLoaded
 | 
					local IsAddOnLoaded = IsAddOnLoaded
 | 
				
			||||||
local IsInInstance = IsInInstance
 | 
					 | 
				
			||||||
local GetBattlefieldStatus = GetBattlefieldStatus
 | 
					local GetBattlefieldStatus = GetBattlefieldStatus
 | 
				
			||||||
local IsActiveBattlefieldArena = IsActiveBattlefieldArena
 | 
					local IsActiveBattlefieldArena = IsActiveBattlefieldArena
 | 
				
			||||||
 | 
					local IsInInstance = IsInInstance
 | 
				
			||||||
 | 
					local GetNumArenaOpponents = GetNumArenaOpponents
 | 
				
			||||||
 | 
					local RELEASE_TYPES = { alpha = "Alpha", beta = "Beta", release = "Release"}
 | 
				
			||||||
 | 
					local PREFIX = "Gladdy v"
 | 
				
			||||||
 | 
					local VERSION_REGEX = PREFIX .. "(%d+%.%d+)%-(%a)"
 | 
				
			||||||
 | 
					local LibStub = LibStub
 | 
				
			||||||
 | 
					
 | 
				
			||||||
---------------------------
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -18,12 +27,17 @@ local IsActiveBattlefieldArena = IsActiveBattlefieldArena
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
---------------------------
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local MAJOR, MINOR = "Gladdy", 4
 | 
					local MAJOR, MINOR = "Gladdy", 8
 | 
				
			||||||
local Gladdy = LibStub:NewLibrary(MAJOR, MINOR)
 | 
					local Gladdy = LibStub:NewLibrary(MAJOR, MINOR)
 | 
				
			||||||
local L
 | 
					local L
 | 
				
			||||||
Gladdy.version_major = "TBC-Classic_v1"
 | 
					Gladdy.version_major_num = 2
 | 
				
			||||||
Gladdy.version_minor = "0.3-Beta"
 | 
					Gladdy.version_minor_num = 0.20
 | 
				
			||||||
Gladdy.version = Gladdy.version_major .. "." .. Gladdy.version_minor
 | 
					Gladdy.version_num = Gladdy.version_major_num + Gladdy.version_minor_num
 | 
				
			||||||
 | 
					Gladdy.version_releaseType = RELEASE_TYPES.beta
 | 
				
			||||||
 | 
					Gladdy.version = PREFIX .. string.format("%.2f", Gladdy.version_num) .. "-" .. Gladdy.version_releaseType
 | 
				
			||||||
 | 
					Gladdy.VERSION_REGEX = VERSION_REGEX
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Gladdy.debug = false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LibStub("AceTimer-3.0"):Embed(Gladdy)
 | 
					LibStub("AceTimer-3.0"):Embed(Gladdy)
 | 
				
			||||||
LibStub("AceComm-3.0"):Embed(Gladdy)
 | 
					LibStub("AceComm-3.0"):Embed(Gladdy)
 | 
				
			||||||
@@ -46,6 +60,17 @@ function Gladdy:Print(...)
 | 
				
			|||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Gladdy:Warn(...)
 | 
					function Gladdy:Warn(...)
 | 
				
			||||||
 | 
					    local text = "|cfff29f05Gladdy|r:"
 | 
				
			||||||
 | 
					    local val
 | 
				
			||||||
 | 
					    for i = 1, select("#", ...) do
 | 
				
			||||||
 | 
					        val = select(i, ...)
 | 
				
			||||||
 | 
					        if (type(val) == 'boolean') then val = val and "true" or false end
 | 
				
			||||||
 | 
					        text = text .. " " .. tostring(val)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    DEFAULT_CHAT_FRAME:AddMessage(text)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Gladdy:Error(...)
 | 
				
			||||||
    local text = "|cfffc0303Gladdy|r:"
 | 
					    local text = "|cfffc0303Gladdy|r:"
 | 
				
			||||||
    local val
 | 
					    local val
 | 
				
			||||||
    for i = 1, select("#", ...) do
 | 
					    for i = 1, select("#", ...) do
 | 
				
			||||||
@@ -56,13 +81,38 @@ function Gladdy:Warn(...)
 | 
				
			|||||||
    DEFAULT_CHAT_FRAME:AddMessage(text)
 | 
					    DEFAULT_CHAT_FRAME:AddMessage(text)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Gladdy:Debug(lvl, ...)
 | 
				
			||||||
 | 
					    if Gladdy.debug then
 | 
				
			||||||
 | 
					        if lvl == "INFO" then
 | 
				
			||||||
 | 
					            Gladdy:Print("[INFO]", ...)
 | 
				
			||||||
 | 
					        elseif lvl == "WARN" then
 | 
				
			||||||
 | 
					            Gladdy:Warn("[WARN]", ...)
 | 
				
			||||||
 | 
					        elseif lvl == "ERROR" then
 | 
				
			||||||
 | 
					            Gladdy:Error("[ERROR]", ...)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Gladdy.events = CreateFrame("Frame")
 | 
					Gladdy.events = CreateFrame("Frame")
 | 
				
			||||||
Gladdy.events.registered = {}
 | 
					Gladdy.events.registered = {}
 | 
				
			||||||
Gladdy.events:RegisterEvent("PLAYER_LOGIN")
 | 
					Gladdy.events:RegisterEvent("PLAYER_LOGIN")
 | 
				
			||||||
 | 
					Gladdy.events:RegisterEvent("PLAYER_LOGOUT")
 | 
				
			||||||
 | 
					Gladdy.events:RegisterEvent("CVAR_UPDATE")
 | 
				
			||||||
 | 
					hooksecurefunc("VideoOptionsFrameOkay_OnClick", function(self, button, down, apply)
 | 
				
			||||||
 | 
					    if (self:GetName() == "VideoOptionsFrameApply") then
 | 
				
			||||||
 | 
					        Gladdy:PixelPerfectScale(true)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end)
 | 
				
			||||||
Gladdy.events:SetScript("OnEvent", function(self, event, ...)
 | 
					Gladdy.events:SetScript("OnEvent", function(self, event, ...)
 | 
				
			||||||
    if (event == "PLAYER_LOGIN") then
 | 
					    if (event == "PLAYER_LOGIN") then
 | 
				
			||||||
        Gladdy:OnInitialize()
 | 
					        Gladdy:OnInitialize()
 | 
				
			||||||
        Gladdy:OnEnable()
 | 
					        Gladdy:OnEnable()
 | 
				
			||||||
 | 
					    elseif (event == "CVAR_UPDATE") then
 | 
				
			||||||
 | 
					        if (str_lower(select(1, ...)) == "uiscale") then
 | 
				
			||||||
 | 
					            Gladdy:PixelPerfectScale(true)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    elseif (event == "PLAYER_LOGOUT") then
 | 
				
			||||||
 | 
					        Gladdy:DeleteUnknownOptions(Gladdy.db, Gladdy.defaults.profile)
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        local func = self.registered[event]
 | 
					        local func = self.registered[event]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -125,8 +175,8 @@ function Gladdy:Call(module, func, ...)
 | 
				
			|||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
function Gladdy:SendMessage(message, ...)
 | 
					function Gladdy:SendMessage(message, ...)
 | 
				
			||||||
    for k, v in self:IterModules() do
 | 
					    for _, module in self:IterModules() do
 | 
				
			||||||
        self:Call(v, v.messages[message], ...)
 | 
					        self:Call(module, module.messages[message], ...)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -137,10 +187,32 @@ function Gladdy:NewModule(name, priority, defaults)
 | 
				
			|||||||
    module.defaults = defaults or {}
 | 
					    module.defaults = defaults or {}
 | 
				
			||||||
    module.messages = {}
 | 
					    module.messages = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    module.RegisterMessages = function(self, ...)
 | 
				
			||||||
 | 
					        for _,message in pairs({...}) do
 | 
				
			||||||
 | 
					            self.messages[message] = message
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    module.RegisterMessage = function(self, message, func)
 | 
					    module.RegisterMessage = function(self, message, func)
 | 
				
			||||||
        self.messages[message] = func or message
 | 
					        self.messages[message] = func or message
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    module.UnregisterMessage = function(self, message)
 | 
				
			||||||
 | 
					        self.messages[message] = nil
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    module.UnregisterMessages = function(self, ...)
 | 
				
			||||||
 | 
					        for _,message in pairs({...}) do
 | 
				
			||||||
 | 
					            self.messages[message] = nil
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    module.UnregisterAllMessages = function(self)
 | 
				
			||||||
 | 
					        for msg,_ in pairs(self.messages) do
 | 
				
			||||||
 | 
					            self.messages[msg] = nil
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    module.GetOptions = function()
 | 
					    module.GetOptions = function()
 | 
				
			||||||
        return nil
 | 
					        return nil
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
@@ -160,11 +232,47 @@ end
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
---------------------------
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Gladdy:DeleteUnknownOptions(tbl, refTbl, str)
 | 
				
			||||||
 | 
					    if str == nil then
 | 
				
			||||||
 | 
					        str = "Gladdy.db"
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    for k,v in pairs(tbl) do
 | 
				
			||||||
 | 
					        if refTbl[k] == nil then
 | 
				
			||||||
 | 
					            Gladdy:Debug("INFO", "SavedVariable deleted:", str .. "." .. k, "not found!")
 | 
				
			||||||
 | 
					            tbl[k] = nil
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            if type(v) ~= type(refTbl[k]) then
 | 
				
			||||||
 | 
					                Gladdy:Debug("INFO", "SavedVariable deleted:", str .. "." .. k, "type error!", "Expected", type(refTbl[k]), "but found", type(v))
 | 
				
			||||||
 | 
					                tbl[k] = nil
 | 
				
			||||||
 | 
					            elseif type(v) == "table" then
 | 
				
			||||||
 | 
					                Gladdy:DeleteUnknownOptions(v, refTbl[k], str .. "." .. k)
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Gladdy:PixelPerfectScale(update)
 | 
				
			||||||
 | 
					    local physicalWidth, physicalHeight = GetPhysicalScreenSize()
 | 
				
			||||||
 | 
					    local perfectUIScale = 768.0/physicalHeight--768/select(2, strsplit("x",({ GetScreenResolutions()})[GetCurrentResolution()]))
 | 
				
			||||||
 | 
					    if self.db and self.db.pixelPerfect and self.frame then
 | 
				
			||||||
 | 
					        self.frame:SetIgnoreParentScale(true)
 | 
				
			||||||
 | 
					        self.frame:SetScale(perfectUIScale)
 | 
				
			||||||
 | 
					        --local adaptiveScale = (GetCVar("useUiScale") == "1" and 1.0 + perfectUIScale - GetCVar("UIScale") or perfectUIScale)
 | 
				
			||||||
 | 
					        --self.frame:SetScale(adaptiveScale)
 | 
				
			||||||
 | 
					        if update then
 | 
				
			||||||
 | 
					            self:UpdateFrame()
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    elseif self.frame then
 | 
				
			||||||
 | 
					        self.frame:SetScale(self.db.frameScale)
 | 
				
			||||||
 | 
					        self.frame:SetIgnoreParentScale(false)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Gladdy:OnInitialize()
 | 
					function Gladdy:OnInitialize()
 | 
				
			||||||
    self.dbi = LibStub("AceDB-3.0"):New("GladdyXZ", self.defaults)
 | 
					    self.dbi = LibStub("AceDB-3.0"):New("GladdyXZ", self.defaults)
 | 
				
			||||||
    self.dbi.RegisterCallback(self, "OnProfileChanged", "OnProfileChanged")
 | 
					    self.dbi.RegisterCallback(self, "OnProfileChanged", "OnProfileChanged")
 | 
				
			||||||
    self.dbi.RegisterCallback(self, "OnProfileCopied", "OnProfileChanged")
 | 
					    self.dbi.RegisterCallback(self, "OnProfileCopied", "OnProfileChanged")
 | 
				
			||||||
    self.dbi.RegisterCallback(self, "OnProfileReset", "OnProfileChanged")
 | 
					    self.dbi.RegisterCallback(self, "OnProfileReset", "OnProfileReset")
 | 
				
			||||||
    self.db = self.dbi.profile
 | 
					    self.db = self.dbi.profile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    self.LSM = LibStub("LibSharedMedia-3.0")
 | 
					    self.LSM = LibStub("LibSharedMedia-3.0")
 | 
				
			||||||
@@ -172,18 +280,20 @@ function Gladdy:OnInitialize()
 | 
				
			|||||||
    self.LSM:Register("statusbar", "Smooth", "Interface\\AddOns\\Gladdy\\Images\\Smooth")
 | 
					    self.LSM:Register("statusbar", "Smooth", "Interface\\AddOns\\Gladdy\\Images\\Smooth")
 | 
				
			||||||
    self.LSM:Register("statusbar", "Minimalist", "Interface\\AddOns\\Gladdy\\Images\\Minimalist")
 | 
					    self.LSM:Register("statusbar", "Minimalist", "Interface\\AddOns\\Gladdy\\Images\\Minimalist")
 | 
				
			||||||
    self.LSM:Register("statusbar", "LiteStep", "Interface\\AddOns\\Gladdy\\Images\\LiteStep.tga")
 | 
					    self.LSM:Register("statusbar", "LiteStep", "Interface\\AddOns\\Gladdy\\Images\\LiteStep.tga")
 | 
				
			||||||
 | 
					    self.LSM:Register("statusbar", "Flat", "Interface\\AddOns\\Gladdy\\Images\\UI-StatusBar")
 | 
				
			||||||
    self.LSM:Register("border", "Gladdy Tooltip round", "Interface\\AddOns\\Gladdy\\Images\\UI-Tooltip-Border_round_selfmade")
 | 
					    self.LSM:Register("border", "Gladdy Tooltip round", "Interface\\AddOns\\Gladdy\\Images\\UI-Tooltip-Border_round_selfmade")
 | 
				
			||||||
    self.LSM:Register("border", "Gladdy Tooltip squared", "Interface\\AddOns\\Gladdy\\Images\\UI-Tooltip-Border_square_selfmade")
 | 
					    self.LSM:Register("border", "Gladdy Tooltip squared", "Interface\\AddOns\\Gladdy\\Images\\UI-Tooltip-Border_square_selfmade")
 | 
				
			||||||
    self.LSM:Register("font", "DorisPP", "Interface\\AddOns\\Gladdy\\Images\\DorisPP.TTF")
 | 
					    self.LSM:Register("font", "DorisPP", "Interface\\AddOns\\Gladdy\\Images\\DorisPP.TTF")
 | 
				
			||||||
 | 
					    self.LSM:Register("border", "Square Full White", "Interface\\AddOns\\Gladdy\\Images\\Square_FullWhite.tga")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    L = self.L
 | 
					    L = self.L
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    self.testData = {
 | 
					    self.testData = {
 | 
				
			||||||
        ["arena1"] = { name = "Swift", raceLoc = L["Tauren"], classLoc = L["Warrior"], class = "WARRIOR", health = 9635, healthMax = 14207, power = 76, powerMax = 100, powerType = 1, testSpec = L["Arms"], race = "Tauren" },
 | 
					        ["arena1"] = { name = "Swift", raceLoc = L["NightElf"], classLoc = L["Druid"], class = "DRUID", health = 67, healthMax = 100, power = 76, powerMax = 100, powerType = 1, testSpec = L["Restoration"], race = "NightElf" },
 | 
				
			||||||
        ["arena2"] = { name = "Vilden", raceLoc = L["Undead"], classLoc = L["Mage"], class = "MAGE", health = 10969, healthMax = 11023, power = 7833, powerMax = 10460, powerType = 0, testSpec = L["Frost"], race = "Scourge" },
 | 
					        ["arena2"] = { name = "Vilden", raceLoc = L["Undead"], classLoc = L["Mage"], class = "MAGE", health = 99, healthMax = 100, power = 7833, powerMax = 10460, powerType = 0, testSpec = L["Frost"], race = "Scourge" },
 | 
				
			||||||
        ["arena3"] = { name = "Krymu", raceLoc = L["Human"], classLoc = L["Rogue"], class = "ROGUE", health = 1592, healthMax = 11740, power = 45, powerMax = 110, powerType = 3, testSpec = L["Subtlety"], race = "Human" },
 | 
					        ["arena3"] = { name = "Krymu", raceLoc = L["Human"], classLoc = L["Rogue"], class = "ROGUE", health = 10, healthMax = 100, power = 45, powerMax = 110, powerType = 3, testSpec = L["Subtlety"], race = "Human" },
 | 
				
			||||||
        ["arena4"] = { name = "Talmon", raceLoc = L["Human"], classLoc = L["Warlock"], class = "WARLOCK", health = 10221, healthMax = 14960, power = 9855, powerMax = 9855, powerType = 0, testSpec = L["Demonology"], race = "Human" },
 | 
					        ["arena4"] = { name = "Talmon", raceLoc = L["Human"], classLoc = L["Warlock"], class = "WARLOCK", health = 40, healthMax = 100, power = 9855, powerMax = 9855, powerType = 0, testSpec = L["Demonology"], race = "Human" },
 | 
				
			||||||
        ["arena5"] = { name = "Hydra", raceLoc = L["Undead"], classLoc = L["Priest"], class = "PRIEST", health = 11960, healthMax = 11960, power = 2515, powerMax = 10240, powerType = 0, testSpec = L["Discipline"], race = "Human" },
 | 
					        ["arena5"] = { name = "Hydra", raceLoc = L["Undead"], classLoc = L["Priest"], class = "PRIEST", health = 70, healthMax = 100, power = 2515, powerMax = 10240, powerType = 0, testSpec = L["Discipline"], race = "Human" },
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    self.cooldownSpellIds = {}
 | 
					    self.cooldownSpellIds = {}
 | 
				
			||||||
@@ -194,25 +304,44 @@ function Gladdy:OnInitialize()
 | 
				
			|||||||
    self.guids = {}
 | 
					    self.guids = {}
 | 
				
			||||||
    self.curBracket = nil
 | 
					    self.curBracket = nil
 | 
				
			||||||
    self.curUnit = 1
 | 
					    self.curUnit = 1
 | 
				
			||||||
    self.lastInstance = nil
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    self:SetupOptions()
 | 
					    self:SetupOptions()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for k, v in self:IterModules() do
 | 
					    for _, module in self:IterModules() do
 | 
				
			||||||
        self:Call(v, "Initialize") -- B.E > A.E :D
 | 
					        self:Call(module, "Initialize") -- B.E > A.E :D
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					    if Gladdy.db.hideBlizzard == "always" then
 | 
				
			||||||
 | 
					        Gladdy:BlizzArenaSetAlpha(0)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if not self.db.newLayout then
 | 
				
			||||||
 | 
					        self:ToggleFrame(3)
 | 
				
			||||||
 | 
					        self:HideFrame()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Gladdy:OnProfileReset()
 | 
				
			||||||
 | 
					    self.db = self.dbi.profile
 | 
				
			||||||
 | 
					    Gladdy:Debug("INFO", "OnProfileReset")
 | 
				
			||||||
 | 
					    self:HideFrame()
 | 
				
			||||||
 | 
					    self:ToggleFrame(3)
 | 
				
			||||||
 | 
					    Gladdy.options.args.lock.name = Gladdy.db.locked and L["Unlock frame"] or L["Lock frame"]
 | 
				
			||||||
 | 
					    Gladdy.options.args.showMover.name = Gladdy.db.showMover and L["Hide Mover"] or L["Show Mover"]
 | 
				
			||||||
 | 
					    LibStub("AceConfigRegistry-3.0"):NotifyChange("Gladdy")
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Gladdy:OnProfileChanged()
 | 
					function Gladdy:OnProfileChanged()
 | 
				
			||||||
    self.db = self.dbi.profile
 | 
					    self.db = self.dbi.profile
 | 
				
			||||||
 | 
					 | 
				
			||||||
    self:HideFrame()
 | 
					    self:HideFrame()
 | 
				
			||||||
    self:ToggleFrame(3)
 | 
					    self:ToggleFrame(3)
 | 
				
			||||||
 | 
					    Gladdy.options.args.lock.name = Gladdy.db.locked and L["Unlock frame"] or L["Lock frame"]
 | 
				
			||||||
 | 
					    Gladdy.options.args.showMover.name = Gladdy.db.showMover and L["Hide Mover"] or L["Show Mover"]
 | 
				
			||||||
 | 
					    LibStub("AceConfigRegistry-3.0"):NotifyChange("Gladdy")
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Gladdy:OnEnable()
 | 
					function Gladdy:OnEnable()
 | 
				
			||||||
    self:RegisterEvent("UPDATE_BATTLEFIELD_STATUS")
 | 
					    self:RegisterEvent("UPDATE_BATTLEFIELD_STATUS")
 | 
				
			||||||
    self:RegisterEvent("PLAYER_ENTERING_WORLD")
 | 
					    self:RegisterEvent("PLAYER_ENTERING_WORLD")
 | 
				
			||||||
 | 
					    self:RegisterEvent("PLAYER_REGEN_ENABLED")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (IsAddOnLoaded("Clique")) then
 | 
					    if (IsAddOnLoaded("Clique")) then
 | 
				
			||||||
        for i = 1, 5 do
 | 
					        for i = 1, 5 do
 | 
				
			||||||
@@ -239,6 +368,7 @@ function Gladdy:OnEnable()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        self:HideFrame()
 | 
					        self:HideFrame()
 | 
				
			||||||
        self:ToggleFrame(3)
 | 
					        self:ToggleFrame(3)
 | 
				
			||||||
 | 
					        self.showConfig = true
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -258,23 +388,28 @@ end
 | 
				
			|||||||
---------------------------
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Gladdy:Test()
 | 
					function Gladdy:Test()
 | 
				
			||||||
    Gladdy.frame.testing = true
 | 
					    self.frame.testing = true
 | 
				
			||||||
    for i = 1, self.curBracket do
 | 
					    if self.curBracket then
 | 
				
			||||||
        local unit = "arena" .. i
 | 
					        for i = 1, self.curBracket do
 | 
				
			||||||
        if (not self.buttons[unit]) then
 | 
					            local unit = "arena" .. i
 | 
				
			||||||
            self:CreateButton(i)
 | 
					            if (not self.buttons[unit]) then
 | 
				
			||||||
        end
 | 
					                self:CreateButton(i)
 | 
				
			||||||
        local button = self.buttons[unit]
 | 
					            end
 | 
				
			||||||
 | 
					            local button = self.buttons[unit]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for k, v in pairs(self.testData[unit]) do
 | 
					            for k, v in pairs(self.testData[unit]) do
 | 
				
			||||||
            button[k] = v
 | 
					                button[k] = v
 | 
				
			||||||
        end
 | 
					            end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for k, v in self:IterModules() do
 | 
					            for _, module in self:IterModules() do
 | 
				
			||||||
            self:Call(v, "Test", unit)
 | 
					                self:Call(module, "Test", unit)
 | 
				
			||||||
        end
 | 
					            end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        button:SetAlpha(1)
 | 
					            button:SetAlpha(1)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        for _, module in self:IterModules() do
 | 
				
			||||||
 | 
					            self:Call(module, "TestOnce")
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -285,26 +420,44 @@ end
 | 
				
			|||||||
---------------------------
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Gladdy:PLAYER_ENTERING_WORLD()
 | 
					function Gladdy:PLAYER_ENTERING_WORLD()
 | 
				
			||||||
    local instance = select(2, IsInInstance())
 | 
					    if self.showConfig then
 | 
				
			||||||
    if (instance ~= "arena" and self.frame and self.frame:IsVisible() and not self.frame.testing) then
 | 
					        LibStub("AceConfigDialog-3.0"):Open("Gladdy", nil, LibStub("AceConfigDialog-3.0"):SelectGroup("Gladdy", "XiconProfiles"))
 | 
				
			||||||
 | 
					        self.showConfig = nil
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if (self.frame and self.frame:IsVisible()) then
 | 
				
			||||||
        self:Reset()
 | 
					        self:Reset()
 | 
				
			||||||
        self:HideFrame()
 | 
					        self:HideFrame()
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    if (instance == "arena") then
 | 
					 | 
				
			||||||
        self:Reset()
 | 
					 | 
				
			||||||
        self:HideFrame()
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
    self.lastInstance = instance
 | 
					 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Gladdy:UPDATE_BATTLEFIELD_STATUS(_, index)
 | 
					function Gladdy:UPDATE_BATTLEFIELD_STATUS(_, index)
 | 
				
			||||||
    local status, mapName, instanceID, levelRangeMin, levelRangeMax, teamSize, isRankedArena, suspendedQueue, bool, queueType = GetBattlefieldStatus(index)
 | 
					    local status, mapName, instanceID, levelRangeMin, levelRangeMax, teamSize, isRankedArena, suspendedQueue, bool, queueType = GetBattlefieldStatus(index)
 | 
				
			||||||
    if (status == "active" and teamSize > 0 and IsActiveBattlefieldArena()) then
 | 
					    local instanceType = select(2, IsInInstance())
 | 
				
			||||||
 | 
					    Gladdy:Debug("INFO", "UPDATE_BATTLEFIELD_STATUS", instanceType, status, teamSize)
 | 
				
			||||||
 | 
					    if ((instanceType == "arena" or GetNumArenaOpponents() > 0) and status == "active" and teamSize > 0) then
 | 
				
			||||||
        self.curBracket = teamSize
 | 
					        self.curBracket = teamSize
 | 
				
			||||||
        self:JoinedArena()
 | 
					        self:JoinedArena()
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Gladdy:PLAYER_REGEN_ENABLED()
 | 
				
			||||||
 | 
					    if self.showFrame then
 | 
				
			||||||
 | 
					        self:UpdateFrame()
 | 
				
			||||||
 | 
					        if self.startTest then
 | 
				
			||||||
 | 
					            self:Test()
 | 
				
			||||||
 | 
					            self.startTest = nil
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        self.frame:Show()
 | 
				
			||||||
 | 
					        self:SendMessage("JOINED_ARENA")
 | 
				
			||||||
 | 
					        self.showFrame = nil
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if self.hideFrame then
 | 
				
			||||||
 | 
					        self:Reset()
 | 
				
			||||||
 | 
					        self.frame:Hide()
 | 
				
			||||||
 | 
					        self.hideFrame = nil
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
---------------------------
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- RESET FUNCTIONS (ARENA LEAVE)
 | 
					-- RESET FUNCTIONS (ARENA LEAVE)
 | 
				
			||||||
@@ -313,7 +466,7 @@ end
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
function Gladdy:Reset()
 | 
					function Gladdy:Reset()
 | 
				
			||||||
    if type(self.guids) == "table" then
 | 
					    if type(self.guids) == "table" then
 | 
				
			||||||
        for k, v in pairs(self.guids) do
 | 
					        for k,_ in pairs(self.guids) do
 | 
				
			||||||
            self.guids[k] = nil
 | 
					            self.guids[k] = nil
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
@@ -321,13 +474,16 @@ function Gladdy:Reset()
 | 
				
			|||||||
    self.curBracket = nil
 | 
					    self.curBracket = nil
 | 
				
			||||||
    self.curUnit = 1
 | 
					    self.curUnit = 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for k1, v1 in self:IterModules() do
 | 
					    for _, module in self:IterModules() do
 | 
				
			||||||
        self:Call(v1, "Reset")
 | 
					        self:Call(module, "Reset")
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for unit in pairs(self.buttons) do
 | 
					    for unit in pairs(self.buttons) do
 | 
				
			||||||
        self:ResetUnit(unit)
 | 
					        self:ResetUnit(unit)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					    if Gladdy.db.hideBlizzard == "never" or Gladdy.db.hideBlizzard == "arena" then
 | 
				
			||||||
 | 
					        Gladdy:BlizzArenaSetAlpha(1)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Gladdy:ResetUnit(unit)
 | 
					function Gladdy:ResetUnit(unit)
 | 
				
			||||||
@@ -339,8 +495,8 @@ function Gladdy:ResetUnit(unit)
 | 
				
			|||||||
    button:SetAlpha(0)
 | 
					    button:SetAlpha(0)
 | 
				
			||||||
    self:ResetButton(unit)
 | 
					    self:ResetButton(unit)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for k2, v2 in self:IterModules() do
 | 
					    for _, module in self:IterModules() do
 | 
				
			||||||
        self:Call(v2, "ResetUnit", unit)
 | 
					        self:Call(module, "ResetUnit", unit)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -354,7 +510,7 @@ function Gladdy:ResetButton(unit)
 | 
				
			|||||||
            button[k1] = nil
 | 
					            button[k1] = nil
 | 
				
			||||||
        elseif (type(v1) == "number") then
 | 
					        elseif (type(v1) == "number") then
 | 
				
			||||||
            button[k1] = 0
 | 
					            button[k1] = 0
 | 
				
			||||||
        elseif (type(v1) == "array") then
 | 
					        elseif (type(v1) == "table") then
 | 
				
			||||||
            button[k1] = {}
 | 
					            button[k1] = {}
 | 
				
			||||||
        elseif (type(v1) == "boolean") then
 | 
					        elseif (type(v1) == "boolean") then
 | 
				
			||||||
            button[k1] = false
 | 
					            button[k1] = false
 | 
				
			||||||
@@ -379,10 +535,83 @@ function Gladdy:JoinedArena()
 | 
				
			|||||||
        end
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    self:SendMessage("JOINED_ARENA")
 | 
					    if InCombatLockdown() then
 | 
				
			||||||
    self:UpdateFrame()
 | 
					        Gladdy:Print("Gladdy frames show as soon as you leave combat")
 | 
				
			||||||
    self.frame:Show()
 | 
					        self.showFrame = true
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        self:UpdateFrame()
 | 
				
			||||||
 | 
					        self.frame:Show()
 | 
				
			||||||
 | 
					        self:SendMessage("JOINED_ARENA")
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
    for i=1, self.curBracket do
 | 
					    for i=1, self.curBracket do
 | 
				
			||||||
        self.buttons["arena" .. i]:SetAlpha(1)
 | 
					        self.buttons["arena" .. i]:SetAlpha(1)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					    if Gladdy.db.hideBlizzard == "arena" or Gladdy.db.hideBlizzard == "always" then
 | 
				
			||||||
 | 
					        Gladdy:BlizzArenaSetAlpha(0)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- BLIZZARD FRAMES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Gladdy:BlizzArenaSetAlpha(alpha)
 | 
				
			||||||
 | 
					    if IsAddOnLoaded("Blizzard_ArenaUI") then
 | 
				
			||||||
 | 
					        if (ArenaEnemyFrames) then
 | 
				
			||||||
 | 
					            ArenaEnemyFrames:SetAlpha(alpha)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if ArenaEnemyFrame1 then
 | 
				
			||||||
 | 
					            ArenaEnemyFrame1:SetAlpha(alpha)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if ArenaEnemyFrame1PetFrame then
 | 
				
			||||||
 | 
					            ArenaEnemyFrame1PetFrame:SetAlpha(alpha)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if ArenaEnemyFrame2 then
 | 
				
			||||||
 | 
					            ArenaEnemyFrame2:SetAlpha(alpha)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if ArenaEnemyFrame2PetFrame then
 | 
				
			||||||
 | 
					            ArenaEnemyFrame2PetFrame:SetAlpha(alpha)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if ArenaEnemyFrame3 then
 | 
				
			||||||
 | 
					            ArenaEnemyFrame3:SetAlpha(alpha)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if ArenaEnemyFrame3PetFrame then
 | 
				
			||||||
 | 
					            ArenaEnemyFrame3PetFrame:SetAlpha(alpha)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if ArenaEnemyFrame4 then
 | 
				
			||||||
 | 
					            ArenaEnemyFrame4:SetAlpha(alpha)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if ArenaEnemyFrame4PetFrame then
 | 
				
			||||||
 | 
					            ArenaEnemyFrame4PetFrame:SetAlpha(alpha)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if ArenaEnemyFrame5 then
 | 
				
			||||||
 | 
					            ArenaEnemyFrame5:SetAlpha(alpha)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if ArenaEnemyFrame5PetFrame then
 | 
				
			||||||
 | 
					            ArenaEnemyFrame5PetFrame:SetAlpha(alpha)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- FONT/STATUSBAR/BORDER
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local defaults = {["statusbar"] = "Smooth", ["border"] = "Gladdy Tooltip round", ["font"] = "DorisPP"}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local lastWarning = {}
 | 
				
			||||||
 | 
					function Gladdy:SMFetch(lsmType, key)
 | 
				
			||||||
 | 
					    local smMediaType = self.LSM:Fetch(lsmType, Gladdy.db[key])
 | 
				
			||||||
 | 
					    if (smMediaType == nil and Gladdy.db[key] ~= "None") then
 | 
				
			||||||
 | 
					        if not lastWarning[key] or GetTime() - lastWarning[key] > 120 then
 | 
				
			||||||
 | 
					            lastWarning[key] = GetTime()
 | 
				
			||||||
 | 
					            Gladdy:Warn("Could not find", "\"" .. lsmType .. "\" \"", Gladdy.db[key], " \" for", "\"" .. key .. "\"", "- setting it to", "\"" .. defaults[lsmType] .. "\"")
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        return self.LSM:Fetch(lsmType, defaults[lsmType])
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    return smMediaType
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
							
								
								
									
										39
									
								
								Gladdy.toc
									
									
									
									
									
								
							
							
						
						
									
										39
									
								
								Gladdy.toc
									
									
									
									
									
								
							@@ -1,35 +1,8 @@
 | 
				
			|||||||
## Interface: 20501
 | 
					## Title: Gladdy |cFFFF0000 game client not supported|r
 | 
				
			||||||
## Title: Gladdy - TBC
 | 
					## Version: 2.2-Beta
 | 
				
			||||||
## Version: 1.0.3-Beta
 | 
					## Notes: The most powerful arena AddOn for WoW Classic TBC/WotLK
 | 
				
			||||||
## Notes: The most powerful arena AddOn for WoW 2.5.1
 | 
					 | 
				
			||||||
## Author: XiconQoo, DnB_Junkee, Knall
 | 
					## Author: XiconQoo, DnB_Junkee, Knall
 | 
				
			||||||
## X-Email: contact me on discord Knall#1751
 | 
					## X-Email: contact me on discord Knall#1751
 | 
				
			||||||
## SavedVariables: GladdyXZ
 | 
					## X-Curse-Project-ID: 482332
 | 
				
			||||||
## OptionalDeps: SharedMedia, Blizzard_CombatLog, Blizzard_ArenaUI, Blizzard_CombatText
 | 
					## X-WoWI-ID: 26350
 | 
				
			||||||
 | 
					## Notes: Gladdy only supports Classic TBC and Classic WotLK.
 | 
				
			||||||
embeds.xml
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Gladdy.lua
 | 
					 | 
				
			||||||
Lang.lua
 | 
					 | 
				
			||||||
Frame.lua
 | 
					 | 
				
			||||||
Options.lua
 | 
					 | 
				
			||||||
Constants.lua
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Modules\Announcements.lua
 | 
					 | 
				
			||||||
Modules\Healthbar.lua
 | 
					 | 
				
			||||||
Modules\Powerbar.lua
 | 
					 | 
				
			||||||
Modules\Auras.lua
 | 
					 | 
				
			||||||
Modules\Castbar.lua
 | 
					 | 
				
			||||||
Modules\Classicon.lua
 | 
					 | 
				
			||||||
Modules\Diminishings.lua
 | 
					 | 
				
			||||||
Modules\Highlight.lua
 | 
					 | 
				
			||||||
Modules\TotemPlates.lua
 | 
					 | 
				
			||||||
Modules\Trinket.lua
 | 
					 | 
				
			||||||
Modules\Cooldowns.lua
 | 
					 | 
				
			||||||
Modules\ArenaCountDown.lua
 | 
					 | 
				
			||||||
Modules\BuffsDebuffs.lua
 | 
					 | 
				
			||||||
Modules\VersionCheck.lua
 | 
					 | 
				
			||||||
Modules\XiconProfiles.lua
 | 
					 | 
				
			||||||
Modules\Pets.lua
 | 
					 | 
				
			||||||
Modules\ExportImport.lua
 | 
					 | 
				
			||||||
EventListener.lua
 | 
					 | 
				
			||||||
							
								
								
									
										46
									
								
								Gladdy_BCC.toc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								Gladdy_BCC.toc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,46 @@
 | 
				
			|||||||
 | 
					## Interface: 20504
 | 
				
			||||||
 | 
					## Title: Gladdy - TBC
 | 
				
			||||||
 | 
					## Version: 2.2-Beta
 | 
				
			||||||
 | 
					## Notes: The most powerful arena AddOn for WoW 2.5.4
 | 
				
			||||||
 | 
					## Author: XiconQoo, DnB_Junkee, Knall
 | 
				
			||||||
 | 
					## X-Email: contact me on discord Knall#1751
 | 
				
			||||||
 | 
					## X-Curse-Project-ID: 482332
 | 
				
			||||||
 | 
					## X-WoWI-ID: 26350
 | 
				
			||||||
 | 
					## SavedVariables: GladdyXZ
 | 
				
			||||||
 | 
					## OptionalDeps: SharedMedia, Blizzard_CombatLog, Blizzard_ArenaUI, Blizzard_CombatText, Plater, Kui_Nameplates, NeatPlates, TidyPlates_ThreatPlates, Tukui, ElvUI
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					embeds.xml
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Gladdy.lua
 | 
				
			||||||
 | 
					Lang.lua
 | 
				
			||||||
 | 
					Frame.lua
 | 
				
			||||||
 | 
					Options.lua
 | 
				
			||||||
 | 
					Constants_shared.lua
 | 
				
			||||||
 | 
					Constants_BCC.lua
 | 
				
			||||||
 | 
					ImportStrings.lua
 | 
				
			||||||
 | 
					Util.lua
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Modules\Announcements.lua
 | 
				
			||||||
 | 
					Modules\Healthbar.lua
 | 
				
			||||||
 | 
					Modules\Powerbar.lua
 | 
				
			||||||
 | 
					Modules\Auras.lua
 | 
				
			||||||
 | 
					Modules\Castbar.lua
 | 
				
			||||||
 | 
					Modules\Classicon.lua
 | 
				
			||||||
 | 
					Modules\Clicks.lua
 | 
				
			||||||
 | 
					Modules\Diminishings.lua
 | 
				
			||||||
 | 
					Modules\Highlight.lua
 | 
				
			||||||
 | 
					Modules\TotemPlates.lua
 | 
				
			||||||
 | 
					Modules\TotemPulse.lua
 | 
				
			||||||
 | 
					Modules\Trinket.lua
 | 
				
			||||||
 | 
					Modules\Racial.lua
 | 
				
			||||||
 | 
					Modules\Cooldowns.lua
 | 
				
			||||||
 | 
					Modules\ArenaCountDown.lua
 | 
				
			||||||
 | 
					Modules\BuffsDebuffs.lua
 | 
				
			||||||
 | 
					Modules\VersionCheck.lua
 | 
				
			||||||
 | 
					Modules\XiconProfiles.lua
 | 
				
			||||||
 | 
					Modules\Pets.lua
 | 
				
			||||||
 | 
					Modules\ExportImport.lua
 | 
				
			||||||
 | 
					Modules\CombatIndicator.lua
 | 
				
			||||||
 | 
					Modules\RangeCheck.lua
 | 
				
			||||||
 | 
					Modules\ShadowsightTimer.lua
 | 
				
			||||||
 | 
					EventListener.lua
 | 
				
			||||||
							
								
								
									
										46
									
								
								Gladdy_Wrath.toc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								Gladdy_Wrath.toc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,46 @@
 | 
				
			|||||||
 | 
					## Interface: 30400
 | 
				
			||||||
 | 
					## Title: Gladdy - WotLK
 | 
				
			||||||
 | 
					## Version: 2.2-Beta
 | 
				
			||||||
 | 
					## Notes: The most powerful arena AddOn for WoW 3.4.0
 | 
				
			||||||
 | 
					## Author: XiconQoo, DnB_Junkee, Knall
 | 
				
			||||||
 | 
					## X-Email: contact me on discord Knall#1751
 | 
				
			||||||
 | 
					## X-Curse-Project-ID: 482332
 | 
				
			||||||
 | 
					## X-WoWI-ID: 26350
 | 
				
			||||||
 | 
					## SavedVariables: GladdyXZ
 | 
				
			||||||
 | 
					## OptionalDeps: SharedMedia, Blizzard_CombatLog, Blizzard_ArenaUI, Blizzard_CombatText, Plater, Kui_Nameplates, NeatPlates, TidyPlates_ThreatPlates, Tukui, ElvUI
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					embeds.xml
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Gladdy.lua
 | 
				
			||||||
 | 
					Lang.lua
 | 
				
			||||||
 | 
					Frame.lua
 | 
				
			||||||
 | 
					Options.lua
 | 
				
			||||||
 | 
					Constants_shared.lua
 | 
				
			||||||
 | 
					Constants_Wrath.lua
 | 
				
			||||||
 | 
					ImportStrings.lua
 | 
				
			||||||
 | 
					Util.lua
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Modules\Announcements.lua
 | 
				
			||||||
 | 
					Modules\Healthbar.lua
 | 
				
			||||||
 | 
					Modules\Powerbar.lua
 | 
				
			||||||
 | 
					Modules\Auras.lua
 | 
				
			||||||
 | 
					Modules\Castbar.lua
 | 
				
			||||||
 | 
					Modules\Classicon.lua
 | 
				
			||||||
 | 
					Modules\Clicks.lua
 | 
				
			||||||
 | 
					Modules\Diminishings.lua
 | 
				
			||||||
 | 
					Modules\Highlight.lua
 | 
				
			||||||
 | 
					Modules\TotemPlates.lua
 | 
				
			||||||
 | 
					Modules\TotemPulse.lua
 | 
				
			||||||
 | 
					Modules\Trinket.lua
 | 
				
			||||||
 | 
					Modules\Racial.lua
 | 
				
			||||||
 | 
					Modules\Cooldowns.lua
 | 
				
			||||||
 | 
					Modules\ArenaCountDown.lua
 | 
				
			||||||
 | 
					Modules\BuffsDebuffs.lua
 | 
				
			||||||
 | 
					Modules\VersionCheck.lua
 | 
				
			||||||
 | 
					Modules\XiconProfiles.lua
 | 
				
			||||||
 | 
					Modules\Pets.lua
 | 
				
			||||||
 | 
					Modules\ExportImport.lua
 | 
				
			||||||
 | 
					Modules\CombatIndicator.lua
 | 
				
			||||||
 | 
					Modules\RangeCheck.lua
 | 
				
			||||||
 | 
					Modules\ShadowsightTimer.lua
 | 
				
			||||||
 | 
					EventListener.lua
 | 
				
			||||||
							
								
								
									
										
											BIN
										
									
								
								Images/BasicProfiles/Blizz1.blp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Images/BasicProfiles/Blizz1.blp
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Images/BasicProfiles/Classic2.blp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Images/BasicProfiles/Classic2.blp
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Images/BasicProfiles/Mir1.blp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Images/BasicProfiles/Mir1.blp
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Images/BasicProfiles/Mir1_edited.blp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Images/BasicProfiles/Mir1_edited.blp
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Images/BasicProfiles/Rukk1.blp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Images/BasicProfiles/Rukk1.blp
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Images/Countdown/Alliance.blp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Images/Countdown/Alliance.blp
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Images/Countdown/Horde.blp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Images/Countdown/Horde.blp
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Images/Square_FullWhite.tga
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Images/Square_FullWhite.tga
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Images/UI-StatusBar.blp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Images/UI-StatusBar.blp
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Images/castbar-shield.blp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Images/castbar-shield.blp
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Images/downarrow.blp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Images/downarrow.blp
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Images/mask.blp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Images/mask.blp
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Images/trinket.blp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Images/trinket.blp
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Images/uparrow.blp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Images/uparrow.blp
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										33
									
								
								ImportStrings.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								ImportStrings.lua
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@@ -1,427 +0,0 @@
 | 
				
			|||||||
local major = "DRData-1.0"
 | 
					 | 
				
			||||||
local minor = tonumber(string.match("$Revision: 793$", "(%d+)") or 1)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
assert(LibStub, string.format("%s requires LibStub.", major))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local Data = LibStub:NewLibrary(major, minor)
 | 
					 | 
				
			||||||
if( not Data ) then return end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if( IS_WRATH_BUILD == nil ) then IS_WRATH_BUILD = (select(4, GetBuildInfo()) >= 30000) end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- How long before DR resets
 | 
					 | 
				
			||||||
Data.RESET_TIME = 18
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- List of spellID -> DR category
 | 
					 | 
				
			||||||
Data.spells = {
 | 
					 | 
				
			||||||
	--[[ DISORIENTS ]]--
 | 
					 | 
				
			||||||
	-- Maim
 | 
					 | 
				
			||||||
	[22570] = "disorient",
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	-- Sap
 | 
					 | 
				
			||||||
	[6770] = "disorient",
 | 
					 | 
				
			||||||
	[2070] = "disorient",
 | 
					 | 
				
			||||||
	[11297] = "disorient",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Gouge (Remove all except 1776 come WoTLK)
 | 
					 | 
				
			||||||
	[1776] = "disorient",
 | 
					 | 
				
			||||||
	[1777] = "disorient",
 | 
					 | 
				
			||||||
	[8629] = "disorient",
 | 
					 | 
				
			||||||
	[11285] = "disorient",
 | 
					 | 
				
			||||||
	[11286] = "disorient",
 | 
					 | 
				
			||||||
	[38764] = "disorient",
 | 
					 | 
				
			||||||
		
 | 
					 | 
				
			||||||
	-- Polymorph
 | 
					 | 
				
			||||||
	[118] = "disorient",
 | 
					 | 
				
			||||||
	[12824] = "disorient",
 | 
					 | 
				
			||||||
	[12825] = "disorient",
 | 
					 | 
				
			||||||
	[28272] = "disorient",
 | 
					 | 
				
			||||||
	[28271] = "disorient",
 | 
					 | 
				
			||||||
	[12826] = "disorient",
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	--[[ FEARS ]]--
 | 
					 | 
				
			||||||
	-- Fear (Warlock)
 | 
					 | 
				
			||||||
	[5782] = "fear",
 | 
					 | 
				
			||||||
	[6213] = "fear",
 | 
					 | 
				
			||||||
	[6215] = "fear",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Seduction (Pet)
 | 
					 | 
				
			||||||
	[6358] = "fear",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Howl of Terror
 | 
					 | 
				
			||||||
	[5484] = "fear",
 | 
					 | 
				
			||||||
	[17928] = "fear",
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	-- Psychic scream
 | 
					 | 
				
			||||||
	[8122] = "fear",
 | 
					 | 
				
			||||||
	[8124] = "fear",
 | 
					 | 
				
			||||||
	[10888] = "fear",
 | 
					 | 
				
			||||||
	[10890] = "fear",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Scare Beast
 | 
					 | 
				
			||||||
	[1513] = "fear",
 | 
					 | 
				
			||||||
	[14326] = "fear",
 | 
					 | 
				
			||||||
	[14327] = "fear",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Turn Evil
 | 
					 | 
				
			||||||
	[10326] = "fear",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Intimidating Shout
 | 
					 | 
				
			||||||
	[5246] = "fear",
 | 
					 | 
				
			||||||
			
 | 
					 | 
				
			||||||
	--[[ CONTROL STUNS ]]--
 | 
					 | 
				
			||||||
	-- Hammer of Justice
 | 
					 | 
				
			||||||
	[853] = "ctrlstun",
 | 
					 | 
				
			||||||
	[5588] = "ctrlstun",
 | 
					 | 
				
			||||||
	[5589] = "ctrlstun",
 | 
					 | 
				
			||||||
	[10308] = "ctrlstun",
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	-- Bash
 | 
					 | 
				
			||||||
	[5211] = "ctrlstun",
 | 
					 | 
				
			||||||
	[6798] = "ctrlstun",
 | 
					 | 
				
			||||||
	[8983] = "ctrlstun",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Pounce
 | 
					 | 
				
			||||||
	[9005] = "ctrlstun",
 | 
					 | 
				
			||||||
	[9823] = "ctrlstun",
 | 
					 | 
				
			||||||
	[9827] = "ctrlstun",
 | 
					 | 
				
			||||||
	[27006] = "ctrlstun",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Intimidation
 | 
					 | 
				
			||||||
	[19577] = "ctrlstun",
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	-- Charge
 | 
					 | 
				
			||||||
	[7922] = "ctrlstun",
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	-- Cheap Shot
 | 
					 | 
				
			||||||
	[1833] = "ctrlstun",
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	-- War Stomp
 | 
					 | 
				
			||||||
	[20549] = "ctrlstun",
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	-- Intercept
 | 
					 | 
				
			||||||
	[20253] = "ctrlstun",
 | 
					 | 
				
			||||||
	[20614] = "ctrlstun",
 | 
					 | 
				
			||||||
	[20615] = "ctrlstun",
 | 
					 | 
				
			||||||
	[25273] = "ctrlstun",
 | 
					 | 
				
			||||||
	[25274] = "ctrlstun",
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	-- Concussion Blow
 | 
					 | 
				
			||||||
	[12809] = "ctrlstun",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Shadowfury
 | 
					 | 
				
			||||||
	[30283] = "ctrlstun", 
 | 
					 | 
				
			||||||
	[30413] = "ctrlstun",
 | 
					 | 
				
			||||||
	[30414] = "ctrlstun",
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	-- Unstable Affliction (Silence)
 | 
					 | 
				
			||||||
	[43523] = "ua",
 | 
					 | 
				
			||||||
	[31117] = "ua",
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	-- Impact
 | 
					 | 
				
			||||||
	[12355] = "rndstun",
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	--[[ RANDOM STUNS ]]--
 | 
					 | 
				
			||||||
	-- Stoneclaw Stun
 | 
					 | 
				
			||||||
	[39796] = "rndstun",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Starfire Stun
 | 
					 | 
				
			||||||
	[16922] = "rndstun",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Mace Stun
 | 
					 | 
				
			||||||
	[5530] = "rndstun",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Stormherald/Deep Thunder
 | 
					 | 
				
			||||||
	[34510] = "rndstun",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Seal of Justice
 | 
					 | 
				
			||||||
	[20170] = "rndstun",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Blackout
 | 
					 | 
				
			||||||
	[15269] = "rndstun",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Revenge Stun
 | 
					 | 
				
			||||||
	[12798] = "rndstun",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	--[[ CYCLONE ]]--
 | 
					 | 
				
			||||||
	-- Blind
 | 
					 | 
				
			||||||
	[2094] = "cyclone",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Cyclone
 | 
					 | 
				
			||||||
	[33786] = "cyclone",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	--[[ ROOTS ]]--
 | 
					 | 
				
			||||||
	-- Freeze (Water Elemental)
 | 
					 | 
				
			||||||
	[33395] = "root",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Frost Nova
 | 
					 | 
				
			||||||
	[122] = "root",
 | 
					 | 
				
			||||||
	[865] = "root",
 | 
					 | 
				
			||||||
	[6131] = "root",
 | 
					 | 
				
			||||||
	[10230] = "root",
 | 
					 | 
				
			||||||
	[27088] = "root",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Entangling Roots
 | 
					 | 
				
			||||||
	[339] = "root",
 | 
					 | 
				
			||||||
	[1062] = "root",
 | 
					 | 
				
			||||||
	[5195] = "root",
 | 
					 | 
				
			||||||
	[5196] = "root",
 | 
					 | 
				
			||||||
	[9852] = "root",
 | 
					 | 
				
			||||||
	[9853] = "root",
 | 
					 | 
				
			||||||
	[26989] = "root",
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	--[[ RANDOM ROOTS ]]--
 | 
					 | 
				
			||||||
	-- Improved Hamstring
 | 
					 | 
				
			||||||
	[23694] = "rndroot",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Frostbite
 | 
					 | 
				
			||||||
	[12494] = "rndroot",
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	--[[ SLEEPS ]]--
 | 
					 | 
				
			||||||
	-- Hibernate
 | 
					 | 
				
			||||||
	[2637] = "sleep",
 | 
					 | 
				
			||||||
	[18657] = "sleep",
 | 
					 | 
				
			||||||
	[18658] = "sleep",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Wyvern Sting
 | 
					 | 
				
			||||||
	[19386] = "sleep",
 | 
					 | 
				
			||||||
	[24132] = "sleep",
 | 
					 | 
				
			||||||
	[24133] = "sleep",
 | 
					 | 
				
			||||||
	[27068] = "sleep",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	--[[ MISC ]]--
 | 
					 | 
				
			||||||
	-- Chastise (Maybe this shares DR with Imp HS?)
 | 
					 | 
				
			||||||
	[44041] = "root",
 | 
					 | 
				
			||||||
	[44043] = "root",
 | 
					 | 
				
			||||||
	[44044] = "root",
 | 
					 | 
				
			||||||
	[44045] = "root",
 | 
					 | 
				
			||||||
	[44046] = "root",
 | 
					 | 
				
			||||||
	[44047] = "root",
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	-- Dragon's Breath
 | 
					 | 
				
			||||||
	[31661] = "dragonsbreath", -- Dragon's Breath
 | 
					 | 
				
			||||||
	[33041] = "dragonsbreath", -- Dragon's Breath
 | 
					 | 
				
			||||||
	[33042] = "dragonsbreath", -- Dragon's Breath
 | 
					 | 
				
			||||||
	[33043] = "dragonsbreath", -- Dragon's Breath
 | 
					 | 
				
			||||||
	-- Repentance
 | 
					 | 
				
			||||||
	[20066] = "repentance",
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	-- Scatter Shot
 | 
					 | 
				
			||||||
	[19503] = "scatters",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Freezing Trap
 | 
					 | 
				
			||||||
	[3355] = "freezetrap",
 | 
					 | 
				
			||||||
	[14308] = "freezetrap",
 | 
					 | 
				
			||||||
	[14309] = "freezetrap",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Improved Conc Shot
 | 
					 | 
				
			||||||
	[19410] = "impconc",
 | 
					 | 
				
			||||||
	[22915] = "impconc",
 | 
					 | 
				
			||||||
	[28445] = "impconc",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Death Coil
 | 
					 | 
				
			||||||
	[6789] = "dc",
 | 
					 | 
				
			||||||
	[17925] = "dc",
 | 
					 | 
				
			||||||
	[17926] = "dc",
 | 
					 | 
				
			||||||
	[27223] = "dc",
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	-- Kidney Shot
 | 
					 | 
				
			||||||
	[408] = "ks",
 | 
					 | 
				
			||||||
	[8643] = "ks",
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Mind Control
 | 
					 | 
				
			||||||
	[605] = "charm",
 | 
					 | 
				
			||||||
	[10911] = "charm",
 | 
					 | 
				
			||||||
	[10912] = "charm",
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- Add WoTLK spells
 | 
					 | 
				
			||||||
if( IS_WRATH_BUILD ) then
 | 
					 | 
				
			||||||
	-- Death Coil
 | 
					 | 
				
			||||||
	Data.spells[47859] = "dc"
 | 
					 | 
				
			||||||
	Data.spells[47860] = "dc"
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Wyvern Sting
 | 
					 | 
				
			||||||
	Data.spells[49011] = "sleep"
 | 
					 | 
				
			||||||
	Data.spells[49012] = "sleep"
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Entangling Roots
 | 
					 | 
				
			||||||
	Data.spells[53308] = "root"
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Frost Nova
 | 
					 | 
				
			||||||
	Data.spells[42917] = "root"
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Intercept (Remove all except this one come WoTLK)
 | 
					 | 
				
			||||||
	Data.spells[20252] = "ctrlstun"
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Pounce
 | 
					 | 
				
			||||||
	Data.spells[49803] = "ctrlstun"
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Polymorph
 | 
					 | 
				
			||||||
	Data.spells[61305] = "disorient"
 | 
					 | 
				
			||||||
	Data.spells[61025] = "disorient"
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Sap
 | 
					 | 
				
			||||||
	Data.spells[51724] = "disorient"
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Maim
 | 
					 | 
				
			||||||
	Data.spells[49802] = "disorient"
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Hex (Guessing)
 | 
					 | 
				
			||||||
	Data.spells[51514] = "disorient"
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- DR Category names
 | 
					 | 
				
			||||||
Data.typeNames = {
 | 
					 | 
				
			||||||
	["disorient"] = "Disorients",
 | 
					 | 
				
			||||||
	["fear"] = "Fears",
 | 
					 | 
				
			||||||
	["ctrlstun"] = "Controlled Stuns",
 | 
					 | 
				
			||||||
	["rndstun"] = "Random Stuns",
 | 
					 | 
				
			||||||
	["cyclone"] = "Cyclone/Blind",
 | 
					 | 
				
			||||||
	["ks"] = "Kidney Shot",
 | 
					 | 
				
			||||||
	["chastise"] = "Chastise",
 | 
					 | 
				
			||||||
	["scatters"] = "Scatter Shot",
 | 
					 | 
				
			||||||
	["freezetrap"] = "Freeze Trap",
 | 
					 | 
				
			||||||
	["rndroot"]  = "Random Roots",
 | 
					 | 
				
			||||||
	["dc"] = "Death Coil",
 | 
					 | 
				
			||||||
	["sleep"] = "Sleep",
 | 
					 | 
				
			||||||
	["root"] = "Controlled Roots",
 | 
					 | 
				
			||||||
	["impconc"] = "Imp Concussive Shot",
 | 
					 | 
				
			||||||
	["charm"] = "Charms",
 | 
					 | 
				
			||||||
	["repentance"] = "Repentance",
 | 
					 | 
				
			||||||
	["dragonsbreath"] = "Dragon's Breath",
 | 
					 | 
				
			||||||
	["ua"] = "Unstable Affliction Silence",
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- Categories that have DR in PvE as well as PvP
 | 
					 | 
				
			||||||
Data.pveDRs = {
 | 
					 | 
				
			||||||
	["ks"] = true,
 | 
					 | 
				
			||||||
	["ctrlstun"] = true,
 | 
					 | 
				
			||||||
	["rndstun"] = true,
 | 
					 | 
				
			||||||
	["cyclone"] = true,
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- List of DRs
 | 
					 | 
				
			||||||
Data.categories = {}
 | 
					 | 
				
			||||||
for _, cat in pairs(Data.spells) do
 | 
					 | 
				
			||||||
	Data.categories[cat] = true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- Public APIs
 | 
					 | 
				
			||||||
-- Category name in something usable
 | 
					 | 
				
			||||||
function Data:GetCategoryName(cat)
 | 
					 | 
				
			||||||
	return cat and Data.typeNames[cat] or nil
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- Spell list
 | 
					 | 
				
			||||||
function Data:GetSpells()
 | 
					 | 
				
			||||||
	return Data.spells
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- Seconds before DR resets
 | 
					 | 
				
			||||||
function Data:GetResetTime()
 | 
					 | 
				
			||||||
	return Data.RESET_TIME
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- Get the category of the spellID
 | 
					 | 
				
			||||||
function Data:GetSpellCategory(spellID)
 | 
					 | 
				
			||||||
	return spellID and Data.spells[spellID] or nil
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- Does this category DR in PvE?
 | 
					 | 
				
			||||||
function Data:IsPVE(cat)
 | 
					 | 
				
			||||||
	return cat and Data.pveDRs[cat] or nil
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- List of categories
 | 
					 | 
				
			||||||
function Data:GetCategories()
 | 
					 | 
				
			||||||
	return Data.categories
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- Next DR, if it's 1.0, next is 0.50, if it's 0.50 next is 0.25 and such
 | 
					 | 
				
			||||||
function Data:NextDR(diminished)
 | 
					 | 
				
			||||||
	if( diminished == 1.0 ) then
 | 
					 | 
				
			||||||
		return 0.50
 | 
					 | 
				
			||||||
	elseif( diminished == 0.50 ) then
 | 
					 | 
				
			||||||
		return 0.25
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	return 0
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
--[[ EXAMPLES ]]--
 | 
					 | 
				
			||||||
--[[
 | 
					 | 
				
			||||||
	This is how you would track DR easily, you're welcome to do whatever you want with the below 4 functions.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	Does not include tracking for PvE, you'd need to hack that in yourself but it's not (too) hard.
 | 
					 | 
				
			||||||
]]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
--[[
 | 
					 | 
				
			||||||
local trackedPlayers = {}
 | 
					 | 
				
			||||||
local function debuffGained(spellID, destName, destGUID, isEnemy)
 | 
					 | 
				
			||||||
	if( not trackedPlayers[destGUID] ) then
 | 
					 | 
				
			||||||
		trackedPlayers[destGUID] = {}
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	-- See if we should reset it back to undiminished
 | 
					 | 
				
			||||||
	local drCat = DRData:GetSpellCae
 | 
					 | 
				
			||||||
	local tracked = trackedPlayers[destGUID][drCat]
 | 
					 | 
				
			||||||
	if( tracked and tracked.reset <= GetTime() ) then
 | 
					 | 
				
			||||||
		tracked.diminished = 1.0
 | 
					 | 
				
			||||||
	end	
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local function debuffFaded(spellID, destName, destGUID, isEnemy)
 | 
					 | 
				
			||||||
	local drCat = DRData:GetSpellCategory(spellID)
 | 
					 | 
				
			||||||
	if( not trackedPlayers[destGUID] ) then
 | 
					 | 
				
			||||||
		trackedPlayers[destGUID] = {}
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if( not trackedPlayers[destGUID][drCat] ) then
 | 
					 | 
				
			||||||
		trackedPlayers[destGUID][drCat] = { reset = 0, diminished = 1.0 }
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	local time = GetTime()
 | 
					 | 
				
			||||||
	local tracked = trackedPlayers[destGUID][drCat]
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	tracked.reset = time + DRData:GetResetTime()
 | 
					 | 
				
			||||||
	tracked.diminished = nextDR(tracked.diminished)
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local function resetDR(destGUID)
 | 
					 | 
				
			||||||
	-- Reset the tracked DRs for this person
 | 
					 | 
				
			||||||
	if( trackedPlayers[destGUID] ) then
 | 
					 | 
				
			||||||
		for cat in pairs(trackedPlayers[destGUID]) do
 | 
					 | 
				
			||||||
			trackedPlayers[destGUID][cat].reset = 0
 | 
					 | 
				
			||||||
			trackedPlayers[destGUID][cat].diminished = 1.0
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local COMBATLOG_OBJECT_TYPE_PLAYER = COMBATLOG_OBJECT_TYPE_PLAYER
 | 
					 | 
				
			||||||
local COMBATLOG_OBJECT_REACTION_HOSTILE = COMBATLOG_OBJECT_REACTION_HOSTILE
 | 
					 | 
				
			||||||
local COMBATLOG_OBJECT_CONTROL_PLAYER = COMBATLOG_OBJECT_CONTROL_PLAYER
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local eventRegistered = {["SPELL_AURA_APPLIED"] = true, ["SPELL_AURA_REMOVED"] = true, ["PARTY_KILL"] = true, ["UNIT_DIED"] = true}
 | 
					 | 
				
			||||||
local function COMBAT_LOG_EVENT_UNFILTERED(self, event, timestamp, eventType, sourceGUID, sourceName, sourceFlags, destGUID, destName, destFlags, spellID, spellName, spellSchool, auraType)
 | 
					 | 
				
			||||||
	if( not eventRegistered[eventType] or ( bit.band(destFlags, COMBATLOG_OBJECT_TYPE_PLAYER) ~= COMBATLOG_OBJECT_TYPE_PLAYER and bit.band(destFlags, COMBATLOG_OBJECT_CONTROL_PLAYER) ~= COMBATLOG_OBJECT_CONTROL_PLAYER ) ) then
 | 
					 | 
				
			||||||
		return
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Enemy gained a debuff
 | 
					 | 
				
			||||||
	if( eventType == "SPELL_AURA_APPLIED" ) then
 | 
					 | 
				
			||||||
		if( auraType == "DEBUFF" and Data.Spells[spellID] ) then
 | 
					 | 
				
			||||||
			debuffGained(spellID, destName, destGUID, (bit.band(destFlags, COMBATLOG_OBJECT_REACTION_HOSTILE) == COMBATLOG_OBJECT_REACTION_HOSTILE))
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	-- Buff or debuff faded from an enemy
 | 
					 | 
				
			||||||
	elseif( eventType == "SPELL_AURA_REMOVED" ) then
 | 
					 | 
				
			||||||
		if( auraType == "DEBUFF" and Data.Spells[spellID] ) then
 | 
					 | 
				
			||||||
			debuffFaded(spellID, destName, destGUID, (bit.band(destFlags, COMBATLOG_OBJECT_REACTION_HOSTILE) == COMBATLOG_OBJECT_REACTION_HOSTILE))
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		
 | 
					 | 
				
			||||||
	-- Don't use UNIT_DIED inside arenas due to accuracy issues, outside of arenas we don't care too much
 | 
					 | 
				
			||||||
	elseif( ( eventType == "UNIT_DIED" and select(2, IsInInstance()) ~= "arena" ) or eventType == "PARTY_KILL" ) then
 | 
					 | 
				
			||||||
		resetDR(destGUID)
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
]]
 | 
					 | 
				
			||||||
@@ -1,8 +0,0 @@
 | 
				
			|||||||
## Interface: 20400
 | 
					 | 
				
			||||||
## Title: Lib: Diminishing Returns Data-1.0
 | 
					 | 
				
			||||||
## Notes: DB of spellIDs -> DR category
 | 
					 | 
				
			||||||
## Author: Mayen
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
LibStub-1.0\LibStub-1.0.xml
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
DRData-1.0.xml
 | 
					 | 
				
			||||||
							
								
								
									
										400
									
								
								Libs/DRList-1.0/DRList-1.0.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										400
									
								
								Libs/DRList-1.0/DRList-1.0.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,400 @@
 | 
				
			|||||||
 | 
					--[[
 | 
				
			||||||
 | 
					Name: DRList-1.0
 | 
				
			||||||
 | 
					Description: Diminishing returns categorization. Fork of outdated DRData-1.0.
 | 
				
			||||||
 | 
					Website: https://github.com/wardz/DRList-1.0/
 | 
				
			||||||
 | 
					Documentation: https://wardz.github.io/DRList-1.0/
 | 
				
			||||||
 | 
					Dependencies: LibStub
 | 
				
			||||||
 | 
					License: MIT
 | 
				
			||||||
 | 
					]]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- DRList-1.0
 | 
				
			||||||
 | 
					-- @module DRList-1.0
 | 
				
			||||||
 | 
					local MAJOR, MINOR = "DRList-1.0", 40 -- Don't forget to change this in Spells.lua aswell!
 | 
				
			||||||
 | 
					local Lib = assert(LibStub, MAJOR .. " requires LibStub."):NewLibrary(MAJOR, MINOR)
 | 
				
			||||||
 | 
					if not Lib then return end -- already loaded
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-------------------------------------------------------------------------------
 | 
				
			||||||
 | 
					-- *** LOCALIZATIONS ARE AUTOMATICALLY GENERATED ***
 | 
				
			||||||
 | 
					-- Please see Curseforge localization page if you'd like to help translate.
 | 
				
			||||||
 | 
					-- https://www.curseforge.com/wow/addons/drlist-1-0/localization
 | 
				
			||||||
 | 
					local L = {}
 | 
				
			||||||
 | 
					Lib.L = L
 | 
				
			||||||
 | 
					L["DISARMS"] = "Disarms"
 | 
				
			||||||
 | 
					L["DISORIENTS"] = "Disorients"
 | 
				
			||||||
 | 
					L["INCAPACITATES"] = "Incapacitates"
 | 
				
			||||||
 | 
					L["KNOCKBACKS"] = "Knockbacks"
 | 
				
			||||||
 | 
					L["ROOTS"] = "Roots"
 | 
				
			||||||
 | 
					L["SILENCES"] = "Silences"
 | 
				
			||||||
 | 
					L["STUNS"] = "Stuns"
 | 
				
			||||||
 | 
					L["TAUNTS"] = "Taunts"
 | 
				
			||||||
 | 
					L["FEARS"] = "Fears"
 | 
				
			||||||
 | 
					L["RANDOM_ROOTS"] = "Random roots"
 | 
				
			||||||
 | 
					L["RANDOM_STUNS"] = "Random stuns"
 | 
				
			||||||
 | 
					L["OPENER_STUN"] = "Opener Stuns"
 | 
				
			||||||
 | 
					L["HORROR"] = "Horrors"
 | 
				
			||||||
 | 
					L["SCATTERS"] = "Scatters"
 | 
				
			||||||
 | 
					L["SLEEPS"] = GetSpellInfo(1090) or "Sleep"
 | 
				
			||||||
 | 
					L["MIND_CONTROL"] = GetSpellInfo(605) or "Mind Control"
 | 
				
			||||||
 | 
					L["FROST_SHOCK"] = GetSpellInfo(15089) or "Frost Shock"
 | 
				
			||||||
 | 
					L["KIDNEY_SHOT"] = GetSpellInfo(408) or "Kidney Shot"
 | 
				
			||||||
 | 
					L["DEATH_COIL"] = GetSpellInfo(28412) or "Death Coil"
 | 
				
			||||||
 | 
					L["UNSTABLE_AFFLICTION"] = GetSpellInfo(31117) or "Unstable Affliction"
 | 
				
			||||||
 | 
					L["CHASTISE"] = GetSpellInfo(44041) or "Chastise"
 | 
				
			||||||
 | 
					L["COUNTERATTACK"] = GetSpellInfo(19306) or "Counterattack"
 | 
				
			||||||
 | 
					L["CYCLONE"] = GetSpellInfo(33786) or "Cyclone"
 | 
				
			||||||
 | 
					L["BANISH"] = GetSpellInfo(710) or "Banish"
 | 
				
			||||||
 | 
					L["CHARGE"] = GetSpellInfo(100) or "Charge"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- luacheck: push ignore 542
 | 
				
			||||||
 | 
					local locale = GetLocale()
 | 
				
			||||||
 | 
					if locale == "deDE" then
 | 
				
			||||||
 | 
					    L["FEARS"] = "Furchteffekte"
 | 
				
			||||||
 | 
					    L["KNOCKBACKS"] = "Rückstoßeffekte"
 | 
				
			||||||
 | 
					    L["ROOTS"] = "Bewegungsunfähigkeitseffekte"
 | 
				
			||||||
 | 
					    L["SILENCES"] = "Stilleeffekte"
 | 
				
			||||||
 | 
					    L["STUNS"] = "Betäubungseffekte"
 | 
				
			||||||
 | 
					    L["TAUNTS"] = "Spotteffekte"
 | 
				
			||||||
 | 
					elseif locale == "frFR" then
 | 
				
			||||||
 | 
					    L["FEARS"] = "Peurs"
 | 
				
			||||||
 | 
					    L["KNOCKBACKS"] = "Projections"
 | 
				
			||||||
 | 
					    L["ROOTS"] = "Immobilisations"
 | 
				
			||||||
 | 
					    L["SILENCES"] = "Silences"
 | 
				
			||||||
 | 
					    L["STUNS"] = "Etourdissements"
 | 
				
			||||||
 | 
					    L["TAUNTS"] = "Provocations"
 | 
				
			||||||
 | 
					elseif locale == "itIT" then
 | 
				
			||||||
 | 
					    --@localization(locale="itIT", namespace="Categories", format="lua_additive_table", handle-unlocalized="ignore")@
 | 
				
			||||||
 | 
					elseif locale == "koKR" then
 | 
				
			||||||
 | 
					    L["DISORIENTS"] = "방향 감각 상실"
 | 
				
			||||||
 | 
					    L["INCAPACITATES"] = "행동 불가"
 | 
				
			||||||
 | 
					    L["KNOCKBACKS"] = "밀쳐내기"
 | 
				
			||||||
 | 
					    L["ROOTS"] = "이동 불가"
 | 
				
			||||||
 | 
					    L["SILENCES"] = "침묵"
 | 
				
			||||||
 | 
					    L["STUNS"] = "기절"
 | 
				
			||||||
 | 
					elseif locale == "ptBR" then
 | 
				
			||||||
 | 
					    --@localization(locale="ptBR", namespace="Categories", format="lua_additive_table", handle-unlocalized="ignore")@
 | 
				
			||||||
 | 
					elseif locale == "ruRU" then
 | 
				
			||||||
 | 
					    L["DISARMS"] = "Разоружение"
 | 
				
			||||||
 | 
					    L["DISORIENTS"] = "Дезориентация"
 | 
				
			||||||
 | 
					    L["FEARS"] = "Опасения"
 | 
				
			||||||
 | 
					    L["INCAPACITATES"] = "Паралич"
 | 
				
			||||||
 | 
					    L["KNOCKBACKS"] = "Отбрасывание"
 | 
				
			||||||
 | 
					    L["RANDOM_ROOTS"] = "Случайные корни"
 | 
				
			||||||
 | 
					    L["RANDOM_STUNS"] = "Случайные оглушения"
 | 
				
			||||||
 | 
					    L["ROOTS"] = "Сковывание"
 | 
				
			||||||
 | 
					    L["SILENCES"] = "Немота"
 | 
				
			||||||
 | 
					    L["STUNS"] = "Оглушение"
 | 
				
			||||||
 | 
					    L["TAUNTS"] = "Насмешки"
 | 
				
			||||||
 | 
					elseif locale == "esES" or locale == "esMX" then
 | 
				
			||||||
 | 
					    L["DISARMS"] = "Desarmar"
 | 
				
			||||||
 | 
					    L["DISORIENTS"] = "Desorientar"
 | 
				
			||||||
 | 
					    L["FEARS"] = "Miedos"
 | 
				
			||||||
 | 
					    L["INCAPACITATES"] = "Incapacitar"
 | 
				
			||||||
 | 
					    L["KNOCKBACKS"] = "Derribos"
 | 
				
			||||||
 | 
					    L["RANDOM_ROOTS"] = "Raíces aleatorias"
 | 
				
			||||||
 | 
					    L["RANDOM_STUNS"] = "Aturdir aleatorio"
 | 
				
			||||||
 | 
					    L["ROOTS"] = "Raíces"
 | 
				
			||||||
 | 
					    L["SILENCES"] = "Silencios"
 | 
				
			||||||
 | 
					    L["STUNS"] = "Aturdimientos"
 | 
				
			||||||
 | 
					    L["TAUNTS"] = "Provocaciones"
 | 
				
			||||||
 | 
					elseif locale == "zhCN" then
 | 
				
			||||||
 | 
					    L["DISARMS"] = "缴械"
 | 
				
			||||||
 | 
					    L["DISORIENTS"] = "迷惑"
 | 
				
			||||||
 | 
					    L["FEARS"] = "恐惧"
 | 
				
			||||||
 | 
					    L["INCAPACITATES"] = "瘫痪"
 | 
				
			||||||
 | 
					    L["KNOCKBACKS"] = "击退"
 | 
				
			||||||
 | 
					    L["RANDOM_ROOTS"] = "随机定身"
 | 
				
			||||||
 | 
					    L["RANDOM_STUNS"] = "随机眩晕"
 | 
				
			||||||
 | 
					    L["ROOTS"] = "定身"
 | 
				
			||||||
 | 
					    L["SILENCES"] = "沉默"
 | 
				
			||||||
 | 
					    L["STUNS"] = "昏迷"
 | 
				
			||||||
 | 
					    L["TAUNTS"] = "嘲讽"
 | 
				
			||||||
 | 
					elseif locale == "zhTW" then
 | 
				
			||||||
 | 
					    L["DISARMS"] = "繳械"
 | 
				
			||||||
 | 
					    L["DISORIENTS"] = "迷惑"
 | 
				
			||||||
 | 
					    L["FEARS"] = "恐懼"
 | 
				
			||||||
 | 
					    L["INCAPACITATES"] = "癱瘓"
 | 
				
			||||||
 | 
					    L["KNOCKBACKS"] = "擊退"
 | 
				
			||||||
 | 
					    L["RANDOM_ROOTS"] = "隨機定身"
 | 
				
			||||||
 | 
					    L["RANDOM_STUNS"] = "隨機昏迷"
 | 
				
			||||||
 | 
					    L["ROOTS"] = "定身"
 | 
				
			||||||
 | 
					    L["SILENCES"] = "沉默"
 | 
				
			||||||
 | 
					    L["STUNS"] = "昏迷"
 | 
				
			||||||
 | 
					    L["TAUNTS"] = "嘲諷"
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					-- luacheck: pop
 | 
				
			||||||
 | 
					-------------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Check what game version we're running
 | 
				
			||||||
 | 
					Lib.gameExpansion = ({
 | 
				
			||||||
 | 
					    [WOW_PROJECT_MAINLINE] = "retail",
 | 
				
			||||||
 | 
					    [WOW_PROJECT_CLASSIC] = "classic",
 | 
				
			||||||
 | 
					    [WOW_PROJECT_BURNING_CRUSADE_CLASSIC or 5] = "tbc",
 | 
				
			||||||
 | 
					})[WOW_PROJECT_ID]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local tocVersion = select(4, GetBuildInfo())
 | 
				
			||||||
 | 
					if tocVersion >= 30400 and tocVersion < 40000 then
 | 
				
			||||||
 | 
					    Lib.gameExpansion = "wotlk" -- temporary check for wotlk build until new constant is added
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- How long it takes for a DR to expire, in seconds.
 | 
				
			||||||
 | 
					Lib.resetTimes = {
 | 
				
			||||||
 | 
					    retail = {
 | 
				
			||||||
 | 
					        ["default"] = 18.5, -- 18 sec + 0.5 latency
 | 
				
			||||||
 | 
					        ["npc"] = 23, -- Against mobs it seems to last slightly longer, depending on server load
 | 
				
			||||||
 | 
					        ["knockback"] = 10, -- Knockbacks are immediately immune and only DRs for 10s
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    classic = {
 | 
				
			||||||
 | 
					        ["default"] = 19, -- dynamic between 15 and 20s
 | 
				
			||||||
 | 
					        ["npc"] = 23,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    tbc = {
 | 
				
			||||||
 | 
					        ["default"] = 19, -- dynamic between 15 and 20s
 | 
				
			||||||
 | 
					        ["npc"] = 23,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    wotlk = {
 | 
				
			||||||
 | 
					        ["default"] = 19,  -- dynamic between 15 and 20s
 | 
				
			||||||
 | 
					        ["npc"] = 23,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- List of all DR categories, english -> localized.
 | 
				
			||||||
 | 
					Lib.categoryNames = {
 | 
				
			||||||
 | 
					    retail = {
 | 
				
			||||||
 | 
					        ["disorient"] = L.DISORIENTS,
 | 
				
			||||||
 | 
					        ["incapacitate"] = L.INCAPACITATES,
 | 
				
			||||||
 | 
					        ["silence"] = L.SILENCES,
 | 
				
			||||||
 | 
					        ["stun"] = L.STUNS,
 | 
				
			||||||
 | 
					        ["root"] = L.ROOTS,
 | 
				
			||||||
 | 
					        ["disarm"] = L.DISARMS,
 | 
				
			||||||
 | 
					        ["taunt"] = L.TAUNTS,
 | 
				
			||||||
 | 
					        ["knockback"] = L.KNOCKBACKS,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    classic = {
 | 
				
			||||||
 | 
					        ["incapacitate"] = L.INCAPACITATES,
 | 
				
			||||||
 | 
					        ["stun"] = L.STUNS, -- controlled stun
 | 
				
			||||||
 | 
					        ["root"] = L.ROOTS, -- controlled root
 | 
				
			||||||
 | 
					        ["random_stun"] = L.RANDOM_STUNS, -- random proc stun, usually short (<3s)
 | 
				
			||||||
 | 
					        ["random_root"] = L.RANDOM_ROOTS,
 | 
				
			||||||
 | 
					        ["fear"] = L.FEARS,
 | 
				
			||||||
 | 
					        ["mind_control"] = L.MIND_CONTROL,
 | 
				
			||||||
 | 
					        ["frost_shock"] = L.FROST_SHOCK,
 | 
				
			||||||
 | 
					        ["kidney_shot"] = L.KIDNEY_SHOT,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    tbc = {
 | 
				
			||||||
 | 
					        ["disorient"] = L.DISORIENTS,
 | 
				
			||||||
 | 
					        ["incapacitate"] = L.INCAPACITATES,
 | 
				
			||||||
 | 
					        ["stun"] = L.STUNS,
 | 
				
			||||||
 | 
					        ["random_stun"] = L.RANDOM_STUNS,
 | 
				
			||||||
 | 
					        ["random_root"] = L.RANDOM_ROOTS,
 | 
				
			||||||
 | 
					        ["root"] = L.ROOTS,
 | 
				
			||||||
 | 
					        ["disarm"] = L.DISARMS,
 | 
				
			||||||
 | 
					        ["fear"] = L.FEARS,
 | 
				
			||||||
 | 
					        ["scatter"] = L.SCATTERS,
 | 
				
			||||||
 | 
					        ["mind_control"] = L.MIND_CONTROL,
 | 
				
			||||||
 | 
					        ["kidney_shot"] = L.KIDNEY_SHOT,
 | 
				
			||||||
 | 
					        ["death_coil"] = L.DEATH_COIL,
 | 
				
			||||||
 | 
					        ["unstable_affliction"] = L.UNSTABLE_AFFLICTION,
 | 
				
			||||||
 | 
					        ["chastise"] = L.CHASTISE,
 | 
				
			||||||
 | 
					        ["counterattack"] = L.COUNTERATTACK,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    wotlk = { -- WORK IN PROGRESS
 | 
				
			||||||
 | 
					        ["incapacitate"] = L.INCAPACITATES,
 | 
				
			||||||
 | 
					        ["stun"] = L.STUNS,
 | 
				
			||||||
 | 
					        ["random_stun"] = L.RANDOM_STUNS,
 | 
				
			||||||
 | 
					        ["random_root"] = L.RANDOM_ROOTS,
 | 
				
			||||||
 | 
					        ["root"] = L.ROOTS,
 | 
				
			||||||
 | 
					        ["disarm"] = L.DISARMS,
 | 
				
			||||||
 | 
					        ["fear"] = L.FEARS,
 | 
				
			||||||
 | 
					        ["scatter"] = L.SCATTERS,
 | 
				
			||||||
 | 
					        ["silence"] = L.SILENCES,
 | 
				
			||||||
 | 
					        ["horror"] = L.HORROR,
 | 
				
			||||||
 | 
					        ["mind_control"] = L.MIND_CONTROL,
 | 
				
			||||||
 | 
					        ["cyclone"] = L.CYCLONE,
 | 
				
			||||||
 | 
					        ["charge"] = L.CHARGE,
 | 
				
			||||||
 | 
					        ["opener_stun"] = L.OPENER_STUN,
 | 
				
			||||||
 | 
					        ["counterattack"] = L.COUNTERATTACK,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Categories that have DR against normal mobs.
 | 
				
			||||||
 | 
					-- Note that this is only for normal mobs on retail. Special mobs or pets have DR on all categories,
 | 
				
			||||||
 | 
					-- see UnitClassification() and UnitIsQuestBoss().
 | 
				
			||||||
 | 
					Lib.categoriesPvE = {
 | 
				
			||||||
 | 
					    retail = {
 | 
				
			||||||
 | 
					        ["taunt"] = L.TAUNTS, -- Lib.categoryNames.retail.taunt
 | 
				
			||||||
 | 
					        ["stun"] = L.STUNS,
 | 
				
			||||||
 | 
					        ["root"] = L.ROOTS,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    classic = {
 | 
				
			||||||
 | 
					        ["stun"] = L.STUNS,
 | 
				
			||||||
 | 
					        ["kidney_shot"] = L.KIDNEY_SHOT,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    tbc = {
 | 
				
			||||||
 | 
					        ["stun"] = L.STUNS,
 | 
				
			||||||
 | 
					        ["random_stun"] = L.RANDOM_STUNS,
 | 
				
			||||||
 | 
					        ["kidney_shot"] = L.KIDNEY_SHOT,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    wotlk = {
 | 
				
			||||||
 | 
					        --["taunt"] = L.TAUNTS,
 | 
				
			||||||
 | 
					        ["stun"] = L.STUNS,
 | 
				
			||||||
 | 
					        ["random_stun"] = L.RANDOM_STUNS,
 | 
				
			||||||
 | 
					        ["opener_stun"] = L.OPENER_STUN,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Successives diminished durations
 | 
				
			||||||
 | 
					Lib.diminishedDurations = {
 | 
				
			||||||
 | 
					    retail = {
 | 
				
			||||||
 | 
					        -- Decreases by 50%, immune at the 4th application
 | 
				
			||||||
 | 
					        ["default"] = { 0.50, 0.25 },
 | 
				
			||||||
 | 
					        -- Decreases by 35%, immune at the 5th application
 | 
				
			||||||
 | 
					        ["taunt"] = { 0.65, 0.42, 0.27 },
 | 
				
			||||||
 | 
					        -- Immediately immune
 | 
				
			||||||
 | 
					        ["knockback"] = {},
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    classic = {
 | 
				
			||||||
 | 
					        ["default"] = { 0.50, 0.25 },
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    tbc = {
 | 
				
			||||||
 | 
					        ["default"] = { 0.50, 0.25 },
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    wotlk = {
 | 
				
			||||||
 | 
					        ["default"] = { 0.50, 0.25 },
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-------------------------------------------------------------------------------
 | 
				
			||||||
 | 
					-- Public API
 | 
				
			||||||
 | 
					-------------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Get table of all spells that DRs.
 | 
				
			||||||
 | 
					-- Key is the spellID, and value is the unlocalized DR category.
 | 
				
			||||||
 | 
					-- For Classic the key is the localized spell name instead, and value
 | 
				
			||||||
 | 
					-- is a table containing both the DR category and spell ID. (Classic has no spellID payload in the combat log)
 | 
				
			||||||
 | 
					-- @see IterateSpellsByCategory
 | 
				
			||||||
 | 
					-- @treturn ?table {number=string}|table {string=table}
 | 
				
			||||||
 | 
					function Lib:GetSpells()
 | 
				
			||||||
 | 
					    return Lib.spellList
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Get table of all DR categories.
 | 
				
			||||||
 | 
					-- Key is unlocalized name used for API functions, value is localized name used for UI.
 | 
				
			||||||
 | 
					-- @treturn table {string=string}
 | 
				
			||||||
 | 
					function Lib:GetCategories()
 | 
				
			||||||
 | 
					    return Lib.categoryNames[Lib.gameExpansion]
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Get table of all categories that DRs in PvE only.
 | 
				
			||||||
 | 
					-- Key is unlocalized name used for API functions, value is localized name used for UI.
 | 
				
			||||||
 | 
					-- Note that this is only for normal mobs on retail. Special mobs or pets have DR on all categories,
 | 
				
			||||||
 | 
					-- see UnitClassification() and UnitIsQuestBoss().
 | 
				
			||||||
 | 
					-- Tip: you can combine :GetPvECategories() and :IterateSpellsByCategory() to get spellIDs only for PvE aswell.
 | 
				
			||||||
 | 
					-- @treturn table {string=string}
 | 
				
			||||||
 | 
					function Lib:GetPvECategories()
 | 
				
			||||||
 | 
					    return Lib.categoriesPvE[Lib.gameExpansion]
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Get constant for how long a DR lasts for a given category.
 | 
				
			||||||
 | 
					-- @tparam[opt="default"] string category Unlocalized category name, or "npc" for PvE timer.
 | 
				
			||||||
 | 
					-- @treturn number
 | 
				
			||||||
 | 
					function Lib:GetResetTime(category)
 | 
				
			||||||
 | 
					    return Lib.resetTimes[Lib.gameExpansion][category or "default"] or Lib.resetTimes[Lib.gameExpansion].default
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Get unlocalized DR category by spell ID.
 | 
				
			||||||
 | 
					-- For Classic (vanilla) you should pass in the spell name instead of ID.
 | 
				
			||||||
 | 
					-- For Classic you also get an optional second return value
 | 
				
			||||||
 | 
					-- which is the hardcoded spell ID of the spell name you passed in.
 | 
				
			||||||
 | 
					-- You should use this ID to query additional info from Blizzard API if needed, as
 | 
				
			||||||
 | 
					-- spell names only works for the player if they have the spell in their current spellbook.
 | 
				
			||||||
 | 
					-- @tparam number spellID
 | 
				
			||||||
 | 
					-- @treturn[1] string|nil The category name.
 | 
				
			||||||
 | 
					-- @treturn[2] number|nil The spell ID. (Classic only)
 | 
				
			||||||
 | 
					function Lib:GetCategoryBySpellID(spellID)
 | 
				
			||||||
 | 
					    if Lib.gameExpansion == "classic" then
 | 
				
			||||||
 | 
					        -- special case for classic as CLEU doesn't provide spellIDs
 | 
				
			||||||
 | 
					        local data = Lib.spellList[spellID]
 | 
				
			||||||
 | 
					        if not data then return end
 | 
				
			||||||
 | 
					        return data.category, data.spellID
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return Lib.spellList[spellID]
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Get localized category from unlocalized category name, case sensitive.
 | 
				
			||||||
 | 
					-- @tparam string category Unlocalized category name
 | 
				
			||||||
 | 
					-- @treturn ?string|nil The localized category name.
 | 
				
			||||||
 | 
					function Lib:GetCategoryLocalization(category)
 | 
				
			||||||
 | 
					    return Lib.categoryNames[Lib.gameExpansion][category]
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Check if a category has DR against mobs.
 | 
				
			||||||
 | 
					-- Note that this is only for normal mobs on retail. Special mobs or pets have DR on all categories,
 | 
				
			||||||
 | 
					-- see UnitClassification() and UnitIsQuestBoss().
 | 
				
			||||||
 | 
					-- @tparam string category Unlocalized category name
 | 
				
			||||||
 | 
					-- @treturn bool
 | 
				
			||||||
 | 
					function Lib:IsPvECategory(category)
 | 
				
			||||||
 | 
					    return Lib.categoriesPvE[Lib.gameExpansion][category] and true or false -- make sure bool is always returned here
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Get next successive diminished duration
 | 
				
			||||||
 | 
					-- @tparam number diminished How many times the DR has been applied so far
 | 
				
			||||||
 | 
					-- @tparam[opt="default"] string category Unlocalized category name
 | 
				
			||||||
 | 
					-- @usage local reduction = DRList:GetNextDR(1) -- returns 0.50, half duration on debuff
 | 
				
			||||||
 | 
					-- @treturn number DR percentage in decimals. Returns 0 if max DR is reached or arguments are invalid.
 | 
				
			||||||
 | 
					function Lib:GetNextDR(diminished, category)
 | 
				
			||||||
 | 
					    local durations = Lib.diminishedDurations[Lib.gameExpansion][category or "default"]
 | 
				
			||||||
 | 
					    if not durations and Lib.categoryNames[Lib.gameExpansion][category] then
 | 
				
			||||||
 | 
					        -- Redirect to default when "stun", "root" etc is passed
 | 
				
			||||||
 | 
					        durations = Lib.diminishedDurations[Lib.gameExpansion]["default"]
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return durations and durations[diminished] or 0
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					do
 | 
				
			||||||
 | 
					    local next = _G.next
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    local function CategoryIterator(category, index)
 | 
				
			||||||
 | 
					        local spellList, newCat = Lib.spellList
 | 
				
			||||||
 | 
					        repeat
 | 
				
			||||||
 | 
					            index, newCat = next(spellList, index)
 | 
				
			||||||
 | 
					            if index then
 | 
				
			||||||
 | 
					                if newCat == category or newCat.category == category then
 | 
				
			||||||
 | 
					                    return index, category
 | 
				
			||||||
 | 
					                end
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        until not index
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    --- Iterate through the spells of a given category.
 | 
				
			||||||
 | 
					    -- @tparam string category Unlocalized category name
 | 
				
			||||||
 | 
					    -- @usage for spellID in DRList:IterateSpellsByCategory("root") do print(spellID) end
 | 
				
			||||||
 | 
					    -- @warning Slow function, do not use for frequent combat related stuff unless you cache results.
 | 
				
			||||||
 | 
					    -- @return Iterator function
 | 
				
			||||||
 | 
					    function Lib:IterateSpellsByCategory(category)
 | 
				
			||||||
 | 
					        assert(Lib.categoryNames[Lib.gameExpansion][category], "invalid category")
 | 
				
			||||||
 | 
					        return CategoryIterator, category
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- keep same API as DRData-1.0 for easier transitions
 | 
				
			||||||
 | 
					Lib.GetCategoryName = Lib.GetCategoryLocalization
 | 
				
			||||||
 | 
					Lib.IsPVE = Lib.IsPvECategory
 | 
				
			||||||
 | 
					Lib.NextDR = Lib.GetNextDR
 | 
				
			||||||
 | 
					Lib.GetSpellCategory = Lib.GetCategoryBySpellID
 | 
				
			||||||
 | 
					Lib.IterateSpells = Lib.IterateSpellsByCategory
 | 
				
			||||||
 | 
					Lib.RESET_TIME = Lib.resetTimes[Lib.gameExpansion].default
 | 
				
			||||||
 | 
					Lib.pveDR = Lib.categoriesPvE
 | 
				
			||||||
							
								
								
									
										23
									
								
								Libs/DRList-1.0/DRList-1.0.toc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								Libs/DRList-1.0/DRList-1.0.toc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
				
			|||||||
 | 
					## Interface: 90205
 | 
				
			||||||
 | 
					## Interface-Classic: 11402
 | 
				
			||||||
 | 
					## Interface-BCC: 20504
 | 
				
			||||||
 | 
					## Interface-Wrath: 30400
 | 
				
			||||||
 | 
					## Title: Lib: DRList-1.0
 | 
				
			||||||
 | 
					## Version: @project-version@
 | 
				
			||||||
 | 
					## X-Category: Library
 | 
				
			||||||
 | 
					## X-License: MIT
 | 
				
			||||||
 | 
					## X-Curse-Project-ID: 315757
 | 
				
			||||||
 | 
					## X-Wago-ID: 9rN4BxKD
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#@no-lib-strip@
 | 
				
			||||||
 | 
					libs\LibStub\LibStub.lua
 | 
				
			||||||
 | 
					#@end-no-lib-strip@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					DRList-1.0.xml
 | 
				
			||||||
 | 
					#@do-not-package@
 | 
				
			||||||
 | 
					tests\engine.lua
 | 
				
			||||||
 | 
					tests\test-retail.lua
 | 
				
			||||||
 | 
					tests\test-classic.lua
 | 
				
			||||||
 | 
					tests\test-tbc.lua
 | 
				
			||||||
 | 
					tests\test-wotlk.lua
 | 
				
			||||||
 | 
					#@end-do-not-package@
 | 
				
			||||||
							
								
								
									
										4
									
								
								Libs/DRList-1.0/DRList-1.0.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								Libs/DRList-1.0/DRList-1.0.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
				
			|||||||
 | 
					<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
 | 
				
			||||||
 | 
					    <Script file="DRList-1.0.lua"/>
 | 
				
			||||||
 | 
					    <Script file="Spells.lua"/>
 | 
				
			||||||
 | 
					</Ui>
 | 
				
			||||||
							
								
								
									
										695
									
								
								Libs/DRList-1.0/Spells.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										695
									
								
								Libs/DRList-1.0/Spells.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,695 @@
 | 
				
			|||||||
 | 
					local Lib, version = LibStub("DRList-1.0")
 | 
				
			||||||
 | 
					if Lib.spellList and version >= 40 then return end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if Lib.gameExpansion == "retail" then
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    -- SpellID list for mainline aka retail WoW
 | 
				
			||||||
 | 
					    Lib.spellList = {
 | 
				
			||||||
 | 
					        [207167]  = "disorient",       -- Blinding Sleet
 | 
				
			||||||
 | 
					        [207685]  = "disorient",       -- Sigil of Misery
 | 
				
			||||||
 | 
					        [33786]   = "disorient",       -- Cyclone
 | 
				
			||||||
 | 
					        [1513]    = "disorient",       -- Scare Beast
 | 
				
			||||||
 | 
					        [31661]   = "disorient",       -- Dragon's Breath
 | 
				
			||||||
 | 
					        [198909]  = "disorient",       -- Song of Chi-ji
 | 
				
			||||||
 | 
					        [202274]  = "disorient",       -- Incendiary Brew
 | 
				
			||||||
 | 
					        [105421]  = "disorient",       -- Blinding Light
 | 
				
			||||||
 | 
					        [10326]   = "disorient",       -- Turn Evil
 | 
				
			||||||
 | 
					        [605]     = "disorient",       -- Mind Control
 | 
				
			||||||
 | 
					        [8122]    = "disorient",       -- Psychic Scream
 | 
				
			||||||
 | 
					        [226943]  = "disorient",       -- Mind Bomb
 | 
				
			||||||
 | 
					        [2094]    = "disorient",       -- Blind
 | 
				
			||||||
 | 
					        [118699]  = "disorient",       -- Fear
 | 
				
			||||||
 | 
					        [5484]    = "disorient",       -- Howl of Terror
 | 
				
			||||||
 | 
					        [261589]  = "disorient",       -- Seduction (Grimoire of Sacrifice)
 | 
				
			||||||
 | 
					        [6358]    = "disorient",       -- Seduction (Succubus)
 | 
				
			||||||
 | 
					        [5246]    = "disorient",       -- Intimidating Shout 1
 | 
				
			||||||
 | 
					        [316593]  = "disorient",       -- Intimidating Shout 2 (TODO: not sure which one is correct in 9.0.1)
 | 
				
			||||||
 | 
					        [316595]  = "disorient",       -- Intimidating Shout 3
 | 
				
			||||||
 | 
					        [331866]  = "disorient",       -- Agent of Chaos (Venthyr Covenant)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [217832]  = "incapacitate",    -- Imprison
 | 
				
			||||||
 | 
					        [221527]  = "incapacitate",    -- Imprison (Honor talent)
 | 
				
			||||||
 | 
					        [2637]    = "incapacitate",    -- Hibernate
 | 
				
			||||||
 | 
					        [99]      = "incapacitate",    -- Incapacitating Roar
 | 
				
			||||||
 | 
					        [3355]    = "incapacitate",    -- Freezing Trap
 | 
				
			||||||
 | 
					        [203337]  = "incapacitate",    -- Freezing Trap (Honor talent)
 | 
				
			||||||
 | 
					        [213691]  = "incapacitate",    -- Scatter Shot
 | 
				
			||||||
 | 
					        [118]     = "incapacitate",    -- Polymorph
 | 
				
			||||||
 | 
					        [28271]   = "incapacitate",    -- Polymorph (Turtle)
 | 
				
			||||||
 | 
					        [28272]   = "incapacitate",    -- Polymorph (Pig)
 | 
				
			||||||
 | 
					        [61025]   = "incapacitate",    -- Polymorph (Snake)
 | 
				
			||||||
 | 
					        [61305]   = "incapacitate",    -- Polymorph (Black Cat)
 | 
				
			||||||
 | 
					        [61780]   = "incapacitate",    -- Polymorph (Turkey)
 | 
				
			||||||
 | 
					        [61721]   = "incapacitate",    -- Polymorph (Rabbit)
 | 
				
			||||||
 | 
					        [126819]  = "incapacitate",    -- Polymorph (Porcupine)
 | 
				
			||||||
 | 
					        [161353]  = "incapacitate",    -- Polymorph (Polar Bear Cub)
 | 
				
			||||||
 | 
					        [161354]  = "incapacitate",    -- Polymorph (Monkey)
 | 
				
			||||||
 | 
					        [161355]  = "incapacitate",    -- Polymorph (Penguin)
 | 
				
			||||||
 | 
					        [161372]  = "incapacitate",    -- Polymorph (Peacock)
 | 
				
			||||||
 | 
					        [277787]  = "incapacitate",    -- Polymorph (Baby Direhorn)
 | 
				
			||||||
 | 
					        [277792]  = "incapacitate",    -- Polymorph (Bumblebee)
 | 
				
			||||||
 | 
					        [82691]   = "incapacitate",    -- Ring of Frost
 | 
				
			||||||
 | 
					        [115078]  = "incapacitate",    -- Paralysis
 | 
				
			||||||
 | 
					        [20066]   = "incapacitate",    -- Repentance
 | 
				
			||||||
 | 
					        [9484]    = "incapacitate",    -- Shackle Undead
 | 
				
			||||||
 | 
					        [200196]  = "incapacitate",    -- Holy Word: Chastise
 | 
				
			||||||
 | 
					        [1776]    = "incapacitate",    -- Gouge
 | 
				
			||||||
 | 
					        [6770]    = "incapacitate",    -- Sap
 | 
				
			||||||
 | 
					        [51514]   = "incapacitate",    -- Hex
 | 
				
			||||||
 | 
					        [196942]  = "incapacitate",    -- Hex (Voodoo Totem)
 | 
				
			||||||
 | 
					        [210873]  = "incapacitate",    -- Hex (Raptor)
 | 
				
			||||||
 | 
					        [211004]  = "incapacitate",    -- Hex (Spider)
 | 
				
			||||||
 | 
					        [211010]  = "incapacitate",    -- Hex (Snake)
 | 
				
			||||||
 | 
					        [211015]  = "incapacitate",    -- Hex (Cockroach)
 | 
				
			||||||
 | 
					        [269352]  = "incapacitate",    -- Hex (Skeletal Hatchling)
 | 
				
			||||||
 | 
					        [309328]  = "incapacitate",    -- Hex (Living Honey)
 | 
				
			||||||
 | 
					        [277778]  = "incapacitate",    -- Hex (Zandalari Tendonripper)
 | 
				
			||||||
 | 
					        [277784]  = "incapacitate",    -- Hex (Wicker Mongrel)
 | 
				
			||||||
 | 
					        [197214]  = "incapacitate",    -- Sundering
 | 
				
			||||||
 | 
					        [710]     = "incapacitate",    -- Banish
 | 
				
			||||||
 | 
					        [6789]    = "incapacitate",    -- Mortal Coil
 | 
				
			||||||
 | 
					        [107079]  = "incapacitate",    -- Quaking Palm (Pandaren racial)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [47476]   = "silence",         -- Strangulate
 | 
				
			||||||
 | 
					        [204490]  = "silence",         -- Sigil of Silence
 | 
				
			||||||
 | 
					--      [78675]   = "silence",         -- Solar Beam (doesn't seem to DR)
 | 
				
			||||||
 | 
					        [202933]  = "silence",         -- Spider Sting
 | 
				
			||||||
 | 
					        [356727]  = "silence",         -- Spider Venom
 | 
				
			||||||
 | 
					        [217824]  = "silence",         -- Shield of Virtue
 | 
				
			||||||
 | 
					        [15487]   = "silence",         -- Silence
 | 
				
			||||||
 | 
					        [1330]    = "silence",         -- Garrote
 | 
				
			||||||
 | 
					        [196364]  = "silence",         -- Unstable Affliction Silence Effect
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [210141]  = "stun",            -- Zombie Explosion
 | 
				
			||||||
 | 
					        [334693]  = "stun",            -- Absolute Zero (Breath of Sindragosa)
 | 
				
			||||||
 | 
					        [108194]  = "stun",            -- Asphyxiate (Unholy)
 | 
				
			||||||
 | 
					        [221562]  = "stun",            -- Asphyxiate (Blood)
 | 
				
			||||||
 | 
					        [91800]   = "stun",            -- Gnaw (Ghoul)
 | 
				
			||||||
 | 
					        [91797]   = "stun",            -- Monstrous Blow (Mutated Ghoul)
 | 
				
			||||||
 | 
					        [287254]  = "stun",            -- Dead of Winter
 | 
				
			||||||
 | 
					        [179057]  = "stun",            -- Chaos Nova
 | 
				
			||||||
 | 
					        [205630]  = "stun",            -- Illidan's Grasp (Primary effect)
 | 
				
			||||||
 | 
					        [208618]  = "stun",            -- Illidan's Grasp (Secondary effect)
 | 
				
			||||||
 | 
					        [211881]  = "stun",            -- Fel Eruption
 | 
				
			||||||
 | 
					        [200166]  = "stun",            -- Metamorphosis (PvE stun effect)
 | 
				
			||||||
 | 
					        [203123]  = "stun",            -- Maim
 | 
				
			||||||
 | 
					        [163505]  = "stun",            -- Rake (Prowl)
 | 
				
			||||||
 | 
					        [5211]    = "stun",            -- Mighty Bash
 | 
				
			||||||
 | 
					        [202244]  = "stun",            -- Overrun
 | 
				
			||||||
 | 
					        [325321]  = "stun",            -- Wild Hunt's Charge
 | 
				
			||||||
 | 
					        [357021]  = "stun",            -- Consecutive Concussion
 | 
				
			||||||
 | 
					        [24394]   = "stun",            -- Intimidation
 | 
				
			||||||
 | 
					        [119381]  = "stun",            -- Leg Sweep
 | 
				
			||||||
 | 
					        [202346]  = "stun",            -- Double Barrel
 | 
				
			||||||
 | 
					        [853]     = "stun",            -- Hammer of Justice
 | 
				
			||||||
 | 
					        [255941]  = "stun",            -- Wake of Ashes
 | 
				
			||||||
 | 
					        [64044]   = "stun",            -- Psychic Horror
 | 
				
			||||||
 | 
					        [200200]  = "stun",            -- Holy Word: Chastise Censure
 | 
				
			||||||
 | 
					        [1833]    = "stun",            -- Cheap Shot
 | 
				
			||||||
 | 
					        [408]     = "stun",            -- Kidney Shot
 | 
				
			||||||
 | 
					        [118905]  = "stun",            -- Static Charge (Capacitor Totem)
 | 
				
			||||||
 | 
					        [118345]  = "stun",            -- Pulverize (Primal Earth Elemental)
 | 
				
			||||||
 | 
					        [305485]  = "stun",            -- Lightning Lasso
 | 
				
			||||||
 | 
					        [89766]   = "stun",            -- Axe Toss
 | 
				
			||||||
 | 
					        [171017]  = "stun",            -- Meteor Strike (Infernal)
 | 
				
			||||||
 | 
					        [171018]  = "stun",            -- Meteor Strike (Abyssal)
 | 
				
			||||||
 | 
					        [30283]   = "stun",            -- Shadowfury
 | 
				
			||||||
 | 
					        [46968]   = "stun",            -- Shockwave
 | 
				
			||||||
 | 
					        [132168]  = "stun",            -- Shockwave (Protection)
 | 
				
			||||||
 | 
					        [145047]  = "stun",            -- Shockwave (Proving Grounds PvE)
 | 
				
			||||||
 | 
					        [132169]  = "stun",            -- Storm Bolt
 | 
				
			||||||
 | 
					        [199085]  = "stun",            -- Warpath
 | 
				
			||||||
 | 
					        [20549]   = "stun",            -- War Stomp (Tauren)
 | 
				
			||||||
 | 
					        [255723]  = "stun",            -- Bull Rush (Highmountain Tauren)
 | 
				
			||||||
 | 
					        [287712]  = "stun",            -- Haymaker (Kul Tiran)
 | 
				
			||||||
 | 
					        [332423]  = "stun",            -- Sparkling Driftglobe Core (Kyrian Covenant)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [204085]  = "root",            -- Deathchill (Chains of Ice)
 | 
				
			||||||
 | 
					        [233395]  = "root",            -- Deathchill (Remorseless Winter)
 | 
				
			||||||
 | 
					        [339]     = "root",            -- Entangling Roots
 | 
				
			||||||
 | 
					        [170855]  = "root",            -- Entangling Roots (Nature's Grasp)
 | 
				
			||||||
 | 
					        [102359]  = "root",            -- Mass Entanglement
 | 
				
			||||||
 | 
					        [117526]  = "root",            -- Binding Shot
 | 
				
			||||||
 | 
					        [162480]  = "root",            -- Steel Trap
 | 
				
			||||||
 | 
					        [273909]  = "root",            -- Steelclaw Trap
 | 
				
			||||||
 | 
					--      [190927]  = "root_harpoon",    -- Harpoon (TODO: confirm)
 | 
				
			||||||
 | 
					        [212638]  = "root",            -- Tracker's Net
 | 
				
			||||||
 | 
					        [201158]  = "root",            -- Super Sticky Tar
 | 
				
			||||||
 | 
					        [122]     = "root",            -- Frost Nova
 | 
				
			||||||
 | 
					        [33395]   = "root",            -- Freeze
 | 
				
			||||||
 | 
					        [198121]  = "root",            -- Frostbite
 | 
				
			||||||
 | 
					        [342375]  = "root",            -- Tormenting Backlash (Torghast PvE)
 | 
				
			||||||
 | 
					        [233582]  = "root",            -- Entrenched in Flame
 | 
				
			||||||
 | 
					        [116706]  = "root",            -- Disable
 | 
				
			||||||
 | 
					        [324382]  = "root",            -- Clash
 | 
				
			||||||
 | 
					        [64695]   = "root",            -- Earthgrab (Totem effect)
 | 
				
			||||||
 | 
					        [285515]  = "root",            -- Surge of Power
 | 
				
			||||||
 | 
					        [39965]   = "root",            -- Frost Grenade (Item)
 | 
				
			||||||
 | 
					        [75148]   = "root",            -- Embersilk Net (Item)
 | 
				
			||||||
 | 
					        [55536]   = "root",            -- Frostweave Net (Item)
 | 
				
			||||||
 | 
					        [268966]  = "root",            -- Hooked Deep Sea Net (Item)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [209749]  = "disarm",          -- Faerie Swarm (Balance Honor Talent)
 | 
				
			||||||
 | 
					        [207777]  = "disarm",          -- Dismantle
 | 
				
			||||||
 | 
					        [233759]  = "disarm",          -- Grapple Weapon
 | 
				
			||||||
 | 
					        [236077]  = "disarm",          -- Disarm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [56222]   = "taunt",           -- Dark Command
 | 
				
			||||||
 | 
					        [51399]   = "taunt",           -- Death Grip (Taunt Effect)
 | 
				
			||||||
 | 
					        [185245]  = "taunt",           -- Torment
 | 
				
			||||||
 | 
					        [6795]    = "taunt",           -- Growl (Druid)
 | 
				
			||||||
 | 
					        [2649]    = "taunt",           -- Growl (Hunter Pet) (TODO: confirm)
 | 
				
			||||||
 | 
					        [20736]   = "taunt",           -- Distracting Shot
 | 
				
			||||||
 | 
					        [116189]  = "taunt",           -- Provoke
 | 
				
			||||||
 | 
					        [118635]  = "taunt",           -- Provoke (Black Ox Statue)
 | 
				
			||||||
 | 
					        [196727]  = "taunt",           -- Provoke (Niuzao)
 | 
				
			||||||
 | 
					        [204079]  = "taunt",           -- Final Stand
 | 
				
			||||||
 | 
					        [62124]   = "taunt",           -- Hand of Reckoning
 | 
				
			||||||
 | 
					        [17735]   = "taunt",           -- Suffering (Voidwalker) (TODO: confirm)
 | 
				
			||||||
 | 
					        [355]     = "taunt",           -- Taunt
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        -- Experimental
 | 
				
			||||||
 | 
					        [108199]  = "knockback",        -- Gorefiend's Grasp
 | 
				
			||||||
 | 
					        [202249]  = "knockback",        -- Overrun
 | 
				
			||||||
 | 
					        [61391]   = "knockback",        -- Typhoon
 | 
				
			||||||
 | 
					        [102793]  = "knockback",        -- Ursol's Vortex
 | 
				
			||||||
 | 
					        [186387]  = "knockback",        -- Bursting Shot
 | 
				
			||||||
 | 
					        [236777]  = "knockback",        -- Hi-Explosive Trap
 | 
				
			||||||
 | 
					        [157981]  = "knockback",        -- Blast Wave
 | 
				
			||||||
 | 
					        [237371]  = "knockback",        -- Ring of Peace
 | 
				
			||||||
 | 
					        [204263]  = "knockback",        -- Shining Force
 | 
				
			||||||
 | 
					        [51490]   = "knockback",        -- Thunderstorm
 | 
				
			||||||
 | 
					--      [287712]  = "knockback",        -- Haywire (Kul'Tiran Racial)
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					elseif Lib.gameExpansion == "tbc" then
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    -- SpellID list for The Burning Crusade
 | 
				
			||||||
 | 
					    -- spellID for every rank is used over spell name to avoid name collisions, and faster lookups
 | 
				
			||||||
 | 
					    Lib.spellList = {
 | 
				
			||||||
 | 
					        [2637]  = "incapacitate", -- Hibernate (Rank 1)
 | 
				
			||||||
 | 
					        [18657] = "incapacitate", -- Hibernate (Rank 2)
 | 
				
			||||||
 | 
					        [18658] = "incapacitate", -- Hibernate (Rank 3)
 | 
				
			||||||
 | 
					        [22570] = "incapacitate", -- Maim
 | 
				
			||||||
 | 
					        [3355]  = "incapacitate", -- Freezing Trap Effect (Rank 1)
 | 
				
			||||||
 | 
					        [14308] = "incapacitate", -- Freezing Trap Effect (Rank 2)
 | 
				
			||||||
 | 
					        [14309] = "incapacitate", -- Freezing Trap Effect (Rank 3)
 | 
				
			||||||
 | 
					        [19386] = "incapacitate", -- Wyvern Sting (Rank 1)
 | 
				
			||||||
 | 
					        [24132] = "incapacitate", -- Wyvern Sting (Rank 2)
 | 
				
			||||||
 | 
					        [24133] = "incapacitate", -- Wyvern Sting (Rank 3)
 | 
				
			||||||
 | 
					        [27068] = "incapacitate", -- Wyvern Sting (Rank 4)
 | 
				
			||||||
 | 
					        [118]   = "incapacitate", -- Polymorph (Rank 1)
 | 
				
			||||||
 | 
					        [12824] = "incapacitate", -- Polymorph (Rank 2)
 | 
				
			||||||
 | 
					        [12825] = "incapacitate", -- Polymorph (Rank 3)
 | 
				
			||||||
 | 
					        [12826] = "incapacitate", -- Polymorph (Rank 4)
 | 
				
			||||||
 | 
					        [28271] = "incapacitate", -- Polymorph: Turtle
 | 
				
			||||||
 | 
					        [28272] = "incapacitate", -- Polymorph: Pig
 | 
				
			||||||
 | 
					        [20066] = "incapacitate", -- Repentance
 | 
				
			||||||
 | 
					        [6770]  = "incapacitate", -- Sap (Rank 1)
 | 
				
			||||||
 | 
					        [2070]  = "incapacitate", -- Sap (Rank 2)
 | 
				
			||||||
 | 
					        [11297] = "incapacitate", -- Sap (Rank 3)
 | 
				
			||||||
 | 
					        [1776]  = "incapacitate", -- Gouge (Rank 1)
 | 
				
			||||||
 | 
					        [1777]  = "incapacitate", -- Gouge (Rank 2)
 | 
				
			||||||
 | 
					        [8629]  = "incapacitate", -- Gouge (Rank 3)
 | 
				
			||||||
 | 
					        [11285] = "incapacitate", -- Gouge (Rank 4)
 | 
				
			||||||
 | 
					        [11286] = "incapacitate", -- Gouge (Rank 5)
 | 
				
			||||||
 | 
					        [38764] = "incapacitate", -- Gouge (Rank 6)
 | 
				
			||||||
 | 
					        [13327] = "incapacitate", -- Reckless Charge (Rocket Helmet)
 | 
				
			||||||
 | 
					        [4064]  = "incapacitate", -- Rough Copper Bomb
 | 
				
			||||||
 | 
					        [4065]  = "incapacitate", -- Large Copper Bomb
 | 
				
			||||||
 | 
					        [4066]  = "incapacitate", -- Small Bronze Bomb
 | 
				
			||||||
 | 
					        [4067]  = "incapacitate", -- Big Bronze Bomb
 | 
				
			||||||
 | 
					        [4068]  = "incapacitate", -- Iron Grenade
 | 
				
			||||||
 | 
					        [12421] = "incapacitate", -- Mithril Frag Bomb
 | 
				
			||||||
 | 
					        [4069]  = "incapacitate", -- Big Iron Bomb
 | 
				
			||||||
 | 
					        [12562] = "incapacitate", -- The Big One
 | 
				
			||||||
 | 
					        [12543] = "incapacitate", -- Hi-Explosive Bomb
 | 
				
			||||||
 | 
					        [19769] = "incapacitate", -- Thorium Grenade
 | 
				
			||||||
 | 
					        [19784] = "incapacitate", -- Dark Iron Bomb
 | 
				
			||||||
 | 
					        [30216] = "incapacitate", -- Fel Iron Bomb
 | 
				
			||||||
 | 
					        [30461] = "incapacitate", -- The Bigger One
 | 
				
			||||||
 | 
					        [30217] = "incapacitate", -- Adamantite Grenade
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [33786] = "disorient", -- Cyclone
 | 
				
			||||||
 | 
					        [2094]  = "disorient", -- Blind
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [5211]  = "stun", -- Bash (Rank 1)
 | 
				
			||||||
 | 
					        [6798]  = "stun", -- Bash (Rank 2)
 | 
				
			||||||
 | 
					        [8983]  = "stun", -- Bash (Rank 3)
 | 
				
			||||||
 | 
					        [9005]  = "stun", -- Pounce (Rank 1)
 | 
				
			||||||
 | 
					        [9823]  = "stun", -- Pounce (Rank 2)
 | 
				
			||||||
 | 
					        [9827]  = "stun", -- Pounce (Rank 3)
 | 
				
			||||||
 | 
					        [27006] = "stun", -- Pounce (Rank 4)
 | 
				
			||||||
 | 
					        [24394] = "stun", -- Intimidation
 | 
				
			||||||
 | 
					        [853]   = "stun", -- Hammer of Justice (Rank 1)
 | 
				
			||||||
 | 
					        [5588]  = "stun", -- Hammer of Justice (Rank 2)
 | 
				
			||||||
 | 
					        [5589]  = "stun", -- Hammer of Justice (Rank 3)
 | 
				
			||||||
 | 
					        [10308] = "stun", -- Hammer of Justice (Rank 4)
 | 
				
			||||||
 | 
					        [1833]  = "stun", -- Cheap Shot
 | 
				
			||||||
 | 
					        [30283] = "stun", -- Shadowfury (Rank 1)
 | 
				
			||||||
 | 
					        [30413] = "stun", -- Shadowfury (Rank 2)
 | 
				
			||||||
 | 
					        [30414] = "stun", -- Shadowfury (Rank 3)
 | 
				
			||||||
 | 
					        [12809] = "stun", -- Concussion Blow
 | 
				
			||||||
 | 
					        [7922]  = "stun", -- Charge Stun
 | 
				
			||||||
 | 
					        [20253] = "stun", -- Intercept Stun (Rank 1)
 | 
				
			||||||
 | 
					        [20614] = "stun", -- Intercept Stun (Rank 2)
 | 
				
			||||||
 | 
					        [20615] = "stun", -- Intercept Stun (Rank 3)
 | 
				
			||||||
 | 
					        [25273] = "stun", -- Intercept Stun (Rank 4)
 | 
				
			||||||
 | 
					        [25274] = "stun", -- Intercept Stun (Rank 5)
 | 
				
			||||||
 | 
					        [20549] = "stun", -- War Stomp (Racial)
 | 
				
			||||||
 | 
					        [13237] = "stun", -- Goblin Mortar
 | 
				
			||||||
 | 
					        [835]   = "stun", -- Tidal Charm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [16922]   = "random_stun",  -- Celestial Focus (Starfire Stun)
 | 
				
			||||||
 | 
					        [19410]   = "random_stun",  -- Improved Concussive Shot
 | 
				
			||||||
 | 
					        [12355]   = "random_stun",  -- Impact
 | 
				
			||||||
 | 
					        [20170]   = "random_stun",  -- Seal of Justice Stun
 | 
				
			||||||
 | 
					        [15269]   = "random_stun",  -- Blackout
 | 
				
			||||||
 | 
					        [18093]   = "random_stun",  -- Pyroclasm
 | 
				
			||||||
 | 
					        [39796]   = "random_stun",  -- Stoneclaw Stun
 | 
				
			||||||
 | 
					        [12798]   = "random_stun",  -- Revenge Stun
 | 
				
			||||||
 | 
					        [5530]    = "random_stun",  -- Mace Stun Effect (Mace Specialization)
 | 
				
			||||||
 | 
					        [15283]   = "random_stun",  -- Stunning Blow (Weapon Proc)
 | 
				
			||||||
 | 
					        [56]      = "random_stun",  -- Stun (Weapon Proc)
 | 
				
			||||||
 | 
					        [34510]   = "random_stun",  -- Stormherald/Deep Thunder (Weapon Proc)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [10326] = "fear", -- Turn Evil (Might be PvE only until wotlk, adding just incase)
 | 
				
			||||||
 | 
					        [8122]  = "fear", -- Psychic Scream (Rank 1)
 | 
				
			||||||
 | 
					        [8124]  = "fear", -- Psychic Scream (Rank 2)
 | 
				
			||||||
 | 
					        [10888] = "fear", -- Psychic Scream (Rank 3)
 | 
				
			||||||
 | 
					        [10890] = "fear", -- Psychic Scream (Rank 4)
 | 
				
			||||||
 | 
					        [5782]  = "fear", -- Fear (Rank 1)
 | 
				
			||||||
 | 
					        [6213]  = "fear", -- Fear (Rank 2)
 | 
				
			||||||
 | 
					        [6215]  = "fear", -- Fear (Rank 3)
 | 
				
			||||||
 | 
					        [6358]  = "fear", -- Seduction (Succubus)
 | 
				
			||||||
 | 
					        [5484]  = "fear", -- Howl of Terror (Rank 1)
 | 
				
			||||||
 | 
					        [17928] = "fear", -- Howl of Terror (Rank 2)
 | 
				
			||||||
 | 
					        [1513]  = "fear", -- Scare Beast (Rank 1)
 | 
				
			||||||
 | 
					        [14326] = "fear", -- Scare Beast (Rank 2)
 | 
				
			||||||
 | 
					        [14327] = "fear", -- Scare Beast (Rank 3)
 | 
				
			||||||
 | 
					        [5246]  = "fear", -- Intimidating Shout
 | 
				
			||||||
 | 
					        [5134]  = "fear", -- Flash Bomb Fear (Item)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [339]   = "root", -- Entangling Roots (Rank 1)
 | 
				
			||||||
 | 
					        [1062]  = "root", -- Entangling Roots (Rank 2)
 | 
				
			||||||
 | 
					        [5195]  = "root", -- Entangling Roots (Rank 3)
 | 
				
			||||||
 | 
					        [5196]  = "root", -- Entangling Roots (Rank 4)
 | 
				
			||||||
 | 
					        [9852]  = "root", -- Entangling Roots (Rank 5)
 | 
				
			||||||
 | 
					        [9853]  = "root", -- Entangling Roots (Rank 6)
 | 
				
			||||||
 | 
					        [26989] = "root", -- Entangling Roots (Rank 7)
 | 
				
			||||||
 | 
					        [19975] = "root", -- Nature's Grasp (Rank 1)
 | 
				
			||||||
 | 
					        [19974] = "root", -- Nature's Grasp (Rank 2)
 | 
				
			||||||
 | 
					        [19973] = "root", -- Nature's Grasp (Rank 3)
 | 
				
			||||||
 | 
					        [19972] = "root", -- Nature's Grasp (Rank 4)
 | 
				
			||||||
 | 
					        [19971] = "root", -- Nature's Grasp (Rank 5)
 | 
				
			||||||
 | 
					        [19970] = "root", -- Nature's Grasp (Rank 6)
 | 
				
			||||||
 | 
					        [27010] = "root", -- Nature's Grasp (Rank 7)
 | 
				
			||||||
 | 
					        [122]   = "root", -- Frost Nova (Rank 1)
 | 
				
			||||||
 | 
					        [865]   = "root", -- Frost Nova (Rank 2)
 | 
				
			||||||
 | 
					        [6131]  = "root", -- Frost Nova (Rank 3)
 | 
				
			||||||
 | 
					        [10230] = "root", -- Frost Nova (Rank 4)
 | 
				
			||||||
 | 
					        [27088] = "root", -- Frost Nova (Rank 5)
 | 
				
			||||||
 | 
					        [33395] = "root", -- Freeze (Water Elemental)
 | 
				
			||||||
 | 
					        [39965] = "root", -- Frost Grenade (Item)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [605]   = "mind_control", -- Mind Control (Rank 1)
 | 
				
			||||||
 | 
					        [10911] = "mind_control", -- Mind Control (Rank 2)
 | 
				
			||||||
 | 
					        [10912] = "mind_control", -- Mind Control (Rank 3)
 | 
				
			||||||
 | 
					        [13181] = "mind_control", -- Gnomish Mind Control Cap
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [14251] = "disarm", -- Riposte
 | 
				
			||||||
 | 
					        [34097] = "disarm", -- Riposte 2 (TODO: Check which ID is the correct one)
 | 
				
			||||||
 | 
					        [676]   = "disarm", -- Disarm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [12494] = "random_root",         -- Frostbite
 | 
				
			||||||
 | 
					        [23694] = "random_root",         -- Improved Hamstring
 | 
				
			||||||
 | 
					        [19229] = "random_root",         -- Improved Wing Clip
 | 
				
			||||||
 | 
					        [19185] = "random_root",         -- Entrapment
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [19503] = "scatter",        -- Scatter Shot
 | 
				
			||||||
 | 
					        [31661] = "scatter",        -- Dragon's Breath (Rank 1)
 | 
				
			||||||
 | 
					        [33041] = "scatter",        -- Dragon's Breath (Rank 2)
 | 
				
			||||||
 | 
					        [33042] = "scatter",        -- Dragon's Breath (Rank 3)
 | 
				
			||||||
 | 
					        [33043] = "scatter",        -- Dragon's Breath (Rank 4)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        -- Spells that DR with itself only
 | 
				
			||||||
 | 
					        [408]   = "kidney_shot",         -- Kidney Shot (Rank 1)
 | 
				
			||||||
 | 
					        [8643]  = "kidney_shot",         -- Kidney Shot (Rank 2)
 | 
				
			||||||
 | 
					        [43523] = "unstable_affliction", -- Unstable Affliction 1
 | 
				
			||||||
 | 
					        [31117] = "unstable_affliction", -- Unstable Affliction 2
 | 
				
			||||||
 | 
					        [6789]  = "death_coil",          -- Death Coil (Rank 1)
 | 
				
			||||||
 | 
					        [17925] = "death_coil",          -- Death Coil (Rank 2)
 | 
				
			||||||
 | 
					        [17926] = "death_coil",          -- Death Coil (Rank 3)
 | 
				
			||||||
 | 
					        [27223] = "death_coil",          -- Death Coil (Rank 4)
 | 
				
			||||||
 | 
					        [44041] = "chastise",            -- Chastise (Rank 1)
 | 
				
			||||||
 | 
					        [44043] = "chastise",            -- Chastise (Rank 2)
 | 
				
			||||||
 | 
					        [44044] = "chastise",            -- Chastise (Rank 3)
 | 
				
			||||||
 | 
					        [44045] = "chastise",            -- Chastise (Rank 4)
 | 
				
			||||||
 | 
					        [44046] = "chastise",            -- Chastise (Rank 5)
 | 
				
			||||||
 | 
					        [44047] = "chastise",            -- Chastise (Rank 6)
 | 
				
			||||||
 | 
					        [19306] = "counterattack",       -- Counterattack (Rank 1)
 | 
				
			||||||
 | 
					        [20909] = "counterattack",       -- Counterattack (Rank 2)
 | 
				
			||||||
 | 
					        [20910] = "counterattack",       -- Counterattack (Rank 3)
 | 
				
			||||||
 | 
					        [27067] = "counterattack",       -- Counterattack (Rank 4)
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					elseif Lib.gameExpansion == "wotlk" then -- STILL WORK IN PROGRESS, I DON'T HAVE BETA ACCESS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    -- SpellID list for Wrath of the Lich King.
 | 
				
			||||||
 | 
					    -- spellID for every rank is used over spell name to avoid name collisions, and faster lookups
 | 
				
			||||||
 | 
					    Lib.spellList = {
 | 
				
			||||||
 | 
					        [49203] = "incapacitate", -- Hungering Cold
 | 
				
			||||||
 | 
					        [2637]  = "incapacitate", -- Hibernate (Rank 1)
 | 
				
			||||||
 | 
					        [18657] = "incapacitate", -- Hibernate (Rank 2)
 | 
				
			||||||
 | 
					        [18658] = "incapacitate", -- Hibernate (Rank 3)
 | 
				
			||||||
 | 
					        [60210] = "incapacitate", -- Freezing Arrow Effect (Rank 1)
 | 
				
			||||||
 | 
					        [3355]  = "incapacitate", -- Freezing Trap Effect (Rank 1)
 | 
				
			||||||
 | 
					        [14308] = "incapacitate", -- Freezing Trap Effect (Rank 2)
 | 
				
			||||||
 | 
					        [14309] = "incapacitate", -- Freezing Trap Effect (Rank 3)
 | 
				
			||||||
 | 
					        [19386] = "incapacitate", -- Wyvern Sting (Rank 1)
 | 
				
			||||||
 | 
					        [24132] = "incapacitate", -- Wyvern Sting (Rank 2)
 | 
				
			||||||
 | 
					        [24133] = "incapacitate", -- Wyvern Sting (Rank 3)
 | 
				
			||||||
 | 
					        [27068] = "incapacitate", -- Wyvern Sting (Rank 4)
 | 
				
			||||||
 | 
					        [49011] = "incapacitate", -- Wyvern Sting (Rank 5)
 | 
				
			||||||
 | 
					        [49012] = "incapacitate", -- Wyvern Sting (Rank 6)
 | 
				
			||||||
 | 
					        [118]   = "incapacitate", -- Polymorph (Rank 1)
 | 
				
			||||||
 | 
					        [12824] = "incapacitate", -- Polymorph (Rank 2)
 | 
				
			||||||
 | 
					        [12825] = "incapacitate", -- Polymorph (Rank 3)
 | 
				
			||||||
 | 
					        [12826] = "incapacitate", -- Polymorph (Rank 4)
 | 
				
			||||||
 | 
					        [28271] = "incapacitate", -- Polymorph: Turtle
 | 
				
			||||||
 | 
					        [28272] = "incapacitate", -- Polymorph: Pig
 | 
				
			||||||
 | 
					        [61721] = "incapacitate", -- Polymorph: Rabbit
 | 
				
			||||||
 | 
					        [61780] = "incapacitate", -- Polymorph: Turkey
 | 
				
			||||||
 | 
					        [61305] = "incapacitate", -- Polymorph: Black Cat
 | 
				
			||||||
 | 
					        [20066] = "incapacitate", -- Repentance
 | 
				
			||||||
 | 
					        [1776]  = "incapacitate", -- Gouge
 | 
				
			||||||
 | 
					        [6770]  = "incapacitate", -- Sap (Rank 1)
 | 
				
			||||||
 | 
					        [2070]  = "incapacitate", -- Sap (Rank 2)
 | 
				
			||||||
 | 
					        [11297] = "incapacitate", -- Sap (Rank 3)
 | 
				
			||||||
 | 
					        [51724] = "incapacitate", -- Sap (Rank 4)
 | 
				
			||||||
 | 
					        [710]   = "incapacitate", -- Banish (Rank 1)
 | 
				
			||||||
 | 
					        [18647] = "incapacitate", -- Banish (Rank 2)
 | 
				
			||||||
 | 
					        [9484]  = "incapacitate", -- Shackle Undead (Rank 1)
 | 
				
			||||||
 | 
					        [9485]  = "incapacitate", -- Shackle Undead (Rank 2)
 | 
				
			||||||
 | 
					        [10955] = "incapacitate", -- Shackle Undead (Rank 3)
 | 
				
			||||||
 | 
					        [51514] = "incapacitate", -- Hex
 | 
				
			||||||
 | 
					        [13327] = "incapacitate", -- Reckless Charge (Rocket Helmet)
 | 
				
			||||||
 | 
					        [4064]  = "incapacitate", -- Rough Copper Bomb
 | 
				
			||||||
 | 
					        [4065]  = "incapacitate", -- Large Copper Bomb
 | 
				
			||||||
 | 
					        [4066]  = "incapacitate", -- Small Bronze Bomb
 | 
				
			||||||
 | 
					        [4067]  = "incapacitate", -- Big Bronze Bomb
 | 
				
			||||||
 | 
					        [4068]  = "incapacitate", -- Iron Grenade
 | 
				
			||||||
 | 
					        [12421] = "incapacitate", -- Mithril Frag Bomb
 | 
				
			||||||
 | 
					        [4069]  = "incapacitate", -- Big Iron Bomb
 | 
				
			||||||
 | 
					        [12562] = "incapacitate", -- The Big One
 | 
				
			||||||
 | 
					        [12543] = "incapacitate", -- Hi-Explosive Bomb
 | 
				
			||||||
 | 
					        [19769] = "incapacitate", -- Thorium Grenade
 | 
				
			||||||
 | 
					        [19784] = "incapacitate", -- Dark Iron Bomb
 | 
				
			||||||
 | 
					        [30216] = "incapacitate", -- Fel Iron Bomb
 | 
				
			||||||
 | 
					        [30461] = "incapacitate", -- The Bigger One
 | 
				
			||||||
 | 
					        [30217] = "incapacitate", -- Adamantite Grenade
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [47481] = "stun", -- Gnaw (Ghoul Pet)
 | 
				
			||||||
 | 
					        [5211]  = "stun", -- Bash (Rank 1)
 | 
				
			||||||
 | 
					        [6798]  = "stun", -- Bash (Rank 2)
 | 
				
			||||||
 | 
					        [8983]  = "stun", -- Bash (Rank 3)
 | 
				
			||||||
 | 
					        [22570] = "stun", -- Maim (Rank 1)
 | 
				
			||||||
 | 
					        [49802] = "stun", -- Maim (Rank 2)
 | 
				
			||||||
 | 
					        [24394] = "stun", -- Intimidation
 | 
				
			||||||
 | 
					        [50519] = "stun", -- Sonic Blast (Pet Rank 1)
 | 
				
			||||||
 | 
					        [53564] = "stun", -- Sonic Blast (Pet Rank 2)
 | 
				
			||||||
 | 
					        [53565] = "stun", -- Sonic Blast (Pet Rank 3)
 | 
				
			||||||
 | 
					        [53566] = "stun", -- Sonic Blast (Pet Rank 4)
 | 
				
			||||||
 | 
					        [53567] = "stun", -- Sonic Blast (Pet Rank 5)
 | 
				
			||||||
 | 
					        [53568] = "stun", -- Sonic Blast (Pet Rank 6)
 | 
				
			||||||
 | 
					        [50518] = "stun", -- Ravage (Pet Rank 1)
 | 
				
			||||||
 | 
					        [53558] = "stun", -- Ravage (Pet Rank 2)
 | 
				
			||||||
 | 
					        [53559] = "stun", -- Ravage (Pet Rank 3)
 | 
				
			||||||
 | 
					        [53560] = "stun", -- Ravage (Pet Rank 4)
 | 
				
			||||||
 | 
					        [53561] = "stun", -- Ravage (Pet Rank 5)
 | 
				
			||||||
 | 
					        [53562] = "stun", -- Ravage (Pet Rank 6)
 | 
				
			||||||
 | 
					        [44572] = "stun", -- Deep Freeze
 | 
				
			||||||
 | 
					        [853]   = "stun", -- Hammer of Justice (Rank 1)
 | 
				
			||||||
 | 
					        [5588]  = "stun", -- Hammer of Justice (Rank 2)
 | 
				
			||||||
 | 
					        [5589]  = "stun", -- Hammer of Justice (Rank 3)
 | 
				
			||||||
 | 
					        [10308] = "stun", -- Hammer of Justice (Rank 4)
 | 
				
			||||||
 | 
					        [2812]  = "stun", -- Holy Wrath (Rank 1)
 | 
				
			||||||
 | 
					        [10318] = "stun", -- Holy Wrath (Rank 2)
 | 
				
			||||||
 | 
					        [27139] = "stun", -- Holy Wrath (Rank 3)
 | 
				
			||||||
 | 
					        [48816] = "stun", -- Holy Wrath (Rank 4)
 | 
				
			||||||
 | 
					        [48817] = "stun", -- Holy Wrath (Rank 5)
 | 
				
			||||||
 | 
					        [408]   = "stun", -- Kidney Shot (Rank 1)
 | 
				
			||||||
 | 
					        [8643]  = "stun", -- Kidney Shot (Rank 2)
 | 
				
			||||||
 | 
					        [58861] = "stun", -- Bash (Spirit Wolves)
 | 
				
			||||||
 | 
					        [30283] = "stun", -- Shadowfury (Rank 1)
 | 
				
			||||||
 | 
					        [30413] = "stun", -- Shadowfury (Rank 2)
 | 
				
			||||||
 | 
					        [30414] = "stun", -- Shadowfury (Rank 3)
 | 
				
			||||||
 | 
					        [47846] = "stun", -- Shadowfury (Rank 4)
 | 
				
			||||||
 | 
					        [47847] = "stun", -- Shadowfury (Rank 5)
 | 
				
			||||||
 | 
					        [12809] = "stun", -- Concussion Blow
 | 
				
			||||||
 | 
					        [60995] = "stun", -- Demon Charge
 | 
				
			||||||
 | 
					        [30153] = "stun", -- Intercept (Felguard Rank 1)
 | 
				
			||||||
 | 
					        [30195] = "stun", -- Intercept (Felguard Rank 2)
 | 
				
			||||||
 | 
					        [30197] = "stun", -- Intercept (Felguard Rank 3)
 | 
				
			||||||
 | 
					        [47995] = "stun", -- Intercept (Felguard Rank 4)
 | 
				
			||||||
 | 
					        [20253] = "stun", -- Intercept Stun (Rank 1)
 | 
				
			||||||
 | 
					        [20614] = "stun", -- Intercept Stun (Rank 2)
 | 
				
			||||||
 | 
					        [20615] = "stun", -- Intercept Stun (Rank 3)
 | 
				
			||||||
 | 
					        [25273] = "stun", -- Intercept Stun (Rank 4)
 | 
				
			||||||
 | 
					        [25274] = "stun", -- Intercept Stun (Rank 5)
 | 
				
			||||||
 | 
					        [46968] = "stun", -- Shockwave
 | 
				
			||||||
 | 
					        [20549] = "stun", -- War Stomp (Racial)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [16922]   = "random_stun",  -- Celestial Focus (Starfire Stun)
 | 
				
			||||||
 | 
					        [28445]   = "random_stun",  -- Improved Concussive Shot
 | 
				
			||||||
 | 
					        [12355]   = "random_stun",  -- Impact
 | 
				
			||||||
 | 
					        [20170]   = "random_stun",  -- Seal of Justice Stun
 | 
				
			||||||
 | 
					        [39796]   = "random_stun",  -- Stoneclaw Stun
 | 
				
			||||||
 | 
					        [12798]   = "random_stun",  -- Revenge Stun
 | 
				
			||||||
 | 
					        [5530]    = "random_stun",  -- Mace Stun Effect (Mace Specialization)
 | 
				
			||||||
 | 
					        [15283]   = "random_stun",  -- Stunning Blow (Weapon Proc)
 | 
				
			||||||
 | 
					        [56]      = "random_stun",  -- Stun (Weapon Proc)
 | 
				
			||||||
 | 
					        [34510]   = "random_stun",  -- Stormherald/Deep Thunder (Weapon Proc)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [1513]  = "fear", -- Scare Beast (Rank 1)
 | 
				
			||||||
 | 
					        [14326] = "fear", -- Scare Beast (Rank 2)
 | 
				
			||||||
 | 
					        [14327] = "fear", -- Scare Beast (Rank 3)
 | 
				
			||||||
 | 
					        [10326] = "fear", -- Turn Evil
 | 
				
			||||||
 | 
					        [8122]  = "fear", -- Psychic Scream (Rank 1)
 | 
				
			||||||
 | 
					        [8124]  = "fear", -- Psychic Scream (Rank 2)
 | 
				
			||||||
 | 
					        [10888] = "fear", -- Psychic Scream (Rank 3)
 | 
				
			||||||
 | 
					        [10890] = "fear", -- Psychic Scream (Rank 4)
 | 
				
			||||||
 | 
					        [2094]  = "fear", -- Blind
 | 
				
			||||||
 | 
					        [5782]  = "fear", -- Fear (Rank 1)
 | 
				
			||||||
 | 
					        [6213]  = "fear", -- Fear (Rank 2)
 | 
				
			||||||
 | 
					        [6215]  = "fear", -- Fear (Rank 3)
 | 
				
			||||||
 | 
					        [6358]  = "fear", -- Seduction (Succubus)
 | 
				
			||||||
 | 
					        [5484]  = "fear", -- Howl of Terror (Rank 1)
 | 
				
			||||||
 | 
					        [17928] = "fear", -- Howl of Terror (Rank 2)
 | 
				
			||||||
 | 
					        [5246]  = "fear", -- Intimidating Shout
 | 
				
			||||||
 | 
					        [5134]  = "fear", -- Flash Bomb Fear (Item)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [339]   = "root", -- Entangling Roots (Rank 1)
 | 
				
			||||||
 | 
					        [1062]  = "root", -- Entangling Roots (Rank 2)
 | 
				
			||||||
 | 
					        [5195]  = "root", -- Entangling Roots (Rank 3)
 | 
				
			||||||
 | 
					        [5196]  = "root", -- Entangling Roots (Rank 4)
 | 
				
			||||||
 | 
					        [9852]  = "root", -- Entangling Roots (Rank 5)
 | 
				
			||||||
 | 
					        [9853]  = "root", -- Entangling Roots (Rank 6)
 | 
				
			||||||
 | 
					        [26989] = "root", -- Entangling Roots (Rank 7)
 | 
				
			||||||
 | 
					        [53308] = "root", -- Entangling Roots (Rank 8)
 | 
				
			||||||
 | 
					        [19975] = "root", -- Nature's Grasp (Rank 1)
 | 
				
			||||||
 | 
					        [19974] = "root", -- Nature's Grasp (Rank 2)
 | 
				
			||||||
 | 
					        [19973] = "root", -- Nature's Grasp (Rank 3)
 | 
				
			||||||
 | 
					        [19972] = "root", -- Nature's Grasp (Rank 4)
 | 
				
			||||||
 | 
					        [19971] = "root", -- Nature's Grasp (Rank 5)
 | 
				
			||||||
 | 
					        [19970] = "root", -- Nature's Grasp (Rank 6)
 | 
				
			||||||
 | 
					        [27010] = "root", -- Nature's Grasp (Rank 7)
 | 
				
			||||||
 | 
					        [53312] = "root", -- Nature's Grasp (Rank 8)
 | 
				
			||||||
 | 
					        [50245] = "root", -- Pin (Rank 1)
 | 
				
			||||||
 | 
					        [53544] = "root", -- Pin (Rank 2)
 | 
				
			||||||
 | 
					        [53545] = "root", -- Pin (Rank 3)
 | 
				
			||||||
 | 
					        [53546] = "root", -- Pin (Rank 4)
 | 
				
			||||||
 | 
					        [53547] = "root", -- Pin (Rank 5)
 | 
				
			||||||
 | 
					        [53548] = "root", -- Pin (Rank 6)
 | 
				
			||||||
 | 
					        [33395] = "root", -- Freeze (Water Elemental)
 | 
				
			||||||
 | 
					        [122]   = "root", -- Frost Nova (Rank 1)
 | 
				
			||||||
 | 
					        [865]   = "root", -- Frost Nova (Rank 2)
 | 
				
			||||||
 | 
					        [6131]  = "root", -- Frost Nova (Rank 3)
 | 
				
			||||||
 | 
					        [10230] = "root", -- Frost Nova (Rank 4)
 | 
				
			||||||
 | 
					        [27088] = "root", -- Frost Nova (Rank 5)
 | 
				
			||||||
 | 
					        [42917] = "root", -- Frost Nova (Rank 6)
 | 
				
			||||||
 | 
					        [39965] = "root", -- Frost Grenade (Item)
 | 
				
			||||||
 | 
					        [63685] = "root", -- Freeze (Frost Shock)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [12494] = "random_root",         -- Frostbite
 | 
				
			||||||
 | 
					        [55080] = "random_root",         -- Shattered Barrier
 | 
				
			||||||
 | 
					        [58373] = "random_root",         -- Glyph of Hamstring
 | 
				
			||||||
 | 
					        [23694] = "random_root",         -- Improved Hamstring
 | 
				
			||||||
 | 
					        [47168] = "random_root",         -- Improved Wing Clip
 | 
				
			||||||
 | 
					        [19185] = "random_root",         -- Entrapment
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [53359] = "disarm", -- Chimera Shot (Scorpid)
 | 
				
			||||||
 | 
					        [50541] = "disarm", -- Snatch (Rank 1)
 | 
				
			||||||
 | 
					        [53537] = "disarm", -- Snatch (Rank 2)
 | 
				
			||||||
 | 
					        [53538] = "disarm", -- Snatch (Rank 3)
 | 
				
			||||||
 | 
					        [53540] = "disarm", -- Snatch (Rank 4)
 | 
				
			||||||
 | 
					        [53542] = "disarm", -- Snatch (Rank 5)
 | 
				
			||||||
 | 
					        [53543] = "disarm", -- Snatch (Rank 6)
 | 
				
			||||||
 | 
					        [64058] = "disarm", -- Psychic Horror Disarm Effect
 | 
				
			||||||
 | 
					        [51722] = "disarm", -- Dismantle
 | 
				
			||||||
 | 
					        [676]   = "disarm", -- Disarm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [47476] = "silence", -- Strangulate
 | 
				
			||||||
 | 
					        [34490] = "silence", -- Silencing Shot
 | 
				
			||||||
 | 
					        [35334] = "silence", -- Nether Shock 1 -- TODO: verify
 | 
				
			||||||
 | 
					        [44957] = "silence", -- Nether Shock 2 -- TODO: verify
 | 
				
			||||||
 | 
					        [18469] = "silence", -- Silenced - Improved Counterspell (Rank 1)
 | 
				
			||||||
 | 
					        [55021] = "silence", -- Silenced - Improved Counterspell (Rank 2)
 | 
				
			||||||
 | 
					        [63529] = "silence", -- Silenced - Shield of the Templar
 | 
				
			||||||
 | 
					        [15487] = "silence", -- Silence
 | 
				
			||||||
 | 
					        [1330]  = "silence", -- Garrote - Silence
 | 
				
			||||||
 | 
					        [18425] = "silence", -- Silenced - Improved Kick
 | 
				
			||||||
 | 
					        [24259] = "silence", -- Spell Lock
 | 
				
			||||||
 | 
					        [43523] = "silence", -- Unstable Affliction 1
 | 
				
			||||||
 | 
					        [31117] = "silence", -- Unstable Affliction 2
 | 
				
			||||||
 | 
					        [18498] = "silence", -- Silenced - Gag Order 1
 | 
				
			||||||
 | 
					        [74347] = "silence", -- Silenced - Gag Order 1
 | 
				
			||||||
 | 
					        [50613] = "silence", -- Arcane Torrent (Racial, Runic Power)
 | 
				
			||||||
 | 
					        [28730] = "silence", -- Arcane Torrent (Racial, Mana)
 | 
				
			||||||
 | 
					        [25046] = "silence", -- Arcane Torrent (Racial, Energy)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [64044] = "horror", -- Psychic Horror
 | 
				
			||||||
 | 
					        [6789]  = "horror", -- Death Coil (Rank 1)
 | 
				
			||||||
 | 
					        [17925] = "horror", -- Death Coil (Rank 2)
 | 
				
			||||||
 | 
					        [17926] = "horror", -- Death Coil (Rank 3)
 | 
				
			||||||
 | 
					        [27223] = "horror", -- Death Coil (Rank 4)
 | 
				
			||||||
 | 
					        [47859] = "horror", -- Death Coil (Rank 5)
 | 
				
			||||||
 | 
					        [47860] = "horror", -- Death Coil (Rank 6)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [1833]  = "opener_stun", -- Cheap Shot
 | 
				
			||||||
 | 
					        [9005]  = "opener_stun", -- Pounce (Rank 1)
 | 
				
			||||||
 | 
					        [9823]  = "opener_stun", -- Pounce (Rank 2)
 | 
				
			||||||
 | 
					        [9827]  = "opener_stun", -- Pounce (Rank 3)
 | 
				
			||||||
 | 
					        [27006] = "opener_stun", -- Pounce (Rank 4)
 | 
				
			||||||
 | 
					        [49803] = "opener_stun", -- Pounce (Rank 5)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [31661] = "scatter", -- Dragon's Breath (Rank 1)
 | 
				
			||||||
 | 
					        [33041] = "scatter", -- Dragon's Breath (Rank 2)
 | 
				
			||||||
 | 
					        [33042] = "scatter", -- Dragon's Breath (Rank 3)
 | 
				
			||||||
 | 
					        [33043] = "scatter", -- Dragon's Breath (Rank 4)
 | 
				
			||||||
 | 
					        [42949] = "scatter", -- Dragon's Breath (Rank 5)
 | 
				
			||||||
 | 
					        [42950] = "scatter", -- Dragon's Breath (Rank 6)
 | 
				
			||||||
 | 
					        [19503] = "scatter", -- Scatter Shot
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        -- Spells that DR with itself only
 | 
				
			||||||
 | 
					        [33786] = "cyclone",        -- Cyclone
 | 
				
			||||||
 | 
					        [605]   = "mind_control",   -- Mind Control
 | 
				
			||||||
 | 
					        [13181] = "mind_control",   -- Gnomish Mind Control Cap
 | 
				
			||||||
 | 
					        [7922]  = "charge",         -- Charge Stun
 | 
				
			||||||
 | 
					        [19306] = "counterattack",  -- Counterattack 1
 | 
				
			||||||
 | 
					        [20909] = "counterattack",  -- Counterattack 2
 | 
				
			||||||
 | 
					        [20910] = "counterattack",  -- Counterattack 3
 | 
				
			||||||
 | 
					        [27067] = "counterattack",  -- Counterattack 4
 | 
				
			||||||
 | 
					        [48998] = "counterattack",  -- Counterattack 5
 | 
				
			||||||
 | 
					        [48999] = "counterattack",  -- Counterattack 6
 | 
				
			||||||
 | 
					        --Storm, Earth and Fire has no DR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        -- TODO: profession stuff
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					elseif Lib.gameExpansion == "classic" then
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    -- SpellID list for Classic Era (vanilla)
 | 
				
			||||||
 | 
					    -- In Classic the spell ID payload is gone from the combat log, so we need the key here to be
 | 
				
			||||||
 | 
					    -- spell name instead. We also provide spell ID in the table value so it's possible to retrieve
 | 
				
			||||||
 | 
					    -- for example spell icon using GetSpellTexture(spellID) later on. (These functions only accept
 | 
				
			||||||
 | 
					    -- spell names if the player has the spell in their spell book)
 | 
				
			||||||
 | 
					    local GetSpellInfo = _G.GetSpellInfo -- upvalue
 | 
				
			||||||
 | 
					    Lib.spellList = {
 | 
				
			||||||
 | 
					        -- Controlled roots
 | 
				
			||||||
 | 
					        [GetSpellInfo(339)]     = { category = "root", spellID = 339 },      -- Entangling Roots
 | 
				
			||||||
 | 
					        [GetSpellInfo(19306)]   = { category = "root", spellID = 19306 },    -- Counterattack
 | 
				
			||||||
 | 
					        [GetSpellInfo(122)]     = { category = "root", spellID = 122 },      -- Frost Nova
 | 
				
			||||||
 | 
					    --  [GetSpellInfo(13099)]   = { category = "root", spellID = 13099 },    -- Net-o-Matic
 | 
				
			||||||
 | 
					    --  [GetSpellInfo(8312)]    = { category = "root", spellID = 8312 },     -- Trap
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        -- Controlled stuns
 | 
				
			||||||
 | 
					        [GetSpellInfo(5211)]    = { category = "stun", spellID = 5211 },     -- Bash
 | 
				
			||||||
 | 
					        [GetSpellInfo(24394)]   = { category = "stun", spellID = 24394 },    -- Intimidation
 | 
				
			||||||
 | 
					        [GetSpellInfo(853)]     = { category = "stun", spellID = 853 },      -- Hammer of Justice
 | 
				
			||||||
 | 
					        [GetSpellInfo(9005)]    = { category = "stun", spellID = 9005 },     -- Pounce
 | 
				
			||||||
 | 
					        [GetSpellInfo(1833)]    = { category = "stun", spellID = 1833 },     -- Cheap Shot
 | 
				
			||||||
 | 
					        [GetSpellInfo(12809)]   = { category = "stun", spellID = 12809 },    -- Concussion Blow
 | 
				
			||||||
 | 
					        [GetSpellInfo(20253)]   = { category = "stun", spellID = 20253 },    -- Intercept Stun
 | 
				
			||||||
 | 
					        [GetSpellInfo(7922)]    = { category = "stun", spellID = 7922 },     -- Charge Stun
 | 
				
			||||||
 | 
					        [GetSpellInfo(20549)]   = { category = "stun", spellID = 20549 },    -- War Stomp (Racial)
 | 
				
			||||||
 | 
					        [GetSpellInfo(4068)]    = { category = "stun", spellID = 4068 },     -- Iron Grenade
 | 
				
			||||||
 | 
					        [GetSpellInfo(19769)]   = { category = "stun", spellID = 19769 },    -- Thorium Grenade
 | 
				
			||||||
 | 
					        [GetSpellInfo(13808)]   = { category = "stun", spellID = 13808 },    -- M73 Frag Grenade
 | 
				
			||||||
 | 
					        [GetSpellInfo(4069)]    = { category = "stun", spellID = 4069 },     -- Big Iron Bomb
 | 
				
			||||||
 | 
					        [GetSpellInfo(12543)]   = { category = "stun", spellID = 12543 },    -- Hi-Explosive Bomb
 | 
				
			||||||
 | 
					        [GetSpellInfo(4064)]    = { category = "stun", spellID = 4064 },     -- Rough Copper Bomb
 | 
				
			||||||
 | 
					        [GetSpellInfo(12421)]   = { category = "stun", spellID = 12421 },    -- Mithril Frag Bomb
 | 
				
			||||||
 | 
					        [GetSpellInfo(19784)]   = { category = "stun", spellID = 19784 },    -- Dark Iron Bomb
 | 
				
			||||||
 | 
					        [GetSpellInfo(4067)]    = { category = "stun", spellID = 4067 },     -- Big Bronze Bomb
 | 
				
			||||||
 | 
					        [GetSpellInfo(4066)]    = { category = "stun", spellID = 4066 },     -- Small Bronze Bomb
 | 
				
			||||||
 | 
					        [GetSpellInfo(4065)]    = { category = "stun", spellID = 4065 },     -- Large Copper Bomb
 | 
				
			||||||
 | 
					        [GetSpellInfo(13237)]   = { category = "stun", spellID = 13237 },    -- Goblin Mortar
 | 
				
			||||||
 | 
					        [GetSpellInfo(835)]     = { category = "stun", spellID = 835 },      -- Tidal Charm
 | 
				
			||||||
 | 
					        [GetSpellInfo(12562)]   = { category = "stun", spellID = 12562 },    -- The Big One
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        -- Incapacitates
 | 
				
			||||||
 | 
					        [GetSpellInfo(2637)]    = { category = "incapacitate", spellID = 2637 },    -- Hibernate
 | 
				
			||||||
 | 
					        [GetSpellInfo(3355)]    = { category = "incapacitate", spellID = 3355 },    -- Freezing Trap
 | 
				
			||||||
 | 
					        [GetSpellInfo(19503)]   = { category = "incapacitate", spellID = 19503 },   -- Scatter Shot
 | 
				
			||||||
 | 
					        [GetSpellInfo(19386)]   = { category = "incapacitate", spellID = 19386 },   -- Wyvern Sting
 | 
				
			||||||
 | 
					        [GetSpellInfo(28271)]   = { category = "incapacitate", spellID = 28271 },   -- Polymorph: Turtle
 | 
				
			||||||
 | 
					        [GetSpellInfo(28272)]   = { category = "incapacitate", spellID = 28272 },   -- Polymorph: Pig
 | 
				
			||||||
 | 
					        [GetSpellInfo(118)]     = { category = "incapacitate", spellID = 118 },     -- Polymorph
 | 
				
			||||||
 | 
					        [GetSpellInfo(20066)]   = { category = "incapacitate", spellID = 20066 },   -- Repentance
 | 
				
			||||||
 | 
					        [GetSpellInfo(1776)]    = { category = "incapacitate", spellID = 1776 },    -- Gouge
 | 
				
			||||||
 | 
					        [GetSpellInfo(6770)]    = { category = "incapacitate", spellID = 6770 },    -- Sap
 | 
				
			||||||
 | 
					        [GetSpellInfo(1090)]    = { category = "incapacitate", spellID = 1090 },    -- Sleep
 | 
				
			||||||
 | 
					        [GetSpellInfo(13327)]   = { category = "incapacitate", spellID = 13327 },   -- Reckless Charge (Rocket Helmet)
 | 
				
			||||||
 | 
					        [GetSpellInfo(26108)]   = { category = "incapacitate", spellID = 26108 },   -- Glimpse of Madness
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        -- Fears
 | 
				
			||||||
 | 
					        [GetSpellInfo(1513)]    = { category = "fear", spellID = 1513 },          -- Scare Beast
 | 
				
			||||||
 | 
					        [GetSpellInfo(8122)]    = { category = "fear", spellID = 8122 },          -- Psychic Scream
 | 
				
			||||||
 | 
					        [GetSpellInfo(5782)]    = { category = "fear", spellID = 5782 },          -- Fear
 | 
				
			||||||
 | 
					        [GetSpellInfo(5484)]    = { category = "fear", spellID = 5484 },          -- Howl of Terror
 | 
				
			||||||
 | 
					        [GetSpellInfo(6358)]    = { category = "fear", spellID = 6358 },          -- Seduction
 | 
				
			||||||
 | 
					        [GetSpellInfo(5246)]    = { category = "fear", spellID = 5246 },          -- Intimidating Shout
 | 
				
			||||||
 | 
					        [GetSpellInfo(5134)]    = { category = "fear", spellID = 5134 },          -- Flash Bomb Fear
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        -- Random/short roots
 | 
				
			||||||
 | 
					        [GetSpellInfo(19229)]   = { category = "random_root", spellID = 19229 },   -- Improved Wing Clip
 | 
				
			||||||
 | 
					--      [GetSpellInfo(27868)]   = { category = "random_root", spellID = 12494 },   -- Frostbite
 | 
				
			||||||
 | 
					        [GetSpellInfo(23694)]   = { category = "random_root", spellID = 23694 },   -- Improved Hamstring
 | 
				
			||||||
 | 
					        [GetSpellInfo(27868)]   = { category = "random_root", spellID = 27868 },   -- Freeze (Item proc and set bonus)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        -- Random/short stuns
 | 
				
			||||||
 | 
					        [GetSpellInfo(16922)]   = { category = "random_stun", spellID = 16922 },   -- Improved Starfire
 | 
				
			||||||
 | 
					        [GetSpellInfo(19410)]   = { category = "random_stun", spellID = 19410 },   -- Improved Concussive Shot
 | 
				
			||||||
 | 
					        [GetSpellInfo(12355)]   = { category = "random_stun", spellID = 12355 },   -- Impact
 | 
				
			||||||
 | 
					        [GetSpellInfo(20170)]   = { category = "random_stun", spellID = 20170 },   -- Seal of Justice Stun
 | 
				
			||||||
 | 
					        [GetSpellInfo(15269)]   = { category = "random_stun", spellID = 15269 },   -- Blackout
 | 
				
			||||||
 | 
					        [GetSpellInfo(18093)]   = { category = "random_stun", spellID = 18093 },   -- Pyroclasm
 | 
				
			||||||
 | 
					        [GetSpellInfo(12798)]   = { category = "random_stun", spellID = 12798 },   -- Revenge Stun
 | 
				
			||||||
 | 
					        [GetSpellInfo(5530)]    = { category = "random_stun", spellID = 5530 },    -- Mace Stun Effect (Mace Specialization)
 | 
				
			||||||
 | 
					        [GetSpellInfo(15283)]   = { category = "random_stun", spellID = 15283 },   -- Stunning Blow (Weapon Proc)
 | 
				
			||||||
 | 
					        [GetSpellInfo(56)]      = { category = "random_stun", spellID = 56 },      -- Stun (Weapon Proc)
 | 
				
			||||||
 | 
					        [GetSpellInfo(21152)]   = { category = "random_stun", spellID = 21152 },   -- Earthshaker (Weapon Proc)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        -- Spells that DRs with itself only
 | 
				
			||||||
 | 
					        [GetSpellInfo(408)]     = { category = "kidney_shot", spellID = 408 },     -- Kidney Shot
 | 
				
			||||||
 | 
					        [GetSpellInfo(605)]     = { category = "mind_control", spellID = 605 },    -- Mind Control
 | 
				
			||||||
 | 
					        [GetSpellInfo(13181)]   = { category = "mind_control", spellID = 13181 },  -- Gnomish Mind Control Cap
 | 
				
			||||||
 | 
					        [GetSpellInfo(8056)]    = { category = "frost_shock", spellID = 8056 },    -- Frost Shock
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					    print("DRList-1.0: Unsupported game expansion loaded.") -- luacheck: ignore
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Alias for DRData-1.0
 | 
				
			||||||
 | 
					Lib.spells = Lib.spellList
 | 
				
			||||||
@@ -6,24 +6,23 @@ local Buff = LibClassAuras.Buff
 | 
				
			|||||||
-------------
 | 
					-------------
 | 
				
			||||||
-- PRIEST
 | 
					-- PRIEST
 | 
				
			||||||
-------------
 | 
					-------------
 | 
				
			||||||
Buff({ 1243, 1244, 1245, 2791, 10937, 10938, 25389 }, { buffType = "magic" }, "PRIEST") -- Power Word: Fortitude
 | 
					Buff({ 1243, 1244, 1245, 2791, 10937, 10938, 25389, 48161 }, { buffType = "magic" }, "PRIEST") -- Power Word: Fortitude
 | 
				
			||||||
Buff({ 21562, 21564, 25392 }, { buffType = "magic" }, "PRIEST") -- Prayer of Fortitude
 | 
					Buff({ 21562, 21564, 25392, 48162 }, { buffType = "magic" }, "PRIEST") -- Prayer of Fortitude
 | 
				
			||||||
Buff({ 17, 592, 600, 3747, 6065, 6066, 10898, 10899, 10900, 10901, 25217, 25218 }, { buffType = "magic" }, "PRIEST") -- Power Word: Shield
 | 
					Buff({ 17, 592, 600, 3747, 6065, 6066, 10898, 10899, 10900, 10901, 25217, 25218, 48065, 48066 }, { buffType = "magic" }, "PRIEST") -- Power Word: Shield
 | 
				
			||||||
Buff({ 588, 7128, 602, 1006, 10951, 10952, 25431 }, { buffType = "magic" }, "PRIEST") -- Inner Fire
 | 
					Buff({ 588, 7128, 602, 1006, 10951, 10952, 25431, 48040, 48168 }, { buffType = "magic" }, "PRIEST") -- Inner Fire
 | 
				
			||||||
Buff({ 2651 }, { buffType = "magic" }, "PRIEST") -- Elune's Grace
 | 
					Buff({ 2651 }, { buffType = "magic" }, "PRIEST") -- Elune's Grace
 | 
				
			||||||
Buff({ 6346 }, { buffType = "magic" }, "PRIEST") -- Fear Ward
 | 
					Buff({ 6346 }, { buffType = "magic" }, "PRIEST") -- Fear Ward
 | 
				
			||||||
Buff({ 14752, 14818, 14819, 27841, 25312 }, { buffType = "magic" }, "PRIEST") -- Divine Spirit
 | 
					Buff({ 14752, 14818, 14819, 27841, 25312, 48073 }, { buffType = "magic" }, "PRIEST") -- Divine Spirit
 | 
				
			||||||
Buff({ 27681, 32999 }, { buffType = "magic" }, "PRIEST") -- Prayer of Spirit
 | 
					Buff({ 27681, 32999, 48074 }, { buffType = "magic" }, "PRIEST") -- Prayer of Spirit
 | 
				
			||||||
Buff({ 1706 }, { buffType = "magic" }, "PRIEST") -- Levitate
 | 
					Buff({ 1706 }, { buffType = "magic" }, "PRIEST") -- Levitate
 | 
				
			||||||
Buff({ 139, 6074, 6075, 6076, 6077, 6078, 10927, 10928, 10929, 25315, 25221, 25222 }, { buffType = "magic" }, "PRIEST") -- Renew
 | 
					Buff({ 139, 6074, 6075, 6076, 6077, 6078, 10927, 10928, 10929, 25315, 25221, 25222, 48067, 48068 }, { buffType = "magic" }, "PRIEST") -- Renew
 | 
				
			||||||
Buff({ 552 }, { buffType = "magic" }, "PRIEST") -- Abolish Disease
 | 
					Buff({ 552 }, { buffType = "magic" }, "PRIEST") -- Abolish Disease
 | 
				
			||||||
Buff({ 33076 }, { buffType = "magic" }, "PRIEST") -- Prayer of Mending
 | 
					Buff({ 33076, 48112, 48113 }, { buffType = "magic" }, "PRIEST") -- Prayer of Mending
 | 
				
			||||||
Buff({ 586, 9578, 9579, 9592, 10941, 10942, 25429 }, { buffType = "magic" }, "PRIEST") -- Fade
 | 
					Buff({ 586, 9578, 9579, 9592, 10941, 10942, 25429 }, { buffType = "magic" }, "PRIEST") -- Fade
 | 
				
			||||||
Buff({ 2652, 19261, 19262, 19264, 19265, 19266, 25461 }, { buffType = "magic" }, "PRIEST") -- Touch of Weakness
 | 
					Buff({ 2652, 19261, 19262, 19264, 19265, 19266, 25461 }, { buffType = "magic" }, "PRIEST") -- Touch of Weakness
 | 
				
			||||||
Buff({ 18137, 19308, 19310, 19311, 19312, 25477 }, { buffType = "magic" }, "PRIEST") -- Shadowguard
 | 
					Buff({ 18137, 19308, 19310, 19311, 19312, 25477 }, { buffType = "magic" }, "PRIEST") -- Shadowguard
 | 
				
			||||||
Buff({ 976, 10957, 10958, 16874, 25433 }, { buffType = "magic" }, "PRIEST") -- Shadow Protection
 | 
					Buff({ 976, 10957, 10958, 16874, 25433 }, { buffType = "magic" }, "PRIEST") -- Shadow Protection
 | 
				
			||||||
Buff({ 27683, 39374 }, { buffType = "magic" }, "PRIEST") -- Prayer of Shadow Protection
 | 
					Buff({ 27683, 39374 }, { buffType = "magic" }, "PRIEST") -- Prayer of Shadow Protection
 | 
				
			||||||
Buff({ 15473 }, { buffType = "form" }, "PRIEST") -- Shadowform
 | 
					 | 
				
			||||||
--talents
 | 
					--talents
 | 
				
			||||||
Buff({ 14893, 15357, 15359 }, { buffType = "magic" }, "PRIEST") -- Inspiration
 | 
					Buff({ 14893, 15357, 15359 }, { buffType = "magic" }, "PRIEST") -- Inspiration
 | 
				
			||||||
Buff({ 27813, 27817, 27818 }, { buffType = "magic" }, "PRIEST") -- Blessed Recovery
 | 
					Buff({ 27813, 27817, 27818 }, { buffType = "magic" }, "PRIEST") -- Blessed Recovery
 | 
				
			||||||
@@ -32,68 +31,189 @@ Buff({ 14751 }, { buffType = "magic" }, "PRIEST") -- Inner Focus
 | 
				
			|||||||
Buff({ 10060 }, { buffType = "magic" }, "PRIEST") -- Power Infusion
 | 
					Buff({ 10060 }, { buffType = "magic" }, "PRIEST") -- Power Infusion
 | 
				
			||||||
Buff({ 33206 }, { buffType = "magic" }, "PRIEST") -- Pain Suppression
 | 
					Buff({ 33206 }, { buffType = "magic" }, "PRIEST") -- Pain Suppression
 | 
				
			||||||
Buff({ 34754 }, { buffType = "magic" }, "PRIEST") -- Clearcasting
 | 
					Buff({ 34754 }, { buffType = "magic" }, "PRIEST") -- Clearcasting
 | 
				
			||||||
 | 
					Buff({ 15473 }, { buffType = "form" }, "PRIEST") -- Shadowform
 | 
				
			||||||
 | 
					Buff({ 47788 }, { buffType = "magic" }, "PRIEST") -- Guardian's Spirit
 | 
				
			||||||
 | 
					Buff({ 47585 }, { buffType = "magic" }, "PRIEST") -- Dispersion
 | 
				
			||||||
 | 
					Buff({ 65081 }, { buffType = "magic" }, "PRIEST") -- Body and Soul
 | 
				
			||||||
 | 
					Buff({ 33151 }, { buffType = "magic" }, "PRIEST") -- Surge of Light
 | 
				
			||||||
 | 
					Buff({ 47753 }, { buffType = "magic" }, "PRIEST") -- Divine Aegis
 | 
				
			||||||
 | 
					Buff({ 47930 }, { buffType = "magic" }, "PRIEST") -- Grace
 | 
				
			||||||
 | 
					Buff({ 63734 }, { buffType = "magic" }, "PRIEST") -- Serendipity
 | 
				
			||||||
 | 
					
 | 
				
			||||||
---------------
 | 
					---------------
 | 
				
			||||||
-- DRUID
 | 
					-- DRUID
 | 
				
			||||||
---------------
 | 
					---------------
 | 
				
			||||||
Buff({ 467, 782, 1075, 8914, 9756, 9910, 26992 }, { buffType = "magic"}, "DRUID") -- Thorns
 | 
					Buff({ 467, 782, 1075, 8914, 9756, 9910, 26992, 53307 }, { buffType = "magic"}, "DRUID") -- Thorns
 | 
				
			||||||
Buff({ 5487 }, { buffType = "form"}, "DRUID") -- Bear Form
 | 
					Buff({ 5487 }, { buffType = "form"}, "DRUID") -- Bear Form
 | 
				
			||||||
Buff({ 783 }, { buffType = "form"}, "DRUID") -- Travel Form
 | 
					Buff({ 783 }, { buffType = "form"}, "DRUID") -- Travel Form
 | 
				
			||||||
Buff({ 9634 }, { buffType = "form"}, "DRUID") -- Dire Bear Form
 | 
					Buff({ 9634 }, { buffType = "form"}, "DRUID") -- Dire Bear Form
 | 
				
			||||||
Buff({ 768 }, { buffType = "form"}, "DRUID") -- Cat Form
 | 
					Buff({ 768 }, { buffType = "form"}, "DRUID") -- Cat Form
 | 
				
			||||||
Buff({ 22812 }, { buffType = "magic"}, "DRUID") -- Barkskin
 | 
					Buff({ 22812 }, { buffType = "magic"}, "DRUID") -- Barkskin
 | 
				
			||||||
Buff({ 5229 }, { buffType = "physical"}, "DRUID") -- Enrage
 | 
					Buff({ 5229 }, { buffType = "enrage"}, "DRUID") -- Enrage
 | 
				
			||||||
Buff({ 5217, 6793, 9845, 9846 }, { buffType = "physical"}, "DRUID") -- Tiger's Fury
 | 
					Buff({ 5217, 6793, 9845, 9846, 50212, 50213 }, { buffType = "physical"}, "DRUID") -- Tiger's Fury
 | 
				
			||||||
Buff({ 1850, 9821, 33357 }, { buffType = "physical"}, "DRUID") -- Dash
 | 
					Buff({ 1850, 9821, 33357 }, { buffType = "physical"}, "DRUID") -- Dash
 | 
				
			||||||
Buff({ 22842, 22895, 22896, 26999 }, { buffType = "physical"}, "DRUID") -- Frenzied Regeneration
 | 
					Buff({ 22842 }, { buffType = "physical"}, "DRUID") -- Frenzied Regeneration
 | 
				
			||||||
Buff({ 1126, 5232, 6756, 5234, 8907, 9884, 9885, 26990 }, { buffType = "magic"}, "DRUID") -- Mark of the Wild
 | 
					Buff({ 1126, 5232, 6756, 5234, 8907, 9884, 9885, 26990, 48469 }, { buffType = "magic"}, "DRUID") -- Mark of the Wild
 | 
				
			||||||
Buff({ 21849, 21850, 26991 }, { buffType = "magic"}, "DRUID") -- Gift of the Wild
 | 
					Buff({ 21849, 21850, 26991, 48470 }, { buffType = "magic"}, "DRUID") -- Gift of the Wild
 | 
				
			||||||
Buff({ 774, 1058, 1430, 2090, 2091, 3627, 8910, 9839, 9840, 9841, 25299, 26981, 26982 }, { buffType = "magic"}, "DRUID") -- Regrowth
 | 
					Buff({ 774, 1058, 1430, 2090, 2091, 3627, 8910, 9839, 9840, 9841, 25299, 26981, 26982, 48442, 48443 }, { buffType = "magic"}, "DRUID") -- Regrowth
 | 
				
			||||||
Buff({ 8936, 8938, 8939, 8940, 8941, 9750, 9856, 9857, 9858, 26980 }, { buffType = "magic"}, "DRUID") -- Rejuvenation
 | 
					Buff({ 8936, 8938, 8939, 8940, 8941, 9750, 9856, 9857, 9858, 26980, 48440, 48441 }, { buffType = "magic"}, "DRUID") -- Rejuvenation
 | 
				
			||||||
Buff({ 2893 }, { buffType = "magic"}, "DRUID") -- Abolish Poison
 | 
					Buff({ 2893 }, { buffType = "magic"}, "DRUID") -- Abolish Poison
 | 
				
			||||||
Buff({ 33763 }, { buffType = "magic"}, "DRUID") -- Lifebloom
 | 
					Buff({ 33763, 48450, 48451}, { buffType = "magic"}, "DRUID") -- Lifebloom
 | 
				
			||||||
--Talents
 | 
					--Talents
 | 
				
			||||||
Buff({ 24858 }, { buffType = "form"}, "DRUID") -- Moonkin Form
 | 
					Buff({ 24858 }, { buffType = "form"}, "DRUID") -- Moonkin Form
 | 
				
			||||||
Buff({ 24907 }, { buffType = "aura"}, "DRUID") -- Moonkin Aura
 | 
					Buff({ 24907 }, { buffType = "aura"}, "DRUID") -- Moonkin Aura
 | 
				
			||||||
Buff({ 33891 }, { buffType = "form"}, "DRUID") -- Tree of Life
 | 
					Buff({ 33891 }, { buffType = "form"}, "DRUID") -- Tree of Life
 | 
				
			||||||
Buff({ 16864 }, { buffType = "magic"}, "DRUID") -- Omen of Clarity
 | 
					Buff({ 16864, 16870 }, { buffType = "magic"}, "DRUID") -- Omen of Clarity
 | 
				
			||||||
Buff({ 16689, 16810, 16811, 16812, 16813, 17329, 27009 }, { buffType = "magic"}, "DRUID") -- Nature's Grasp
 | 
					Buff({ 16689, 16810, 16811, 16812, 16813, 17329, 27009, 53312 }, { buffType = "magic"}, "DRUID") -- Nature's Grasp
 | 
				
			||||||
Buff({ 45281, 45282, 45283 }, { buffType = "magic"}, "DRUID") -- Natural Perfection
 | 
					Buff({ 45281, 45282, 45283 }, { buffType = "magic"}, "DRUID") -- Natural Perfection
 | 
				
			||||||
Buff({ 16188 }, { buffType = "magic"}, "DRUID") -- Nature's Swiftness
 | 
					Buff({ 17116 }, { buffType = "magic"}, "DRUID") -- Nature's Swiftness
 | 
				
			||||||
Buff({ 17007 }, { buffType = "aura"}, "DRUID") -- Leader of the Pack
 | 
					Buff({ 17007 }, { buffType = "aura"}, "DRUID") -- Leader of the Pack
 | 
				
			||||||
 | 
					Buff({ 48518 }, { buffType = "physical"}, "DRUID") -- Eclipse (Lunar)
 | 
				
			||||||
 | 
					Buff({ 48517 }, { buffType = "physical"}, "DRUID") -- Eclipse (Solar)
 | 
				
			||||||
 | 
					Buff({ 16886 }, { buffType = "magic"}, "DRUID") -- Nature's Grace
 | 
				
			||||||
 | 
					Buff({ 48503, 48504 }, { buffType = "magic"}, "DRUID") -- Living Seed
 | 
				
			||||||
 | 
					Buff({ 50334 }, { buffType = "physical"}, "DRUID") -- Berserk
 | 
				
			||||||
 | 
					Buff({ 52610, 62071 }, { buffType = "enrage"}, "DRUID") -- Savage Roar
 | 
				
			||||||
 | 
					Buff({ 48391 }, { buffType = "enrage"}, "DRUID") -- Owlkin Frenzy
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-------------
 | 
					-------------
 | 
				
			||||||
-- WARRIOR
 | 
					-- WARRIOR -- TODO
 | 
				
			||||||
-------------
 | 
					-------------
 | 
				
			||||||
--Buff({ 29703 }, { buffType = "physical"}, "WARRIOR") -- Dazed
 | 
					Buff({ 29838 }, { buffType = "physical"}, "WARRIOR") -- Second Wind
 | 
				
			||||||
 | 
					Buff({ 12292 }, { buffType = "enrage"}, "WARRIOR") -- Death Wish
 | 
				
			||||||
 | 
					Buff({ 6673 }, { buffType = "physical"}, "WARRIOR") -- Battle Shout
 | 
				
			||||||
 | 
					Buff({ 469 }, { buffType = "physical"}, "WARRIOR") -- Commanding Shout
 | 
				
			||||||
 | 
					Buff({ 12328 }, { buffType = "physical"}, "WARRIOR") -- Sweeping Strikes
 | 
				
			||||||
 | 
					Buff({ 29801, 30032 }, { buffType = "aura"}, "WARRIOR") -- Rampage
 | 
				
			||||||
 | 
					Buff({ 2687 }, { buffType = "enrage"}, "WARRIOR") -- Blood Rage
 | 
				
			||||||
 | 
					Buff({ 20230 }, { buffType = "physical"}, "WARRIOR") -- Retaliation
 | 
				
			||||||
 | 
					Buff({ 871 }, { buffType = "physical"}, "WARRIOR") -- Shield Wall
 | 
				
			||||||
 | 
					Buff({ 18499 }, { buffType = "enrage"}, "WARRIOR") -- Berserker Rage
 | 
				
			||||||
 | 
					Buff({ 23885 }, { buffType = "enrage"}, "WARRIOR") -- Bloodthirst
 | 
				
			||||||
 | 
					Buff({ 3411 }, { buffType = "physical"}, "WARRIOR") -- Intervene
 | 
				
			||||||
 | 
					Buff({ 50622 }, { buffType = "physical"}, "WARRIOR") -- Bladestorm (whirlwind)
 | 
				
			||||||
 | 
					Buff({ 52437 }, { buffType = "physical"}, "WARRIOR") -- Sudden Death
 | 
				
			||||||
 | 
					Buff({ 57522 }, { buffType = "physical"}, "WARRIOR") -- Wrecking Crew
 | 
				
			||||||
 | 
					Buff({ 46916 }, { buffType = "physical"}, "WARRIOR") -- Slam!
 | 
				
			||||||
 | 
					Buff({ 50720 }, { buffType = "physical"}, "WARRIOR") -- Vigilance
 | 
				
			||||||
 | 
					Buff({ 55694 }, { buffType = "enrage"}, "WARRIOR") -- Enraged Regeneration
 | 
				
			||||||
 | 
					Buff({ 1719 }, { buffType = "enrage"}, "WARRIOR") -- Recklessness
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--------------
 | 
					--------------
 | 
				
			||||||
-- ROGUE
 | 
					-- ROGUE -- TODO
 | 
				
			||||||
--------------
 | 
					--------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Buff({ 2983 }, { buffType = "physical" }, "ROGUE") -- Sprint
 | 
					Buff({ 2983 }, { buffType = "physical" }, "ROGUE") -- Sprint
 | 
				
			||||||
Buff({ 5277 }, { buffType = "physical" }, "ROGUE") -- Evasion
 | 
					Buff({ 5277 }, { buffType = "physical" }, "ROGUE") -- Evasion
 | 
				
			||||||
 | 
					Buff({ 31224 }, { buffType = "physical" }, "ROGUE") -- Cloak of Shadows
 | 
				
			||||||
 | 
					Buff({ 14278 }, { buffType = "physical" }, "ROGUE") -- Ghostly Strike
 | 
				
			||||||
 | 
					Buff({ 51713 }, { buffType = "physical" }, "ROGUE") -- Shadow Dance
 | 
				
			||||||
 | 
					Buff({ 31665 }, { buffType = "physical" }, "ROGUE") -- Master of Subtlety
 | 
				
			||||||
 | 
					Buff({ 51690 }, { buffType = "physical" }, "ROGUE") -- Killing Spree
 | 
				
			||||||
 | 
					Buff({ 63848 }, { buffType = "enrage" }, "ROGUE") -- Hunger For Blood
 | 
				
			||||||
 | 
					Buff({ 57934 }, { buffType = "physical" }, "ROGUE") -- Tricks of the Trade
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
------------
 | 
					------------
 | 
				
			||||||
-- WARLOCK
 | 
					-- WARLOCK --TODO
 | 
				
			||||||
------------
 | 
					------------
 | 
				
			||||||
Buff({ 19028 }, { buffType = "immune"}, "WARLOCK") -- Soul Link
 | 
					Buff({ 19028 }, { buffType = "aura"}, "WARLOCK") -- Soul Link
 | 
				
			||||||
Buff({ 23759 }, { buffType = "immune"}, "WARLOCK") -- Master Demonologist
 | 
					Buff({ 687, 696 }, { buffType = "aura"}, "WARLOCK") -- Demon Skin
 | 
				
			||||||
 | 
					Buff({ 706, 1086, 11733, 11734, 11735, 27260, 47793, 47889 }, { buffType = "aura"}, "WARLOCK") -- Demon Armor
 | 
				
			||||||
 | 
					Buff({ 28176, 28189, 47892, 47893 }, { buffType = "aura"}, "WARLOCK") -- Fel Armor
 | 
				
			||||||
 | 
					Buff({ 23759 }, { buffType = "aura"}, "WARLOCK") -- Master Demonologist
 | 
				
			||||||
 | 
					Buff({ 34936 }, { buffType = "magic"}, "WARLOCK") -- Backlash
 | 
				
			||||||
 | 
					Buff({ 5697 }, { buffType = "magic"}, "WARLOCK") -- Unending Breath
 | 
				
			||||||
 | 
					Buff({ 132 }, { buffType = "magic"}, "WARLOCK") -- Detect Invisibility
 | 
				
			||||||
 | 
					Buff({ 1949, 11683, 11684, 27213, 47823 }, { buffType = "aura"}, "WARLOCK") -- Hellfire
 | 
				
			||||||
 | 
					Buff({ 6229, 11739, 11740, 28610, 47890, 47891 }, { buffType = "magic"}, "WARLOCK") -- Shadow Ward
 | 
				
			||||||
 | 
					Buff({ 19480, 20435, 41002 }, { buffType = "aura"}, "WARLOCK") -- Paranoia
 | 
				
			||||||
 | 
					Buff({ 7812, 19438, 19440, 19441, 19442, 19443, 27273, 47985, 47986 }, { buffType = "magic"}, "WARLOCK") -- Sacrifice
 | 
				
			||||||
 | 
					Buff({ 2947, 8316, 8317, 11770, 11771, 27269, 47983 }, { buffType = "magic"}, "WARLOCK") -- Fire Shield
 | 
				
			||||||
 | 
					Buff({ 48018 }, { buffType = "magic"}, "WARLOCK") -- Demonic Circle: Summon
 | 
				
			||||||
 | 
					Buff({ 59672 }, { buffType = "physical"}, "WARLOCK") -- Metamorphosis
 | 
				
			||||||
 | 
					Buff({ 54277 }, { buffType = "physical"}, "WARLOCK") -- Backdraft
 | 
				
			||||||
 | 
					Buff({ 47283 }, { buffType = "magic"}, "WARLOCK") -- Empowered Imp
 | 
				
			||||||
 | 
					Buff({ 64371 }, { buffType = "magic"}, "WARLOCK") -- Eradication
 | 
				
			||||||
 | 
					Buff({ 18093, 63243, 63244 } ,{ buffType = "physical" }, "WARLOCK") -- Pyroclasm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
---------------
 | 
					---------------
 | 
				
			||||||
-- SHAMAN
 | 
					-- SHAMAN
 | 
				
			||||||
---------------
 | 
					---------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Buff({ 8178 } ,{ buffType = "magic" }, "SHAMAN") -- Grounding Totem Effect
 | 
					Buff({ 8178 } ,{ buffType = "magic" }, "SHAMAN") -- Grounding Totem Effect
 | 
				
			||||||
 | 
					Buff({ 30823 } ,{ buffType = "magic" }, "SHAMAN") -- Shamanistic Rage
 | 
				
			||||||
 | 
					Buff({ 32182 } ,{ buffType = "magic" }, "SHAMAN") -- Heroism
 | 
				
			||||||
 | 
					Buff({ 2825 } ,{ buffType = "magic" }, "SHAMAN") -- Bloodlust
 | 
				
			||||||
 | 
					Buff({ 974, 32593, 32594, 49283, 49284 } ,{ buffType = "magic" }, "SHAMAN") -- Earth Shield
 | 
				
			||||||
 | 
					Buff({ 24398, 33736, 57960 } ,{ buffType = "magic" }, "SHAMAN") -- Water Shield
 | 
				
			||||||
 | 
					Buff({ 324, 25472, 49280, 49281 } ,{ buffType = "magic" }, "SHAMAN") -- Lightning Shield
 | 
				
			||||||
 | 
					Buff({ 16188 } ,{ buffType = "magic" }, "SHAMAN") -- Nature's Swiftness
 | 
				
			||||||
 | 
					Buff({ 16166 } ,{ buffType = "magic" }, "SHAMAN") -- Elemental Mastery
 | 
				
			||||||
 | 
					Buff({ 51470 } ,{ buffType = "aura" }, "SHAMAN") -- Elemental Oath
 | 
				
			||||||
 | 
					Buff({ 30809 } ,{ buffType = "aura" }, "SHAMAN") -- Unleashed Rage
 | 
				
			||||||
 | 
					Buff({ 52179 } ,{ buffType = "magic" }, "SHAMAN") -- Astral Shift
 | 
				
			||||||
 | 
					Buff({ 61295, 61299, 61300, 61301 } ,{ buffType = "magic" }, "SHAMAN") -- Riptide
 | 
				
			||||||
 | 
					Buff({ 53390 } ,{ buffType = "magic" }, "SHAMAN") -- Tidal Waves
 | 
				
			||||||
 | 
					Buff({ 52000, 51999, 51998, 51997, 51990, 51945 } ,{ buffType = "magic" }, "SHAMAN") -- Earthliving proc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--------------
 | 
					--------------
 | 
				
			||||||
-- PALADIN
 | 
					-- PALADIN --TODO
 | 
				
			||||||
--------------
 | 
					--------------
 | 
				
			||||||
 | 
					--Blessings
 | 
				
			||||||
 | 
					Buff( { 1022, 5599, 10278 }, { buffType = "magic"}, "PALADIN") -- Blessing/Hand of Protection
 | 
				
			||||||
 | 
					Buff( { 6940 }, { buffType = "magic"}, "PALADIN") -- Blessing/Hand of Sacrifice
 | 
				
			||||||
 | 
					Buff( { 1044, 66115 }, { buffType = "magic"}, "PALADIN") -- Blessing/Hand of Freedom
 | 
				
			||||||
 | 
					Buff( { 19740, 19834, 19835, 19836, 19837, 19838, 25291, 27140, 48931, 48932 }, { buffType = "magic"}, "PALADIN") -- Blessing of Might
 | 
				
			||||||
 | 
					Buff( { 19742, 19850, 19852, 19853, 19854, 25290, 27142, 48935, 48936 }, { buffType = "magic"}, "PALADIN") -- Blessing of Wisdom
 | 
				
			||||||
 | 
					Buff( { 20217 }, { buffType = "magic"}, "PALADIN") -- Blessing of Kings
 | 
				
			||||||
 | 
					Buff( { 19977 }, { buffType = "magic"}, "PALADIN") -- Blessing of Light
 | 
				
			||||||
 | 
					Buff( { 1038 }, { buffType = "magic"}, "PALADIN") -- Blessing/Hand of Salvation
 | 
				
			||||||
 | 
					Buff( { 20911 }, { buffType = "magic"}, "PALADIN") -- Blessing of Sanctuary
 | 
				
			||||||
 | 
					Buff( { 25898 }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Kings
 | 
				
			||||||
 | 
					Buff( { 25890 }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Light
 | 
				
			||||||
 | 
					Buff( { 25782, 27141, 48933, 48934 }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Might
 | 
				
			||||||
 | 
					Buff( { 25895  }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Salvation
 | 
				
			||||||
 | 
					Buff( { 25899 }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Sanctuary
 | 
				
			||||||
 | 
					Buff( { 25894, 48937 }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Wisdom
 | 
				
			||||||
 | 
					Buff( { 642 }, { buffType = "immune"}, "PALADIN") -- Divine Shield
 | 
				
			||||||
 | 
					Buff( { 31884 }, { buffType = "magic"}, "PALADIN") -- Avenging Wrath
 | 
				
			||||||
 | 
					--Auras
 | 
				
			||||||
 | 
					Buff( { 465, 10290, 643, 10291, 1032, 10292, 10293, 27149, 48941, 48942 }, { buffType = "aura"}, "PALADIN") -- Devotion Aura
 | 
				
			||||||
 | 
					Buff( { 7294 }, { buffType = "aura"}, "PALADIN") -- Retribution Aura
 | 
				
			||||||
 | 
					Buff( { 19746 }, { buffType = "aura"}, "PALADIN") -- Concentration Aura
 | 
				
			||||||
 | 
					Buff( { 19876 }, { buffType = "aura"}, "PALADIN") -- Shadow Resistance Aura
 | 
				
			||||||
 | 
					Buff( { 20218 }, { buffType = "aura"}, "PALADIN") -- Sanctity Aura
 | 
				
			||||||
 | 
					Buff( { 19888 }, { buffType = "aura"}, "PALADIN") -- Frost Resistance Aura
 | 
				
			||||||
 | 
					Buff( { 19891 }, { buffType = "aura"}, "PALADIN") -- Fire Resistance Aura
 | 
				
			||||||
 | 
					Buff( { 32223 }, { buffType = "aura"}, "PALADIN") -- Crusader Aura
 | 
				
			||||||
 | 
					--Seals
 | 
				
			||||||
 | 
					Buff( { 20154, 21084, 20287, 20288, 20289, 20290, 20291, 20292, 20293, 27155 }, { buffType = "magic"}, "PALADIN") -- Seal of Righteousness
 | 
				
			||||||
 | 
					Buff( { 31892 }, { buffType = "magic"}, "PALADIN") -- Seal of Blood
 | 
				
			||||||
 | 
					Buff( { 20375 }, { buffType = "magic"}, "PALADIN") -- Seal of Command
 | 
				
			||||||
 | 
					Buff( { 20164 }, { buffType = "magic"}, "PALADIN") -- Seal of Justice
 | 
				
			||||||
 | 
					Buff( { 20165 }, { buffType = "magic"}, "PALADIN") -- Seal of Light
 | 
				
			||||||
 | 
					Buff( { 15277 }, { buffType = "magic"}, "PALADIN") -- Seal of Reckoning
 | 
				
			||||||
 | 
					Buff( { 31801 }, { buffType = "magic"}, "PALADIN") -- Seal of Vengeance
 | 
				
			||||||
 | 
					Buff( { 20166 }, { buffType = "magic"}, "PALADIN") -- Seal of Wisdom
 | 
				
			||||||
 | 
					Buff( { 21082 }, { buffType = "magic"}, "PALADIN") -- Seal of the Crusade
 | 
				
			||||||
 | 
					Buff( { 53563 }, { buffType = "magic"}, "PALADIN") -- Beacon of Light
 | 
				
			||||||
 | 
					Buff( { 54149 }, { buffType = "magic"}, "PALADIN") -- Infusion of Light
 | 
				
			||||||
 | 
					Buff( { 59578 }, { buffType = "magic"}, "PALADIN") -- The Art of War
 | 
				
			||||||
 | 
					Buff( { 20925, 20927, 20928, 27179, 48951, 48952 }, { buffType = "magic"}, "PALADIN") -- Holy Shield
 | 
				
			||||||
 | 
					Buff( { 53601 }, { buffType = "magic"}, "PALADIN") -- Sacred Shield
 | 
				
			||||||
 | 
					Buff( { 54428 }, { buffType = "magic"}, "PALADIN") -- Divine Plea
 | 
				
			||||||
 | 
					Buff( { 31821 }, { buffType = "magic"}, "PALADIN") -- Aura Mastery
 | 
				
			||||||
 | 
					Buff( { 31842 }, { buffType = "magic"}, "PALADIN") -- Divine Illumination
 | 
				
			||||||
 | 
					Buff( { 20216 }, { buffType = "magic"}, "PALADIN") -- Divine Favor
 | 
				
			||||||
 | 
					Buff( { 25780 }, { buffType = "magic"}, "PALADIN") -- Righteous Fury
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--Buff( { 25771 }, { buffType = "immune"}, "PALADIN") -- Forbearance
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-------------
 | 
					-------------
 | 
				
			||||||
@@ -101,7 +221,12 @@ Buff({ 8178 } ,{ buffType = "magic" }, "SHAMAN") -- Grounding Totem Effect
 | 
				
			|||||||
-------------
 | 
					-------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Buff( { 5384 }, { buffType = "physical"}, "HUNTER") -- Feign Death
 | 
					Buff( { 5384 }, { buffType = "physical"}, "HUNTER") -- Feign Death
 | 
				
			||||||
--local FEIGN_DEATH = GetSpellInfo(5384) -- Localized name for Feign Death
 | 
					Buff( { 19263 }, { buffType = "physical"}, "HUNTER") -- Deterrence
 | 
				
			||||||
 | 
					Buff( { 3045 }, { buffType = "physical"}, "HUNTER") -- Rapid Fire
 | 
				
			||||||
 | 
					Buff( { 64420 }, { buffType = "physical"}, "HUNTER") -- Sniper Training
 | 
				
			||||||
 | 
					Buff( { 34835 }, { buffType = "physical"}, "HUNTER") -- Master Tactician
 | 
				
			||||||
 | 
					Buff( { 54216 }, { buffType = "physical"}, "HUNTER") -- Master's Call
 | 
				
			||||||
 | 
					Buff( { 34471 }, { buffType = "physical"}, "HUNTER") -- The Beast Within
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-------------
 | 
					-------------
 | 
				
			||||||
@@ -109,20 +234,50 @@ Buff( { 5384 }, { buffType = "physical"}, "HUNTER") -- Feign Death
 | 
				
			|||||||
-------------
 | 
					-------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Buff({ 66 }, { buffType = "magic"}, "MAGE") -- Invisibility
 | 
					Buff({ 66 }, { buffType = "magic"}, "MAGE") -- Invisibility
 | 
				
			||||||
Buff({ 1459 }, { buffType = "magic"}, "MAGE") -- Arcane Intellect
 | 
					Buff({ 1459, 1460, 1461, 10156, 10157, 27126, 42995 }, { buffType = "magic"}, "MAGE") -- Arcane Intellect
 | 
				
			||||||
Buff({ 130 }, { buffType = "magic"}, "MAGE") -- Slow Fall
 | 
					Buff({ 130 }, { buffType = "magic"}, "MAGE") -- Slow Fall
 | 
				
			||||||
Buff({ 604 }, { buffType = "magic"}, "MAGE") -- Dampen Magic
 | 
					Buff({ 604, 8450, 8451, 10173, 10174, 33944, 43015 }, { buffType = "magic"}, "MAGE") -- Dampen Magic
 | 
				
			||||||
Buff({ 1008 }, { buffType = "magic"}, "MAGE") -- Amplify Magic
 | 
					Buff({ 1008, 8455, 10169, 10170, 27130, 33946, 43017,  }, { buffType = "magic"}, "MAGE") -- Amplify Magic
 | 
				
			||||||
Buff({ 1463 }, { buffType = "magic"}, "MAGE") -- Mana Shield
 | 
					Buff({ 1463, 8494, 8495, 10191, 10192, 10193, 27131, 43019, 43020 }, { buffType = "magic"}, "MAGE") -- Mana Shield
 | 
				
			||||||
Buff({ 6117 }, { buffType = "form"}, "MAGE") -- Mage Armor
 | 
					Buff({ 6117, 22782, 22783, 27125, 43023, 43024 }, { buffType = "form"}, "MAGE") -- Mage Armor
 | 
				
			||||||
Buff({ 31643 }, { buffType = "magic"}, "MAGE") -- Blazing Speed
 | 
					Buff({ 31643 }, { buffType = "magic"}, "MAGE") -- Blazing Speed
 | 
				
			||||||
Buff({ 543 }, { buffType = "magic"}, "MAGE") -- Fire Ward
 | 
					Buff({ 543, 8457, 8458, 10223, 10225, 27128, 43010 }, { buffType = "magic"}, "MAGE") -- Fire Ward
 | 
				
			||||||
Buff({ 11129 }, { buffType = "magic"}, "MAGE") -- Combustion
 | 
					Buff({ 11129 }, { buffType = "magic"}, "MAGE") -- Combustion
 | 
				
			||||||
Buff({ 30482 }, { buffType = "form"}, "MAGE") -- Molten Armor
 | 
					Buff({ 30482, 43045, 43046 }, { buffType = "form"}, "MAGE") -- Molten Armor
 | 
				
			||||||
Buff({ 168 }, { buffType = "form"}, "MAGE") -- Frost Armor
 | 
					Buff({ 168, 7300, 7301 }, { buffType = "form"}, "MAGE") -- Frost Armor
 | 
				
			||||||
Buff({ 7302 }, { buffType = "form"}, "MAGE") -- Ice Armor
 | 
					Buff({ 7302, 7320, 10219, 10220, 27124, 43008 }, { buffType = "form"}, "MAGE") -- Ice Armor
 | 
				
			||||||
Buff({ 45438 }, { buffType = "immune"}, "MAGE") -- Ice Block
 | 
					Buff({ 45438 }, { buffType = "immune"}, "MAGE") -- Ice Block
 | 
				
			||||||
Buff({ 6143 }, { buffType = "magic"}, "MAGE") -- Frost Ward
 | 
					Buff({ 6143, 32796, 8462, 28609, 10177, 43012, 8461 }, { buffType = "magic"}, "MAGE") -- Frost Ward
 | 
				
			||||||
--talents
 | 
					--talents
 | 
				
			||||||
Buff({ 11426 }, { buffType = "magic"}, "MAGE") -- Ice Barrier
 | 
					Buff({ 11426, 13031, 13032, 13033, 27134, 33405, 43038, 43039 }, { buffType = "magic"}, "MAGE") -- Ice Barrier
 | 
				
			||||||
Buff({ 12472 }, { buffType = "magic"}, "MAGE") -- Icy Veins
 | 
					Buff({ 12472 }, { buffType = "magic"}, "MAGE") -- Icy Veins
 | 
				
			||||||
 | 
					Buff({ 74396 }, { buffType = "magic"}, "MAGE") -- Fingers of Frost
 | 
				
			||||||
 | 
					Buff({ 57761 }, { buffType = "magic"}, "MAGE") -- FireBall!
 | 
				
			||||||
 | 
					Buff({ 44413 }, { buffType = "magic"}, "MAGE") -- Incanter's Absorption
 | 
				
			||||||
 | 
					Buff({ 48108 }, { buffType = "magic"}, "MAGE") -- Hot Streak
 | 
				
			||||||
 | 
					Buff({ 54741 }, { buffType = "magic"}, "MAGE") -- Hot Streak
 | 
				
			||||||
 | 
					Buff({ 61316 }, { buffType = "magic"}, "MAGE") -- Dalaran Brilliance
 | 
				
			||||||
 | 
					Buff({ 44401 }, { buffType = "magic"}, "MAGE") -- Missile Barrage
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-------------
 | 
				
			||||||
 | 
					-- DEATHKNIGHT
 | 
				
			||||||
 | 
					-------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Buff({ 48707 }, { buffType = "physical"}, "DEATHKNIGHT") -- Anti-Magic Shell
 | 
				
			||||||
 | 
					Buff({ 48792 }, { buffType = "physical"}, "DEATHKNIGHT") -- Icebound Fortitude
 | 
				
			||||||
 | 
					Buff({ 49039 }, { buffType = "physical"}, "DEATHKNIGHT") -- Lichborne
 | 
				
			||||||
 | 
					Buff({ 50461 }, { buffType = "physical"}, "DEATHKNIGHT") -- Anti-Magic Zone
 | 
				
			||||||
 | 
					Buff({ 57330, 57623 }, { buffType = "physical"}, "DEATHKNIGHT") -- Horn of Winter
 | 
				
			||||||
 | 
					Buff({ 49222 }, { buffType = "physical"}, "DEATHKNIGHT") -- Bone Shield
 | 
				
			||||||
 | 
					Buff({ 49016 }, { buffType = "enrage"}, "DEATHKNIGHT") -- Unholy Frenzy
 | 
				
			||||||
 | 
					Buff({ 59052 }, { buffType = "physical"}, "DEATHKNIGHT") -- Freezing Fog
 | 
				
			||||||
 | 
					Buff({ 55233 }, { buffType = "physical"}, "DEATHKNIGHT") -- Vampiric Blood
 | 
				
			||||||
 | 
					Buff({ 51271 }, { buffType = "physical"}, "DEATHKNIGHT") -- Unbreakable Armor
 | 
				
			||||||
 | 
					Buff({ 49796 }, { buffType = "physical"}, "DEATHKNIGHT") -- Deathchill
 | 
				
			||||||
 | 
					Buff({ 50485 }, { buffType = "physical"}, "DEATHKNIGHT") -- Acclimation
 | 
				
			||||||
 | 
					Buff({ 66803 }, { buffType = "physical"}, "DEATHKNIGHT") -- Desolation
 | 
				
			||||||
 | 
					Buff({ 55610 }, { buffType = "aura"}, "DEATHKNIGHT") -- Improved Icy Talons
 | 
				
			||||||
 | 
					Buff({ 53138 }, { buffType = "aura"}, "DEATHKNIGHT") -- Abomination's Might
 | 
				
			||||||
@@ -11,126 +11,151 @@ Debuff({ 9035, 19281, 19282, 19283, 19284, 19285, 25470 }, { buffType = "curse"
 | 
				
			|||||||
Debuff({ 6788 }, { }, "PRIEST") -- Weakened Soul
 | 
					Debuff({ 6788 }, { }, "PRIEST") -- Weakened Soul
 | 
				
			||||||
Debuff({ 15487 }, { buffType = "magic" }, "PRIEST") -- Silence
 | 
					Debuff({ 15487 }, { buffType = "magic" }, "PRIEST") -- Silence
 | 
				
			||||||
Debuff({ 10797, 19296, 19299, 19302, 19303, 19304, 19305, 25446 }, { stacking = true, buffType = "magic", preEvent = "SPELL_CAST_SUCCESS" }, "PRIEST") -- starshards
 | 
					Debuff({ 10797, 19296, 19299, 19302, 19303, 19304, 19305, 25446 }, { stacking = true, buffType = "magic", preEvent = "SPELL_CAST_SUCCESS" }, "PRIEST") -- starshards
 | 
				
			||||||
Debuff({ 2944, 19276, 19277, 19278, 19279, 19280, 25467 }, { stacking = true , buffType = "disease", preEvent = "SPELL_CAST_SUCCESS"}, "PRIEST") --devouring plague
 | 
					Debuff({ 2944, 19276, 19277, 19278, 19279, 19280, 25467, 48299, 48300 }, { stacking = true , buffType = "disease", preEvent = "SPELL_CAST_SUCCESS"}, "PRIEST") --devouring plague
 | 
				
			||||||
Debuff({ 453, 8192, 10953, 25596 }, { }, "PRIEST") -- mind soothe
 | 
					Debuff({ 453, 8192, 10953, 25596 }, { }, "PRIEST") -- mind soothe
 | 
				
			||||||
Debuff({ 14914, 15261, 15262, 15263, 15264, 15265, 15266, 15267, 25384 }, { stacking = true, buffType = "magic", preEvent = "SPELL_DAMAGE"}, "PRIEST") -- Holy Fire, stacking?
 | 
					Debuff({ 14914, 15261, 15262, 15263, 15264, 15265, 15266, 15267, 25384, 48134, 48135 }, { stacking = true, buffType = "magic", preEvent = "SPELL_DAMAGE"}, "PRIEST") -- Holy Fire, stacking?
 | 
				
			||||||
Debuff({ 589, 594, 970, 992, 2767, 10892, 10893, 10894, 25367, 25368 }, { stacking = true, buffType = "magic", preEvent = "SPELL_CAST_SUCCESS"}, "PRIEST") -- SW:P
 | 
					Debuff({ 589, 594, 970, 992, 2767, 10892, 10893, 10894, 25367, 25368, 48124, 48125 }, { stacking = true, buffType = "magic", preEvent = "SPELL_CAST_SUCCESS"}, "PRIEST") -- SW:P
 | 
				
			||||||
Debuff({ 15258 } ,{ buffType = "magic" }, "PRIEST") -- Shadow Vulnerability (Shadow Weaving Talent Effect)
 | 
					Debuff({ 15258 } ,{ buffType = "magic" }, "PRIEST") -- Shadow Vulnerability (Shadow Weaving Talent Effect)
 | 
				
			||||||
Debuff({ 15286 } ,{ buffType = "magic" }, "PRIEST") -- Vampiric Embrace
 | 
					Debuff({ 15286 } ,{ buffType = "magic" }, "PRIEST") -- Vampiric Embrace
 | 
				
			||||||
Debuff({ 15407, 17311, 17312, 17313, 17314, 18807, 25387 }, { buffType = "magic" }, "PRIEST") -- Mind Flay
 | 
					Debuff({ 34914, 34916, 34917, 48159, 48160 }, { buffType = "magic"}, "PRIEST") -- Vampiric Touch
 | 
				
			||||||
 | 
					Debuff({ 15407, 17311, 17312, 17313, 17314, 18807, 25387, 48155, 48156 }, { buffType = "magic" }, "PRIEST") -- Mind Flay
 | 
				
			||||||
Debuff({ 605, 10911, 10912 }, { buffType = "magic" }, "PRIEST") -- Mind Control
 | 
					Debuff({ 605, 10911, 10912 }, { buffType = "magic" }, "PRIEST") -- Mind Control
 | 
				
			||||||
Debuff({ 8122, 8124, 10888, 10890 }, { buffType = "magic", }, "PRIEST") -- Psychic Scream
 | 
					Debuff({ 8122, 8124, 10888, 10890 }, { buffType = "magic", }, "PRIEST") -- Psychic Scream
 | 
				
			||||||
Debuff({ 15269 }, { buffType = "magic"}, "PRIEST")
 | 
					Debuff({ 15269 }, { buffType = "magic"}, "PRIEST") -- Blackout
 | 
				
			||||||
 | 
					Debuff({ 44041, 44043, 44044, 44045, 44046, 44047 }, { buffType = "magic"}, "PRIEST") -- Chastise
 | 
				
			||||||
 | 
					Debuff({ 48045, 53023 }, {stacking = true, buffType = "magic", preEvent = "SPELL_CAST_SUCCESS"}, "PRIEST") -- Mind Sear
 | 
				
			||||||
 | 
					Debuff({ 64044 }, { buffType = "magic" }, "PRIEST") -- Psychic Horror
 | 
				
			||||||
 | 
					Debuff({ 64058 }, { buffType = "physical" }, "PRIEST") -- Psychic Horror Disarm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
---------------
 | 
					---------------
 | 
				
			||||||
-- DRUID
 | 
					-- DRUID
 | 
				
			||||||
---------------
 | 
					---------------
 | 
				
			||||||
Debuff({ 33786 }, { buffType = "immune"}, "DRUID") -- Cyclone
 | 
					Debuff({ 33786 }, { buffType = "immune"}, "DRUID") -- Cyclone
 | 
				
			||||||
Debuff({ 19675 }, { }, "DRUID") -- Feral Charge
 | 
					Debuff({ 19675 }, { }, "DRUID") -- Feral Charge
 | 
				
			||||||
Debuff( { 22570}, { buffType = "physical"}, "DRUID") -- Maim
 | 
					Debuff({ 22570, 49802}, { buffType = "physical"}, "DRUID") -- Maim
 | 
				
			||||||
Debuff({ 19975, 19974, 19973, 19972, 19971, 19970, 27010 }, { buffType = "magic", altName = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689))  }, "DRUID") -- Nature's Grasp root
 | 
					Debuff({ 19975, 19974, 19973, 19972, 19971, 19970, 27010, 53313 }, { buffType = "magic", altName = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689))  }, "DRUID") -- Nature's Grasp root
 | 
				
			||||||
Debuff({ 339, 1062, 5195, 5196, 9852, 9853, 26989 }, { buffType = "magic"}, "DRUID") -- Entangling Roots
 | 
					Debuff({ 339, 1062, 5195, 5196, 9852, 9853, 26989 }, { buffType = "magic"}, "DRUID") -- Entangling Roots
 | 
				
			||||||
Debuff({ 770, 778, 9749, 9907, 26993 }, { buffType = "magic"  }, "DRUID") -- Faerie Fire
 | 
					Debuff({ 770, 778, 9749, 9907, 26993 }, { buffType = "magic"  }, "DRUID") -- Faerie Fire
 | 
				
			||||||
Debuff({ 16857, 17390, 17391, 17392, 27011 }, { buffType = "magic"  }, "DRUID") -- Faerie Fire (Feral)
 | 
					Debuff({ 16857, 17390, 17391, 17392, 27011 }, { buffType = "magic"  }, "DRUID") -- Faerie Fire (Feral)
 | 
				
			||||||
Debuff({ 2637, 18657, 18658 }, { buffType = "magic"}, "DRUID") -- Hibernate
 | 
					Debuff({ 2637, 18657, 18658 }, { buffType = "magic"}, "DRUID") -- Hibernate
 | 
				
			||||||
Debuff({ 99, 1735, 9490, 9747, 9898, 26998 }, { buffType = "physical" }, "DRUID") -- Demoralizing Roar
 | 
					Debuff({ 99, 1735, 9490, 9747, 9898, 26998, 48559, 48560 }, { buffType = "physical" }, "DRUID") -- Demoralizing Roar
 | 
				
			||||||
Debuff({ 5209 }, { buffType = "physical"  }, "DRUID") -- Challenging Roar
 | 
					Debuff({ 5209 }, { buffType = "physical"  }, "DRUID") -- Challenging Roar
 | 
				
			||||||
Debuff({ 6795 }, { stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Taunt
 | 
					Debuff({ 6795 }, { stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Taunt
 | 
				
			||||||
Debuff({ 16922 }, { buffType = "physical" }, "DRUID") -- Imp Starfire Stun
 | 
					Debuff({ 16922 }, { buffType = "physical" }, "DRUID") -- Imp Starfire Stun
 | 
				
			||||||
Debuff({ 9005, 9823, 9827, 27006 }, { buffType = "physical" }, "DRUID") -- Pounce
 | 
					Debuff({ 9005, 9823, 9827, 27006, 49803 }, { buffType = "physical" }, "DRUID") -- Pounce
 | 
				
			||||||
Debuff({ 9007, 9824, 9826, 27007 }, { buffType = "physical", stacking = true, preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Pounce Bleed
 | 
					Debuff({ 9007, 9824, 9826, 27007, 49804 }, { buffType = "physical", stacking = true, preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Pounce Bleed
 | 
				
			||||||
Debuff({ 8921, 8924, 8925, 8926, 8927, 8928, 8929, 9833, 9834, 9835, 26987, 26988 }, { stacking = true, buffType = "magic"}, "DRUID") -- Moonfire
 | 
					Debuff({ 8921, 8924, 8925, 8926, 8927, 8928, 8929, 9833, 9834, 9835, 26987, 26988, 48462, 48463 }, { stacking = true, buffType = "magic"}, "DRUID") -- Moonfire
 | 
				
			||||||
Debuff({ 1822, 1823, 1824, 9904, 27003 }, { stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Rake
 | 
					Debuff({ 1822, 1823, 1824, 9904, 27003, 48573, 48574, 59886 }, { stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Rake
 | 
				
			||||||
Debuff({ 1079, 9492, 9493, 9752, 9894, 9896, 27008 }, { stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Rip
 | 
					Debuff({ 1079, 9492, 9493, 9752, 9894, 9896, 27008, 49799, 49800 }, { stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Rip
 | 
				
			||||||
Debuff({ 5570, 24974, 24975, 24976, 24977, 27013 }, { stacking = true, buffType = "magic", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Insect Swarm
 | 
					Debuff({ 5570, 24974, 24975, 24976, 24977, 27013, 48468 }, { stacking = true, buffType = "magic", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Insect Swarm
 | 
				
			||||||
Debuff({ 33745 }, { stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Lacerate
 | 
					Debuff({ 33745, 48567, 48568 }, { stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Lacerate
 | 
				
			||||||
 | 
					Debuff({ 33878, 33986, 33987, 48563, 48564 }, { buffType = "physical" }, "DRUID") -- Mangle (Bear)
 | 
				
			||||||
 | 
					Debuff({ 33876, 33982, 33983, 48565, 48566 }, { buffType = "physical" }, "DRUID") -- Mangle (Cat)
 | 
				
			||||||
 | 
					Debuff({ 60433 }, { buffType = "magic" }, "DRUID") -- Earth and Moon
 | 
				
			||||||
 | 
					Debuff({ 58181 }, { buffType = "physical" }, "DRUID") -- Infected Wounds
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-------------
 | 
					-------------
 | 
				
			||||||
-- WARRIOR
 | 
					-- WARRIOR
 | 
				
			||||||
-------------
 | 
					-------------
 | 
				
			||||||
Debuff({ 29703 }, { buffType = "physical"}, "WARRIOR") -- Dazed
 | 
					Debuff({ 29703 }, { buffType = "physical"}, "WARRIOR") -- Dazed
 | 
				
			||||||
Debuff({ 12294, 21551, 21552, 21553, 25248, 30330 }, { buffType = "physical" }, "WARRIOR") -- Mortal Strike
 | 
					Debuff({ 12294, 21551, 21552, 21553, 25248, 30330, 47485, 47486 }, { buffType = "physical" }, "WARRIOR") -- Mortal Strike
 | 
				
			||||||
Debuff({ 72, 1671, 1672, 29704}, { buffType = "physical" }, "WARRIOR") -- Shield Bash
 | 
					Debuff({ 72, 1671, 1672, 29704 }, { buffType = "physical" }, "WARRIOR") -- Shield Bash
 | 
				
			||||||
Debuff({ 18498 }, { buffType = "physical" }, "WARRIOR") -- Improved Shield Bash
 | 
					Debuff({ 18498 }, { buffType = "physical" }, "WARRIOR") -- Improved Shield Bash
 | 
				
			||||||
Debuff({ 772, 6546, 6547, 6548, 11572, 11573, 11574, 25208 }, { stacking = true, buffType = "physical"}, "WARRIOR") -- Rend
 | 
					Debuff({ 772, 6546, 6547, 6548, 11572, 11573, 11574, 25208, 46845, 47465 }, { stacking = true, buffType = "physical"}, "WARRIOR") -- Rend
 | 
				
			||||||
Debuff({ 12721, 43104 }, { stacking = true, buffType = "physical"}, "WARRIOR") -- Deep Wounds
 | 
					Debuff({ 12721, 43104,  }, { stacking = true, buffType = "physical"}, "WARRIOR") -- Deep Wounds
 | 
				
			||||||
Debuff({ 12323 }, { buffType = "physical"}, "WARRIOR") -- Piercing Howl
 | 
					Debuff({ 12323 }, { buffType = "physical"}, "WARRIOR") -- Piercing Howl
 | 
				
			||||||
Debuff({ 1715, 7372, 7373, 25212 }, { buffType = "physical" }, "WARRIOR") -- Hamstring
 | 
					Debuff({ 1715, 7372, 7373, 25212 }, { buffType = "physical" }, "WARRIOR") -- Hamstring
 | 
				
			||||||
Debuff({ 23694 } , { buffType = "physical" }, "WARRIOR") -- Improved Hamstring
 | 
					Debuff({ 23694 } , { buffType = "physical" }, "WARRIOR") -- Improved Hamstring
 | 
				
			||||||
Debuff({ 6343, 8198, 8204, 8205, 11580, 11581, 25264 }, { buffType = "physical"}, "WARRIOR") -- Thunder Clap
 | 
					Debuff({ 6343, 8198, 8204, 8205, 11580, 11581, 25264, 47501, 47502 }, { buffType = "physical"}, "WARRIOR") -- Thunder Clap
 | 
				
			||||||
Debuff({ 694, 7400, 7402, 20559, 20560 }, { buffType = "physical", }, "WARRIOR") -- Mocking Blow
 | 
					Debuff({ 694, 7400, 7402, 20559, 20560 }, { buffType = "physical", }, "WARRIOR") -- Mocking Blow
 | 
				
			||||||
Debuff({ 1161 } ,{ buffType = "physical", }, "WARRIOR") -- Challenging Shout
 | 
					Debuff({ 1161 } ,{ buffType = "physical", }, "WARRIOR") -- Challenging Shout
 | 
				
			||||||
Debuff({ 355 } ,{ stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "WARRIOR") -- Taunt
 | 
					Debuff({ 355 } ,{ stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "WARRIOR") -- Taunt
 | 
				
			||||||
Debuff({ 1160, 6190, 11554, 11555, 11556, 25202, 25203 }, { buffType = "physical" }, "WARRIOR") -- Demoralizing Shout, varies
 | 
					Debuff({ 1160, 6190, 11554, 11555, 11556, 25202, 25203, 47437 }, { buffType = "physical" }, "WARRIOR") -- Demoralizing Shout, varies
 | 
				
			||||||
Debuff({ 5246 }, { buffType = "physical" }, "WARRIOR") -- Intimidating Shout Fear
 | 
					Debuff({ 5246 }, { buffType = "physical" }, "WARRIOR") -- Intimidating Shout Fear
 | 
				
			||||||
Debuff({ 676 } ,{ buffType = "physical" }, "WARRIOR") -- Disarm
 | 
					Debuff({ 676 } ,{ buffType = "physical" }, "WARRIOR") -- Disarm
 | 
				
			||||||
Debuff({ 12798 } , { buffType = "physical" }, "WARRIOR") -- Imp Revenge Stun
 | 
					Debuff({ 12798 } , { buffType = "physical" }, "WARRIOR") -- Imp Revenge Stun
 | 
				
			||||||
Debuff({ 7386, 7405, 8380, 11596, 11597, 25225, buffType = "physical" }, { }, "WARRIOR") -- Sunder Armor
 | 
					Debuff({ 7386, 7405, 8380, 11596, 11597, 25225 }, { buffType = "physical" }, { }, "WARRIOR") -- Sunder Armor
 | 
				
			||||||
Debuff({ 12809 } ,{ buffType = "physical" }, "WARRIOR") -- Concussion Blow
 | 
					Debuff({ 12809 } ,{ buffType = "physical" }, "WARRIOR") -- Concussion Blow
 | 
				
			||||||
Debuff({ 7922 }, { buffType = "physical" }, "WARRIOR") -- Charge Stun
 | 
					Debuff({ 7922 }, { buffType = "physical" }, "WARRIOR") -- Charge Stun
 | 
				
			||||||
Debuff({ 20253, 20614, 20615, 25273, 25274 }, { buffType = "physical" }, "WARRIOR") -- Intercept Stun
 | 
					Debuff({ 20253, 20614, 20615, 25273, 25274, 47995 }, { buffType = "physical" }, "WARRIOR") -- Intercept Stun
 | 
				
			||||||
Debuff({ 5530 }, { buffType = "physical"}, "WARRIOR") -- Mace Stun Effect (Mace Specialization)
 | 
					Debuff({ 5530 }, { buffType = "physical"}, "WARRIOR") -- Mace Stun Effect (Mace Specialization)
 | 
				
			||||||
 | 
					Debuff({ 56112 }, { buffType = "physical"}, "WARRIOR") -- Furious Attacks
 | 
				
			||||||
 | 
					Debuff({ 18498, 74347 }, { buffType = "physical"}, "WARRIOR") -- Gag Order
 | 
				
			||||||
 | 
					Debuff({ 46857 }, { buffType = "physical"}, "WARRIOR") -- Trauma
 | 
				
			||||||
 | 
					Debuff({ 46968 }, { buffType = "physical"}, "WARRIOR") -- Shockwave
 | 
				
			||||||
 | 
					Debuff({ 64382 }, { buffType = "physical"}, "WARRIOR") -- Shattering Throw
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--------------
 | 
					--------------
 | 
				
			||||||
-- ROGUE
 | 
					-- ROGUE
 | 
				
			||||||
--------------
 | 
					--------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Debuff({ 16511, 17347, 17348, 26864 }, { buffType = "physical" }, "ROGUE") -- Hemorrhage
 | 
					Debuff({ 16511, 17347, 17348, 26864, 48660 }, { buffType = "physical" }, "ROGUE") -- Hemorrhage
 | 
				
			||||||
Debuff({ 3409, 11201 }, { buffType = "poison" }, "ROGUE") -- Crippling Poison
 | 
					Debuff({ 3409, 11201 }, { buffType = "poison" }, "ROGUE") -- Crippling Poison
 | 
				
			||||||
Debuff({ 13218, 13222, 13223, 13224, 27189 }, { buffType = "poison" }, "ROGUE") -- Wound Poison
 | 
					Debuff({ 13218, 13222, 13223, 13224, 27189, 57975 }, { buffType = "poison" }, "ROGUE") -- Wound Poison
 | 
				
			||||||
Debuff({ 26679 }, { buffType = "physical"}, "ROGUE") -- Deadly Throw Slow
 | 
					Debuff({ 26679 }, { buffType = "physical"}, "ROGUE") -- Deadly Throw Slow
 | 
				
			||||||
Debuff({ 2818, 2819, 11353, 11354, 25349, 26968, 27187 }, { stacking = true, buffType = "poison", preEvent = { { event = "SPELL_DAMAGE", spellID = 5940}, "SWING_DAMAGE" }}, "ROGUE") -- Deadly Poison
 | 
					Debuff({ 2818, 2819, 11353, 11354, 25349, 26968, 27187, 57970 }, { stacking = true, buffType = "poison", preEvent = { { event = "SPELL_DAMAGE", spellID = 5940}, "SWING_DAMAGE" }}, "ROGUE") -- Deadly Poison
 | 
				
			||||||
Debuff({ 5760, 8692, 11398 }, { buffType = "poison" }, "ROGUE") -- Mind-numbing Poison
 | 
					Debuff({ 5760, 8692, 11398 }, { buffType = "poison" }, "ROGUE") -- Mind-numbing Poison
 | 
				
			||||||
Debuff({ 18425 }, { buffType = "physical" }, "ROGUE") -- Improved Kick Silence
 | 
					Debuff({ 18425 }, { buffType = "physical" }, "ROGUE") -- Improved Kick Silence
 | 
				
			||||||
Debuff({ 1833 }, { buffType = "physical" }, "ROGUE") -- Cheap Shot
 | 
					Debuff({ 1833 }, { buffType = "physical" }, "ROGUE") -- Cheap Shot
 | 
				
			||||||
Debuff({ 2070, 6770, 11297 }, { buffType = "physical" }, "ROGUE") -- Sap
 | 
					Debuff({ 2070, 6770, 11297 }, { buffType = "physical" }, "ROGUE") -- Sap
 | 
				
			||||||
Debuff({ 2094 } , { buffType = "physical" }, "ROGUE") -- Blind
 | 
					Debuff({ 2094 } , { buffType = "physical" }, "ROGUE") -- Blind
 | 
				
			||||||
Debuff({ 8647, 8649, 8650, 11197, 11198, 26866 }, { buffType = "physical" }, "ROGUE") -- Expose Armor
 | 
					Debuff({ 8647, 8649, 8650, 11197, 11198, 26866 }, { buffType = "physical" }, "ROGUE") -- Expose Armor
 | 
				
			||||||
Debuff({ 703, 8631, 8632, 8633, 11289, 11290, 26839, 26884 }, { buffType = "physical", stacking = true, preEvent = "SPELL_CAST_SUCCESS"}, "ROGUE") -- Garrote
 | 
					Debuff({ 703, 8631, 8632, 8633, 11289, 11290, 26839, 26884, 48676 }, { buffType = "physical", stacking = true, preEvent = "SPELL_CAST_SUCCESS"}, "ROGUE") -- Garrote
 | 
				
			||||||
Debuff({ 1330 }, { buffType = "physical"}, "ROGUE")-- Garrote - Silence
 | 
					Debuff({ 1330 }, { buffType = "physical"}, "ROGUE")-- Garrote - Silence
 | 
				
			||||||
Debuff({ 408, 8643 }, { buffType = "physical" }, "ROGUE") -- Kidney Shot
 | 
					Debuff({ 408, 8643 }, { buffType = "physical" }, "ROGUE") -- Kidney Shot
 | 
				
			||||||
Debuff({ 1943, 8639, 8640, 11273, 11274, 11275, 26867 }, { buffType = "physical", stacking = true}, "ROGUE") -- Rupture
 | 
					Debuff({ 1943, 8639, 8640, 11273, 11274, 11275, 26867, 48671, 48672 }, { buffType = "physical", stacking = true}, "ROGUE") -- Rupture
 | 
				
			||||||
Debuff({ 1776, 1777, 8629, 11285, 11286, 38764 }, { buffType = "physical", }, "ROGUE") -- Gouge
 | 
					Debuff({ 1776, 1777, 8629, 11285, 11286, 38764 }, { buffType = "physical", }, "ROGUE") -- Gouge
 | 
				
			||||||
Debuff({ 14251 } , { buffType = "physical", }, "ROGUE") -- Riposte (disarm)
 | 
					Debuff({ 14251 } , { buffType = "physical", }, "ROGUE") -- Riposte (disarm)
 | 
				
			||||||
 | 
					Debuff({ 51693 } , { buffType = "physical", }, "ROGUE") -- Waylay
 | 
				
			||||||
 | 
					Debuff({ 51585 } , { buffType = "physical", }, "ROGUE") -- Blade Twisting
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
------------
 | 
					------------
 | 
				
			||||||
-- WARLOCK
 | 
					-- WARLOCK
 | 
				
			||||||
------------
 | 
					------------
 | 
				
			||||||
Debuff({ 32386 }, { buffType = "magic"}, "WARLOCK") -- Shadow Embrace
 | 
					Debuff({ 32386 }, { buffType = "magic"}, "WARLOCK") -- Shadow Embrace
 | 
				
			||||||
Debuff({ 710, 18647 } ,{ buffType = "immune"}, "WARLOCK") -- Banish
 | 
					Debuff({ 710, 18647 } ,{ buffType = "immune"}, "WARLOCK") -- Banish
 | 
				
			||||||
Debuff( { 348, 707, 1094, 2941, 11665, 11667, 11668, 25309, 27215 }, { buffType = "magic", stacking = true, preEvent = "SPELL_DAMAGE"}, "WARLOCK") -- Immolate
 | 
					Debuff( { 348, 707, 1094, 2941, 11665, 11667, 11668, 25309, 27215, 47810, 47811 }, { buffType = "magic", stacking = true, preEvent = "SPELL_DAMAGE"}, "WARLOCK") -- Immolate
 | 
				
			||||||
Debuff({ 24259 } ,{ buffType = "magic" }, "WARLOCK") -- Spell Lock Silence
 | 
					Debuff({ 24259 } ,{ buffType = "magic" }, "WARLOCK") -- Spell Lock Silence
 | 
				
			||||||
Debuff({ 27243 } ,{ buffType = "magic", stacking = true, preEvent = "SPELL_CAST_START" }, "WARLOCK") -- Seed of Corruption
 | 
					Debuff({ 27243 } ,{ buffType = "magic", stacking = true, preEvent = "SPELL_CAST_START" }, "WARLOCK") -- Seed of Corruption
 | 
				
			||||||
Debuff( { 689, 699, 709, 7651, 11699, 11700, 27219, 27220 }, { buffType = "magic", stacking = true, preEvent = "SPELL_CAST_SUCCESS"}, "WARLOCK") -- Drain Life
 | 
					Debuff( { 689, 699, 709, 7651, 11699, 11700, 27219, 27220, 47857 }, { buffType = "magic", stacking = true, preEvent = "SPELL_CAST_SUCCESS"}, "WARLOCK") -- Drain Life
 | 
				
			||||||
Debuff( { 5138, 6226, 11703, 11704, 27221, 30908 }, { buffType = "magic", stacking = true, preEvent = "SPELL_CAST_SUCCESS"}, "WARLOCK") -- Drain Mana
 | 
					Debuff( { 5138, 6226, 11703, 11704, 27221, 30908 }, { buffType = "magic", stacking = true, preEvent = "SPELL_CAST_SUCCESS"}, "WARLOCK") -- Drain Mana
 | 
				
			||||||
Debuff( { 1120, 8288, 8289, 11675, 27217 }, { buffType = "magic", stacking = true, preEvent = "SPELL_CAST_SUCCESS"}, "WARLOCK") -- Drain Soul
 | 
					Debuff( { 1120, 8288, 8289, 11675, 27217, 47855 }, { buffType = "magic", stacking = true, preEvent = "SPELL_CAST_SUCCESS"}, "WARLOCK") -- Drain Soul
 | 
				
			||||||
Debuff( { 18265, 18879, 18880, 18881, 27264, 30911}, { buffType = "magic", stacking = true, preEvent = "SPELL_CAST_SUCCESS"}, "WARLOCK") -- Siphon Life
 | 
					Debuff( { 18265, 18879, 18880, 18881, 27264, 30911}, { buffType = "magic", stacking = true, preEvent = "SPELL_CAST_SUCCESS"}, "WARLOCK") -- Siphon Life
 | 
				
			||||||
Debuff( { 172, 6222, 6223, 7648, 11671, 11672, 25311, 27216 }, { buffType = "magic", stacking = true }, "WARLOCK") -- Corruption
 | 
					Debuff( { 172, 6222, 6223, 7648, 11671, 11672, 25311, 27216, 47812, 47813 }, { buffType = "magic", stacking = true }, "WARLOCK") -- Corruption
 | 
				
			||||||
Debuff( { 980, 1014, 6217, 11711, 11712, 11713, 27218 }, { buffType = "curse", stacking = true, preEvent = "SPELL_CAST_SUCCESS"}, "WARLOCK") -- Curse of Agony
 | 
					Debuff( { 980, 1014, 6217, 11711, 11712, 11713, 27218, 47863, 47864 }, { buffType = "curse", stacking = true, preEvent = "SPELL_CAST_SUCCESS"}, "WARLOCK") -- Curse of Agony
 | 
				
			||||||
Debuff({ 18223, 29539, 46434 }, { buffType = "curse"}, "WARLOCK") -- Curse of Exhaustion
 | 
					Debuff({ 18223, 29539, 46434 }, { buffType = "curse"}, "WARLOCK") -- Curse of Exhaustion
 | 
				
			||||||
Debuff( { 704, 7658, 7659, 11717, 27226 }, { buffType = "curse"}, "WARLOCK") -- Curse of Recklessness
 | 
					Debuff( { 16231, 704, 7658, 7659, 11717, 27226 }, { buffType = "curse"}, "WARLOCK") -- Curse of Recklessness
 | 
				
			||||||
Debuff( { 1490, 11721, 11722, 27228 }, { buffType = "curse"}, "WARLOCK") -- Curse of the Elements
 | 
					Debuff( { 1490, 11721, 11722, 27228, 47865 }, { buffType = "curse"}, "WARLOCK") -- Curse of the Elements
 | 
				
			||||||
Debuff( { 1714, 11719 }, { buffType = "curse"}, "WARLOCK") -- Curse of Tongues
 | 
					Debuff( { 1714, 11719 }, { buffType = "curse"}, "WARLOCK") -- Curse of Tongues
 | 
				
			||||||
Debuff( { 702, 1108, 6205, 7646, 11707, 11708, 27224, 30909 }, { buffType = "curse"}, "WARLOCK") -- Curse of Weakness
 | 
					Debuff( { 702, 1108, 6205, 7646, 11707, 11708, 27224, 30909, 50511 }, { buffType = "curse"}, "WARLOCK") -- Curse of Weakness
 | 
				
			||||||
Debuff( { 603, 30910 }, { buffType = "curse"}, "WARLOCK") -- Curse of Doom
 | 
					Debuff( { 603, 30910, 47867 }, { buffType = "curse"}, "WARLOCK") -- Curse of Doom
 | 
				
			||||||
Debuff( { 6789, 17925, 17926, 27223 }, { buffType = "magic"}, "WARLOCK") -- Death Coil
 | 
					Debuff( { 6789, 17925, 17926, 27223, 47859, 47860 }, { buffType = "magic"}, "WARLOCK") -- Death Coil
 | 
				
			||||||
Debuff( { 5782, 6213, 6215 }, { buffType = "magic"}, "WARLOCK") -- Fear
 | 
					Debuff( { 5782, 6213, 6215 }, { buffType = "magic"}, "WARLOCK") -- Fear
 | 
				
			||||||
Debuff( { 5484, 17928 }, { buffType = "magic"}, "WARLOCK") -- Howl of Terror
 | 
					Debuff( { 5484, 17928 }, { buffType = "magic"}, "WARLOCK") -- Howl of Terror
 | 
				
			||||||
Debuff({ 6358 }, { buffType = "magic" }, "WARLOCK") -- Seduction
 | 
					Debuff({ 6358 }, { buffType = "magic" }, "WARLOCK") -- Seduction
 | 
				
			||||||
Debuff({ 30108, 30404, 30405 }, { buffType = "magic", stacking = true, preEvent = "SPELL_CAST_START" }, "WARLOCK") -- Unstable Affliction
 | 
					Debuff({ 30108, 30404, 30405, 47841, 47843 }, { buffType = "magic", stacking = true, preEvent = "SPELL_CAST_START" }, "WARLOCK") -- Unstable Affliction
 | 
				
			||||||
Debuff({ 31117, 43523 }, { buffType = "magic", altName = select(1, GetSpellInfo(30405)) .. " Silence" }, "WARLOCK") -- Unstable Affliction Silence
 | 
					Debuff({ 31117, 43523, 65813 }, { buffType = "magic", altName = select(1, GetSpellInfo(30405)) .. " Silence" }, "WARLOCK") -- Unstable Affliction Silence
 | 
				
			||||||
Debuff({ 18093 } ,{ buffType = "physical" }, "WARLOCK") -- Pyroclasm
 | 
					Debuff({ 18093 } ,{ buffType = "physical" }, "WARLOCK") -- Pyroclasm
 | 
				
			||||||
Debuff({ 17877, 18867, 18868, 18869, 18870, 18871, 27263, 30546 }, { buffType = "physical", stacking = true, preEvent = "SPELL_CAST_SUCCESS" }, "WARLOCK") -- Shadowburn Debuff
 | 
					Debuff({ 17877, 18867, 18868, 18869, 18870, 18871, 27263, 30546, 47826, 47827 }, { buffType = "physical", stacking = true, preEvent = "SPELL_CAST_SUCCESS" }, "WARLOCK") -- Shadowburn Debuff
 | 
				
			||||||
 | 
					Debuff({ 47960, 61291 } ,{ buffType = "magic" }, "WARLOCK") -- Shadowflame dot
 | 
				
			||||||
 | 
					Debuff({ 63311 } ,{ buffType = "physical" }, "WARLOCK") -- Shadowflame slow
 | 
				
			||||||
 | 
					Debuff({ 48181, 59161, 59163, 59164 }, { buffType = "magic" }, "WARLOCK") -- Haunt
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
---------------
 | 
					---------------
 | 
				
			||||||
-- SHAMAN
 | 
					-- SHAMAN
 | 
				
			||||||
---------------
 | 
					---------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Debuff({ 17364 } ,{ buffType = "magic" }, "SHAMAN") -- Stormstrike
 | 
					Debuff({ 17364 } ,{ buffType = "magic" }, "SHAMAN") -- Stormstrike
 | 
				
			||||||
Debuff({ 8056, 8058, 10472, 10473, 25464 }, { buffType = "magic" }, "SHAMAN") -- Frost Shock
 | 
					Debuff({ 8056, 8058, 10472, 10473, 25464, 49235, 49236 }, { buffType = "magic" }, "SHAMAN") -- Frost Shock
 | 
				
			||||||
Debuff({ 8050, 8052, 8053, 10447, 10448, 29228, 25457 }, { stacking = true, buffType = "magic", preEvent = "SPELL_CAST_SUCCESS" }, "SHAMAN") -- Flame Shock
 | 
					Debuff({ 8050, 8052, 8053, 10447, 10448, 29228, 25457, 49232, 49233 }, { stacking = true, buffType = "magic", preEvent = "SPELL_CAST_SUCCESS" }, "SHAMAN") -- Flame Shock
 | 
				
			||||||
Debuff({ 8034, 8037, 10458, 16352, 16353, 25501 }, { buffType = "magic" }, "SHAMAN") -- Frostbrand Attack
 | 
					Debuff({ 8034, 8037, 10458, 16352, 16353, 25501, 58797, 58798, 58799 }, { buffType = "magic" }, "SHAMAN") -- Frostbrand Attack
 | 
				
			||||||
Debuff({ 3600 } ,{ buffType = "magic" }, "SHAMAN") -- Earthbind Totem
 | 
					Debuff({ 3600 } ,{ buffType = "magic" }, "SHAMAN") -- Earthbind Totem
 | 
				
			||||||
 | 
					Debuff({ 63685 } ,{ buffType = "magic" }, "SHAMAN") -- Frozen Power
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--------------
 | 
					--------------
 | 
				
			||||||
-- PALADIN
 | 
					-- PALADIN
 | 
				
			||||||
@@ -140,59 +165,94 @@ Debuff( { 25771 }, { buffType = "immune"}, "PALADIN") -- Forbearance
 | 
				
			|||||||
Debuff({ 20066 }, { buffType = "magic" }, "PALADIN") -- Repentance
 | 
					Debuff({ 20066 }, { buffType = "magic" }, "PALADIN") -- Repentance
 | 
				
			||||||
Debuff({ 2878, 5627, 5627 }, { buffType = "magic"}, "PALADIN") -- Turn Undead
 | 
					Debuff({ 2878, 5627, 5627 }, { buffType = "magic"}, "PALADIN") -- Turn Undead
 | 
				
			||||||
Debuff({ 21183, 20188, 20300, 20301, 20302, 20303, 27159 }, { }, "PALADIN") -- Judgement of the Crusader
 | 
					Debuff({ 21183, 20188, 20300, 20301, 20302, 20303, 27159 }, { }, "PALADIN") -- Judgement of the Crusader
 | 
				
			||||||
Debuff({ 20185, 20344, 20345, 20346 }, { buffType = "magic"}, "PALADIN") -- Judgement of Light
 | 
					Debuff({ 20271, 20185, 20344, 20345, 20346 }, { buffType = "magic"}, "PALADIN") -- Judgement of Light
 | 
				
			||||||
Debuff({ 20186, 20354, 20355 }, { buffType = "magic"}, "PALADIN") -- Judgement of Wisdom
 | 
					Debuff({ 20186, 20354, 20355, 53408 }, { buffType = "magic"}, "PALADIN") -- Judgement of Wisdom
 | 
				
			||||||
Debuff({ 20184, 31896}, { buffType = "magic", }, "PALADIN") -- Judgement of Justice
 | 
					Debuff({ 20184, 31896, 53407}, { buffType = "magic", }, "PALADIN") -- Judgement of Justice
 | 
				
			||||||
Debuff({ 853, 5588, 5589, 10308 }, { buffType = "magic" }, "PALADIN") -- Hammer of Justice
 | 
					Debuff({ 853, 5588, 5589, 10308 }, { buffType = "magic" }, "PALADIN") -- Hammer of Justice
 | 
				
			||||||
Debuff({ 20170 } ,{ buffType = "physical", }, "PALADIN") -- Seal of Justice stun
 | 
					Debuff({ 20170 } ,{ buffType = "physical", }, "PALADIN") -- Seal of Justice stun
 | 
				
			||||||
 | 
					Debuff({ 63529 } ,{ buffType = "magic", }, "PALADIN") -- Shield of the Templar
 | 
				
			||||||
 | 
					Debuff({ 61840 } ,{ buffType = "magic", }, "PALADIN") -- Righteous Vengeance
 | 
				
			||||||
 | 
					Debuff({ 10326 }, { buffType = "magic"}, "PALADIN") -- Turn Evil
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-------------
 | 
					-------------
 | 
				
			||||||
-- HUNTER
 | 
					-- HUNTER
 | 
				
			||||||
-------------
 | 
					-------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Debuff( { 19434, 20900, 20901, 20902, 20903, 20904}, { buffType = "physical"}, "HUNTER") -- Aimed Shot
 | 
					Debuff( { 19434, 20900, 20901, 20902, 20903, 20904, 27065, 49049, 49050}, { buffType = "physical"}, "HUNTER") -- Aimed Shot
 | 
				
			||||||
Debuff({ 1130, 14323, 14324, 14325 }, { buffType = "magic", }, "HUNTER") -- Hunter's Mark
 | 
					Debuff({ 1130, 14323, 14324, 14325, 53338 }, { buffType = "magic", }, "HUNTER") -- Hunter's Mark
 | 
				
			||||||
Debuff({ 1978, 13549, 13550, 13551, 13552, 13553, 13554, 13555, 25295, 27016 }, { stacking = true, buffType = "poison", preEvent = "SPELL_CAST_SUCCESS" }, "HUNTER") -- Serpent Sting
 | 
					Debuff({ 1978, 13549, 13550, 13551, 13552, 13553, 13554, 13555, 25295, 27016, 49000, 49001 }, { stacking = true, buffType = "poison", preEvent = "SPELL_CAST_SUCCESS" }, "HUNTER") -- Serpent Sting
 | 
				
			||||||
Debuff({ 34490 }, { buffType = "magic" }, "HUNTER") -- Silencing Shot
 | 
					Debuff({ 34490 }, { buffType = "magic" }, "HUNTER") -- Silencing Shot
 | 
				
			||||||
Debuff({ 3043 }, { buffType = "poison", }, "HUNTER") -- Scorpid Sting
 | 
					Debuff({ 3043 }, { buffType = "poison", }, "HUNTER") -- Scorpid Sting
 | 
				
			||||||
Debuff({ 3034, 14279, 14280, 27018 }, { buffType = "poison", }, "HUNTER") -- Viper Sting
 | 
					Debuff({ 3034, 14279, 14280, 27018 }, { buffType = "poison", }, "HUNTER") -- Viper Sting
 | 
				
			||||||
Debuff({ 19386, 24132, 24133, 27068 }, { buffType = "poison", }, "HUNTER") -- Wyvern Sting
 | 
					Debuff({ 19386, 24132, 24133, 27068, 49011, 49012 }, { buffType = "poison", }, "HUNTER") -- Wyvern Sting
 | 
				
			||||||
Debuff({ 24131, 24134, 24135, 27069 }, { buffType = "poison", altName = select(1, GetSpellInfo(19386)) .. " Dot" }, "HUNTER") -- Wyvern Sting Dot
 | 
					Debuff({ 24131, 24134, 24135, 27069, 49009, 49010 }, { buffType = "poison", altName = select(1, GetSpellInfo(19386)) .. " Dot" }, "HUNTER") -- Wyvern Sting Dot
 | 
				
			||||||
Debuff({ 1513, 14326, 14327 }, { buffType = "magic"}, "HUNTER") -- Scare Beast
 | 
					Debuff({ 1513, 14326, 14327 }, { buffType = "magic"}, "HUNTER") -- Scare Beast
 | 
				
			||||||
Debuff({ 19229 }, { buffType = "physical", }, "HUNTER") -- Wing Clip Root
 | 
					Debuff({ 19229, 47168 }, { buffType = "physical", }, "HUNTER") -- Wing Clip Root
 | 
				
			||||||
Debuff({ 19306, 20909, 20910 }, { buffType = "physical"}, "HUNTER") -- Counterattack
 | 
					Debuff({ 19306, 20909, 20910, 27067, 48998, 48999 }, { buffType = "physical"}, "HUNTER") -- Counterattack
 | 
				
			||||||
Debuff({ 13812, 14314, 14315, 27026 }, { stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "HUNTER") -- Explosive Trap
 | 
					Debuff({ 13812, 14314, 14315, 27026, 49064, 49065 }, { stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "HUNTER") -- Explosive Trap
 | 
				
			||||||
Debuff({ 13797, 14298, 14299, 14300, 14301, 27024 }, { stacking = true, buffType = "magic", preEvent = "SPELL_CAST_SUCCESS" }, "HUNTER") -- Immolation Trap
 | 
					Debuff({ 13797, 14298, 14299, 14300, 14301, 27024 }, { stacking = true, buffType = "magic", preEvent = "SPELL_CAST_SUCCESS" }, "HUNTER") -- Immolation Trap
 | 
				
			||||||
Debuff({ 3355, 14308, 14309 }, { buffType = "magic" }, "HUNTER") -- Freezing Trap
 | 
					Debuff({ 3355, 14308, 14309 }, { buffType = "magic" }, "HUNTER") -- Freezing Trap
 | 
				
			||||||
Debuff({ 19503 }, { buffType = "physical" }, "HUNTER") -- Scatter Shot
 | 
					Debuff({ 19503 }, { buffType = "physical" }, "HUNTER") -- Scatter Shot
 | 
				
			||||||
Debuff({ 2974, 14267, 14268 }, { buffType = "physical" }, "HUNTER") -- Wing Clip
 | 
					Debuff({ 2974 }, { buffType = "physical" }, "HUNTER") -- Wing Clip
 | 
				
			||||||
 | 
					Debuff({ 19229, 47168 }, { buffType = "physical" }, "HUNTER") -- Improved Wing Clip
 | 
				
			||||||
Debuff({ 5116 }, { buffType = "physical" }, "HUNTER") -- Concussive Shot
 | 
					Debuff({ 5116 }, { buffType = "physical" }, "HUNTER") -- Concussive Shot
 | 
				
			||||||
Debuff({ 19410 }, { buffType = "physical" }, "HUNTER") -- Conc Stun
 | 
					Debuff({ 19410 }, { buffType = "physical" }, "HUNTER") -- Conc Stun
 | 
				
			||||||
Debuff({ 24394 }, { buffType = "physical" }, "HUNTER") -- Intimidation
 | 
					Debuff({ 24394 }, { buffType = "physical" }, "HUNTER") -- Intimidation
 | 
				
			||||||
Debuff({ 15571 }, { buffType = "physical" }, "HUNTER") -- Daze from Aspect
 | 
					Debuff({ 15571 }, { buffType = "physical" }, "HUNTER") -- Daze from Aspect
 | 
				
			||||||
Debuff({ 19185 }, { buffType = "physical" }, "HUNTER") -- Entrapment
 | 
					Debuff({ 19185 }, { buffType = "physical" }, "HUNTER") -- Entrapment
 | 
				
			||||||
Debuff({ 25999 }, { buffType = "physical" }, "HUNTER") -- Boar Charge
 | 
					Debuff({ 25999 }, { buffType = "physical" }, "HUNTER") -- Boar Charge
 | 
				
			||||||
Debuff({ 24640, 24583, 24586, 24587, 27060 }, { buffType = "poison" }, "HUNTER") -- Scorpid Poison
 | 
					Debuff({ 24640, 24583, 24586, 24587, 27060, 55728 }, { buffType = "poison" }, "HUNTER") -- Scorpid Poison
 | 
				
			||||||
 | 
					Debuff({ 60053 }, { buffType = "magic" }, "HUNTER") -- Explosive Shot
 | 
				
			||||||
 | 
					Debuff({ 63468 }, { buffType = "physical" }, "HUNTER") -- Piercing Shots
 | 
				
			||||||
 | 
					Debuff({ 3674 }, { buffType = "magic" }, "HUNTER") -- Black Arrow
 | 
				
			||||||
 | 
					Debuff({ 60210 }, { buffType = "magic" }, "HUNTER") -- Freezing Arrow effect
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-------------
 | 
					-------------
 | 
				
			||||||
-- MAGE
 | 
					-- MAGE
 | 
				
			||||||
-------------
 | 
					-------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Debuff({ 133, 143, 145, 3140, 8400, 8401, 8402, 10148, 10149, 10150, 10151, 25306, 27070 }, { buffType = "magic"}, "MAGE") -- Fireball
 | 
					Debuff({ 133, 143, 145, 3140, 8400, 8401, 8402, 10148, 10149, 10150, 10151, 25306, 27070, 38692, 42832, 42833 }, { buffType = "magic"}, "MAGE") -- Fireball
 | 
				
			||||||
Debuff({ 11366, 12505, 12522, 12523, 12524, 12525, 12526, 18809, 27132, 33938 }, { buffType = "magic" }, "MAGE") -- Pyroblast
 | 
					Debuff({ 11366, 12505, 12522, 12523, 12524, 12525, 12526, 18809, 27132, 33938, 42890, 42891 }, { buffType = "magic" }, "MAGE") -- Pyroblast
 | 
				
			||||||
Debuff({ 18469 }, { buffType = "magic" }, "MAGE") -- Imp CS Silence
 | 
					Debuff({ 18469 }, { buffType = "magic" }, "MAGE") -- Imp CS Silence
 | 
				
			||||||
Debuff({ 118, 12824, 12825, 12826 }, { buffType = "magic" }, "MAGE") -- Polymorph
 | 
					Debuff({ 118, 12824, 12825, 12826, 61721, 61305, 61780 }, { buffType = "magic" }, "MAGE") -- Polymorph
 | 
				
			||||||
Debuff({ 12355 } , { buffType = "physical" }, "MAGE") -- Impact
 | 
					Debuff({ 12355 } , { buffType = "physical" }, "MAGE") -- Impact
 | 
				
			||||||
Debuff({ 12654 }, { buffType = "magic" }, "MAGE") -- Ignite
 | 
					Debuff({ 12654 }, { buffType = "magic" }, "MAGE") -- Ignite
 | 
				
			||||||
Debuff({ 22959 }, { buffType = "magic" }, "MAGE") -- Fire Vulnerability
 | 
					Debuff({ 22959 }, { buffType = "magic" }, "MAGE") -- Fire Vulnerability
 | 
				
			||||||
Debuff({ 12579 }, { buffType = "magic" }, "MAGE") -- Winter's Chill
 | 
					Debuff({ 12579 }, { buffType = "magic" }, "MAGE") -- Winter's Chill
 | 
				
			||||||
Debuff({ 11113, 13018, 13019, 13020, 13021, 27133, 33933 }, { buffType = "physical" }, "MAGE") -- Blast Wave
 | 
					Debuff({ 11113, 13018, 13019, 13020, 13021, 27133, 33933, 42944, 42945 }, { buffType = "physical" }, "MAGE") -- Blast Wave
 | 
				
			||||||
--Spell({ 2120, 2121, 8422, 8423, 10215, 10216, 27086 }, { stacking = true, buffType = "physical" }) -- Flamestrike
 | 
					--Spell({ 2120, 2121, 8422, 8423, 10215, 10216, 27086 }, { stacking = true, buffType = "physical" }) -- Flamestrike
 | 
				
			||||||
Debuff({ 120, 8492, 10159, 10160, 10161, 27087 }, { buffType = "magic" }, "MAGE") -- Cone of Cold
 | 
					Debuff({ 120, 8492, 10159, 10160, 10161, 27087, 42930, 42931 }, { buffType = "magic" }, "MAGE") -- Cone of Cold
 | 
				
			||||||
Debuff({ 12484, 12485, 12486 }, { .5 }) -- Improved Blizzard (Chilled)
 | 
					Debuff({ 12484, 12485, 12486 }, { .5 }) -- Improved Blizzard (Chilled)
 | 
				
			||||||
Debuff({ 6136, 7321, 18101, 20005, 16927, 15850, 31257}, { buffType = "magic" }, "MAGE") -- Frost/Ice Armor (Chilled)
 | 
					Debuff({ 6136, 7321, 18101, 20005, 16927, 15850, 31257}, { buffType = "magic" }, "MAGE") -- Frost/Ice Armor (Chilled)
 | 
				
			||||||
Debuff({ 116, 205, 837, 7322, 8406, 8407, 8408, 10179, 10180, 10181, 25304, 27071, 27072, 38697 }, { buffType = "magic" }, "MAGE") -- Frostbolt
 | 
					Debuff({ 116, 205, 837, 7322, 8406, 8407, 8408, 10179, 10180, 10181, 25304, 27071, 27072, 38697, 42841, 42842 }, { buffType = "magic" }, "MAGE") -- Frostbolt
 | 
				
			||||||
Debuff({ 12494 }, { buffType = "magic" }, "MAGE") -- Frostbite
 | 
					Debuff({ 12494 }, { buffType = "magic" }, "MAGE") -- Frostbite
 | 
				
			||||||
Debuff({ 122, 865, 6131, 10230 }, { buffType = "magic" }, "MAGE") -- Frost Nova
 | 
					Debuff({ 122, 865, 6131, 10230, 27088, 42917 }, { buffType = "magic" }, "MAGE") -- Frost Nova
 | 
				
			||||||
Debuff({ 31589 }, { buffType = "magic" }, "MAGE") -- Slow
 | 
					Debuff({ 31589 }, { buffType = "magic" }, "MAGE") -- Slow
 | 
				
			||||||
Debuff({ 41425 }, { buffType = "immune" }, "MAGE") -- Hypothermia
 | 
					Debuff({ 41425 }, { buffType = "immune" }, "MAGE") -- Hypothermia
 | 
				
			||||||
 | 
					Debuff({ 44572 }, { buffType = "magic" }, "MAGE") -- Deep Freeze
 | 
				
			||||||
 | 
					Debuff({ 55360 }, { buffType = "magic" }, "MAGE") -- Living Bomb
 | 
				
			||||||
 | 
					Debuff({ 64346 }, { buffType = "magic" }, "MAGE") -- Fiery Payback
 | 
				
			||||||
 | 
					Debuff({ 44614, 47610 }, { buffType = "magic" }, "MAGE") -- Frostfire Bolt
 | 
				
			||||||
 | 
					Debuff({ 31661, 33041, 33042, 33043, 42949, 42950 }, { buffType = "magic" }, "MAGE") -- Dragon's Breath
 | 
				
			||||||
 | 
					Debuff({ 36032 }, { }, "MAGE") -- Arcane Blast
 | 
				
			||||||
 | 
					Debuff({ 55080 }, { buffType = "magic" }, "MAGE") -- Shattered Barrier
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-------------
 | 
				
			||||||
 | 
					-- Death Knight
 | 
				
			||||||
 | 
					-------------
 | 
				
			||||||
 | 
					Debuff({ 55095 }, { buffType = "disease" }, "DEATHKNIGHT") -- Frost Fever
 | 
				
			||||||
 | 
					Debuff({ 55078 }, { buffType = "disease" }, "DEATHKNIGHT") -- Blood Plague
 | 
				
			||||||
 | 
					Debuff({ 50510 }, { buffType = "disease" }, "DEATHKNIGHT") -- Crypt Fever
 | 
				
			||||||
 | 
					Debuff({ 51735 }, { buffType = "disease" }, "DEATHKNIGHT") -- Ebon Plague
 | 
				
			||||||
 | 
					Debuff({ 50536 }, { buffType = "physical" }, "DEATHKNIGHT") -- Unholy Blight
 | 
				
			||||||
 | 
					Debuff({ 51209	}, { buffType = "magic" }, "DEATHKNIGHT") -- Hungering Cold
 | 
				
			||||||
 | 
					Debuff({ 47476	}, { buffType = "magic" }, "DEATHKNIGHT") -- Strangulate
 | 
				
			||||||
 | 
					Debuff({ 43265, 49936, 49937, 49938 }, { buffType = "physical" }, "DEATHKNIGHT") -- Death and decay
 | 
				
			||||||
 | 
					Debuff({ 45524 }, { buffType = "magic" }, "DEATHKNIGHT") -- Chains of Ice
 | 
				
			||||||
 | 
					Debuff({ 66803 }, { buffType = "physical" }, "DEATHKNIGHT") -- Desecration
 | 
				
			||||||
 | 
					Debuff({ 50436 }, { buffType = "physical" }, "DEATHKNIGHT") -- Icy Clutch
 | 
				
			||||||
 | 
					Debuff({ 49005 }, { buffType = "physical" }, "DEATHKNIGHT") -- Mark of Blood
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,33 +1,57 @@
 | 
				
			|||||||
local type, ipairs, pairs, tinsert = type, ipairs, pairs, tinsert
 | 
					local type, ipairs, pairs, tinsert = type, ipairs, pairs, tinsert
 | 
				
			||||||
local GetSpellInfo = GetSpellInfo
 | 
					local GetSpellInfo = GetSpellInfo
 | 
				
			||||||
 | 
					local AURA_TYPE_DEBUFF, AURA_TYPE_BUFF = AURA_TYPE_DEBUFF, AURA_TYPE_BUFF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local LibClassAuras = LibStub:NewLibrary("LibClassAuras-1.0", 1)
 | 
					local LibClassAuras = LibStub:NewLibrary("LibClassAuras-1.0", 1)
 | 
				
			||||||
LibClassAuras.debuffs = {}
 | 
					LibClassAuras.debuffs = {}
 | 
				
			||||||
LibClassAuras.debuffToId = {}
 | 
					LibClassAuras.debuffToId = {}
 | 
				
			||||||
LibClassAuras.buffs = {}
 | 
					LibClassAuras.buffs = {}
 | 
				
			||||||
LibClassAuras.buffToId = {}
 | 
					LibClassAuras.buffToId = {}
 | 
				
			||||||
 | 
					LibClassAuras.altNames = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					LibClassAuras.gameExpansion = ({
 | 
				
			||||||
 | 
					    [WOW_PROJECT_MAINLINE] = "retail",
 | 
				
			||||||
 | 
					    [WOW_PROJECT_CLASSIC] = "classic",
 | 
				
			||||||
 | 
					    [WOW_PROJECT_BURNING_CRUSADE_CLASSIC or 5] = "tbc"
 | 
				
			||||||
 | 
					})[WOW_PROJECT_ID]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function Spell(id, opts, class, spellTable, idTable)
 | 
					local function Spell(id, opts, class, spellTable, idTable)
 | 
				
			||||||
    if not opts or not class then
 | 
					    if not opts or not class then
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local lastRankID
 | 
					    local spellName
 | 
				
			||||||
    if type(id) == "table" then
 | 
					    if type(id) == "table" then
 | 
				
			||||||
        local clones = id
 | 
					        local realIds = {}
 | 
				
			||||||
        lastRankID = clones[#clones]
 | 
					        for i = 1, #id do
 | 
				
			||||||
 | 
					            if GetSpellInfo(id[i]) then
 | 
				
			||||||
 | 
					                tinsert(realIds, id[i])
 | 
				
			||||||
 | 
					                spellName = GetSpellInfo(id[i])
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        id = realIds
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        lastRankID = id
 | 
					        spellName = GetSpellInfo(id)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
    local spellName = GetSpellInfo(lastRankID)
 | 
					 | 
				
			||||||
    if not spellName then
 | 
					    if not spellName then
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    if opts.altName then
 | 
					    if opts.altName then
 | 
				
			||||||
        idTable[opts.altName] = {id = id , class = class}
 | 
					        for _,v in ipairs(id) do
 | 
				
			||||||
 | 
					            LibClassAuras.altNames[v] = opts.altName
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if idTable[opts.altName] then
 | 
				
			||||||
 | 
					            tinsert(idTable[opts.altName], {id = id , class = class})
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            idTable[opts.altName] = {[1] = {id = id , class = class}}
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        idTable[spellName] = {id = id , class = class}
 | 
					        if idTable[spellName] then
 | 
				
			||||||
 | 
					            tinsert(idTable[spellName], {id = id , class = class})
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            idTable[spellName] = {[1] = {id = id , class = class}}
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if type(id) == "table" then
 | 
					    if type(id) == "table" then
 | 
				
			||||||
@@ -53,9 +77,11 @@ LibClassAuras.Buff = Buff
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
local function getClassDebuffs(class)
 | 
					local function getClassDebuffs(class)
 | 
				
			||||||
    local classSpells = {}
 | 
					    local classSpells = {}
 | 
				
			||||||
    for k,v in pairs(LibClassAuras.debuffToId) do
 | 
					    for name, spells in pairs(LibClassAuras.debuffToId) do
 | 
				
			||||||
        if v.class == class then
 | 
					        for _, spellInfo in ipairs(spells) do
 | 
				
			||||||
            tinsert(classSpells, {name = k, id = v.id})
 | 
					            if spellInfo.class == class then
 | 
				
			||||||
 | 
					                tinsert(classSpells, {name = name, id = spellInfo.id})
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    return classSpells
 | 
					    return classSpells
 | 
				
			||||||
@@ -64,11 +90,28 @@ LibClassAuras.GetClassDebuffs = getClassDebuffs
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
local function getClassBuffs(class)
 | 
					local function getClassBuffs(class)
 | 
				
			||||||
    local classSpells = {}
 | 
					    local classSpells = {}
 | 
				
			||||||
    for k,v in pairs(LibClassAuras.buffToId) do
 | 
					    for name, spells in pairs(LibClassAuras.buffToId) do
 | 
				
			||||||
        if v.class == class then
 | 
					        for _, spellInfo in ipairs(spells) do
 | 
				
			||||||
            tinsert(classSpells, {name = k, id = v.id})
 | 
					            if spellInfo.class == class then
 | 
				
			||||||
 | 
					                tinsert(classSpells, {name = name, id = spellInfo.id})
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    return classSpells
 | 
					    return classSpells
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
LibClassAuras.GetClassBuffs = getClassBuffs
 | 
					LibClassAuras.GetClassBuffs = getClassBuffs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function getSpellNameToId(auraType)
 | 
				
			||||||
 | 
					    if auraType == AURA_TYPE_DEBUFF then
 | 
				
			||||||
 | 
					        return LibClassAuras.debuffToId
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        return LibClassAuras.buffToId
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					LibClassAuras.GetSpellNameToId = getSpellNameToId
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function getAltName(spellID)
 | 
				
			||||||
 | 
					    return LibClassAuras.altNames[spellID]
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					LibClassAuras.GetAltName = getAltName
 | 
				
			||||||
							
								
								
									
										711
									
								
								Libs/LibCustomGlow-1.0/LibCustomGlow-1.0.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										711
									
								
								Libs/LibCustomGlow-1.0/LibCustomGlow-1.0.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,711 @@
 | 
				
			|||||||
 | 
					--[[
 | 
				
			||||||
 | 
					This library contains work of Hendrick "nevcairiel" Leppkes
 | 
				
			||||||
 | 
					https://www.wowace.com/projects/libbuttonglow-1-0
 | 
				
			||||||
 | 
					]]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- luacheck: globals CreateFromMixins ObjectPoolMixin CreateTexturePool CreateFramePool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local MAJOR_VERSION = "LibCustomGlow-1.0"
 | 
				
			||||||
 | 
					local MINOR_VERSION = 16
 | 
				
			||||||
 | 
					if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end
 | 
				
			||||||
 | 
					local lib, oldversion = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION)
 | 
				
			||||||
 | 
					if not lib then return end
 | 
				
			||||||
 | 
					local Masque = LibStub("Masque", true)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local isRetail = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE
 | 
				
			||||||
 | 
					local textureList = {
 | 
				
			||||||
 | 
					    empty = [[Interface\AdventureMap\BrokenIsles\AM_29]],
 | 
				
			||||||
 | 
					    white = [[Interface\BUTTONS\WHITE8X8]],
 | 
				
			||||||
 | 
					    shine = [[Interface\ItemSocketingFrame\UI-ItemSockets]]
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local shineCoords = {0.3984375, 0.4453125, 0.40234375, 0.44921875}
 | 
				
			||||||
 | 
					if isRetail then
 | 
				
			||||||
 | 
					    textureList.shine = [[Interface\Artifacts\Artifacts]]
 | 
				
			||||||
 | 
					    shineCoords = {0.8115234375,0.9169921875,0.8798828125,0.9853515625}
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function lib.RegisterTextures(texture,id)
 | 
				
			||||||
 | 
					    textureList[id] = texture
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					lib.glowList = {}
 | 
				
			||||||
 | 
					lib.startList = {}
 | 
				
			||||||
 | 
					lib.stopList = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local GlowParent = UIParent
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local GlowMaskPool = CreateFromMixins(ObjectPoolMixin)
 | 
				
			||||||
 | 
					lib.GlowMaskPool = GlowMaskPool
 | 
				
			||||||
 | 
					local function MaskPoolFactory(maskPool)
 | 
				
			||||||
 | 
					    return maskPool.parent:CreateMaskTexture()
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local MaskPoolResetter = function(maskPool,mask)
 | 
				
			||||||
 | 
					    mask:Hide()
 | 
				
			||||||
 | 
					    mask:ClearAllPoints()
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ObjectPoolMixin.OnLoad(GlowMaskPool,MaskPoolFactory,MaskPoolResetter)
 | 
				
			||||||
 | 
					GlowMaskPool.parent =  GlowParent
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local TexPoolResetter = function(pool,tex)
 | 
				
			||||||
 | 
					    local maskNum = tex:GetNumMaskTextures()
 | 
				
			||||||
 | 
					    for i = maskNum,1 do
 | 
				
			||||||
 | 
					        tex:RemoveMaskTexture(tex:GetMaskTexture(i))
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    tex:Hide()
 | 
				
			||||||
 | 
					    tex:ClearAllPoints()
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					local GlowTexPool = CreateTexturePool(GlowParent ,"ARTWORK",7,nil,TexPoolResetter)
 | 
				
			||||||
 | 
					lib.GlowTexPool = GlowTexPool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local FramePoolResetter = function(framePool,frame)
 | 
				
			||||||
 | 
					    frame:SetScript("OnUpdate",nil)
 | 
				
			||||||
 | 
					    local parent = frame:GetParent()
 | 
				
			||||||
 | 
					    if parent[frame.name] then
 | 
				
			||||||
 | 
					        parent[frame.name] = nil
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if frame.textures then
 | 
				
			||||||
 | 
					        for _, texture in pairs(frame.textures) do
 | 
				
			||||||
 | 
					            GlowTexPool:Release(texture)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if frame.bg then
 | 
				
			||||||
 | 
					        GlowTexPool:Release(frame.bg)
 | 
				
			||||||
 | 
					        frame.bg = nil
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if frame.masks then
 | 
				
			||||||
 | 
					        for _,mask in pairs(frame.masks) do
 | 
				
			||||||
 | 
					            GlowMaskPool:Release(mask)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        frame.masks = nil
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    frame.textures = {}
 | 
				
			||||||
 | 
					    frame.info = {}
 | 
				
			||||||
 | 
					    frame.name = nil
 | 
				
			||||||
 | 
					    frame.timer = nil
 | 
				
			||||||
 | 
					    frame:Hide()
 | 
				
			||||||
 | 
					    frame:ClearAllPoints()
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					local GlowFramePool = CreateFramePool("Frame",GlowParent,nil,FramePoolResetter)
 | 
				
			||||||
 | 
					lib.GlowFramePool = GlowFramePool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function addFrameAndTex(r,color,name,key,N,xOffset,yOffset,texture,texCoord,desaturated,frameLevel)
 | 
				
			||||||
 | 
					    key = key or ""
 | 
				
			||||||
 | 
						frameLevel = frameLevel or 8
 | 
				
			||||||
 | 
					    if not r[name..key] then
 | 
				
			||||||
 | 
					        r[name..key] = GlowFramePool:Acquire()
 | 
				
			||||||
 | 
					        r[name..key]:SetParent(r)
 | 
				
			||||||
 | 
					        r[name..key].name = name..key
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    local f = r[name..key]
 | 
				
			||||||
 | 
						f:SetFrameLevel(r:GetFrameLevel()+frameLevel)
 | 
				
			||||||
 | 
					    f:SetPoint("TOPLEFT",r,"TOPLEFT",-xOffset+0.05,yOffset+0.05)
 | 
				
			||||||
 | 
					    f:SetPoint("BOTTOMRIGHT",r,"BOTTOMRIGHT",xOffset,-yOffset+0.05)
 | 
				
			||||||
 | 
					    f:Show()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if not f.textures then
 | 
				
			||||||
 | 
					        f.textures = {}
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for i=1,N do
 | 
				
			||||||
 | 
					        if not f.textures[i] then
 | 
				
			||||||
 | 
					            f.textures[i] = GlowTexPool:Acquire()
 | 
				
			||||||
 | 
					            f.textures[i]:SetTexture(texture)
 | 
				
			||||||
 | 
					            f.textures[i]:SetTexCoord(texCoord[1],texCoord[2],texCoord[3],texCoord[4])
 | 
				
			||||||
 | 
					            f.textures[i]:SetDesaturated(desaturated)
 | 
				
			||||||
 | 
					            f.textures[i]:SetParent(f)
 | 
				
			||||||
 | 
					            f.textures[i]:SetDrawLayer("ARTWORK",7)
 | 
				
			||||||
 | 
					            if not isRetail and name == "_AutoCastGlow" then
 | 
				
			||||||
 | 
					                f.textures[i]:SetBlendMode("ADD")
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        f.textures[i]:SetVertexColor(color[1],color[2],color[3],color[4])
 | 
				
			||||||
 | 
					        f.textures[i]:Show()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    while #f.textures>N do
 | 
				
			||||||
 | 
					        GlowTexPool:Release(f.textures[#f.textures])
 | 
				
			||||||
 | 
					        table.remove(f.textures)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--Pixel Glow Functions--
 | 
				
			||||||
 | 
					local pCalc1 = function(progress,s,th,p)
 | 
				
			||||||
 | 
					    local c
 | 
				
			||||||
 | 
					    if progress>p[3] or progress<p[0] then
 | 
				
			||||||
 | 
					        c = 0
 | 
				
			||||||
 | 
					    elseif progress>p[2] then
 | 
				
			||||||
 | 
					        c =s-th-(progress-p[2])/(p[3]-p[2])*(s-th)
 | 
				
			||||||
 | 
					    elseif progress>p[1] then
 | 
				
			||||||
 | 
					        c =s-th
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        c = (progress-p[0])/(p[1]-p[0])*(s-th)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    return math.floor(c+0.5)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local pCalc2 = function(progress,s,th,p)
 | 
				
			||||||
 | 
					    local c
 | 
				
			||||||
 | 
					    if progress>p[3] then
 | 
				
			||||||
 | 
					        c = s-th-(progress-p[3])/(p[0]+1-p[3])*(s-th)
 | 
				
			||||||
 | 
					    elseif progress>p[2] then
 | 
				
			||||||
 | 
					        c = s-th
 | 
				
			||||||
 | 
					    elseif progress>p[1] then
 | 
				
			||||||
 | 
					        c = (progress-p[1])/(p[2]-p[1])*(s-th)
 | 
				
			||||||
 | 
					    elseif progress>p[0] then
 | 
				
			||||||
 | 
					        c = 0
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        c = s-th-(progress+1-p[3])/(p[0]+1-p[3])*(s-th)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    return math.floor(c+0.5)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local  pUpdate = function(self,elapsed)
 | 
				
			||||||
 | 
					    self.timer = self.timer+elapsed/self.info.period
 | 
				
			||||||
 | 
					    if self.timer>1 or self.timer <-1 then
 | 
				
			||||||
 | 
					        self.timer = self.timer%1
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    local progress = self.timer
 | 
				
			||||||
 | 
					    local width,height = self:GetSize()
 | 
				
			||||||
 | 
					    if width ~= self.info.width or height ~= self.info.height then
 | 
				
			||||||
 | 
					        local perimeter = 2*(width+height)
 | 
				
			||||||
 | 
					        if not (perimeter>0) then
 | 
				
			||||||
 | 
					            return
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        self.info.width = width
 | 
				
			||||||
 | 
					        self.info.height = height
 | 
				
			||||||
 | 
					        self.info.pTLx = {
 | 
				
			||||||
 | 
					            [0] = (height+self.info.length/2)/perimeter,
 | 
				
			||||||
 | 
					            [1] = (height+width+self.info.length/2)/perimeter,
 | 
				
			||||||
 | 
					            [2] = (2*height+width-self.info.length/2)/perimeter,
 | 
				
			||||||
 | 
					            [3] = 1-self.info.length/2/perimeter
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        self.info.pTLy ={
 | 
				
			||||||
 | 
					            [0] = (height-self.info.length/2)/perimeter,
 | 
				
			||||||
 | 
					            [1] = (height+width+self.info.length/2)/perimeter,
 | 
				
			||||||
 | 
					            [2] = (height*2+width+self.info.length/2)/perimeter,
 | 
				
			||||||
 | 
					            [3] = 1-self.info.length/2/perimeter
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        self.info.pBRx ={
 | 
				
			||||||
 | 
					            [0] = self.info.length/2/perimeter,
 | 
				
			||||||
 | 
					            [1] = (height-self.info.length/2)/perimeter,
 | 
				
			||||||
 | 
					            [2] = (height+width-self.info.length/2)/perimeter,
 | 
				
			||||||
 | 
					            [3] = (height*2+width+self.info.length/2)/perimeter
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        self.info.pBRy ={
 | 
				
			||||||
 | 
					            [0] = self.info.length/2/perimeter,
 | 
				
			||||||
 | 
					            [1] = (height+self.info.length/2)/perimeter,
 | 
				
			||||||
 | 
					            [2] = (height+width-self.info.length/2)/perimeter,
 | 
				
			||||||
 | 
					            [3] = (height*2+width-self.info.length/2)/perimeter
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if self:IsShown() then
 | 
				
			||||||
 | 
					        if not (self.masks[1]:IsShown()) then
 | 
				
			||||||
 | 
					            self.masks[1]:Show()
 | 
				
			||||||
 | 
					            self.masks[1]:SetPoint("TOPLEFT",self,"TOPLEFT",self.info.th,-self.info.th)
 | 
				
			||||||
 | 
					            self.masks[1]:SetPoint("BOTTOMRIGHT",self,"BOTTOMRIGHT",-self.info.th,self.info.th)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if self.masks[2] and not(self.masks[2]:IsShown()) then
 | 
				
			||||||
 | 
					            self.masks[2]:Show()
 | 
				
			||||||
 | 
					            self.masks[2]:SetPoint("TOPLEFT",self,"TOPLEFT",self.info.th+1,-self.info.th-1)
 | 
				
			||||||
 | 
					            self.masks[2]:SetPoint("BOTTOMRIGHT",self,"BOTTOMRIGHT",-self.info.th-1,self.info.th+1)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if self.bg and not(self.bg:IsShown()) then
 | 
				
			||||||
 | 
					            self.bg:Show()
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        for k,line  in pairs(self.textures) do
 | 
				
			||||||
 | 
					            line:SetPoint("TOPLEFT",self,"TOPLEFT",pCalc1((progress+self.info.step*(k-1))%1,width,self.info.th,self.info.pTLx),-pCalc2((progress+self.info.step*(k-1))%1,height,self.info.th,self.info.pTLy))
 | 
				
			||||||
 | 
					            line:SetPoint("BOTTOMRIGHT",self,"TOPLEFT",self.info.th+pCalc2((progress+self.info.step*(k-1))%1,width,self.info.th,self.info.pBRx),-height+pCalc1((progress+self.info.step*(k-1))%1,height,self.info.th,self.info.pBRy))
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function lib.PixelGlow_Start(r,color,N,frequency,length,th,xOffset,yOffset,border,key,frameLevel)
 | 
				
			||||||
 | 
					    if not r then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if not color then
 | 
				
			||||||
 | 
					        color = {0.95,0.95,0.32,1}
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if not(N and N>0) then
 | 
				
			||||||
 | 
					        N = 8
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    local period
 | 
				
			||||||
 | 
					    if frequency then
 | 
				
			||||||
 | 
					        if not(frequency>0 or frequency<0) then
 | 
				
			||||||
 | 
					            period = 4
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            period = 1/frequency
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        period = 4
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    local width,height = r:GetSize()
 | 
				
			||||||
 | 
					    length = length or math.floor((width+height)*(2/N-0.1))
 | 
				
			||||||
 | 
					    length = min(length,min(width,height))
 | 
				
			||||||
 | 
					    th = th or 1
 | 
				
			||||||
 | 
					    xOffset = xOffset or 0
 | 
				
			||||||
 | 
					    yOffset = yOffset or 0
 | 
				
			||||||
 | 
					    key = key or ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    addFrameAndTex(r,color,"_PixelGlow",key,N,xOffset,yOffset,textureList.white,{0,1,0,1},nil,frameLevel)
 | 
				
			||||||
 | 
					    local f = r["_PixelGlow"..key]
 | 
				
			||||||
 | 
					    if not f.masks then
 | 
				
			||||||
 | 
					        f.masks = {}
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if not f.masks[1] then
 | 
				
			||||||
 | 
					        f.masks[1] = GlowMaskPool:Acquire()
 | 
				
			||||||
 | 
					        f.masks[1]:SetTexture(textureList.empty, "CLAMPTOWHITE","CLAMPTOWHITE")
 | 
				
			||||||
 | 
					        f.masks[1]:Show()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    f.masks[1]:SetPoint("TOPLEFT",f,"TOPLEFT",th,-th)
 | 
				
			||||||
 | 
					    f.masks[1]:SetPoint("BOTTOMRIGHT",f,"BOTTOMRIGHT",-th,th)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if not(border==false) then
 | 
				
			||||||
 | 
					        if not f.masks[2] then
 | 
				
			||||||
 | 
					            f.masks[2] = GlowMaskPool:Acquire()
 | 
				
			||||||
 | 
					            f.masks[2]:SetTexture(textureList.empty, "CLAMPTOWHITE","CLAMPTOWHITE")
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        f.masks[2]:SetPoint("TOPLEFT",f,"TOPLEFT",th+1,-th-1)
 | 
				
			||||||
 | 
					        f.masks[2]:SetPoint("BOTTOMRIGHT",f,"BOTTOMRIGHT",-th-1,th+1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if not f.bg then
 | 
				
			||||||
 | 
					            f.bg = GlowTexPool:Acquire()
 | 
				
			||||||
 | 
					            f.bg:SetColorTexture(0.1,0.1,0.1,0.8)
 | 
				
			||||||
 | 
					            f.bg:SetParent(f)
 | 
				
			||||||
 | 
					            f.bg:SetAllPoints(f)
 | 
				
			||||||
 | 
					            f.bg:SetDrawLayer("ARTWORK",6)
 | 
				
			||||||
 | 
					            f.bg:AddMaskTexture(f.masks[2])
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        if f.bg then
 | 
				
			||||||
 | 
					            GlowTexPool:Release(f.bg)
 | 
				
			||||||
 | 
					            f.bg = nil
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if f.masks[2] then
 | 
				
			||||||
 | 
					            GlowMaskPool:Release(f.masks[2])
 | 
				
			||||||
 | 
					            f.masks[2] = nil
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    for _,tex in pairs(f.textures) do
 | 
				
			||||||
 | 
					        if tex:GetNumMaskTextures() < 1 then
 | 
				
			||||||
 | 
					            tex:AddMaskTexture(f.masks[1])
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    f.timer = f.timer or 0
 | 
				
			||||||
 | 
					    f.info = f.info or {}
 | 
				
			||||||
 | 
					    f.info.step = 1/N
 | 
				
			||||||
 | 
					    f.info.period = period
 | 
				
			||||||
 | 
					    f.info.th = th
 | 
				
			||||||
 | 
					    if f.info.length ~= length then
 | 
				
			||||||
 | 
					        f.info.width = nil
 | 
				
			||||||
 | 
					        f.info.length = length
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    pUpdate(f, 0)
 | 
				
			||||||
 | 
					    f:SetScript("OnUpdate",pUpdate)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function lib.PixelGlow_Stop(r,key)
 | 
				
			||||||
 | 
					    if not r then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    key = key or ""
 | 
				
			||||||
 | 
					    if not r["_PixelGlow"..key] then
 | 
				
			||||||
 | 
					        return false
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        GlowFramePool:Release(r["_PixelGlow"..key])
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					table.insert(lib.glowList, "Pixel Glow")
 | 
				
			||||||
 | 
					lib.startList["Pixel Glow"] = lib.PixelGlow_Start
 | 
				
			||||||
 | 
					lib.stopList["Pixel Glow"] = lib.PixelGlow_Stop
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--Autocast Glow Funcitons--
 | 
				
			||||||
 | 
					local function acUpdate(self,elapsed)
 | 
				
			||||||
 | 
					    local width,height = self:GetSize()
 | 
				
			||||||
 | 
					    if width ~= self.info.width or height ~= self.info.height then
 | 
				
			||||||
 | 
					        if width*height == 0 then return end -- Avoid division by zero
 | 
				
			||||||
 | 
					        self.info.width = width
 | 
				
			||||||
 | 
					        self.info.height = height
 | 
				
			||||||
 | 
					        self.info.perimeter = 2*(width+height)
 | 
				
			||||||
 | 
					        self.info.bottomlim = height*2+width
 | 
				
			||||||
 | 
					        self.info.rightlim = height+width
 | 
				
			||||||
 | 
					        self.info.space = self.info.perimeter/self.info.N
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    local texIndex = 0;
 | 
				
			||||||
 | 
					    for k=1,4 do
 | 
				
			||||||
 | 
					        self.timer[k] = self.timer[k]+elapsed/(self.info.period*k)
 | 
				
			||||||
 | 
					        if self.timer[k] > 1 or self.timer[k] <-1 then
 | 
				
			||||||
 | 
					            self.timer[k] = self.timer[k]%1
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        for i = 1,self.info.N do
 | 
				
			||||||
 | 
					            texIndex = texIndex+1
 | 
				
			||||||
 | 
					            local position = (self.info.space*i+self.info.perimeter*self.timer[k])%self.info.perimeter
 | 
				
			||||||
 | 
					            if position>self.info.bottomlim then
 | 
				
			||||||
 | 
					                self.textures[texIndex]: SetPoint("CENTER",self,"BOTTOMRIGHT",-position+self.info.bottomlim,0)
 | 
				
			||||||
 | 
					            elseif position>self.info.rightlim then
 | 
				
			||||||
 | 
					                self.textures[texIndex]: SetPoint("CENTER",self,"TOPRIGHT",0,-position+self.info.rightlim)
 | 
				
			||||||
 | 
					            elseif position>self.info.height then
 | 
				
			||||||
 | 
					                self.textures[texIndex]: SetPoint("CENTER",self,"TOPLEFT",position-self.info.height,0)
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					                self.textures[texIndex]: SetPoint("CENTER",self,"BOTTOMLEFT",0,position)
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function lib.AutoCastGlow_Start(r,color,N,frequency,scale,xOffset,yOffset,key,frameLevel)
 | 
				
			||||||
 | 
					    if not r then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if not color then
 | 
				
			||||||
 | 
					        color = {0.95,0.95,0.32,1}
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if not(N and N>0) then
 | 
				
			||||||
 | 
					        N = 4
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    local period
 | 
				
			||||||
 | 
					    if frequency then
 | 
				
			||||||
 | 
					        if not(frequency>0 or frequency<0) then
 | 
				
			||||||
 | 
					            period = 8
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            period = 1/frequency
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        period = 8
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    scale = scale or 1
 | 
				
			||||||
 | 
					    xOffset = xOffset or 0
 | 
				
			||||||
 | 
					    yOffset = yOffset or 0
 | 
				
			||||||
 | 
					    key = key or ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    addFrameAndTex(r,color,"_AutoCastGlow",key,N*4,xOffset,yOffset,textureList.shine,shineCoords, true, frameLevel)
 | 
				
			||||||
 | 
					    local f = r["_AutoCastGlow"..key]
 | 
				
			||||||
 | 
					    local sizes = {7,6,5,4}
 | 
				
			||||||
 | 
					    for k,size in pairs(sizes) do
 | 
				
			||||||
 | 
					        for i = 1,N do
 | 
				
			||||||
 | 
					            f.textures[i+N*(k-1)]:SetSize(size*scale,size*scale)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    f.timer = f.timer or {0,0,0,0}
 | 
				
			||||||
 | 
					    f.info = f.info or {}
 | 
				
			||||||
 | 
					    f.info.N = N
 | 
				
			||||||
 | 
					    f.info.period = period
 | 
				
			||||||
 | 
					    f:SetScript("OnUpdate",acUpdate)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function lib.AutoCastGlow_Stop(r,key)
 | 
				
			||||||
 | 
					    if not r then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    key = key or ""
 | 
				
			||||||
 | 
					    if not r["_AutoCastGlow"..key] then
 | 
				
			||||||
 | 
					        return false
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        GlowFramePool:Release(r["_AutoCastGlow"..key])
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					table.insert(lib.glowList, "Autocast Shine")
 | 
				
			||||||
 | 
					lib.startList["Autocast Shine"] = lib.AutoCastGlow_Start
 | 
				
			||||||
 | 
					lib.stopList["Autocast Shine"] = lib.AutoCastGlow_Stop
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--Action Button Glow--
 | 
				
			||||||
 | 
					local function ButtonGlowResetter(framePool,frame)
 | 
				
			||||||
 | 
					    frame:SetScript("OnUpdate",nil)
 | 
				
			||||||
 | 
					    local parent = frame:GetParent()
 | 
				
			||||||
 | 
					    if parent._ButtonGlow then
 | 
				
			||||||
 | 
					        parent._ButtonGlow = nil
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    frame:Hide()
 | 
				
			||||||
 | 
					    frame:ClearAllPoints()
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					local ButtonGlowPool = CreateFramePool("Frame",GlowParent,nil,ButtonGlowResetter)
 | 
				
			||||||
 | 
					lib.ButtonGlowPool = ButtonGlowPool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function CreateScaleAnim(group, target, order, duration, x, y, delay)
 | 
				
			||||||
 | 
					    local scale = group:CreateAnimation("Scale")
 | 
				
			||||||
 | 
					    scale:SetChildKey(target)
 | 
				
			||||||
 | 
					    scale:SetOrder(order)
 | 
				
			||||||
 | 
					    scale:SetDuration(duration)
 | 
				
			||||||
 | 
					    scale:SetScale(x, y)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if delay then
 | 
				
			||||||
 | 
					        scale:SetStartDelay(delay)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function CreateAlphaAnim(group, target, order, duration, fromAlpha, toAlpha, delay, appear)
 | 
				
			||||||
 | 
					    local alpha = group:CreateAnimation("Alpha")
 | 
				
			||||||
 | 
					    alpha:SetChildKey(target)
 | 
				
			||||||
 | 
					    alpha:SetOrder(order)
 | 
				
			||||||
 | 
					    alpha:SetDuration(duration)
 | 
				
			||||||
 | 
					    alpha:SetFromAlpha(fromAlpha)
 | 
				
			||||||
 | 
					    alpha:SetToAlpha(toAlpha)
 | 
				
			||||||
 | 
					    if delay then
 | 
				
			||||||
 | 
					        alpha:SetStartDelay(delay)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if appear then
 | 
				
			||||||
 | 
					        table.insert(group.appear, alpha)
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        table.insert(group.fade, alpha)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function AnimIn_OnPlay(group)
 | 
				
			||||||
 | 
					    local frame = group:GetParent()
 | 
				
			||||||
 | 
					    local frameWidth, frameHeight = frame:GetSize()
 | 
				
			||||||
 | 
					    frame.spark:SetSize(frameWidth, frameHeight)
 | 
				
			||||||
 | 
					    frame.spark:SetAlpha(not(frame.color) and 1.0 or 0.3*frame.color[4])
 | 
				
			||||||
 | 
					    frame.innerGlow:SetSize(frameWidth / 2, frameHeight / 2)
 | 
				
			||||||
 | 
					    frame.innerGlow:SetAlpha(not(frame.color) and 1.0 or frame.color[4])
 | 
				
			||||||
 | 
					    frame.innerGlowOver:SetAlpha(not(frame.color) and 1.0 or frame.color[4])
 | 
				
			||||||
 | 
					    frame.outerGlow:SetSize(frameWidth * 2, frameHeight * 2)
 | 
				
			||||||
 | 
					    frame.outerGlow:SetAlpha(not(frame.color) and 1.0 or frame.color[4])
 | 
				
			||||||
 | 
					    frame.outerGlowOver:SetAlpha(not(frame.color) and 1.0 or frame.color[4])
 | 
				
			||||||
 | 
					    frame.ants:SetSize(frameWidth * 0.85, frameHeight * 0.85)
 | 
				
			||||||
 | 
					    frame.ants:SetAlpha(0)
 | 
				
			||||||
 | 
					    frame:Show()
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function AnimIn_OnFinished(group)
 | 
				
			||||||
 | 
					    local frame = group:GetParent()
 | 
				
			||||||
 | 
					    local frameWidth, frameHeight = frame:GetSize()
 | 
				
			||||||
 | 
					    frame.spark:SetAlpha(0)
 | 
				
			||||||
 | 
					    frame.innerGlow:SetAlpha(0)
 | 
				
			||||||
 | 
					    frame.innerGlow:SetSize(frameWidth, frameHeight)
 | 
				
			||||||
 | 
					    frame.innerGlowOver:SetAlpha(0.0)
 | 
				
			||||||
 | 
					    frame.outerGlow:SetSize(frameWidth, frameHeight)
 | 
				
			||||||
 | 
					    frame.outerGlowOver:SetAlpha(0.0)
 | 
				
			||||||
 | 
					    frame.outerGlowOver:SetSize(frameWidth, frameHeight)
 | 
				
			||||||
 | 
					    frame.ants:SetAlpha(not(frame.color) and 1.0 or frame.color[4])
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function AnimIn_OnStop(group)
 | 
				
			||||||
 | 
					    local frame = group:GetParent()
 | 
				
			||||||
 | 
					    local frameWidth, frameHeight = frame:GetSize()
 | 
				
			||||||
 | 
					    frame.spark:SetAlpha(0)
 | 
				
			||||||
 | 
					    frame.innerGlow:SetAlpha(0)
 | 
				
			||||||
 | 
					    frame.innerGlowOver:SetAlpha(0.0)
 | 
				
			||||||
 | 
					    frame.outerGlowOver:SetAlpha(0.0)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function bgHide(self)
 | 
				
			||||||
 | 
					    if self.animOut:IsPlaying() then
 | 
				
			||||||
 | 
					        self.animOut:Stop()
 | 
				
			||||||
 | 
					        ButtonGlowPool:Release(self)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function bgUpdate(self, elapsed)
 | 
				
			||||||
 | 
					    AnimateTexCoords(self.ants, 256, 256, 48, 48, 22, elapsed, self.throttle);
 | 
				
			||||||
 | 
					    local cooldown = self:GetParent().cooldown;
 | 
				
			||||||
 | 
					    if(cooldown and cooldown:IsShown() and cooldown:GetCooldownDuration() > 3000) then
 | 
				
			||||||
 | 
					        self:SetAlpha(0.5);
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        self:SetAlpha(1.0);
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function configureButtonGlow(f,alpha)
 | 
				
			||||||
 | 
					    f.spark = f:CreateTexture(nil, "BACKGROUND")
 | 
				
			||||||
 | 
					    f.spark:SetPoint("CENTER")
 | 
				
			||||||
 | 
					    f.spark:SetAlpha(0)
 | 
				
			||||||
 | 
					    f.spark:SetTexture([[Interface\SpellActivationOverlay\IconAlert]])
 | 
				
			||||||
 | 
					    f.spark:SetTexCoord(0.00781250, 0.61718750, 0.00390625, 0.26953125)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    -- inner glow
 | 
				
			||||||
 | 
					    f.innerGlow = f:CreateTexture(nil, "ARTWORK")
 | 
				
			||||||
 | 
					    f.innerGlow:SetPoint("CENTER")
 | 
				
			||||||
 | 
					    f.innerGlow:SetAlpha(0)
 | 
				
			||||||
 | 
					    f.innerGlow:SetTexture([[Interface\SpellActivationOverlay\IconAlert]])
 | 
				
			||||||
 | 
					    f.innerGlow:SetTexCoord(0.00781250, 0.50781250, 0.27734375, 0.52734375)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    -- inner glow over
 | 
				
			||||||
 | 
					    f.innerGlowOver = f:CreateTexture(nil, "ARTWORK")
 | 
				
			||||||
 | 
					    f.innerGlowOver:SetPoint("TOPLEFT", f.innerGlow, "TOPLEFT")
 | 
				
			||||||
 | 
					    f.innerGlowOver:SetPoint("BOTTOMRIGHT", f.innerGlow, "BOTTOMRIGHT")
 | 
				
			||||||
 | 
					    f.innerGlowOver:SetAlpha(0)
 | 
				
			||||||
 | 
					    f.innerGlowOver:SetTexture([[Interface\SpellActivationOverlay\IconAlert]])
 | 
				
			||||||
 | 
					    f.innerGlowOver:SetTexCoord(0.00781250, 0.50781250, 0.53515625, 0.78515625)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    -- outer glow
 | 
				
			||||||
 | 
					    f.outerGlow = f:CreateTexture(nil, "ARTWORK")
 | 
				
			||||||
 | 
					    f.outerGlow:SetPoint("CENTER")
 | 
				
			||||||
 | 
					    f.outerGlow:SetAlpha(0)
 | 
				
			||||||
 | 
					    f.outerGlow:SetTexture([[Interface\SpellActivationOverlay\IconAlert]])
 | 
				
			||||||
 | 
					    f.outerGlow:SetTexCoord(0.00781250, 0.50781250, 0.27734375, 0.52734375)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    -- outer glow over
 | 
				
			||||||
 | 
					    f.outerGlowOver = f:CreateTexture(nil, "ARTWORK")
 | 
				
			||||||
 | 
					    f.outerGlowOver:SetPoint("TOPLEFT", f.outerGlow, "TOPLEFT")
 | 
				
			||||||
 | 
					    f.outerGlowOver:SetPoint("BOTTOMRIGHT", f.outerGlow, "BOTTOMRIGHT")
 | 
				
			||||||
 | 
					    f.outerGlowOver:SetAlpha(0)
 | 
				
			||||||
 | 
					    f.outerGlowOver:SetTexture([[Interface\SpellActivationOverlay\IconAlert]])
 | 
				
			||||||
 | 
					    f.outerGlowOver:SetTexCoord(0.00781250, 0.50781250, 0.53515625, 0.78515625)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    -- ants
 | 
				
			||||||
 | 
					    f.ants = f:CreateTexture(nil, "OVERLAY")
 | 
				
			||||||
 | 
					    f.ants:SetPoint("CENTER")
 | 
				
			||||||
 | 
					    f.ants:SetAlpha(0)
 | 
				
			||||||
 | 
					    f.ants:SetTexture([[Interface\SpellActivationOverlay\IconAlertAnts]])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    f.animIn = f:CreateAnimationGroup()
 | 
				
			||||||
 | 
					    f.animIn.appear = {}
 | 
				
			||||||
 | 
					    f.animIn.fade = {}
 | 
				
			||||||
 | 
					    CreateScaleAnim(f.animIn, "spark",          1, 0.2, 1.5, 1.5)
 | 
				
			||||||
 | 
					    CreateAlphaAnim(f.animIn, "spark",          1, 0.2, 0, alpha, nil, true)
 | 
				
			||||||
 | 
					    CreateScaleAnim(f.animIn, "innerGlow",      1, 0.3, 2, 2)
 | 
				
			||||||
 | 
					    CreateScaleAnim(f.animIn, "innerGlowOver",  1, 0.3, 2, 2)
 | 
				
			||||||
 | 
					    CreateAlphaAnim(f.animIn, "innerGlowOver",  1, 0.3, alpha, 0, nil, false)
 | 
				
			||||||
 | 
					    CreateScaleAnim(f.animIn, "outerGlow",      1, 0.3, 0.5, 0.5)
 | 
				
			||||||
 | 
					    CreateScaleAnim(f.animIn, "outerGlowOver",  1, 0.3, 0.5, 0.5)
 | 
				
			||||||
 | 
					    CreateAlphaAnim(f.animIn, "outerGlowOver",  1, 0.3, alpha, 0, nil, false)
 | 
				
			||||||
 | 
					    CreateScaleAnim(f.animIn, "spark",          1, 0.2, 2/3, 2/3, 0.2)
 | 
				
			||||||
 | 
					    CreateAlphaAnim(f.animIn, "spark",          1, 0.2, alpha, 0, 0.2, false)
 | 
				
			||||||
 | 
					    CreateAlphaAnim(f.animIn, "innerGlow",      1, 0.2, alpha, 0, 0.3, false)
 | 
				
			||||||
 | 
					    CreateAlphaAnim(f.animIn, "ants",           1, 0.2, 0, alpha, 0.3, true)
 | 
				
			||||||
 | 
					    f.animIn:SetScript("OnPlay", AnimIn_OnPlay)
 | 
				
			||||||
 | 
					    f.animIn:SetScript("OnStop", AnimIn_OnStop)
 | 
				
			||||||
 | 
					    f.animIn:SetScript("OnFinished", AnimIn_OnFinished)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    f.animOut = f:CreateAnimationGroup()
 | 
				
			||||||
 | 
					    f.animOut.appear = {}
 | 
				
			||||||
 | 
					    f.animOut.fade = {}
 | 
				
			||||||
 | 
					    CreateAlphaAnim(f.animOut, "outerGlowOver", 1, 0.2, 0, alpha, nil, true)
 | 
				
			||||||
 | 
					    CreateAlphaAnim(f.animOut, "ants",          1, 0.2, alpha, 0, nil, false)
 | 
				
			||||||
 | 
					    CreateAlphaAnim(f.animOut, "outerGlowOver", 2, 0.2, alpha, 0, nil, false)
 | 
				
			||||||
 | 
					    CreateAlphaAnim(f.animOut, "outerGlow",     2, 0.2, alpha, 0, nil, false)
 | 
				
			||||||
 | 
					    f.animOut:SetScript("OnFinished", function(self) ButtonGlowPool:Release(self:GetParent())  end)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    f:SetScript("OnHide", bgHide)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function updateAlphaAnim(f,alpha)
 | 
				
			||||||
 | 
					    for _,anim in pairs(f.animIn.appear) do
 | 
				
			||||||
 | 
					        anim:SetToAlpha(alpha)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    for _,anim in pairs(f.animIn.fade) do
 | 
				
			||||||
 | 
					        anim:SetFromAlpha(alpha)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    for _,anim in pairs(f.animOut.appear) do
 | 
				
			||||||
 | 
					        anim:SetToAlpha(alpha)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    for _,anim in pairs(f.animOut.fade) do
 | 
				
			||||||
 | 
					        anim:SetFromAlpha(alpha)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local ButtonGlowTextures = {["spark"] = true,["innerGlow"] = true,["innerGlowOver"] = true,["outerGlow"] = true,["outerGlowOver"] = true,["ants"] = true}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function lib.ButtonGlow_Start(r,color,frequency,frameLevel)
 | 
				
			||||||
 | 
					    if not r then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
						frameLevel = frameLevel or 8;
 | 
				
			||||||
 | 
					    local throttle
 | 
				
			||||||
 | 
					    if frequency and frequency > 0 then
 | 
				
			||||||
 | 
					        throttle = 0.25/frequency*0.01
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        throttle = 0.01
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if r._ButtonGlow then
 | 
				
			||||||
 | 
					        local f = r._ButtonGlow
 | 
				
			||||||
 | 
					        local width,height = r:GetSize()
 | 
				
			||||||
 | 
					        f:SetFrameLevel(r:GetFrameLevel()+frameLevel)
 | 
				
			||||||
 | 
					        f:SetSize(width*1.4 , height*1.4)
 | 
				
			||||||
 | 
					        f:SetPoint("TOPLEFT", r, "TOPLEFT", -width * 0.2, height * 0.2)
 | 
				
			||||||
 | 
					        f:SetPoint("BOTTOMRIGHT", r, "BOTTOMRIGHT", width * 0.2, -height * 0.2)
 | 
				
			||||||
 | 
					        f.ants:SetSize(width*1.4*0.85, height*1.4*0.85)
 | 
				
			||||||
 | 
							AnimIn_OnFinished(f.animIn)
 | 
				
			||||||
 | 
							if f.animOut:IsPlaying() then
 | 
				
			||||||
 | 
					            f.animOut:Stop()
 | 
				
			||||||
 | 
					            f.animIn:Play()
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if not(color) then
 | 
				
			||||||
 | 
					            for texture in pairs(ButtonGlowTextures) do
 | 
				
			||||||
 | 
					                f[texture]:SetDesaturated(nil)
 | 
				
			||||||
 | 
					                f[texture]:SetVertexColor(1,1,1)
 | 
				
			||||||
 | 
					                f[texture]:SetAlpha(f[texture]:GetAlpha()/(f.color and f.color[4] or 1))
 | 
				
			||||||
 | 
					                updateAlphaAnim(f, 1)
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					            f.color = false
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            for texture in pairs(ButtonGlowTextures) do
 | 
				
			||||||
 | 
					                f[texture]:SetDesaturated(1)
 | 
				
			||||||
 | 
					                f[texture]:SetVertexColor(color[1],color[2],color[3])
 | 
				
			||||||
 | 
					                f[texture]:SetAlpha(f[texture]:GetAlpha()/(f.color and f.color[4] or 1)*color[4])
 | 
				
			||||||
 | 
					                updateAlphaAnim(f,color and color[4] or 1)
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					            f.color = color
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        f.throttle = throttle
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        local f, new = ButtonGlowPool:Acquire()
 | 
				
			||||||
 | 
					        if new then
 | 
				
			||||||
 | 
					            configureButtonGlow(f,color and color[4] or 1)
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            updateAlphaAnim(f,color and color[4] or 1)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        r._ButtonGlow = f
 | 
				
			||||||
 | 
					        local width,height = r:GetSize()
 | 
				
			||||||
 | 
					        f:SetParent(r)
 | 
				
			||||||
 | 
					        f:SetFrameLevel(r:GetFrameLevel()+frameLevel)
 | 
				
			||||||
 | 
					        f:SetSize(width * 1.4, height * 1.4)
 | 
				
			||||||
 | 
					        f:SetPoint("TOPLEFT", r, "TOPLEFT", -width * 0.2, height * 0.2)
 | 
				
			||||||
 | 
					        f:SetPoint("BOTTOMRIGHT", r, "BOTTOMRIGHT", width * 0.2, -height * 0.2)
 | 
				
			||||||
 | 
					        if not(color) then
 | 
				
			||||||
 | 
					            f.color = false
 | 
				
			||||||
 | 
					            for texture in pairs(ButtonGlowTextures) do
 | 
				
			||||||
 | 
					                f[texture]:SetDesaturated(nil)
 | 
				
			||||||
 | 
					                f[texture]:SetVertexColor(1,1,1)
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            f.color = color
 | 
				
			||||||
 | 
					            for texture in pairs(ButtonGlowTextures) do
 | 
				
			||||||
 | 
					                f[texture]:SetDesaturated(1)
 | 
				
			||||||
 | 
					                f[texture]:SetVertexColor(color[1],color[2],color[3])
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        f.throttle = throttle
 | 
				
			||||||
 | 
					        f:SetScript("OnUpdate", bgUpdate)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        f.animIn:Play()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if Masque and Masque.UpdateSpellAlert and (not r.overlay or not issecurevariable(r, "overlay")) then
 | 
				
			||||||
 | 
					            local old_overlay = r.overlay
 | 
				
			||||||
 | 
					            r.overlay = f
 | 
				
			||||||
 | 
					            Masque:UpdateSpellAlert(r)
 | 
				
			||||||
 | 
					            r.overlay = old_overlay
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function lib.ButtonGlow_Stop(r)
 | 
				
			||||||
 | 
					    if r._ButtonGlow then
 | 
				
			||||||
 | 
					        if r._ButtonGlow.animIn:IsPlaying() then
 | 
				
			||||||
 | 
					            r._ButtonGlow.animIn:Stop()
 | 
				
			||||||
 | 
					            ButtonGlowPool:Release(r._ButtonGlow)
 | 
				
			||||||
 | 
					        elseif r:IsVisible() then
 | 
				
			||||||
 | 
					            r._ButtonGlow.animOut:Play()
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            ButtonGlowPool:Release(r._ButtonGlow)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					table.insert(lib.glowList, "Action Button Glow")
 | 
				
			||||||
 | 
					lib.startList["Action Button Glow"] = lib.ButtonGlow_Start
 | 
				
			||||||
 | 
					lib.stopList["Action Button Glow"] = lib.ButtonGlow_Stop
 | 
				
			||||||
							
								
								
									
										12
									
								
								Libs/LibCustomGlow-1.0/LibCustomGlow-1.0.toc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								Libs/LibCustomGlow-1.0/LibCustomGlow-1.0.toc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
				
			|||||||
 | 
					## Interface: 80200
 | 
				
			||||||
 | 
					## Title: Lib: CustomGlow
 | 
				
			||||||
 | 
					## Notes: Creates custom glow functions
 | 
				
			||||||
 | 
					## Author: deezo
 | 
				
			||||||
 | 
					## X-Category: Library
 | 
				
			||||||
 | 
					## X-License: BSD
 | 
				
			||||||
 | 
					## Version: f15e6de
 | 
				
			||||||
 | 
					## OptionalDeps: Masque
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					LibStub\LibStub.lua
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					LibCustomGlow-1.0.xml
 | 
				
			||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
 | 
					<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
 | 
				
			||||||
..\FrameXML\UI.xsd">
 | 
					..\FrameXML\UI.xsd">
 | 
				
			||||||
	<Script file="DRData-1.0.lua"/>
 | 
					  <Script file = "LibCustomGlow-1.0.lua"/>
 | 
				
			||||||
</Ui>
 | 
					</Ui>
 | 
				
			||||||
							
								
								
									
										51
									
								
								Libs/LibCustomGlow-1.0/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								Libs/LibCustomGlow-1.0/README.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,51 @@
 | 
				
			|||||||
 | 
					Adds functions:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					`PixelGlow_Start(frame[, color[, N[, frequency[, length[, th[, xOffset[, yOffset[, border[ ,key]]]]]]]])`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Starts glow over target frame with set parameters:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- frame - target frame to set glowing;
 | 
				
			||||||
 | 
					- color - {r,g,b,a}, color of lines and opacity, from 0 to 1. Defaul value is {0.95, 0.95, 0.32, 1};
 | 
				
			||||||
 | 
					- N - number of lines. Defaul value is 8;
 | 
				
			||||||
 | 
					- frequency - frequency, set to negative to inverse direction of rotation. Default value is 0.25;
 | 
				
			||||||
 | 
					- length - length of lines. Default value depends on region size and number of lines;
 | 
				
			||||||
 | 
					- th - thickness of lines. Default value is 2;
 | 
				
			||||||
 | 
					- xOffset,yOffset - offset of glow relative to region border;
 | 
				
			||||||
 | 
					- border - set to true to create border under lines;
 | 
				
			||||||
 | 
					- key - key of glow, allows for multiple glows on one frame;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					`PixelGlow_Stop(frame[, key])`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Stops glow with set key over target frame
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					`AutoCastGlow_Start(frame[, color[, N[, frequency[, scale[, xOffset[, yOffset[, key]]]]]]])`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Starts glow over target frame with set parameters:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- frame - target frame to set glowing;
 | 
				
			||||||
 | 
					- color - {r,g,b,a}, color of particles and opacity, from 0 to 1. Defaul value is {0.95, 0.95, 0.32, 1};
 | 
				
			||||||
 | 
					- N - number of particle groups. Each group contains 4 particles. Defaul value is 4;
 | 
				
			||||||
 | 
					- frequency - frequency, set to negative to inverse direction of rotation. Default value is 0.125;
 | 
				
			||||||
 | 
					- scale - scale of particles;
 | 
				
			||||||
 | 
					- xOffset,yOffset - offset of glow relative to region border;
 | 
				
			||||||
 | 
					- key - key of glow, allows for multiple glows on one frame;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					`AutoCastGlow_Stop(frame[, key])`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Stops glow with set key over target frame
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Blizzard glow is based heavily on https://www.wowace.com/projects/libbuttonglow-1-0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					`ButtonGlow_Start(frame[, color[, frequency]]])`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Starts glow over target frame with set parameters:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- frame - target frame to set glowing;
 | 
				
			||||||
 | 
					- color - {r,g,b,a}, color of particles and opacity, from 0 to 1. Defaul value is {0.95, 0.95, 0.32, 1};
 | 
				
			||||||
 | 
					- frequency - frequency. Default value is 0.125;
 | 
				
			||||||
 | 
					- frameLevel - frameLevel. Default value is 8;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					`ButtonGlow_Stop(frame)`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Stops glow over target frame
 | 
				
			||||||
							
								
								
									
										232
									
								
								Libs/LibSpellRange-1.0/LibSpellRange-1.0.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										232
									
								
								Libs/LibSpellRange-1.0/LibSpellRange-1.0.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,232 @@
 | 
				
			|||||||
 | 
					--- = Background =
 | 
				
			||||||
 | 
					-- Blizzard's IsSpellInRange API has always been very limited - you either must have the name of the spell, or its spell book ID. Checking directly by spellID is simply not possible.
 | 
				
			||||||
 | 
					-- Now, in Mists of Pandaria, Blizzard changed the way that many talents and specialization spells work - instead of giving you a new spell when leaned, they replace existing spells. These replacement spells do not work with Blizzard's IsSpellInRange function whatsoever; this limitation is what prompted the creation of this lib.
 | 
				
			||||||
 | 
					-- = Usage = 
 | 
				
			||||||
 | 
					-- **LibSpellRange-1.0** exposes an enhanced version of IsSpellInRange that:
 | 
				
			||||||
 | 
					-- * Allows ranged checking based on both spell name and spellID.
 | 
				
			||||||
 | 
					-- * Works correctly with replacement spells that will not work using Blizzard's IsSpellInRange method alone.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					-- @class file
 | 
				
			||||||
 | 
					-- @name LibSpellRange-1.0.lua
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local major = "SpellRange-1.0"
 | 
				
			||||||
 | 
					local minor = 15
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					assert(LibStub, format("%s requires LibStub.", major))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local Lib = LibStub:NewLibrary(major, minor)
 | 
				
			||||||
 | 
					if not Lib then return end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local tonumber = _G.tonumber
 | 
				
			||||||
 | 
					local strlower = _G.strlower
 | 
				
			||||||
 | 
					local wipe = _G.wipe
 | 
				
			||||||
 | 
					local type = _G.type
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local GetSpellTabInfo = _G.GetSpellTabInfo
 | 
				
			||||||
 | 
					local GetNumSpellTabs = _G.GetNumSpellTabs
 | 
				
			||||||
 | 
					local GetSpellBookItemInfo = _G.GetSpellBookItemInfo
 | 
				
			||||||
 | 
					local GetSpellBookItemName = _G.GetSpellBookItemName
 | 
				
			||||||
 | 
					local GetSpellLink = _G.GetSpellLink
 | 
				
			||||||
 | 
					local GetSpellInfo = _G.GetSpellInfo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local IsSpellInRange = _G.IsSpellInRange
 | 
				
			||||||
 | 
					local SpellHasRange = _G.SpellHasRange
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- isNumber is basically a tonumber cache for maximum efficiency
 | 
				
			||||||
 | 
					Lib.isNumber = Lib.isNumber or setmetatable({}, {
 | 
				
			||||||
 | 
						__mode = "kv",
 | 
				
			||||||
 | 
						__index = function(t, i)
 | 
				
			||||||
 | 
							local o = tonumber(i) or false
 | 
				
			||||||
 | 
							t[i] = o
 | 
				
			||||||
 | 
							return o
 | 
				
			||||||
 | 
					end})
 | 
				
			||||||
 | 
					local isNumber = Lib.isNumber
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- strlower cache for maximum efficiency
 | 
				
			||||||
 | 
					Lib.strlowerCache = Lib.strlowerCache or setmetatable(
 | 
				
			||||||
 | 
					{}, {
 | 
				
			||||||
 | 
						__index = function(t, i)
 | 
				
			||||||
 | 
							if not i then return end
 | 
				
			||||||
 | 
							local o
 | 
				
			||||||
 | 
							if type(i) == "number" then
 | 
				
			||||||
 | 
								o = i
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								o = strlower(i)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							t[i] = o
 | 
				
			||||||
 | 
							return o
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					}) local strlowerCache = Lib.strlowerCache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Matches lowercase player spell names to their spellBookID
 | 
				
			||||||
 | 
					Lib.spellsByName_spell = Lib.spellsByName_spell or {}
 | 
				
			||||||
 | 
					local spellsByName_spell = Lib.spellsByName_spell
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Matches player spellIDs to their spellBookID
 | 
				
			||||||
 | 
					Lib.spellsByID_spell = Lib.spellsByID_spell or {}
 | 
				
			||||||
 | 
					local spellsByID_spell = Lib.spellsByID_spell
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Matches lowercase pet spell names to their spellBookID
 | 
				
			||||||
 | 
					Lib.spellsByName_pet = Lib.spellsByName_pet or {}
 | 
				
			||||||
 | 
					local spellsByName_pet = Lib.spellsByName_pet
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Matches pet spellIDs to their spellBookID
 | 
				
			||||||
 | 
					Lib.spellsByID_pet = Lib.spellsByID_pet or {}
 | 
				
			||||||
 | 
					local spellsByID_pet = Lib.spellsByID_pet
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Updates spellsByName and spellsByID
 | 
				
			||||||
 | 
					local function UpdateBook(bookType)
 | 
				
			||||||
 | 
						local max = 0
 | 
				
			||||||
 | 
						for i = 1, GetNumSpellTabs() do
 | 
				
			||||||
 | 
							local _, _, offs, numspells, _, specId = GetSpellTabInfo(i)
 | 
				
			||||||
 | 
							if specId == 0 then
 | 
				
			||||||
 | 
								max = offs + numspells
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						local spellsByName = Lib["spellsByName_" .. bookType]
 | 
				
			||||||
 | 
						local spellsByID = Lib["spellsByID_" .. bookType]
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						wipe(spellsByName)
 | 
				
			||||||
 | 
						wipe(spellsByID)
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						for spellBookID = 1, max do
 | 
				
			||||||
 | 
							local type, baseSpellID = GetSpellBookItemInfo(spellBookID, bookType)
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							if type == "SPELL" or type == "PETACTION" then
 | 
				
			||||||
 | 
								local currentSpellName = GetSpellBookItemName(spellBookID, bookType)
 | 
				
			||||||
 | 
								local link = GetSpellLink(currentSpellName)
 | 
				
			||||||
 | 
								local currentSpellID = tonumber(link and link:gsub("|", "||"):match("spell:(%d+)"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								-- For each entry we add to a table,
 | 
				
			||||||
 | 
								-- only add it if there isn't anything there already.
 | 
				
			||||||
 | 
								-- This prevents weird passives from overwriting real, legit spells.
 | 
				
			||||||
 | 
								-- For example, in WoW 7.3.5 the ret paladin mastery 
 | 
				
			||||||
 | 
								-- was coming back with a base spell named "Judgement",
 | 
				
			||||||
 | 
								-- which was overwriting the real "Judgement".
 | 
				
			||||||
 | 
								-- Passives usually come last in the spellbook,
 | 
				
			||||||
 | 
								-- so this should work just fine as a workaround.
 | 
				
			||||||
 | 
								-- This issue with "Judgement" is gone in BFA because the mastery changed.
 | 
				
			||||||
 | 
								
 | 
				
			||||||
 | 
								if currentSpellName and not spellsByName[strlower(currentSpellName)] then
 | 
				
			||||||
 | 
									spellsByName[strlower(currentSpellName)] = spellBookID
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								if currentSpellID and not spellsByID[currentSpellID] then
 | 
				
			||||||
 | 
									spellsByID[currentSpellID] = spellBookID
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								
 | 
				
			||||||
 | 
								if type == "SPELL" then
 | 
				
			||||||
 | 
									-- PETACTION (pet abilities) don't return a spellID for baseSpellID,
 | 
				
			||||||
 | 
									-- so base spells only work for proper player spells.
 | 
				
			||||||
 | 
									local baseSpellName = GetSpellInfo(baseSpellID)
 | 
				
			||||||
 | 
									if baseSpellName and not spellsByName[strlower(baseSpellName)] then
 | 
				
			||||||
 | 
										spellsByName[strlower(baseSpellName)] = spellBookID
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									if baseSpellID and not spellsByID[baseSpellID] then
 | 
				
			||||||
 | 
										spellsByID[baseSpellID] = spellBookID
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Handles updating spellsByName and spellsByID
 | 
				
			||||||
 | 
					if not Lib.updaterFrame then
 | 
				
			||||||
 | 
						Lib.updaterFrame = CreateFrame("Frame")
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					Lib.updaterFrame:UnregisterAllEvents()
 | 
				
			||||||
 | 
					Lib.updaterFrame:RegisterEvent("SPELLS_CHANGED")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function UpdateSpells()
 | 
				
			||||||
 | 
						UpdateBook("spell")
 | 
				
			||||||
 | 
						UpdateBook("pet")
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Lib.updaterFrame:SetScript("OnEvent", UpdateSpells)
 | 
				
			||||||
 | 
					UpdateSpells()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Improved spell range checking function.
 | 
				
			||||||
 | 
					-- @name SpellRange.IsSpellInRange
 | 
				
			||||||
 | 
					-- @paramsig spell, unit
 | 
				
			||||||
 | 
					-- @param spell Name or spellID of a spell that you wish to check the range of. The spell must be a spell that you have in your spellbook or your pet's spellbook.
 | 
				
			||||||
 | 
					-- @param unit UnitID of the spell that you wish to check the range on.
 | 
				
			||||||
 | 
					-- @return Exact same returns as http://wowprogramming.com/docs/api/IsSpellInRange
 | 
				
			||||||
 | 
					-- @usage
 | 
				
			||||||
 | 
					-- -- Check spell range by spell name on unit "target"
 | 
				
			||||||
 | 
					-- local SpellRange = LibStub("SpellRange-1.0")
 | 
				
			||||||
 | 
					-- local inRange = SpellRange.IsSpellInRange("Stormstrike", "target")
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					-- -- Check spell range by spellID on unit "mouseover"
 | 
				
			||||||
 | 
					-- local SpellRange = LibStub("SpellRange-1.0")
 | 
				
			||||||
 | 
					-- local inRange = SpellRange.IsSpellInRange(17364, "mouseover")
 | 
				
			||||||
 | 
					function Lib.IsSpellInRange(spellInput, unit)
 | 
				
			||||||
 | 
						if isNumber[spellInput] then
 | 
				
			||||||
 | 
							local spell = spellsByID_spell[spellInput]
 | 
				
			||||||
 | 
							if spell then
 | 
				
			||||||
 | 
								return IsSpellInRange(spell, "spell", unit)
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								local spell = spellsByID_pet[spellInput]
 | 
				
			||||||
 | 
								if spell then
 | 
				
			||||||
 | 
									return IsSpellInRange(spell, "pet", unit)
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							local spellInput = strlowerCache[spellInput]
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							local spell = spellsByName_spell[spellInput]
 | 
				
			||||||
 | 
							if spell then
 | 
				
			||||||
 | 
								return IsSpellInRange(spell, "spell", unit)
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								local spell = spellsByName_pet[spellInput]
 | 
				
			||||||
 | 
								if spell then
 | 
				
			||||||
 | 
									return IsSpellInRange(spell, "pet", unit)
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							return IsSpellInRange(spellInput, unit)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Improved SpellHasRange.
 | 
				
			||||||
 | 
					-- @name SpellRange.SpellHasRange
 | 
				
			||||||
 | 
					-- @paramsig spell
 | 
				
			||||||
 | 
					-- @param spell Name or spellID of a spell that you wish to check for a range. The spell must be a spell that you have in your spellbook or your pet's spellbook.
 | 
				
			||||||
 | 
					-- @return Exact same returns as http://wowprogramming.com/docs/api/SpellHasRange
 | 
				
			||||||
 | 
					-- @usage
 | 
				
			||||||
 | 
					-- -- Check if a spell has a range by spell name
 | 
				
			||||||
 | 
					-- local SpellRange = LibStub("SpellRange-1.0")
 | 
				
			||||||
 | 
					-- local hasRange = SpellRange.SpellHasRange("Stormstrike")
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					-- -- Check if a spell has a range by spellID
 | 
				
			||||||
 | 
					-- local SpellRange = LibStub("SpellRange-1.0")
 | 
				
			||||||
 | 
					-- local hasRange = SpellRange.SpellHasRange(17364)
 | 
				
			||||||
 | 
					function Lib.SpellHasRange(spellInput)
 | 
				
			||||||
 | 
						if isNumber[spellInput] then
 | 
				
			||||||
 | 
							local spell = spellsByID_spell[spellInput]
 | 
				
			||||||
 | 
							if spell then
 | 
				
			||||||
 | 
								return SpellHasRange(spell, "spell")
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								local spell = spellsByID_pet[spellInput]
 | 
				
			||||||
 | 
								if spell then
 | 
				
			||||||
 | 
									return SpellHasRange(spell, "pet")
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							local spellInput = strlowerCache[spellInput]
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							local spell = spellsByName_spell[spellInput]
 | 
				
			||||||
 | 
							if spell then
 | 
				
			||||||
 | 
								return SpellHasRange(spell, "spell")
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								local spell = spellsByName_pet[spellInput]
 | 
				
			||||||
 | 
								if spell then
 | 
				
			||||||
 | 
									return SpellHasRange(spell, "pet")
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							return SpellHasRange(spellInput)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
							
								
								
									
										61
									
								
								Libs/LibSpellRange-1.0/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								Libs/LibSpellRange-1.0/README.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,61 @@
 | 
				
			|||||||
 | 
					# LibSpellRange-1.0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## Background
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Blizzard's `IsSpellInRange` API has always been very limited - you either must have the name of the spell, 
 | 
				
			||||||
 | 
					or its spell book ID. Checking directly by spellID is simply not possible. 
 | 
				
			||||||
 | 
					Now, since Mists of Pandaria, Blizzard changed the way that many talents and specialization spells work - 
 | 
				
			||||||
 | 
					instead of giving you a new spell when leaned, they replace existing spells. These replacement spells do 
 | 
				
			||||||
 | 
					not work with Blizzard's IsSpellInRange function whatsoever; this limitation is what prompted the creation of this lib.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## Usage
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**LibSpellRange-1.0** exposes an enhanced version of IsSpellInRange that:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					*   Allows ranged checking based on both spell name and spellID.
 | 
				
			||||||
 | 
					*   Works correctly with replacement spells that will not work using Blizzard's IsSpellInRange method alone.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### `SpellRange.IsSpellInRange(spell, unit)` - Improved `IsSpellInRange`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#### Parameters
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- `spell` - Name or spellID of a spell that you wish to check the range of. The spell must be a spell that you have in your spellbook or your pet's spellbook.
 | 
				
			||||||
 | 
					- `unit` - UnitID of the spell that you wish to check the range on.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#### Return value
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Exact same returns as [the built-in `IsSpellInRange`](http://wowprogramming.com/docs/api/IsSpellInRange.html)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#### Usage
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					``` lua
 | 
				
			||||||
 | 
					-- Check spell range by spell name on unit "target"
 | 
				
			||||||
 | 
					local SpellRange = LibStub("SpellRange-1.0")
 | 
				
			||||||
 | 
					local inRange = SpellRange.IsSpellInRange("Stormstrike", "target")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Check spell range by spellID on unit "mouseover"
 | 
				
			||||||
 | 
					local SpellRange = LibStub("SpellRange-1.0")
 | 
				
			||||||
 | 
					local inRange = SpellRange.IsSpellInRange(17364, "mouseover")
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### `SpellRange.SpellHasRange(spell)` - Improved `SpellHasRange`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#### Parameters
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- `spell` - Name or spellID of a spell that you wish to check for a range. The spell must be a spell that you have in your spellbook or your pet's spellbook.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#### Return value
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Exact same returns as [the built-in `SpellHasRange`](http://wowprogramming.com/docs/api/SpellHasRange.html)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#### Usage
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					``` lua
 | 
				
			||||||
 | 
					-- Check if a spell has a range by spell name
 | 
				
			||||||
 | 
					local SpellRange = LibStub("SpellRange-1.0")
 | 
				
			||||||
 | 
					local hasRange = SpellRange.SpellHasRange("Stormstrike")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Check if a spell has a range by spellID
 | 
				
			||||||
 | 
					local SpellRange = LibStub("SpellRange-1.0")
 | 
				
			||||||
 | 
					local hasRange = SpellRange.SpellHasRange(17364)
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
							
								
								
									
										3
									
								
								Libs/LibSpellRange-1.0/lib.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								Libs/LibSpellRange-1.0/lib.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
				
			|||||||
 | 
					<Ui>
 | 
				
			||||||
 | 
						<Script file="LibSpellRange-1.0.lua"/>
 | 
				
			||||||
 | 
					</Ui>
 | 
				
			||||||
@@ -16,17 +16,18 @@ local UnitName = UnitName
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
local Gladdy = LibStub("Gladdy")
 | 
					local Gladdy = LibStub("Gladdy")
 | 
				
			||||||
local L = Gladdy.L
 | 
					local L = Gladdy.L
 | 
				
			||||||
local Announcements = Gladdy:NewModule("Announcements", nil, {
 | 
					local Announcements = Gladdy:NewModule("Announcements", 101, {
 | 
				
			||||||
    announcements = {
 | 
					    announcements = {
 | 
				
			||||||
        drinks = true,
 | 
					        drinks = true,
 | 
				
			||||||
        resurrections = true,
 | 
					        resurrections = true,
 | 
				
			||||||
        enemy = false,
 | 
					        enemy = false,
 | 
				
			||||||
        spec = false,
 | 
					        spec = true,
 | 
				
			||||||
        health = false,
 | 
					        health = false,
 | 
				
			||||||
        healthThreshold = 20,
 | 
					        healthThreshold = 20,
 | 
				
			||||||
        trinketUsed = true,
 | 
					        trinketUsed = true,
 | 
				
			||||||
        trinketReady = false,
 | 
					        trinketReady = false,
 | 
				
			||||||
        dest = "self",
 | 
					        spellInterrupt = true,
 | 
				
			||||||
 | 
					        dest = "party",
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -41,15 +42,20 @@ function Announcements:Initialize()
 | 
				
			|||||||
        [GetSpellInfo(20777)] = true,
 | 
					        [GetSpellInfo(20777)] = true,
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    self:RegisterMessage("CAST_START")
 | 
					    self:RegisterMessage("JOINED_ARENA")
 | 
				
			||||||
    self:RegisterMessage("ENEMY_SPOTTED")
 | 
					 | 
				
			||||||
    self:RegisterMessage("UNIT_SPEC")
 | 
					 | 
				
			||||||
    self:RegisterMessage("UNIT_HEALTH")
 | 
					 | 
				
			||||||
    self:RegisterMessage("TRINKET_USED")
 | 
					 | 
				
			||||||
    self:RegisterMessage("TRINKET_READY")
 | 
					 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Announcements:Reset()
 | 
					function Announcements:Reset()
 | 
				
			||||||
 | 
					    self:UnregisterMessages(
 | 
				
			||||||
 | 
					            "CAST_START",
 | 
				
			||||||
 | 
					            "ENEMY_SPOTTED",
 | 
				
			||||||
 | 
					            "UNIT_SPEC",
 | 
				
			||||||
 | 
					            "AURA_GAIN",
 | 
				
			||||||
 | 
					            "UNIT_HEALTH",
 | 
				
			||||||
 | 
					            "TRINKET_USED",
 | 
				
			||||||
 | 
					            "TRINKET_READY",
 | 
				
			||||||
 | 
					            "SHADOWSIGHT",
 | 
				
			||||||
 | 
					            "SPELL_INTERRUPT")
 | 
				
			||||||
    self.enemy = {}
 | 
					    self.enemy = {}
 | 
				
			||||||
    self.throttled = {}
 | 
					    self.throttled = {}
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
@@ -59,17 +65,25 @@ function Announcements:Test(unit)
 | 
				
			|||||||
    if (not button) then
 | 
					    if (not button) then
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					    self:JOINED_ARENA()
 | 
				
			||||||
    if (unit == "arena1") then
 | 
					    if unit == "arena1" then
 | 
				
			||||||
        self:UNIT_SPEC(unit, button.testSpec)
 | 
					        self:AURA_GAIN(unit, nil, nil, self.DRINK_AURA)
 | 
				
			||||||
    elseif (unit == "arena2") then
 | 
					 | 
				
			||||||
        self:CheckDrink(unit, self.DRINK_AURA)
 | 
					 | 
				
			||||||
    elseif (unit == "arena3") then
 | 
					 | 
				
			||||||
        self:UNIT_HEALTH(unit, button.health, button.healthMax)
 | 
					 | 
				
			||||||
        self:ENEMY_SPOTTED(unit)
 | 
					 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Announcements:JOINED_ARENA()
 | 
				
			||||||
 | 
					    self:RegisterMessages(
 | 
				
			||||||
 | 
					            "CAST_START",
 | 
				
			||||||
 | 
					            "ENEMY_SPOTTED",
 | 
				
			||||||
 | 
					            "UNIT_SPEC",
 | 
				
			||||||
 | 
					            "AURA_GAIN",
 | 
				
			||||||
 | 
					            "UNIT_HEALTH",
 | 
				
			||||||
 | 
					            "TRINKET_USED",
 | 
				
			||||||
 | 
					            "TRINKET_READY",
 | 
				
			||||||
 | 
					            "SHADOWSIGHT",
 | 
				
			||||||
 | 
					            "SPELL_INTERRUPT")
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Announcements:CAST_START(unit, spell)
 | 
					function Announcements:CAST_START(unit, spell)
 | 
				
			||||||
    local button = Gladdy.buttons[unit]
 | 
					    local button = Gladdy.buttons[unit]
 | 
				
			||||||
    if (not button or not Gladdy.db.announcements.resurrections) then
 | 
					    if (not button or not Gladdy.db.announcements.resurrections) then
 | 
				
			||||||
@@ -77,7 +91,7 @@ function Announcements:CAST_START(unit, spell)
 | 
				
			|||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (self.RES_SPELLS[spell]) then
 | 
					    if (self.RES_SPELLS[spell]) then
 | 
				
			||||||
        self:Send(L["RESURRECTING: %s (%s)"]:format(button.name, button.classLoc), 3, RAID_CLASS_COLORS[button.class])
 | 
					        self:Send(L["RESURRECTING: %s (%s)"]:format(button.name, button.classLoc), 3, RAID_CLASS_COLORS[button.class], unit)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -91,7 +105,7 @@ function Announcements:ENEMY_SPOTTED(unit)
 | 
				
			|||||||
        if button.name == "Unknown" then
 | 
					        if button.name == "Unknown" then
 | 
				
			||||||
            button.name = UnitName(unit)
 | 
					            button.name = UnitName(unit)
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
        self:Send("ENEMY SPOTTED:" .. ("%s (%s)"):format(button.name, button.classLoc), 0, RAID_CLASS_COLORS[button.class])
 | 
					        self:Send("ENEMY SPOTTED:" .. ("%s (%s)"):format(button.name, button.classLoc), 0, RAID_CLASS_COLORS[button.class], unit)
 | 
				
			||||||
        self.enemy[unit] = true
 | 
					        self.enemy[unit] = true
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
@@ -104,7 +118,7 @@ function Announcements:UNIT_SPEC(unit, spec)
 | 
				
			|||||||
    if button.name == "Unknown" then
 | 
					    if button.name == "Unknown" then
 | 
				
			||||||
        button.name = UnitName(unit)
 | 
					        button.name = UnitName(unit)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    self:Send(L["SPEC DETECTED: %s - %s (%s)"]:format(button.name, spec, button.classLoc), 0, RAID_CLASS_COLORS[button.class])
 | 
					    self:Send(L["SPEC DETECTED: %s - %s (%s)"]:format(button.name, spec, button.classLoc), 1, RAID_CLASS_COLORS[button.class], unit)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Announcements:UNIT_HEALTH(unit, health, healthMax)
 | 
					function Announcements:UNIT_HEALTH(unit, health, healthMax)
 | 
				
			||||||
@@ -115,7 +129,7 @@ function Announcements:UNIT_HEALTH(unit, health, healthMax)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    local healthPercent = floor(health * 100 / healthMax)
 | 
					    local healthPercent = floor(health * 100 / healthMax)
 | 
				
			||||||
    if (healthPercent < Gladdy.db.announcements.healthThreshold) then
 | 
					    if (healthPercent < Gladdy.db.announcements.healthThreshold) then
 | 
				
			||||||
        self:Send(L["LOW HEALTH: %s (%s)"]:format(button.name, button.classLoc), 10, RAID_CLASS_COLORS[button.class])
 | 
					        self:Send(L["LOW HEALTH: %s (%s)"]:format(button.name, button.classLoc), 10, RAID_CLASS_COLORS[button.class], unit)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -125,7 +139,7 @@ function Announcements:TRINKET_USED(unit)
 | 
				
			|||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    self:Send(L["TRINKET USED: %s (%s)"]:format(button.name, button.classLoc), 0, RAID_CLASS_COLORS[button.class])
 | 
					    self:Send(L["TRINKET USED: %s (%s)"]:format(button.name, button.classLoc), 1, RAID_CLASS_COLORS[button.class], unit)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Announcements:TRINKET_READY(unit)
 | 
					function Announcements:TRINKET_READY(unit)
 | 
				
			||||||
@@ -134,27 +148,43 @@ function Announcements:TRINKET_READY(unit)
 | 
				
			|||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    self:Send(L["TRINKET READY: %s (%s)"]:format(button.name, button.classLoc), 3, RAID_CLASS_COLORS[button.class])
 | 
					    self:Send(L["TRINKET READY: %s (%s)"]:format(button.name, button.classLoc), 1, RAID_CLASS_COLORS[button.class], unit)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Announcements:CheckDrink(unit, aura)
 | 
					function Announcements:SPELL_INTERRUPT(unit,spellID,spellName,spellSchool,extraSpellId,extraSpellName,extraSpellSchool)
 | 
				
			||||||
 | 
					    local button = Gladdy.buttons[unit]
 | 
				
			||||||
 | 
					    if (not button or not Gladdy.db.announcements.spellInterrupt) then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    self:Send(L["INTERRUPTED: %s (%s)"]:format(extraSpellName, button.name or ""), nil, RAID_CLASS_COLORS[button.class], unit)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Announcements:AURA_GAIN(unit, auraType, spellID, spellName)
 | 
				
			||||||
    local button = Gladdy.buttons[unit]
 | 
					    local button = Gladdy.buttons[unit]
 | 
				
			||||||
    if (not button or not Gladdy.db.announcements.drinks) then
 | 
					    if (not button or not Gladdy.db.announcements.drinks) then
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (aura == self.DRINK_AURA) then
 | 
					    if (spellName == self.DRINK_AURA) then
 | 
				
			||||||
        self:Send(L["DRINKING: %s (%s)"]:format(button.name, button.classLoc), 3, RAID_CLASS_COLORS[button.class])
 | 
					        self:Send(L["DRINKING: %s (%s)"]:format(button.name, button.classLoc), 3, RAID_CLASS_COLORS[button.class], unit)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Announcements:Send(msg, throttle, color)
 | 
					function Announcements:SHADOWSIGHT(msg)
 | 
				
			||||||
 | 
					    self:Send(msg, 2)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Announcements:Send(msg, throttle, color, unit)
 | 
				
			||||||
    if (throttle and throttle > 0) then
 | 
					    if (throttle and throttle > 0) then
 | 
				
			||||||
        if (not self.throttled[msg]) then
 | 
					        local throttledMsg = unit and msg .. unit or msg
 | 
				
			||||||
            self.throttled[msg] = GetTime() + throttle
 | 
					        if (not self.throttled[throttledMsg]) then
 | 
				
			||||||
        elseif (self.throttled[msg] < GetTime()) then
 | 
					            self.throttled[throttledMsg] = GetTime() + throttle
 | 
				
			||||||
            self.throttled[msg] = nil
 | 
					            Gladdy:Debug("INFO", throttledMsg, "- NOT THROTTLED -", self.throttled[throttledMsg])
 | 
				
			||||||
 | 
					        elseif (self.throttled[throttledMsg] < GetTime()) then
 | 
				
			||||||
 | 
					            Gladdy:Debug("INFO", throttledMsg, "- THROTTLED OVER -", self.throttled[throttledMsg])
 | 
				
			||||||
 | 
					            self.throttled[throttledMsg] = GetTime() + throttle
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
 | 
					            Gladdy:Debug("INFO", throttledMsg, "- THROTTLED -", self.throttled[throttledMsg])
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
@@ -172,9 +202,9 @@ function Announcements:Send(msg, throttle, color)
 | 
				
			|||||||
        RaidNotice_AddMessage(RaidBossEmoteFrame, msg, color)
 | 
					        RaidNotice_AddMessage(RaidBossEmoteFrame, msg, color)
 | 
				
			||||||
    elseif (dest == "fct" and IsAddOnLoaded("Blizzard_CombatText")) then
 | 
					    elseif (dest == "fct" and IsAddOnLoaded("Blizzard_CombatText")) then
 | 
				
			||||||
        CombatText_AddMessage(msg, nil, color.r, color.g, color.b, "crit", 1)
 | 
					        CombatText_AddMessage(msg, nil, color.r, color.g, color.b, "crit", 1)
 | 
				
			||||||
    --[[elseif (dest == "msbt" and IsAddOnLoaded("MikScrollingBattleText")) then
 | 
					    elseif (dest == "msbt" and IsAddOnLoaded("MikScrollingBattleText")) then
 | 
				
			||||||
        MikSBT.DisplayMessage(msg, MikSBT.DISPLAYTYPE_NOTIFICATION, true, color.r * 255, color.g * 255, color.b * 255)
 | 
					        MikSBT.Animations.DisplayMessage(msg, MikSBT.DISPLAYTYPE_NOTIFICATION, true, color.r * 255, color.g * 255, color.b * 255)
 | 
				
			||||||
    elseif (dest == "sct" and IsAddOnLoaded("sct")) then
 | 
					    --[[elseif (dest == "sct" and IsAddOnLoaded("sct")) then
 | 
				
			||||||
        SCT:DisplayText(msg, color, true, "event", 1)
 | 
					        SCT:DisplayText(msg, color, true, "event", 1)
 | 
				
			||||||
    elseif (dest == "parrot" and IsAddOnLoaded("parrot")) then
 | 
					    elseif (dest == "parrot" and IsAddOnLoaded("parrot")) then
 | 
				
			||||||
        Parrot:ShowMessage(msg, "Notification", true, color.r, color.g, color.b)--]]
 | 
					        Parrot:ShowMessage(msg, "Notification", true, color.r, color.g, color.b)--]]
 | 
				
			||||||
@@ -205,12 +235,15 @@ function Announcements:GetOptions()
 | 
				
			|||||||
        ["self"] = L["Self"],
 | 
					        ["self"] = L["Self"],
 | 
				
			||||||
        ["party"] = L["Party"],
 | 
					        ["party"] = L["Party"],
 | 
				
			||||||
        ["rw"] = L["Raid Warning"],
 | 
					        ["rw"] = L["Raid Warning"],
 | 
				
			||||||
        ["fct"] = L["Blizzard's Floating Combat Text"],
 | 
					 | 
				
			||||||
        --["msbt"] = L["MikScrollingBattleText"],
 | 
					 | 
				
			||||||
        --["sct"] = L["Scrolling Combat Text"],
 | 
					 | 
				
			||||||
        --["parrot"] = L["Parrot"],
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if IsAddOnLoaded("Blizzard_CombatText") then
 | 
				
			||||||
 | 
					        destValues["fct"] = L["Blizzard's Floating Combat Text"]
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if IsAddOnLoaded("MikScrollingBattleText") then
 | 
				
			||||||
 | 
					        destValues["msbt"] = L["MikScrollingBattleText"]
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return {
 | 
					    return {
 | 
				
			||||||
        headerAnnouncements = {
 | 
					        headerAnnouncements = {
 | 
				
			||||||
            type = "header",
 | 
					            type = "header",
 | 
				
			||||||
@@ -229,41 +262,47 @@ function Announcements:GetOptions()
 | 
				
			|||||||
            desc = L["Announce when an enemy's trinket is ready again"],
 | 
					            desc = L["Announce when an enemy's trinket is ready again"],
 | 
				
			||||||
            order = 4,
 | 
					            order = 4,
 | 
				
			||||||
        }),
 | 
					        }),
 | 
				
			||||||
 | 
					        spellInterrupt = option({
 | 
				
			||||||
 | 
					            type = "toggle",
 | 
				
			||||||
 | 
					            name = L["Interrupts"],
 | 
				
			||||||
 | 
					            desc = L["Announces when enemies' spells are interrupted"],
 | 
				
			||||||
 | 
					            order = 5,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
        drinks = option({
 | 
					        drinks = option({
 | 
				
			||||||
            type = "toggle",
 | 
					            type = "toggle",
 | 
				
			||||||
            name = L["Drinking"],
 | 
					            name = L["Drinking"],
 | 
				
			||||||
            desc = L["Announces when enemies sit down to drink"],
 | 
					            desc = L["Announces when enemies sit down to drink"],
 | 
				
			||||||
            order = 5,
 | 
					            order = 6,
 | 
				
			||||||
        }),
 | 
					        }),
 | 
				
			||||||
        resurrections = option({
 | 
					        resurrections = option({
 | 
				
			||||||
            type = "toggle",
 | 
					            type = "toggle",
 | 
				
			||||||
            name = L["Resurrection"],
 | 
					            name = L["Resurrection"],
 | 
				
			||||||
            desc = L["Announces when an enemy tries to resurrect a teammate"],
 | 
					            desc = L["Announces when an enemy tries to resurrect a teammate"],
 | 
				
			||||||
            order = 6,
 | 
					            order = 7,
 | 
				
			||||||
        }),
 | 
					        }),
 | 
				
			||||||
        enemy = option({
 | 
					        enemy = option({
 | 
				
			||||||
            type = "toggle",
 | 
					            type = "toggle",
 | 
				
			||||||
            name = L["New enemies"],
 | 
					            name = L["New enemies"],
 | 
				
			||||||
            desc = L["Announces when new enemies are discovered"],
 | 
					            desc = L["Announces when new enemies are discovered"],
 | 
				
			||||||
            order = 7,
 | 
					            order = 8,
 | 
				
			||||||
        }),
 | 
					        }),
 | 
				
			||||||
        spec = option({
 | 
					        spec = option({
 | 
				
			||||||
            type = "toggle",
 | 
					            type = "toggle",
 | 
				
			||||||
            name = L["Spec Detection"],
 | 
					            name = L["Spec Detection"],
 | 
				
			||||||
            desc = L["Announces when the spec of an enemy was detected"],
 | 
					            desc = L["Announces when the spec of an enemy was detected"],
 | 
				
			||||||
            order = 8,
 | 
					            order = 9,
 | 
				
			||||||
        }),
 | 
					        }),
 | 
				
			||||||
        health = option({
 | 
					        health = option({
 | 
				
			||||||
            type = "toggle",
 | 
					            type = "toggle",
 | 
				
			||||||
            name = L["Low health"],
 | 
					            name = L["Low health"],
 | 
				
			||||||
            desc = L["Announces when an enemy drops below a certain health threshold"],
 | 
					            desc = L["Announces when an enemy drops below a certain health threshold"],
 | 
				
			||||||
            order = 9,
 | 
					            order = 10,
 | 
				
			||||||
        }),
 | 
					        }),
 | 
				
			||||||
        healthThreshold = option({
 | 
					        healthThreshold = option({
 | 
				
			||||||
            type = "range",
 | 
					            type = "range",
 | 
				
			||||||
            name = L["Low health threshold"],
 | 
					            name = L["Low health threshold"],
 | 
				
			||||||
            desc = L["Choose how low an enemy must be before low health is announced"],
 | 
					            desc = L["Choose how low an enemy must be before low health is announced"],
 | 
				
			||||||
            order = 10,
 | 
					            order = 11,
 | 
				
			||||||
            min = 1,
 | 
					            min = 1,
 | 
				
			||||||
            max = 100,
 | 
					            max = 100,
 | 
				
			||||||
            step = 1,
 | 
					            step = 1,
 | 
				
			||||||
@@ -275,7 +314,7 @@ function Announcements:GetOptions()
 | 
				
			|||||||
            type = "select",
 | 
					            type = "select",
 | 
				
			||||||
            name = L["Destination"],
 | 
					            name = L["Destination"],
 | 
				
			||||||
            desc = L["Choose how your announcements are displayed"],
 | 
					            desc = L["Choose how your announcements are displayed"],
 | 
				
			||||||
            order = 11,
 | 
					            order = 12,
 | 
				
			||||||
            values = destValues,
 | 
					            values = destValues,
 | 
				
			||||||
        }),
 | 
					        }),
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,157 +1,178 @@
 | 
				
			|||||||
local select, floor, str_len, tostring, str_sub, str_find = select, math.floor, string.len, tostring, string.sub, string.find
 | 
					local str_find, pairs = string.find, pairs
 | 
				
			||||||
local IsInInstance = IsInInstance
 | 
					local CreateFrame = CreateFrame
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local Gladdy = LibStub("Gladdy")
 | 
					local Gladdy = LibStub("Gladdy")
 | 
				
			||||||
local L = Gladdy.L
 | 
					local L = Gladdy.L
 | 
				
			||||||
local ACDFrame = Gladdy:NewModule("Countdown", nil, {
 | 
					local ACDFrame = Gladdy:NewModule("Arena Countdown", nil, {
 | 
				
			||||||
    countdown = true,
 | 
					    countdown = true,
 | 
				
			||||||
    arenaCountdownSize = 256
 | 
					    arenaCountdownSize = 256,
 | 
				
			||||||
 | 
					    arenaCountdownFrameStrata = "HIGH",
 | 
				
			||||||
 | 
					    arenaCountdownFrameLevel = 50,
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function ACDFrame:OnEvent(event, ...)
 | 
				
			||||||
 | 
					    self[event](self, ...)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function ACDFrame:Initialize()
 | 
					function ACDFrame:Initialize()
 | 
				
			||||||
    self.hidden = false
 | 
					    self.locale = Gladdy:GetArenaTimer()
 | 
				
			||||||
    self.countdown = -1
 | 
					    self.countdown = -1
 | 
				
			||||||
    self.texturePath = "Interface\\AddOns\\Gladdy\\Images\\Countdown\\";
 | 
					    self.texturePath = "Interface\\AddOns\\Gladdy\\Images\\Countdown\\";
 | 
				
			||||||
    ACDFrame:RegisterEvent("CHAT_MSG_BG_SYSTEM_NEUTRAL")
 | 
					
 | 
				
			||||||
    ACDFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
 | 
					    local ACDNumFrame = CreateFrame("Frame", "ACDNumFrame", UIParent)
 | 
				
			||||||
 | 
					    self.ACDNumFrame = ACDNumFrame
 | 
				
			||||||
 | 
					    self.ACDNumFrame:EnableMouse(false)
 | 
				
			||||||
 | 
					    self.ACDNumFrame:SetHeight(Gladdy.db.arenaCountdownSize)
 | 
				
			||||||
 | 
					    self.ACDNumFrame:SetWidth(Gladdy.db.arenaCountdownSize)
 | 
				
			||||||
 | 
					    self.ACDNumFrame:SetPoint("CENTER", 0, 128)
 | 
				
			||||||
 | 
					    self.ACDNumFrame:Hide()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    local ACDNumTens = ACDNumFrame:CreateTexture("ACDNumTens", "HIGH")
 | 
				
			||||||
 | 
					    self.ACDNumTens = ACDNumTens
 | 
				
			||||||
 | 
					    self.ACDNumTens:SetWidth(Gladdy.db.arenaCountdownSize)
 | 
				
			||||||
 | 
					    self.ACDNumTens:SetHeight(Gladdy.db.arenaCountdownSize)
 | 
				
			||||||
 | 
					    self.ACDNumTens:SetPoint("CENTER", self.ACDNumFrame, "CENTER", -(Gladdy.db.arenaCountdownSize/8 + Gladdy.db.arenaCountdownSize/8/2), 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    local ACDNumOnes = ACDNumFrame:CreateTexture("ACDNumOnes", "HIGH")
 | 
				
			||||||
 | 
					    self.ACDNumOnes = ACDNumOnes
 | 
				
			||||||
 | 
					    self.ACDNumOnes:SetWidth(Gladdy.db.arenaCountdownSize)
 | 
				
			||||||
 | 
					    self.ACDNumOnes:SetHeight(Gladdy.db.arenaCountdownSize)
 | 
				
			||||||
 | 
					    self.ACDNumOnes:SetPoint("CENTER", self.ACDNumFrame, "CENTER", (Gladdy.db.arenaCountdownSize/8 + Gladdy.db.arenaCountdownSize/8/2), 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    local ACDNumOne = ACDNumFrame:CreateTexture("ACDNumOne", "HIGH")
 | 
				
			||||||
 | 
					    self.ACDNumOne = ACDNumOne
 | 
				
			||||||
 | 
					    self.ACDNumOne:SetWidth(Gladdy.db.arenaCountdownSize)
 | 
				
			||||||
 | 
					    self.ACDNumOne:SetHeight(Gladdy.db.arenaCountdownSize)
 | 
				
			||||||
 | 
					    self.ACDNumOne:SetPoint("CENTER", self.ACDNumFrame, "CENTER", 0, 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if Gladdy.db.countdown then
 | 
				
			||||||
 | 
					        self:RegisterMessage("JOINED_ARENA")
 | 
				
			||||||
 | 
					        self:RegisterMessage("ENEMY_SPOTTED")
 | 
				
			||||||
 | 
					        self:RegisterMessage("UNIT_SPEC")
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    self.faction = UnitFactionGroup("player")
 | 
				
			||||||
 | 
					    self:SetScript("OnEvent", ACDFrame.OnEvent)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function ACDFrame:OnEvent(event, ...)
 | 
					function ACDFrame:UpdateFrameOnce()
 | 
				
			||||||
    -- functions created in "object:method"-style have an implicit first parameter of "self", which points to object
 | 
					    if Gladdy.db.countdown then
 | 
				
			||||||
    self[event](self, ...) -- route event parameters to LoseControl:event methods
 | 
					        self:RegisterMessage("JOINED_ARENA")
 | 
				
			||||||
 | 
					        self:RegisterMessage("ENEMY_SPOTTED")
 | 
				
			||||||
 | 
					        self:RegisterMessage("UNIT_SPEC")
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        self:UnregisterAllMessages()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    self.ACDNumFrame:SetFrameStrata(Gladdy.db.arenaCountdownFrameStrata)
 | 
				
			||||||
 | 
					    self.ACDNumFrame:SetFrameLevel(Gladdy.db.arenaCountdownFrameLevel)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    self.ACDNumFrame:SetHeight(Gladdy.db.arenaCountdownSize)
 | 
				
			||||||
 | 
					    self.ACDNumFrame:SetWidth(Gladdy.db.arenaCountdownSize)
 | 
				
			||||||
 | 
					    self.ACDNumFrame:SetPoint("CENTER", 0, 128)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    self.ACDNumTens:SetWidth(Gladdy.db.arenaCountdownSize)
 | 
				
			||||||
 | 
					    self.ACDNumTens:SetHeight(Gladdy.db.arenaCountdownSize)
 | 
				
			||||||
 | 
					    self.ACDNumTens:SetPoint("CENTER", self.ACDNumFrame, "CENTER", -(Gladdy.db.arenaCountdownSize/8 + Gladdy.db.arenaCountdownSize/8/2), 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    self.ACDNumOnes:SetWidth(Gladdy.db.arenaCountdownSize)
 | 
				
			||||||
 | 
					    self.ACDNumOnes:SetHeight(Gladdy.db.arenaCountdownSize)
 | 
				
			||||||
 | 
					    self.ACDNumOnes:SetPoint("CENTER", self.ACDNumFrame, "CENTER", (Gladdy.db.arenaCountdownSize/8 + Gladdy.db.arenaCountdownSize/8/2), 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    self.ACDNumOne:SetWidth(Gladdy.db.arenaCountdownSize)
 | 
				
			||||||
 | 
					    self.ACDNumOne:SetHeight(Gladdy.db.arenaCountdownSize)
 | 
				
			||||||
 | 
					    self.ACDNumOne:SetPoint("CENTER", self.ACDNumFrame, "CENTER", 0, 0)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
ACDFrame:SetScript("OnEvent", ACDFrame.OnEvent)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function ACDFrame:HideAll()
 | 
				
			||||||
 | 
					    self.ACDNumFrame:Hide()
 | 
				
			||||||
 | 
					    self.ACDNumTens:Hide()
 | 
				
			||||||
 | 
					    self.ACDNumOnes:Hide()
 | 
				
			||||||
 | 
					    self.ACDNumOne:Hide()
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local ACDNumFrame = CreateFrame("Frame", "ACDNumFrame", UIParent)
 | 
					function ACDFrame:CreateTicker(countdown)
 | 
				
			||||||
ACDNumFrame:SetHeight(256)
 | 
					    self.countdown = countdown
 | 
				
			||||||
ACDNumFrame:SetWidth(256)
 | 
					    if self.ticker and not self.ticker:IsCancelled() then
 | 
				
			||||||
ACDNumFrame:SetPoint("CENTER", 0, 128)
 | 
					        self.ticker:Cancel()
 | 
				
			||||||
ACDNumFrame:Show()
 | 
					    end
 | 
				
			||||||
 | 
					    self.ticker = C_Timer.NewTicker(1, ACDFrame.Ticker)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local ACDNumTens = ACDNumFrame:CreateTexture("ACDNumTens", "HIGH")
 | 
					function ACDFrame.Ticker()
 | 
				
			||||||
ACDNumTens:SetWidth(256)
 | 
					    local self = ACDFrame
 | 
				
			||||||
ACDNumTens:SetHeight(128)
 | 
					    if (Gladdy.db.countdown) then
 | 
				
			||||||
ACDNumTens:SetPoint("CENTER", ACDNumFrame, "CENTER", -48, 0)
 | 
					        self.ACDNumFrame:Show()
 | 
				
			||||||
 | 
					        if (self.countdown and self.countdown >= 10 and self.countdown <= 60) then
 | 
				
			||||||
 | 
					            -- Display has 2 digits
 | 
				
			||||||
 | 
					            local ones = self.countdown % 10
 | 
				
			||||||
 | 
					            local tens = (self.countdown / 10) % 10
 | 
				
			||||||
 | 
					            self.ACDNumOne:Hide()
 | 
				
			||||||
 | 
					            self.ACDNumTens:Show()
 | 
				
			||||||
 | 
					            self.ACDNumOnes:Show()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local ACDNumOnes = ACDNumFrame:CreateTexture("ACDNumOnes", "HIGH")
 | 
					            self.ACDNumTens:SetTexture(self.texturePath .. tens)
 | 
				
			||||||
ACDNumOnes:SetWidth(256)
 | 
					            self.ACDNumOnes:SetTexture(self.texturePath .. ones)
 | 
				
			||||||
ACDNumOnes:SetHeight(128)
 | 
					            self.ACDNumFrame:SetScale(0.7)
 | 
				
			||||||
ACDNumOnes:SetPoint("CENTER", ACDNumFrame, "CENTER", 48, 0)
 | 
					        elseif (self.countdown and self.countdown < 10 and self.countdown > -1) then
 | 
				
			||||||
 | 
					            -- Display has 1 digit
 | 
				
			||||||
local ACDNumOne = ACDNumFrame:CreateTexture("ACDNumOne", "HIGH")
 | 
					            local path = self.countdown <= 0 and self.faction or self.countdown
 | 
				
			||||||
ACDNumOne:SetWidth(256)
 | 
					            self.ACDNumOne:Show()
 | 
				
			||||||
ACDNumOne:SetHeight(128)
 | 
					            self.ACDNumOne:SetTexture(self.texturePath .. path)
 | 
				
			||||||
ACDNumOne:SetPoint("CENTER", ACDNumFrame, "CENTER", 0, 0)
 | 
					            self.ACDNumOnes:Hide()
 | 
				
			||||||
 | 
					            self.ACDNumTens:Hide()
 | 
				
			||||||
function ACDFrame:PLAYER_ENTERING_WORLD()
 | 
					            self.ACDNumFrame:SetScale(1.0)
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
    local instanceType = select(2, IsInInstance())
 | 
					            ACDFrame:HideAll()
 | 
				
			||||||
    if (( instanceType == "arena" )) then
 | 
					            if (self.countdown and self.countdown < -1) then
 | 
				
			||||||
        ACDFrame:SetScript("OnUpdate", function(self, elapse)
 | 
					                self.ticker:Cancel()
 | 
				
			||||||
            if (self.countdown > 0 and Gladdy.db.countdown) then
 | 
					 | 
				
			||||||
                self.hidden = false;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                if ((floor(self.countdown) ~= floor(self.countdown - elapse)) and (floor(self.countdown - elapse) >= 0)) then
 | 
					 | 
				
			||||||
                    local str = tostring(floor(self.countdown - elapse));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    if (floor(self.countdown - elapse) == 0) then
 | 
					 | 
				
			||||||
                        ACDNumTens:Hide();
 | 
					 | 
				
			||||||
                        ACDNumOnes:Hide();
 | 
					 | 
				
			||||||
                        ACDNumOne:Hide();
 | 
					 | 
				
			||||||
                    elseif (str_len(str) == 2) then
 | 
					 | 
				
			||||||
                        -- Display has 2 digits
 | 
					 | 
				
			||||||
                        ACDNumOne:Hide();
 | 
					 | 
				
			||||||
                        ACDNumTens:Show();
 | 
					 | 
				
			||||||
                        ACDNumOnes:Show();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        ACDNumTens:SetTexture(self.texturePath .. str_sub(str, 0, 1));
 | 
					 | 
				
			||||||
                        ACDNumOnes:SetTexture(self.texturePath .. str_sub(str, 2, 2));
 | 
					 | 
				
			||||||
                        ACDNumFrame:SetScale(0.7)
 | 
					 | 
				
			||||||
                    elseif (str_len(str) == 1) then
 | 
					 | 
				
			||||||
                        -- Display has 1 digit
 | 
					 | 
				
			||||||
                        ACDNumOne:Show();
 | 
					 | 
				
			||||||
                        ACDNumOne:SetTexture(self.texturePath .. str_sub(str, 0, 1));
 | 
					 | 
				
			||||||
                        ACDNumOnes:Hide();
 | 
					 | 
				
			||||||
                        ACDNumTens:Hide();
 | 
					 | 
				
			||||||
                        ACDNumFrame:SetScale(1.0)
 | 
					 | 
				
			||||||
                    end
 | 
					 | 
				
			||||||
                end
 | 
					 | 
				
			||||||
                self.countdown = self.countdown - elapse;
 | 
					 | 
				
			||||||
            else
 | 
					 | 
				
			||||||
                self.hidden = true;
 | 
					 | 
				
			||||||
                ACDNumTens:Hide();
 | 
					 | 
				
			||||||
                ACDNumOnes:Hide();
 | 
					 | 
				
			||||||
                ACDNumOne:Hide();
 | 
					 | 
				
			||||||
            end
 | 
					            end
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        self.countdown = self.countdown and self.countdown - 1
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        ACDFrame:HideAll()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        end)
 | 
					function ACDFrame:JOINED_ARENA()
 | 
				
			||||||
 | 
					    if Gladdy.db.countdown then
 | 
				
			||||||
 | 
					        self:CreateTicker(nil)
 | 
				
			||||||
 | 
					        self:RegisterEvent("CHAT_MSG_BG_SYSTEM_NEUTRAL")
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function ACDFrame:Reset()
 | 
				
			||||||
 | 
					    if self.ticker and not self.ticker:IsCancelled() then
 | 
				
			||||||
 | 
					        self.ticker:Cancel()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    self.countdown = nil
 | 
				
			||||||
 | 
					    self:UnregisterEvent("CHAT_MSG_BG_SYSTEM_NEUTRAL")
 | 
				
			||||||
 | 
					    ACDFrame:HideAll()
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function ACDFrame:ENEMY_SPOTTED()
 | 
				
			||||||
 | 
					    if not Gladdy.frame.testing then
 | 
				
			||||||
 | 
					        ACDFrame:Reset()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function ACDFrame:UNIT_SPEC()
 | 
				
			||||||
 | 
					    if not Gladdy.frame.testing then
 | 
				
			||||||
 | 
					        ACDFrame:Reset()
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function ACDFrame:CHAT_MSG_BG_SYSTEM_NEUTRAL(msg)
 | 
					function ACDFrame:CHAT_MSG_BG_SYSTEM_NEUTRAL(msg)
 | 
				
			||||||
    if (str_find(msg, "L'ar\195\168ne ouvre ses portes dans 60 secondes !")) then
 | 
					    for k,v in pairs(self.locale) do
 | 
				
			||||||
        self.countdown = 61
 | 
					        if str_find(msg, v) then
 | 
				
			||||||
        return
 | 
					            if self.countdown and self.countdown == 0 then
 | 
				
			||||||
    end
 | 
					                return
 | 
				
			||||||
    if (str_find(msg, "L'ar\195\168ne ouvre ses portes dans 30 secondes !")) then
 | 
					            end
 | 
				
			||||||
        self.countdown = 31
 | 
					            self.countdown = k
 | 
				
			||||||
        return
 | 
					        end
 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
    if (str_find(msg, "L'ar\195\168ne ouvre ses portes dans 15 secondes !")) then
 | 
					 | 
				
			||||||
        self.countdown = 16
 | 
					 | 
				
			||||||
        return
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
    if (str_find(msg, "L'ar\195\168ne ouvre ses portes dans 10 secondes !")) then
 | 
					 | 
				
			||||||
        self.countdown = 11
 | 
					 | 
				
			||||||
        return
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
    if (str_find(msg, "One minute until the Arena battle begins!")) then
 | 
					 | 
				
			||||||
        self.countdown = 61
 | 
					 | 
				
			||||||
        return
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
    if (str_find(msg, "Thirty seconds until the Arena battle begins!")) then
 | 
					 | 
				
			||||||
        self.countdown = 31
 | 
					 | 
				
			||||||
        return
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
    if (str_find(msg, "Fifteen seconds until the Arena battle begins!")) then
 | 
					 | 
				
			||||||
        self.countdown = 16
 | 
					 | 
				
			||||||
        return
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
    if (str_find(msg, "Ten seconds until the Arena battle begins!")) then
 | 
					 | 
				
			||||||
        self.countdown = 10
 | 
					 | 
				
			||||||
        return
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
    if (str_find(msg, "The Arena battle has begun!")) then
 | 
					 | 
				
			||||||
        ACDFrame:SetScript("OnUpdate", nil)
 | 
					 | 
				
			||||||
        return
 | 
					 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function ACDFrame:UpdateFrame()
 | 
					function ACDFrame:TestOnce()
 | 
				
			||||||
    ACDNumFrame:SetHeight(Gladdy.db.arenaCountdownSize)
 | 
					    self:CreateTicker(30)
 | 
				
			||||||
    ACDNumFrame:SetWidth(Gladdy.db.arenaCountdownSize)
 | 
					 | 
				
			||||||
    ACDNumFrame:SetPoint("CENTER", 0, 128)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ACDNumTens:SetWidth(Gladdy.db.arenaCountdownSize)
 | 
					 | 
				
			||||||
    ACDNumTens:SetHeight(Gladdy.db.arenaCountdownSize/2)
 | 
					 | 
				
			||||||
    ACDNumTens:SetPoint("CENTER", ACDNumFrame, "CENTER", -(Gladdy.db.arenaCountdownSize/8 + Gladdy.db.arenaCountdownSize/8/2), 0)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ACDNumOnes:SetWidth(Gladdy.db.arenaCountdownSize)
 | 
					 | 
				
			||||||
    ACDNumOnes:SetHeight(Gladdy.db.arenaCountdownSize/2)
 | 
					 | 
				
			||||||
    ACDNumOnes:SetPoint("CENTER", ACDNumFrame, "CENTER", (Gladdy.db.arenaCountdownSize/8 + Gladdy.db.arenaCountdownSize/8/2), 0)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ACDNumOne:SetWidth(Gladdy.db.arenaCountdownSize)
 | 
					 | 
				
			||||||
    ACDNumOne:SetHeight(Gladdy.db.arenaCountdownSize/2)
 | 
					 | 
				
			||||||
    ACDNumOne:SetPoint("CENTER", ACDNumFrame, "CENTER", 0, 0)
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
function ACDFrame:Test()
 | 
					 | 
				
			||||||
    self.countdown = 30
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
function ACDFrame:Reset()
 | 
					 | 
				
			||||||
    self.countdown = 0
 | 
					 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function ACDFrame:GetOptions()
 | 
					function ACDFrame:GetOptions()
 | 
				
			||||||
@@ -163,7 +184,7 @@ function ACDFrame:GetOptions()
 | 
				
			|||||||
        },
 | 
					        },
 | 
				
			||||||
        countdown = Gladdy:option({
 | 
					        countdown = Gladdy:option({
 | 
				
			||||||
            type = "toggle",
 | 
					            type = "toggle",
 | 
				
			||||||
            name = L["Turn on/off"],
 | 
					            name = L["Enabled"],
 | 
				
			||||||
            desc = L["Turns countdown before the start of an arena match on/off."],
 | 
					            desc = L["Turns countdown before the start of an arena match on/off."],
 | 
				
			||||||
            order = 3,
 | 
					            order = 3,
 | 
				
			||||||
            width = "full",
 | 
					            width = "full",
 | 
				
			||||||
@@ -175,6 +196,31 @@ function ACDFrame:GetOptions()
 | 
				
			|||||||
            min = 64,
 | 
					            min = 64,
 | 
				
			||||||
            max = 512,
 | 
					            max = 512,
 | 
				
			||||||
            step = 16,
 | 
					            step = 16,
 | 
				
			||||||
 | 
					            width = "full",
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.countdown end,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
 | 
					        headerAuraLevel = {
 | 
				
			||||||
 | 
					            type = "header",
 | 
				
			||||||
 | 
					            name = L["Frame Strata and Level"],
 | 
				
			||||||
 | 
					            order = 5,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        arenaCountdownFrameStrata = Gladdy:option({
 | 
				
			||||||
 | 
					            type = "select",
 | 
				
			||||||
 | 
					            name = L["Frame Strata"],
 | 
				
			||||||
 | 
					            order = 6,
 | 
				
			||||||
 | 
					            values = Gladdy.frameStrata,
 | 
				
			||||||
 | 
					            sorting = Gladdy.frameStrataSorting,
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.countdown end,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
 | 
					        arenaCountdownFrameLevel = Gladdy:option({
 | 
				
			||||||
 | 
					            type = "range",
 | 
				
			||||||
 | 
					            name = L["Frame Level"],
 | 
				
			||||||
 | 
					            min = 0,
 | 
				
			||||||
 | 
					            max = 500,
 | 
				
			||||||
 | 
					            step = 1,
 | 
				
			||||||
 | 
					            order = 7,
 | 
				
			||||||
 | 
					            width = "full",
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.countdown end,
 | 
				
			||||||
        }),
 | 
					        }),
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										1217
									
								
								Modules/Auras.lua
									
									
									
									
									
								
							
							
						
						
									
										1217
									
								
								Modules/Auras.lua
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -18,12 +18,15 @@ local BackdropTemplateMixin = BackdropTemplateMixin
 | 
				
			|||||||
local Gladdy = LibStub("Gladdy")
 | 
					local Gladdy = LibStub("Gladdy")
 | 
				
			||||||
local L = Gladdy.L
 | 
					local L = Gladdy.L
 | 
				
			||||||
local AceGUIWidgetLSMlists = AceGUIWidgetLSMlists
 | 
					local AceGUIWidgetLSMlists = AceGUIWidgetLSMlists
 | 
				
			||||||
local Castbar = Gladdy:NewModule("Castbar", 70, {
 | 
					local Castbar = Gladdy:NewModule("Cast Bar", 70, {
 | 
				
			||||||
 | 
					    castBarEnabled = true,
 | 
				
			||||||
    castBarHeight = 20,
 | 
					    castBarHeight = 20,
 | 
				
			||||||
    castBarWidth = 160,
 | 
					    castBarWidth = 160,
 | 
				
			||||||
    castBarIconSize = 22,
 | 
					    castBarIconSize = 22,
 | 
				
			||||||
 | 
					    castBarIconZoomed = false,
 | 
				
			||||||
    castBarBorderSize = 8,
 | 
					    castBarBorderSize = 8,
 | 
				
			||||||
    castBarFontSize = 12,
 | 
					    castBarFontSize = 12,
 | 
				
			||||||
 | 
					    castBarFontOutline = false,
 | 
				
			||||||
    castBarTexture = "Smooth",
 | 
					    castBarTexture = "Smooth",
 | 
				
			||||||
    castBarIconStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp",
 | 
					    castBarIconStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp",
 | 
				
			||||||
    castBarBorderStyle = "Gladdy Tooltip round",
 | 
					    castBarBorderStyle = "Gladdy Tooltip round",
 | 
				
			||||||
@@ -32,8 +35,8 @@ local Castbar = Gladdy:NewModule("Castbar", 70, {
 | 
				
			|||||||
    castBarIconColor = { r = 0, g = 0, b = 0, a = 1 },
 | 
					    castBarIconColor = { r = 0, g = 0, b = 0, a = 1 },
 | 
				
			||||||
    castBarBorderColor = { r = 0, g = 0, b = 0, a = 1 },
 | 
					    castBarBorderColor = { r = 0, g = 0, b = 0, a = 1 },
 | 
				
			||||||
    castBarFontColor = { r = 1, g = 1, b = 1, a = 1 },
 | 
					    castBarFontColor = { r = 1, g = 1, b = 1, a = 1 },
 | 
				
			||||||
 | 
					    castBarIconEnabled = true,
 | 
				
			||||||
    castBarGuesses = true,
 | 
					    castBarGuesses = true,
 | 
				
			||||||
    castBarPos = "LEFT",
 | 
					 | 
				
			||||||
    castBarXOffset = 0,
 | 
					    castBarXOffset = 0,
 | 
				
			||||||
    castBarYOffset = 0,
 | 
					    castBarYOffset = 0,
 | 
				
			||||||
    castBarIconPos = "LEFT",
 | 
					    castBarIconPos = "LEFT",
 | 
				
			||||||
@@ -41,12 +44,16 @@ local Castbar = Gladdy:NewModule("Castbar", 70, {
 | 
				
			|||||||
    castBarTimerFormat = "LEFT",
 | 
					    castBarTimerFormat = "LEFT",
 | 
				
			||||||
    castBarSparkEnabled = true,
 | 
					    castBarSparkEnabled = true,
 | 
				
			||||||
    castBarSparkColor = { r = 1, g = 1, b = 1, a = 1 },
 | 
					    castBarSparkColor = { r = 1, g = 1, b = 1, a = 1 },
 | 
				
			||||||
 | 
					    castBarFrameStrata = "MEDIUM",
 | 
				
			||||||
 | 
					    castBarFrameLevel = 5,
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Castbar:Initialize()
 | 
					function Castbar:Initialize()
 | 
				
			||||||
    self.frames = {}
 | 
					    self.frames = {}
 | 
				
			||||||
    self:RegisterMessage("UNIT_DEATH")
 | 
					    if Gladdy.db.castBarEnabled then
 | 
				
			||||||
    self:RegisterMessage("JOINED_ARENA")
 | 
					        self:RegisterMessage("UNIT_DEATH")
 | 
				
			||||||
 | 
					        self:RegisterMessage("JOINED_ARENA")
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
---------------------------
 | 
					---------------------------
 | 
				
			||||||
@@ -56,19 +63,28 @@ end
 | 
				
			|||||||
---------------------------
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Castbar:CreateFrame(unit)
 | 
					function Castbar:CreateFrame(unit)
 | 
				
			||||||
    local castBar = CreateFrame("Frame", nil, Gladdy.buttons[unit], BackdropTemplateMixin and "BackdropTemplate")
 | 
					    local castBar = CreateFrame("Frame", nil, Gladdy.buttons[unit])
 | 
				
			||||||
 | 
					    castBar:EnableMouse(false)
 | 
				
			||||||
 | 
					    castBar:SetMovable(true)
 | 
				
			||||||
    castBar.unit = unit
 | 
					    castBar.unit = unit
 | 
				
			||||||
 | 
					    castBar:SetFrameStrata(Gladdy.db.castBarFrameStrata)
 | 
				
			||||||
 | 
					    castBar:SetFrameLevel(Gladdy.db.castBarFrameLevel)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    castBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.castBarBorderStyle),
 | 
					    castBar.backdrop = CreateFrame("Frame", nil, castBar, BackdropTemplateMixin and "BackdropTemplate")
 | 
				
			||||||
 | 
					    castBar.backdrop:SetAllPoints(castBar)
 | 
				
			||||||
 | 
					    castBar.backdrop:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "castBarBorderStyle"),
 | 
				
			||||||
                                 edgeSize = Gladdy.db.castBarBorderSize })
 | 
					                                 edgeSize = Gladdy.db.castBarBorderSize })
 | 
				
			||||||
    castBar:SetBackdropBorderColor(Gladdy.db.castBarBorderColor.r, Gladdy.db.castBarBorderColor.g, Gladdy.db.castBarBorderColor.b, Gladdy.db.castBarBorderColor.a)
 | 
					    castBar.backdrop:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.castBarBorderColor))
 | 
				
			||||||
    castBar:SetFrameLevel(1)
 | 
					    castBar.backdrop:SetFrameStrata(Gladdy.db.castBarFrameStrata)
 | 
				
			||||||
 | 
					    castBar.backdrop:SetFrameLevel(Gladdy.db.castBarFrameLevel - 1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    castBar.bar = CreateFrame("StatusBar", nil, castBar)
 | 
					    castBar.bar = CreateFrame("StatusBar", nil, castBar)
 | 
				
			||||||
    castBar.bar:SetStatusBarTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.castBarTexture))
 | 
					    castBar.bar:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "castBarTexture"))
 | 
				
			||||||
    castBar.bar:SetStatusBarColor(Gladdy.db.castBarColor.r, Gladdy.db.castBarColor.g, Gladdy.db.castBarColor.b, Gladdy.db.castBarColor.a)
 | 
					    castBar.bar:SetStatusBarColor(Gladdy:SetColor(Gladdy.db.castBarColor))
 | 
				
			||||||
    castBar.bar:SetMinMaxValues(0, 100)
 | 
					    castBar.bar:SetMinMaxValues(0, 100)
 | 
				
			||||||
    castBar.bar:SetFrameLevel(0)
 | 
					    castBar.bar:SetFrameLevel(0)
 | 
				
			||||||
 | 
					    castBar.bar:SetFrameStrata(Gladdy.db.castBarFrameStrata)
 | 
				
			||||||
 | 
					    castBar.bar:SetFrameLevel(Gladdy.db.castBarFrameLevel)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    castBar.spark = castBar:CreateTexture(nil, "OVERLAY")
 | 
					    castBar.spark = castBar:CreateTexture(nil, "OVERLAY")
 | 
				
			||||||
    castBar.spark:SetTexture("Interface\\CastingBar\\UI-CastingBar-Spark")
 | 
					    castBar.spark:SetTexture("Interface\\CastingBar\\UI-CastingBar-Spark")
 | 
				
			||||||
@@ -79,17 +95,27 @@ function Castbar:CreateFrame(unit)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    castBar.bg = castBar.bar:CreateTexture(nil, "BACKGROUND")
 | 
					    castBar.bg = castBar.bar:CreateTexture(nil, "BACKGROUND")
 | 
				
			||||||
    castBar.bg:SetAlpha(1)
 | 
					    castBar.bg:SetAlpha(1)
 | 
				
			||||||
    castBar.bg:SetTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.castBarTexture))
 | 
					    castBar.bg:SetTexture(Gladdy:SMFetch("statusbar", "castBarTexture"))
 | 
				
			||||||
    castBar.bg:SetVertexColor(Gladdy.db.castBarBgColor.r, Gladdy.db.castBarBgColor.g, Gladdy.db.castBarBgColor.b, Gladdy.db.castBarBgColor.a)
 | 
					    castBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.castBarBgColor))
 | 
				
			||||||
    castBar.bg:SetAllPoints(castBar.bar)
 | 
					    castBar.bg:SetAllPoints(castBar.bar)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    castBar.icon = CreateFrame("Frame", nil, castBar)
 | 
					    castBar.icon = CreateFrame("Frame", nil, castBar)
 | 
				
			||||||
 | 
					    castBar.icon:SetFrameStrata(Gladdy.db.castBarFrameStrata)
 | 
				
			||||||
 | 
					    castBar.icon:SetFrameLevel(Gladdy.db.castBarFrameLevel)
 | 
				
			||||||
    castBar.icon.texture = castBar.icon:CreateTexture(nil, "BACKGROUND")
 | 
					    castBar.icon.texture = castBar.icon:CreateTexture(nil, "BACKGROUND")
 | 
				
			||||||
 | 
					    castBar.icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
				
			||||||
    castBar.icon.texture:SetAllPoints(castBar.icon)
 | 
					    castBar.icon.texture:SetAllPoints(castBar.icon)
 | 
				
			||||||
 | 
					    castBar.icon.texture.masked = true
 | 
				
			||||||
    castBar.icon.texture.overlay = castBar.icon:CreateTexture(nil, "BORDER")
 | 
					    castBar.icon.texture.overlay = castBar.icon:CreateTexture(nil, "BORDER")
 | 
				
			||||||
    castBar.icon.texture.overlay:SetAllPoints(castBar.icon.texture)
 | 
					    castBar.icon.texture.overlay:SetAllPoints(castBar.icon.texture)
 | 
				
			||||||
    castBar.icon.texture.overlay:SetTexture(Gladdy.db.castBarIconStyle)
 | 
					    castBar.icon.texture.overlay:SetTexture(Gladdy.db.castBarIconStyle)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    castBar.shield = castBar.icon:CreateTexture(nil, "OVERLAY")
 | 
				
			||||||
 | 
					    castBar.shield:SetTexture("Interface\\AddOns\\Gladdy\\Images\\castbar-shield")
 | 
				
			||||||
 | 
					    castBar.shield:SetHeight(80)
 | 
				
			||||||
 | 
					    castBar.shield:SetWidth(80)
 | 
				
			||||||
 | 
					    castBar.shield:SetPoint("CENTER", castBar.icon, "CENTER", 0, -1.5)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    castBar.icon:ClearAllPoints()
 | 
					    castBar.icon:ClearAllPoints()
 | 
				
			||||||
    if (Gladdy.db.castBarIconPos == "LEFT") then
 | 
					    if (Gladdy.db.castBarIconPos == "LEFT") then
 | 
				
			||||||
        castBar.icon:SetPoint("RIGHT", castBar, "LEFT", -3, 0) -- Icon of castbar
 | 
					        castBar.icon:SetPoint("RIGHT", castBar, "LEFT", -3, 0) -- Icon of castbar
 | 
				
			||||||
@@ -98,16 +124,16 @@ function Castbar:CreateFrame(unit)
 | 
				
			|||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    castBar.spellText = castBar:CreateFontString(nil, "LOW")
 | 
					    castBar.spellText = castBar:CreateFontString(nil, "LOW")
 | 
				
			||||||
    castBar.spellText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.auraFont), Gladdy.db.castBarFontSize)
 | 
					    castBar.spellText:SetFont(Gladdy:SMFetch("font", "auraFont"), Gladdy.db.castBarFontSize, Gladdy.db.castBarFontOutline and "OUTLINE")
 | 
				
			||||||
    castBar.spellText:SetTextColor(Gladdy.db.castBarFontColor.r, Gladdy.db.castBarFontColor.g, Gladdy.db.castBarFontColor.b, Gladdy.db.castBarFontColor.a)
 | 
					    castBar.spellText:SetTextColor(Gladdy:SetColor(Gladdy.db.castBarFontColor))
 | 
				
			||||||
    castBar.spellText:SetShadowOffset(1, -1)
 | 
					    castBar.spellText:SetShadowOffset(1, -1)
 | 
				
			||||||
    castBar.spellText:SetShadowColor(0, 0, 0, 1)
 | 
					    castBar.spellText:SetShadowColor(0, 0, 0, 1)
 | 
				
			||||||
    castBar.spellText:SetJustifyH("CENTER")
 | 
					    castBar.spellText:SetJustifyH("CENTER")
 | 
				
			||||||
    castBar.spellText:SetPoint("LEFT", 7, 0) -- Text of the spell
 | 
					    castBar.spellText:SetPoint("LEFT", 10, 0) -- Text of the spell
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    castBar.timeText = castBar:CreateFontString(nil, "LOW")
 | 
					    castBar.timeText = castBar:CreateFontString(nil, "LOW")
 | 
				
			||||||
    castBar.timeText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.auraFont), Gladdy.db.castBarFontSize)
 | 
					    castBar.timeText:SetFont(Gladdy:SMFetch("font", "auraFont"), Gladdy.db.castBarFontSize, Gladdy.db.castBarFontOutline and "OUTLINE")
 | 
				
			||||||
    castBar.timeText:SetTextColor(Gladdy.db.castBarFontColor.r, Gladdy.db.castBarFontColor.g, Gladdy.db.castBarFontColor.b, Gladdy.db.castBarFontColor.a)
 | 
					    castBar.timeText:SetTextColor(Gladdy:SetColor(Gladdy.db.castBarFontColor))
 | 
				
			||||||
    castBar.timeText:SetShadowOffset(1, -1)
 | 
					    castBar.timeText:SetShadowOffset(1, -1)
 | 
				
			||||||
    castBar.timeText:SetShadowColor(0, 0, 0, 1)
 | 
					    castBar.timeText:SetShadowColor(0, 0, 0, 1)
 | 
				
			||||||
    castBar.timeText:SetJustifyH("CENTER")
 | 
					    castBar.timeText:SetJustifyH("CENTER")
 | 
				
			||||||
@@ -118,31 +144,50 @@ function Castbar:CreateFrame(unit)
 | 
				
			|||||||
    self:ResetUnit(unit)
 | 
					    self:ResetUnit(unit)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Castbar:UpdateFrameOnce()
 | 
				
			||||||
 | 
					    if Gladdy.db.castBarEnabled then
 | 
				
			||||||
 | 
					        self:RegisterMessage("UNIT_DEATH")
 | 
				
			||||||
 | 
					        self:RegisterMessage("JOINED_ARENA")
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        self:UnregisterAllMessages()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Castbar:UpdateFrame(unit)
 | 
					function Castbar:UpdateFrame(unit)
 | 
				
			||||||
    local button = Gladdy.buttons[unit]
 | 
					 | 
				
			||||||
    local castBar = self.frames[unit]
 | 
					    local castBar = self.frames[unit]
 | 
				
			||||||
    if (not castBar) then
 | 
					    if (not castBar) then
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    local testAgain = false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    castBar:SetFrameStrata(Gladdy.db.castBarFrameStrata)
 | 
				
			||||||
 | 
					    castBar:SetFrameLevel(Gladdy.db.castBarFrameLevel)
 | 
				
			||||||
 | 
					    castBar.backdrop:SetFrameStrata(Gladdy.db.castBarFrameStrata)
 | 
				
			||||||
 | 
					    castBar.backdrop:SetFrameLevel(Gladdy.db.castBarFrameLevel - 1)
 | 
				
			||||||
 | 
					    castBar.bar:SetFrameStrata(Gladdy.db.castBarFrameStrata)
 | 
				
			||||||
 | 
					    castBar.bar:SetFrameLevel(Gladdy.db.castBarFrameLevel)
 | 
				
			||||||
 | 
					    castBar.icon:SetFrameStrata(Gladdy.db.castBarFrameStrata)
 | 
				
			||||||
 | 
					    castBar.icon:SetFrameLevel(Gladdy.db.castBarFrameLevel)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    castBar:SetWidth(Gladdy.db.castBarWidth)
 | 
					    castBar:SetWidth(Gladdy.db.castBarWidth)
 | 
				
			||||||
    castBar:SetHeight(Gladdy.db.castBarHeight)
 | 
					    castBar:SetHeight(Gladdy.db.castBarHeight)
 | 
				
			||||||
    castBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.castBarBorderStyle),
 | 
					    castBar.backdrop:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "castBarBorderStyle"),
 | 
				
			||||||
                                 edgeSize = Gladdy.db.castBarBorderSize })
 | 
					                                 edgeSize = Gladdy.db.castBarBorderSize })
 | 
				
			||||||
    castBar:SetBackdropBorderColor(Gladdy.db.castBarBorderColor.r, Gladdy.db.castBarBorderColor.g, Gladdy.db.castBarBorderColor.b, Gladdy.db.castBarBorderColor.a)
 | 
					    castBar.backdrop:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.castBarBorderColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    castBar.bar:SetStatusBarTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.castBarTexture))
 | 
					    castBar.bar:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "castBarTexture"))
 | 
				
			||||||
    castBar.bar:ClearAllPoints()
 | 
					    castBar.bar:ClearAllPoints()
 | 
				
			||||||
    castBar.bar:SetStatusBarColor(Gladdy.db.castBarColor.r, Gladdy.db.castBarColor.g, Gladdy.db.castBarColor.b, Gladdy.db.castBarColor.a)
 | 
					    castBar.bar:SetStatusBarColor(Gladdy:SetColor(Gladdy.db.castBarColor))
 | 
				
			||||||
    castBar.bar:SetPoint("TOPLEFT", castBar, "TOPLEFT", (Gladdy.db.castBarBorderSize/Gladdy.db.statusbarBorderOffset), -(Gladdy.db.castBarBorderSize/Gladdy.db.statusbarBorderOffset))
 | 
					    castBar.bar:SetPoint("TOPLEFT", castBar, "TOPLEFT", (Gladdy.db.castBarBorderSize/Gladdy.db.statusbarBorderOffset), -(Gladdy.db.castBarBorderSize/Gladdy.db.statusbarBorderOffset))
 | 
				
			||||||
    castBar.bar:SetPoint("BOTTOMRIGHT", castBar, "BOTTOMRIGHT", -(Gladdy.db.castBarBorderSize/Gladdy.db.statusbarBorderOffset), (Gladdy.db.castBarBorderSize/Gladdy.db.statusbarBorderOffset))
 | 
					    castBar.bar:SetPoint("BOTTOMRIGHT", castBar, "BOTTOMRIGHT", -(Gladdy.db.castBarBorderSize/Gladdy.db.statusbarBorderOffset), (Gladdy.db.castBarBorderSize/Gladdy.db.statusbarBorderOffset))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    castBar.bg:SetTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.castBarTexture))
 | 
					    castBar.bg:SetTexture(Gladdy:SMFetch("statusbar", "castBarTexture"))
 | 
				
			||||||
    castBar.bg:SetVertexColor(Gladdy.db.castBarBgColor.r, Gladdy.db.castBarBgColor.g, Gladdy.db.castBarBgColor.b, Gladdy.db.castBarBgColor.a)
 | 
					    castBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.castBarBgColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if Gladdy.db.castBarSparkEnabled then
 | 
					    if Gladdy.db.castBarSparkEnabled then
 | 
				
			||||||
        castBar.spark:SetHeight(Gladdy.db.castBarHeight * 1.8)
 | 
					        castBar.spark:SetHeight(Gladdy.db.castBarHeight * 1.8)
 | 
				
			||||||
        castBar.spark:SetVertexColor(Gladdy.db.castBarSparkColor.r, Gladdy.db.castBarSparkColor.g, Gladdy.db.castBarSparkColor.b, Gladdy.db.castBarSparkColor.a)
 | 
					        castBar.spark:SetVertexColor(Gladdy:SetColor(Gladdy.db.castBarSparkColor))
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        castBar.spark:SetAlpha(0)
 | 
					        castBar.spark:SetAlpha(0)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
@@ -150,8 +195,28 @@ function Castbar:UpdateFrame(unit)
 | 
				
			|||||||
    castBar.icon:SetWidth(Gladdy.db.castBarIconSize)
 | 
					    castBar.icon:SetWidth(Gladdy.db.castBarIconSize)
 | 
				
			||||||
    castBar.icon:SetHeight(Gladdy.db.castBarIconSize)
 | 
					    castBar.icon:SetHeight(Gladdy.db.castBarIconSize)
 | 
				
			||||||
    castBar.icon.texture:SetAllPoints(castBar.icon)
 | 
					    castBar.icon.texture:SetAllPoints(castBar.icon)
 | 
				
			||||||
 | 
					    if Gladdy.db.castBarIconZoomed then
 | 
				
			||||||
 | 
					        if castBar.icon.texture.masked then
 | 
				
			||||||
 | 
					            castBar.icon.texture:SetMask(nil)
 | 
				
			||||||
 | 
					            castBar.icon.texture:SetTexCoord(0.1,0.9,0.1,0.9)
 | 
				
			||||||
 | 
					            castBar.icon.texture.masked = nil
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        if not castBar.icon.texture.masked then
 | 
				
			||||||
 | 
					            castBar.icon.texture:SetMask(nil)
 | 
				
			||||||
 | 
					            castBar.icon.texture:SetTexCoord(0,1,0,1)
 | 
				
			||||||
 | 
					            castBar.icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
				
			||||||
 | 
					            castBar.icon.texture.masked = true
 | 
				
			||||||
 | 
					            if Gladdy.frame.testing then
 | 
				
			||||||
 | 
					                testAgain = true
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
    castBar.icon:ClearAllPoints()
 | 
					    castBar.icon:ClearAllPoints()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    castBar.shield:SetWidth(Gladdy.db.castBarIconSize * 3.2)
 | 
				
			||||||
 | 
					    castBar.shield:SetHeight(Gladdy.db.castBarIconSize * 3.2)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local rightMargin = 0
 | 
					    local rightMargin = 0
 | 
				
			||||||
    local leftMargin = 0
 | 
					    local leftMargin = 0
 | 
				
			||||||
    if (Gladdy.db.castBarIconPos == "LEFT") then
 | 
					    if (Gladdy.db.castBarIconPos == "LEFT") then
 | 
				
			||||||
@@ -162,64 +227,35 @@ function Castbar:UpdateFrame(unit)
 | 
				
			|||||||
        leftMargin = Gladdy.db.castBarIconSize + 1
 | 
					        leftMargin = Gladdy.db.castBarIconSize + 1
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    castBar:ClearAllPoints()
 | 
					    Gladdy:SetPosition(castBar, unit, "castBarXOffset", "castBarYOffset", Castbar:LegacySetPosition(castBar, unit, leftMargin, rightMargin), Castbar)
 | 
				
			||||||
    local horizontalMargin = Gladdy.db.highlightBorderSize + Gladdy.db.padding
 | 
					 | 
				
			||||||
    local verticalMargin = -(Gladdy.db.powerBarHeight)/2
 | 
					 | 
				
			||||||
    if (Gladdy.db.castBarPos == "LEFT") then
 | 
					 | 
				
			||||||
        if (Gladdy.db.trinketPos == "LEFT" and Gladdy.db.trinketEnabled) then
 | 
					 | 
				
			||||||
            horizontalMargin = horizontalMargin + (Gladdy.db.trinketSize * Gladdy.db.trinketWidthFactor) + Gladdy.db.padding
 | 
					 | 
				
			||||||
            if (Gladdy.db.classIconPos == "LEFT") then
 | 
					 | 
				
			||||||
                horizontalMargin = horizontalMargin + (Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor) + Gladdy.db.padding
 | 
					 | 
				
			||||||
            end
 | 
					 | 
				
			||||||
        elseif (Gladdy.db.classIconPos == "LEFT") then
 | 
					 | 
				
			||||||
            horizontalMargin = horizontalMargin + (Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor) + Gladdy.db.padding
 | 
					 | 
				
			||||||
            if (Gladdy.db.trinketPos == "LEFT" and Gladdy.db.trinketEnabled) then
 | 
					 | 
				
			||||||
                horizontalMargin = horizontalMargin + (Gladdy.db.trinketSize * Gladdy.db.trinketWidthFactor) + Gladdy.db.padding
 | 
					 | 
				
			||||||
            end
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
        if (Gladdy.db.cooldownYPos == "LEFT" and Gladdy.db.cooldown) then
 | 
					 | 
				
			||||||
            verticalMargin = verticalMargin + (Gladdy.db.cooldownSize/2 + Gladdy.db.padding/2)
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
        if (Gladdy.db.drCooldownPos == "LEFT" and Gladdy.db.drEnabled) then
 | 
					 | 
				
			||||||
            verticalMargin = verticalMargin + (Gladdy.db.drIconSize/2 + Gladdy.db.padding/2)
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
        if (Gladdy.db.buffsCooldownPos == "LEFT" and Gladdy.db.buffsEnabled) then
 | 
					 | 
				
			||||||
            verticalMargin = verticalMargin + Gladdy.db.buffsIconSize/2 + Gladdy.db.padding/2
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
        castBar:SetPoint("RIGHT", button.healthBar, "LEFT", -horizontalMargin - leftMargin + Gladdy.db.castBarXOffset, Gladdy.db.castBarYOffset + verticalMargin)
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
    if (Gladdy.db.castBarPos == "RIGHT") then
 | 
					 | 
				
			||||||
        if (Gladdy.db.trinketPos == "RIGHT" and Gladdy.db.trinketEnabled) then
 | 
					 | 
				
			||||||
            horizontalMargin = horizontalMargin + (Gladdy.db.trinketSize * Gladdy.db.trinketWidthFactor) + Gladdy.db.padding
 | 
					 | 
				
			||||||
            if (Gladdy.db.classIconPos == "RIGHT") then
 | 
					 | 
				
			||||||
                horizontalMargin = horizontalMargin + (Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor) + Gladdy.db.padding
 | 
					 | 
				
			||||||
            end
 | 
					 | 
				
			||||||
        elseif (Gladdy.db.classIconPos == "RIGHT") then
 | 
					 | 
				
			||||||
            horizontalMargin = horizontalMargin + (Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor) + Gladdy.db.padding
 | 
					 | 
				
			||||||
            if (Gladdy.db.trinketPos == "LEFT" and Gladdy.db.trinketEnabled) then
 | 
					 | 
				
			||||||
                horizontalMargin = horizontalMargin + (Gladdy.db.trinketSize * Gladdy.db.trinketWidthFactor) + Gladdy.db.padding
 | 
					 | 
				
			||||||
            end
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
        if (Gladdy.db.cooldownYPos == "RIGHT" and Gladdy.db.cooldown) then
 | 
					 | 
				
			||||||
            verticalMargin = verticalMargin + (Gladdy.db.cooldownSize/2 + Gladdy.db.padding/2)
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
        if (Gladdy.db.drCooldownPos == "RIGHT" and Gladdy.db.drEnabled) then
 | 
					 | 
				
			||||||
            verticalMargin = verticalMargin + (Gladdy.db.drIconSize/2 + Gladdy.db.padding/2)
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
        if (Gladdy.db.buffsCooldownPos == "RIGHT" and Gladdy.db.buffsEnabled) then
 | 
					 | 
				
			||||||
            verticalMargin = verticalMargin + Gladdy.db.buffsIconSize/2 + Gladdy.db.padding/2
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
        castBar:SetPoint("LEFT", button.healthBar, "RIGHT", horizontalMargin + rightMargin + Gladdy.db.castBarXOffset, Gladdy.db.castBarYOffset + verticalMargin)
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    castBar.spellText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.auraFont), Gladdy.db.castBarFontSize)
 | 
					    castBar.spellText:SetFont(Gladdy:SMFetch("font", "castBarFont"), Gladdy.db.castBarFontSize, Gladdy.db.castBarFontOutline and "OUTLINE")
 | 
				
			||||||
    castBar.spellText:SetTextColor(Gladdy.db.castBarFontColor.r, Gladdy.db.castBarFontColor.g, Gladdy.db.castBarFontColor.b, Gladdy.db.castBarFontColor.a)
 | 
					    castBar.spellText:SetTextColor(Gladdy:SetColor(Gladdy.db.castBarFontColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    castBar.timeText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.auraFont), Gladdy.db.castBarFontSize)
 | 
					    castBar.timeText:SetFont(Gladdy:SMFetch("font", "castBarFont"), Gladdy.db.castBarFontSize, Gladdy.db.castBarFontOutline and "OUTLINE")
 | 
				
			||||||
    castBar.timeText:SetTextColor(Gladdy.db.castBarFontColor.r, Gladdy.db.castBarFontColor.g, Gladdy.db.castBarFontColor.b, Gladdy.db.castBarFontColor.a)
 | 
					    castBar.timeText:SetTextColor(Gladdy:SetColor(Gladdy.db.castBarFontColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    castBar.icon.texture.overlay:SetTexture(Gladdy.db.castBarIconStyle)
 | 
					    castBar.icon.texture.overlay:SetTexture(Gladdy.db.castBarIconStyle)
 | 
				
			||||||
    castBar.icon.texture.overlay:SetVertexColor(Gladdy.db.castBarIconColor.r, Gladdy.db.castBarIconColor.g, Gladdy.db.castBarIconColor.b, Gladdy.db.castBarIconColor.a)
 | 
					    castBar.icon.texture.overlay:SetVertexColor(Gladdy:SetColor(Gladdy.db.castBarIconColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (unit == "arena1") then
 | 
				
			||||||
 | 
					        Gladdy:CreateMover(castBar, "castBarXOffset", "castBarYOffset", L["Cast Bar"],
 | 
				
			||||||
 | 
					                {"TOPLEFT", "TOPLEFT"}, Gladdy.db.castBarWidth, Gladdy.db.castBarHeight,
 | 
				
			||||||
 | 
					                0, 0, "castBarEnabled")
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if not Gladdy.db.castBarEnabled then
 | 
				
			||||||
 | 
					        self:CAST_STOP(unit)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if Gladdy.db.castBarIconEnabled then
 | 
				
			||||||
 | 
					        castBar.icon:Show()
 | 
				
			||||||
 | 
					        if testAgain then
 | 
				
			||||||
 | 
					            self:ResetUnit(unit)
 | 
				
			||||||
 | 
					            self:Test(unit)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        castBar.icon:Hide()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
---------------------------
 | 
					---------------------------
 | 
				
			||||||
@@ -260,7 +296,7 @@ function Castbar.OnUpdate(castBar, elapsed)
 | 
				
			|||||||
            castBar.spark:SetPoint("CENTER", castBar.bar, "LEFT", castBar.spark.position, 0)
 | 
					            castBar.spark:SetPoint("CENTER", castBar.bar, "LEFT", castBar.spark.position, 0)
 | 
				
			||||||
            castBar.spark:Show()
 | 
					            castBar.spark:Show()
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    elseif ( GetTime() < castBar.holdTime ) then
 | 
					    elseif ( castBar.holdTime and GetTime() < castBar.holdTime ) then
 | 
				
			||||||
        castBar.timeText:Hide()
 | 
					        castBar.timeText:Hide()
 | 
				
			||||||
        castBar.spark:Hide()
 | 
					        castBar.spark:Hide()
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
@@ -272,16 +308,16 @@ function Castbar.OnUpdate(castBar, elapsed)
 | 
				
			|||||||
            castBar.fadeOut = nil;
 | 
					            castBar.fadeOut = nil;
 | 
				
			||||||
            castBar.timeText:Show()
 | 
					            castBar.timeText:Show()
 | 
				
			||||||
            castBar.spark:Show()
 | 
					            castBar.spark:Show()
 | 
				
			||||||
            castBar:Hide();
 | 
					            castBar:SetAlpha(0)
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Castbar.CastEventsFunc = {}
 | 
					Castbar.CastEventsFunc = {}
 | 
				
			||||||
Castbar.CastEventsFunc["UNIT_SPELLCAST_START"] = function(castBar, event, ...)
 | 
					Castbar.CastEventsFunc["UNIT_SPELLCAST_START"] = function(castBar, event, ...)
 | 
				
			||||||
    local name, text, texture, startTime, endTime, isTradeSkill, castID = UnitCastingInfo(castBar.unit)
 | 
					    local name, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible, spellId = UnitCastingInfo(castBar.unit)
 | 
				
			||||||
    if ( not name or (not castBar.showTradeSkills and isTradeSkill)) then
 | 
					    if ( not name or (not castBar.showTradeSkills and isTradeSkill)) then
 | 
				
			||||||
        castBar:Hide()
 | 
					        castBar:SetAlpha(0)
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -312,7 +348,7 @@ Castbar.CastEventsFunc["UNIT_SPELLCAST_SUCCEEDED"] = function(castBar, event, ..
 | 
				
			|||||||
end
 | 
					end
 | 
				
			||||||
Castbar.CastEventsFunc["UNIT_SPELLCAST_STOP"] = function(castBar, event, ...)
 | 
					Castbar.CastEventsFunc["UNIT_SPELLCAST_STOP"] = function(castBar, event, ...)
 | 
				
			||||||
    if ( not castBar:IsVisible() ) then
 | 
					    if ( not castBar:IsVisible() ) then
 | 
				
			||||||
        castBar:Hide()
 | 
					        castBar:SetAlpha(0)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    if ( (castBar.casting and event == "UNIT_SPELLCAST_STOP" and select(2, ...) == castBar.castID) or
 | 
					    if ( (castBar.casting and event == "UNIT_SPELLCAST_STOP" and select(2, ...) == castBar.castID) or
 | 
				
			||||||
            (castBar.channeling and event == "UNIT_SPELLCAST_CHANNEL_STOP") ) then
 | 
					            (castBar.channeling and event == "UNIT_SPELLCAST_CHANNEL_STOP") ) then
 | 
				
			||||||
@@ -360,7 +396,7 @@ Castbar.CastEventsFunc["UNIT_SPELLCAST_DELAYED"] = function(castBar, event, ...)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        if ( not name or (not castBar.showTradeSkills and isTradeSkill)) then
 | 
					        if ( not name or (not castBar.showTradeSkills and isTradeSkill)) then
 | 
				
			||||||
            -- if there is no name, there is no bar
 | 
					            -- if there is no name, there is no bar
 | 
				
			||||||
            castBar:Hide()
 | 
					            castBar:SetAlpha(0)
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
        castBar.value = (GetTime() - (startTime / 1000))
 | 
					        castBar.value = (GetTime() - (startTime / 1000))
 | 
				
			||||||
@@ -375,10 +411,10 @@ Castbar.CastEventsFunc["UNIT_SPELLCAST_DELAYED"] = function(castBar, event, ...)
 | 
				
			|||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
Castbar.CastEventsFunc["UNIT_SPELLCAST_CHANNEL_START"] = function(castBar, event, ...)
 | 
					Castbar.CastEventsFunc["UNIT_SPELLCAST_CHANNEL_START"] = function(castBar, event, ...)
 | 
				
			||||||
    local name, text, texture, startTime, endTime, isTradeSkill, spellID = UnitChannelInfo(castBar.unit)
 | 
					    local name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellId = UnitChannelInfo(castBar.unit)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if ( not name or (not castBar.showTradeSkills and isTradeSkill)) then
 | 
					    if ( not name or (not castBar.showTradeSkills and isTradeSkill)) then
 | 
				
			||||||
        castBar:Hide()
 | 
					        castBar:SetAlpha(0)
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    if ( castBar.spark ) then
 | 
					    if ( castBar.spark ) then
 | 
				
			||||||
@@ -396,7 +432,7 @@ Castbar.CastEventsFunc["UNIT_SPELLCAST_CHANNEL_UPDATE"] = function(castBar, even
 | 
				
			|||||||
    if ( castBar:IsShown() ) then
 | 
					    if ( castBar:IsShown() ) then
 | 
				
			||||||
        local name, text, texture, startTime, endTime, isTradeSkill = UnitChannelInfo(castBar.unit)
 | 
					        local name, text, texture, startTime, endTime, isTradeSkill = UnitChannelInfo(castBar.unit)
 | 
				
			||||||
        if ( not name or (not castBar.showTradeSkills and isTradeSkill)) then
 | 
					        if ( not name or (not castBar.showTradeSkills and isTradeSkill)) then
 | 
				
			||||||
            castBar:Hide()
 | 
					            castBar:SetAlpha(0)
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
        castBar.value = ((endTime / 1000) - GetTime())
 | 
					        castBar.value = ((endTime / 1000) - GetTime())
 | 
				
			||||||
@@ -413,7 +449,7 @@ function Castbar.OnEvent(self, event, ...)
 | 
				
			|||||||
    Castbar.CastEventsFunc[event](self, event, ...)
 | 
					    Castbar.CastEventsFunc[event](self, event, ...)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Castbar:CAST_START(unit, spell, icon, value, maxValue, test)
 | 
					function Castbar:CAST_START(unit, spell, icon, value, maxValue, notInterruptible, test)
 | 
				
			||||||
    local castBar = self.frames[unit]
 | 
					    local castBar = self.frames[unit]
 | 
				
			||||||
    if (not castBar) then
 | 
					    if (not castBar) then
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
@@ -425,18 +461,36 @@ function Castbar:CAST_START(unit, spell, icon, value, maxValue, test)
 | 
				
			|||||||
        castBar.channeling = test == "channel"
 | 
					        castBar.channeling = test == "channel"
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    castBar.bar:SetStatusBarColor(Gladdy.db.castBarColor.r, Gladdy.db.castBarColor.g, Gladdy.db.castBarColor.b, Gladdy.db.castBarColor.a)
 | 
					    if notInterruptible then
 | 
				
			||||||
 | 
					        castBar.bar:SetStatusBarColor(.8,.8,.8,1)
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        castBar.bar:SetStatusBarColor(Gladdy:SetColor(Gladdy.db.castBarColor))
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    castBar.value = value
 | 
					    castBar.value = value
 | 
				
			||||||
    castBar.maxValue = maxValue
 | 
					    castBar.maxValue = maxValue
 | 
				
			||||||
    castBar.bar:SetMinMaxValues(0, maxValue)
 | 
					    castBar.bar:SetMinMaxValues(0, maxValue)
 | 
				
			||||||
    castBar.bar:SetValue(value)
 | 
					    castBar.bar:SetValue(value)
 | 
				
			||||||
 | 
					    castBar.icon:SetAlpha(1)
 | 
				
			||||||
    castBar.icon.texture:SetTexture(icon)
 | 
					    castBar.icon.texture:SetTexture(icon)
 | 
				
			||||||
    castBar.spellText:SetText(spell)
 | 
					    castBar.spellText:SetText(spell)
 | 
				
			||||||
    castBar.timeText:SetText(maxValue)
 | 
					    castBar.timeText:SetText(maxValue)
 | 
				
			||||||
    castBar.bg:Show()
 | 
					    castBar.bg:Show()
 | 
				
			||||||
    castBar:Show()
 | 
					    castBar.backdrop:Show()
 | 
				
			||||||
 | 
					    if Gladdy.db.castBarSparkEnabled then
 | 
				
			||||||
 | 
					        castBar.spark:Show()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if notInterruptible then
 | 
				
			||||||
 | 
					        castBar.shield:Show()
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        castBar.shield:Hide()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
    castBar:SetAlpha(1)
 | 
					    castBar:SetAlpha(1)
 | 
				
			||||||
    castBar.icon:Show()
 | 
					    if Gladdy.db.castBarIconEnabled then
 | 
				
			||||||
 | 
					        castBar.icon:Show()
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        castBar.icon:Hide()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Castbar:CAST_STOP(unit, ...)
 | 
					function Castbar:CAST_STOP(unit, ...)
 | 
				
			||||||
@@ -449,13 +503,16 @@ function Castbar:CAST_STOP(unit, ...)
 | 
				
			|||||||
        castBar.channeling = nil
 | 
					        castBar.channeling = nil
 | 
				
			||||||
        castBar.value = 0
 | 
					        castBar.value = 0
 | 
				
			||||||
        castBar.maxValue = 0
 | 
					        castBar.maxValue = 0
 | 
				
			||||||
 | 
					        castBar.icon:SetAlpha(0)
 | 
				
			||||||
        castBar.icon.texture:SetTexture("")
 | 
					        castBar.icon.texture:SetTexture("")
 | 
				
			||||||
        castBar.spellText:SetText("")
 | 
					        castBar.spellText:SetText("")
 | 
				
			||||||
        castBar.timeText:SetText("")
 | 
					        castBar.timeText:SetText("")
 | 
				
			||||||
        castBar.bar:SetValue(0)
 | 
					        castBar.bar:SetValue(0)
 | 
				
			||||||
        castBar.bg:Hide()
 | 
					        castBar.bg:Hide()
 | 
				
			||||||
        castBar:Hide()
 | 
					        castBar.backdrop:Hide()
 | 
				
			||||||
 | 
					        castBar.spark:Hide()
 | 
				
			||||||
        castBar.icon:Hide()
 | 
					        castBar.icon:Hide()
 | 
				
			||||||
 | 
					        castBar.shield:Hide()
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        castBar.bar:SetStatusBarColor(...)
 | 
					        castBar.bar:SetStatusBarColor(...)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
@@ -468,42 +525,41 @@ end
 | 
				
			|||||||
---------------------------
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Castbar:JOINED_ARENA()
 | 
					function Castbar:JOINED_ARENA()
 | 
				
			||||||
    for i=1, Gladdy.curBracket do
 | 
					    if Gladdy.db.castBarEnabled then
 | 
				
			||||||
        local unit = "arena" .. i
 | 
					        for i=1, Gladdy.curBracket do
 | 
				
			||||||
        local castBar = self.frames[unit]
 | 
					            local unit = "arena" .. i
 | 
				
			||||||
        castBar:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED")
 | 
					            local castBar = self.frames[unit]
 | 
				
			||||||
        castBar:RegisterEvent("UNIT_SPELLCAST_DELAYED")
 | 
					            castBar:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED")
 | 
				
			||||||
        castBar:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START")
 | 
					            castBar:RegisterEvent("UNIT_SPELLCAST_DELAYED")
 | 
				
			||||||
        castBar:RegisterEvent("UNIT_SPELLCAST_CHANNEL_UPDATE")
 | 
					            castBar:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START")
 | 
				
			||||||
        castBar:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP")
 | 
					            castBar:RegisterEvent("UNIT_SPELLCAST_CHANNEL_UPDATE")
 | 
				
			||||||
        castBar:RegisterUnitEvent("UNIT_SPELLCAST_START", unit)
 | 
					            castBar:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP")
 | 
				
			||||||
        castBar:RegisterUnitEvent("UNIT_SPELLCAST_STOP", unit)
 | 
					            castBar:RegisterUnitEvent("UNIT_SPELLCAST_START", unit)
 | 
				
			||||||
        castBar:RegisterUnitEvent("UNIT_SPELLCAST_FAILED", unit)
 | 
					            castBar:RegisterUnitEvent("UNIT_SPELLCAST_STOP", unit)
 | 
				
			||||||
        castBar:RegisterUnitEvent("UNIT_SPELLCAST_SUCCEEDED", unit)
 | 
					            castBar:RegisterUnitEvent("UNIT_SPELLCAST_FAILED", unit)
 | 
				
			||||||
        castBar:SetScript("OnEvent", Castbar.OnEvent)
 | 
					            castBar:RegisterUnitEvent("UNIT_SPELLCAST_SUCCEEDED", unit)
 | 
				
			||||||
        castBar:SetScript("OnUpdate", Castbar.OnUpdate)
 | 
					            castBar:SetScript("OnEvent", Castbar.OnEvent)
 | 
				
			||||||
        castBar.fadeOut = nil
 | 
					            castBar:SetScript("OnUpdate", Castbar.OnUpdate)
 | 
				
			||||||
        self:CAST_STOP(unit)
 | 
					            castBar.fadeOut = nil
 | 
				
			||||||
        --Castbar.OnEvent(castBar, "PLAYER_ENTERING_WORLD")
 | 
					            self:CAST_STOP(unit)
 | 
				
			||||||
 | 
					            --Castbar.OnEvent(castBar, "PLAYER_ENTERING_WORLD")
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Castbar:ResetUnit(unit)
 | 
					function Castbar:ResetUnit(unit)
 | 
				
			||||||
    local castBar = self.frames[unit]
 | 
					    local castBar = self.frames[unit]
 | 
				
			||||||
    castBar:UnregisterEvent("UNIT_SPELLCAST_INTERRUPTED")
 | 
					    castBar:UnregisterAllEvents()
 | 
				
			||||||
    castBar:UnregisterEvent("UNIT_SPELLCAST_DELAYED")
 | 
					 | 
				
			||||||
    castBar:UnregisterEvent("UNIT_SPELLCAST_CHANNEL_START")
 | 
					 | 
				
			||||||
    castBar:UnregisterEvent("UNIT_SPELLCAST_CHANNEL_UPDATE")
 | 
					 | 
				
			||||||
    castBar:UnregisterEvent("UNIT_SPELLCAST_CHANNEL_STOP")
 | 
					 | 
				
			||||||
    castBar:UnregisterEvent("UNIT_SPELLCAST_START")
 | 
					 | 
				
			||||||
    castBar:UnregisterEvent("UNIT_SPELLCAST_STOP")
 | 
					 | 
				
			||||||
    castBar:UnregisterEvent("UNIT_SPELLCAST_FAILED")
 | 
					 | 
				
			||||||
    castBar:SetScript("OnEvent", nil)
 | 
					    castBar:SetScript("OnEvent", nil)
 | 
				
			||||||
    castBar:SetScript("OnUpdate", nil)
 | 
					    castBar:SetScript("OnUpdate", nil)
 | 
				
			||||||
    castBar.fadeOut = nil
 | 
					    castBar.fadeOut = nil
 | 
				
			||||||
    self:CAST_STOP(unit)
 | 
					    self:CAST_STOP(unit)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Castbar:Reset()
 | 
				
			||||||
 | 
					    self.test = nil
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
---------------------------
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- TEST
 | 
					-- TEST
 | 
				
			||||||
@@ -511,25 +567,31 @@ end
 | 
				
			|||||||
---------------------------
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Castbar:Test(unit)
 | 
					function Castbar:Test(unit)
 | 
				
			||||||
    local spell, _, icon, value, maxValue, event, endTime, startTime
 | 
					    self.test = true
 | 
				
			||||||
 | 
					    if Gladdy.db.castBarEnabled then
 | 
				
			||||||
 | 
					        local spell, _, icon, value, maxValue, event, endTime, startTime
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (unit == "arena2") then
 | 
					        if (unit == "arena2") then
 | 
				
			||||||
        spell, _, icon = GetSpellInfo(27072)
 | 
					            spell, _, icon = GetSpellInfo(27072)
 | 
				
			||||||
        value, maxValue, event = 0, 2, "cast"
 | 
					            value, maxValue, event = 0, 40, "cast"
 | 
				
			||||||
    elseif (unit == "arena1") then
 | 
					        elseif (unit == "arena1") then
 | 
				
			||||||
        spell, _, icon = GetSpellInfo(27220)
 | 
					            spell, _, icon = GetSpellInfo(27220)
 | 
				
			||||||
        endTime = GetTime() * 1000 + 60*1000
 | 
					            endTime = GetTime() * 1000 + 60*1000
 | 
				
			||||||
        startTime = GetTime() * 1000
 | 
					            startTime = GetTime() * 1000
 | 
				
			||||||
        value = (endTime / 1000) - GetTime()
 | 
					            value = (endTime / 1000) - GetTime()
 | 
				
			||||||
        maxValue = (endTime - startTime) / 1000
 | 
					            maxValue = (endTime - startTime) / 1000
 | 
				
			||||||
        event = "channel"
 | 
					            event = "channel"
 | 
				
			||||||
    elseif (unit == "arena3") then
 | 
					        else
 | 
				
			||||||
        spell, _, icon = GetSpellInfo(20770)
 | 
					            spell, _, icon = GetSpellInfo(20770)
 | 
				
			||||||
        value, maxValue, event = 0, 60, "cast"
 | 
					            value, maxValue, event = 0, 60, "cast"
 | 
				
			||||||
    end
 | 
					        end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (spell) then
 | 
					        if (spell) then
 | 
				
			||||||
        self:CAST_START(unit, spell, icon, value, maxValue, event)
 | 
					            local nonInterruptable = unit == "arena1" and Gladdy.expansion == "Wrath"
 | 
				
			||||||
 | 
					            self:CAST_START(unit, spell, icon, value, maxValue, nonInterruptable, event)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        self:CAST_STOP(unit)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -548,7 +610,7 @@ local function option(params)
 | 
				
			|||||||
        set = function(info, value)
 | 
					        set = function(info, value)
 | 
				
			||||||
            local key = info.arg or info[#info]
 | 
					            local key = info.arg or info[#info]
 | 
				
			||||||
            Gladdy.dbi.profile[key] = value
 | 
					            Gladdy.dbi.profile[key] = value
 | 
				
			||||||
            Gladdy.options.args.Castbar.args.group.args.barFrame.args.castBarBorderSize.max = Gladdy.db.castBarHeight/2
 | 
					            Gladdy.options.args["Cast Bar"].args.group.args.barFrame.args.castBarBorderSize.max = Gladdy.db.castBarHeight/2
 | 
				
			||||||
            if Gladdy.db.castBarBorderSize > Gladdy.db.castBarHeight/2 then
 | 
					            if Gladdy.db.castBarBorderSize > Gladdy.db.castBarHeight/2 then
 | 
				
			||||||
                Gladdy.db.castBarBorderSize = Gladdy.db.castBarHeight/2
 | 
					                Gladdy.db.castBarBorderSize = Gladdy.db.castBarHeight/2
 | 
				
			||||||
            end
 | 
					            end
 | 
				
			||||||
@@ -570,15 +632,22 @@ function Castbar:GetOptions()
 | 
				
			|||||||
            name = L["Cast Bar"],
 | 
					            name = L["Cast Bar"],
 | 
				
			||||||
            order = 2,
 | 
					            order = 2,
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
					        castBarEnabled = option({
 | 
				
			||||||
 | 
					            type = "toggle",
 | 
				
			||||||
 | 
					            name = L["Enabled"],
 | 
				
			||||||
 | 
					            desc = L["If test is running, type \"/gladdy test\" again"],
 | 
				
			||||||
 | 
					            order = 3,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
        group = {
 | 
					        group = {
 | 
				
			||||||
            type = "group",
 | 
					            type = "group",
 | 
				
			||||||
            childGroups = "tree",
 | 
					            childGroups = "tree",
 | 
				
			||||||
            name = "Frame",
 | 
					            name = L["Frame"],
 | 
				
			||||||
            order = 3,
 | 
					            order = 4,
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.castBarEnabled end,
 | 
				
			||||||
            args = {
 | 
					            args = {
 | 
				
			||||||
                barFrame = {
 | 
					                barFrame = {
 | 
				
			||||||
                    type = "group",
 | 
					                    type = "group",
 | 
				
			||||||
                    name = "Bar",
 | 
					                    name = L["Bar"],
 | 
				
			||||||
                    order = 1,
 | 
					                    order = 1,
 | 
				
			||||||
                    args = {
 | 
					                    args = {
 | 
				
			||||||
                        headerSize = {
 | 
					                        headerSize = {
 | 
				
			||||||
@@ -592,8 +661,9 @@ function Castbar:GetOptions()
 | 
				
			|||||||
                            desc = L["Height of the bar"],
 | 
					                            desc = L["Height of the bar"],
 | 
				
			||||||
                            order = 3,
 | 
					                            order = 3,
 | 
				
			||||||
                            min = 0,
 | 
					                            min = 0,
 | 
				
			||||||
                            max = 50,
 | 
					                            max = 200,
 | 
				
			||||||
                            step = 1,
 | 
					                            step = 1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        castBarWidth = option({
 | 
					                        castBarWidth = option({
 | 
				
			||||||
                            type = "range",
 | 
					                            type = "range",
 | 
				
			||||||
@@ -601,8 +671,9 @@ function Castbar:GetOptions()
 | 
				
			|||||||
                            desc = L["Width of the bars"],
 | 
					                            desc = L["Width of the bars"],
 | 
				
			||||||
                            order = 4,
 | 
					                            order = 4,
 | 
				
			||||||
                            min = 0,
 | 
					                            min = 0,
 | 
				
			||||||
                            max = 300,
 | 
					                            max = 600,
 | 
				
			||||||
                            step = 1,
 | 
					                            step = 1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        headerTexture = {
 | 
					                        headerTexture = {
 | 
				
			||||||
                            type = "header",
 | 
					                            type = "header",
 | 
				
			||||||
@@ -643,6 +714,7 @@ function Castbar:GetOptions()
 | 
				
			|||||||
                            min = 0.5,
 | 
					                            min = 0.5,
 | 
				
			||||||
                            max = Gladdy.db.castBarHeight/2,
 | 
					                            max = Gladdy.db.castBarHeight/2,
 | 
				
			||||||
                            step = 0.5,
 | 
					                            step = 0.5,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        castBarBorderStyle = option({
 | 
					                        castBarBorderStyle = option({
 | 
				
			||||||
                            type = "select",
 | 
					                            type = "select",
 | 
				
			||||||
@@ -661,14 +733,27 @@ function Castbar:GetOptions()
 | 
				
			|||||||
                },
 | 
					                },
 | 
				
			||||||
                icon = {
 | 
					                icon = {
 | 
				
			||||||
                    type = "group",
 | 
					                    type = "group",
 | 
				
			||||||
                    name = "Icon",
 | 
					                    name = L["Icon"],
 | 
				
			||||||
                    order = 2,
 | 
					                    order = 2,
 | 
				
			||||||
                    args = {
 | 
					                    args = {
 | 
				
			||||||
                        headerSize = {
 | 
					                        headerSize = {
 | 
				
			||||||
                            type = "header",
 | 
					                            type = "header",
 | 
				
			||||||
                            name = L["Icon Size"],
 | 
					                            name = L["Icon"],
 | 
				
			||||||
                            order = 1,
 | 
					                            order = 1,
 | 
				
			||||||
                        },
 | 
					                        },
 | 
				
			||||||
 | 
					                        castBarIconEnabled = option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["Icon Enabled"],
 | 
				
			||||||
 | 
					                            order = 2,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        castBarIconZoomed = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["Zoomed Icon"],
 | 
				
			||||||
 | 
					                            desc = L["Zoomes the icon to remove borders"],
 | 
				
			||||||
 | 
					                            order = 3,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
                        castBarIconSize = option({
 | 
					                        castBarIconSize = option({
 | 
				
			||||||
                            type = "range",
 | 
					                            type = "range",
 | 
				
			||||||
                            name = L["Icon size"],
 | 
					                            name = L["Icon size"],
 | 
				
			||||||
@@ -676,6 +761,7 @@ function Castbar:GetOptions()
 | 
				
			|||||||
                            min = 0,
 | 
					                            min = 0,
 | 
				
			||||||
                            max = 100,
 | 
					                            max = 100,
 | 
				
			||||||
                            step = 1,
 | 
					                            step = 1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        headerBorder = {
 | 
					                        headerBorder = {
 | 
				
			||||||
                            type = "header",
 | 
					                            type = "header",
 | 
				
			||||||
@@ -698,7 +784,7 @@ function Castbar:GetOptions()
 | 
				
			|||||||
                },
 | 
					                },
 | 
				
			||||||
                spark = {
 | 
					                spark = {
 | 
				
			||||||
                    type = "group",
 | 
					                    type = "group",
 | 
				
			||||||
                    name = "Spark",
 | 
					                    name = L["Spark"],
 | 
				
			||||||
                    order = 3,
 | 
					                    order = 3,
 | 
				
			||||||
                    args = {
 | 
					                    args = {
 | 
				
			||||||
                        header = {
 | 
					                        header = {
 | 
				
			||||||
@@ -722,7 +808,7 @@ function Castbar:GetOptions()
 | 
				
			|||||||
                },
 | 
					                },
 | 
				
			||||||
                font = {
 | 
					                font = {
 | 
				
			||||||
                    type = "group",
 | 
					                    type = "group",
 | 
				
			||||||
                    name = "Font",
 | 
					                    name = L["Font"],
 | 
				
			||||||
                    order = 4,
 | 
					                    order = 4,
 | 
				
			||||||
                    args = {
 | 
					                    args = {
 | 
				
			||||||
                        header = {
 | 
					                        header = {
 | 
				
			||||||
@@ -752,6 +838,13 @@ function Castbar:GetOptions()
 | 
				
			|||||||
                            order = 4,
 | 
					                            order = 4,
 | 
				
			||||||
                            min = 1,
 | 
					                            min = 1,
 | 
				
			||||||
                            max = 20,
 | 
					                            max = 20,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        castBarFontOutline = option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["Outline"],
 | 
				
			||||||
 | 
					                            order = 5,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        headerFormat = {
 | 
					                        headerFormat = {
 | 
				
			||||||
                            type = "header",
 | 
					                            type = "header",
 | 
				
			||||||
@@ -772,7 +865,7 @@ function Castbar:GetOptions()
 | 
				
			|||||||
                },
 | 
					                },
 | 
				
			||||||
                position = {
 | 
					                position = {
 | 
				
			||||||
                    type = "group",
 | 
					                    type = "group",
 | 
				
			||||||
                    name = "Position",
 | 
					                    name = L["Position"],
 | 
				
			||||||
                    order = 5,
 | 
					                    order = 5,
 | 
				
			||||||
                    args = {
 | 
					                    args = {
 | 
				
			||||||
                        header = {
 | 
					                        header = {
 | 
				
			||||||
@@ -780,15 +873,6 @@ function Castbar:GetOptions()
 | 
				
			|||||||
                            name = L["Position"],
 | 
					                            name = L["Position"],
 | 
				
			||||||
                            order = 1,
 | 
					                            order = 1,
 | 
				
			||||||
                        },
 | 
					                        },
 | 
				
			||||||
                        castBarPos = option({
 | 
					 | 
				
			||||||
                            type = "select",
 | 
					 | 
				
			||||||
                            name = L["Castbar position"],
 | 
					 | 
				
			||||||
                            order = 2,
 | 
					 | 
				
			||||||
                            values = {
 | 
					 | 
				
			||||||
                                ["LEFT"] = L["Left"],
 | 
					 | 
				
			||||||
                                ["RIGHT"] = L["Right"],
 | 
					 | 
				
			||||||
                            },
 | 
					 | 
				
			||||||
                        }),
 | 
					 | 
				
			||||||
                        castBarIconPos = option( {
 | 
					                        castBarIconPos = option( {
 | 
				
			||||||
                            type = "select",
 | 
					                            type = "select",
 | 
				
			||||||
                            name = L["Icon position"],
 | 
					                            name = L["Icon position"],
 | 
				
			||||||
@@ -810,6 +894,7 @@ function Castbar:GetOptions()
 | 
				
			|||||||
                            min = -400,
 | 
					                            min = -400,
 | 
				
			||||||
                            max = 400,
 | 
					                            max = 400,
 | 
				
			||||||
                            step = 0.1,
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        castBarYOffset = option({
 | 
					                        castBarYOffset = option({
 | 
				
			||||||
                            type = "range",
 | 
					                            type = "range",
 | 
				
			||||||
@@ -818,10 +903,77 @@ function Castbar:GetOptions()
 | 
				
			|||||||
                            min = -400,
 | 
					                            min = -400,
 | 
				
			||||||
                            max = 400,
 | 
					                            max = 400,
 | 
				
			||||||
                            step = 0.1,
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
 | 
					                frameStrata = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Frame Strata and Level"],
 | 
				
			||||||
 | 
					                    order = 6,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        headerAuraLevel = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Frame Strata and Level"],
 | 
				
			||||||
 | 
					                            order = 1,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        castBarFrameStrata = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "select",
 | 
				
			||||||
 | 
					                            name = L["Frame Strata"],
 | 
				
			||||||
 | 
					                            order = 2,
 | 
				
			||||||
 | 
					                            values = Gladdy.frameStrata,
 | 
				
			||||||
 | 
					                            sorting = Gladdy.frameStrataSorting,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        castBarFrameLevel = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Frame Level"],
 | 
				
			||||||
 | 
					                            min = 1,
 | 
				
			||||||
 | 
					                            max = 500,
 | 
				
			||||||
 | 
					                            step = 1,
 | 
				
			||||||
 | 
					                            order = 3,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- LAGACY HANDLER
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Castbar:LegacySetPosition(castBar, unit, leftMargin, rightMargin)
 | 
				
			||||||
 | 
					    if Gladdy.db.newLayout then
 | 
				
			||||||
 | 
					        return Gladdy.db.newLayout
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    castBar:ClearAllPoints()
 | 
				
			||||||
 | 
					    if Gladdy.db.castBarWidth <= 0 then
 | 
				
			||||||
 | 
					        castBar:SetWidth(0.1)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if Gladdy.db.castBarHeight <= 0 then
 | 
				
			||||||
 | 
					        castBar:SetHeight(0.1)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    local horizontalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) + Gladdy.db.padding
 | 
				
			||||||
 | 
					    if (Gladdy.db.castBarPos == "LEFT") then
 | 
				
			||||||
 | 
					        local anchor = Gladdy:GetAnchor(unit, "LEFT")
 | 
				
			||||||
 | 
					        if anchor == Gladdy.buttons[unit].healthBar then
 | 
				
			||||||
 | 
					            castBar:SetPoint("RIGHT", anchor, "LEFT", -horizontalMargin - leftMargin + Gladdy.db.castBarXOffset, Gladdy.db.castBarYOffset)
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            castBar:SetPoint("RIGHT", anchor, "LEFT", -Gladdy.db.padding - leftMargin + Gladdy.db.castBarXOffset, Gladdy.db.castBarYOffset)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if (Gladdy.db.castBarPos == "RIGHT") then
 | 
				
			||||||
 | 
					        local anchor = Gladdy:GetAnchor(unit, "RIGHT")
 | 
				
			||||||
 | 
					        if anchor == Gladdy.buttons[unit].healthBar then
 | 
				
			||||||
 | 
					            castBar:SetPoint("LEFT", anchor, "RIGHT", horizontalMargin + rightMargin + Gladdy.db.castBarXOffset, Gladdy.db.castBarYOffset)
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            castBar:SetPoint("LEFT", anchor, "RIGHT", Gladdy.db.padding + rightMargin + Gladdy.db.castBarXOffset, Gladdy.db.castBarYOffset)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    return Gladdy.db.newLayout
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
@@ -1,27 +1,122 @@
 | 
				
			|||||||
 | 
					local select, str_gsub = select, string.gsub
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local Gladdy = LibStub("Gladdy")
 | 
					local Gladdy = LibStub("Gladdy")
 | 
				
			||||||
local CreateFrame = CreateFrame
 | 
					local CreateFrame = CreateFrame
 | 
				
			||||||
 | 
					local GetSpellInfo = GetSpellInfo
 | 
				
			||||||
local L = Gladdy.L
 | 
					local L = Gladdy.L
 | 
				
			||||||
local Classicon = Gladdy:NewModule("Classicon", 80, {
 | 
					local Classicon = Gladdy:NewModule("Class Icon", 81, {
 | 
				
			||||||
    classIconPos = "LEFT",
 | 
					    classIconEnabled = true,
 | 
				
			||||||
    classIconSize = 60 + 20 + 1,
 | 
					    classIconSize = 60 + 20 + 1,
 | 
				
			||||||
    classIconWidthFactor = 0.9,
 | 
					    classIconWidthFactor = 0.9,
 | 
				
			||||||
 | 
					    classIconZoomed = false,
 | 
				
			||||||
    classIconBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp",
 | 
					    classIconBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp",
 | 
				
			||||||
    classIconBorderColor = { r = 0, g = 0, b = 0, a = 1 },
 | 
					    classIconBorderColor = { r = 0, g = 0, b = 0, a = 1 },
 | 
				
			||||||
 | 
					    classIconSpecIcon = false,
 | 
				
			||||||
 | 
					    classIconXOffset = 0,
 | 
				
			||||||
 | 
					    classIconYOffset = 0,
 | 
				
			||||||
 | 
					    classIconFrameStrata = "MEDIUM",
 | 
				
			||||||
 | 
					    classIconFrameLevel = 5,
 | 
				
			||||||
 | 
					    classIconGroup = false,
 | 
				
			||||||
 | 
					    classIconGroupDirection = "DOWN"
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local classIconPath = "Interface\\Addons\\Gladdy\\Images\\Classes\\"
 | 
				
			||||||
 | 
					local classIcons = {
 | 
				
			||||||
 | 
					    ["DRUID"] = classIconPath .. "inv_misc_monsterclaw_04",
 | 
				
			||||||
 | 
					    ["DEATHKNIGHT"] = select(3, GetSpellInfo(49023)), --Might of Mograine
 | 
				
			||||||
 | 
					    ["HUNTER"] = classIconPath .. "inv_weapon_bow_07",
 | 
				
			||||||
 | 
					    ["MAGE"] = classIconPath .. "inv_staff_13",
 | 
				
			||||||
 | 
					    ["PALADIN"] = classIconPath .. "inv_hammer_01",
 | 
				
			||||||
 | 
					    ["PRIEST"] = classIconPath .. "inv_staff_30",
 | 
				
			||||||
 | 
					    ["ROGUE"] = classIconPath .. "inv_throwingknife_04",
 | 
				
			||||||
 | 
					    ["SHAMAN"] = classIconPath .. "inv_jewelry_talisman_04",
 | 
				
			||||||
 | 
					    ["WARLOCK"] = classIconPath .. "spell_nature_drowsy",
 | 
				
			||||||
 | 
					    ["WARRIOR"] = classIconPath .. "inv_sword_27",
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local specIcons = {
 | 
				
			||||||
 | 
					    --DRUID
 | 
				
			||||||
 | 
					    ["DRUID"] = {
 | 
				
			||||||
 | 
					        [L["Balance"]] = select(3, GetSpellInfo(8921)), -- Moonfire
 | 
				
			||||||
 | 
					        [L["Feral"]] = select(3, GetSpellInfo(27545)), -- Cat Form
 | 
				
			||||||
 | 
					        [L["Restoration"]] = select(3, GetSpellInfo(5185)), -- Healing Touch
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    ["DEATHKNIGHT"] = {
 | 
				
			||||||
 | 
					        [L["Unholy"]] = select(3, GetSpellInfo(48265)), -- Unholy Presence
 | 
				
			||||||
 | 
					        [L["Blood"]] = select(3, GetSpellInfo(48266)), -- Blood Presence
 | 
				
			||||||
 | 
					        [L["Frost"]] = select(3, GetSpellInfo(48263)), -- Frost Presence
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    ["HUNTER"] = {
 | 
				
			||||||
 | 
					        [L["Beast Mastery"]] = select(3, GetSpellInfo(1515)), -- Tame Beast
 | 
				
			||||||
 | 
					        [L["Marksmanship"]] = select(3, GetSpellInfo(42243)), -- Volley
 | 
				
			||||||
 | 
					        [L["Survival"]] = select(3, GetSpellInfo(1495)), -- Mongoose Bite
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    ["MAGE"] = {
 | 
				
			||||||
 | 
					        [L["Arcane"]] = select(3, GetSpellInfo(1459)), -- Arcane Intellect
 | 
				
			||||||
 | 
					        [L["Fire"]] = select(3, GetSpellInfo(133)), -- Fireball
 | 
				
			||||||
 | 
					        [L["Frost"]] = select(3, GetSpellInfo(116)), -- Frostbolt
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    ["PALADIN"] = {
 | 
				
			||||||
 | 
					        [L["Holy"]] = select(3, GetSpellInfo(635)), -- Holy Light
 | 
				
			||||||
 | 
					        [L["Retribution"]] = select(3, GetSpellInfo(7294)), -- Retribution Aura
 | 
				
			||||||
 | 
					        [L["Protection"]] = select(3, GetSpellInfo(32828)), -- Protection Aura
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    ["PRIEST"] = {
 | 
				
			||||||
 | 
					        [L["Discipline"]] = select(3, GetSpellInfo(1243)), -- Power Word: Fortitude
 | 
				
			||||||
 | 
					        [L["Shadow"]] = select(3, GetSpellInfo(589)), -- Shadow Word: Pain
 | 
				
			||||||
 | 
					        [L["Holy"]] = select(3, GetSpellInfo(635)), -- Holy Light
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    ["ROGUE"] = {
 | 
				
			||||||
 | 
					        [L["Assassination"]] = select(3, GetSpellInfo(1329)), -- Mutilate (Eviscerate? 2098)
 | 
				
			||||||
 | 
					        [L["Combat"]] = select(3, GetSpellInfo(53)), -- Backstab
 | 
				
			||||||
 | 
					        [L["Subtlety"]] = select(3, GetSpellInfo(1784)), -- Stealth
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    ["SHAMAN"] = {
 | 
				
			||||||
 | 
					        [L["Elemental"]] = select(3, GetSpellInfo(403)), -- Lightning Bolt
 | 
				
			||||||
 | 
					        [L["Enhancement"]] = select(3, GetSpellInfo(324)), -- Lightning Shield
 | 
				
			||||||
 | 
					        [L["Restoration"]] = select(3, GetSpellInfo(331)), -- Healing Wave
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    ["WARLOCK"] = {
 | 
				
			||||||
 | 
					        [L["Affliction"]] = select(3, GetSpellInfo(6789)), -- Affliction
 | 
				
			||||||
 | 
					        [L["Demonology"]] = select(3, GetSpellInfo(5500)), -- Sense Demons
 | 
				
			||||||
 | 
					        [L["Destruction"]] = select(3, GetSpellInfo(5740)), -- Rain of Fire
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    ["WARRIOR"] = {
 | 
				
			||||||
 | 
					        [L["Arms"]] = select(3, GetSpellInfo(12294)), -- Mortal Strike
 | 
				
			||||||
 | 
					        [L["Fury"]] = select(3, GetSpellInfo(12325)), -- Inner Rage
 | 
				
			||||||
 | 
					        [L["Protection"]] = select(3, GetSpellInfo(71)), -- Defensive Stance
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Classicon:Initialize()
 | 
					function Classicon:Initialize()
 | 
				
			||||||
    self.frames = {}
 | 
					    self.frames = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    self:RegisterMessage("ENEMY_SPOTTED")
 | 
					    if Gladdy.db.classIconEnabled then
 | 
				
			||||||
    self:RegisterMessage("UNIT_DEATH")
 | 
					        self:RegisterMessage("ENEMY_SPOTTED")
 | 
				
			||||||
 | 
					        self:RegisterMessage("UNIT_DEATH")
 | 
				
			||||||
 | 
					        self:RegisterMessage("UNIT_SPEC")
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Classicon:UpdateFrameOnce()
 | 
				
			||||||
 | 
					    if Gladdy.db.classIconEnabled then
 | 
				
			||||||
 | 
					        self:RegisterMessage("ENEMY_SPOTTED")
 | 
				
			||||||
 | 
					        self:RegisterMessage("UNIT_DEATH")
 | 
				
			||||||
 | 
					        self:RegisterMessage("UNIT_SPEC")
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        self:UnregisterAllMessages()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Classicon:CreateFrame(unit)
 | 
					function Classicon:CreateFrame(unit)
 | 
				
			||||||
    local classIcon = CreateFrame("Frame", nil, Gladdy.buttons[unit])
 | 
					    local classIcon = CreateFrame("Frame", nil, Gladdy.buttons[unit])
 | 
				
			||||||
 | 
					    classIcon:EnableMouse(false)
 | 
				
			||||||
    classIcon:SetFrameStrata("MEDIUM")
 | 
					    classIcon:SetFrameStrata("MEDIUM")
 | 
				
			||||||
    classIcon:SetFrameLevel(1)
 | 
					    classIcon:SetFrameLevel(1)
 | 
				
			||||||
    classIcon.texture = classIcon:CreateTexture(nil, "BACKGROUND")
 | 
					    classIcon.texture = classIcon:CreateTexture(nil, "BACKGROUND")
 | 
				
			||||||
    classIcon.texture:SetAllPoints(classIcon)
 | 
					    classIcon.texture:SetAllPoints(classIcon)
 | 
				
			||||||
 | 
					    classIcon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
				
			||||||
 | 
					    classIcon.texture.masked = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    classIcon.texture.overlay = classIcon:CreateTexture(nil, "BORDER")
 | 
					    classIcon.texture.overlay = classIcon:CreateTexture(nil, "BORDER")
 | 
				
			||||||
    classIcon.texture.overlay:SetAllPoints(classIcon)
 | 
					    classIcon.texture.overlay:SetAllPoints(classIcon)
 | 
				
			||||||
@@ -30,13 +125,6 @@ function Classicon:CreateFrame(unit)
 | 
				
			|||||||
    classIcon:SetFrameStrata("MEDIUM")
 | 
					    classIcon:SetFrameStrata("MEDIUM")
 | 
				
			||||||
    classIcon:SetFrameLevel(2)
 | 
					    classIcon:SetFrameLevel(2)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    classIcon:ClearAllPoints()
 | 
					 | 
				
			||||||
    if (Gladdy.db.classIconPos == "RIGHT") then
 | 
					 | 
				
			||||||
        classIcon:SetPoint("TOPLEFT", Gladdy.buttons[unit].healthBar, "TOPRIGHT", 2, 2)
 | 
					 | 
				
			||||||
    else
 | 
					 | 
				
			||||||
        classIcon:SetPoint("TOPRIGHT", Gladdy.buttons[unit].healthBar, "TOPLEFT", -2, 2)
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Gladdy.buttons[unit].classIcon = classIcon
 | 
					    Gladdy.buttons[unit].classIcon = classIcon
 | 
				
			||||||
    self.frames[unit] = classIcon
 | 
					    self.frames[unit] = classIcon
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
@@ -47,26 +135,92 @@ function Classicon:UpdateFrame(unit)
 | 
				
			|||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    local testAgain = false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    classIcon:SetFrameStrata(Gladdy.db.classIconFrameStrata)
 | 
				
			||||||
 | 
					    classIcon:SetFrameLevel(Gladdy.db.classIconFrameLevel)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    classIcon:SetWidth(Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor)
 | 
					    classIcon:SetWidth(Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor)
 | 
				
			||||||
    classIcon:SetHeight(Gladdy.db.classIconSize)
 | 
					    classIcon:SetHeight(Gladdy.db.classIconSize)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    classIcon:ClearAllPoints()
 | 
					    if Gladdy.db.classIconZoomed then
 | 
				
			||||||
    local margin = Gladdy.db.highlightBorderSize + Gladdy.db.padding
 | 
					        if classIcon.texture.masked then
 | 
				
			||||||
    if (Gladdy.db.classIconPos == "LEFT") then
 | 
					            classIcon.texture:SetMask(nil)
 | 
				
			||||||
        classIcon:SetPoint("TOPRIGHT", Gladdy.buttons[unit].healthBar, "TOPLEFT", -margin, 0)
 | 
					            classIcon.texture:SetTexCoord(0.1,0.9,0.1,0.9)
 | 
				
			||||||
 | 
					            classIcon.texture.masked = nil
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        classIcon:SetPoint("TOPLEFT", Gladdy.buttons[unit], "TOPRIGHT", margin, 0)
 | 
					        if not classIcon.texture.masked then
 | 
				
			||||||
 | 
					            classIcon.texture:SetMask(nil)
 | 
				
			||||||
 | 
					            classIcon.texture:SetTexCoord(0,1,0,1)
 | 
				
			||||||
 | 
					            classIcon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
				
			||||||
 | 
					            classIcon.texture.masked = true
 | 
				
			||||||
 | 
					            if Gladdy.frame.testing then
 | 
				
			||||||
 | 
					                testAgain = true
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Gladdy:SetPosition(classIcon, unit, "classIconXOffset", "classIconYOffset", Classicon:LegacySetPosition(classIcon, unit), Classicon)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (Gladdy.db.classIconGroup) then
 | 
				
			||||||
 | 
					        if (unit ~= "arena1") then
 | 
				
			||||||
 | 
					            local previousUnit = "arena" .. str_gsub(unit, "arena", "") - 1
 | 
				
			||||||
 | 
					            self.frames[unit]:ClearAllPoints()
 | 
				
			||||||
 | 
					            if Gladdy.db.classIconGroupDirection == "RIGHT" then
 | 
				
			||||||
 | 
					                self.frames[unit]:SetPoint("LEFT", self.frames[previousUnit], "RIGHT", 0, 0)
 | 
				
			||||||
 | 
					            elseif Gladdy.db.classIconGroupDirection == "LEFT" then
 | 
				
			||||||
 | 
					                self.frames[unit]:SetPoint("RIGHT", self.frames[previousUnit], "LEFT", 0, 0)
 | 
				
			||||||
 | 
					            elseif Gladdy.db.classIconGroupDirection == "UP" then
 | 
				
			||||||
 | 
					                self.frames[unit]:SetPoint("BOTTOM", self.frames[previousUnit], "TOP", 0, 0)
 | 
				
			||||||
 | 
					            elseif Gladdy.db.classIconGroupDirection == "DOWN" then
 | 
				
			||||||
 | 
					                self.frames[unit]:SetPoint("TOP", self.frames[previousUnit], "BOTTOM", 0, 0)
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (unit == "arena1") then
 | 
				
			||||||
 | 
					        Gladdy:CreateMover(classIcon, "classIconXOffset", "classIconYOffset", L["Class Icon"],
 | 
				
			||||||
 | 
					                {"TOPLEFT", "TOPLEFT"},
 | 
				
			||||||
 | 
					                Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor,
 | 
				
			||||||
 | 
					                Gladdy.db.classIconSize,
 | 
				
			||||||
 | 
					                0,
 | 
				
			||||||
 | 
					                0, "classIconEnabled")
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    classIcon.texture:ClearAllPoints()
 | 
					    classIcon.texture:ClearAllPoints()
 | 
				
			||||||
    classIcon.texture:SetAllPoints(classIcon)
 | 
					    classIcon.texture:SetAllPoints(classIcon)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    classIcon.texture.overlay:SetTexture(Gladdy.db.classIconBorderStyle)
 | 
					    classIcon.texture.overlay:SetTexture(Gladdy.db.classIconBorderStyle)
 | 
				
			||||||
    classIcon.texture.overlay:SetVertexColor(Gladdy.db.classIconBorderColor.r, Gladdy.db.classIconBorderColor.g, Gladdy.db.classIconBorderColor.b, Gladdy.db.classIconBorderColor.a)
 | 
					    classIcon.texture.overlay:SetVertexColor(Gladdy:SetColor(Gladdy.db.classIconBorderColor))
 | 
				
			||||||
 | 
					    if Gladdy.db.classIconEnabled then
 | 
				
			||||||
 | 
					        classIcon:Show()
 | 
				
			||||||
 | 
					        if testAgain then
 | 
				
			||||||
 | 
					            Classicon:ResetUnit(unit)
 | 
				
			||||||
 | 
					            Classicon:ENEMY_SPOTTED(unit)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        classIcon:Hide()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Classicon:Test(unit)
 | 
					function Classicon:ENEMY_SPOTTED(unit)
 | 
				
			||||||
    self:ENEMY_SPOTTED(unit)
 | 
					    local classIcon = self.frames[unit]
 | 
				
			||||||
 | 
					    if (not classIcon) then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    classIcon.texture:SetTexture(classIcons[Gladdy.buttons[unit].class])
 | 
				
			||||||
 | 
					    --classIcon.texture:SetTexCoord(unpack(CLASS_BUTTONS[Gladdy.buttons[unit].class]))
 | 
				
			||||||
 | 
					    classIcon.texture:SetAllPoints(classIcon)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Classicon:UNIT_SPEC(unit, spec)
 | 
				
			||||||
 | 
					    local classIcon = self.frames[unit]
 | 
				
			||||||
 | 
					    if (not Gladdy.db.classIconSpecIcon or not classIcon) then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    classIcon.texture:SetTexture(specIcons[Gladdy.buttons[unit].class][spec])
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Classicon:ResetUnit(unit)
 | 
					function Classicon:ResetUnit(unit)
 | 
				
			||||||
@@ -85,24 +239,83 @@ function Classicon:GetOptions()
 | 
				
			|||||||
            name = L["Class Icon"],
 | 
					            name = L["Class Icon"],
 | 
				
			||||||
            order = 2,
 | 
					            order = 2,
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
					        classIconEnabled = Gladdy:option({
 | 
				
			||||||
 | 
					            type = "toggle",
 | 
				
			||||||
 | 
					            name = L["Class Icon Enabled"],
 | 
				
			||||||
 | 
					            order = 3,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
 | 
					        classIconSpecIcon = {
 | 
				
			||||||
 | 
					            type = "toggle",
 | 
				
			||||||
 | 
					            name = L["Show Spec Icon"],
 | 
				
			||||||
 | 
					            desc = L["Shows Spec Icon once spec is detected"],
 | 
				
			||||||
 | 
					            order = 4,
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.classIconEnabled end,
 | 
				
			||||||
 | 
					            get = function() return Gladdy.db.classIconSpecIcon end,
 | 
				
			||||||
 | 
					            set = function(_, value)
 | 
				
			||||||
 | 
					                Gladdy.db.classIconSpecIcon = value
 | 
				
			||||||
 | 
					                if Gladdy.curBracket and Gladdy.curBracket > 0 then
 | 
				
			||||||
 | 
					                    for i=1,Gladdy.curBracket do
 | 
				
			||||||
 | 
					                        local unit = "arena" .. i
 | 
				
			||||||
 | 
					                        if (Gladdy.buttons[unit] and Gladdy.buttons[unit].spec) then
 | 
				
			||||||
 | 
					                            self:ENEMY_SPOTTED(unit)
 | 
				
			||||||
 | 
					                            self:UNIT_SPEC(unit, Gladdy.buttons[unit].spec)
 | 
				
			||||||
 | 
					                        end
 | 
				
			||||||
 | 
					                    end
 | 
				
			||||||
 | 
					                end
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        classIconGroup = Gladdy:option({
 | 
				
			||||||
 | 
					            type = "toggle",
 | 
				
			||||||
 | 
					            name = L["Group"] .. " " .. L["Class Icon"],
 | 
				
			||||||
 | 
					            order = 5,
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.classIconEnabled end,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
 | 
					        classIconGroupDirection = Gladdy:option({
 | 
				
			||||||
 | 
					            type = "select",
 | 
				
			||||||
 | 
					            name = L["Group direction"],
 | 
				
			||||||
 | 
					            order = 6,
 | 
				
			||||||
 | 
					            values = {
 | 
				
			||||||
 | 
					                ["RIGHT"] = L["Right"],
 | 
				
			||||||
 | 
					                ["LEFT"] = L["Left"],
 | 
				
			||||||
 | 
					                ["UP"] = L["Up"],
 | 
				
			||||||
 | 
					                ["DOWN"] = L["Down"],
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					            disabled = function()
 | 
				
			||||||
 | 
					                return not Gladdy.db.classIconGroup or not Gladdy.db.classIconEnabled
 | 
				
			||||||
 | 
					            end,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
        group = {
 | 
					        group = {
 | 
				
			||||||
            type = "group",
 | 
					            type = "group",
 | 
				
			||||||
            childGroups = "tree",
 | 
					            childGroups = "tree",
 | 
				
			||||||
            name = "Frame",
 | 
					            name = L["Frame"],
 | 
				
			||||||
            order = 3,
 | 
					            order = 7,
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.classIconEnabled end,
 | 
				
			||||||
            args = {
 | 
					            args = {
 | 
				
			||||||
                size = {
 | 
					                size = {
 | 
				
			||||||
                    type = "group",
 | 
					                    type = "group",
 | 
				
			||||||
                    name = L["Icon size"],
 | 
					                    name = L["Icon"],
 | 
				
			||||||
                    order = 1,
 | 
					                    order = 1,
 | 
				
			||||||
                    args = {
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        header = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Icon"],
 | 
				
			||||||
 | 
					                            order = 1,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        classIconZoomed = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["Zoomed Icon"],
 | 
				
			||||||
 | 
					                            desc = L["Zoomes the icon to remove borders"],
 | 
				
			||||||
 | 
					                            order = 2,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
                        classIconSize = Gladdy:option({
 | 
					                        classIconSize = Gladdy:option({
 | 
				
			||||||
                            type = "range",
 | 
					                            type = "range",
 | 
				
			||||||
                            name = L["Icon size"],
 | 
					                            name = L["Size"],
 | 
				
			||||||
                            min = 1,
 | 
					                            min = 3,
 | 
				
			||||||
                            max = 100,
 | 
					                            max = 100,
 | 
				
			||||||
                            step = 1,
 | 
					                            step = .1,
 | 
				
			||||||
                            order = 3,
 | 
					                            order = 3,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        classIconWidthFactor = Gladdy:option({
 | 
					                        classIconWidthFactor = Gladdy:option({
 | 
				
			||||||
                            type = "range",
 | 
					                            type = "range",
 | 
				
			||||||
@@ -111,35 +324,44 @@ function Classicon:GetOptions()
 | 
				
			|||||||
                            max = 2,
 | 
					                            max = 2,
 | 
				
			||||||
                            step = 0.05,
 | 
					                            step = 0.05,
 | 
				
			||||||
                            order = 4,
 | 
					                            order = 4,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
                position = {
 | 
					                position = {
 | 
				
			||||||
                    type = "group",
 | 
					                    type = "group",
 | 
				
			||||||
                    name = L["Position"],
 | 
					                    name = L["Position"],
 | 
				
			||||||
                    order = 1,
 | 
					                    order = 3,
 | 
				
			||||||
                    args = {
 | 
					                    args = {
 | 
				
			||||||
                        headerPosition = {
 | 
					                        headerPosition = {
 | 
				
			||||||
                            type = "header",
 | 
					                            type = "header",
 | 
				
			||||||
                            name = L["Position"],
 | 
					                            name = L["Position"],
 | 
				
			||||||
                            order = 5,
 | 
					                            order = 5,
 | 
				
			||||||
                        },
 | 
					                        },
 | 
				
			||||||
                        classIconPos = Gladdy:option({
 | 
					                        classIconXOffset = Gladdy:option({
 | 
				
			||||||
                            type = "select",
 | 
					                            type = "range",
 | 
				
			||||||
                            name = L["Icon position"],
 | 
					                            name = L["Horizontal offset"],
 | 
				
			||||||
                            desc = L["This changes positions with trinket"],
 | 
					                            order = 11,
 | 
				
			||||||
                            order = 6,
 | 
					                            min = -800,
 | 
				
			||||||
                            values = {
 | 
					                            max = 800,
 | 
				
			||||||
                                ["LEFT"] = L["Left"],
 | 
					                            step = 0.1,
 | 
				
			||||||
                                ["RIGHT"] = L["Right"],
 | 
					                            width = "full",
 | 
				
			||||||
                            },
 | 
					                        }),
 | 
				
			||||||
 | 
					                        classIconYOffset = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Vertical offset"],
 | 
				
			||||||
 | 
					                            order = 12,
 | 
				
			||||||
 | 
					                            min = -800,
 | 
				
			||||||
 | 
					                            max = 800,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
                border = {
 | 
					                border = {
 | 
				
			||||||
                    type = "group",
 | 
					                    type = "group",
 | 
				
			||||||
                    name = L["Border"],
 | 
					                    name = L["Border"],
 | 
				
			||||||
                    order = 1,
 | 
					                    order = 2,
 | 
				
			||||||
                    args = {
 | 
					                    args = {
 | 
				
			||||||
                        headerBorder = {
 | 
					                        headerBorder = {
 | 
				
			||||||
                            type = "header",
 | 
					                            type = "header",
 | 
				
			||||||
@@ -161,42 +383,55 @@ function Classicon:GetOptions()
 | 
				
			|||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
 | 
					                frameStrata = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Frame Strata and Level"],
 | 
				
			||||||
 | 
					                    order = 4,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        headerAuraLevel = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Frame Strata and Level"],
 | 
				
			||||||
 | 
					                            order = 1,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        classIconFrameStrata = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "select",
 | 
				
			||||||
 | 
					                            name = L["Frame Strata"],
 | 
				
			||||||
 | 
					                            order = 2,
 | 
				
			||||||
 | 
					                            values = Gladdy.frameStrata,
 | 
				
			||||||
 | 
					                            sorting = Gladdy.frameStrataSorting,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        classIconFrameLevel = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Frame Level"],
 | 
				
			||||||
 | 
					                            min = 0,
 | 
				
			||||||
 | 
					                            max = 500,
 | 
				
			||||||
 | 
					                            step = 1,
 | 
				
			||||||
 | 
					                            order = 3,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function getClassIcon(class)
 | 
					---------------------------
 | 
				
			||||||
    -- see https://wow.gamepedia.com/Class_icon
 | 
					 | 
				
			||||||
    local classIcon = "Interface\\Addons\\Gladdy\\Images\\Classes\\"
 | 
					 | 
				
			||||||
    if class == "DRUID" then
 | 
					 | 
				
			||||||
        return classIcon .. "inv_misc_monsterclaw_04"
 | 
					 | 
				
			||||||
    elseif class == "HUNTER" then
 | 
					 | 
				
			||||||
        return classIcon .. "inv_weapon_bow_07"
 | 
					 | 
				
			||||||
    elseif class == "MAGE" then
 | 
					 | 
				
			||||||
        return classIcon .. "inv_staff_13"
 | 
					 | 
				
			||||||
    elseif class == "PALADIN" then
 | 
					 | 
				
			||||||
        return classIcon .. "inv_hammer_01"
 | 
					 | 
				
			||||||
    elseif class == "PRIEST" then
 | 
					 | 
				
			||||||
        return classIcon .. "inv_staff_30"
 | 
					 | 
				
			||||||
    elseif class == "ROGUE" then
 | 
					 | 
				
			||||||
        return classIcon .. "inv_throwingknife_04"
 | 
					 | 
				
			||||||
    elseif class == "SHAMAN" then
 | 
					 | 
				
			||||||
        return classIcon .. "inv_jewelry_talisman_04"
 | 
					 | 
				
			||||||
    elseif class == "WARLOCK" then
 | 
					 | 
				
			||||||
        return classIcon .. "spell_nature_drowsy"
 | 
					 | 
				
			||||||
    elseif class == "WARRIOR" then
 | 
					 | 
				
			||||||
        return classIcon .. "inv_sword_27"
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Classicon:ENEMY_SPOTTED(unit)
 | 
					-- LAGACY HANDLER
 | 
				
			||||||
    local classIcon = self.frames[unit]
 | 
					 | 
				
			||||||
    if (not classIcon) then
 | 
					 | 
				
			||||||
        return
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    classIcon.texture:SetTexture(getClassIcon(Gladdy.buttons[unit].class))
 | 
					---------------------------
 | 
				
			||||||
    --classIcon.texture:SetTexCoord(unpack(CLASS_BUTTONS[Gladdy.buttons[unit].class]))
 | 
					
 | 
				
			||||||
    classIcon.texture:SetAllPoints(classIcon)
 | 
					function Classicon:LegacySetPosition(classIcon, unit)
 | 
				
			||||||
 | 
					    if Gladdy.db.newLayout then
 | 
				
			||||||
 | 
					        return Gladdy.db.newLayout
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    classIcon:ClearAllPoints()
 | 
				
			||||||
 | 
					    local margin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) + Gladdy.db.padding
 | 
				
			||||||
 | 
					    if (Gladdy.db.classIconPos == "LEFT") then
 | 
				
			||||||
 | 
					        classIcon:SetPoint("TOPRIGHT", Gladdy.buttons[unit].healthBar, "TOPLEFT", -margin, 0)
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        classIcon:SetPoint("TOPLEFT", Gladdy.buttons[unit], "TOPRIGHT", margin, 0)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
							
								
								
									
										217
									
								
								Modules/Clicks.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										217
									
								
								Modules/Clicks.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,217 @@
 | 
				
			|||||||
 | 
					local tinsert = table.insert
 | 
				
			||||||
 | 
					local pairs = pairs
 | 
				
			||||||
 | 
					local tonumber = tonumber
 | 
				
			||||||
 | 
					local tostring = tostring
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local GetBindingKey = GetBindingKey
 | 
				
			||||||
 | 
					local ClearOverrideBindings = ClearOverrideBindings
 | 
				
			||||||
 | 
					local SetOverrideBindingClick = SetOverrideBindingClick
 | 
				
			||||||
 | 
					local MACRO, TARGET, FOCUS, ADDON_DISABLED = MACRO, TARGET, FOCUS, ADDON_DISABLED
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local Gladdy = LibStub("Gladdy")
 | 
				
			||||||
 | 
					local L = Gladdy.L
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local attributes = {
 | 
				
			||||||
 | 
					    { name = L["Target"], button = "1", modifier = "", action = "target", spell = "" },
 | 
				
			||||||
 | 
					    { name = L["Focus"], button = "2", modifier = "", action = "focus", spell = "" },
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					for i = 3, 10 do
 | 
				
			||||||
 | 
					    tinsert(attributes, { name = L["Action #%d"]:format(i), button = "", modifier = "", action = "disabled", spell = "" })
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					local Clicks = Gladdy:NewModule("Clicks", nil, {
 | 
				
			||||||
 | 
					    attributes = attributes,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					BINDING_HEADER_GLADDY = "Gladdy"
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON1_LEFT = L["Left Click Enemy 1"]
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON2_LEFT = L["Left Click Enemy 2"]
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON3_LEFT = L["Left Click Enemy 3"]
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON4_LEFT = L["Left Click Enemy 4"]
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON5_LEFT = L["Left Click Enemy 5"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON1_RIGHT = L["Right Click Enemy 1"]
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON2_RIGHT = L["Right Click Enemy 2"]
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON3_RIGHT = L["Right Click Enemy 3"]
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON4_RIGHT = L["Right Click Enemy 4"]
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON5_RIGHT = L["Right Click Enemy 5"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON1_MIDDLE = L["Middle Click Enemy 1"]
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON2_MIDDLE = L["Middle Click Enemy 2"]
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON3_MIDDLE = L["Middle Click Enemy 3"]
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON4_MIDDLE = L["Middle Click Enemy 4"]
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON5_MIDDLE = L["Middle Click Enemy 5"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON1_BUTTON4 = L["Button4 Click Enemy 1"]
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON2_BUTTON4 = L["Button4 Click Enemy 2"]
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON3_BUTTON4 = L["Button4 Click Enemy 3"]
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON4_BUTTON4 = L["Button4 Click Enemy 4"]
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON5_BUTTON4 = L["Button4 Click Enemy 5"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON1_BUTTON5 = L["Button5 Click Enemy 1"]
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON2_BUTTON5 = L["Button5 Click Enemy 2"]
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON3_BUTTON5 = L["Button5 Click Enemy 3"]
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON4_BUTTON5 = L["Button5 Click Enemy 4"]
 | 
				
			||||||
 | 
					BINDING_NAME_GLADDYBUTTON5_BUTTON5 = L["Button5 Click Enemy 5"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Clicks:Initialize()
 | 
				
			||||||
 | 
					    --
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Clicks:Reset()
 | 
				
			||||||
 | 
					    --
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Clicks:ResetUnit(unit)
 | 
				
			||||||
 | 
					    --
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Clicks:UpdateFrame(unit)
 | 
				
			||||||
 | 
					    self:SetupAttributes(unit)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Clicks:UpdateFrameOnce()
 | 
				
			||||||
 | 
					    for _, v in pairs(Gladdy.buttons) do
 | 
				
			||||||
 | 
					        local left = GetBindingKey(("GLADDYBUTTON%d_LEFT"):format(v.id))
 | 
				
			||||||
 | 
					        local right = GetBindingKey(("GLADDYBUTTON%d_RIGHT"):format(v.id))
 | 
				
			||||||
 | 
					        local middle = GetBindingKey(("GLADDYBUTTON%d_MIDDLE"):format(v.id))
 | 
				
			||||||
 | 
					        local button4 = GetBindingKey(("GLADDYBUTTON%d_BUTTON4"):format(v.id))
 | 
				
			||||||
 | 
					        local button5 = GetBindingKey(("GLADDYBUTTON%d_BUTTON5"):format(v.id))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        ClearOverrideBindings(v.secure)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (left) then
 | 
				
			||||||
 | 
					            SetOverrideBindingClick(v.secure, false, left, v.secure:GetName(), "LeftButton")
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (right) then
 | 
				
			||||||
 | 
					            SetOverrideBindingClick(v.secure, false, right, v.secure:GetName(), "RightButton")
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (middle) then
 | 
				
			||||||
 | 
					            SetOverrideBindingClick(v.secure, false, middle, v.secure:GetName(), "MiddleButton")
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (button4) then
 | 
				
			||||||
 | 
					            SetOverrideBindingClick(v.secure, false, button4, v.secure:GetName(), "Button4")
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (button5) then
 | 
				
			||||||
 | 
					            SetOverrideBindingClick(v.secure, false, button5, v.secure:GetName(), "Button5")
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Clicks:SetupAttributes(unit)
 | 
				
			||||||
 | 
					    local button = Gladdy.buttons[unit]
 | 
				
			||||||
 | 
					    if (not button) then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for _, v in pairs(Gladdy.db.attributes) do
 | 
				
			||||||
 | 
					        self:SetupAttribute(button, v.button, v.modifier, v.action, v.spell)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Clicks:SetupAttribute(button, key, mod, action, spell)
 | 
				
			||||||
 | 
					    local attr = ""
 | 
				
			||||||
 | 
					    local text = ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (action == "macro") then
 | 
				
			||||||
 | 
					        attr = mod .. "macrotext" .. key
 | 
				
			||||||
 | 
					        text = spell:gsub("%*arena%*", button.unit)
 | 
				
			||||||
 | 
					        button.secure:SetAttribute(mod .. "type" .. key, "macro")
 | 
				
			||||||
 | 
					    elseif (action ~= "disabled") then
 | 
				
			||||||
 | 
					        if (action == "target") then
 | 
				
			||||||
 | 
					            attr = mod .. "type" .. key
 | 
				
			||||||
 | 
					            text = "target"
 | 
				
			||||||
 | 
					        elseif (action == "focus") then
 | 
				
			||||||
 | 
					            attr = mod .. "type" .. key
 | 
				
			||||||
 | 
					            text = "focus"
 | 
				
			||||||
 | 
					        elseif (action == "spell") then
 | 
				
			||||||
 | 
					            attr = mod .. "type" .. key
 | 
				
			||||||
 | 
					            text = "spell"
 | 
				
			||||||
 | 
					            button.secure:SetAttribute(mod .. "spell" .. key, spell)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    button.secure:SetAttribute(attr, text)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local buttons = { ["1"] = L["Left button"], ["2"] = L["Right button"], ["3"] = L["Middle button"], ["4"] = L["Button 4"], ["5"] = L["Button 5"] }
 | 
				
			||||||
 | 
					local modifiers = { [""] = L["None"], ["*"] = L["All"], ["ctrl-"] = L["CTRL"], ["shift-"] = L["SHIFT"], ["alt-"] = L["ALT"] }
 | 
				
			||||||
 | 
					local clickValues = { ["macro"] = MACRO, ["target"] = TARGET, ["focus"] = FOCUS, ["spell"] = L["Cast Spell"], ["disabled"] = ADDON_DISABLED }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function SetupAttributeOption(i)
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
					        type = "group",
 | 
				
			||||||
 | 
					        name = Gladdy.dbi.profile.attributes[i].name,
 | 
				
			||||||
 | 
					        desc = Gladdy.dbi.profile.attributes[i].name,
 | 
				
			||||||
 | 
					        order = i + 1,
 | 
				
			||||||
 | 
					        get = function(info)
 | 
				
			||||||
 | 
					            return Gladdy.dbi.profile.attributes[tonumber(info[#info - 1])][info[#info]]
 | 
				
			||||||
 | 
					        end,
 | 
				
			||||||
 | 
					        set = function(info, value)
 | 
				
			||||||
 | 
					            Gladdy.dbi.profile.attributes[tonumber(info[#info - 1])][info[#info]] = value
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (info[#info] == "name") then
 | 
				
			||||||
 | 
					                Gladdy.options.args.Clicks.args[info[#info - 1]].name = value
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            Gladdy:UpdateFrame()
 | 
				
			||||||
 | 
					        end,
 | 
				
			||||||
 | 
					        args = {
 | 
				
			||||||
 | 
					            name = {
 | 
				
			||||||
 | 
					                type = "input",
 | 
				
			||||||
 | 
					                name = L["Name"],
 | 
				
			||||||
 | 
					                desc = L["Select the name of the click option"],
 | 
				
			||||||
 | 
					                order = 1,
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					            button = {
 | 
				
			||||||
 | 
					                type = "select",
 | 
				
			||||||
 | 
					                name = L["Button"],
 | 
				
			||||||
 | 
					                desc = L["Select which mouse button to use"],
 | 
				
			||||||
 | 
					                order = 2,
 | 
				
			||||||
 | 
					                values = buttons,
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					            modifier = {
 | 
				
			||||||
 | 
					                type = "select",
 | 
				
			||||||
 | 
					                name = L["Modifier"],
 | 
				
			||||||
 | 
					                desc = L["Select which modifier to use"],
 | 
				
			||||||
 | 
					                order = 3,
 | 
				
			||||||
 | 
					                values = modifiers,
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					            action = {
 | 
				
			||||||
 | 
					                type = "select",
 | 
				
			||||||
 | 
					                name = L["Action"],
 | 
				
			||||||
 | 
					                desc = L["Select what action this mouse button does"],
 | 
				
			||||||
 | 
					                order = 4,
 | 
				
			||||||
 | 
					                values = clickValues,
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					            spell = {
 | 
				
			||||||
 | 
					                type = "input",
 | 
				
			||||||
 | 
					                name = L["Cast Spell / Macro"],
 | 
				
			||||||
 | 
					                desc = L["\n|cff1ac742Cast Spell:|r\n" ..
 | 
				
			||||||
 | 
					                        "Type in the spell name.\n" ..
 | 
				
			||||||
 | 
					                        "For example:\n" ..
 | 
				
			||||||
 | 
					                        "|cff17d1c8Polymorph|r\n" ..
 | 
				
			||||||
 | 
					                        "\n" ..
 | 
				
			||||||
 | 
					                        "|cff1ac742Macro:|r\n" ..
 | 
				
			||||||
 | 
					                        "Use *arena* as placeholder.\n" ..
 | 
				
			||||||
 | 
					                        "For example:\n" ..
 | 
				
			||||||
 | 
					                        "|cff17d1c8/cast [@*arena*] Blind\n" ..
 | 
				
			||||||
 | 
					                        "/run SendChatMessage(\"Blinding \" .. UnitName(\"*arena*\"), \"PARTY\")|r"],
 | 
				
			||||||
 | 
					                order = 5,
 | 
				
			||||||
 | 
					                width = "full",
 | 
				
			||||||
 | 
					                multiline = 10,
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Clicks:GetOptions()
 | 
				
			||||||
 | 
					    local options = {}
 | 
				
			||||||
 | 
					    for i = 1, 10 do
 | 
				
			||||||
 | 
					        options[tostring(i)] = SetupAttributeOption(i)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    return options
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
							
								
								
									
										294
									
								
								Modules/CombatIndicator.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										294
									
								
								Modules/CombatIndicator.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,294 @@
 | 
				
			|||||||
 | 
					local select = select
 | 
				
			||||||
 | 
					local UnitExists, UnitAffectingCombat, GetSpellInfo = UnitExists, UnitAffectingCombat, GetSpellInfo
 | 
				
			||||||
 | 
					local CreateFrame = CreateFrame
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local Gladdy = LibStub("Gladdy")
 | 
				
			||||||
 | 
					local L = Gladdy.L
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local CombatIndicator = Gladdy:NewModule("Combat Indicator", nil, {
 | 
				
			||||||
 | 
					    ciEnabled = true,
 | 
				
			||||||
 | 
					    ciSize = 20,
 | 
				
			||||||
 | 
					    ciAlpha = 1,
 | 
				
			||||||
 | 
					    ciWidthFactor = 1,
 | 
				
			||||||
 | 
					    ciXOffset = 0,
 | 
				
			||||||
 | 
					    ciYOffset = -31,
 | 
				
			||||||
 | 
					    ciBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp",
 | 
				
			||||||
 | 
					    ciBorderColor = { r = 0, g = 0, b = 0, a = 1 },
 | 
				
			||||||
 | 
					    ciFrameStrata = "HIGH",
 | 
				
			||||||
 | 
					    ciFrameLevel = 5,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function CombatIndicator:Initialize()
 | 
				
			||||||
 | 
					    self.frames = {}
 | 
				
			||||||
 | 
					    if Gladdy.db.ciEnabled then
 | 
				
			||||||
 | 
					        self:RegisterMessage("JOINED_ARENA")
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    self.updateInterval = 0.05
 | 
				
			||||||
 | 
					    self.combatIndicatorIcon = select(3, GetSpellInfo(674))
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function CombatIndicator:JOINED_ARENA()
 | 
				
			||||||
 | 
					    self:SetScript("OnUpdate", CombatIndicator.OnEvent)
 | 
				
			||||||
 | 
					    self.lastTimeUpdated = 0
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function CombatIndicator:CreateFrame(unit)
 | 
				
			||||||
 | 
					    local button = Gladdy.buttons[unit]
 | 
				
			||||||
 | 
					    if not button then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    local ciFrame = CreateFrame("Frame", "GladdyCombatindicator" .. unit, button)
 | 
				
			||||||
 | 
					    ciFrame:EnableMouse(false)
 | 
				
			||||||
 | 
					    ciFrame:SetMovable(true)
 | 
				
			||||||
 | 
					    ciFrame:SetFrameStrata(Gladdy.db.ciFrameStrata)
 | 
				
			||||||
 | 
					    ciFrame:SetFrameLevel(Gladdy.db.ciFrameLevel)
 | 
				
			||||||
 | 
					    ciFrame:SetHeight(Gladdy.db.ciSize)
 | 
				
			||||||
 | 
					    ciFrame:SetWidth(Gladdy.db.ciSize * Gladdy.db.ciWidthFactor)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ciFrame.texture = ciFrame:CreateTexture(nil, "OVERLAY")
 | 
				
			||||||
 | 
					    ciFrame.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
				
			||||||
 | 
					    ciFrame.texture:SetTexture(self.combatIndicatorIcon)
 | 
				
			||||||
 | 
					    ciFrame.texture:SetAllPoints(ciFrame)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ciFrame.border = ciFrame:CreateTexture(nil, "OVERLAY")
 | 
				
			||||||
 | 
					    ciFrame.border:SetAllPoints(ciFrame)
 | 
				
			||||||
 | 
					    ciFrame.border:SetTexture(Gladdy.db.ciBorderStyle)
 | 
				
			||||||
 | 
					    ciFrame.border:SetVertexColor(Gladdy:SetColor(Gladdy.db.ciBorderColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    self.frames[unit] = ciFrame
 | 
				
			||||||
 | 
					    button.ciFrame = ciFrame
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function CombatIndicator:UpdateFrameOnce()
 | 
				
			||||||
 | 
					    if Gladdy.db.ciEnabled then
 | 
				
			||||||
 | 
					        self:RegisterMessage("JOINED_ARENA")
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        self:UnregisterAllMessages()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function CombatIndicator:UpdateFrame(unit)
 | 
				
			||||||
 | 
					    local button = Gladdy.buttons[unit]
 | 
				
			||||||
 | 
					    local ciFrame = self.frames[unit]
 | 
				
			||||||
 | 
					    if (not button or not ciFrame) then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ciFrame:SetFrameStrata(Gladdy.db.ciFrameStrata)
 | 
				
			||||||
 | 
					    ciFrame:SetFrameLevel(Gladdy.db.ciFrameLevel)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ciFrame:SetHeight(Gladdy.db.ciSize)
 | 
				
			||||||
 | 
					    ciFrame:SetWidth(Gladdy.db.ciSize * Gladdy.db.ciWidthFactor)
 | 
				
			||||||
 | 
					    ciFrame.border:SetTexture(Gladdy.db.ciBorderStyle)
 | 
				
			||||||
 | 
					    ciFrame.border:SetVertexColor(Gladdy:SetColor(Gladdy.db.ciBorderColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Gladdy:SetPosition(ciFrame, unit, "ciXOffset", "ciYOffset", CombatIndicator:LegacySetPosition(ciFrame, unit), CombatIndicator)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ciFrame:SetAlpha(Gladdy.db.ciAlpha)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (Gladdy.db.ciEnabled == false) then
 | 
				
			||||||
 | 
					        ciFrame:Hide()
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        ciFrame:Show()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if (unit == "arena1") then
 | 
				
			||||||
 | 
					        Gladdy:CreateMover(ciFrame, "ciXOffset", "ciYOffset", L["Combat Indicator"],
 | 
				
			||||||
 | 
					                {"TOPLEFT", "TOPLEFT"},
 | 
				
			||||||
 | 
					                Gladdy.db.ciSize * Gladdy.db.ciWidthFactor, Gladdy.db.ciSize,
 | 
				
			||||||
 | 
					                0, 0, "ciEnabled")
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function CombatIndicator:Test()
 | 
				
			||||||
 | 
					    self.test = true
 | 
				
			||||||
 | 
					    self:JOINED_ARENA()
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function CombatIndicator:Reset()
 | 
				
			||||||
 | 
					    self:SetScript("OnUpdate", nil)
 | 
				
			||||||
 | 
					    self.test = false
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function CombatIndicator.OnEvent(self, elapsed)
 | 
				
			||||||
 | 
					    self.lastTimeUpdated = self.lastTimeUpdated + elapsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (self.lastTimeUpdated > self.updateInterval) then
 | 
				
			||||||
 | 
					        for i=1,Gladdy.curBracket do
 | 
				
			||||||
 | 
					            local unit = "arena" .. i
 | 
				
			||||||
 | 
					            if Gladdy.db.ciEnabled and (CombatIndicator.test or (UnitExists(unit) and UnitAffectingCombat(unit))) then
 | 
				
			||||||
 | 
					                CombatIndicator.frames[unit]:Show()
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					                CombatIndicator.frames[unit]:Hide()
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        self.lastTimeUpdated = 0
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function CombatIndicator:GetOptions()
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
					        header = {
 | 
				
			||||||
 | 
					            type = "header",
 | 
				
			||||||
 | 
					            name = L["Combat Indicator"],
 | 
				
			||||||
 | 
					            order = 2,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        ciEnabled = Gladdy:option({
 | 
				
			||||||
 | 
					            type = "toggle",
 | 
				
			||||||
 | 
					            name = L["Enabled"],
 | 
				
			||||||
 | 
					            desc = L["Enable Combat Indicator icon"],
 | 
				
			||||||
 | 
					            order = 3,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
 | 
					        group = {
 | 
				
			||||||
 | 
					            type = "group",
 | 
				
			||||||
 | 
					            childGroups = "tree",
 | 
				
			||||||
 | 
					            name = L["Frame"],
 | 
				
			||||||
 | 
					            order = 4,
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.ciEnabled end,
 | 
				
			||||||
 | 
					            args = {
 | 
				
			||||||
 | 
					                general = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Frame"],
 | 
				
			||||||
 | 
					                    order = 1,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        header = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Frame"],
 | 
				
			||||||
 | 
					                            order = 1,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        ciSize = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Icon size"],
 | 
				
			||||||
 | 
					                            min = 5,
 | 
				
			||||||
 | 
					                            max = 100,
 | 
				
			||||||
 | 
					                            step = 1,
 | 
				
			||||||
 | 
					                            order = 2,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        ciWidthFactor = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Icon width factor"],
 | 
				
			||||||
 | 
					                            min = 0.5,
 | 
				
			||||||
 | 
					                            max = 2,
 | 
				
			||||||
 | 
					                            step = 0.05,
 | 
				
			||||||
 | 
					                            order = 3,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        ciAlpha = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Alpha"],
 | 
				
			||||||
 | 
					                            min = 0,
 | 
				
			||||||
 | 
					                            max = 1,
 | 
				
			||||||
 | 
					                            step = 0.05,
 | 
				
			||||||
 | 
					                            order = 4,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                position = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Position"],
 | 
				
			||||||
 | 
					                    order = 3,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        header = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Position"],
 | 
				
			||||||
 | 
					                            order = 4,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        ciXOffset = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Horizontal offset"],
 | 
				
			||||||
 | 
					                            order = 23,
 | 
				
			||||||
 | 
					                            min = -400,
 | 
				
			||||||
 | 
					                            max = 400,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        ciYOffset = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Vertical offset"],
 | 
				
			||||||
 | 
					                            order = 24,
 | 
				
			||||||
 | 
					                            min = -400,
 | 
				
			||||||
 | 
					                            max = 400,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                border = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Border"],
 | 
				
			||||||
 | 
					                    order = 2,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        header = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Border"],
 | 
				
			||||||
 | 
					                            order = 4,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        ciBorderStyle = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "select",
 | 
				
			||||||
 | 
					                            name = L["Border style"],
 | 
				
			||||||
 | 
					                            order = 31,
 | 
				
			||||||
 | 
					                            values = Gladdy:GetIconStyles()
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        ciBorderColor = Gladdy:colorOption({
 | 
				
			||||||
 | 
					                            type = "color",
 | 
				
			||||||
 | 
					                            name = L["Border color"],
 | 
				
			||||||
 | 
					                            desc = L["Color of the border"],
 | 
				
			||||||
 | 
					                            order = 32,
 | 
				
			||||||
 | 
					                            hasAlpha = true,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                frameStrata = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Frame Strata and Level"],
 | 
				
			||||||
 | 
					                    order = 5,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        headerAuraLevel = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Frame Strata and Level"],
 | 
				
			||||||
 | 
					                            order = 1,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        ciFrameStrata = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "select",
 | 
				
			||||||
 | 
					                            name = L["Frame Strata"],
 | 
				
			||||||
 | 
					                            order = 2,
 | 
				
			||||||
 | 
					                            values = Gladdy.frameStrata,
 | 
				
			||||||
 | 
					                            sorting = Gladdy.frameStrataSorting,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        ciFrameLevel = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Frame Level"],
 | 
				
			||||||
 | 
					                            min = 0,
 | 
				
			||||||
 | 
					                            max = 500,
 | 
				
			||||||
 | 
					                            step = 1,
 | 
				
			||||||
 | 
					                            order = 3,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- LAGACY HANDLER
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function CombatIndicator:LegacySetPosition(ciFrame, unit)
 | 
				
			||||||
 | 
					    if Gladdy.db.newLayout then
 | 
				
			||||||
 | 
					        return Gladdy.db.newLayout
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    -- LEGACY options
 | 
				
			||||||
 | 
					    local ANCHORS = { ["LEFT"] = "RIGHT", ["RIGHT"] = "LEFT", ["BOTTOM"] = "TOP", ["TOP"] = "BOTTOM"}
 | 
				
			||||||
 | 
					    local ciAnchor = Gladdy.db.ciAnchor or Gladdy.legacy.ciAnchor
 | 
				
			||||||
 | 
					    local ciPos = Gladdy.db.ciPos
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ciFrame:ClearAllPoints()
 | 
				
			||||||
 | 
					    ciFrame:SetPoint(ANCHORS[ciPos], Gladdy.buttons[unit][ciAnchor], ciPos, Gladdy.db.ciXOffset, Gladdy.db.ciYOffset)
 | 
				
			||||||
 | 
					    return Gladdy.db.newLayout
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -1,4 +1,4 @@
 | 
				
			|||||||
local type, pairs = type, pairs
 | 
					local type, pairs, str_match = type, pairs, string.match
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local Gladdy = LibStub("Gladdy")
 | 
					local Gladdy = LibStub("Gladdy")
 | 
				
			||||||
local AceSerializer = LibStub("AceSerializer-3.0")
 | 
					local AceSerializer = LibStub("AceSerializer-3.0")
 | 
				
			||||||
@@ -6,29 +6,25 @@ local L = Gladdy.L
 | 
				
			|||||||
local AceGUI = LibStub("AceGUI-3.0")
 | 
					local AceGUI = LibStub("AceGUI-3.0")
 | 
				
			||||||
local LibDeflate = LibStub:GetLibrary("LibDeflate")
 | 
					local LibDeflate = LibStub:GetLibrary("LibDeflate")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function table_copy(t)
 | 
					
 | 
				
			||||||
 | 
					local function table_copy(t, str)
 | 
				
			||||||
    local t2 = {};
 | 
					    local t2 = {};
 | 
				
			||||||
 | 
					    if str == nil then
 | 
				
			||||||
 | 
					        str = "Gladdy.db"
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
    for k,v in pairs(t) do
 | 
					    for k,v in pairs(t) do
 | 
				
			||||||
        if type(v) == "table" then
 | 
					        if type(v) == "table" then
 | 
				
			||||||
            t2[k] = table_copy(v);
 | 
					            t2[k] = table_copy(v, str .. "." .. k);
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            t2[k] = v;
 | 
					            t2[k] = v;
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    return t2;
 | 
					    return t2;
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function applyImport(t)
 | 
					local ExportImport = Gladdy:NewModule("Export Import", nil, {
 | 
				
			||||||
    for k,v in pairs(t) do
 | 
					    expansion = Gladdy.expansion,
 | 
				
			||||||
        if type(v) == "table" then
 | 
					 | 
				
			||||||
            applyImport(v, Gladdy.dbi.profile[k]);
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
            Gladdy.dbi.profile[k] = v;
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local ExportImport = Gladdy:NewModule("ExportImport", nil, {
 | 
					 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local export = AceGUI:Create("Frame")
 | 
					local export = AceGUI:Create("Frame")
 | 
				
			||||||
@@ -72,9 +68,12 @@ importButton:SetText("Import\n(this will overwrite your current profile!)")
 | 
				
			|||||||
importButton:SetWidth(200)
 | 
					importButton:SetWidth(200)
 | 
				
			||||||
importButton:SetHeight(50)
 | 
					importButton:SetHeight(50)
 | 
				
			||||||
importButton:SetCallback("OnClick", function(widget)
 | 
					importButton:SetCallback("OnClick", function(widget)
 | 
				
			||||||
    applyImport(import.deserializedTable)
 | 
					    ExportImport:ApplyImport(import.deserializedTable, Gladdy.db)
 | 
				
			||||||
    Gladdy:UpdateFrame()
 | 
					 | 
				
			||||||
    import:Hide()
 | 
					    import:Hide()
 | 
				
			||||||
 | 
					    Gladdy:Reset()
 | 
				
			||||||
 | 
					    Gladdy:HideFrame()
 | 
				
			||||||
 | 
					    Gladdy:ToggleFrame(3)
 | 
				
			||||||
 | 
					    LibStub("AceConfigRegistry-3.0"):NotifyChange("Gladdy")
 | 
				
			||||||
end)
 | 
					end)
 | 
				
			||||||
import:AddChild(importButton)
 | 
					import:AddChild(importButton)
 | 
				
			||||||
import.button = importButton
 | 
					import.button = importButton
 | 
				
			||||||
@@ -91,29 +90,93 @@ end)
 | 
				
			|||||||
import:AddChild(importClearButton)
 | 
					import:AddChild(importClearButton)
 | 
				
			||||||
import.clearButton = importClearButton
 | 
					import.clearButton = importClearButton
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function ExportImport:CheckDeserializedOptions(tbl, refTbl, str)
 | 
					local deletedOptions = { -- backwards compatibility
 | 
				
			||||||
    if str == nil and not tbl.version_major then
 | 
					    --deleted DR-categories
 | 
				
			||||||
        return false, "Version conflict: version_major not seen"
 | 
					    repentance = true,
 | 
				
			||||||
 | 
					    sleep = true,
 | 
				
			||||||
 | 
					    impconc = true,
 | 
				
			||||||
 | 
					    dragonsbreath = true,
 | 
				
			||||||
 | 
					    freezetrap = true,
 | 
				
			||||||
 | 
					    --deleted db options
 | 
				
			||||||
 | 
					    castBarPos = true,
 | 
				
			||||||
 | 
					    buffsCooldownPos = true,
 | 
				
			||||||
 | 
					    buffsBuffsCooldownPos = true,
 | 
				
			||||||
 | 
					    classIconPos = true,
 | 
				
			||||||
 | 
					    ciAnchor = true,
 | 
				
			||||||
 | 
					    ciPos = true,
 | 
				
			||||||
 | 
					    cooldownYPos = true,
 | 
				
			||||||
 | 
					    cooldownXPos = true,
 | 
				
			||||||
 | 
					    drCooldownPos = true,
 | 
				
			||||||
 | 
					    racialAnchor = true,
 | 
				
			||||||
 | 
					    racialPos = true,
 | 
				
			||||||
 | 
					    trinketPos = true,
 | 
				
			||||||
 | 
					    padding = true,
 | 
				
			||||||
 | 
					    growUp = true,
 | 
				
			||||||
 | 
					    powerBarFontSize = true,
 | 
				
			||||||
 | 
					    ["38373"] = true, -- The Beast Within (Auras)
 | 
				
			||||||
 | 
					    ["34692"] = true, -- The Beast Within (Cooldowns)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local expansionSpecific = {
 | 
				
			||||||
 | 
					    "drCategories",
 | 
				
			||||||
 | 
					    "auraListDefault",
 | 
				
			||||||
 | 
					    "auraListInterrupts",
 | 
				
			||||||
 | 
					    "trackedDebuffs",
 | 
				
			||||||
 | 
					    "trackedBuffs",
 | 
				
			||||||
 | 
					    "cooldownCooldowns",
 | 
				
			||||||
 | 
					    "cooldownCooldownsOrder",
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function checkIsDeletedOption(k, str, msg, errorFound, errorMsg)
 | 
				
			||||||
 | 
					    local isDeleted
 | 
				
			||||||
 | 
					    for key, _ in pairs(deletedOptions) do
 | 
				
			||||||
 | 
					        if str_match(k, key) then
 | 
				
			||||||
 | 
					            isDeleted = true
 | 
				
			||||||
 | 
					            Gladdy:Debug("WARN", "found deleted option =", str .. "." .. k)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    if str == nil and tbl.version_major ~= Gladdy.version_major then
 | 
					    if errorFound then
 | 
				
			||||||
        return false, "Version conflict: " .. tbl.version_major .. " ~= " .. Gladdy.version_major
 | 
					        return errorFound, errorMsg
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if not isDeleted then
 | 
				
			||||||
 | 
					        return true, msg or str .. "." .. k .. " does not exist"
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function ExportImport:CheckDeserializedOptions(tbl, refTbl, str)
 | 
				
			||||||
 | 
					    if str == nil and not tbl.version_major_num then
 | 
				
			||||||
 | 
					        return false, "Version conflict: version_major_num not seen"
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if str == nil and tbl.version_major_num > Gladdy.version_major_num then
 | 
				
			||||||
 | 
					        return false, "Version conflict: Major v" .. tbl.version_major_num .. " ~= v" .. Gladdy.version_major_num
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    if str == nil then
 | 
					    if str == nil then
 | 
				
			||||||
        str = "Gladdy.db"
 | 
					        str = "Gladdy.db"
 | 
				
			||||||
        tbl.version_major = nil
 | 
					        tbl.version_major_num = nil
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    if type(tbl) == "table" then
 | 
					    local res, msg
 | 
				
			||||||
 | 
					    local errorFound, errorMsg
 | 
				
			||||||
 | 
					    if refTbl == nil then
 | 
				
			||||||
 | 
					        return false, str .. "does not exist"
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
        for k,v in pairs(tbl) do
 | 
					        for k,v in pairs(tbl) do
 | 
				
			||||||
            if refTbl[k] ~= nil then
 | 
					            if refTbl[k] == nil then
 | 
				
			||||||
                if type(v) ~= type(refTbl[k]) then
 | 
					                errorFound, errorMsg = checkIsDeletedOption(k, str, nil, errorFound, errorMsg)
 | 
				
			||||||
                    return false, str .. "." .. k .. " type error. Expected " .. type(refTbl[k]) .. " found " .. type(v)
 | 
					            elseif type(v) ~= type(refTbl[k]) then
 | 
				
			||||||
 | 
					                errorFound = true
 | 
				
			||||||
 | 
					                errorMsg = str .. "." .. k .. " type error. Expected " .. type(refTbl[k]) .. " found " .. type(v)
 | 
				
			||||||
 | 
					            elseif type(v) == "table" then
 | 
				
			||||||
 | 
					                res, msg = ExportImport:CheckDeserializedOptions(v, refTbl[k], str .. "." .. k)
 | 
				
			||||||
 | 
					                if not res then
 | 
				
			||||||
 | 
					                    errorFound, errorMsg = checkIsDeletedOption(msg, str, msg, errorFound, errorMsg)
 | 
				
			||||||
                end
 | 
					                end
 | 
				
			||||||
                ExportImport:CheckDeserializedOptions(v, refTbl[k], str .. "." .. k)
 | 
					 | 
				
			||||||
            else
 | 
					 | 
				
			||||||
                return false, str .. "." .. k .. " does not exist"
 | 
					 | 
				
			||||||
            end
 | 
					            end
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if errorFound then
 | 
				
			||||||
 | 
					        --return false, errorMsg
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
    return true
 | 
					    return true
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -130,7 +193,7 @@ function ExportImport:GetOptions()
 | 
				
			|||||||
            type = "execute",
 | 
					            type = "execute",
 | 
				
			||||||
            func = function()
 | 
					            func = function()
 | 
				
			||||||
                local db = table_copy(Gladdy.db)
 | 
					                local db = table_copy(Gladdy.db)
 | 
				
			||||||
                db.version_major = Gladdy.version_major
 | 
					                db.version_major_num = Gladdy.version_major_num
 | 
				
			||||||
                dump = AceSerializer:Serialize(db)
 | 
					                dump = AceSerializer:Serialize(db)
 | 
				
			||||||
                local compress_deflate = LibDeflate:CompressZlib(dump)
 | 
					                local compress_deflate = LibDeflate:CompressZlib(dump)
 | 
				
			||||||
                printable_compressed = LibDeflate:EncodeForPrint(compress_deflate)
 | 
					                printable_compressed = LibDeflate:EncodeForPrint(compress_deflate)
 | 
				
			||||||
@@ -140,8 +203,8 @@ function ExportImport:GetOptions()
 | 
				
			|||||||
                export.eb:HighlightText(0, export.eb.editBox:GetNumLetters())
 | 
					                export.eb:HighlightText(0, export.eb.editBox:GetNumLetters())
 | 
				
			||||||
                export:SetStatusText("Copy this string to share your configuration with others.")
 | 
					                export:SetStatusText("Copy this string to share your configuration with others.")
 | 
				
			||||||
            end,
 | 
					            end,
 | 
				
			||||||
            name = "Export",
 | 
					            name = L["Export"],
 | 
				
			||||||
            desc = "Export your current profile to share with others or your various accounts.",
 | 
					            desc = L["Export your current profile to share with others or your various accounts."],
 | 
				
			||||||
            order = 3,
 | 
					            order = 3,
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        import = {
 | 
					        import = {
 | 
				
			||||||
@@ -154,44 +217,92 @@ function ExportImport:GetOptions()
 | 
				
			|||||||
                import.statustext:SetTextColor(1,0,0)
 | 
					                import.statustext:SetTextColor(1,0,0)
 | 
				
			||||||
                import.eb:SetFocus()
 | 
					                import.eb:SetFocus()
 | 
				
			||||||
                import.eb:SetCallback("OnTextChanged", function(widget)
 | 
					                import.eb:SetCallback("OnTextChanged", function(widget)
 | 
				
			||||||
                    local decoded_string = LibDeflate:DecodeForPrint(widget:GetText())
 | 
					                    local deserialized = ExportImport:Decode(widget:GetText(), true)
 | 
				
			||||||
                    if not decoded_string then
 | 
					                    if not deserialized then
 | 
				
			||||||
                        import.statustext:SetTextColor(1,0,0)
 | 
					 | 
				
			||||||
                        import:SetStatusText("Invalid Import String FAILED LibDeflate:DecodeForPrint")
 | 
					 | 
				
			||||||
                        import.button.frame:Disable()
 | 
					 | 
				
			||||||
                        return
 | 
					                        return
 | 
				
			||||||
                    end
 | 
					                    end
 | 
				
			||||||
                    local decompress_deflate = LibDeflate:DecompressZlib(decoded_string)
 | 
					 | 
				
			||||||
                    if not decompress_deflate then
 | 
					 | 
				
			||||||
                        import.statustext:SetTextColor(1,0,0)
 | 
					 | 
				
			||||||
                        import:SetStatusText("Invalid Import String FAILED LibDeflate:DecompressZlib")
 | 
					 | 
				
			||||||
                        import.button.frame:Disable()
 | 
					 | 
				
			||||||
                        return
 | 
					 | 
				
			||||||
                    end
 | 
					 | 
				
			||||||
                    local success, deserialized = AceSerializer:Deserialize(decompress_deflate)
 | 
					 | 
				
			||||||
                    if not success then
 | 
					 | 
				
			||||||
                        import.statustext:SetTextColor(1,0,0)
 | 
					 | 
				
			||||||
                        import:SetStatusText("Invalid Import String FAILED AceSerializer:Deserialize")
 | 
					 | 
				
			||||||
                        import.button.frame:Disable()
 | 
					 | 
				
			||||||
                        return
 | 
					 | 
				
			||||||
                    end
 | 
					 | 
				
			||||||
                    local statusOption, error = ExportImport:CheckDeserializedOptions(deserialized, Gladdy.db)
 | 
					 | 
				
			||||||
                    if not statusOption then
 | 
					 | 
				
			||||||
                        import.statustext:SetTextColor(1,0,0)
 | 
					 | 
				
			||||||
                        import:SetStatusText(error)
 | 
					 | 
				
			||||||
                        import.button.frame:Disable()
 | 
					 | 
				
			||||||
                        return
 | 
					 | 
				
			||||||
                    end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    import.statustext:SetTextColor(0,1,0)
 | 
					                    import.statustext:SetTextColor(0,1,0)
 | 
				
			||||||
                    import:SetStatusText("SUCCESS")
 | 
					                    import:SetStatusText("SUCCESS")
 | 
				
			||||||
                    import.button.frame:Enable()
 | 
					                    import.button.frame:Enable()
 | 
				
			||||||
                    import.deserializedTable = deserialized
 | 
					                    import.deserializedTable = deserialized
 | 
				
			||||||
                end)
 | 
					                end)
 | 
				
			||||||
            end,
 | 
					            end,
 | 
				
			||||||
            name = "Import",
 | 
					            name = L["Import"],
 | 
				
			||||||
            desc = "This will overwrite your current profile!",
 | 
					            desc = L["This will overwrite your current profile!"],
 | 
				
			||||||
            order = 4,
 | 
					            order = 4,
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function ExportImport:ApplyImport(t, table, str)
 | 
				
			||||||
 | 
					    if str == nil then
 | 
				
			||||||
 | 
					        str = "Gladdy.db"
 | 
				
			||||||
 | 
					        if (not t.newLayout) then
 | 
				
			||||||
 | 
					            table.newLayout = false
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if not t.expansion then
 | 
				
			||||||
 | 
					            t.expansion = "BCC"
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    for k,v in pairs(t) do
 | 
				
			||||||
 | 
					        local skip = k == "expansion"
 | 
				
			||||||
 | 
					        if t.expansion and t.expansion ~= table.expansion then
 | 
				
			||||||
 | 
					            if Gladdy:contains(k, expansionSpecific) then
 | 
				
			||||||
 | 
					                Gladdy:Debug("WARN", "ExportImport:ApplyImport", "skipped", k, "- import string expansion is", t.expansion, "- current expansion is", table.expansion)
 | 
				
			||||||
 | 
					                skip = true
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if not skip then
 | 
				
			||||||
 | 
					            if type(v) == "table" then
 | 
				
			||||||
 | 
					                if (table[k] ~= nil) then
 | 
				
			||||||
 | 
					                    ExportImport:ApplyImport(v, table[k], str .. "." .. k)
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                    Gladdy:Debug("ERROR", "ExportImport:ApplyImport", "failed for", str .. "." .. k)
 | 
				
			||||||
 | 
					                end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					                table[k] = v
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function ExportImport:Decode(str, showError)
 | 
				
			||||||
 | 
					    local decoded_string = LibDeflate:DecodeForPrint(str)
 | 
				
			||||||
 | 
					    if not decoded_string then
 | 
				
			||||||
 | 
					        if showError then
 | 
				
			||||||
 | 
					            import.statustext:SetTextColor(1,0,0)
 | 
				
			||||||
 | 
					            import:SetStatusText("Invalid Import String FAILED LibDeflate:DecodeForPrint")
 | 
				
			||||||
 | 
					            import.button.frame:Disable()
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        return nil
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    local decompress_deflate = LibDeflate:DecompressZlib(decoded_string)
 | 
				
			||||||
 | 
					    if not decompress_deflate then
 | 
				
			||||||
 | 
					        if showError then
 | 
				
			||||||
 | 
					            import.statustext:SetTextColor(1,0,0)
 | 
				
			||||||
 | 
					            import:SetStatusText("Invalid Import String FAILED LibDeflate:DecompressZlib")
 | 
				
			||||||
 | 
					            import.button.frame:Disable()
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        return nil
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    local success, deserialized = AceSerializer:Deserialize(decompress_deflate)
 | 
				
			||||||
 | 
					    if not success then
 | 
				
			||||||
 | 
					        if showError then
 | 
				
			||||||
 | 
					            import.statustext:SetTextColor(1,0,0)
 | 
				
			||||||
 | 
					            import:SetStatusText("Invalid Import String FAILED AceSerializer:Deserialize")
 | 
				
			||||||
 | 
					            import.button.frame:Disable()
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        return nil
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    local statusOption, error = ExportImport:CheckDeserializedOptions(deserialized, Gladdy.defaults.profile)
 | 
				
			||||||
 | 
					    if not statusOption then
 | 
				
			||||||
 | 
					        if showError then
 | 
				
			||||||
 | 
					            import.statustext:SetTextColor(1,0,0)
 | 
				
			||||||
 | 
					            import:SetStatusText(error)
 | 
				
			||||||
 | 
					            import.button.frame:Disable()
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        return nil
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    return deserialized
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
@@ -1,6 +1,7 @@
 | 
				
			|||||||
local pairs = pairs
 | 
					local pairs, ipairs = pairs, ipairs
 | 
				
			||||||
local floor = math.floor
 | 
					local floor, abs = math.floor, math.abs
 | 
				
			||||||
local UnitHealth, UnitHealthMax, UnitName, UnitExists = UnitHealth, UnitHealthMax, UnitName, UnitExists
 | 
					local str_find, str_gsub, str_sub, tinsert = string.find, string.gsub, string.sub, table.insert
 | 
				
			||||||
 | 
					local UnitHealth, UnitHealthMax, UnitName, UnitExists, UnitIsDeadOrGhost = UnitHealth, UnitHealthMax, UnitName, UnitExists, UnitIsDeadOrGhost
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local CreateFrame = CreateFrame
 | 
					local CreateFrame = CreateFrame
 | 
				
			||||||
local RAID_CLASS_COLORS = RAID_CLASS_COLORS
 | 
					local RAID_CLASS_COLORS = RAID_CLASS_COLORS
 | 
				
			||||||
@@ -8,7 +9,7 @@ local RAID_CLASS_COLORS = RAID_CLASS_COLORS
 | 
				
			|||||||
local Gladdy = LibStub("Gladdy")
 | 
					local Gladdy = LibStub("Gladdy")
 | 
				
			||||||
local L = Gladdy.L
 | 
					local L = Gladdy.L
 | 
				
			||||||
local AceGUIWidgetLSMlists = AceGUIWidgetLSMlists
 | 
					local AceGUIWidgetLSMlists = AceGUIWidgetLSMlists
 | 
				
			||||||
local Healthbar = Gladdy:NewModule("Healthbar", 100, {
 | 
					local Healthbar = Gladdy:NewModule("Health Bar", 100, {
 | 
				
			||||||
    healthBarFont = "DorisPP",
 | 
					    healthBarFont = "DorisPP",
 | 
				
			||||||
    healthBarHeight = 60,
 | 
					    healthBarHeight = 60,
 | 
				
			||||||
    healthBarTexture = "Smooth",
 | 
					    healthBarTexture = "Smooth",
 | 
				
			||||||
@@ -16,16 +17,41 @@ local Healthbar = Gladdy:NewModule("Healthbar", 100, {
 | 
				
			|||||||
    healthBarBorderSize = 9,
 | 
					    healthBarBorderSize = 9,
 | 
				
			||||||
    healthBarBorderColor = { r = 0, g = 0, b = 0, a = 1 },
 | 
					    healthBarBorderColor = { r = 0, g = 0, b = 0, a = 1 },
 | 
				
			||||||
    healthBarBgColor = { r = 0, g = 0, b = 0, a = 0.4 },
 | 
					    healthBarBgColor = { r = 0, g = 0, b = 0, a = 0.4 },
 | 
				
			||||||
 | 
					    healthBarClassColored = true,
 | 
				
			||||||
 | 
					    healthBarColoredByCurrentHp = false,
 | 
				
			||||||
 | 
					    healthBarStatusBarColorMax = { r = 0, g = 1, b = 0, a = 1 },
 | 
				
			||||||
 | 
					    healthBarStatusBarColorMid = { r = 1, g = 1, b = 0, a = 1 },
 | 
				
			||||||
 | 
					    healthBarStatusBarColorMin = { r = 1, g = 0, b = 0, a = 1 },
 | 
				
			||||||
 | 
					    healthFrameStrata = "MEDIUM",
 | 
				
			||||||
 | 
					    healthFrameLevel = 1,
 | 
				
			||||||
 | 
					    healthBarStealthColor = { r = 0.66, g = 0.66, b = 0.66, a = 1 },
 | 
				
			||||||
 | 
					    --font
 | 
				
			||||||
    healthBarFontColor = { r = 1, g = 1, b = 1, a = 1 },
 | 
					    healthBarFontColor = { r = 1, g = 1, b = 1, a = 1 },
 | 
				
			||||||
    healthBarFontSize = 12,
 | 
					    healthBarNameFontSize = 12,
 | 
				
			||||||
 | 
					    healthBarHealthFontSize = 12,
 | 
				
			||||||
 | 
					    healthNameToArenaId = false,
 | 
				
			||||||
 | 
					    healthName = true,
 | 
				
			||||||
    healthActual = false,
 | 
					    healthActual = false,
 | 
				
			||||||
    healthMax = true,
 | 
					    healthMax = true,
 | 
				
			||||||
    healthPercentage = true,
 | 
					    healthPercentage = true,
 | 
				
			||||||
 | 
					    healthCustomTagsEnabled = false,
 | 
				
			||||||
 | 
					    healthTextLeft = "[name]",
 | 
				
			||||||
 | 
					    healthTextRight = "[percent|status]",
 | 
				
			||||||
 | 
					    healthTextLeftOutline = false,
 | 
				
			||||||
 | 
					    healthTextRightOutline = false,
 | 
				
			||||||
 | 
					    healthTextLeftVOffset = 0,
 | 
				
			||||||
 | 
					    healthTextLeftHOffset = 5,
 | 
				
			||||||
 | 
					    healthTextRightVOffset = 0,
 | 
				
			||||||
 | 
					    healthTextRightHOffset = -5,
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Healthbar:Initialize()
 | 
					function Healthbar:Initialize()
 | 
				
			||||||
    self.frames = {}
 | 
					    self.frames = {}
 | 
				
			||||||
 | 
					    self:RegisterMessage("JOINED_ARENA")
 | 
				
			||||||
    self:RegisterMessage("ENEMY_SPOTTED")
 | 
					    self:RegisterMessage("ENEMY_SPOTTED")
 | 
				
			||||||
 | 
					    self:RegisterMessage("ENEMY_STEALTH")
 | 
				
			||||||
 | 
					    self:RegisterMessage("UNIT_SPEC")
 | 
				
			||||||
 | 
					    self:RegisterMessage("UNIT_DESTROYED")
 | 
				
			||||||
    self:RegisterMessage("UNIT_DEATH")
 | 
					    self:RegisterMessage("UNIT_DEATH")
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -33,152 +59,238 @@ function Healthbar:CreateFrame(unit)
 | 
				
			|||||||
    local button = Gladdy.buttons[unit]
 | 
					    local button = Gladdy.buttons[unit]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local healthBar = CreateFrame("Frame", nil, Gladdy.buttons[unit], BackdropTemplateMixin and "BackdropTemplate")
 | 
					    local healthBar = CreateFrame("Frame", nil, Gladdy.buttons[unit], BackdropTemplateMixin and "BackdropTemplate")
 | 
				
			||||||
    healthBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.healthBarBorderStyle),
 | 
					    healthBar:EnableMouse(false)
 | 
				
			||||||
 | 
					    healthBar:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "healthBarBorderStyle"),
 | 
				
			||||||
                                   edgeSize = Gladdy.db.healthBarBorderSize })
 | 
					                                   edgeSize = Gladdy.db.healthBarBorderSize })
 | 
				
			||||||
    healthBar:SetBackdropBorderColor(Gladdy.db.healthBarBorderColor.r, Gladdy.db.healthBarBorderColor.g, Gladdy.db.healthBarBorderColor.b, Gladdy.db.healthBarBorderColor.a)
 | 
					    healthBar:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.healthBarBorderColor))
 | 
				
			||||||
    healthBar:SetFrameLevel(1)
 | 
					    healthBar:SetFrameStrata(Gladdy.db.healthFrameStrata)
 | 
				
			||||||
 | 
					    healthBar:SetFrameLevel(Gladdy.db.healthFrameLevel)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    healthBar.hp = CreateFrame("StatusBar", nil, healthBar)
 | 
					    healthBar.hp = CreateFrame("StatusBar", nil, healthBar)
 | 
				
			||||||
    healthBar.hp:SetStatusBarTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.healthBarTexture))
 | 
					    healthBar.hp:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "healthBarTexture"))
 | 
				
			||||||
    healthBar.hp:SetMinMaxValues(0, 100)
 | 
					    healthBar.hp:SetMinMaxValues(0, 100)
 | 
				
			||||||
    healthBar.hp:SetFrameLevel(0)
 | 
					    healthBar.hp:SetFrameStrata(Gladdy.db.healthFrameStrata)
 | 
				
			||||||
 | 
					    healthBar.hp:SetFrameLevel(Gladdy.db.healthFrameLevel - 1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    healthBar.bg = healthBar.hp:CreateTexture(nil, "BACKGROUND")
 | 
					    healthBar.bg = healthBar.hp:CreateTexture(nil, "BACKGROUND")
 | 
				
			||||||
    healthBar.bg:SetTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.healthBarTexture))
 | 
					    healthBar.bg:SetTexture(Gladdy:SMFetch("statusbar", "healthBarTexture"))
 | 
				
			||||||
    healthBar.bg:ClearAllPoints()
 | 
					    healthBar.bg:ClearAllPoints()
 | 
				
			||||||
    healthBar.bg:SetAllPoints(healthBar.hp)
 | 
					    healthBar.bg:SetAllPoints(healthBar.hp)
 | 
				
			||||||
    healthBar.bg:SetAlpha(1)
 | 
					    healthBar.bg:SetAlpha(1)
 | 
				
			||||||
    healthBar.bg:SetVertexColor(Gladdy.db.healthBarBgColor.r, Gladdy.db.healthBarBgColor.g, Gladdy.db.healthBarBgColor.b, Gladdy.db.healthBarBgColor.a)
 | 
					    healthBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.healthBarBgColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    healthBar.nameText = healthBar:CreateFontString(nil, "LOW", "GameFontNormalSmall")
 | 
					    healthBar.nameText = healthBar:CreateFontString(nil, "LOW", "GameFontNormalSmall")
 | 
				
			||||||
    if (Gladdy.db.healthBarFontSize < 1) then
 | 
					    if (Gladdy.db.healthBarNameFontSize < 1) then
 | 
				
			||||||
        healthBar.nameText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.healthBarFont), 1)
 | 
					        healthBar.nameText:SetFont(Gladdy:SMFetch("font", "healthBarNameFont"), 1)
 | 
				
			||||||
        healthBar.nameText:Hide()
 | 
					        healthBar.nameText:Hide()
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        healthBar.nameText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.healthBarFont), Gladdy.db.healthBarFontSize)
 | 
					        healthBar.nameText:SetFont(Gladdy:SMFetch("font", "healthBarFont"), Gladdy.db.healthBarNameFontSize, Gladdy.db.healthTextLeftOutline and "OUTLINE")
 | 
				
			||||||
        healthBar.nameText:Show()
 | 
					        healthBar.nameText:Show()
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    healthBar.nameText:SetTextColor(Gladdy.db.healthBarFontColor.r, Gladdy.db.healthBarFontColor.g, Gladdy.db.healthBarFontColor.b, Gladdy.db.healthBarFontColor.a)
 | 
					    healthBar.nameText:SetTextColor(Gladdy:SetColor(Gladdy.db.healthBarFontColor))
 | 
				
			||||||
    healthBar.nameText:SetShadowOffset(1, -1)
 | 
					    healthBar.nameText:SetShadowOffset(1, -1)
 | 
				
			||||||
    healthBar.nameText:SetShadowColor(0, 0, 0, 1)
 | 
					    healthBar.nameText:SetShadowColor(0, 0, 0, 1)
 | 
				
			||||||
    healthBar.nameText:SetJustifyH("CENTER")
 | 
					    healthBar.nameText:SetJustifyH("CENTER")
 | 
				
			||||||
    healthBar.nameText:SetPoint("LEFT", 5, 0)
 | 
					    healthBar.nameText:SetPoint("LEFT", Gladdy.db.healthTextLeftHOffset, Gladdy.db.healthTextLeftVOffset)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    healthBar.healthText = healthBar:CreateFontString(nil, "LOW")
 | 
					    healthBar.healthText = healthBar:CreateFontString(nil, "LOW")
 | 
				
			||||||
    if (Gladdy.db.healthBarFontSize < 1) then
 | 
					    if (Gladdy.db.healthBarHealthFontSize < 1) then
 | 
				
			||||||
        healthBar.healthText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.healthBarFont), 1)
 | 
					        healthBar.healthText:SetFont(Gladdy:SMFetch("font", "healthBarFont"), 1)
 | 
				
			||||||
        healthBar.healthText:Hide()
 | 
					        healthBar.healthText:Hide()
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        healthBar.healthText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.healthBarFont), Gladdy.db.healthBarFontSize)
 | 
					        healthBar.healthText:SetFont(Gladdy:SMFetch("font", "healthBarFont"), Gladdy.db.healthBarHealthFontSize, Gladdy.db.healthTextRightOutline and "OUTLINE")
 | 
				
			||||||
        healthBar.healthText:Hide()
 | 
					        healthBar.healthText:Hide()
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    healthBar.healthText:SetTextColor(Gladdy.db.healthBarFontColor.r, Gladdy.db.healthBarFontColor.g, Gladdy.db.healthBarFontColor.b, Gladdy.db.healthBarFontColor.a)
 | 
					    healthBar.healthText:SetTextColor(Gladdy:SetColor(Gladdy.db.healthBarFontColor))
 | 
				
			||||||
    healthBar.healthText:SetShadowOffset(1, -1)
 | 
					    healthBar.healthText:SetShadowOffset(1, -1)
 | 
				
			||||||
    healthBar.healthText:SetShadowColor(0, 0, 0, 1)
 | 
					    healthBar.healthText:SetShadowColor(0, 0, 0, 1)
 | 
				
			||||||
    healthBar.healthText:SetJustifyH("CENTER")
 | 
					    healthBar.healthText:SetJustifyH("CENTER")
 | 
				
			||||||
    healthBar.healthText:SetPoint("RIGHT", -5, 0)
 | 
					    healthBar.healthText:SetPoint("RIGHT", Gladdy.db.healthTextRightHOffset, Gladdy.db.healthTextRightVOffset)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    healthBar.unit = unit
 | 
					    healthBar.unit = unit
 | 
				
			||||||
    self.frames[unit] = healthBar
 | 
					    self.frames[unit] = healthBar
 | 
				
			||||||
    button.healthBar = healthBar
 | 
					    button.healthBar = healthBar
 | 
				
			||||||
    self:ResetUnit(unit)
 | 
					    self:ResetUnit(unit)
 | 
				
			||||||
    healthBar:RegisterUnitEvent("UNIT_HEALTH", unit)
 | 
					    healthBar:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", unit)
 | 
				
			||||||
    healthBar:RegisterUnitEvent("UNIT_MAXHEALTH", unit)
 | 
					    healthBar:RegisterUnitEvent("UNIT_MAXHEALTH", unit)
 | 
				
			||||||
    healthBar:RegisterUnitEvent("UNIT_NAME_UPDATE", unit)
 | 
					    healthBar:RegisterUnitEvent("UNIT_NAME_UPDATE", unit)
 | 
				
			||||||
    healthBar:SetScript("OnEvent", Healthbar.OnEvent)
 | 
					    healthBar:SetScript("OnEvent", Healthbar.OnEvent)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Healthbar.OnEvent(self, event, unit)
 | 
					function Healthbar.OnEvent(self, event, unit)
 | 
				
			||||||
    if event == "UNIT_HEALTH" then
 | 
					    local isDead = UnitExists(unit) and UnitIsDeadOrGhost(unit) and not Gladdy:isFeignDeath(unit)
 | 
				
			||||||
        local health = UnitHealth(unit)
 | 
					    if event == "UNIT_HEALTH_FREQUENT" or event == "UNIT_MAXHEALTH" then
 | 
				
			||||||
        local healthMax = UnitHealthMax(unit)
 | 
					        if isDead then
 | 
				
			||||||
        Healthbar:SetHealthText(self, health, healthMax)
 | 
					            Gladdy:SendMessage("UNIT_DEATH", unit)
 | 
				
			||||||
        self.hp:SetValue(UnitHealth(unit))
 | 
					            return
 | 
				
			||||||
    elseif event == "UNIT_MAXHEALTH" then
 | 
					        end
 | 
				
			||||||
        local health = UnitHealth(unit)
 | 
					        local health = UnitHealth(unit)
 | 
				
			||||||
        local healthMax = UnitHealthMax(unit)
 | 
					        local healthMax = UnitHealthMax(unit)
 | 
				
			||||||
        self.hp:SetMinMaxValues(0, healthMax)
 | 
					        self.hp:SetMinMaxValues(0, healthMax)
 | 
				
			||||||
        self.hp:SetValue(health)
 | 
					        self.hp:SetValue(health)
 | 
				
			||||||
        Healthbar:SetHealthText(self, health, healthMax)
 | 
					        self.hp.current = health
 | 
				
			||||||
 | 
					        self.hp.max = healthMax
 | 
				
			||||||
 | 
					        Healthbar:SetText(unit, health, healthMax)
 | 
				
			||||||
 | 
					        Healthbar:SetHealthStatusBarColor(unit, self.hp.current, self.hp.max)
 | 
				
			||||||
    elseif event == "UNIT_NAME_UPDATE" then
 | 
					    elseif event == "UNIT_NAME_UPDATE" then
 | 
				
			||||||
        local name = UnitName(unit)
 | 
					        local name = UnitName(unit)
 | 
				
			||||||
        Gladdy.buttons[unit].name = name
 | 
					        Gladdy.buttons[unit].name = name
 | 
				
			||||||
        self.nameText:SetText(name)
 | 
					        Healthbar:SetText(unit, self.hp.current, self.hp.max)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    if not Gladdy.buttons[unit].class then
 | 
					    if not Gladdy.buttons[unit].class then
 | 
				
			||||||
        Gladdy:SpotEnemy(unit, true)
 | 
					        Gladdy:SpotEnemy(unit, true)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Healthbar:SetHealthText(healthBar, health, healthMax)
 | 
					local function getGradient(start, ending, percentage, factor)
 | 
				
			||||||
    local healthText
 | 
					    return start * abs(-2 * percentage + 1) + ending * factor
 | 
				
			||||||
    local healthPercentage = floor(health * 100 / healthMax)
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if health == 0 then
 | 
					-- /run LibStub("Gladdy").modules["Health Bar"]:SetHealthStatusBarColor("arena1", 51, 100)
 | 
				
			||||||
        self:UNIT_DEATH(healthBar.unit)
 | 
					local rMax, gMax, bMax, rMid, gMid, bMid, rMin, gMin, bMin, rNow, gNow, bNow, percentage, factor, stealthAlpha
 | 
				
			||||||
 | 
					function Healthbar:SetHealthStatusBarColor(unit, health, healthMax)
 | 
				
			||||||
 | 
					    local button = Gladdy.buttons[unit]
 | 
				
			||||||
 | 
					    if not button or not health or not healthMax then
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (Gladdy.db.healthActual) then
 | 
					    local healthBar = Gladdy.buttons[unit].healthBar
 | 
				
			||||||
        healthText = healthMax > 999 and ("%.1fk"):format(health / 1000) or health
 | 
					    if not healthBar.hp.oorFactor then
 | 
				
			||||||
 | 
					        healthBar.hp.oorFactor = 1
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (Gladdy.db.healthMax) then
 | 
					    healthBar.hp:SetMinMaxValues(0, healthMax)
 | 
				
			||||||
        local text = healthMax > 999 and ("%.1fk"):format(healthMax / 1000) or healthMax
 | 
					    healthBar.hp:SetValue(health)
 | 
				
			||||||
        if (healthText) then
 | 
					
 | 
				
			||||||
            healthText = ("%s/%s"):format(healthText, text)
 | 
					    if healthBar.hp.stealth then
 | 
				
			||||||
 | 
					        stealthAlpha = Gladdy.db.healthBarStealthColor.a < Gladdy.db.healthBarBgColor.a and Gladdy.db.healthBarStealthColor.a or Gladdy.db.healthBarBgColor.a
 | 
				
			||||||
 | 
					        healthBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.healthBarBgColor, nil, stealthAlpha))
 | 
				
			||||||
 | 
					        healthBar.hp:SetStatusBarColor(Gladdy:SetColor(Gladdy.db.healthBarStealthColor))
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        healthBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.healthBarBgColor))
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if not Gladdy.db.healthBarClassColored then
 | 
				
			||||||
 | 
					        if Gladdy.db.healthBarColoredByCurrentHp then
 | 
				
			||||||
 | 
					            rMax, gMax, bMax = Gladdy:SetColor(Gladdy.db.healthBarStatusBarColorMax)
 | 
				
			||||||
 | 
					            rMid, gMid, bMid = Gladdy:SetColor(Gladdy.db.healthBarStatusBarColorMid)
 | 
				
			||||||
 | 
					            rMin, gMin, bMin = Gladdy:SetColor(Gladdy.db.healthBarStatusBarColorMin)
 | 
				
			||||||
 | 
					            percentage = health / healthMax
 | 
				
			||||||
 | 
					            if percentage == 0.5 then
 | 
				
			||||||
 | 
					                rNow, gNow, bNow = Gladdy:SetColor(Gladdy.db.healthBarStatusBarColorMid, healthBar.hp.oorFactor)
 | 
				
			||||||
 | 
					            elseif percentage < 0.5 then
 | 
				
			||||||
 | 
					                factor = percentage * 2
 | 
				
			||||||
 | 
					                rNow = getGradient(rMin, rMid, percentage, factor)
 | 
				
			||||||
 | 
					                gNow = getGradient(gMin, gMid, percentage, factor)
 | 
				
			||||||
 | 
					                bNow = getGradient(bMin, bMid, percentage, factor)
 | 
				
			||||||
 | 
					            elseif percentage > 0.5 then
 | 
				
			||||||
 | 
					                factor = ((healthMax - health) / healthMax) * 2
 | 
				
			||||||
 | 
					                rNow = getGradient(rMax, rMid, percentage, factor)
 | 
				
			||||||
 | 
					                gNow = getGradient(gMax, gMid, percentage, factor)
 | 
				
			||||||
 | 
					                bNow = getGradient(bMax, bMid, percentage, factor)
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					            healthBar.hp:SetStatusBarColor(rNow / healthBar.hp.oorFactor, gNow / healthBar.hp.oorFactor, bNow / healthBar.hp.oorFactor, 1)
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
            healthText = text
 | 
					            healthBar.hp:SetStatusBarColor(Gladdy:SetColor(Gladdy.db.healthBarStatusBarColorMax, healthBar.hp.oorFactor))
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					    if button.class and Gladdy.db.healthBarClassColored then
 | 
				
			||||||
    if (Gladdy.db.healthPercentage) then
 | 
					        healthBar.hp:SetStatusBarColor(
 | 
				
			||||||
        if (healthText) then
 | 
					                RAID_CLASS_COLORS[button.class].r / healthBar.hp.oorFactor,
 | 
				
			||||||
            healthText = ("%s (%d%%)"):format(healthText, healthPercentage)
 | 
					                RAID_CLASS_COLORS[button.class].g / healthBar.hp.oorFactor,
 | 
				
			||||||
        else
 | 
					                RAID_CLASS_COLORS[button.class].b / healthBar.hp.oorFactor, 1)
 | 
				
			||||||
            healthText = ("%d%%"):format(healthPercentage)
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Healthbar:SetHealthText(healthBar, health, healthMax)
 | 
				
			||||||
 | 
					    local healthText = ""
 | 
				
			||||||
 | 
					    local healthPercentage = health and healthMax and floor(health * 100 / healthMax)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if health == 0 and UnitExists(healthBar.unit) and UnitIsDeadOrGhost(healthBar.unit) and not Gladdy:isFeignDeath(healthBar.unit) then
 | 
				
			||||||
 | 
					        self:UNIT_DEATH(healthBar.unit)
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if (Gladdy.db.healthPercentage and healthPercentage) then
 | 
				
			||||||
 | 
					        healthText = ("%d%%"):format(healthPercentage)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
    healthBar.healthText:SetText(healthText)
 | 
					    healthBar.healthText:SetText(healthText)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Healthbar:SetText(unit, health, healthMax, status)
 | 
				
			||||||
 | 
					    local button = Gladdy.buttons[unit]
 | 
				
			||||||
 | 
					    if not Gladdy.buttons[unit] then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if Gladdy.db.healthCustomTagsEnabled then
 | 
				
			||||||
 | 
					        button.healthBar.nameText:SetText(Gladdy:SetTag(unit, Gladdy.db.healthTextLeft, health, healthMax, status))
 | 
				
			||||||
 | 
					        button.healthBar.healthText:SetText(Gladdy:SetTag(unit, Gladdy.db.healthTextRight, health, healthMax, status))
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        if Gladdy.db.healthName then
 | 
				
			||||||
 | 
					            if Gladdy.db.healthNameToArenaId then
 | 
				
			||||||
 | 
					                button.healthBar.nameText:SetText(str_gsub(unit, "arena", ""))
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					                button.healthBar.nameText:SetText(Gladdy.buttons[unit].name)
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if status then
 | 
				
			||||||
 | 
					            button.healthBar.healthText:SetText(status)
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            Healthbar:SetHealthText(button.healthBar, health, healthMax)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Healthbar:UpdateFrame(unit)
 | 
					function Healthbar:UpdateFrame(unit)
 | 
				
			||||||
    local healthBar = self.frames[unit]
 | 
					    local healthBar = self.frames[unit]
 | 
				
			||||||
    if (not healthBar) then
 | 
					    if (not healthBar) then
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local iconSize = Gladdy.db.healthBarHeight + Gladdy.db.powerBarHeight
 | 
					    healthBar:SetFrameStrata(Gladdy.db.healthFrameStrata)
 | 
				
			||||||
 | 
					    healthBar:SetFrameLevel(Gladdy.db.healthFrameLevel)
 | 
				
			||||||
 | 
					    healthBar.hp:SetFrameStrata(Gladdy.db.healthFrameStrata)
 | 
				
			||||||
 | 
					    healthBar.hp:SetFrameLevel(Gladdy.db.healthFrameLevel - 1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    healthBar.bg:SetTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.healthBarTexture))
 | 
					    healthBar.bg:SetTexture(Gladdy:SMFetch("statusbar", "healthBarTexture"))
 | 
				
			||||||
    healthBar.bg:SetVertexColor(Gladdy.db.healthBarBgColor.r, Gladdy.db.healthBarBgColor.g, Gladdy.db.healthBarBgColor.b, Gladdy.db.healthBarBgColor.a)
 | 
					    healthBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.healthBarBgColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    healthBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.healthBarBorderStyle),
 | 
					    healthBar:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "healthBarBorderStyle"),
 | 
				
			||||||
                            edgeSize = Gladdy.db.healthBarBorderSize })
 | 
					                            edgeSize = Gladdy.db.healthBarBorderSize })
 | 
				
			||||||
    healthBar:SetBackdropBorderColor(Gladdy.db.healthBarBorderColor.r, Gladdy.db.healthBarBorderColor.g, Gladdy.db.healthBarBorderColor.b, Gladdy.db.healthBarBorderColor.a)
 | 
					    healthBar:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.healthBarBorderColor))
 | 
				
			||||||
    healthBar:ClearAllPoints()
 | 
					    healthBar:ClearAllPoints()
 | 
				
			||||||
    healthBar:SetPoint("TOPLEFT", Gladdy.buttons[unit], "TOPLEFT", iconSize, 0)
 | 
					    healthBar:SetPoint("TOPLEFT", Gladdy.buttons[unit], "TOPLEFT", 0, 0)
 | 
				
			||||||
    healthBar:SetPoint("BOTTOMRIGHT", Gladdy.buttons[unit], "BOTTOMRIGHT")
 | 
					    healthBar:SetPoint("BOTTOMRIGHT", Gladdy.buttons[unit], "BOTTOMRIGHT")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    healthBar.hp:SetStatusBarTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.healthBarTexture))
 | 
					    healthBar.hp:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "healthBarTexture"))
 | 
				
			||||||
    healthBar.hp:ClearAllPoints()
 | 
					    healthBar.hp:ClearAllPoints()
 | 
				
			||||||
    healthBar.hp:SetPoint("TOPLEFT", healthBar, "TOPLEFT", (Gladdy.db.healthBarBorderSize/Gladdy.db.statusbarBorderOffset), -(Gladdy.db.healthBarBorderSize/Gladdy.db.statusbarBorderOffset))
 | 
					    healthBar.hp:SetPoint("TOPLEFT", healthBar, "TOPLEFT", (Gladdy.db.healthBarBorderSize/Gladdy.db.statusbarBorderOffset), -(Gladdy.db.healthBarBorderSize/Gladdy.db.statusbarBorderOffset))
 | 
				
			||||||
    healthBar.hp:SetPoint("BOTTOMRIGHT", healthBar, "BOTTOMRIGHT", -(Gladdy.db.healthBarBorderSize/Gladdy.db.statusbarBorderOffset), (Gladdy.db.healthBarBorderSize/Gladdy.db.statusbarBorderOffset))
 | 
					    healthBar.hp:SetPoint("BOTTOMRIGHT", healthBar, "BOTTOMRIGHT", -(Gladdy.db.healthBarBorderSize/Gladdy.db.statusbarBorderOffset), (Gladdy.db.healthBarBorderSize/Gladdy.db.statusbarBorderOffset))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (Gladdy.db.healthBarFontSize < 1) then
 | 
					    if (Gladdy.db.healthBarHealthFontSize < 1) then
 | 
				
			||||||
        healthBar.nameText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.healthBarFont), 1)
 | 
					        healthBar.healthText:SetFont(Gladdy:SMFetch("font", "healthBarFont"), 1)
 | 
				
			||||||
        healthBar.healthText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.healthBarFont), 1)
 | 
					 | 
				
			||||||
        healthBar.nameText:Hide()
 | 
					 | 
				
			||||||
        healthBar.healthText:Hide()
 | 
					        healthBar.healthText:Hide()
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        healthBar.nameText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.healthBarFont), Gladdy.db.healthBarFontSize)
 | 
					        healthBar.healthText:SetFont(Gladdy:SMFetch("font", "healthBarFont"), Gladdy.db.healthBarHealthFontSize, Gladdy.db.healthTextRightOutline and "OUTLINE")
 | 
				
			||||||
        healthBar.nameText:Show()
 | 
					 | 
				
			||||||
        healthBar.healthText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.healthBarFont), Gladdy.db.healthBarFontSize)
 | 
					 | 
				
			||||||
        healthBar.healthText:Show()
 | 
					        healthBar.healthText:Show()
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    healthBar.nameText:SetTextColor(Gladdy.db.healthBarFontColor.r, Gladdy.db.healthBarFontColor.g, Gladdy.db.healthBarFontColor.b, Gladdy.db.healthBarFontColor.a)
 | 
					    if (Gladdy.db.healthBarNameFontSize < 1) then
 | 
				
			||||||
    healthBar.healthText:SetTextColor(Gladdy.db.healthBarFontColor.r, Gladdy.db.healthBarFontColor.g, Gladdy.db.healthBarFontColor.b, Gladdy.db.healthBarFontColor.a)
 | 
					        healthBar.nameText:SetFont(Gladdy:SMFetch("font", "healthBarNameFont"), 1)
 | 
				
			||||||
 | 
					        healthBar.nameText:Hide()
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        healthBar.nameText:SetFont(Gladdy:SMFetch("font", "healthBarFont"), Gladdy.db.healthBarNameFontSize, Gladdy.db.healthTextLeftOutline and "OUTLINE")
 | 
				
			||||||
 | 
					        if Gladdy.db.healthName or Gladdy.db.healthCustomTagsEnabled then
 | 
				
			||||||
 | 
					            healthBar.nameText:Show()
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            healthBar.nameText:Hide()
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    healthBar.nameText:SetTextColor(Gladdy:SetColor(Gladdy.db.healthBarFontColor))
 | 
				
			||||||
 | 
					    healthBar.healthText:SetTextColor(Gladdy:SetColor(Gladdy.db.healthBarFontColor))
 | 
				
			||||||
 | 
					    healthBar.nameText:SetPoint("LEFT", Gladdy.db.healthTextLeftHOffset, Gladdy.db.healthTextLeftVOffset)
 | 
				
			||||||
 | 
					    healthBar.healthText:SetPoint("RIGHT", Gladdy.db.healthTextRightHOffset, Gladdy.db.healthTextRightVOffset)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Healthbar:SetHealthStatusBarColor(unit, healthBar.hp.current, healthBar.hp.max)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Healthbar:ResetUnit(unit)
 | 
					function Healthbar:ResetUnit(unit)
 | 
				
			||||||
@@ -191,6 +303,8 @@ function Healthbar:ResetUnit(unit)
 | 
				
			|||||||
    healthBar.nameText:SetText("")
 | 
					    healthBar.nameText:SetText("")
 | 
				
			||||||
    healthBar.healthText:SetText("")
 | 
					    healthBar.healthText:SetText("")
 | 
				
			||||||
    healthBar.hp:SetValue(0)
 | 
					    healthBar.hp:SetValue(0)
 | 
				
			||||||
 | 
					    healthBar.hp.current = nil
 | 
				
			||||||
 | 
					    healthBar.hp.max = nil
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Healthbar:Test(unit)
 | 
					function Healthbar:Test(unit)
 | 
				
			||||||
@@ -200,8 +314,31 @@ function Healthbar:Test(unit)
 | 
				
			|||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Gladdy:SendMessage("UNIT_HEALTH", unit, button.health, button.healthMax)
 | 
				
			||||||
 | 
					    healthBar.hp.current = button.health
 | 
				
			||||||
 | 
					    healthBar.hp.max = button.healthMax
 | 
				
			||||||
    self:ENEMY_SPOTTED(unit)
 | 
					    self:ENEMY_SPOTTED(unit)
 | 
				
			||||||
    self:UNIT_HEALTH(unit, button.health, button.healthMax)
 | 
					    self:SetText(unit, button.health, button.healthMax)
 | 
				
			||||||
 | 
					    healthBar.hp:SetValue(button.health)
 | 
				
			||||||
 | 
					    if unit == "arena1" then
 | 
				
			||||||
 | 
					        self:UNIT_DEATH(unit)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Healthbar:UNIT_SPEC(unit)
 | 
				
			||||||
 | 
					    local button = Gladdy.buttons[unit]
 | 
				
			||||||
 | 
					    if not button then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    self:SetText(unit, button.healthBar.hp.current, button.healthBar.hp.max)
 | 
				
			||||||
 | 
					    --button.healthBar.nameText:SetText(Gladdy:SetTag(unit, Gladdy.db.healthTextLeft, button.health, button.healthMax))
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Healthbar:JOINED_ARENA()
 | 
				
			||||||
 | 
					    for i=1,Gladdy.curBracket do
 | 
				
			||||||
 | 
					        local unit = "arena" .. i
 | 
				
			||||||
 | 
					        self:SetText(unit, self.frames[unit].hp.current, self.frames[unit].hp.max)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Healthbar:ENEMY_SPOTTED(unit)
 | 
					function Healthbar:ENEMY_SPOTTED(unit)
 | 
				
			||||||
@@ -216,48 +353,23 @@ function Healthbar:ENEMY_SPOTTED(unit)
 | 
				
			|||||||
        local healthMax = UnitHealthMax(unit)
 | 
					        local healthMax = UnitHealthMax(unit)
 | 
				
			||||||
        healthBar.hp:SetMinMaxValues(0, healthMax)
 | 
					        healthBar.hp:SetMinMaxValues(0, healthMax)
 | 
				
			||||||
        healthBar.hp:SetValue(health)
 | 
					        healthBar.hp:SetValue(health)
 | 
				
			||||||
        Healthbar:SetHealthText(healthBar, health, healthMax)
 | 
					        healthBar.hp.current = health
 | 
				
			||||||
 | 
					        healthBar.hp.max = healthMax
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    healthBar.nameText:SetText(button.name)
 | 
					    Healthbar:SetText(unit, healthBar.hp.current, healthBar.hp.max)
 | 
				
			||||||
    healthBar.hp:SetStatusBarColor(RAID_CLASS_COLORS[button.class].r, RAID_CLASS_COLORS[button.class].g, RAID_CLASS_COLORS[button.class].b, 1)
 | 
					    Healthbar:SetHealthStatusBarColor(unit, healthBar.hp.current, healthBar.hp.max)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Healthbar:UNIT_HEALTH(unit, health, healthMax)
 | 
					function Healthbar:ENEMY_STEALTH(unit, stealth)
 | 
				
			||||||
    local healthBar = self.frames[unit]
 | 
					    local healthBar = self.frames[unit]
 | 
				
			||||||
    if (not healthBar) then
 | 
					    local button = Gladdy.buttons[unit]
 | 
				
			||||||
 | 
					    if (not healthBar or not button) then
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    if not Gladdy.buttons[unit].class then
 | 
					 | 
				
			||||||
        Gladdy:SpotEnemy(unit, true)
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
    Gladdy:SendMessage("UNIT_HEALTH", unit, health, healthMax)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local healthPercentage = floor(health * 100 / healthMax)
 | 
					    healthBar.hp.stealth = stealth
 | 
				
			||||||
    local healthText
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (Gladdy.db.healthActual) then
 | 
					    Healthbar:SetHealthStatusBarColor(unit, healthBar.hp.current, healthBar.hp.max)
 | 
				
			||||||
        healthText = healthMax > 999 and ("%.1fk"):format(health / 1000) or health
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (Gladdy.db.healthMax) then
 | 
					 | 
				
			||||||
        local text = healthMax > 999 and ("%.1fk"):format(healthMax / 1000) or healthMax
 | 
					 | 
				
			||||||
        if (healthText) then
 | 
					 | 
				
			||||||
            healthText = ("%s/%s"):format(healthText, text)
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
            healthText = text
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (Gladdy.db.healthPercentage) then
 | 
					 | 
				
			||||||
        if (healthText) then
 | 
					 | 
				
			||||||
            healthText = ("%s (%d%%)"):format(healthText, healthPercentage)
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
            healthText = ("%d%%"):format(healthPercentage)
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    healthBar.healthText:SetText(healthText)
 | 
					 | 
				
			||||||
    healthBar.hp:SetValue(healthPercentage)
 | 
					 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Healthbar:UNIT_DEATH(unit)
 | 
					function Healthbar:UNIT_DEATH(unit)
 | 
				
			||||||
@@ -267,7 +379,19 @@ function Healthbar:UNIT_DEATH(unit)
 | 
				
			|||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    healthBar.hp:SetValue(0)
 | 
					    healthBar.hp:SetValue(0)
 | 
				
			||||||
    healthBar.healthText:SetText(L["DEAD"])
 | 
					    healthBar.hp.current = 0
 | 
				
			||||||
 | 
					    Healthbar:SetText(unit, 0, 100, L["DEAD"])
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Healthbar:UNIT_DESTROYED(unit)
 | 
				
			||||||
 | 
					    local healthBar = self.frames[unit]
 | 
				
			||||||
 | 
					    if (not healthBar) then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    healthBar.hp:SetValue(0)
 | 
				
			||||||
 | 
					    healthBar.hp.current = 0
 | 
				
			||||||
 | 
					    Healthbar:SetText(unit, 0, 100, L["LEAVE"])
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function option(params)
 | 
					local function option(params)
 | 
				
			||||||
@@ -279,10 +403,15 @@ local function option(params)
 | 
				
			|||||||
        set = function(info, value)
 | 
					        set = function(info, value)
 | 
				
			||||||
            local key = info.arg or info[#info]
 | 
					            local key = info.arg or info[#info]
 | 
				
			||||||
            Gladdy.dbi.profile[key] = value
 | 
					            Gladdy.dbi.profile[key] = value
 | 
				
			||||||
            Gladdy.options.args.Healthbar.args.group.args.border.args.healthBarBorderSize.max = Gladdy.db.healthBarHeight/2
 | 
					            Gladdy.options.args["Health Bar"].args.group.args.border.args.healthBarBorderSize.max = Gladdy.db.healthBarHeight/2
 | 
				
			||||||
            if Gladdy.db.healthBarBorderSize > Gladdy.db.healthBarHeight/2 then
 | 
					            if Gladdy.db.healthBarBorderSize > Gladdy.db.healthBarHeight/2 then
 | 
				
			||||||
                Gladdy.db.healthBarBorderSize = Gladdy.db.healthBarHeight/2
 | 
					                Gladdy.db.healthBarBorderSize = Gladdy.db.healthBarHeight/2
 | 
				
			||||||
            end
 | 
					            end
 | 
				
			||||||
 | 
					            if Gladdy.frame.testing then
 | 
				
			||||||
 | 
					                for i=1,Gladdy.curBracket do
 | 
				
			||||||
 | 
					                    Healthbar:Test("arena" .. i)
 | 
				
			||||||
 | 
					                end
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
            Gladdy:UpdateFrame()
 | 
					            Gladdy:UpdateFrame()
 | 
				
			||||||
        end,
 | 
					        end,
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -304,7 +433,7 @@ function Healthbar:GetOptions()
 | 
				
			|||||||
        group = {
 | 
					        group = {
 | 
				
			||||||
            type = "group",
 | 
					            type = "group",
 | 
				
			||||||
            childGroups = "tree",
 | 
					            childGroups = "tree",
 | 
				
			||||||
            name = "Frame",
 | 
					            name = L["Frame"],
 | 
				
			||||||
            order = 3,
 | 
					            order = 3,
 | 
				
			||||||
            args = {
 | 
					            args = {
 | 
				
			||||||
                general = {
 | 
					                general = {
 | 
				
			||||||
@@ -325,6 +454,7 @@ function Healthbar:GetOptions()
 | 
				
			|||||||
                            min = 10,
 | 
					                            min = 10,
 | 
				
			||||||
                            max = 100,
 | 
					                            max = 100,
 | 
				
			||||||
                            step = 1,
 | 
					                            step = 1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        healthBarTexture = option({
 | 
					                        healthBarTexture = option({
 | 
				
			||||||
                            type = "select",
 | 
					                            type = "select",
 | 
				
			||||||
@@ -334,19 +464,76 @@ function Healthbar:GetOptions()
 | 
				
			|||||||
                            dialogControl = "LSM30_Statusbar",
 | 
					                            dialogControl = "LSM30_Statusbar",
 | 
				
			||||||
                            values = AceGUIWidgetLSMlists.statusbar,
 | 
					                            values = AceGUIWidgetLSMlists.statusbar,
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                barColor = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Bar Color"],
 | 
				
			||||||
 | 
					                    order = 2,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        headerAuras = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Color"],
 | 
				
			||||||
 | 
					                            order = 1,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        healthBarClassColored = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["Class colored"] .. " " .. L["Health Bar"],
 | 
				
			||||||
 | 
					                            order = 2,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        healthBarStealthColor = Gladdy:colorOption({
 | 
				
			||||||
 | 
					                            type = "color",
 | 
				
			||||||
 | 
					                            name = L["Stealth Color"],
 | 
				
			||||||
 | 
					                            order = 3,
 | 
				
			||||||
 | 
					                            hasAlpha = true,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
                        healthBarBgColor = Gladdy:colorOption({
 | 
					                        healthBarBgColor = Gladdy:colorOption({
 | 
				
			||||||
                            type = "color",
 | 
					                            type = "color",
 | 
				
			||||||
                            name = L["Background color"],
 | 
					                            name = L["Background color"],
 | 
				
			||||||
                            desc = L["Color of the status bar background"],
 | 
					                            desc = L["Color of the status bar background"],
 | 
				
			||||||
                            order = 5,
 | 
					                            order = 4,
 | 
				
			||||||
                            hasAlpha = true,
 | 
					                            hasAlpha = true,
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
 | 
					                        headerAuras = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Custom Colors"],
 | 
				
			||||||
 | 
					                            order = 10,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        healthBarColoredByCurrentHp = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["Enable Custom Colors"],
 | 
				
			||||||
 | 
					                            order = 11,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                            disabled = function() return Gladdy.db.healthBarClassColored end,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        healthBarStatusBarColorMax = Gladdy:colorOption({
 | 
				
			||||||
 | 
					                            type = "color",
 | 
				
			||||||
 | 
					                            name = L["100%"],
 | 
				
			||||||
 | 
					                            order = 12,
 | 
				
			||||||
 | 
					                            hasAlpha = false,
 | 
				
			||||||
 | 
					                            disabled = function() return Gladdy.db.healthBarClassColored end,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        healthBarStatusBarColorMid = Gladdy:colorOption({
 | 
				
			||||||
 | 
					                            type = "color",
 | 
				
			||||||
 | 
					                            name = L["50%"],
 | 
				
			||||||
 | 
					                            order = 13,
 | 
				
			||||||
 | 
					                            hasAlpha = false,
 | 
				
			||||||
 | 
					                            disabled = function() return Gladdy.db.healthBarClassColored end,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        healthBarStatusBarColorMin = Gladdy:colorOption({
 | 
				
			||||||
 | 
					                            type = "color",
 | 
				
			||||||
 | 
					                            name = L["0%"],
 | 
				
			||||||
 | 
					                            order = 14,
 | 
				
			||||||
 | 
					                            hasAlpha = false,
 | 
				
			||||||
 | 
					                            disabled = function() return Gladdy.db.healthBarClassColored end,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
                font = {
 | 
					                font = {
 | 
				
			||||||
                    type = "group",
 | 
					                    type = "group",
 | 
				
			||||||
                    name = L["Font"],
 | 
					                    name = L["Font"],
 | 
				
			||||||
                    order = 2,
 | 
					                    order = 3,
 | 
				
			||||||
                    args = {
 | 
					                    args = {
 | 
				
			||||||
                        header = {
 | 
					                        header = {
 | 
				
			||||||
                            type = "header",
 | 
					                            type = "header",
 | 
				
			||||||
@@ -368,20 +555,90 @@ function Healthbar:GetOptions()
 | 
				
			|||||||
                            order = 12,
 | 
					                            order = 12,
 | 
				
			||||||
                            hasAlpha = true,
 | 
					                            hasAlpha = true,
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        healthBarFontSize = option({
 | 
					                        healthTextLeftOutline = option({
 | 
				
			||||||
                            type = "range",
 | 
					                            type = "toggle",
 | 
				
			||||||
                            name = L["Font size"],
 | 
					                            name = L["Left Font Outline"],
 | 
				
			||||||
                            desc = L["Size of the text"],
 | 
					 | 
				
			||||||
                            order = 13,
 | 
					                            order = 13,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        healthTextRightOutline = option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["Right Font Outline"],
 | 
				
			||||||
 | 
					                            order = 14,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        headerSize = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Size"],
 | 
				
			||||||
 | 
					                            order = 20,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        healthBarNameFontSize = option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Name font size"],
 | 
				
			||||||
 | 
					                            desc = L["Size of the name text"],
 | 
				
			||||||
 | 
					                            order = 21,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
                            min = 0,
 | 
					                            min = 0,
 | 
				
			||||||
                            max = 20,
 | 
					                            max = 20,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        healthBarHealthFontSize = option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Health font size"],
 | 
				
			||||||
 | 
					                            desc = L["Size of the health text"],
 | 
				
			||||||
 | 
					                            order = 22,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            min = 0,
 | 
				
			||||||
 | 
					                            max = 20,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        headerOffsets = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Offsets"],
 | 
				
			||||||
 | 
					                            order = 30,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        healthTextLeftVOffset = option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Left Text Vertical Offset"],
 | 
				
			||||||
 | 
					                            order = 31,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            min = -200,
 | 
				
			||||||
 | 
					                            max = 200,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        healthTextLeftHOffset = option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Left Text Horizontal Offset"],
 | 
				
			||||||
 | 
					                            order = 32,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            min = -200,
 | 
				
			||||||
 | 
					                            max = 200,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        healthTextRightVOffset = option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Right Text Vertical Offset"],
 | 
				
			||||||
 | 
					                            order = 33,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            min = -200,
 | 
				
			||||||
 | 
					                            max = 200,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        healthTextRightHOffset = option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Right Text Horizontal Offset"],
 | 
				
			||||||
 | 
					                            order = 34,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            min = -200,
 | 
				
			||||||
 | 
					                            max = 200,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
                border = {
 | 
					                border = {
 | 
				
			||||||
                    type = "group",
 | 
					                    type = "group",
 | 
				
			||||||
                    name = L["Border"],
 | 
					                    name = L["Border"],
 | 
				
			||||||
                    order = 3,
 | 
					                    order = 4,
 | 
				
			||||||
                    args = {
 | 
					                    args = {
 | 
				
			||||||
                        header = {
 | 
					                        header = {
 | 
				
			||||||
                            type = "header",
 | 
					                            type = "header",
 | 
				
			||||||
@@ -403,6 +660,7 @@ function Healthbar:GetOptions()
 | 
				
			|||||||
                            min = 0.5,
 | 
					                            min = 0.5,
 | 
				
			||||||
                            max = Gladdy.db.healthBarHeight/2,
 | 
					                            max = Gladdy.db.healthBarHeight/2,
 | 
				
			||||||
                            step = 0.5,
 | 
					                            step = 0.5,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        healthBarBorderColor = Gladdy:colorOption({
 | 
					                        healthBarBorderColor = Gladdy:colorOption({
 | 
				
			||||||
                            type = "color",
 | 
					                            type = "color",
 | 
				
			||||||
@@ -413,34 +671,77 @@ function Healthbar:GetOptions()
 | 
				
			|||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
 | 
					                frameStrata = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Frame Strata and Level"],
 | 
				
			||||||
 | 
					                    order = 5,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        headerAuraLevel = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Frame Strata and Level"],
 | 
				
			||||||
 | 
					                            order = 1,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        healthFrameStrata = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "select",
 | 
				
			||||||
 | 
					                            name = L["Frame Strata"],
 | 
				
			||||||
 | 
					                            order = 2,
 | 
				
			||||||
 | 
					                            values = Gladdy.frameStrata,
 | 
				
			||||||
 | 
					                            sorting = Gladdy.frameStrataSorting,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        healthFrameLevel = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Frame Level"],
 | 
				
			||||||
 | 
					                            min = 1,
 | 
				
			||||||
 | 
					                            max = 500,
 | 
				
			||||||
 | 
					                            step = 1,
 | 
				
			||||||
 | 
					                            order = 3,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
                healthValues = {
 | 
					                healthValues = {
 | 
				
			||||||
                    type = "group",
 | 
					                    type = "group",
 | 
				
			||||||
                    name = L["Health Values"],
 | 
					                    name = L["Health Bar Text"],
 | 
				
			||||||
                    order = 4,
 | 
					                    order = 6,
 | 
				
			||||||
                    args = {
 | 
					                    args = {
 | 
				
			||||||
                        header = {
 | 
					                        header = {
 | 
				
			||||||
                            type = "header",
 | 
					                            type = "header",
 | 
				
			||||||
                            name = L["Health Values"],
 | 
					                            name = L["Health Bar Text"],
 | 
				
			||||||
                            order = 1,
 | 
					                            order = 1,
 | 
				
			||||||
                        },
 | 
					                        },
 | 
				
			||||||
                        healthActual = option({
 | 
					                        healthName = option({
 | 
				
			||||||
                            type = "toggle",
 | 
					                            type = "toggle",
 | 
				
			||||||
                            name = L["Show the actual health"],
 | 
					                            name = L["Show name text"],
 | 
				
			||||||
                            desc = L["Show the actual health on the health bar"],
 | 
					                            desc = L["Show the units name"],
 | 
				
			||||||
                            order = 31,
 | 
					                            order = 2,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                            disabled = function() return Gladdy.db.healthCustomTagsEnabled end,
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        healthMax = option({
 | 
					                        healthNameToArenaId = option({
 | 
				
			||||||
                            type = "toggle",
 | 
					                            type = "toggle",
 | 
				
			||||||
                            name = L["Show max health"],
 | 
					                            name = L["Show ArenaX"],
 | 
				
			||||||
                            desc = L["Show max health on the health bar"],
 | 
					                            desc = L["Show 1-5 as name instead"],
 | 
				
			||||||
                            order = 32,
 | 
					                            order = 3,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                            disabled = function() return not Gladdy.db.healthName or Gladdy.db.healthCustomTagsEnabled end,
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        healthPercentage = option({
 | 
					                        healthPercentage = option({
 | 
				
			||||||
                            type = "toggle",
 | 
					                            type = "toggle",
 | 
				
			||||||
                            name = L["Show health percentage"],
 | 
					                            name = L["Show health percentage"],
 | 
				
			||||||
                            desc = L["Show health percentage on the health bar"],
 | 
					                            desc = L["Show health percentage on the health bar"],
 | 
				
			||||||
                            order = 33,
 | 
					                            order = 6,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                            disabled = function() return Gladdy.db.healthCustomTagsEnabled end,
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
 | 
					                        header = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Custom Tags"],
 | 
				
			||||||
 | 
					                            order = 10,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        healthCustomTagsEnabled = Gladdy:GetTagOption(L["Custom Tags Enabled"], 11, nil, option, true),
 | 
				
			||||||
 | 
					                        healthTextLeft = Gladdy:GetTagOption(L["Left Text"], 12, "healthCustomTagsEnabled", option),
 | 
				
			||||||
 | 
					                        healthTextRight = Gladdy:GetTagOption(L["Right Text"], 13, "healthCustomTagsEnabled", option),
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,14 +3,18 @@ local CreateFrame, UnitIsUnit = CreateFrame, UnitIsUnit
 | 
				
			|||||||
local Gladdy = LibStub("Gladdy")
 | 
					local Gladdy = LibStub("Gladdy")
 | 
				
			||||||
local L = Gladdy.L
 | 
					local L = Gladdy.L
 | 
				
			||||||
local Highlight = Gladdy:NewModule("Highlight", nil, {
 | 
					local Highlight = Gladdy:NewModule("Highlight", nil, {
 | 
				
			||||||
    highlightBorderSize = 2,
 | 
					    highlightBorderSize = 1,
 | 
				
			||||||
 | 
					    highlightInset = false,
 | 
				
			||||||
    targetBorderColor = { r = 1, g = 0.8, b = 0, a = 1 },
 | 
					    targetBorderColor = { r = 1, g = 0.8, b = 0, a = 1 },
 | 
				
			||||||
    focusBorderColor = { r = 1, g = 0, b = 0, a = 1 },
 | 
					    focusBorderColor = { r = 1, g = 0, b = 0, a = 1 },
 | 
				
			||||||
    leaderBorderColor = { r = 0, g = 1, b = 0, a = 1 },
 | 
					    leaderBorderColor = { r = 0, g = 1, b = 0, a = 1 },
 | 
				
			||||||
 | 
					    highlightBorderStyle = "Square Full White",
 | 
				
			||||||
    highlight = true,
 | 
					    highlight = true,
 | 
				
			||||||
    targetBorder = true,
 | 
					    targetBorder = true,
 | 
				
			||||||
    focusBorder = true,
 | 
					    focusBorder = true,
 | 
				
			||||||
    leaderBorder = true,
 | 
					    leaderBorder = true,
 | 
				
			||||||
 | 
					    highlightFrameStrata = "MEDIUM",
 | 
				
			||||||
 | 
					    highlightFrameLevel = 20,
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Highlight:Initialize()
 | 
					function Highlight:Initialize()
 | 
				
			||||||
@@ -50,21 +54,24 @@ function Highlight:CreateFrame(unit)
 | 
				
			|||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local healthBar = Gladdy.modules.Healthbar.frames[unit]
 | 
					    local healthBar = Gladdy.modules["Health Bar"].frames[unit]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local targetBorder = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate")
 | 
					    local targetBorder = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate")
 | 
				
			||||||
    targetBorder:SetBackdrop({ edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", edgeSize = Gladdy.db.highlightBorderSize })
 | 
					    targetBorder:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "highlightBorderStyle"), edgeSize = Gladdy.db.highlightBorderSize })
 | 
				
			||||||
    targetBorder:SetFrameStrata("HIGH")
 | 
					    targetBorder:SetFrameStrata(Gladdy.db.highlightFrameStrata)
 | 
				
			||||||
 | 
					    targetBorder:SetFrameLevel(Gladdy.db.highlightFrameLevel)
 | 
				
			||||||
    targetBorder:Hide()
 | 
					    targetBorder:Hide()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local focusBorder = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate")
 | 
					    local focusBorder = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate")
 | 
				
			||||||
    focusBorder:SetBackdrop({ edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", edgeSize = Gladdy.db.highlightBorderSize })
 | 
					    focusBorder:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "highlightBorderStyle"), edgeSize = Gladdy.db.highlightBorderSize })
 | 
				
			||||||
    focusBorder:SetFrameStrata("LOW")
 | 
					    focusBorder:SetFrameStrata(Gladdy.db.highlightFrameStrata)
 | 
				
			||||||
 | 
					    focusBorder:SetFrameLevel(Gladdy.db.highlightFrameLevel)
 | 
				
			||||||
    focusBorder:Hide()
 | 
					    focusBorder:Hide()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local leaderBorder = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate")
 | 
					    local leaderBorder = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate")
 | 
				
			||||||
    leaderBorder:SetBackdrop({ edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", edgeSize = Gladdy.db.highlightBorderSize })
 | 
					    leaderBorder:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "highlightBorderStyle"), edgeSize = Gladdy.db.highlightBorderSize })
 | 
				
			||||||
    leaderBorder:SetFrameStrata("MEDIUM")
 | 
					    leaderBorder:SetFrameStrata(Gladdy.db.highlightFrameStrata)
 | 
				
			||||||
 | 
					    leaderBorder:SetFrameLevel(Gladdy.db.highlightFrameLevel)
 | 
				
			||||||
    leaderBorder:Hide()
 | 
					    leaderBorder:Hide()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local highlight = healthBar:CreateTexture(nil, "OVERLAY")
 | 
					    local highlight = healthBar:CreateTexture(nil, "OVERLAY")
 | 
				
			||||||
@@ -87,31 +94,58 @@ function Highlight:UpdateFrame(unit)
 | 
				
			|||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    local powerBarHeight = Gladdy.db.powerBarEnabled and (Gladdy.db.powerBarHeight + 1) or 0
 | 
				
			||||||
    local borderSize = Gladdy.db.highlightBorderSize
 | 
					    local borderSize = Gladdy.db.highlightBorderSize
 | 
				
			||||||
    local iconSize = Gladdy.db.healthBarHeight + Gladdy.db.powerBarHeight + 1
 | 
					    local borderOffset = borderSize
 | 
				
			||||||
    local width = Gladdy.db.barWidth + borderSize * 2
 | 
					    local hpAndPowerHeight = Gladdy.db.healthBarHeight + powerBarHeight
 | 
				
			||||||
    local height = iconSize + borderSize * 2
 | 
					    local width = Gladdy.db.barWidth + (Gladdy.db.highlightInset and 0 or borderSize * 2)
 | 
				
			||||||
 | 
					    local height = hpAndPowerHeight + (Gladdy.db.highlightInset and 0 or borderSize * 2)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    button.targetBorder:SetFrameStrata(Gladdy.db.highlightFrameStrata)
 | 
				
			||||||
 | 
					    button.targetBorder:SetFrameLevel(Gladdy.db.highlightFrameLevel)
 | 
				
			||||||
 | 
					    button.focusBorder:SetFrameStrata(Gladdy.db.highlightFrameStrata)
 | 
				
			||||||
 | 
					    button.focusBorder:SetFrameLevel(Gladdy.db.highlightFrameLevel)
 | 
				
			||||||
 | 
					    button.leaderBorder:SetFrameStrata(Gladdy.db.highlightFrameStrata)
 | 
				
			||||||
 | 
					    button.leaderBorder:SetFrameLevel(Gladdy.db.highlightFrameLevel)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    button.targetBorder:SetWidth(width)
 | 
					    button.targetBorder:SetWidth(width)
 | 
				
			||||||
    button.targetBorder:SetHeight(height)
 | 
					    button.targetBorder:SetHeight(height)
 | 
				
			||||||
    button.targetBorder:ClearAllPoints()
 | 
					    button.targetBorder:ClearAllPoints()
 | 
				
			||||||
    button.targetBorder:SetPoint("TOP", button.healthBar, "TOP", 0, borderSize)
 | 
					    if Gladdy.db.highlightInset then
 | 
				
			||||||
    button.targetBorder:SetBackdrop({ edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", edgeSize = borderSize })
 | 
					        button.targetBorder:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT", -(borderOffset/Gladdy.db.statusbarBorderOffset), (borderOffset/Gladdy.db.statusbarBorderOffset))
 | 
				
			||||||
    button.targetBorder:SetBackdropBorderColor(Gladdy.db.targetBorderColor.r, Gladdy.db.targetBorderColor.g, Gladdy.db.targetBorderColor.b, Gladdy.db.targetBorderColor.a)
 | 
					        button.targetBorder:SetPoint("BOTTOMRIGHT",  Gladdy.db.powerBarEnabled and button.powerBar or button.healthBar, "BOTTOMRIGHT", (borderOffset/Gladdy.db.statusbarBorderOffset), -(borderOffset/Gladdy.db.statusbarBorderOffset))
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        button.targetBorder:SetPoint("TOP", button.healthBar, "TOP", 0, (Gladdy.db.highlightInset and 0 or borderSize))
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    button.targetBorder:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "highlightBorderStyle"), edgeSize = borderSize })
 | 
				
			||||||
 | 
					    button.targetBorder:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.targetBorderColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    button.focusBorder:SetWidth(width)
 | 
					    button.focusBorder:SetWidth(width)
 | 
				
			||||||
    button.focusBorder:SetHeight(height)
 | 
					    button.focusBorder:SetHeight(height)
 | 
				
			||||||
    button.focusBorder:ClearAllPoints()
 | 
					    button.focusBorder:ClearAllPoints()
 | 
				
			||||||
    button.focusBorder:SetPoint("TOP", button.healthBar, "TOP", 0, borderSize)
 | 
					    if Gladdy.db.highlightInset then
 | 
				
			||||||
    button.focusBorder:SetBackdrop({ edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", edgeSize = borderSize })
 | 
					        button.focusBorder:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT", -(borderOffset/Gladdy.db.statusbarBorderOffset), (borderOffset/Gladdy.db.statusbarBorderOffset))
 | 
				
			||||||
    button.focusBorder:SetBackdropBorderColor(Gladdy.db.focusBorderColor.r, Gladdy.db.focusBorderColor.g, Gladdy.db.focusBorderColor.b, Gladdy.db.focusBorderColor.a)
 | 
					        button.focusBorder:SetPoint("BOTTOMRIGHT", Gladdy.db.powerBarEnabled and button.powerBar or button.healthBar, "BOTTOMRIGHT", (borderOffset/Gladdy.db.statusbarBorderOffset), -(borderOffset/Gladdy.db.statusbarBorderOffset))
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        button.focusBorder:SetPoint("TOP", button.healthBar, "TOP", 0, (Gladdy.db.highlightInset and 0 or borderSize))
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    button.focusBorder:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "highlightBorderStyle"), edgeSize = borderSize })
 | 
				
			||||||
 | 
					    button.focusBorder:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.focusBorderColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    button.leaderBorder:SetWidth(width)
 | 
					    button.leaderBorder:SetWidth(width)
 | 
				
			||||||
    button.leaderBorder:SetHeight(height)
 | 
					    button.leaderBorder:SetHeight(height)
 | 
				
			||||||
    button.leaderBorder:ClearAllPoints()
 | 
					    button.leaderBorder:ClearAllPoints()
 | 
				
			||||||
    button.leaderBorder:SetPoint("TOP", button.healthBar, "TOP", 0, borderSize)
 | 
					    if Gladdy.db.highlightInset then
 | 
				
			||||||
    button.leaderBorder:SetBackdrop({ edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", edgeSize = borderSize })
 | 
					        button.leaderBorder:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT", -(borderOffset/Gladdy.db.statusbarBorderOffset), (borderOffset/Gladdy.db.statusbarBorderOffset))
 | 
				
			||||||
    button.leaderBorder:SetBackdropBorderColor(Gladdy.db.leaderBorderColor.r, Gladdy.db.leaderBorderColor.g, Gladdy.db.leaderBorderColor.b, Gladdy.db.leaderBorderColor.a)
 | 
					        button.leaderBorder:SetPoint("BOTTOMRIGHT", button.powerBar, "BOTTOMRIGHT", (borderOffset/Gladdy.db.statusbarBorderOffset), -(borderOffset/Gladdy.db.statusbarBorderOffset))
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        button.leaderBorder:SetPoint("TOP", button.healthBar, "TOP", 0, (Gladdy.db.highlightInset and 0 or borderSize))
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    button.leaderBorder:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "highlightBorderStyle"), edgeSize = borderSize })
 | 
				
			||||||
 | 
					    button.leaderBorder:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.leaderBorderColor))
 | 
				
			||||||
    if Gladdy.frame.testing then
 | 
					    if Gladdy.frame.testing then
 | 
				
			||||||
        Highlight:Test(unit)
 | 
					        Highlight:Test(unit)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
@@ -135,7 +169,7 @@ function Highlight:Test(unit)
 | 
				
			|||||||
    elseif (unit == "arena2") then
 | 
					    elseif (unit == "arena2") then
 | 
				
			||||||
        self:Toggle(unit, "target", true)
 | 
					        self:Toggle(unit, "target", true)
 | 
				
			||||||
    elseif (unit == "arena3") then
 | 
					    elseif (unit == "arena3") then
 | 
				
			||||||
        self:Toggle(unit, "leader", true)
 | 
					        --self:Toggle(unit, "leader", true)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -179,64 +213,136 @@ function Highlight:GetOptions()
 | 
				
			|||||||
            name = L["Highlight"],
 | 
					            name = L["Highlight"],
 | 
				
			||||||
            order = 2,
 | 
					            order = 2,
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        highlightBorderSize = {
 | 
					        highlightInset = Gladdy:option({
 | 
				
			||||||
            type = "range",
 | 
					            type = "toggle",
 | 
				
			||||||
            name = L["Border size"],
 | 
					            name = L["Show Inside"],
 | 
				
			||||||
            desc = L["Border size"],
 | 
					            desc = L["Show Highlight border inside of frame"],
 | 
				
			||||||
            order = 3,
 | 
					            order = 3,
 | 
				
			||||||
            min = 1,
 | 
					        }),
 | 
				
			||||||
            max = 10,
 | 
					        group = {
 | 
				
			||||||
            step = 1,
 | 
					            type = "group",
 | 
				
			||||||
 | 
					            childGroups = "tree",
 | 
				
			||||||
 | 
					            name = L["Frame"],
 | 
				
			||||||
 | 
					            order = 3,
 | 
				
			||||||
 | 
					            args = {
 | 
				
			||||||
 | 
					                enabled = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Enabled"],
 | 
				
			||||||
 | 
					                    order = 1,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        headerEnable = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Enabled"],
 | 
				
			||||||
 | 
					                            order = 10,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        highlight = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["Highlight target"],
 | 
				
			||||||
 | 
					                            desc = L["Toggle if the selected target should be highlighted"],
 | 
				
			||||||
 | 
					                            order = 11,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        targetBorder = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["Show border around target"],
 | 
				
			||||||
 | 
					                            desc = L["Toggle if a border should be shown around the selected target"],
 | 
				
			||||||
 | 
					                            order = 12,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        focusBorder = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["Show border around focus"],
 | 
				
			||||||
 | 
					                            desc = L["Toggle of a border should be shown around the current focus"],
 | 
				
			||||||
 | 
					                            order = 13,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                border = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Border"],
 | 
				
			||||||
 | 
					                    order = 2,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        headerHighlight = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Border"],
 | 
				
			||||||
 | 
					                            order = 2,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        highlightBorderSize = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Border size"],
 | 
				
			||||||
 | 
					                            desc = L["Border size"],
 | 
				
			||||||
 | 
					                            order = 4,
 | 
				
			||||||
 | 
					                            min = 1,
 | 
				
			||||||
 | 
					                            max = 20,
 | 
				
			||||||
 | 
					                            step = 1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        highlightBorderStyle = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "select",
 | 
				
			||||||
 | 
					                            name = L["Border style"],
 | 
				
			||||||
 | 
					                            order = 5,
 | 
				
			||||||
 | 
					                            dialogControl = "LSM30_Border",
 | 
				
			||||||
 | 
					                            values = AceGUIWidgetLSMlists.border,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                color = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Color"],
 | 
				
			||||||
 | 
					                    order = 3,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        headerColor = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Colors"],
 | 
				
			||||||
 | 
					                            order = 6,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        targetBorderColor = Gladdy:colorOption({
 | 
				
			||||||
 | 
					                            type = "color",
 | 
				
			||||||
 | 
					                            name = L["Target border color"],
 | 
				
			||||||
 | 
					                            desc = L["Color of the selected targets border"],
 | 
				
			||||||
 | 
					                            order = 7,
 | 
				
			||||||
 | 
					                            hasAlpha = true,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        focusBorderColor = Gladdy:colorOption({
 | 
				
			||||||
 | 
					                            type = "color",
 | 
				
			||||||
 | 
					                            name = L["Focus border color"],
 | 
				
			||||||
 | 
					                            desc = L["Color of the focus border"],
 | 
				
			||||||
 | 
					                            order = 8,
 | 
				
			||||||
 | 
					                            hasAlpha = true,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                frameStrata = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Frame Strata and Level"],
 | 
				
			||||||
 | 
					                    order = 4,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        headerAuraLevel = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Frame Strata and Level"],
 | 
				
			||||||
 | 
					                            order = 1,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        highlightFrameStrata = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "select",
 | 
				
			||||||
 | 
					                            name = L["Frame Strata"],
 | 
				
			||||||
 | 
					                            order = 2,
 | 
				
			||||||
 | 
					                            values = Gladdy.frameStrata,
 | 
				
			||||||
 | 
					                            sorting = Gladdy.frameStrataSorting,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        highlightFrameLevel = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Frame Level"],
 | 
				
			||||||
 | 
					                            min = 1,
 | 
				
			||||||
 | 
					                            max = 500,
 | 
				
			||||||
 | 
					                            step = 1,
 | 
				
			||||||
 | 
					                            order = 3,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        targetBorderColor = Gladdy:colorOption({
 | 
					 | 
				
			||||||
            type = "color",
 | 
					 | 
				
			||||||
            name = L["Target border color"],
 | 
					 | 
				
			||||||
            desc = L["Color of the selected targets border"],
 | 
					 | 
				
			||||||
            order = 4,
 | 
					 | 
				
			||||||
            hasAlpha = true,
 | 
					 | 
				
			||||||
        }),
 | 
					 | 
				
			||||||
        focusBorderColor = Gladdy:colorOption({
 | 
					 | 
				
			||||||
            type = "color",
 | 
					 | 
				
			||||||
            name = L["Focus border color"],
 | 
					 | 
				
			||||||
            desc = L["Color of the focus border"],
 | 
					 | 
				
			||||||
            order = 5,
 | 
					 | 
				
			||||||
            hasAlpha = true,
 | 
					 | 
				
			||||||
        }),
 | 
					 | 
				
			||||||
        leaderBorderColor = Gladdy:colorOption({
 | 
					 | 
				
			||||||
            type = "color",
 | 
					 | 
				
			||||||
            name = L["Raid leader border color"],
 | 
					 | 
				
			||||||
            desc = L["Color of the raid leader border"],
 | 
					 | 
				
			||||||
            order = 6,
 | 
					 | 
				
			||||||
            hasAlpha = true,
 | 
					 | 
				
			||||||
        }),
 | 
					 | 
				
			||||||
        headerEnable = {
 | 
					 | 
				
			||||||
            type = "header",
 | 
					 | 
				
			||||||
            name = L["Enable/Disable"],
 | 
					 | 
				
			||||||
            order = 10,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        highlight = Gladdy:option({
 | 
					 | 
				
			||||||
            type = "toggle",
 | 
					 | 
				
			||||||
            name = L["Highlight target"],
 | 
					 | 
				
			||||||
            desc = L["Toggle if the selected target should be highlighted"],
 | 
					 | 
				
			||||||
            order = 11,
 | 
					 | 
				
			||||||
        }),
 | 
					 | 
				
			||||||
        targetBorder = Gladdy:option({
 | 
					 | 
				
			||||||
            type = "toggle",
 | 
					 | 
				
			||||||
            name = L["Show border around target"],
 | 
					 | 
				
			||||||
            desc = L["Toggle if a border should be shown around the selected target"],
 | 
					 | 
				
			||||||
            order = 12,
 | 
					 | 
				
			||||||
        }),
 | 
					 | 
				
			||||||
        focusBorder = Gladdy:option({
 | 
					 | 
				
			||||||
            type = "toggle",
 | 
					 | 
				
			||||||
            name = L["Show border around focus"],
 | 
					 | 
				
			||||||
            desc = L["Toggle of a border should be shown around the current focus"],
 | 
					 | 
				
			||||||
            order = 13,
 | 
					 | 
				
			||||||
        }),
 | 
					 | 
				
			||||||
        leaderBorder = Gladdy:option({
 | 
					 | 
				
			||||||
            type = "toggle",
 | 
					 | 
				
			||||||
            name = L["Show border around raid leader"],
 | 
					 | 
				
			||||||
            desc = L["Toggle if a border should be shown around the raid leader"],
 | 
					 | 
				
			||||||
            order = 14,
 | 
					 | 
				
			||||||
        }),
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
							
								
								
									
										249
									
								
								Modules/Pets.lua
									
									
									
									
									
								
							
							
						
						
									
										249
									
								
								Modules/Pets.lua
									
									
									
									
									
								
							@@ -1,12 +1,12 @@
 | 
				
			|||||||
local string_gsub, floor, pairs = string.gsub, math.floor, pairs
 | 
					local string_gsub, floor, pairs = string.gsub, math.floor, pairs
 | 
				
			||||||
local CreateFrame = CreateFrame
 | 
					local CreateFrame, SetPortraitTexture = CreateFrame, SetPortraitTexture
 | 
				
			||||||
local UnitHealthMax, UnitHealth, UnitGUID = UnitHealthMax, UnitHealth, UnitGUID
 | 
					local UnitHealthMax, UnitHealth, UnitGUID = UnitHealthMax, UnitHealth, UnitGUID
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local Gladdy = LibStub("Gladdy")
 | 
					local Gladdy = LibStub("Gladdy")
 | 
				
			||||||
local L = Gladdy.L
 | 
					local L = Gladdy.L
 | 
				
			||||||
local Pets = Gladdy:NewModule("Pets", nil, {
 | 
					local Pets = Gladdy:NewModule("Pets", nil, {
 | 
				
			||||||
    petEnabled = true,
 | 
					    petEnabled = true,
 | 
				
			||||||
    petWidth = 100,
 | 
					    petWidth = 128,
 | 
				
			||||||
    petHeight = 20,
 | 
					    petHeight = 20,
 | 
				
			||||||
    petPortraitEnabled = true,
 | 
					    petPortraitEnabled = true,
 | 
				
			||||||
    petPortraitBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp",
 | 
					    petPortraitBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp",
 | 
				
			||||||
@@ -21,26 +21,44 @@ local Pets = Gladdy:NewModule("Pets", nil, {
 | 
				
			|||||||
    petHealthBarFontColor = { r = 1, g = 1, b = 1, a = 1 },
 | 
					    petHealthBarFontColor = { r = 1, g = 1, b = 1, a = 1 },
 | 
				
			||||||
    petHealthBarFontSize = 12,
 | 
					    petHealthBarFontSize = 12,
 | 
				
			||||||
    petHealthPercentage = true,
 | 
					    petHealthPercentage = true,
 | 
				
			||||||
    petXOffset = 50,
 | 
					    petXOffset = 1,
 | 
				
			||||||
    petYOffset = 0,
 | 
					    petYOffset = -62,
 | 
				
			||||||
 | 
					    petGroup = false,
 | 
				
			||||||
 | 
					    petMargin = 1,
 | 
				
			||||||
 | 
					    petFrameStrata = "MEDIUM",
 | 
				
			||||||
 | 
					    petFrameLevel = 5,
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Pets:Initialize()
 | 
					function Pets:Initialize()
 | 
				
			||||||
    self.frames = {}
 | 
					    self.frames = {}
 | 
				
			||||||
    self:RegisterMessage("JOINED_ARENA")
 | 
					    if Gladdy.db.petEnabled then
 | 
				
			||||||
    self:RegisterMessage("PET_SPOTTED")
 | 
					        self:RegisterMessage("JOINED_ARENA")
 | 
				
			||||||
    self:RegisterMessage("PET_DESTROYED")
 | 
					        self:RegisterMessage("PET_SPOTTED")
 | 
				
			||||||
    self:RegisterMessage("PET_STEALTH")
 | 
					        self:RegisterMessage("PET_DESTROYED")
 | 
				
			||||||
    self:RegisterMessage("ENEMY_SPOTTED")
 | 
					        self:RegisterMessage("PET_STEALTH")
 | 
				
			||||||
 | 
					        self:RegisterMessage("ENEMY_SPOTTED")
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Pets:UpdateFrameOnce()
 | 
				
			||||||
 | 
					    if Gladdy.db.petEnabled then
 | 
				
			||||||
 | 
					        self:RegisterMessage("JOINED_ARENA")
 | 
				
			||||||
 | 
					        self:RegisterMessage("PET_SPOTTED")
 | 
				
			||||||
 | 
					        self:RegisterMessage("PET_DESTROYED")
 | 
				
			||||||
 | 
					        self:RegisterMessage("PET_STEALTH")
 | 
				
			||||||
 | 
					        self:RegisterMessage("ENEMY_SPOTTED")
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        self:UnregisterAllMessages()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Pets:JOINED_ARENA()
 | 
					function Pets:JOINED_ARENA()
 | 
				
			||||||
    for k,v in pairs(self.frames) do
 | 
					    for _,v in pairs(self.frames) do
 | 
				
			||||||
        v.healthBar:SetAlpha(0)
 | 
					        v.healthBar:SetAlpha(0)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    if Gladdy.db.petEnabled then
 | 
					    if Gladdy.db.petEnabled then
 | 
				
			||||||
        self:RegisterEvent("UNIT_PET")
 | 
					        self:RegisterEvent("UNIT_PET")
 | 
				
			||||||
        self:SetScript("OnEvent", function(self, event, unitId)
 | 
					        self:SetScript("OnEvent", function(_, event, unitId)
 | 
				
			||||||
            if event == "UNIT_PET" then
 | 
					            if event == "UNIT_PET" then
 | 
				
			||||||
                local unit = Gladdy.guids[UnitGUID(unitId)]
 | 
					                local unit = Gladdy.guids[UnitGUID(unitId)]
 | 
				
			||||||
                if unit then
 | 
					                if unit then
 | 
				
			||||||
@@ -63,9 +81,10 @@ function Pets:ResetUnit(unitId)
 | 
				
			|||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Pets:PET_SPOTTED(unit)
 | 
					function Pets:PET_SPOTTED(unit)
 | 
				
			||||||
 | 
					    Gladdy.guids[UnitGUID(unit)] = unit
 | 
				
			||||||
    if Gladdy.db.petEnabled then
 | 
					    if Gladdy.db.petEnabled then
 | 
				
			||||||
        self.frames[unit].healthBar:SetAlpha(1)
 | 
					        self.frames[unit].healthBar:SetAlpha(1)
 | 
				
			||||||
        self.frames[unit].healthBar.hp:SetStatusBarColor(Gladdy.db.petHealthBarColor.r, Gladdy.db.petHealthBarColor.g, Gladdy.db.petHealthBarColor.b, Gladdy.db.petHealthBarColor.a)
 | 
					        self.frames[unit].healthBar.hp:SetStatusBarColor(Gladdy:SetColor(Gladdy.db.petHealthBarColor))
 | 
				
			||||||
        self.frames[unit].healthBar:SetScript("OnUpdate", function(self)
 | 
					        self.frames[unit].healthBar:SetScript("OnUpdate", function(self)
 | 
				
			||||||
            self.hp:SetValue(UnitHealth(self.unit))
 | 
					            self.hp:SetValue(UnitHealth(self.unit))
 | 
				
			||||||
            Pets:SetHealthText(self, UnitHealth(unit), UnitHealthMax(unit))
 | 
					            Pets:SetHealthText(self, UnitHealth(unit), UnitHealthMax(unit))
 | 
				
			||||||
@@ -124,6 +143,7 @@ function Pets:Test(unitId)
 | 
				
			|||||||
        petFrame.healthBar.hp:SetMinMaxValues(0, 6200)
 | 
					        petFrame.healthBar.hp:SetMinMaxValues(0, 6200)
 | 
				
			||||||
        petFrame.healthBar.hp:SetValue(2000)
 | 
					        petFrame.healthBar.hp:SetValue(2000)
 | 
				
			||||||
        Pets:SetHealthText(petFrame.healthBar, 2000, 6200)
 | 
					        Pets:SetHealthText(petFrame.healthBar, 2000, 6200)
 | 
				
			||||||
 | 
					        SetPortraitTexture(petFrame.healthBar.portrait, "player")
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -133,12 +153,13 @@ function Pets:CreateFrame(unitId)
 | 
				
			|||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    local button = CreateFrame("Frame", "GladdyButtonFramePet" .. unit, Gladdy.frame)
 | 
					    local button = CreateFrame("Frame", "GladdyButtonFramePet" .. unit, Gladdy.frame)
 | 
				
			||||||
 | 
					    button:SetMovable(true)
 | 
				
			||||||
    --button:SetAlpha(0)
 | 
					    --button:SetAlpha(0)
 | 
				
			||||||
    button:SetPoint("LEFT", Gladdy.buttons[unitId].healthBar, "RIGHT", Gladdy.db.petXOffset, Gladdy.db.petYOffset)
 | 
					    button:SetPoint("LEFT", Gladdy.buttons[unitId].healthBar, "RIGHT", Gladdy.db.petXOffset, Gladdy.db.petYOffset)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local secure = CreateFrame("Button", "GladdyButton" .. unit, button, "SecureActionButtonTemplate")
 | 
					    local secure = CreateFrame("Button", "GladdyButton" .. unit, button, "SecureActionButtonTemplate, SecureHandlerEnterLeaveTemplate")
 | 
				
			||||||
    secure:RegisterForClicks("AnyUp")
 | 
					 | 
				
			||||||
    secure:RegisterForClicks("AnyUp")
 | 
					    secure:RegisterForClicks("AnyUp")
 | 
				
			||||||
 | 
					    secure:RegisterForClicks("AnyDown")
 | 
				
			||||||
    secure:SetAttribute("*type1", "target")
 | 
					    secure:SetAttribute("*type1", "target")
 | 
				
			||||||
    secure:SetAttribute("*type2", "focus")
 | 
					    secure:SetAttribute("*type2", "focus")
 | 
				
			||||||
    secure:SetAttribute("unit", unit)
 | 
					    secure:SetAttribute("unit", unit)
 | 
				
			||||||
@@ -148,46 +169,48 @@ function Pets:CreateFrame(unitId)
 | 
				
			|||||||
    button.secure = secure
 | 
					    button.secure = secure
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local healthBar = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate")
 | 
					    local healthBar = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate")
 | 
				
			||||||
    healthBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.petHealthBarBorderStyle),
 | 
					    healthBar:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "petHealthBarBorderStyle"),
 | 
				
			||||||
                            edgeSize = Gladdy.db.petHealthBarBorderSize })
 | 
					                            edgeSize = Gladdy.db.petHealthBarBorderSize })
 | 
				
			||||||
    healthBar:SetBackdropBorderColor(Gladdy.db.petHealthBarBorderColor.r, Gladdy.db.petHealthBarBorderColor.g, Gladdy.db.petHealthBarBorderColor.b, Gladdy.db.petHealthBarBorderColor.a)
 | 
					    healthBar:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.petHealthBarBorderColor))
 | 
				
			||||||
    healthBar:SetFrameLevel(1)
 | 
					    healthBar:SetFrameStrata(Gladdy.db.petFrameStrata)
 | 
				
			||||||
 | 
					    healthBar:SetFrameLevel(Gladdy.db.petFrameLevel)
 | 
				
			||||||
    healthBar:SetAllPoints(button)
 | 
					    healthBar:SetAllPoints(button)
 | 
				
			||||||
    healthBar:SetAlpha(0)
 | 
					    healthBar:SetAlpha(0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    healthBar.portrait = healthBar:CreateTexture(nil, "OVERLAY")
 | 
					    healthBar.portrait = healthBar:CreateTexture(nil, "BACKGROUND")
 | 
				
			||||||
    healthBar.portrait:SetPoint("LEFT", healthBar, "RIGHT")
 | 
					    healthBar.portrait:SetPoint("LEFT", healthBar, "RIGHT")
 | 
				
			||||||
    healthBar.portrait:SetTexCoord(0.1, 0.9, 0.1, 0.9)
 | 
					    healthBar.portrait:SetTexCoord(0.1, 0.9, 0.1, 0.9)
 | 
				
			||||||
    SetPortraitTexture(healthBar.portrait, "player")
 | 
					    SetPortraitTexture(healthBar.portrait, "player")
 | 
				
			||||||
    healthBar.portrait.border = healthBar:CreateTexture(nil, "OVERLAY")
 | 
					    healthBar.portrait.border = healthBar:CreateTexture(nil, "OVERLAY")
 | 
				
			||||||
    healthBar.portrait.border:SetAllPoints(healthBar.portrait)
 | 
					    healthBar.portrait.border:SetAllPoints(healthBar.portrait)
 | 
				
			||||||
    healthBar.portrait.border:SetTexture(Gladdy.db.classIconBorderStyle)
 | 
					    healthBar.portrait.border:SetTexture(Gladdy.db.classIconBorderStyle)
 | 
				
			||||||
    healthBar.portrait.border:SetVertexColor(Gladdy.db.petHealthBarBorderColor.r, Gladdy.db.petHealthBarBorderColor.g, Gladdy.db.petHealthBarBorderColor.b, Gladdy.db.petHealthBarBorderColor.a)
 | 
					    healthBar.portrait.border:SetVertexColor(Gladdy:SetColor(Gladdy.db.petHealthBarBorderColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    healthBar.hp = CreateFrame("StatusBar", nil, healthBar)
 | 
					    healthBar.hp = CreateFrame("StatusBar", nil, healthBar)
 | 
				
			||||||
    healthBar.hp:SetStatusBarTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.petHealthBarTexture))
 | 
					    healthBar.hp:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "petHealthBarTexture"))
 | 
				
			||||||
    healthBar.hp:SetStatusBarColor(Gladdy.db.petHealthBarColor.r, Gladdy.db.petHealthBarColor.g, Gladdy.db.petHealthBarColor.b, Gladdy.db.petHealthBarColor.a)
 | 
					    healthBar.hp:SetStatusBarColor(Gladdy:SetColor(Gladdy.db.petHealthBarColor))
 | 
				
			||||||
    healthBar.hp:SetMinMaxValues(0, 100)
 | 
					    healthBar.hp:SetMinMaxValues(0, 100)
 | 
				
			||||||
    healthBar.hp:SetFrameLevel(0)
 | 
					    healthBar.hp:SetFrameStrata(Gladdy.db.petFrameStrata)
 | 
				
			||||||
 | 
					    healthBar.hp:SetFrameLevel(Gladdy.db.petFrameLevel - 1)
 | 
				
			||||||
    healthBar.hp:SetAllPoints(healthBar)
 | 
					    healthBar.hp:SetAllPoints(healthBar)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    healthBar.bg = healthBar.hp:CreateTexture(nil, "BACKGROUND")
 | 
					    healthBar.bg = healthBar.hp:CreateTexture(nil, "BACKGROUND")
 | 
				
			||||||
    healthBar.bg:SetTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.petHealthBarTexture))
 | 
					    healthBar.bg:SetTexture(Gladdy:SMFetch("statusbar", "petHealthBarTexture"))
 | 
				
			||||||
    healthBar.bg:ClearAllPoints()
 | 
					    healthBar.bg:ClearAllPoints()
 | 
				
			||||||
    healthBar.bg:SetAllPoints(healthBar.hp)
 | 
					    healthBar.bg:SetAllPoints(healthBar.hp)
 | 
				
			||||||
    healthBar.bg:SetAlpha(1)
 | 
					    healthBar.bg:SetAlpha(1)
 | 
				
			||||||
    healthBar.bg:SetVertexColor(Gladdy.db.petHealthBarBgColor.r, Gladdy.db.petHealthBarBgColor.g, Gladdy.db.petHealthBarBgColor.b, Gladdy.db.petHealthBarBgColor.a)
 | 
					    healthBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.petHealthBarBgColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    healthBar.nameText = healthBar:CreateFontString(nil, "LOW", "GameFontNormalSmall")
 | 
					    healthBar.nameText = healthBar:CreateFontString(nil, "LOW", "GameFontNormalSmall")
 | 
				
			||||||
    if (Gladdy.db.petHealthBarFontSize < 1) then
 | 
					    if (Gladdy.db.petHealthBarFontSize < 1) then
 | 
				
			||||||
        healthBar.nameText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.petHealthBarFont), 1)
 | 
					        healthBar.nameText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), 1)
 | 
				
			||||||
        healthBar.nameText:Hide()
 | 
					        healthBar.nameText:Hide()
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        healthBar.nameText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.petHealthBarFont), Gladdy.db.petHealthBarFontSize)
 | 
					        healthBar.nameText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), Gladdy.db.petHealthBarFontSize)
 | 
				
			||||||
        healthBar.nameText:Show()
 | 
					        healthBar.nameText:Show()
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    healthBar.nameText:SetTextColor(Gladdy.db.petHealthBarFontColor.r, Gladdy.db.petHealthBarFontColor.g, Gladdy.db.petHealthBarFontColor.b, Gladdy.db.petHealthBarFontColor.a)
 | 
					    healthBar.nameText:SetTextColor(Gladdy:SetColor(Gladdy.db.petHealthBarFontColor))
 | 
				
			||||||
    healthBar.nameText:SetShadowOffset(1, -1)
 | 
					    healthBar.nameText:SetShadowOffset(1, -1)
 | 
				
			||||||
    healthBar.nameText:SetShadowColor(0, 0, 0, 1)
 | 
					    healthBar.nameText:SetShadowColor(0, 0, 0, 1)
 | 
				
			||||||
    healthBar.nameText:SetJustifyH("CENTER")
 | 
					    healthBar.nameText:SetJustifyH("CENTER")
 | 
				
			||||||
@@ -195,13 +218,13 @@ function Pets:CreateFrame(unitId)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    healthBar.healthText = healthBar:CreateFontString(nil, "LOW")
 | 
					    healthBar.healthText = healthBar:CreateFontString(nil, "LOW")
 | 
				
			||||||
    if (Gladdy.db.petHealthBarFontSize < 1) then
 | 
					    if (Gladdy.db.petHealthBarFontSize < 1) then
 | 
				
			||||||
        healthBar.healthText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.petHealthBarFont), 1)
 | 
					        healthBar.healthText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), 1)
 | 
				
			||||||
        healthBar.healthText:Hide()
 | 
					        healthBar.healthText:Hide()
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        healthBar.healthText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.petHealthBarFont), Gladdy.db.petHealthBarFontSize)
 | 
					        healthBar.healthText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), Gladdy.db.petHealthBarFontSize)
 | 
				
			||||||
        healthBar.healthText:Hide()
 | 
					        healthBar.healthText:Hide()
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    healthBar.healthText:SetTextColor(Gladdy.db.petHealthBarFontColor.r, Gladdy.db.petHealthBarFontColor.g, Gladdy.db.petHealthBarFontColor.b, Gladdy.db.petHealthBarFontColor.a)
 | 
					    healthBar.healthText:SetTextColor(Gladdy:SetColor(Gladdy.db.petHealthBarFontColor))
 | 
				
			||||||
    healthBar.healthText:SetShadowOffset(1, -1)
 | 
					    healthBar.healthText:SetShadowOffset(1, -1)
 | 
				
			||||||
    healthBar.healthText:SetShadowColor(0, 0, 0, 1)
 | 
					    healthBar.healthText:SetShadowColor(0, 0, 0, 1)
 | 
				
			||||||
    healthBar.healthText:SetJustifyH("CENTER")
 | 
					    healthBar.healthText:SetJustifyH("CENTER")
 | 
				
			||||||
@@ -210,7 +233,7 @@ function Pets:CreateFrame(unitId)
 | 
				
			|||||||
    healthBar.unit = unit
 | 
					    healthBar.unit = unit
 | 
				
			||||||
    button.healthBar = healthBar
 | 
					    button.healthBar = healthBar
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    healthBar:RegisterUnitEvent("UNIT_HEALTH", unit)
 | 
					    healthBar:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", unit)
 | 
				
			||||||
    healthBar:RegisterUnitEvent("UNIT_MAXHEALTH", unit)
 | 
					    healthBar:RegisterUnitEvent("UNIT_MAXHEALTH", unit)
 | 
				
			||||||
    healthBar:RegisterUnitEvent("UNIT_PORTRAIT_UPDATE", unit)
 | 
					    healthBar:RegisterUnitEvent("UNIT_PORTRAIT_UPDATE", unit)
 | 
				
			||||||
    healthBar:RegisterUnitEvent("UNIT_NAME_UPDATE", unit)
 | 
					    healthBar:RegisterUnitEvent("UNIT_NAME_UPDATE", unit)
 | 
				
			||||||
@@ -240,6 +263,11 @@ function Pets:UpdateFrame(unitId)
 | 
				
			|||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    healthBar:SetFrameStrata(Gladdy.db.petFrameStrata)
 | 
				
			||||||
 | 
					    healthBar:SetFrameLevel(Gladdy.db.petFrameLevel)
 | 
				
			||||||
 | 
					    healthBar.hp:SetFrameStrata(Gladdy.db.petFrameStrata)
 | 
				
			||||||
 | 
					    healthBar.hp:SetFrameLevel(Gladdy.db.petFrameLevel - 1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if not Gladdy.db.petEnabled then
 | 
					    if not Gladdy.db.petEnabled then
 | 
				
			||||||
        self.frames[unit]:Hide()
 | 
					        self.frames[unit]:Hide()
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
@@ -248,7 +276,22 @@ function Pets:UpdateFrame(unitId)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    self.frames[unit]:SetWidth(Gladdy.db.petWidth)
 | 
					    self.frames[unit]:SetWidth(Gladdy.db.petWidth)
 | 
				
			||||||
    self.frames[unit]:SetHeight(Gladdy.db.petHeight)
 | 
					    self.frames[unit]:SetHeight(Gladdy.db.petHeight)
 | 
				
			||||||
    self.frames[unit]:SetPoint("LEFT", Gladdy.buttons[unitId].healthBar, "RIGHT", Gladdy.db.petXOffset, Gladdy.db.petYOffset)
 | 
					
 | 
				
			||||||
 | 
					    Gladdy:SetPosition(self.frames[unit], unitId, "petXOffset", "petYOffset", Pets:LegacySetPosition(unit, unitId), Pets)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (Gladdy.db.petGroup) then
 | 
				
			||||||
 | 
					        if (unit == "arenapet1") then
 | 
				
			||||||
 | 
					            self.frames[unit]:ClearAllPoints()
 | 
				
			||||||
 | 
					            self.frames[unit]:SetPoint("TOPLEFT", Gladdy.buttons[unitId].healthBar, "TOPLEFT", Gladdy.db.petXOffset, Gladdy.db.petYOffset)
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            local previousPet = "arenapet" .. string_gsub(unit, "arenapet", "") - 1
 | 
				
			||||||
 | 
					            self.frames[unit]:ClearAllPoints()
 | 
				
			||||||
 | 
					            self.frames[unit]:SetPoint("TOPLEFT", self.frames[previousPet], "BOTTOMLEFT", 0, - Gladdy.db.petMargin)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        self.frames[unit]:ClearAllPoints()
 | 
				
			||||||
 | 
					        self.frames[unit]:SetPoint("TOPLEFT", Gladdy.buttons[unitId].healthBar, "TOPLEFT", Gladdy.db.petXOffset, Gladdy.db.petYOffset)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    healthBar.portrait:SetHeight(Gladdy.db.petHeight)
 | 
					    healthBar.portrait:SetHeight(Gladdy.db.petHeight)
 | 
				
			||||||
    healthBar.portrait:SetWidth(Gladdy.db.petHeight)
 | 
					    healthBar.portrait:SetWidth(Gladdy.db.petHeight)
 | 
				
			||||||
@@ -260,34 +303,37 @@ function Pets:UpdateFrame(unitId)
 | 
				
			|||||||
        healthBar.portrait.border:Show()
 | 
					        healthBar.portrait.border:Show()
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    healthBar.portrait.border:SetTexture(Gladdy.db.petPortraitBorderStyle)
 | 
					    healthBar.portrait.border:SetTexture(Gladdy.db.petPortraitBorderStyle)
 | 
				
			||||||
    healthBar.portrait.border:SetVertexColor(Gladdy.db.petHealthBarBorderColor.r, Gladdy.db.petHealthBarBorderColor.g, Gladdy.db.petHealthBarBorderColor.b, Gladdy.db.petHealthBarBorderColor.a)
 | 
					    healthBar.portrait.border:SetVertexColor(Gladdy:SetColor(Gladdy.db.petHealthBarBorderColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    healthBar.bg:SetTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.petHealthBarTexture))
 | 
					    healthBar.bg:SetTexture(Gladdy:SMFetch("statusbar",  "petHealthBarTexture"))
 | 
				
			||||||
    healthBar.bg:SetVertexColor(Gladdy.db.petHealthBarBgColor.r, Gladdy.db.petHealthBarBgColor.g, Gladdy.db.petHealthBarBgColor.b, Gladdy.db.petHealthBarBgColor.a)
 | 
					    healthBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.petHealthBarBgColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    healthBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.petHealthBarBorderStyle),
 | 
					    healthBar:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "petHealthBarBorderStyle"),
 | 
				
			||||||
                            edgeSize = Gladdy.db.petHealthBarBorderSize })
 | 
					                            edgeSize = Gladdy.db.petHealthBarBorderSize })
 | 
				
			||||||
    healthBar:SetBackdropBorderColor(Gladdy.db.petHealthBarBorderColor.r, Gladdy.db.petHealthBarBorderColor.g, Gladdy.db.petHealthBarBorderColor.b, Gladdy.db.petHealthBarBorderColor.a)
 | 
					    healthBar:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.petHealthBarBorderColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    healthBar.hp:SetStatusBarTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.petHealthBarTexture))
 | 
					    healthBar.hp:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "petHealthBarTexture"))
 | 
				
			||||||
    healthBar.hp:SetStatusBarColor(Gladdy.db.petHealthBarColor.r, Gladdy.db.petHealthBarColor.g, Gladdy.db.petHealthBarColor.b, Gladdy.db.petHealthBarColor.a)
 | 
					    healthBar.hp:SetStatusBarColor(Gladdy:SetColor(Gladdy.db.petHealthBarColor))
 | 
				
			||||||
    healthBar.hp:ClearAllPoints()
 | 
					    healthBar.hp:ClearAllPoints()
 | 
				
			||||||
    healthBar.hp:SetPoint("TOPLEFT", healthBar, "TOPLEFT", (Gladdy.db.petHealthBarBorderSize/Gladdy.db.statusbarBorderOffset), -(Gladdy.db.petHealthBarBorderSize/Gladdy.db.statusbarBorderOffset))
 | 
					    healthBar.hp:SetPoint("TOPLEFT", healthBar, "TOPLEFT", (Gladdy.db.petHealthBarBorderSize/Gladdy.db.statusbarBorderOffset), -(Gladdy.db.petHealthBarBorderSize/Gladdy.db.statusbarBorderOffset))
 | 
				
			||||||
    healthBar.hp:SetPoint("BOTTOMRIGHT", healthBar, "BOTTOMRIGHT", -(Gladdy.db.petHealthBarBorderSize/Gladdy.db.statusbarBorderOffset), (Gladdy.db.petHealthBarBorderSize/Gladdy.db.statusbarBorderOffset))
 | 
					    healthBar.hp:SetPoint("BOTTOMRIGHT", healthBar, "BOTTOMRIGHT", -(Gladdy.db.petHealthBarBorderSize/Gladdy.db.statusbarBorderOffset), (Gladdy.db.petHealthBarBorderSize/Gladdy.db.statusbarBorderOffset))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (Gladdy.db.petHealthBarFontSize < 1) then
 | 
					    if (Gladdy.db.petHealthBarFontSize < 1) then
 | 
				
			||||||
        healthBar.nameText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.petHealthBarFont), 1)
 | 
					        healthBar.nameText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), 1)
 | 
				
			||||||
        healthBar.healthText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.petHealthBarFont), 1)
 | 
					        healthBar.healthText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), 1)
 | 
				
			||||||
        healthBar.nameText:Hide()
 | 
					        healthBar.nameText:Hide()
 | 
				
			||||||
        healthBar.healthText:Hide()
 | 
					        healthBar.healthText:Hide()
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        healthBar.nameText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.petHealthBarFont), Gladdy.db.petHealthBarFontSize)
 | 
					        healthBar.nameText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), Gladdy.db.petHealthBarFontSize)
 | 
				
			||||||
        healthBar.nameText:Show()
 | 
					        healthBar.nameText:Show()
 | 
				
			||||||
        healthBar.healthText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.petHealthBarFont), Gladdy.db.petHealthBarFontSize)
 | 
					        healthBar.healthText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), Gladdy.db.petHealthBarFontSize)
 | 
				
			||||||
        healthBar.healthText:Show()
 | 
					        healthBar.healthText:Show()
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    healthBar.nameText:SetTextColor(Gladdy.db.petHealthBarFontColor.r, Gladdy.db.petHealthBarFontColor.g, Gladdy.db.petHealthBarFontColor.b, Gladdy.db.petHealthBarFontColor.a)
 | 
					    healthBar.nameText:SetTextColor(Gladdy:SetColor(Gladdy.db.petHealthBarFontColor))
 | 
				
			||||||
    healthBar.healthText:SetTextColor(Gladdy.db.petHealthBarFontColor.r, Gladdy.db.petHealthBarFontColor.g, Gladdy.db.petHealthBarFontColor.b, Gladdy.db.petHealthBarFontColor.a)
 | 
					    healthBar.healthText:SetTextColor(Gladdy:SetColor(Gladdy.db.petHealthBarFontColor))
 | 
				
			||||||
 | 
					    if (unit == "arenapet1") then
 | 
				
			||||||
 | 
					        Gladdy:CreateMover(self.frames[unit], "petXOffset", "petYOffset", L["Pets"], {"TOPLEFT", "TOPLEFT"})
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Pets:SetHealthText(healthBar, health, healthMax)
 | 
					function Pets:SetHealthText(healthBar, health, healthMax)
 | 
				
			||||||
@@ -332,22 +378,28 @@ end
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
function Pets:GetOptions()
 | 
					function Pets:GetOptions()
 | 
				
			||||||
    return {
 | 
					    return {
 | 
				
			||||||
        headerHealthbar = {
 | 
					        header = {
 | 
				
			||||||
            type = "header",
 | 
					            type = "header",
 | 
				
			||||||
            name = L["Health Bar"],
 | 
					            name = L["Pets"],
 | 
				
			||||||
            order = 2,
 | 
					            order = 2,
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        petEnabled = Gladdy:option({
 | 
					        petEnabled = Gladdy:option({
 | 
				
			||||||
            type = "toggle",
 | 
					            type = "toggle",
 | 
				
			||||||
            name = L["Enable"],
 | 
					            name = L["Enabled"],
 | 
				
			||||||
            desc = L["Enabled Pets module"],
 | 
					            desc = L["Enables Pets module"],
 | 
				
			||||||
            order = 3,
 | 
					            order = 3,
 | 
				
			||||||
        }),
 | 
					        }),
 | 
				
			||||||
 | 
					        petGroup = option({
 | 
				
			||||||
 | 
					            type = "toggle",
 | 
				
			||||||
 | 
					            name = L["Group Pets"],
 | 
				
			||||||
 | 
					            order = 4,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
        group = {
 | 
					        group = {
 | 
				
			||||||
            type = "group",
 | 
					            type = "group",
 | 
				
			||||||
            childGroups = "tree",
 | 
					            childGroups = "tree",
 | 
				
			||||||
            name = "Frame",
 | 
					            name = L["Frame"],
 | 
				
			||||||
            order = 3,
 | 
					            order = 3,
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.petEnabled end,
 | 
				
			||||||
            args = {
 | 
					            args = {
 | 
				
			||||||
                general = {
 | 
					                general = {
 | 
				
			||||||
                    type = "group",
 | 
					                    type = "group",
 | 
				
			||||||
@@ -367,6 +419,7 @@ function Pets:GetOptions()
 | 
				
			|||||||
                            min = 10,
 | 
					                            min = 10,
 | 
				
			||||||
                            max = 100,
 | 
					                            max = 100,
 | 
				
			||||||
                            step = 1,
 | 
					                            step = 1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        petWidth = option({
 | 
					                        petWidth = option({
 | 
				
			||||||
                            type = "range",
 | 
					                            type = "range",
 | 
				
			||||||
@@ -374,14 +427,27 @@ function Pets:GetOptions()
 | 
				
			|||||||
                            desc = L["Width of the bar"],
 | 
					                            desc = L["Width of the bar"],
 | 
				
			||||||
                            order = 4,
 | 
					                            order = 4,
 | 
				
			||||||
                            min = 10,
 | 
					                            min = 10,
 | 
				
			||||||
                            max = 100,
 | 
					                            max = 300,
 | 
				
			||||||
                            step = 1,
 | 
					                            step = 1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        petMargin = option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Margin"],
 | 
				
			||||||
 | 
					                            desc = L["Height of the bar"],
 | 
				
			||||||
 | 
					                            order = 6,
 | 
				
			||||||
 | 
					                            disabled = function()
 | 
				
			||||||
 | 
					                                return not Gladdy.db.petGroup
 | 
				
			||||||
 | 
					                            end,
 | 
				
			||||||
 | 
					                            min = 0,
 | 
				
			||||||
 | 
					                            max = 50,
 | 
				
			||||||
 | 
					                            step = .1,
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        petHealthBarTexture = option({
 | 
					                        petHealthBarTexture = option({
 | 
				
			||||||
                            type = "select",
 | 
					                            type = "select",
 | 
				
			||||||
                            name = L["Bar texture"],
 | 
					                            name = L["Bar texture"],
 | 
				
			||||||
                            desc = L["Texture of the bar"],
 | 
					                            desc = L["Texture of the bar"],
 | 
				
			||||||
                            order = 5,
 | 
					                            order = 7,
 | 
				
			||||||
                            dialogControl = "LSM30_Statusbar",
 | 
					                            dialogControl = "LSM30_Statusbar",
 | 
				
			||||||
                            values = AceGUIWidgetLSMlists.statusbar,
 | 
					                            values = AceGUIWidgetLSMlists.statusbar,
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
@@ -389,14 +455,14 @@ function Pets:GetOptions()
 | 
				
			|||||||
                            type = "color",
 | 
					                            type = "color",
 | 
				
			||||||
                            name = L["Health color"],
 | 
					                            name = L["Health color"],
 | 
				
			||||||
                            desc = L["Color of the status bar"],
 | 
					                            desc = L["Color of the status bar"],
 | 
				
			||||||
                            order = 6,
 | 
					                            order = 8,
 | 
				
			||||||
                            hasAlpha = true,
 | 
					                            hasAlpha = true,
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        petHealthBarBgColor = Gladdy:colorOption({
 | 
					                        petHealthBarBgColor = Gladdy:colorOption({
 | 
				
			||||||
                            type = "color",
 | 
					                            type = "color",
 | 
				
			||||||
                            name = L["Background color"],
 | 
					                            name = L["Background color"],
 | 
				
			||||||
                            desc = L["Color of the status bar background"],
 | 
					                            desc = L["Color of the status bar background"],
 | 
				
			||||||
                            order = 7,
 | 
					                            order = 9,
 | 
				
			||||||
                            hasAlpha = true,
 | 
					                            hasAlpha = true,
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
@@ -457,6 +523,7 @@ function Pets:GetOptions()
 | 
				
			|||||||
                            order = 13,
 | 
					                            order = 13,
 | 
				
			||||||
                            min = 0,
 | 
					                            min = 0,
 | 
				
			||||||
                            max = 20,
 | 
					                            max = 20,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
@@ -485,6 +552,7 @@ function Pets:GetOptions()
 | 
				
			|||||||
                            min = 0.5,
 | 
					                            min = 0.5,
 | 
				
			||||||
                            max = Gladdy.db.petHeight/2,
 | 
					                            max = Gladdy.db.petHeight/2,
 | 
				
			||||||
                            step = 0.5,
 | 
					                            step = 0.5,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        petHealthBarBorderColor = Gladdy:colorOption({
 | 
					                        petHealthBarBorderColor = Gladdy:colorOption({
 | 
				
			||||||
                            type = "color",
 | 
					                            type = "color",
 | 
				
			||||||
@@ -500,28 +568,64 @@ function Pets:GetOptions()
 | 
				
			|||||||
                    name = L["Position"],
 | 
					                    name = L["Position"],
 | 
				
			||||||
                    order = 5,
 | 
					                    order = 5,
 | 
				
			||||||
                    args = {
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        header = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Position"],
 | 
				
			||||||
 | 
					                            order = 1,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
                        petXOffset = Gladdy:option({
 | 
					                        petXOffset = Gladdy:option({
 | 
				
			||||||
                            type = "range",
 | 
					                            type = "range",
 | 
				
			||||||
                            name = L["Horizontal offset"],
 | 
					                            name = L["Horizontal offset"],
 | 
				
			||||||
                            order = 22,
 | 
					                            order = 22,
 | 
				
			||||||
                            min = -400,
 | 
					                            min = -600,
 | 
				
			||||||
                            max = 400,
 | 
					                            max = 600,
 | 
				
			||||||
                            step = 0.1,
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        petYOffset = Gladdy:option({
 | 
					                        petYOffset = Gladdy:option({
 | 
				
			||||||
                            type = "range",
 | 
					                            type = "range",
 | 
				
			||||||
                            name = L["Vertical offset"],
 | 
					                            name = L["Vertical offset"],
 | 
				
			||||||
                            order = 23,
 | 
					                            order = 23,
 | 
				
			||||||
                            min = -400,
 | 
					                            min = -600,
 | 
				
			||||||
                            max = 400,
 | 
					                            max = 600,
 | 
				
			||||||
                            step = 0.1,
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
 | 
					                frameStrata = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Frame Strata and Level"],
 | 
				
			||||||
 | 
					                    order = 6,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        headerAuraLevel = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Frame Strata and Level"],
 | 
				
			||||||
 | 
					                            order = 1,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        petFrameStrata = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "select",
 | 
				
			||||||
 | 
					                            name = L["Frame Strata"],
 | 
				
			||||||
 | 
					                            order = 2,
 | 
				
			||||||
 | 
					                            values = Gladdy.frameStrata,
 | 
				
			||||||
 | 
					                            sorting = Gladdy.frameStrataSorting,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        petFrameLevel = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Frame Level"],
 | 
				
			||||||
 | 
					                            min = 1,
 | 
				
			||||||
 | 
					                            max = 500,
 | 
				
			||||||
 | 
					                            step = 1,
 | 
				
			||||||
 | 
					                            order = 3,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
                healthValues = {
 | 
					                healthValues = {
 | 
				
			||||||
                    type = "group",
 | 
					                    type = "group",
 | 
				
			||||||
                    name = L["Health Values"],
 | 
					                    name = L["Health Values"],
 | 
				
			||||||
                    order = 6,
 | 
					                    order = 7,
 | 
				
			||||||
                    args = {
 | 
					                    args = {
 | 
				
			||||||
                        header = {
 | 
					                        header = {
 | 
				
			||||||
                            type = "header",
 | 
					                            type = "header",
 | 
				
			||||||
@@ -539,4 +643,31 @@ function Pets:GetOptions()
 | 
				
			|||||||
            },
 | 
					            },
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- LAGACY HANDLER
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Pets:LegacySetPosition(unit, unitId)
 | 
				
			||||||
 | 
					    if Gladdy.db.newLayout then
 | 
				
			||||||
 | 
					        return Gladdy.db.newLayout
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    self.frames[unit]:ClearAllPoints()
 | 
				
			||||||
 | 
					    self.frames[unit]:SetPoint("LEFT", Gladdy.buttons[unitId].healthBar, "RIGHT", Gladdy.db.petXOffset, Gladdy.db.petYOffset)
 | 
				
			||||||
 | 
					    if (Gladdy.db.petGroup) then
 | 
				
			||||||
 | 
					        if (unit == "arenapet1") then
 | 
				
			||||||
 | 
					            self.frames[unit]:SetPoint("LEFT", Gladdy.buttons[unitId].healthBar, "RIGHT", Gladdy.db.petXOffset, Gladdy.db.petYOffset)
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            local previousPet = "arenapet" .. string_gsub(unit, "arenapet", "") - 1
 | 
				
			||||||
 | 
					            self.frames[unit]:ClearAllPoints()
 | 
				
			||||||
 | 
					            self.frames[unit]:SetPoint("TOPLEFT", self.frames[previousPet], "BOTTOMLEFT", 0, - Gladdy.db.petMargin)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        self.frames[unit]:ClearAllPoints()
 | 
				
			||||||
 | 
					        self.frames[unit]:SetPoint("LEFT", Gladdy.buttons[unitId].healthBar, "RIGHT", Gladdy.db.petXOffset, Gladdy.db.petYOffset)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    return Gladdy.db.newLayout
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
@@ -6,7 +6,8 @@ local CreateFrame, UnitPower, UnitPowerType, UnitPowerMax, UnitExists = CreateFr
 | 
				
			|||||||
local Gladdy = LibStub("Gladdy")
 | 
					local Gladdy = LibStub("Gladdy")
 | 
				
			||||||
local L = Gladdy.L
 | 
					local L = Gladdy.L
 | 
				
			||||||
local AceGUIWidgetLSMlists = AceGUIWidgetLSMlists
 | 
					local AceGUIWidgetLSMlists = AceGUIWidgetLSMlists
 | 
				
			||||||
local Powerbar = Gladdy:NewModule("Powerbar", 90, {
 | 
					local Powerbar = Gladdy:NewModule("Power Bar", 90, {
 | 
				
			||||||
 | 
					    powerBarEnabled = true,
 | 
				
			||||||
    powerBarFont = "DorisPP",
 | 
					    powerBarFont = "DorisPP",
 | 
				
			||||||
    powerBarHeight = 20,
 | 
					    powerBarHeight = 20,
 | 
				
			||||||
    powerBarTexture = "Smooth",
 | 
					    powerBarTexture = "Smooth",
 | 
				
			||||||
@@ -15,124 +16,120 @@ local Powerbar = Gladdy:NewModule("Powerbar", 90, {
 | 
				
			|||||||
    powerBarBorderColor = { r = 0, g = 0, b = 0, a = 1 },
 | 
					    powerBarBorderColor = { r = 0, g = 0, b = 0, a = 1 },
 | 
				
			||||||
    powerBarFontColor = { r = 1, g = 1, b = 1, a = 1 },
 | 
					    powerBarFontColor = { r = 1, g = 1, b = 1, a = 1 },
 | 
				
			||||||
    powerBarBgColor = { r = 0.3, g = 0.3, b = 0.3, a = 0.7 },
 | 
					    powerBarBgColor = { r = 0.3, g = 0.3, b = 0.3, a = 0.7 },
 | 
				
			||||||
    powerBarFontSize = 10,
 | 
					    powerBarRaceFontSize = 10,
 | 
				
			||||||
 | 
					    powerBarPowerFontSize = 10,
 | 
				
			||||||
 | 
					    powerShowSpec = true,
 | 
				
			||||||
 | 
					    powerShowRace = true,
 | 
				
			||||||
    powerActual = true,
 | 
					    powerActual = true,
 | 
				
			||||||
    powerMax = true,
 | 
					    powerMax = true,
 | 
				
			||||||
    powerPercentage = false,
 | 
					    powerPercentage = false,
 | 
				
			||||||
 | 
					    powerFrameStrata = "MEDIUM",
 | 
				
			||||||
 | 
					    powerFrameLevel = 1,
 | 
				
			||||||
 | 
					    powerCustomTagsEnabled = false,
 | 
				
			||||||
 | 
					    powerTextLeft = "[spec] [race]",
 | 
				
			||||||
 | 
					    powerTextRight = "[current]/[max]",
 | 
				
			||||||
 | 
					    powerTextLeftOutline = false,
 | 
				
			||||||
 | 
					    powerTextRightOutline = false,
 | 
				
			||||||
 | 
					    powerTextLeftVOffset = 1,
 | 
				
			||||||
 | 
					    powerTextLeftHOffset = 5,
 | 
				
			||||||
 | 
					    powerTextRightVOffset = 1,
 | 
				
			||||||
 | 
					    powerTextRightHOffset = -5,
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Powerbar:Initialize()
 | 
					function Powerbar:Initialize()
 | 
				
			||||||
    self.frames = {}
 | 
					    self.frames = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    self:RegisterMessage("ENEMY_SPOTTED")
 | 
					    if Gladdy.db.powerBarEnabled then
 | 
				
			||||||
    self:RegisterMessage("UNIT_SPEC")
 | 
					        self:RegisterMessage("ENEMY_SPOTTED")
 | 
				
			||||||
    self:RegisterMessage("UNIT_DEATH")
 | 
					        self:RegisterMessage("UNIT_SPEC")
 | 
				
			||||||
 | 
					        self:RegisterMessage("UNIT_DEATH")
 | 
				
			||||||
 | 
					        self:RegisterMessage("UNIT_DESTROYED")
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Powerbar:UpdateFrameOnce()
 | 
				
			||||||
 | 
					    if Gladdy.db.powerBarEnabled then
 | 
				
			||||||
 | 
					        self:RegisterMessage("ENEMY_SPOTTED")
 | 
				
			||||||
 | 
					        self:RegisterMessage("UNIT_SPEC")
 | 
				
			||||||
 | 
					        self:RegisterMessage("UNIT_DEATH")
 | 
				
			||||||
 | 
					        self:RegisterMessage("UNIT_DESTROYED")
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        self:UnregisterAllMessages()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Powerbar:CreateFrame(unit)
 | 
					function Powerbar:CreateFrame(unit)
 | 
				
			||||||
    local button = Gladdy.buttons[unit]
 | 
					    local button = Gladdy.buttons[unit]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local powerBar = CreateFrame("Frame", nil, Gladdy.buttons[unit], BackdropTemplateMixin and "BackdropTemplate")
 | 
					    local powerBar = CreateFrame("Frame", nil, Gladdy.buttons[unit], BackdropTemplateMixin and "BackdropTemplate")
 | 
				
			||||||
    powerBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.powerBarBorderStyle),
 | 
					    powerBar:EnableMouse(false)
 | 
				
			||||||
 | 
					    powerBar:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "powerBarBorderStyle"),
 | 
				
			||||||
                                  edgeSize = Gladdy.db.powerBarBorderSize })
 | 
					                                  edgeSize = Gladdy.db.powerBarBorderSize })
 | 
				
			||||||
    powerBar:SetBackdropBorderColor(Gladdy.db.powerBarBorderColor.r, Gladdy.db.powerBarBorderColor.g, Gladdy.db.powerBarBorderColor.b, Gladdy.db.powerBarBorderColor.a)
 | 
					    powerBar:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.powerBarBorderColor))
 | 
				
			||||||
    powerBar:SetFrameLevel(1)
 | 
					    powerBar:SetFrameStrata(Gladdy.db.powerFrameStrata)
 | 
				
			||||||
 | 
					    powerBar:SetFrameLevel(Gladdy.db.powerFrameLevel)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    powerBar.energy = CreateFrame("StatusBar", nil, powerBar)
 | 
					    powerBar.energy = CreateFrame("StatusBar", nil, powerBar)
 | 
				
			||||||
    powerBar.energy:SetStatusBarTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.powerBarTexture))
 | 
					    powerBar.energy:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "powerBarTexture"))
 | 
				
			||||||
    powerBar.energy:SetMinMaxValues(0, 100)
 | 
					    powerBar.energy:SetMinMaxValues(0, 100)
 | 
				
			||||||
    powerBar.energy:SetFrameLevel(0)
 | 
					    powerBar.energy:SetFrameStrata(Gladdy.db.powerFrameStrata)
 | 
				
			||||||
 | 
					    powerBar.energy:SetFrameLevel(Gladdy.db.powerFrameLevel - 1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    powerBar.bg = powerBar.energy:CreateTexture(nil, "BACKGROUND")
 | 
					    powerBar.bg = powerBar.energy:CreateTexture(nil, "BACKGROUND")
 | 
				
			||||||
    powerBar.bg:SetTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.powerBarTexture))
 | 
					    powerBar.bg:SetTexture(Gladdy:SMFetch("statusbar", "powerBarTexture"))
 | 
				
			||||||
    powerBar.bg:ClearAllPoints()
 | 
					    powerBar.bg:ClearAllPoints()
 | 
				
			||||||
    powerBar.bg:SetAllPoints(powerBar.energy)
 | 
					    powerBar.bg:SetAllPoints(powerBar.energy)
 | 
				
			||||||
    powerBar.bg:SetVertexColor(Gladdy.db.powerBarBgColor.r, Gladdy.db.powerBarBgColor.g, Gladdy.db.powerBarBgColor.b, Gladdy.db.powerBarBgColor.a)
 | 
					    powerBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.powerBarBgColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    powerBar.raceText = powerBar:CreateFontString(nil, "LOW")
 | 
					    powerBar.raceText = powerBar:CreateFontString(nil, "LOW")
 | 
				
			||||||
    powerBar.raceText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.powerBarFont), Gladdy.db.powerBarFontSize)
 | 
					    powerBar.raceText:SetFont(Gladdy:SMFetch("font", "powerBarFont"), Gladdy.db.powerBarRaceFontSize, Gladdy.db.powerTextLeftOutline and "OUTLINE")
 | 
				
			||||||
    powerBar.raceText:SetTextColor(Gladdy.db.powerBarFontColor.r, Gladdy.db.powerBarFontColor.g, Gladdy.db.powerBarFontColor.b, Gladdy.db.powerBarFontColor.a)
 | 
					    powerBar.raceText:SetTextColor(Gladdy:SetColor(Gladdy.db.powerBarFontColor))
 | 
				
			||||||
    powerBar.raceText:SetShadowOffset(1, -1)
 | 
					    powerBar.raceText:SetShadowOffset(1, -1)
 | 
				
			||||||
    powerBar.raceText:SetShadowColor(0, 0, 0, 1)
 | 
					    powerBar.raceText:SetShadowColor(0, 0, 0, 1)
 | 
				
			||||||
    powerBar.raceText:SetJustifyH("CENTER")
 | 
					    powerBar.raceText:SetJustifyH("CENTER")
 | 
				
			||||||
    powerBar.raceText:SetPoint("LEFT", 5, 1)
 | 
					    powerBar.raceText:SetPoint("LEFT", Gladdy.db.powerTextLeftHOffset, Gladdy.db.powerTextLeftVOffset)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    powerBar.powerText = powerBar:CreateFontString(nil, "LOW")
 | 
					    powerBar.powerText = powerBar:CreateFontString(nil, "LOW")
 | 
				
			||||||
    powerBar.powerText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.powerBarFont), Gladdy.db.powerBarFontSize)
 | 
					    powerBar.powerText:SetFont(Gladdy:SMFetch("font", "powerBarFont"), Gladdy.db.powerBarPowerFontSize, Gladdy.db.powerTextRightOutline and "OUTLINE")
 | 
				
			||||||
    powerBar.powerText:SetTextColor(Gladdy.db.powerBarFontColor.r, Gladdy.db.powerBarFontColor.g, Gladdy.db.powerBarFontColor.b, Gladdy.db.powerBarFontColor.a)
 | 
					    powerBar.powerText:SetTextColor(Gladdy:SetColor(Gladdy.db.powerBarFontColor))
 | 
				
			||||||
    powerBar.powerText:SetShadowOffset(1, -1)
 | 
					    powerBar.powerText:SetShadowOffset(1, -1)
 | 
				
			||||||
    powerBar.powerText:SetShadowColor(0, 0, 0, 1)
 | 
					    powerBar.powerText:SetShadowColor(0, 0, 0, 1)
 | 
				
			||||||
    powerBar.powerText:SetJustifyH("CENTER")
 | 
					    powerBar.powerText:SetJustifyH("CENTER")
 | 
				
			||||||
    powerBar.powerText:SetPoint("RIGHT", -5, 1)
 | 
					    powerBar.powerText:SetPoint("RIGHT", Gladdy.db.powerTextRightHOffset, Gladdy.db.powerTextRightVOffset)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    button.powerBar = powerBar
 | 
					    button.powerBar = powerBar
 | 
				
			||||||
    self.frames[unit] = powerBar
 | 
					    self.frames[unit] = powerBar
 | 
				
			||||||
    self:ResetUnit(unit)
 | 
					    self:ResetUnit(unit)
 | 
				
			||||||
 | 
					    powerBar.unit = unit
 | 
				
			||||||
    powerBar:RegisterUnitEvent("UNIT_POWER_UPDATE", unit)
 | 
					    powerBar:RegisterUnitEvent("UNIT_POWER_UPDATE", unit)
 | 
				
			||||||
    powerBar:RegisterUnitEvent("UNIT_MAXPOWER", unit)
 | 
					    powerBar:RegisterUnitEvent("UNIT_MAXPOWER", unit)
 | 
				
			||||||
    powerBar:RegisterUnitEvent("UNIT_DISPLAYPOWER", unit)
 | 
					    powerBar:RegisterUnitEvent("UNIT_DISPLAYPOWER", unit)
 | 
				
			||||||
    powerBar:SetScript("OnEvent", Powerbar.OnEvent)
 | 
					    powerBar:SetScript("OnEvent", Powerbar.OnEvent)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Powerbar.OnEvent(powerBar, event, unit)
 | 
					 | 
				
			||||||
    if event == "UNIT_POWER_UPDATE" then
 | 
					 | 
				
			||||||
        Powerbar:SetPower(powerBar, UnitPower(unit, UnitPowerType(unit), true), UnitPowerMax(unit, UnitPowerType(unit), true), UnitPowerType(unit))
 | 
					 | 
				
			||||||
    elseif event == "UNIT_MAXPOWER" then
 | 
					 | 
				
			||||||
        Powerbar:SetPower(powerBar, UnitPower(unit, UnitPowerType(unit), true), UnitPowerMax(unit, UnitPowerType(unit), true), UnitPowerType(unit))
 | 
					 | 
				
			||||||
    elseif event == "UNIT_DISPLAYPOWER" then
 | 
					 | 
				
			||||||
        Powerbar:SetPower(powerBar, UnitPower(unit, UnitPowerType(unit), true), UnitPowerMax(unit, UnitPowerType(unit), true), UnitPowerType(unit))
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
function Powerbar:SetPower(powerBar, power, powerMax, powerType)
 | 
					 | 
				
			||||||
    local powerPercentage = floor(power * 100 / powerMax)
 | 
					 | 
				
			||||||
    local powerText
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (Gladdy.db.powerActual) then
 | 
					 | 
				
			||||||
        powerText = powerMax > 999 and ("%.1fk"):format(power / 1000) or power
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (Gladdy.db.powerMax) then
 | 
					 | 
				
			||||||
        local text = powerMax > 999 and ("%.1fk"):format(powerMax / 1000) or powerMax
 | 
					 | 
				
			||||||
        if (powerText) then
 | 
					 | 
				
			||||||
            powerText = ("%s/%s"):format(powerText, text)
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
            powerText = text
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (Gladdy.db.powerPercentage) then
 | 
					 | 
				
			||||||
        if (powerText) then
 | 
					 | 
				
			||||||
            powerText = ("%s (%d%%)"):format(powerText, powerPercentage)
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
            powerText = ("%d%%"):format(powerPercentage)
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (powerType == 1) then
 | 
					 | 
				
			||||||
        powerBar.energy:SetStatusBarColor(1, 0, 0, 1)
 | 
					 | 
				
			||||||
    elseif (powerType == 3) then
 | 
					 | 
				
			||||||
        powerBar.energy:SetStatusBarColor(1, 1, 0, 1)
 | 
					 | 
				
			||||||
    else
 | 
					 | 
				
			||||||
        powerBar.energy:SetStatusBarColor(.18, .44, .75, 1)
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    powerBar.powerText:SetText(powerText)
 | 
					 | 
				
			||||||
    powerBar.energy:SetMinMaxValues(0, powerMax)
 | 
					 | 
				
			||||||
    powerBar.energy:SetValue(power)
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
function Powerbar:UpdateFrame(unit)
 | 
					function Powerbar:UpdateFrame(unit)
 | 
				
			||||||
    local powerBar = self.frames[unit]
 | 
					    local powerBar = self.frames[unit]
 | 
				
			||||||
    if (not powerBar) then
 | 
					    if (not powerBar) then
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					    local healthBar = Gladdy.modules["Health Bar"].frames[unit]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local healthBar = Gladdy.modules.Healthbar.frames[unit]
 | 
					    if not Gladdy.db.powerBarEnabled then
 | 
				
			||||||
 | 
					        powerBar:Hide()
 | 
				
			||||||
 | 
					        powerBar:UnregisterEvent("UNIT_POWER_UPDATE")
 | 
				
			||||||
    powerBar.bg:SetTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.powerBarTexture))
 | 
					        powerBar:UnregisterEvent("UNIT_MAXPOWER")
 | 
				
			||||||
    powerBar.bg:SetVertexColor(Gladdy.db.powerBarBgColor.r, Gladdy.db.powerBarBgColor.g, Gladdy.db.powerBarBgColor.b, Gladdy.db.powerBarBgColor.a)
 | 
					        powerBar:UnregisterEvent("UNIT_DISPLAYPOWER")
 | 
				
			||||||
 | 
					        powerBar:SetScript("OnEvent", nil)
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        powerBar:RegisterUnitEvent("UNIT_POWER_UPDATE", unit)
 | 
				
			||||||
 | 
					        powerBar:RegisterUnitEvent("UNIT_MAXPOWER", unit)
 | 
				
			||||||
 | 
					        powerBar:RegisterUnitEvent("UNIT_DISPLAYPOWER", unit)
 | 
				
			||||||
 | 
					        powerBar:SetScript("OnEvent", Powerbar.OnEvent)
 | 
				
			||||||
 | 
					        powerBar:Show()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    powerBar.bg:SetTexture(Gladdy:SMFetch("statusbar", "powerBarTexture"))
 | 
				
			||||||
 | 
					    powerBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.powerBarBgColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    powerBar:SetWidth(healthBar:GetWidth())
 | 
					    powerBar:SetWidth(healthBar:GetWidth())
 | 
				
			||||||
    powerBar:SetHeight(Gladdy.db.powerBarHeight)
 | 
					    powerBar:SetHeight(Gladdy.db.powerBarHeight)
 | 
				
			||||||
@@ -140,19 +137,100 @@ function Powerbar:UpdateFrame(unit)
 | 
				
			|||||||
    powerBar:ClearAllPoints()
 | 
					    powerBar:ClearAllPoints()
 | 
				
			||||||
    powerBar:SetPoint("TOPLEFT", healthBar, "BOTTOMLEFT", 0, -1)
 | 
					    powerBar:SetPoint("TOPLEFT", healthBar, "BOTTOMLEFT", 0, -1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    powerBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.powerBarBorderStyle),
 | 
					    powerBar:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "powerBarBorderStyle"),
 | 
				
			||||||
                                  edgeSize = Gladdy.db.powerBarBorderSize })
 | 
					                           edgeSize = Gladdy.db.powerBarBorderSize })
 | 
				
			||||||
    powerBar:SetBackdropBorderColor(Gladdy.db.powerBarBorderColor.r, Gladdy.db.powerBarBorderColor.g, Gladdy.db.powerBarBorderColor.b, Gladdy.db.powerBarBorderColor.a)
 | 
					    powerBar:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.powerBarBorderColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    powerBar.energy:SetStatusBarTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.powerBarTexture))
 | 
					    powerBar.energy:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "powerBarTexture"))
 | 
				
			||||||
    powerBar.energy:ClearAllPoints()
 | 
					    powerBar.energy:ClearAllPoints()
 | 
				
			||||||
    powerBar.energy:SetPoint("TOPLEFT", powerBar, "TOPLEFT", (Gladdy.db.powerBarBorderSize/Gladdy.db.statusbarBorderOffset), -(Gladdy.db.powerBarBorderSize/Gladdy.db.statusbarBorderOffset))
 | 
					    powerBar.energy:SetPoint("TOPLEFT", powerBar, "TOPLEFT", (Gladdy.db.powerBarBorderSize/Gladdy.db.statusbarBorderOffset), -(Gladdy.db.powerBarBorderSize/Gladdy.db.statusbarBorderOffset))
 | 
				
			||||||
    powerBar.energy:SetPoint("BOTTOMRIGHT", powerBar, "BOTTOMRIGHT", -(Gladdy.db.powerBarBorderSize/Gladdy.db.statusbarBorderOffset), (Gladdy.db.powerBarBorderSize/Gladdy.db.statusbarBorderOffset))
 | 
					    powerBar.energy:SetPoint("BOTTOMRIGHT", powerBar, "BOTTOMRIGHT", -(Gladdy.db.powerBarBorderSize/Gladdy.db.statusbarBorderOffset), (Gladdy.db.powerBarBorderSize/Gladdy.db.statusbarBorderOffset))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    powerBar.raceText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.powerBarFont), Gladdy.db.powerBarFontSize)
 | 
					    powerBar.raceText:SetFont(Gladdy:SMFetch("font", "powerBarFont"), Gladdy.db.powerBarRaceFontSize, Gladdy.db.powerTextLeftOutline and "OUTLINE")
 | 
				
			||||||
    powerBar.raceText:SetTextColor(Gladdy.db.powerBarFontColor.r, Gladdy.db.powerBarFontColor.g, Gladdy.db.powerBarFontColor.b, Gladdy.db.powerBarFontColor.a)
 | 
					    powerBar.raceText:SetTextColor(Gladdy:SetColor(Gladdy.db.powerBarFontColor))
 | 
				
			||||||
    powerBar.powerText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.powerBarFont), Gladdy.db.powerBarFontSize)
 | 
					    powerBar.raceText:SetPoint("LEFT", Gladdy.db.powerTextLeftHOffset, Gladdy.db.powerTextLeftVOffset)
 | 
				
			||||||
    powerBar.powerText:SetTextColor(Gladdy.db.powerBarFontColor.r, Gladdy.db.powerBarFontColor.g, Gladdy.db.powerBarFontColor.b, Gladdy.db.powerBarFontColor.a)
 | 
					
 | 
				
			||||||
 | 
					    powerBar.powerText:SetFont(Gladdy:SMFetch("font", "powerBarFont"), Gladdy.db.powerBarPowerFontSize, Gladdy.db.powerTextRightOutline and "OUTLINE")
 | 
				
			||||||
 | 
					    powerBar.powerText:SetTextColor(Gladdy:SetColor(Gladdy.db.powerBarFontColor))
 | 
				
			||||||
 | 
					    powerBar.powerText:SetPoint("RIGHT", Gladdy.db.powerTextRightHOffset, Gladdy.db.powerTextRightVOffset)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    powerBar:SetFrameStrata(Gladdy.db.powerFrameStrata)
 | 
				
			||||||
 | 
					    powerBar:SetFrameLevel(Gladdy.db.powerFrameLevel)
 | 
				
			||||||
 | 
					    powerBar.energy:SetFrameStrata(Gladdy.db.powerFrameStrata)
 | 
				
			||||||
 | 
					    powerBar.energy:SetFrameLevel(Gladdy.db.powerFrameLevel - 1)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Powerbar.OnEvent(powerBar, event, unit)
 | 
				
			||||||
 | 
					    powerBar.energy.powerType = select(1, UnitPowerType(unit))
 | 
				
			||||||
 | 
					    powerBar.energy.current, powerBar.energy.max = UnitPower(unit, powerBar.energy.powerType, true), UnitPowerMax(unit, powerBar.energy.powerType, true)
 | 
				
			||||||
 | 
					    Powerbar:SetPower(powerBar, unit, powerBar.energy.current, powerBar.energy.max, powerBar.energy.powerType)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Powerbar:SetText(unit, power, powerMax, status)
 | 
				
			||||||
 | 
					    local button = Gladdy.buttons[unit]
 | 
				
			||||||
 | 
					    if not Gladdy.buttons[unit] then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    local powerBar = button.powerBar
 | 
				
			||||||
 | 
					    if Gladdy.db.powerCustomTagsEnabled then
 | 
				
			||||||
 | 
					        powerBar.powerText:SetText(Gladdy:SetTag(unit, Gladdy.db.powerTextRight, power, powerMax, status))
 | 
				
			||||||
 | 
					        powerBar.raceText:SetText(Gladdy:SetTag(unit, Gladdy.db.powerTextLeft, power, powerMax, status))
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        if power then
 | 
				
			||||||
 | 
					            local powerPercentage = floor(power * 100 / powerMax)
 | 
				
			||||||
 | 
					            local powerText
 | 
				
			||||||
 | 
					            if (Gladdy.db.powerActual) then
 | 
				
			||||||
 | 
					                powerText = powerMax > 999 and ("%.1fk"):format(power / 1000) or power
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					            if (Gladdy.db.powerMax) then
 | 
				
			||||||
 | 
					                local text = powerMax > 999 and ("%.1fk"):format(powerMax / 1000) or powerMax
 | 
				
			||||||
 | 
					                if (powerText) then
 | 
				
			||||||
 | 
					                    powerText = ("%s/%s"):format(powerText, text)
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                    powerText = text
 | 
				
			||||||
 | 
					                end
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					            if (Gladdy.db.powerPercentage) then
 | 
				
			||||||
 | 
					                if (powerText) then
 | 
				
			||||||
 | 
					                    powerText = ("%s (%d%%)"):format(powerText, powerPercentage)
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                    powerText = ("%d%%"):format(powerPercentage)
 | 
				
			||||||
 | 
					                end
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					            powerBar.powerText:SetText(powerText)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        local raceText = Gladdy.db.powerShowRace and button.raceLoc or ""
 | 
				
			||||||
 | 
					        if (button.spec and Gladdy.db.powerShowSpec) then
 | 
				
			||||||
 | 
					            raceText = button.spec .. " " .. raceText
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        powerBar.raceText:SetText(raceText)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Powerbar:SetPower(powerBar, unit, power, powerMax, powerType, status)
 | 
				
			||||||
 | 
					    Powerbar:SetText(unit, power, powerMax, status)
 | 
				
			||||||
 | 
					    powerBar.energy.current = power
 | 
				
			||||||
 | 
					    powerBar.energy.max = powerMax
 | 
				
			||||||
 | 
					    powerBar.energy.powerType = powerType
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (powerType == 1 and powerBar.powerType ~= powerType) then
 | 
				
			||||||
 | 
					        powerBar.energy:SetStatusBarColor(1, 0, 0, 1)
 | 
				
			||||||
 | 
					        powerBar.powerColor = {r = 1, g = 0, b = 0}
 | 
				
			||||||
 | 
					        powerBar.powerType = powerType
 | 
				
			||||||
 | 
					    elseif (powerType == 3 and powerBar.powerType ~= powerType) then
 | 
				
			||||||
 | 
					        powerBar.energy:SetStatusBarColor(1, 1, 0, 1)
 | 
				
			||||||
 | 
					        powerBar.powerColor = {r = 1, g = 1, b = 0}
 | 
				
			||||||
 | 
					        powerBar.powerType = powerType
 | 
				
			||||||
 | 
					    elseif powerBar.powerType ~= powerType then
 | 
				
			||||||
 | 
					        powerBar.energy:SetStatusBarColor(.18, .44, .75, 1)
 | 
				
			||||||
 | 
					        powerBar.powerColor = {r = .18, g = .44, b = .75}
 | 
				
			||||||
 | 
					        powerBar.powerType = powerType
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    powerBar.energy:SetMinMaxValues(0, powerMax)
 | 
				
			||||||
 | 
					    powerBar.energy:SetValue(power)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Powerbar:ResetUnit(unit)
 | 
					function Powerbar:ResetUnit(unit)
 | 
				
			||||||
@@ -165,6 +243,8 @@ function Powerbar:ResetUnit(unit)
 | 
				
			|||||||
    powerBar.raceText:SetText("")
 | 
					    powerBar.raceText:SetText("")
 | 
				
			||||||
    powerBar.powerText:SetText("")
 | 
					    powerBar.powerText:SetText("")
 | 
				
			||||||
    powerBar.energy:SetValue(0)
 | 
					    powerBar.energy:SetValue(0)
 | 
				
			||||||
 | 
					    powerBar.powerType = ""
 | 
				
			||||||
 | 
					    powerBar.powerColor = {r = 1, g = 1, b = 1}
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Powerbar:Test(unit)
 | 
					function Powerbar:Test(unit)
 | 
				
			||||||
@@ -174,8 +254,14 @@ function Powerbar:Test(unit)
 | 
				
			|||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    powerBar.energy.current = button.power
 | 
				
			||||||
 | 
					    powerBar.energy.max = button.powerMax
 | 
				
			||||||
 | 
					    powerBar.energy.powerType = button.powerType
 | 
				
			||||||
    self:ENEMY_SPOTTED(unit)
 | 
					    self:ENEMY_SPOTTED(unit)
 | 
				
			||||||
    self:UNIT_POWER(unit, button.power, button.powerMax, button.powerType)
 | 
					    self:UNIT_POWER(unit, button.power, button.powerMax, button.powerType)
 | 
				
			||||||
 | 
					    if unit == "arena1" then
 | 
				
			||||||
 | 
					        self:UNIT_DEATH(unit)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Powerbar:ENEMY_SPOTTED(unit)
 | 
					function Powerbar:ENEMY_SPOTTED(unit)
 | 
				
			||||||
@@ -185,15 +271,10 @@ function Powerbar:ENEMY_SPOTTED(unit)
 | 
				
			|||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local raceText = button.raceLoc
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (button.spec) then
 | 
					 | 
				
			||||||
        raceText = button.spec .. " " .. raceText
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    powerBar.raceText:SetText(raceText)
 | 
					 | 
				
			||||||
    if UnitExists(unit) then
 | 
					    if UnitExists(unit) then
 | 
				
			||||||
        Powerbar:SetPower(powerBar, UnitPower(unit, UnitPowerType(unit), true), UnitPowerMax(unit, UnitPowerType(unit), true), UnitPowerType(unit))
 | 
					        powerBar.energy.powerType = select(1, UnitPowerType(unit))
 | 
				
			||||||
 | 
					        powerBar.energy.current, powerBar.energy.max = UnitPower(unit, powerBar.energy.powerType, true), UnitPowerMax(unit, powerBar.energy.powerType, true)
 | 
				
			||||||
 | 
					        Powerbar:SetPower(powerBar, unit, powerBar.energy.current, powerBar.energy.max, powerBar.energy.powerType)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -204,7 +285,9 @@ function Powerbar:UNIT_SPEC(unit, spec)
 | 
				
			|||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    powerBar.raceText:SetText(spec .. " " .. button.raceLoc)
 | 
					    if UnitExists(unit) then
 | 
				
			||||||
 | 
					        Powerbar:SetPower(powerBar, unit, powerBar.energy.current, powerBar.energy.max, powerBar.energy.powerType)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Powerbar:UNIT_POWER(unit, power, powerMax, powerType)
 | 
					function Powerbar:UNIT_POWER(unit, power, powerMax, powerType)
 | 
				
			||||||
@@ -216,41 +299,7 @@ function Powerbar:UNIT_POWER(unit, power, powerMax, powerType)
 | 
				
			|||||||
    if not Gladdy.buttons[unit].class then
 | 
					    if not Gladdy.buttons[unit].class then
 | 
				
			||||||
        Gladdy:SpotEnemy(unit, true)
 | 
					        Gladdy:SpotEnemy(unit, true)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					    Powerbar:SetPower(powerBar, unit, power, powerMax, powerType)
 | 
				
			||||||
    local powerPercentage = floor(power * 100 / powerMax)
 | 
					 | 
				
			||||||
    local powerText
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (Gladdy.db.powerActual) then
 | 
					 | 
				
			||||||
        powerText = powerMax > 999 and ("%.1fk"):format(power / 1000) or power
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (Gladdy.db.powerMax) then
 | 
					 | 
				
			||||||
        local text = powerMax > 999 and ("%.1fk"):format(powerMax / 1000) or powerMax
 | 
					 | 
				
			||||||
        if (powerText) then
 | 
					 | 
				
			||||||
            powerText = ("%s/%s"):format(powerText, text)
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
            powerText = text
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (Gladdy.db.powerPercentage) then
 | 
					 | 
				
			||||||
        if (powerText) then
 | 
					 | 
				
			||||||
            powerText = ("%s (%d%%)"):format(powerText, powerPercentage)
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
            powerText = ("%d%%"):format(powerPercentage)
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (powerType == 1) then
 | 
					 | 
				
			||||||
        powerBar.energy:SetStatusBarColor(1, 0, 0, 1)
 | 
					 | 
				
			||||||
    elseif (powerType == 3) then
 | 
					 | 
				
			||||||
        powerBar.energy:SetStatusBarColor(1, 1, 0, 1)
 | 
					 | 
				
			||||||
    else
 | 
					 | 
				
			||||||
        powerBar.energy:SetStatusBarColor(.18, .44, .75, 1)
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    powerBar.powerText:SetText(powerText)
 | 
					 | 
				
			||||||
    powerBar.energy:SetValue(powerPercentage)
 | 
					 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Powerbar:UNIT_DEATH(unit)
 | 
					function Powerbar:UNIT_DEATH(unit)
 | 
				
			||||||
@@ -258,9 +307,15 @@ function Powerbar:UNIT_DEATH(unit)
 | 
				
			|||||||
    if (not powerBar) then
 | 
					    if (not powerBar) then
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					    Powerbar:SetPower(powerBar, unit, 0, powerBar.energy.max, powerBar.energy.powerType, L["DEAD"])
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    powerBar.energy:SetValue(0)
 | 
					function Powerbar:UNIT_DESTROYED(unit)
 | 
				
			||||||
    powerBar.powerText:SetText("0%")
 | 
					    local powerBar = self.frames[unit]
 | 
				
			||||||
 | 
					    if (not powerBar) then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    Powerbar:SetPower(powerBar, unit, 0, powerBar.energy.max, powerBar.energy.powerType, L["LEAVE"])
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function option(params)
 | 
					local function option(params)
 | 
				
			||||||
@@ -272,10 +327,15 @@ local function option(params)
 | 
				
			|||||||
        set = function(info, value)
 | 
					        set = function(info, value)
 | 
				
			||||||
            local key = info.arg or info[#info]
 | 
					            local key = info.arg or info[#info]
 | 
				
			||||||
            Gladdy.dbi.profile[key] = value
 | 
					            Gladdy.dbi.profile[key] = value
 | 
				
			||||||
            Gladdy.options.args.Powerbar.args.group.args.border.arg.powerBarBorderSize.max = Gladdy.db.powerBarHeight/2
 | 
					            Gladdy.options.args["Power Bar"].args.group.args.border.args.powerBarBorderSize.max = Gladdy.db.powerBarHeight/2
 | 
				
			||||||
            if Gladdy.db.powerBarBorderSize > Gladdy.db.powerBarHeight/2 then
 | 
					            if Gladdy.db.powerBarBorderSize > Gladdy.db.powerBarHeight/2 then
 | 
				
			||||||
                Gladdy.db.powerBarBorderSize = Gladdy.db.powerBarHeight/2
 | 
					                Gladdy.db.powerBarBorderSize = Gladdy.db.powerBarHeight/2
 | 
				
			||||||
            end
 | 
					            end
 | 
				
			||||||
 | 
					            if Gladdy.frame.testing then
 | 
				
			||||||
 | 
					                for i=1,Gladdy.curBracket do
 | 
				
			||||||
 | 
					                    Powerbar:Test("arena" .. i)
 | 
				
			||||||
 | 
					                end
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
            Gladdy:UpdateFrame()
 | 
					            Gladdy:UpdateFrame()
 | 
				
			||||||
        end,
 | 
					        end,
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -294,11 +354,17 @@ function Powerbar:GetOptions()
 | 
				
			|||||||
            name = L["Power Bar"],
 | 
					            name = L["Power Bar"],
 | 
				
			||||||
            order = 2,
 | 
					            order = 2,
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
					        powerBarEnabled = Gladdy:option({
 | 
				
			||||||
 | 
					            type = "toggle",
 | 
				
			||||||
 | 
					            name = L["Enabled"],
 | 
				
			||||||
 | 
					            order = 3,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
        group = {
 | 
					        group = {
 | 
				
			||||||
            type = "group",
 | 
					            type = "group",
 | 
				
			||||||
            childGroups = "tree",
 | 
					            childGroups = "tree",
 | 
				
			||||||
            name = "Frame",
 | 
					            name = L["Frame"],
 | 
				
			||||||
            order = 3,
 | 
					            order = 4,
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.powerBarEnabled end,
 | 
				
			||||||
            args = {
 | 
					            args = {
 | 
				
			||||||
                general = {
 | 
					                general = {
 | 
				
			||||||
                    type = "group",
 | 
					                    type = "group",
 | 
				
			||||||
@@ -318,6 +384,7 @@ function Powerbar:GetOptions()
 | 
				
			|||||||
                            min = 0,
 | 
					                            min = 0,
 | 
				
			||||||
                            max = 50,
 | 
					                            max = 50,
 | 
				
			||||||
                            step = 1,
 | 
					                            step = 1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        powerBarTexture = option({
 | 
					                        powerBarTexture = option({
 | 
				
			||||||
                            type = "select",
 | 
					                            type = "select",
 | 
				
			||||||
@@ -361,13 +428,83 @@ function Powerbar:GetOptions()
 | 
				
			|||||||
                            order = 12,
 | 
					                            order = 12,
 | 
				
			||||||
                            hasAlpha = true,
 | 
					                            hasAlpha = true,
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        powerBarFontSize = option({
 | 
					                        powerTextLeftOutline = option({
 | 
				
			||||||
                            type = "range",
 | 
					                            type = "toggle",
 | 
				
			||||||
                            name = L["Font size"],
 | 
					                            name = L["Left Font Outline"],
 | 
				
			||||||
                            desc = L["Size of the text"],
 | 
					 | 
				
			||||||
                            order = 13,
 | 
					                            order = 13,
 | 
				
			||||||
                            min = 1,
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        powerTextRightOutline = option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["Right Font Outline"],
 | 
				
			||||||
 | 
					                            order = 14,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        headerSize = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Size"],
 | 
				
			||||||
 | 
					                            order = 20,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        powerBarRaceFontSize = option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Race font size"],
 | 
				
			||||||
 | 
					                            desc = L["Size of the race text"],
 | 
				
			||||||
 | 
					                            order = 21,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            min = 0,
 | 
				
			||||||
                            max = 20,
 | 
					                            max = 20,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        powerBarPowerFontSize = option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Power font size"],
 | 
				
			||||||
 | 
					                            desc = L["Size of the power text"],
 | 
				
			||||||
 | 
					                            order = 22,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            min = 0,
 | 
				
			||||||
 | 
					                            max = 20,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        headerOffsets = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Offsets"],
 | 
				
			||||||
 | 
					                            order = 30,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        powerTextLeftVOffset = option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Left Text Vertical Offset"],
 | 
				
			||||||
 | 
					                            order = 31,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            min = -200,
 | 
				
			||||||
 | 
					                            max = 200,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        powerTextLeftHOffset = option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Left Text Horizontal Offset"],
 | 
				
			||||||
 | 
					                            order = 32,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            min = -200,
 | 
				
			||||||
 | 
					                            max = 200,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        powerTextRightVOffset = option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Right Text Vertical Offset"],
 | 
				
			||||||
 | 
					                            order = 33,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            min = -200,
 | 
				
			||||||
 | 
					                            max = 200,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        powerTextRightHOffset = option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Right Text Horizontal Offset"],
 | 
				
			||||||
 | 
					                            order = 34,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            min = -200,
 | 
				
			||||||
 | 
					                            max = 200,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
@@ -396,6 +533,7 @@ function Powerbar:GetOptions()
 | 
				
			|||||||
                            min = 0.5,
 | 
					                            min = 0.5,
 | 
				
			||||||
                            max = Gladdy.db.powerBarHeight/2,
 | 
					                            max = Gladdy.db.powerBarHeight/2,
 | 
				
			||||||
                            step = 0.5,
 | 
					                            step = 0.5,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        powerBarBorderColor = Gladdy:colorOption({
 | 
					                        powerBarBorderColor = Gladdy:colorOption({
 | 
				
			||||||
                            type = "color",
 | 
					                            type = "color",
 | 
				
			||||||
@@ -406,34 +544,88 @@ function Powerbar:GetOptions()
 | 
				
			|||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
 | 
					                frameStrata = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Frame Strata and Level"],
 | 
				
			||||||
 | 
					                    order = 4,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        headerAuraLevel = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Frame Strata and Level"],
 | 
				
			||||||
 | 
					                            order = 1,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        powerFrameStrata = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "select",
 | 
				
			||||||
 | 
					                            name = L["Frame Strata"],
 | 
				
			||||||
 | 
					                            order = 2,
 | 
				
			||||||
 | 
					                            values = Gladdy.frameStrata,
 | 
				
			||||||
 | 
					                            sorting = Gladdy.frameStrataSorting,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        powerFrameLevel = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Frame Level"],
 | 
				
			||||||
 | 
					                            min = 1,
 | 
				
			||||||
 | 
					                            max = 500,
 | 
				
			||||||
 | 
					                            step = 1,
 | 
				
			||||||
 | 
					                            order = 3,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
                powerValues = {
 | 
					                powerValues = {
 | 
				
			||||||
                    type = "group",
 | 
					                    type = "group",
 | 
				
			||||||
                    name = L["Power Values"],
 | 
					                    name = L["Power Bar Text"],
 | 
				
			||||||
                    order = 4,
 | 
					                    order = 5,
 | 
				
			||||||
                    args = {
 | 
					                    args = {
 | 
				
			||||||
                        header = {
 | 
					                        header = {
 | 
				
			||||||
                            type = "header",
 | 
					                            type = "header",
 | 
				
			||||||
                            name = L["Power Values"],
 | 
					                            name = L["Power Texts"],
 | 
				
			||||||
                            order = 1,
 | 
					                            order = 1,
 | 
				
			||||||
                        },
 | 
					                        },
 | 
				
			||||||
 | 
					                        powerShowRace = option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["Show race"],
 | 
				
			||||||
 | 
					                            desc = L["Show race"],
 | 
				
			||||||
 | 
					                            order = 2,
 | 
				
			||||||
 | 
					                            disabled = function() return Gladdy.db.powerCustomTagsEnabled end,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        powerShowSpec= option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["Show spec"],
 | 
				
			||||||
 | 
					                            desc = L["Show spec"],
 | 
				
			||||||
 | 
					                            order = 3,
 | 
				
			||||||
 | 
					                            disabled = function() return Gladdy.db.powerCustomTagsEnabled end,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
                        powerActual = option({
 | 
					                        powerActual = option({
 | 
				
			||||||
                            type = "toggle",
 | 
					                            type = "toggle",
 | 
				
			||||||
                            name = L["Show the actual power"],
 | 
					                            name = L["Show the actual power"],
 | 
				
			||||||
                            desc = L["Show the actual power on the power bar"],
 | 
					                            desc = L["Show the actual power on the power bar"],
 | 
				
			||||||
                            order = 31,
 | 
					                            order = 4,
 | 
				
			||||||
 | 
					                            disabled = function() return Gladdy.db.powerCustomTagsEnabled end,
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        powerMax = option({
 | 
					                        powerMax = option({
 | 
				
			||||||
                            type = "toggle",
 | 
					                            type = "toggle",
 | 
				
			||||||
                            name = L["Show max power"],
 | 
					                            name = L["Show max power"],
 | 
				
			||||||
                            desc = L["Show max power on the power bar"],
 | 
					                            desc = L["Show max power on the power bar"],
 | 
				
			||||||
                            order = 32,
 | 
					                            order = 5,
 | 
				
			||||||
 | 
					                            disabled = function() return Gladdy.db.powerCustomTagsEnabled end,
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        powerPercentage = option({
 | 
					                        powerPercentage = option({
 | 
				
			||||||
                            type = "toggle",
 | 
					                            type = "toggle",
 | 
				
			||||||
                            name = L["Show power percentage"],
 | 
					                            name = L["Show power percentage"],
 | 
				
			||||||
                            desc = L["Show power percentage on the power bar"],
 | 
					                            desc = L["Show power percentage on the power bar"],
 | 
				
			||||||
                            order = 33,
 | 
					                            order = 6,
 | 
				
			||||||
 | 
					                            disabled = function() return Gladdy.db.powerCustomTagsEnabled end,
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
 | 
					                        header = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Custom Tags"],
 | 
				
			||||||
 | 
					                            order = 10,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        powerCustomTagsEnabled = Gladdy:GetTagOption(L["Custom Tags Enabled"], 11, nil, option, true),
 | 
				
			||||||
 | 
					                        powerTextLeft = Gladdy:GetTagOption(L["Left Text"], 12, "powerCustomTagsEnabled", option),
 | 
				
			||||||
 | 
					                        powerTextRight = Gladdy:GetTagOption(L["Right Text"], 13, "powerCustomTagsEnabled", option),
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										558
									
								
								Modules/Racial.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										558
									
								
								Modules/Racial.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,558 @@
 | 
				
			|||||||
 | 
					local ceil, str_gsub = ceil, string.gsub
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local CreateFrame = CreateFrame
 | 
				
			||||||
 | 
					local GetTime = GetTime
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local Gladdy = LibStub("Gladdy")
 | 
				
			||||||
 | 
					local L = Gladdy.L
 | 
				
			||||||
 | 
					local Racial = Gladdy:NewModule("Racial", 79, {
 | 
				
			||||||
 | 
					    racialFont = "DorisPP",
 | 
				
			||||||
 | 
					    racialFontScale = 1,
 | 
				
			||||||
 | 
					    racialEnabled = true,
 | 
				
			||||||
 | 
					    racialSize = 60 + 20 + 1,
 | 
				
			||||||
 | 
					    racialWidthFactor = 0.9,
 | 
				
			||||||
 | 
					    racialIconZoomed = false,
 | 
				
			||||||
 | 
					    racialXOffset = 0,
 | 
				
			||||||
 | 
					    racialYOffset = 0,
 | 
				
			||||||
 | 
					    racialBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp",
 | 
				
			||||||
 | 
					    racialBorderColor = { r = 0, g = 0, b = 0, a = 1 },
 | 
				
			||||||
 | 
					    racialDisableCircle = false,
 | 
				
			||||||
 | 
					    racialCooldownAlpha = 1,
 | 
				
			||||||
 | 
					    racialCooldownNumberAlpha = 1,
 | 
				
			||||||
 | 
					    racialFrameStrata = "MEDIUM",
 | 
				
			||||||
 | 
					    racialFrameLevel = 5,
 | 
				
			||||||
 | 
					    racialGroup = false,
 | 
				
			||||||
 | 
					    racialGroupDirection = "DOWN",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Racial:Initialize()
 | 
				
			||||||
 | 
					    self.frames = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if Gladdy.db.racialEnabled then
 | 
				
			||||||
 | 
					        self:RegisterMessage("JOINED_ARENA")
 | 
				
			||||||
 | 
					        self:RegisterMessage("ENEMY_SPOTTED")
 | 
				
			||||||
 | 
					        self:RegisterMessage("RACIAL_USED")
 | 
				
			||||||
 | 
					        if Gladdy.expansion == "Wrath" then
 | 
				
			||||||
 | 
					            self:RegisterMessage("TRINKET_USED")
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Racial:UpdateFrameOnce()
 | 
				
			||||||
 | 
					    if Gladdy.db.racialEnabled then
 | 
				
			||||||
 | 
					        self:RegisterMessage("JOINED_ARENA")
 | 
				
			||||||
 | 
					        self:RegisterMessage("ENEMY_SPOTTED")
 | 
				
			||||||
 | 
					        self:RegisterMessage("RACIAL_USED")
 | 
				
			||||||
 | 
					        if Gladdy.expansion == "Wrath" then
 | 
				
			||||||
 | 
					            self:RegisterMessage("TRINKET_USED")
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        self:UnregisterAllMessages()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function iconTimer(self,elapsed)
 | 
				
			||||||
 | 
					    if (self.active) then
 | 
				
			||||||
 | 
					        if (self.timeLeft <= 0) then
 | 
				
			||||||
 | 
					            self.active = false
 | 
				
			||||||
 | 
					            self.cooldown:Clear()
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            self.timeLeft = self.timeLeft - elapsed
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        local timeLeft = ceil(self.timeLeft)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if timeLeft >= 60 then
 | 
				
			||||||
 | 
					            self.cooldownFont:SetTextColor(1, 1, 0, Gladdy.db.racialCooldownNumberAlpha)
 | 
				
			||||||
 | 
					            self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 0.15* self:GetWidth()) * Gladdy.db.racialFontScale, "OUTLINE")
 | 
				
			||||||
 | 
					        elseif timeLeft < 60 and timeLeft >= 30 then
 | 
				
			||||||
 | 
					            self.cooldownFont:SetTextColor(1, 1, 0, Gladdy.db.racialCooldownNumberAlpha)
 | 
				
			||||||
 | 
					            self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
 | 
				
			||||||
 | 
					        elseif timeLeft < 30 and timeLeft >= 11 then
 | 
				
			||||||
 | 
					            self.cooldownFont:SetTextColor(1, 0.7, 0, Gladdy.db.racialCooldownNumberAlpha)
 | 
				
			||||||
 | 
					            self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
 | 
				
			||||||
 | 
					        elseif timeLeft < 10 and timeLeft >= 5 then
 | 
				
			||||||
 | 
					            self.cooldownFont:SetTextColor(1, 0.7, 0, Gladdy.db.racialCooldownNumberAlpha)
 | 
				
			||||||
 | 
					            self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
 | 
				
			||||||
 | 
					        elseif timeLeft < 5 and timeLeft > 0 then
 | 
				
			||||||
 | 
					            self.cooldownFont:SetTextColor(1, 0, 0, Gladdy.db.racialCooldownNumberAlpha)
 | 
				
			||||||
 | 
					            self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        Gladdy:FormatTimer(self.cooldownFont, self.timeLeft, self.timeLeft < 10, true)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Racial:CreateFrame(unit)
 | 
				
			||||||
 | 
					    local racial = CreateFrame("Button", "GladdyTrinketButton" .. unit, Gladdy.buttons[unit])
 | 
				
			||||||
 | 
					    racial:EnableMouse(false)
 | 
				
			||||||
 | 
					    racial:SetFrameStrata(Gladdy.db.racialFrameStrata)
 | 
				
			||||||
 | 
					    racial:SetFrameLevel(Gladdy.db.racialFrameLevel)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    racial.texture = racial:CreateTexture(nil, "BACKGROUND")
 | 
				
			||||||
 | 
					    racial.texture:SetAllPoints(racial)
 | 
				
			||||||
 | 
					    racial.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
				
			||||||
 | 
					    racial.texture.masked = true
 | 
				
			||||||
 | 
					    --racial.texture:SetTexture("Interface\\Icons\\INV_Jewelry_TrinketPVP_02")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    racial.cooldown = CreateFrame("Cooldown", nil, racial, "CooldownFrameTemplate")
 | 
				
			||||||
 | 
					    racial.cooldown.noCooldownCount = true --Gladdy.db.racialDisableOmniCC
 | 
				
			||||||
 | 
					    racial.cooldown:SetHideCountdownNumbers(true)
 | 
				
			||||||
 | 
					    racial.cooldown:SetFrameStrata(Gladdy.db.racialFrameStrata)
 | 
				
			||||||
 | 
					    racial.cooldown:SetFrameLevel(Gladdy.db.racialFrameLevel + 1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    racial.cooldownFrame = CreateFrame("Frame", nil, racial)
 | 
				
			||||||
 | 
					    racial.cooldownFrame:ClearAllPoints()
 | 
				
			||||||
 | 
					    racial.cooldownFrame:SetPoint("TOPLEFT", racial, "TOPLEFT")
 | 
				
			||||||
 | 
					    racial.cooldownFrame:SetPoint("BOTTOMRIGHT", racial, "BOTTOMRIGHT")
 | 
				
			||||||
 | 
					    racial.cooldownFrame:SetFrameStrata(Gladdy.db.racialFrameStrata)
 | 
				
			||||||
 | 
					    racial.cooldownFrame:SetFrameLevel(Gladdy.db.racialFrameLevel + 2)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    racial.cooldownFont = racial.cooldownFrame:CreateFontString(nil, "OVERLAY")
 | 
				
			||||||
 | 
					    racial.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), 20, "OUTLINE")
 | 
				
			||||||
 | 
					    --trinket.cooldownFont:SetAllPoints(trinket.cooldown)
 | 
				
			||||||
 | 
					    racial.cooldownFont:SetJustifyH("CENTER")
 | 
				
			||||||
 | 
					    racial.cooldownFont:SetPoint("CENTER")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    racial.borderFrame = CreateFrame("Frame", nil, racial)
 | 
				
			||||||
 | 
					    racial.borderFrame:SetAllPoints(racial)
 | 
				
			||||||
 | 
					    racial.borderFrame:SetFrameStrata(Gladdy.db.racialFrameStrata)
 | 
				
			||||||
 | 
					    racial.borderFrame:SetFrameLevel(Gladdy.db.racialFrameLevel + 3)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    racial.texture.overlay = racial.borderFrame:CreateTexture(nil, "OVERLAY")
 | 
				
			||||||
 | 
					    racial.texture.overlay:SetAllPoints(racial)
 | 
				
			||||||
 | 
					    racial.texture.overlay:SetTexture(Gladdy.db.racialBorderStyle)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    racial:SetScript("OnUpdate", iconTimer)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Gladdy.buttons[unit].racial = racial
 | 
				
			||||||
 | 
					    self.frames[unit] = racial
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Racial:UpdateFrame(unit)
 | 
				
			||||||
 | 
					    local racial = self.frames[unit]
 | 
				
			||||||
 | 
					    if (not racial) then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    local testAgain = false
 | 
				
			||||||
 | 
					    local width, height = Gladdy.db.racialSize * Gladdy.db.racialWidthFactor, Gladdy.db.racialSize
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    racial:SetFrameStrata(Gladdy.db.racialFrameStrata)
 | 
				
			||||||
 | 
					    racial:SetFrameLevel(Gladdy.db.racialFrameLevel)
 | 
				
			||||||
 | 
					    racial.cooldown:SetFrameStrata(Gladdy.db.racialFrameStrata)
 | 
				
			||||||
 | 
					    racial.cooldown:SetFrameLevel(Gladdy.db.racialFrameLevel + 1)
 | 
				
			||||||
 | 
					    racial.cooldownFrame:SetFrameStrata(Gladdy.db.racialFrameStrata)
 | 
				
			||||||
 | 
					    racial.cooldownFrame:SetFrameLevel(Gladdy.db.racialFrameLevel + 2)
 | 
				
			||||||
 | 
					    racial.borderFrame:SetFrameStrata(Gladdy.db.racialFrameStrata)
 | 
				
			||||||
 | 
					    racial.borderFrame:SetFrameLevel(Gladdy.db.racialFrameLevel + 3)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    racial:SetWidth(width)
 | 
				
			||||||
 | 
					    racial:SetHeight(height)
 | 
				
			||||||
 | 
					    if Gladdy.db.racialIconZoomed then
 | 
				
			||||||
 | 
					        racial.cooldown:SetWidth(width)
 | 
				
			||||||
 | 
					        racial.cooldown:SetHeight(height)
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        racial.cooldown:SetWidth(width - width/16)
 | 
				
			||||||
 | 
					        racial.cooldown:SetHeight(height - height/16)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    racial.cooldown:ClearAllPoints()
 | 
				
			||||||
 | 
					    racial.cooldown:SetPoint("CENTER", racial, "CENTER")
 | 
				
			||||||
 | 
					    racial.cooldown.noCooldownCount = true -- Gladdy.db.racialDisableOmniCC
 | 
				
			||||||
 | 
					    racial.cooldown:SetAlpha(Gladdy.db.racialCooldownAlpha)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    racial.texture:ClearAllPoints()
 | 
				
			||||||
 | 
					    racial.texture:SetAllPoints(racial)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    racial.texture.overlay:SetTexture(Gladdy.db.racialBorderStyle)
 | 
				
			||||||
 | 
					    racial.texture.overlay:SetVertexColor(Gladdy:SetColor(Gladdy.db.racialBorderColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if Gladdy.db.racialIconZoomed then
 | 
				
			||||||
 | 
					        if racial.texture.masked then
 | 
				
			||||||
 | 
					            racial.texture:SetMask(nil)
 | 
				
			||||||
 | 
					            racial.texture:SetTexCoord(0.1,0.9,0.1,0.9)
 | 
				
			||||||
 | 
					            racial.texture.masked = nil
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        if not racial.texture.masked then
 | 
				
			||||||
 | 
					            racial.texture:SetMask(nil)
 | 
				
			||||||
 | 
					            racial.texture:SetTexCoord(0,1,0,1)
 | 
				
			||||||
 | 
					            racial.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
				
			||||||
 | 
					            racial.texture.masked = true
 | 
				
			||||||
 | 
					            if Gladdy.frame.testing then
 | 
				
			||||||
 | 
					                testAgain = true
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Gladdy:SetPosition(racial, unit, "racialXOffset", "racialYOffset", Racial:LegacySetPosition(racial, unit), Racial)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (Gladdy.db.racialGroup) then
 | 
				
			||||||
 | 
					        if (unit ~= "arena1") then
 | 
				
			||||||
 | 
					            local previousUnit = "arena" .. str_gsub(unit, "arena", "") - 1
 | 
				
			||||||
 | 
					            self.frames[unit]:ClearAllPoints()
 | 
				
			||||||
 | 
					            if Gladdy.db.racialGroupDirection == "RIGHT" then
 | 
				
			||||||
 | 
					                self.frames[unit]:SetPoint("LEFT", self.frames[previousUnit], "RIGHT", 0, 0)
 | 
				
			||||||
 | 
					            elseif Gladdy.db.racialGroupDirection == "LEFT" then
 | 
				
			||||||
 | 
					                self.frames[unit]:SetPoint("RIGHT", self.frames[previousUnit], "LEFT", 0, 0)
 | 
				
			||||||
 | 
					            elseif Gladdy.db.racialGroupDirection == "UP" then
 | 
				
			||||||
 | 
					                self.frames[unit]:SetPoint("BOTTOM", self.frames[previousUnit], "TOP", 0, 0)
 | 
				
			||||||
 | 
					            elseif Gladdy.db.racialGroupDirection == "DOWN" then
 | 
				
			||||||
 | 
					                self.frames[unit]:SetPoint("TOP", self.frames[previousUnit], "BOTTOM", 0, 0)
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (unit == "arena1") then
 | 
				
			||||||
 | 
					        Gladdy:CreateMover(racial,"racialXOffset", "racialYOffset", L["Racial"],
 | 
				
			||||||
 | 
					                {"TOPLEFT", "TOPLEFT"},
 | 
				
			||||||
 | 
					                Gladdy.db.racialSize * Gladdy.db.racialWidthFactor,
 | 
				
			||||||
 | 
					                Gladdy.db.racialSize,
 | 
				
			||||||
 | 
					                0, 0, "racialEnabled")
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (Gladdy.db.racialEnabled == false) then
 | 
				
			||||||
 | 
					        racial:Hide()
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        racial:Show()
 | 
				
			||||||
 | 
					        if testAgain then
 | 
				
			||||||
 | 
					            Racial:ResetUnit(unit)
 | 
				
			||||||
 | 
					            Racial:Test(unit)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Racial:JOINED_ARENA()
 | 
				
			||||||
 | 
					    self:SetScript("OnEvent", function(self, event, ...)
 | 
				
			||||||
 | 
					        if self[event] then
 | 
				
			||||||
 | 
					            self[event](self, ...)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Racial:RACIAL_USED(unit, expirationTime, spellName)
 | 
				
			||||||
 | 
					    local racial = self.frames[unit]
 | 
				
			||||||
 | 
					    local button = Gladdy.buttons[unit]
 | 
				
			||||||
 | 
					    if (not racial or not button or not button.race or not Gladdy.db.racialEnabled) then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if expirationTime and Gladdy:Racials()[button.race].spellName ~= spellName then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    local startTime = expirationTime or GetTime()
 | 
				
			||||||
 | 
					    Racial:Used(unit, startTime, Gladdy:Racials()[button.race].duration)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Racial:TRINKET_USED(unit) -- Wrath only
 | 
				
			||||||
 | 
					    local racial = self.frames[unit]
 | 
				
			||||||
 | 
					    local button = Gladdy.buttons[unit]
 | 
				
			||||||
 | 
					    if (not racial or not button or not button.race) then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if button.race == "Scourge" then
 | 
				
			||||||
 | 
					        if racial.active and racial.timeLeft >= 45 then
 | 
				
			||||||
 | 
					            -- do nothing
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            self:Used(unit, GetTime(), 45)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    elseif button.race == "Human" then
 | 
				
			||||||
 | 
					        self:Used(unit, GetTime(), 120)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Racial:Used(unit, startTime, duration)
 | 
				
			||||||
 | 
					    local racial = self.frames[unit]
 | 
				
			||||||
 | 
					    if (not racial) then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if not racial.active then
 | 
				
			||||||
 | 
					        racial.timeLeft = duration
 | 
				
			||||||
 | 
					        if not Gladdy.db.racialDisableCircle then racial.cooldown:SetCooldown(startTime, duration) end
 | 
				
			||||||
 | 
					        racial.active = true
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Racial:ENEMY_SPOTTED(unit)
 | 
				
			||||||
 | 
					    local racial = self.frames[unit]
 | 
				
			||||||
 | 
					    if (not racial or not Gladdy.buttons[unit].race) then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    racial.texture:SetTexture(Gladdy:Racials()[Gladdy.buttons[unit].race].texture)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Racial:ResetUnit(unit)
 | 
				
			||||||
 | 
					    local racial = self.frames[unit]
 | 
				
			||||||
 | 
					    if (not racial) then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    racial.texture:SetTexture(nil)
 | 
				
			||||||
 | 
					    racial.timeLeft = nil
 | 
				
			||||||
 | 
					    racial.active = false
 | 
				
			||||||
 | 
					    racial.cooldown:Clear()
 | 
				
			||||||
 | 
					    racial.cooldownFont:SetText("")
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Racial:Test(unit)
 | 
				
			||||||
 | 
					    Racial:ENEMY_SPOTTED(unit)
 | 
				
			||||||
 | 
					    if (unit == "arena2" or unit == "arena3") then
 | 
				
			||||||
 | 
					        Gladdy:SendMessage("RACIAL_USED", unit)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Racial:GetOptions()
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
					        headerTrinket = {
 | 
				
			||||||
 | 
					            type = "header",
 | 
				
			||||||
 | 
					            name = L["Racial"],
 | 
				
			||||||
 | 
					            order = 2,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        racialEnabled = Gladdy:option({
 | 
				
			||||||
 | 
					            type = "toggle",
 | 
				
			||||||
 | 
					            name = L["Enabled"],
 | 
				
			||||||
 | 
					            desc = L["Enable racial icon"],
 | 
				
			||||||
 | 
					            order = 3,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
 | 
					        racialGroup = Gladdy:option({
 | 
				
			||||||
 | 
					            type = "toggle",
 | 
				
			||||||
 | 
					            name = L["Group"] .. " " .. L["Racial"],
 | 
				
			||||||
 | 
					            order = 4,
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.racialEnabled end,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
 | 
					        racialGroupDirection = Gladdy:option({
 | 
				
			||||||
 | 
					            type = "select",
 | 
				
			||||||
 | 
					            name = L["Group direction"],
 | 
				
			||||||
 | 
					            order = 5,
 | 
				
			||||||
 | 
					            values = {
 | 
				
			||||||
 | 
					                ["RIGHT"] = L["Right"],
 | 
				
			||||||
 | 
					                ["LEFT"] = L["Left"],
 | 
				
			||||||
 | 
					                ["UP"] = L["Up"],
 | 
				
			||||||
 | 
					                ["DOWN"] = L["Down"],
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					            disabled = function()
 | 
				
			||||||
 | 
					                return not Gladdy.db.racialGroup or not Gladdy.db.racialEnabled
 | 
				
			||||||
 | 
					            end,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
 | 
					        group = {
 | 
				
			||||||
 | 
					            type = "group",
 | 
				
			||||||
 | 
					            childGroups = "tree",
 | 
				
			||||||
 | 
					            name = L["Frame"],
 | 
				
			||||||
 | 
					            order = 6,
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.racialEnabled end,
 | 
				
			||||||
 | 
					            args = {
 | 
				
			||||||
 | 
					                general = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Icon"],
 | 
				
			||||||
 | 
					                    order = 1,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        header = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Icon"],
 | 
				
			||||||
 | 
					                            order = 1,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        racialIconZoomed = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["Zoomed Icon"],
 | 
				
			||||||
 | 
					                            desc = L["Zoomes the icon to remove borders"],
 | 
				
			||||||
 | 
					                            order = 2,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        racialSize = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Icon size"],
 | 
				
			||||||
 | 
					                            min = 5,
 | 
				
			||||||
 | 
					                            max = 100,
 | 
				
			||||||
 | 
					                            step = 1,
 | 
				
			||||||
 | 
					                            order = 3,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        racialWidthFactor = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Icon width factor"],
 | 
				
			||||||
 | 
					                            min = 0.5,
 | 
				
			||||||
 | 
					                            max = 2,
 | 
				
			||||||
 | 
					                            step = 0.05,
 | 
				
			||||||
 | 
					                            order = 4,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                cooldown = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Cooldown"],
 | 
				
			||||||
 | 
					                    order = 2,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        header = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Cooldown"],
 | 
				
			||||||
 | 
					                            order = 4,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        racialDisableCircle = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["No Cooldown Circle"],
 | 
				
			||||||
 | 
					                            order = 7,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        racialCooldownAlpha = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Cooldown circle alpha"],
 | 
				
			||||||
 | 
					                            min = 0,
 | 
				
			||||||
 | 
					                            max = 1,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            order = 8,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        racialCooldownNumberAlpha = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Cooldown number alpha"],
 | 
				
			||||||
 | 
					                            min = 0,
 | 
				
			||||||
 | 
					                            max = 1,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            order = 9,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                font = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Font"],
 | 
				
			||||||
 | 
					                    order = 3,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        header = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Font"],
 | 
				
			||||||
 | 
					                            order = 4,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        racialFont = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "select",
 | 
				
			||||||
 | 
					                            name = L["Font"],
 | 
				
			||||||
 | 
					                            desc = L["Font of the cooldown"],
 | 
				
			||||||
 | 
					                            order = 11,
 | 
				
			||||||
 | 
					                            dialogControl = "LSM30_Font",
 | 
				
			||||||
 | 
					                            values = AceGUIWidgetLSMlists.font,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        racialFontScale = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Font scale"],
 | 
				
			||||||
 | 
					                            desc = L["Scale of the font"],
 | 
				
			||||||
 | 
					                            order = 12,
 | 
				
			||||||
 | 
					                            min = 0.1,
 | 
				
			||||||
 | 
					                            max = 2,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                position = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Position"],
 | 
				
			||||||
 | 
					                    order = 5,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        header = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Icon position"],
 | 
				
			||||||
 | 
					                            order = 4,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        racialXOffset = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Horizontal offset"],
 | 
				
			||||||
 | 
					                            order = 23,
 | 
				
			||||||
 | 
					                            min = -400,
 | 
				
			||||||
 | 
					                            max = 400,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        racialYOffset = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Vertical offset"],
 | 
				
			||||||
 | 
					                            order = 24,
 | 
				
			||||||
 | 
					                            min = -400,
 | 
				
			||||||
 | 
					                            max = 400,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                border = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Border"],
 | 
				
			||||||
 | 
					                    order = 4,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        header = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Border"],
 | 
				
			||||||
 | 
					                            order = 4,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        racialBorderStyle = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "select",
 | 
				
			||||||
 | 
					                            name = L["Border style"],
 | 
				
			||||||
 | 
					                            order = 31,
 | 
				
			||||||
 | 
					                            values = Gladdy:GetIconStyles()
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        racialBorderColor = Gladdy:colorOption({
 | 
				
			||||||
 | 
					                            type = "color",
 | 
				
			||||||
 | 
					                            name = L["Border color"],
 | 
				
			||||||
 | 
					                            desc = L["Color of the border"],
 | 
				
			||||||
 | 
					                            order = 32,
 | 
				
			||||||
 | 
					                            hasAlpha = true,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                frameStrata = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Frame Strata and Level"],
 | 
				
			||||||
 | 
					                    order = 6,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        headerAuraLevel = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Frame Strata and Level"],
 | 
				
			||||||
 | 
					                            order = 1,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        racialFrameStrata = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "select",
 | 
				
			||||||
 | 
					                            name = L["Frame Strata"],
 | 
				
			||||||
 | 
					                            order = 2,
 | 
				
			||||||
 | 
					                            values = Gladdy.frameStrata,
 | 
				
			||||||
 | 
					                            sorting = Gladdy.frameStrataSorting,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        racialFrameLevel = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Frame Level"],
 | 
				
			||||||
 | 
					                            min = 0,
 | 
				
			||||||
 | 
					                            max = 500,
 | 
				
			||||||
 | 
					                            step = 1,
 | 
				
			||||||
 | 
					                            order = 3,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- LAGACY HANDLER
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Racial:LegacySetPosition(racial, unit)
 | 
				
			||||||
 | 
					    if Gladdy.db.newLayout then
 | 
				
			||||||
 | 
					        return Gladdy.db.newLayout
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    local ANCHORS = { ["LEFT"] = "RIGHT", ["RIGHT"] = "LEFT", ["BOTTOM"] = "TOP", ["TOP"] = "BOTTOM"}
 | 
				
			||||||
 | 
					    racial:ClearAllPoints()
 | 
				
			||||||
 | 
					    local parent = Gladdy.buttons[unit][Gladdy.db.racialAnchor]
 | 
				
			||||||
 | 
					    if (Gladdy.db.racialPos == "RIGHT") then
 | 
				
			||||||
 | 
					        racial:SetPoint(ANCHORS[Gladdy.db.racialPos], parent, Gladdy.db.racialPos, Gladdy.db.padding + Gladdy.db.racialXOffset, Gladdy.db.racialYOffset)
 | 
				
			||||||
 | 
					    elseif (Gladdy.db.racialPos == "LEFT") then
 | 
				
			||||||
 | 
					        racial:SetPoint(ANCHORS[Gladdy.db.racialPos], parent, Gladdy.db.racialPos, -Gladdy.db.padding + Gladdy.db.racialXOffset, Gladdy.db.racialYOffset)
 | 
				
			||||||
 | 
					    elseif (Gladdy.db.racialPos == "TOP") then
 | 
				
			||||||
 | 
					        racial:SetPoint(ANCHORS[Gladdy.db.racialPos], parent, Gladdy.db.racialPos, Gladdy.db.racialXOffset, Gladdy.db.padding + Gladdy.db.racialYOffset)
 | 
				
			||||||
 | 
					    elseif (Gladdy.db.racialPos == "BOTTOM") then
 | 
				
			||||||
 | 
					        racial:SetPoint(ANCHORS[Gladdy.db.racialPos], parent, Gladdy.db.racialPos, Gladdy.db.racialXOffset, -Gladdy.db.padding + Gladdy.db.racialYOffset)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    return Gladdy.db.newLayout
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
							
								
								
									
										395
									
								
								Modules/RangeCheck.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										395
									
								
								Modules/RangeCheck.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,395 @@
 | 
				
			|||||||
 | 
					local UnitIsConnected = UnitIsConnected
 | 
				
			||||||
 | 
					local UnitInPhase = UnitInPhase
 | 
				
			||||||
 | 
					local UnitInRaid = UnitInRaid
 | 
				
			||||||
 | 
					local UnitInParty = UnitInParty
 | 
				
			||||||
 | 
					local UnitInRange = UnitInRange
 | 
				
			||||||
 | 
					local CheckInteractDistance = CheckInteractDistance
 | 
				
			||||||
 | 
					local C_Timer = C_Timer
 | 
				
			||||||
 | 
					local UnitIsUnit = UnitIsUnit
 | 
				
			||||||
 | 
					local UnitClass = UnitClass
 | 
				
			||||||
 | 
					local GetSpellInfo = GetSpellInfo
 | 
				
			||||||
 | 
					local RAID_CLASS_COLORS = RAID_CLASS_COLORS
 | 
				
			||||||
 | 
					local LOCALIZED_CLASS_NAMES_MALE = LOCALIZED_CLASS_NAMES_MALE
 | 
				
			||||||
 | 
					local CLASS_ICON_TCOORDS = CLASS_ICON_TCOORDS
 | 
				
			||||||
 | 
					local select, ipairs, type, tonumber, tostring, format = select, ipairs, type, tonumber, tostring, format
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local LibStub = LibStub
 | 
				
			||||||
 | 
					local Gladdy = LibStub("Gladdy")
 | 
				
			||||||
 | 
					local LSR = LibStub("SpellRange-1.0")
 | 
				
			||||||
 | 
					local L = Gladdy.L
 | 
				
			||||||
 | 
					local HealthBar = Gladdy.modules["Health Bar"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local classSpells = {
 | 
				
			||||||
 | 
					    ["MAGE"] =  118,
 | 
				
			||||||
 | 
					    ["PRIEST"] = 32379,
 | 
				
			||||||
 | 
					    ["DRUID"] = 33786,
 | 
				
			||||||
 | 
					    ["SHAMAN"] = 10414,
 | 
				
			||||||
 | 
					    ["PALADIN"] = 10308,
 | 
				
			||||||
 | 
					    ["WARLOCK"] = 5782,
 | 
				
			||||||
 | 
					    ["WARRIOR"] = 25275,
 | 
				
			||||||
 | 
					    ["HUNTER"] = 27018,
 | 
				
			||||||
 | 
					    ["ROGUE"] = 36554,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function defaultSpells()
 | 
				
			||||||
 | 
					    local defaults = {}
 | 
				
			||||||
 | 
					    for _,class in ipairs(Gladdy.CLASSES) do
 | 
				
			||||||
 | 
					        defaults[class] = { min = classSpells[class] }
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    return defaults
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local RangeCheck = Gladdy:NewModule("Range Check", nil, {
 | 
				
			||||||
 | 
					    rangeCheckEnabled = true,
 | 
				
			||||||
 | 
					    rangeCheckDefaultSpells = defaultSpells(),
 | 
				
			||||||
 | 
					    rangeCheckOorFactor = 1.5,
 | 
				
			||||||
 | 
					    rangeCheckHealthBar = true,
 | 
				
			||||||
 | 
					    rangeCheckHealthBarText = true,
 | 
				
			||||||
 | 
					    rangeCheckPowerBar = true,
 | 
				
			||||||
 | 
					    rangeCheckPowerBarText = true,
 | 
				
			||||||
 | 
					    rangeCheckClassIcon = false,
 | 
				
			||||||
 | 
					    rangeCheckTrinket = false,
 | 
				
			||||||
 | 
					    rangeCheckRacial = false,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function RangeCheck:Initialize()
 | 
				
			||||||
 | 
					    if Gladdy.db.rangeCheckEnabled then
 | 
				
			||||||
 | 
					        self:RegisterMessage("JOINED_ARENA")
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    self.playerClass = select(2, UnitClass("player"))
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function RangeCheck:UpdateFrameOnce()
 | 
				
			||||||
 | 
					    if Gladdy.db.rangeCheckEnabled then
 | 
				
			||||||
 | 
					        self:RegisterMessage("JOINED_ARENA")
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        self:UnregisterAllMessages()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function RangeCheck:Reset()
 | 
				
			||||||
 | 
					    self.test = nil
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function RangeCheck:ResetUnit(unit)
 | 
				
			||||||
 | 
					    local button = Gladdy.buttons[unit]
 | 
				
			||||||
 | 
					    self:CancelTimer(button)
 | 
				
			||||||
 | 
					    self:SetColor(button, 1)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function RangeCheck:Test(unit)
 | 
				
			||||||
 | 
					    local button = Gladdy.buttons[unit]
 | 
				
			||||||
 | 
					    if not button then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    self.test = true
 | 
				
			||||||
 | 
					    button.lastState = 0
 | 
				
			||||||
 | 
					    if Gladdy.db.rangeCheckEnabled then
 | 
				
			||||||
 | 
					        if unit == "arena2" or unit == "arena4" then
 | 
				
			||||||
 | 
					            --button.unit = "target"
 | 
				
			||||||
 | 
					            --self:CreateTimer(button)
 | 
				
			||||||
 | 
					            self:SetRangeAlpha(button, nil)
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            self:SetRangeAlpha(button, true)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        self:SetRangeAlpha(button, true)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function RangeCheck:UpdateFrame(unit)
 | 
				
			||||||
 | 
					    if self.test then
 | 
				
			||||||
 | 
					        self:Test(unit)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function RangeCheck:SetColor(button, oorFac)
 | 
				
			||||||
 | 
					    if button.lastState == oorFac then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if Gladdy.db.rangeCheckHealthBar then
 | 
				
			||||||
 | 
					        button.healthBar.hp.oorFactor = oorFac
 | 
				
			||||||
 | 
					        HealthBar:SetHealthStatusBarColor(button.unit, button.healthBar.hp.current, button.healthBar.hp.max)
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        button.healthBar.hp.oorFactor = 1
 | 
				
			||||||
 | 
					        HealthBar:SetHealthStatusBarColor(button.unit, button.healthBar.hp.current, button.healthBar.hp.max)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if Gladdy.db.rangeCheckHealthBarText then
 | 
				
			||||||
 | 
					        button.healthBar.nameText:SetTextColor(Gladdy.db.healthBarFontColor.r/oorFac, Gladdy.db.healthBarFontColor.g/oorFac, Gladdy.db.healthBarFontColor.b/oorFac, Gladdy.db.healthBarFontColor.a)
 | 
				
			||||||
 | 
					        button.healthBar.healthText:SetTextColor(Gladdy.db.healthBarFontColor.r/oorFac, Gladdy.db.healthBarFontColor.g/oorFac, Gladdy.db.healthBarFontColor.b/oorFac, Gladdy.db.healthBarFontColor.a)
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        button.healthBar.nameText:SetTextColor(Gladdy.db.healthBarFontColor.r, Gladdy.db.healthBarFontColor.g, Gladdy.db.healthBarFontColor.b, Gladdy.db.healthBarFontColor.a)
 | 
				
			||||||
 | 
					        button.healthBar.healthText:SetTextColor(Gladdy.db.healthBarFontColor.r, Gladdy.db.healthBarFontColor.g, Gladdy.db.healthBarFontColor.b, Gladdy.db.healthBarFontColor.a)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if Gladdy.db.rangeCheckPowerBar then
 | 
				
			||||||
 | 
					        button.powerBar.energy:SetStatusBarColor(button.powerBar.powerColor.r/oorFac, button.powerBar.powerColor.g/oorFac, button.powerBar.powerColor.b/oorFac, 1)
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        button.powerBar.energy:SetStatusBarColor(button.powerBar.powerColor.r, button.powerBar.powerColor.g, button.powerBar.powerColor.b, 1)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if Gladdy.db.rangeCheckPowerBarText then
 | 
				
			||||||
 | 
					        button.powerBar.raceText:SetTextColor(Gladdy.db.powerBarFontColor.r/oorFac, Gladdy.db.powerBarFontColor.g/oorFac, Gladdy.db.powerBarFontColor.b/oorFac, Gladdy.db.powerBarFontColor.a)
 | 
				
			||||||
 | 
					        button.powerBar.powerText:SetTextColor(Gladdy.db.powerBarFontColor.r/oorFac, Gladdy.db.powerBarFontColor.g/oorFac, Gladdy.db.powerBarFontColor.b/oorFac, Gladdy.db.powerBarFontColor.a)
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        button.powerBar.raceText:SetTextColor(Gladdy.db.powerBarFontColor.r, Gladdy.db.powerBarFontColor.g, Gladdy.db.powerBarFontColor.b, Gladdy.db.powerBarFontColor.a)
 | 
				
			||||||
 | 
					        button.powerBar.powerText:SetTextColor(Gladdy.db.powerBarFontColor.r, Gladdy.db.powerBarFontColor.g, Gladdy.db.powerBarFontColor.b, Gladdy.db.powerBarFontColor.a)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if Gladdy.db.rangeCheckTrinket then
 | 
				
			||||||
 | 
					        button.trinket.texture:SetVertexColor(1/oorFac, 1/oorFac, 1/oorFac)
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        button.trinket.texture:SetVertexColor(1, 1, 1)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if Gladdy.db.rangeCheckClassIcon then
 | 
				
			||||||
 | 
					        button.classIcon.texture:SetVertexColor(1/oorFac, 1/oorFac, 1/oorFac)
 | 
				
			||||||
 | 
					        button.aura.icon:SetVertexColor(1/oorFac, 1/oorFac, 1/oorFac)
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        button.classIcon.texture:SetVertexColor(1, 1, 1)
 | 
				
			||||||
 | 
					        button.aura.icon:SetVertexColor(1, 1, 1)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if Gladdy.db.rangeCheckRacial then
 | 
				
			||||||
 | 
					        button.racial.texture:SetVertexColor(1/oorFac, 1/oorFac, 1/oorFac)
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        button.racial.texture:SetVertexColor(1, 1, 1)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    button.lastState = oorFac
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function RangeCheck:SetRangeAlpha(button, inRange)
 | 
				
			||||||
 | 
					    local oorFac = Gladdy.db.rangeCheckOorFactor
 | 
				
			||||||
 | 
					    if inRange then
 | 
				
			||||||
 | 
					        RangeCheck:SetColor(button, 1)
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        RangeCheck:SetColor(button, oorFac)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function RangeCheck:JOINED_ARENA()
 | 
				
			||||||
 | 
					    self.test = nil
 | 
				
			||||||
 | 
					    if Gladdy.db.rangeCheckEnabled then
 | 
				
			||||||
 | 
					        for i = 1, Gladdy.curBracket do
 | 
				
			||||||
 | 
					            local button = Gladdy.buttons["arena"..i]
 | 
				
			||||||
 | 
					            --if i == 1 then button.unit = "focus" end
 | 
				
			||||||
 | 
					            self:CreateTimer(button)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function RangeCheck.CheckRange(self)
 | 
				
			||||||
 | 
					    local button = self.parent
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    local spell = Gladdy.db.rangeCheckDefaultSpells[RangeCheck.playerClass].min
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (not UnitIsConnected(button.unit) or not UnitInPhase(button.unit)) then
 | 
				
			||||||
 | 
					        RangeCheck:SetRangeAlpha(button, false)
 | 
				
			||||||
 | 
					    elseif (spell) then
 | 
				
			||||||
 | 
					        RangeCheck:SetRangeAlpha(button, LSR.IsSpellInRange(spell, button.unit) == 1)
 | 
				
			||||||
 | 
					        -- That didn't work, but they are grouped lets try the actual API for this, it's a bit flaky though and not that useful generally
 | 
				
			||||||
 | 
					    elseif (UnitInRaid(button.unit) or UnitInParty(button.unit)) then
 | 
				
			||||||
 | 
					        RangeCheck:SetRangeAlpha(button, UnitInRange(button.unit, "player"))
 | 
				
			||||||
 | 
					        -- Nope, fall back to interaction :(
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        RangeCheck:SetRangeAlpha(button, CheckInteractDistance(button.unit, 4))
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function RangeCheck:CreateTimer(frame)
 | 
				
			||||||
 | 
					    if not frame.range then
 | 
				
			||||||
 | 
					        frame.range = C_Timer.NewTicker(0.05, RangeCheck.CheckRange)
 | 
				
			||||||
 | 
					        frame.range.parent = frame
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function RangeCheck:CancelTimer(frame)
 | 
				
			||||||
 | 
					    if frame.range then
 | 
				
			||||||
 | 
					        frame.range:Cancel()
 | 
				
			||||||
 | 
					        frame.range = nil
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function RangeCheck:ForceUpdate(frame)
 | 
				
			||||||
 | 
					    if( UnitIsUnit(frame.unit, "player") ) then
 | 
				
			||||||
 | 
					        frame.healthBar:SetAlpha(1)
 | 
				
			||||||
 | 
					        frame.powerBar:SetAlpha(1)
 | 
				
			||||||
 | 
					        self:CancelTimer(frame)
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        self:CreateTimer(frame)
 | 
				
			||||||
 | 
					        self.CheckRange(frame.parent)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function RangeCheck:GetOptions()
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
					        header = {
 | 
				
			||||||
 | 
					            type = "header",
 | 
				
			||||||
 | 
					            name = L["Range Check"],
 | 
				
			||||||
 | 
					            order = 2,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        rangeCheckEnabled = Gladdy:option({
 | 
				
			||||||
 | 
					            type = "toggle",
 | 
				
			||||||
 | 
					            name = L["Enabled"],
 | 
				
			||||||
 | 
					            desc = L["Enable racial icon"],
 | 
				
			||||||
 | 
					            order = 3,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
 | 
					        group = {
 | 
				
			||||||
 | 
					            type = "group",
 | 
				
			||||||
 | 
					            childGroups = "tree",
 | 
				
			||||||
 | 
					            name = L["General"],
 | 
				
			||||||
 | 
					            order = 5,
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.rangeCheckEnabled end,
 | 
				
			||||||
 | 
					            args = {
 | 
				
			||||||
 | 
					                general = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["General"],
 | 
				
			||||||
 | 
					                    order = 1,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        header = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["General"],
 | 
				
			||||||
 | 
					                            order = 1,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        rangeCheckOorFactor = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Out of Range Darkening Level"],
 | 
				
			||||||
 | 
					                            desc = L["Higher is darker"],
 | 
				
			||||||
 | 
					                            min = 1.1,
 | 
				
			||||||
 | 
					                            max = 5,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                            order = 2,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        rangeCheckHealthBar = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["Fade"] .. " " .. L["Health Bar"],
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                            order = 3,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        rangeCheckHealthBarText = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["Fade"] .. " " ..  L["Health Bar Text"],
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                            order = 4,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        rangeCheckPowerBar = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["Fade"] .. " " ..  L["Power Bar"],
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                            order = 5,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        rangeCheckPowerBarText = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["Fade"] .. " " ..  L["Power Bar Text"],
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                            order = 6,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        rangeCheckClassIcon = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["Fade"] .. " " ..  L["Class Icon"],
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                            order = 7,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        rangeCheckTrinket = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["Fade"] .. " " ..  L["Trinket"],
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                            order = 8,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        rangeCheckRacial = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["Fade"] .. " " ..  L["Racial"],
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                            order = 9,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        oorSpells = {
 | 
				
			||||||
 | 
					            type = "group",
 | 
				
			||||||
 | 
					            childGroups = "tree",
 | 
				
			||||||
 | 
					            name = L["Spells"],
 | 
				
			||||||
 | 
					            order = 5,
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.rangeCheckEnabled end,
 | 
				
			||||||
 | 
					            args = RangeCheck:GetSpells(),
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function RangeCheck:GetSpells()
 | 
				
			||||||
 | 
					    local group = {
 | 
				
			||||||
 | 
					        description = {
 | 
				
			||||||
 | 
					            type = "description",
 | 
				
			||||||
 | 
					            name = L["Changing the spellID only applies to your player class!\n\nExample: If you are a Paladin and wish to change your range check spell to Repentance, edit the Paladin spellID to 20066."],
 | 
				
			||||||
 | 
					            order = 1,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    for i,class in ipairs(Gladdy.CLASSES) do
 | 
				
			||||||
 | 
					        group[class] = {
 | 
				
			||||||
 | 
					            type = "group",
 | 
				
			||||||
 | 
					            name = LOCALIZED_CLASS_NAMES_MALE[class],
 | 
				
			||||||
 | 
					            order = i + 1,
 | 
				
			||||||
 | 
					            icon = "Interface\\Glues\\CharacterCreate\\UI-CharacterCreate-Classes",
 | 
				
			||||||
 | 
					            iconCoords = CLASS_ICON_TCOORDS[class],
 | 
				
			||||||
 | 
					            args = {
 | 
				
			||||||
 | 
					                headerMin = {
 | 
				
			||||||
 | 
					                    type = "header",
 | 
				
			||||||
 | 
					                    name = GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min) and format("|T%s:20|t %s - %d" .. L["yds"], select(3, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)), select(1, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)), select(6, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)))
 | 
				
			||||||
 | 
					                            or "nil",
 | 
				
			||||||
 | 
					                    order = 1,
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                min = {
 | 
				
			||||||
 | 
					                    type = "input",
 | 
				
			||||||
 | 
					                    name = "Spell ID", --format("|T%s:20|t %s", select(3, GetSpellInfo(k)), select(1, GetSpellInfo(k)))
 | 
				
			||||||
 | 
					                    order = 2,
 | 
				
			||||||
 | 
					                    width = "full",
 | 
				
			||||||
 | 
					                    pattern = "%d+",
 | 
				
			||||||
 | 
					                    validate = function(_, value)
 | 
				
			||||||
 | 
					                        LibStub("AceConfigRegistry-3.0"):NotifyChange("Gladdy")
 | 
				
			||||||
 | 
					                        return type(tonumber(value)) == "number"
 | 
				
			||||||
 | 
					                    end,
 | 
				
			||||||
 | 
					                    --image = select(3, GetSpellInfo(defaultSpells()[class].min)),
 | 
				
			||||||
 | 
					                    get = function(_)
 | 
				
			||||||
 | 
					                        return tostring(Gladdy.db.rangeCheckDefaultSpells[class].min)
 | 
				
			||||||
 | 
					                        end,
 | 
				
			||||||
 | 
					                    set = function(_, value)
 | 
				
			||||||
 | 
					                        Gladdy.db.rangeCheckDefaultSpells[class].min = tonumber(value)
 | 
				
			||||||
 | 
					                        --Gladdy.options.args["Range Check"].args.oorSpells.args[class].args.min.name = GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min) and format("|T%s:20|t %s", select(3, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)), select(1, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)))
 | 
				
			||||||
 | 
					                        --        or "nil"
 | 
				
			||||||
 | 
					                        Gladdy.options.args["Range Check"].args.oorSpells.args[class].args.headerMin.name = GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min) and format("|T%s:20|t %s - %d" .. L["yds"], select(3, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)), select(1, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)), select(6, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)))
 | 
				
			||||||
 | 
					                                or "nil"
 | 
				
			||||||
 | 
					                    end
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                --[[headerMax = {
 | 
				
			||||||
 | 
					                    type = "header",
 | 
				
			||||||
 | 
					                    name = L["Max"],
 | 
				
			||||||
 | 
					                    order = 3,
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                max = {
 | 
				
			||||||
 | 
					                    type = "input",
 | 
				
			||||||
 | 
					                    name = GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].max) and format("|T%s:20|t %s", select(3, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].max)), select(1, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].max)))
 | 
				
			||||||
 | 
					                            or "nil",
 | 
				
			||||||
 | 
					                    order = 4,
 | 
				
			||||||
 | 
					                    width = "full",
 | 
				
			||||||
 | 
					                    pattern = "%d+",
 | 
				
			||||||
 | 
					                    validate = function(_, value)
 | 
				
			||||||
 | 
					                        return type(tonumber(value)) == "number"
 | 
				
			||||||
 | 
					                    end,
 | 
				
			||||||
 | 
					                    --image = select(3, GetSpellInfo(defaultSpells()[class].max)),
 | 
				
			||||||
 | 
					                    get = function(_)
 | 
				
			||||||
 | 
					                        return tostring(Gladdy.db.rangeCheckDefaultSpells[class].max)
 | 
				
			||||||
 | 
					                    end,
 | 
				
			||||||
 | 
					                    set = function(_, value)
 | 
				
			||||||
 | 
					                        Gladdy.db.rangeCheckDefaultSpells[class].max = tonumber(value)
 | 
				
			||||||
 | 
					                        Gladdy.options.args["Range Check"].args.oorSpells.args[class].args.max.name = GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].max) and format("|T%s:20|t %s", select(3, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].max)), select(1, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].max)))
 | 
				
			||||||
 | 
					                                or "nil"
 | 
				
			||||||
 | 
					                    end
 | 
				
			||||||
 | 
					                }--]]
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    return group
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
							
								
								
									
										447
									
								
								Modules/ShadowsightTimer.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										447
									
								
								Modules/ShadowsightTimer.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,447 @@
 | 
				
			|||||||
 | 
					local floor, str_find, pairs = math.floor, string.find, pairs
 | 
				
			||||||
 | 
					local CreateFrame = CreateFrame
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- CORE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local Gladdy = LibStub("Gladdy")
 | 
				
			||||||
 | 
					local L = Gladdy.L
 | 
				
			||||||
 | 
					local ShadowsightTimer = Gladdy:NewModule("Shadowsight Timer", nil, {
 | 
				
			||||||
 | 
					    shadowsightTimerEnabled = true,
 | 
				
			||||||
 | 
					    shadowsightTimerLocked = false,
 | 
				
			||||||
 | 
					    shadowsightTimerScale = 1,
 | 
				
			||||||
 | 
					    shadowsightTimerRelPoint1 = "CENTER",
 | 
				
			||||||
 | 
					    shadowsightTimerRelPoint2 = "CENTER",
 | 
				
			||||||
 | 
					    shadowsightTimerX = 0,
 | 
				
			||||||
 | 
					    shadowsightTimerY = 0,
 | 
				
			||||||
 | 
					    shadowsightAnnounce = true,
 | 
				
			||||||
 | 
					    shadowsightTimerStartTime = 91,
 | 
				
			||||||
 | 
					    shadowsightTimerResetTime = 120,
 | 
				
			||||||
 | 
					    shadowsightTimerShowTwoTimer = false,
 | 
				
			||||||
 | 
					    shadowsightTimerFrameStrata = "HIGH",
 | 
				
			||||||
 | 
					    shadowsightTimerFrameLevel = 20,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- /run LibStub("Gladdy").modules["Shadowsight Timer"]:AURA_GAIN(nil, nil, 34709)
 | 
				
			||||||
 | 
					-- /run LibStub("Gladdy").modules["Shadowsight Timer"].timerFrame1:SetAlpha(0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function ShadowsightTimer:OnEvent(event, ...)
 | 
				
			||||||
 | 
					    self[event](self, ...)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function ShadowsightTimer:Initialize()
 | 
				
			||||||
 | 
					    self.locale = Gladdy:GetArenaTimer()
 | 
				
			||||||
 | 
					    self:CreateAnchor()
 | 
				
			||||||
 | 
					    if Gladdy.db.shadowsightTimerEnabled then
 | 
				
			||||||
 | 
					        self:RegisterMessage("JOINED_ARENA")
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function ShadowsightTimer:Reset()
 | 
				
			||||||
 | 
					    self.anchor:Hide()
 | 
				
			||||||
 | 
					    for i=1,2 do
 | 
				
			||||||
 | 
					        self["timerFrame" .. i].active = false
 | 
				
			||||||
 | 
					        self["timerFrame" .. i]:SetScript("OnUpdate", nil)
 | 
				
			||||||
 | 
					        self["timerFrame" .. i].font:SetTextColor(1, 0.8, 0)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    self:UnregisterEvent("CHAT_MSG_BG_SYSTEM_NEUTRAL")
 | 
				
			||||||
 | 
					    self:SetScript("OnEvent", nil)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- FRAME SETUP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function ShadowsightTimer:CreateTimerFrame(anchor, name, points)
 | 
				
			||||||
 | 
					    local backdrop = {
 | 
				
			||||||
 | 
					        bgFile = "Interface/Tooltips/UI-Tooltip-Background",
 | 
				
			||||||
 | 
					        edgeFile = "",
 | 
				
			||||||
 | 
					        tile = true, tileSize = 16, edgeSize = 10,
 | 
				
			||||||
 | 
					        insets = {left = 0, right = 0, top = 0, bottom = 0}
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    self[name] = CreateFrame("Frame", nil, anchor, BackdropTemplateMixin and "BackdropTemplate")
 | 
				
			||||||
 | 
					    self[name]:SetPoint(points[1], anchor, points[2])
 | 
				
			||||||
 | 
					    self[name]:SetBackdrop(backdrop)
 | 
				
			||||||
 | 
					    self[name]:SetBackdropColor(0,0,0,0.8)
 | 
				
			||||||
 | 
					    self[name]:SetHeight(17)
 | 
				
			||||||
 | 
					    self[name]:SetWidth(35)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    self[name].texture = self[name]:CreateTexture(nil,"OVERLAY")
 | 
				
			||||||
 | 
					    self[name].texture:SetWidth(16)
 | 
				
			||||||
 | 
					    self[name].texture:SetHeight(16)
 | 
				
			||||||
 | 
					    self[name].texture:SetTexture("Interface\\Icons\\Spell_Shadow_EvilEye")
 | 
				
			||||||
 | 
					    self[name].texture:SetTexCoord(0.125,0.875,0.125,0.875)
 | 
				
			||||||
 | 
					    self[name].texture:SetPoint("RIGHT", self[name], "LEFT")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    self[name].font = self[name]:CreateFontString(nil,"OVERLAY","GameFontNormal")
 | 
				
			||||||
 | 
					    self[name].font:SetPoint("LEFT", 5, 0)
 | 
				
			||||||
 | 
					    self[name].font:SetJustifyH("LEFT")
 | 
				
			||||||
 | 
					    self[name].font:SetTextColor(1, 0.8, 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    self[name]:SetFrameStrata(Gladdy.db.shadowsightTimerFrameStrata)
 | 
				
			||||||
 | 
					    self[name]:SetFrameLevel(Gladdy.db.shadowsightTimerFrameLevel)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function ShadowsightTimer:CreateAnchor()
 | 
				
			||||||
 | 
					    self.anchor = CreateFrame("Frame")
 | 
				
			||||||
 | 
					    self.anchor:SetMovable(true)
 | 
				
			||||||
 | 
					    self.anchor:EnableMouse(true)
 | 
				
			||||||
 | 
					    self.anchor:SetWidth(35)
 | 
				
			||||||
 | 
					    self.anchor:SetHeight(17)
 | 
				
			||||||
 | 
					    self.anchor:SetPoint(Gladdy.db.shadowsightTimerRelPoint1, nil, Gladdy.db.shadowsightTimerRelPoint, Gladdy.db.shadowsightTimerX, Gladdy.db.shadowsightTimerY)
 | 
				
			||||||
 | 
					    self.anchor:SetScript("OnMouseDown",function(self) self:StartMoving() end)
 | 
				
			||||||
 | 
					    self.anchor:SetScript("OnMouseUp",function(self)
 | 
				
			||||||
 | 
					        self:StopMovingOrSizing()
 | 
				
			||||||
 | 
					        Gladdy.db.shadowsightTimerRelPoint1,_,Gladdy.db.shadowsightTimerRelPoint2,Gladdy.db.shadowsightTimerX,Gladdy.db.shadowsightTimerY = self:GetPoint()
 | 
				
			||||||
 | 
					    end)
 | 
				
			||||||
 | 
					    self.anchor:SetScale(Gladdy.db.shadowsightTimerScale)
 | 
				
			||||||
 | 
					    self.anchor:Hide()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    self:CreateTimerFrame(self.anchor, "timerFrame1", {"TOP", "TOP"})
 | 
				
			||||||
 | 
					    local show = Gladdy.db.shadowsightTimerShowTwoTimer
 | 
				
			||||||
 | 
					    self:CreateTimerFrame(show and self.timerFrame1 or self.anchor, "timerFrame2", show and {"TOP", "BOTTOM"} or {"TOP", "TOP"})
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function ShadowsightTimer:UpdateFrameOnce()
 | 
				
			||||||
 | 
					    if Gladdy.db.shadowsightTimerEnabled then
 | 
				
			||||||
 | 
					        self:RegisterMessage("JOINED_ARENA")
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        self:UnregisterAllMessages()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    self.anchor:EnableMouse(not Gladdy.db.shadowsightTimerLocked)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    self.anchor:SetFrameStrata(Gladdy.db.shadowsightTimerFrameStrata)
 | 
				
			||||||
 | 
					    self.anchor:SetFrameLevel(Gladdy.db.shadowsightTimerFrameLevel)
 | 
				
			||||||
 | 
					    self.timerFrame1:SetFrameStrata(Gladdy.db.shadowsightTimerFrameStrata)
 | 
				
			||||||
 | 
					    self.timerFrame1:SetFrameLevel(Gladdy.db.shadowsightTimerFrameLevel)
 | 
				
			||||||
 | 
					    self.timerFrame2:SetFrameStrata(Gladdy.db.shadowsightTimerFrameStrata)
 | 
				
			||||||
 | 
					    self.timerFrame2:SetFrameLevel(Gladdy.db.shadowsightTimerFrameLevel)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if Gladdy.db.shadowsightTimerEnabled then
 | 
				
			||||||
 | 
					        self.anchor:SetScale(Gladdy.db.shadowsightTimerScale)
 | 
				
			||||||
 | 
					        self.anchor:ClearAllPoints()
 | 
				
			||||||
 | 
					        self.anchor:SetPoint(Gladdy.db.shadowsightTimerRelPoint1, nil, Gladdy.db.shadowsightTimerRelPoint2, Gladdy.db.shadowsightTimerX, Gladdy.db.shadowsightTimerY)
 | 
				
			||||||
 | 
					        if Gladdy.frame.testing or Gladdy.curBracket then
 | 
				
			||||||
 | 
					            self.anchor:Show()
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if Gladdy.db.shadowsightTimerShowTwoTimer then
 | 
				
			||||||
 | 
					            self.anchor:SetHeight(34)
 | 
				
			||||||
 | 
					            self.timerFrame2:ClearAllPoints()
 | 
				
			||||||
 | 
					            self.timerFrame2:SetPoint("TOP", self.timerFrame1, "BOTTOM")
 | 
				
			||||||
 | 
					            ShadowsightTimer:NotifyStart()
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            self.anchor:SetHeight(17)
 | 
				
			||||||
 | 
					            self.timerFrame2:ClearAllPoints()
 | 
				
			||||||
 | 
					            self.timerFrame2:SetPoint("TOP", self.anchor, "TOP")
 | 
				
			||||||
 | 
					            ShadowsightTimer:NotifyStart()
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        self.anchor:SetScale(Gladdy.db.shadowsightTimerScale)
 | 
				
			||||||
 | 
					        self.anchor:ClearAllPoints()
 | 
				
			||||||
 | 
					        self.anchor:SetPoint(Gladdy.db.shadowsightTimerRelPoint1, nil, Gladdy.db.shadowsightTimerRelPoint2, Gladdy.db.shadowsightTimerX, Gladdy.db.shadowsightTimerY)
 | 
				
			||||||
 | 
					        self.anchor:Hide()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- EVENT HANDLING
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function ShadowsightTimer:JOINED_ARENA()
 | 
				
			||||||
 | 
					    if Gladdy.db.shadowsightTimerEnabled then
 | 
				
			||||||
 | 
					        self:RegisterEvent("CHAT_MSG_BG_SYSTEM_NEUTRAL")
 | 
				
			||||||
 | 
					        self:SetScript("OnEvent", ShadowsightTimer.OnEvent)
 | 
				
			||||||
 | 
					        for i=1,2 do
 | 
				
			||||||
 | 
					            self["timerFrame" .. i].font:SetText("1:30")
 | 
				
			||||||
 | 
					            self["timerFrame" .. i].font:SetTextColor(1, 0.8, 0)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        self.anchor:Show()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function ShadowsightTimer:AURA_GAIN(unit, auraType, spellID)
 | 
				
			||||||
 | 
					    if (spellID == 34709 and Gladdy.db.shadowsightTimerEnabled) then
 | 
				
			||||||
 | 
					        self:Start(Gladdy.db.shadowsightTimerResetTime, self:GetHiddenTimer())
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function ShadowsightTimer:CHAT_MSG_BG_SYSTEM_NEUTRAL(msg)
 | 
				
			||||||
 | 
					    for k,v in pairs(self.locale) do
 | 
				
			||||||
 | 
					        if str_find(msg, v) then
 | 
				
			||||||
 | 
					            if k == 0 then
 | 
				
			||||||
 | 
					                self:Start(nil, self.timerFrame1)
 | 
				
			||||||
 | 
					                self:Start(nil, self.timerFrame2)
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- TEST
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function ShadowsightTimer:Test()
 | 
				
			||||||
 | 
					    if Gladdy.db.shadowsightTimerEnabled then
 | 
				
			||||||
 | 
					        self.anchor:Show()
 | 
				
			||||||
 | 
					        ShadowsightTimer:JOINED_ARENA()
 | 
				
			||||||
 | 
					        self:Start(20, self.timerFrame1)
 | 
				
			||||||
 | 
					        self:Start(25, self.timerFrame2)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- TIMER
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function ShadowsightTimer:Start(time, frame)
 | 
				
			||||||
 | 
					    frame.endTime = time or Gladdy.db.shadowsightTimerStartTime
 | 
				
			||||||
 | 
					    frame.active = true
 | 
				
			||||||
 | 
					    ShadowsightTimer:NotifyStart()
 | 
				
			||||||
 | 
					    frame.announced = nil
 | 
				
			||||||
 | 
					    frame.timeSinceLastUpdate = 0
 | 
				
			||||||
 | 
					    frame.font:SetTextColor(1, 0.8, 0)
 | 
				
			||||||
 | 
					    frame:SetScript("OnUpdate", ShadowsightTimer.OnUpdate)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function ShadowsightTimer.OnUpdate(self, elapsed)
 | 
				
			||||||
 | 
					    self.timeSinceLastUpdate = self.timeSinceLastUpdate + elapsed;
 | 
				
			||||||
 | 
					    self.endTime = self.endTime - elapsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (self.timeSinceLastUpdate > 0.01) then
 | 
				
			||||||
 | 
					        self.font:SetFormattedText(floor(self.endTime / 60) .. ":" ..  "%02d", self.endTime - floor(self.endTime / 60) * 60)
 | 
				
			||||||
 | 
					        self.timeSinceLastUpdate = 0;
 | 
				
			||||||
 | 
					        if floor(self.endTime) == 15 and Gladdy.db.shadowsightAnnounce and not self.announced then
 | 
				
			||||||
 | 
					            self.announced = true
 | 
				
			||||||
 | 
					            Gladdy:SendMessage("SHADOWSIGHT", L["Shadowsight up in %ds"]:format(15))
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if self.endTime <= 0 then
 | 
				
			||||||
 | 
					        if Gladdy.db.shadowsightAnnounce then
 | 
				
			||||||
 | 
					            Gladdy:SendMessage("SHADOWSIGHT", L["Shadowsight up!"])
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        self:SetScript("OnUpdate", nil)
 | 
				
			||||||
 | 
					        self.font:SetText("0:00")
 | 
				
			||||||
 | 
					        self.font:SetTextColor(0, 1, 0)
 | 
				
			||||||
 | 
					        self.active = false
 | 
				
			||||||
 | 
					        ShadowsightTimer:NotifyEnd()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function ShadowsightTimer:NotifyStart()
 | 
				
			||||||
 | 
					    local show = Gladdy.db.shadowsightTimerShowTwoTimer
 | 
				
			||||||
 | 
					    if self.timerFrame1.active and self.timerFrame2.active then
 | 
				
			||||||
 | 
					        if self.timerFrame1.endTime < self.timerFrame2.endTime then
 | 
				
			||||||
 | 
					            self.timerFrame1:SetAlpha(1)
 | 
				
			||||||
 | 
					            self.timerFrame2:SetAlpha(show and 1 or 0)
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            self.timerFrame1:SetAlpha(show and 1 or 0)
 | 
				
			||||||
 | 
					            self.timerFrame2:SetAlpha(1)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        if self.timerFrame1.active then
 | 
				
			||||||
 | 
					            self.timerFrame1:SetAlpha(1)
 | 
				
			||||||
 | 
					            self.timerFrame2:SetAlpha(show and 1 or 0)
 | 
				
			||||||
 | 
					        elseif self.timerFrame2.active then
 | 
				
			||||||
 | 
					            self.timerFrame1:SetAlpha(show and 1 or 0)
 | 
				
			||||||
 | 
					            self.timerFrame2:SetAlpha(1)
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            self.timerFrame1:SetAlpha(1)
 | 
				
			||||||
 | 
					            self.timerFrame2:SetAlpha(show and 1 or 0)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					function ShadowsightTimer:NotifyEnd()
 | 
				
			||||||
 | 
					    local show = Gladdy.db.shadowsightTimerShowTwoTimer
 | 
				
			||||||
 | 
					    if self.timerFrame1.active then
 | 
				
			||||||
 | 
					        self.timerFrame1:SetAlpha(1)
 | 
				
			||||||
 | 
					        self.timerFrame2:SetAlpha(show and 1 or 0)
 | 
				
			||||||
 | 
					    elseif self.timerFrame2.active then
 | 
				
			||||||
 | 
					        self.timerFrame1:SetAlpha(show and 1 or 0)
 | 
				
			||||||
 | 
					        self.timerFrame2:SetAlpha(1)
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        self.timerFrame1:SetAlpha(1)
 | 
				
			||||||
 | 
					        self.timerFrame2:SetAlpha(show and 1 or 0)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					function ShadowsightTimer:GetHiddenTimer()
 | 
				
			||||||
 | 
					    if self.timerFrame1.active and self.timerFrame2.active then
 | 
				
			||||||
 | 
					        return self.timerFrame1.endTime < self.timerFrame2.endTime and self.timerFrame1 or self.timerFrame2
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        return self.timerFrame1.active and self.timerFrame2 or self.timerFrame1
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- OPTIONS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function ShadowsightTimer:GetOptions()
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
					        headerShadowsight = {
 | 
				
			||||||
 | 
					            type = "header",
 | 
				
			||||||
 | 
					            name = L["Shadowsight Timer"],
 | 
				
			||||||
 | 
					            order = 2,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        shadowsightTimerEnabled = Gladdy:option({
 | 
				
			||||||
 | 
					            type = "toggle",
 | 
				
			||||||
 | 
					            name = L["Enabled"],
 | 
				
			||||||
 | 
					            --desc = L["Turns countdown before the start of an arena match on/off."],
 | 
				
			||||||
 | 
					            order = 3,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
 | 
					        shadowsightTimerLocked = Gladdy:option({
 | 
				
			||||||
 | 
					            type = "toggle",
 | 
				
			||||||
 | 
					            name = L["Locked"],
 | 
				
			||||||
 | 
					            --desc = L["Turns countdown before the start of an arena match on/off."],
 | 
				
			||||||
 | 
					            order = 4,
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.shadowsightTimerEnabled end,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
 | 
					        shadowsightTimerShowTwoTimer = Gladdy:option({
 | 
				
			||||||
 | 
					            type = "toggle",
 | 
				
			||||||
 | 
					            name = L["Show two timers"],
 | 
				
			||||||
 | 
					            order = 5,
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.shadowsightTimerEnabled end,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
 | 
					        shadowsightAnnounce = Gladdy:option({
 | 
				
			||||||
 | 
					            type = "toggle",
 | 
				
			||||||
 | 
					            name = L["Announce"],
 | 
				
			||||||
 | 
					            --desc = L["Turns countdown before the start of an arena match on/off."],
 | 
				
			||||||
 | 
					            order = 6,
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.shadowsightTimerEnabled end,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
 | 
					        group = {
 | 
				
			||||||
 | 
					            type = "group",
 | 
				
			||||||
 | 
					            childGroups = "tree",
 | 
				
			||||||
 | 
					            name = L["Frame"],
 | 
				
			||||||
 | 
					            order = 7,
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.shadowsightTimerEnabled end,
 | 
				
			||||||
 | 
					            args = {
 | 
				
			||||||
 | 
					                general = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Scale"],
 | 
				
			||||||
 | 
					                    order = 1,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        header = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Scale"],
 | 
				
			||||||
 | 
					                            order = 1,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        shadowsightTimerScale = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Scale"],
 | 
				
			||||||
 | 
					                            order = 2,
 | 
				
			||||||
 | 
					                            min = 0.1,
 | 
				
			||||||
 | 
					                            max = 5,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                cooldown = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Cooldown"],
 | 
				
			||||||
 | 
					                    order = 2,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        header = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Shadowsight CDs"],
 | 
				
			||||||
 | 
					                            order = 1,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        shadowsightTimerStartTime = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Start Time"],
 | 
				
			||||||
 | 
					                            desc = L["Start time in seconds"],
 | 
				
			||||||
 | 
					                            min = 80,
 | 
				
			||||||
 | 
					                            max = 100,
 | 
				
			||||||
 | 
					                            order = 2,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        shadowsightTimerResetTime = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Reset Time"],
 | 
				
			||||||
 | 
					                            desc = L["Reset time in seconds"],
 | 
				
			||||||
 | 
					                            min = 110,
 | 
				
			||||||
 | 
					                            max = 130,
 | 
				
			||||||
 | 
					                            order = 3,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                --[[font = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Font"],
 | 
				
			||||||
 | 
					                    order = 3,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        header = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Font"],
 | 
				
			||||||
 | 
					                            order = 4,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        racialFont = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "select",
 | 
				
			||||||
 | 
					                            name = L["Font"],
 | 
				
			||||||
 | 
					                            desc = L["Font of the cooldown"],
 | 
				
			||||||
 | 
					                            order = 11,
 | 
				
			||||||
 | 
					                            dialogControl = "LSM30_Font",
 | 
				
			||||||
 | 
					                            values = AceGUIWidgetLSMlists.font,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        racialFontScale = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Font scale"],
 | 
				
			||||||
 | 
					                            desc = L["Scale of the font"],
 | 
				
			||||||
 | 
					                            order = 12,
 | 
				
			||||||
 | 
					                            min = 0.1,
 | 
				
			||||||
 | 
					                            max = 2,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },--]]
 | 
				
			||||||
 | 
					                frameStrata = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Frame Strata and Level"],
 | 
				
			||||||
 | 
					                    order = 6,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        headerAuraLevel = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Frame Strata and Level"],
 | 
				
			||||||
 | 
					                            order = 1,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        shadowsightTimerFrameStrata = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "select",
 | 
				
			||||||
 | 
					                            name = L["Frame Strata"],
 | 
				
			||||||
 | 
					                            order = 2,
 | 
				
			||||||
 | 
					                            values = Gladdy.frameStrata,
 | 
				
			||||||
 | 
					                            sorting = Gladdy.frameStrataSorting,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        shadowsightTimerFrameLevel = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Frame Level"],
 | 
				
			||||||
 | 
					                            min = 0,
 | 
				
			||||||
 | 
					                            max = 500,
 | 
				
			||||||
 | 
					                            step = 1,
 | 
				
			||||||
 | 
					                            order = 3,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
@@ -1,128 +1,41 @@
 | 
				
			|||||||
local select, pairs, string_lower, tremove, tinsert, format, string_gsub, ipairs = select, pairs, string.lower, tremove, tinsert, format, string.gsub, ipairs
 | 
					local select, pairs, tremove, tinsert, format, strsplit, tonumber, ipairs = select, pairs, tremove, tinsert, format, strsplit, tonumber, ipairs
 | 
				
			||||||
local UnitExists, UnitIsUnit, UnitName = UnitExists, UnitIsUnit, UnitName
 | 
					local UnitExists, UnitIsUnit, UnitIsEnemy, UnitGUID = UnitExists, UnitIsUnit, UnitIsEnemy, UnitGUID
 | 
				
			||||||
local C_NamePlate = C_NamePlate
 | 
					local C_NamePlate = C_NamePlate
 | 
				
			||||||
local Gladdy = LibStub("Gladdy")
 | 
					local Gladdy = LibStub("Gladdy")
 | 
				
			||||||
local L = Gladdy.L
 | 
					local L = Gladdy.L
 | 
				
			||||||
local GetSpellInfo, CreateFrame, GetCVar = GetSpellInfo, CreateFrame, GetCVar
 | 
					local GetSpellInfo, CreateFrame = GetSpellInfo, CreateFrame
 | 
				
			||||||
 | 
					local totemData, npcIdToTotemData = Gladdy:GetTotemData()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
---------------------------------------------------
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Constants
 | 
					-- Option Helpers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
---------------------------------------------------
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local totemData = {
 | 
					 | 
				
			||||||
    -- Fire
 | 
					 | 
				
			||||||
    [string_lower("Searing Totem")] = {id = 3599,texture = select(3, GetSpellInfo(3599)), color = {r = 0, g = 0, b = 0, a = 1}, enabled = true, priority = 0}, -- Searing Totem
 | 
					 | 
				
			||||||
    [string_lower("Flametongue Totem")] = {id = 8227,texture = select(3, GetSpellInfo(8227)), color = {r = 0, g = 0, b = 0, a = 1}, enabled = true, priority = 0}, -- Flametongue Totem
 | 
					 | 
				
			||||||
    [string_lower("Magma Totem")] = {id = 8190,texture = select(3, GetSpellInfo(8190)), color = {r = 0, g = 0, b = 0, a = 1}, enabled = true, priority = 0}, -- Magma Totem
 | 
					 | 
				
			||||||
    [string_lower("Fire Nova Totem")] = {id = 1535,texture = select(3, GetSpellInfo(1535)), color = {r = 0, g = 0, b = 0, a = 1}, enabled = true, priority = 0}, -- Fire Nova Totem
 | 
					 | 
				
			||||||
    [string_lower("Totem of Wrath")] = {id = 30706,texture = select(3, GetSpellInfo(30706)), color = {r = 0, g = 0, b = 0, a = 1}, enabled = true, priority = 1}, -- Totem of Wrath
 | 
					 | 
				
			||||||
    [string_lower("Fire Elemental Totem")] = {id = 32982,texture = select(3, GetSpellInfo(32982)), color = {r = 0, g = 0, b = 0, a = 1}, enabled = true, priority = 0}, -- Fire Elemental Totem
 | 
					 | 
				
			||||||
    [string_lower("Frost Resistance Totem")] = {id = 8181,texture = select(3, GetSpellInfo(8181)), color = {r = 0, g = 0, b = 0, a = 1}, enabled = true, priority = 0}, -- Frost Resistance Totem
 | 
					 | 
				
			||||||
    -- Water
 | 
					 | 
				
			||||||
    [string_lower("Fire Resistance Totem")] = {id = 8184,texture = select(3, GetSpellInfo(8184)), color = {r = 0, g = 0, b = 0, a = 1}, enabled = true, priority = 0}, -- Fire Resistance Totem
 | 
					 | 
				
			||||||
    [string_lower("Poison Cleansing Totem")] = {id = 8166,texture = select(3, GetSpellInfo(8166)), color = {r = 0, g = 0, b = 0, a = 1}, enabled = true, priority = 0}, -- Poison Cleansing Totem
 | 
					 | 
				
			||||||
    [string_lower("Disease Cleansing Totem")] = {id = 8170,texture = select(3, GetSpellInfo(8170)), color = {r = 0, g = 0, b = 0, a = 1}, enabled = true, priority = 0}, -- Disease Cleansing Totem
 | 
					 | 
				
			||||||
    [string_lower("Healing Stream Totem")] = {id = 5394,texture = select(3, GetSpellInfo(5394)), color = {r = 0, g = 0, b = 0, a = 1}, enabled = true, priority = 0}, -- Healing Stream Totem
 | 
					 | 
				
			||||||
    [string_lower("Mana Tide Totem")] = {id = 16190,texture = select(3, GetSpellInfo(16190)), color = {r = 0.078, g = 0.9, b = 0.16, a = 1}, enabled = true, priority = 3}, -- Mana Tide Totem
 | 
					 | 
				
			||||||
    [string_lower("Mana Spring Totem")] = {id = 5675,texture = "Interface\\AddOns\\Gladdy\\Images\\Totems\\Spell_Nature_ManaRegenTotem_edit", color = {r = 0, g = 0, b = 0, a = 1}, enabled = true, priority = 1}, -- Mana Spring Totem
 | 
					 | 
				
			||||||
    -- Earth
 | 
					 | 
				
			||||||
    [string_lower("Earthbind Totem")] = {id = 2484,texture = select(3, GetSpellInfo(2484)), color = {r = 0.5, g = 0.5, b = 0.5, a = 1}, enabled = true, priority = 1}, -- Earthbind Totem
 | 
					 | 
				
			||||||
    [string_lower("Stoneclaw Totem")] = {id = 5730,texture = select(3, GetSpellInfo(5730)), color = {r = 0, g = 0, b = 0, a = 1}, enabled = true, priority = 0}, -- Stoneclaw Totem
 | 
					 | 
				
			||||||
    [string_lower("Stoneskin Totem")] = {id = 8071,texture = select(3, GetSpellInfo(8071)), color = {r = 0, g = 0, b = 0, a = 1}, enabled = true, priority = 0}, -- Stoneskin Totem
 | 
					 | 
				
			||||||
    [string_lower("Strength of Earth Totem")] = {id = 8075,texture = select(3, GetSpellInfo(8075)), color = {r = 0, g = 0, b = 0, a = 1}, enabled = true, priority = 0}, -- Strength of Earth Totem
 | 
					 | 
				
			||||||
    [string_lower("Earth Elemental Totem")] = {id = 33663,texture = select(3, GetSpellInfo(33663)), color = {r = 0, g = 0, b = 0, a = 1}, enabled = true, priority = 0}, -- Earth Elemental Totem
 | 
					 | 
				
			||||||
    [string_lower("Tremor Totem")] = {id = 8143,texture = select(3, GetSpellInfo(8143)), color = {r = 1, g = 0.9, b = 0.1, a = 1}, enabled = true, priority = 3}, -- Tremor Totem
 | 
					 | 
				
			||||||
    -- Air
 | 
					 | 
				
			||||||
    [string_lower("Grounding Totem")] = {id = 8177,texture = select(3, GetSpellInfo(8177)), color = {r = 0, g = 0.53, b = 0.92, a = 1}, enabled = true, priority = 3}, -- Grounding Totem
 | 
					 | 
				
			||||||
    [string_lower("Grace of Air Totem")] = {id = 8835,texture = "Interface\\AddOns\\Gladdy\\Images\\Totems\\Spell_Nature_InvisibilityTotem_edit", color = {r = 0, g = 0, b = 0, a = 1}, enabled = true, priority = 0}, -- Grace of Air Totem
 | 
					 | 
				
			||||||
    [string_lower("Nature Resistance Totem")] = {id = 10595,texture = select(3, GetSpellInfo(10595)), color = {r = 0, g = 0, b = 0, a = 1}, enabled = true, priority = 0}, -- Nature Resistance Totem
 | 
					 | 
				
			||||||
    [string_lower("Windfury Totem")] = {id = 8512,texture = "Interface\\AddOns\\Gladdy\\Images\\Totems\\Spell_Nature_Windfury_edit", color = {r = 0.96, g = 0, b = 0.07, a = 1}, enabled = true, priority = 2}, -- Windfury Totem
 | 
					 | 
				
			||||||
    [string_lower("Sentry Totem")] = {id = 6495, texture = "Interface\\AddOns\\Gladdy\\Images\\Totems\\Spell_Nature_RemoveCurse_edit", color = {r = 0, g = 0, b = 0, a = 1}, enabled = true, priority = 0}, -- Sentry Totem
 | 
					 | 
				
			||||||
    [string_lower("Windwall Totem")] = {id = 15107,texture = select(3, GetSpellInfo(15107)), color = {r = 0, g = 0, b = 0, a = 1}, enabled = true, priority = 0}, -- Windwall Totem
 | 
					 | 
				
			||||||
    [string_lower("Wrath of Air Totem")] = {id = 3738,texture = "Interface\\AddOns\\Gladdy\\Images\\Totems\\Spell_Nature_SlowingTotem_edit", color = {r = 0, g = 0, b = 0, a = 1}, enabled = true, priority = 0}, -- Wrath of Air Totem
 | 
					 | 
				
			||||||
    [string_lower("Tranquil Air Totem")] = {id = 25908,texture = "Interface\\Icons\\INV_Staff_07", color = {r = 0, g = 0, b = 0, a = 1}, enabled = true, priority = 0}, -- Tranquil Air Totem
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
local localizedTotemData = {
 | 
					 | 
				
			||||||
    ["default"] = {
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(3599)))] = totemData[string_lower("Searing Totem")], -- Searing Totem
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(8227)))] = totemData[string_lower("Flametongue Totem")], -- Flametongue Totem
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(8190)))] = totemData[string_lower("Magma Totem")], -- Magma Totem
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(1535)))] = totemData[string_lower("Fire Nova Totem")], -- Fire Nova Totem
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(30706)))] = totemData[string_lower("Totem of Wrath")], -- Totem of Wrath
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(32982)))] = totemData[string_lower("Fire Elemental Totem")], -- Fire Elemental Totem
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(8181)))] = totemData[string_lower("Frost Resistance Totem")], -- Frost Resistance Totem
 | 
					 | 
				
			||||||
        -- Water
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(8184)))] = totemData[string_lower("Fire Resistance Totem")], -- Fire Resistance Totem
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(8166)))] = totemData[string_lower("Poison Cleansing Totem")], -- Poison Cleansing Totem
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(8170)))] = totemData[string_lower("Disease Cleansing Totem")], -- Disease Cleansing Totem
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(5394)))] = totemData[string_lower("Healing Stream Totem")], -- Healing Stream Totem
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(16190)))] = totemData[string_lower("Mana Tide Totem")], -- Mana Tide Totem
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(5675)))] = totemData[string_lower("Mana Spring Totem")], -- Mana Spring Totem
 | 
					 | 
				
			||||||
        -- Earth
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(2484)))] = totemData[string_lower("Earthbind Totem")], -- Earthbind Totem
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(5730)))] = totemData[string_lower("Stoneclaw Totem")], -- Stoneclaw Totem
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(8071)))] = totemData[string_lower("Stoneskin Totem")], -- Stoneskin Totem
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(8075)))] = totemData[string_lower("Strength of Earth Totem")], -- Strength of Earth Totem
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(33663)))] = totemData[string_lower("Earth Elemental Totem")], -- Earth Elemental Totem
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(8143)))] = totemData[string_lower("Tremor Totem")], -- Tremor Totem
 | 
					 | 
				
			||||||
        -- Air
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(8177)))] = totemData[string_lower("Grounding Totem")], -- Grounding Totem
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(8835)))] = totemData[string_lower("Grace of Air Totem")], -- Grace of Air Totem
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(10595)))] = totemData[string_lower("Nature Resistance Totem")], -- Nature Resistance Totem
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(8512)))] = totemData[string_lower("Windfury Totem")], -- Windfury Totem
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(6495)))] = totemData[string_lower("Sentry Totem")], -- Sentry Totem
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(15107)))] = totemData[string_lower("Windwall Totem")], -- Windwall Totem
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(3738)))] = totemData[string_lower("Wrath of Air Totem")], -- Wrath of Air Totem
 | 
					 | 
				
			||||||
        [string_lower(select(1, GetSpellInfo(25908)))] = totemData[string_lower("Tranquil Air Totem")], -- Tranquil Air Totem
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    ["frFR"] = {
 | 
					 | 
				
			||||||
        [string_lower("Totem incendiaire")] = totemData[string_lower("Searing Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem Langue de feu")] = totemData[string_lower("Flametongue Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem de lien terrestre")] = totemData[string_lower("Earthbind Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem de Griffes de pierre")] = totemData[string_lower("Stoneclaw Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem Nova de feu")] = totemData[string_lower("Fire Nova Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem de Magma")] = totemData[string_lower("Magma Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem de courroux")] = totemData[string_lower("Totem of Wrath")],
 | 
					 | 
				
			||||||
        [string_lower("Totem d'\195\169lementaire de feu")] = totemData[string_lower("Fire Elemental Totem")],
 | 
					 | 
				
			||||||
		[string_lower("Totem d'\195\169l\195\169mentaire de feu")] = totemData[string_lower("Fire Elemental Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem de Peau de pierre")] = totemData[string_lower("Stoneskin Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem d'\195\169lementaire de terre")] = totemData[string_lower("Earth Elemental Totem")],
 | 
					 | 
				
			||||||
		[string_lower("Totem d'\195\169l\195\169mentaire de terre")] = totemData[string_lower("Earth Elemental Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem de Force de la Terre")] = totemData[string_lower("Strength of Earth Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem de r\195\169sistance au Givre")] = totemData[string_lower("Frost Resistance Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem de r\195\169sistance au Feu")] = totemData[string_lower("Fire Resistance Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem de Gl\195\168be")] = totemData[string_lower("Grounding Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem de Gr\195\162ce a\195\169rienne")] = totemData[string_lower("Grace of Air Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem de R\195\169sistance \195\160 la Nature")] = totemData[string_lower("Nature Resistance Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem Furie-des-vents")] = totemData[string_lower("Windfury Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem Sentinelle")] = totemData[string_lower("Sentry Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem de Mur des vents")] = totemData[string_lower("Windwall Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem de courroux de l'air")] = totemData[string_lower("Wrath of Air Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem de S\195\169isme")] = totemData[string_lower("Tremor Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem gu\195\169risseur")] = totemData[string_lower("Healing Stream Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem de Purification du poison")] = totemData[string_lower("Poison Cleansing Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem Fontaine de mana")] = totemData[string_lower("Mana Spring Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem de Purification des maladies")] = totemData[string_lower("Disease Cleansing Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem de purification")] = totemData[string_lower("Disease Cleansing Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem de Vague de mana")] = totemData[string_lower("Mana Tide Totem")],
 | 
					 | 
				
			||||||
        [string_lower("Totem de Tranquillit\195\169 de l'air")] = totemData[string_lower("Tranquil Air Totem")],
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local function GetTotemColorDefaultOptions()
 | 
					local function GetTotemColorDefaultOptions()
 | 
				
			||||||
    local defaultDB = {}
 | 
					    local defaultDB = {}
 | 
				
			||||||
    local options = {}
 | 
					    local options = {}
 | 
				
			||||||
    local indexedList = {}
 | 
					    local indexedList = {}
 | 
				
			||||||
    for k,v in pairs(totemData) do
 | 
					    for k,v in pairs(totemData) do
 | 
				
			||||||
        tinsert(indexedList, {name = k, id = v.id, color = v.color, texture = v.texture, enabled = v.enabled})
 | 
					        tinsert(indexedList, {name = k, id = v.id, color = v.color, texture = v.texture})
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    table.sort(indexedList, function (a, b)
 | 
					    table.sort(indexedList, function (a, b)
 | 
				
			||||||
        return a.name < b.name
 | 
					        return a.name < b.name
 | 
				
			||||||
    end)
 | 
					    end)
 | 
				
			||||||
    for i=1,#indexedList do
 | 
					    for i=1,#indexedList do
 | 
				
			||||||
        defaultDB["totem" .. indexedList[i].id] = {color = indexedList[i].color, enabled = indexedList[i].enabled, alpha = 0.6}
 | 
					        defaultDB["totem" .. indexedList[i].id] = {color = indexedList[i].color, enabled = true, alpha = 0.6, customText = ""}
 | 
				
			||||||
 | 
					        options["npTotemsHideDisabledTotems"] = {
 | 
				
			||||||
 | 
					            order = 1,
 | 
				
			||||||
 | 
					            name = L["Hide Disabled Totem Plates"],
 | 
				
			||||||
 | 
					            desc = L["Hide Disabled Totem Plates"],
 | 
				
			||||||
 | 
					            type = "toggle",
 | 
				
			||||||
 | 
					            width = "full",
 | 
				
			||||||
 | 
					            get = function() return Gladdy.dbi.profile.npTotemsHideDisabledTotems end,
 | 
				
			||||||
 | 
					            set = function(_, value)
 | 
				
			||||||
 | 
					                Gladdy.dbi.profile.npTotemsHideDisabledTotems = value
 | 
				
			||||||
 | 
					                Gladdy:UpdateFrame()
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        options["totem" .. indexedList[i].id] = {
 | 
					        options["totem" .. indexedList[i].id] = {
 | 
				
			||||||
            order = i+1,
 | 
					            order = i+1,
 | 
				
			||||||
            name = select(1, GetSpellInfo(indexedList[i].id)),
 | 
					            name = select(1, GetSpellInfo(indexedList[i].id)),
 | 
				
			||||||
@@ -138,12 +51,12 @@ local function GetTotemColorDefaultOptions()
 | 
				
			|||||||
                },
 | 
					                },
 | 
				
			||||||
                enabled = {
 | 
					                enabled = {
 | 
				
			||||||
                    order = 2,
 | 
					                    order = 2,
 | 
				
			||||||
                    name = "Enabled",
 | 
					                    name = L["Enabled"],
 | 
				
			||||||
                    desc = "Enable " .. format("|T%s:20|t %s", indexedList[i].texture, select(1, GetSpellInfo(indexedList[i].id))),
 | 
					                    desc = "Enable " .. format("|T%s:20|t %s", indexedList[i].texture, select(1, GetSpellInfo(indexedList[i].id))),
 | 
				
			||||||
                    type = "toggle",
 | 
					                    type = "toggle",
 | 
				
			||||||
                    width = "full",
 | 
					                    width = "full",
 | 
				
			||||||
                    get = function(info) return Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].enabled end,
 | 
					                    get = function() return Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].enabled end,
 | 
				
			||||||
                    set = function(info, value)
 | 
					                    set = function(_, value)
 | 
				
			||||||
                        Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].enabled = value
 | 
					                        Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].enabled = value
 | 
				
			||||||
                        Gladdy:UpdateFrame()
 | 
					                        Gladdy:UpdateFrame()
 | 
				
			||||||
                    end
 | 
					                    end
 | 
				
			||||||
@@ -155,15 +68,13 @@ local function GetTotemColorDefaultOptions()
 | 
				
			|||||||
                    order = 3,
 | 
					                    order = 3,
 | 
				
			||||||
                    hasAlpha = true,
 | 
					                    hasAlpha = true,
 | 
				
			||||||
                    width = "full",
 | 
					                    width = "full",
 | 
				
			||||||
                    get = function(info)
 | 
					                    get = function()
 | 
				
			||||||
                        local key = info.arg or info[#info]
 | 
					 | 
				
			||||||
                        return Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.r,
 | 
					                        return Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.r,
 | 
				
			||||||
                        Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.g,
 | 
					                        Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.g,
 | 
				
			||||||
                        Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.b,
 | 
					                        Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.b,
 | 
				
			||||||
                        Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.a
 | 
					                        Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.a
 | 
				
			||||||
                    end,
 | 
					                    end,
 | 
				
			||||||
                    set = function(info, r, g, b, a)
 | 
					                    set = function(_, r, g, b, a)
 | 
				
			||||||
                        local key = info.arg or info[#info]
 | 
					 | 
				
			||||||
                        Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.r,
 | 
					                        Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.r,
 | 
				
			||||||
                        Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.g,
 | 
					                        Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.g,
 | 
				
			||||||
                        Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.b,
 | 
					                        Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.b,
 | 
				
			||||||
@@ -179,21 +90,21 @@ local function GetTotemColorDefaultOptions()
 | 
				
			|||||||
                    max = 1,
 | 
					                    max = 1,
 | 
				
			||||||
                    step = 0.1,
 | 
					                    step = 0.1,
 | 
				
			||||||
                    width = "full",
 | 
					                    width = "full",
 | 
				
			||||||
                    get = function(info)
 | 
					                    get = function()
 | 
				
			||||||
                        return Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].alpha
 | 
					                        return Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].alpha
 | 
				
			||||||
                    end,
 | 
					                    end,
 | 
				
			||||||
                    set = function(info, value)
 | 
					                    set = function(_, value)
 | 
				
			||||||
                        Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].alpha = value
 | 
					                        Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].alpha = value
 | 
				
			||||||
                        Gladdy:UpdateFrame()
 | 
					                        Gladdy:UpdateFrame()
 | 
				
			||||||
                    end
 | 
					                    end
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
                customText = {
 | 
					                customText = {
 | 
				
			||||||
                  type = "input",
 | 
					                    type = "input",
 | 
				
			||||||
                  name = L["Custom totem name"],
 | 
					                    name = L["Custom totem name"],
 | 
				
			||||||
                  order = 5,
 | 
					                    order = 5,
 | 
				
			||||||
                  width = "full",
 | 
					                    width = "full",
 | 
				
			||||||
                  get = function(info) return Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].customText end,
 | 
					                    get = function() return Gladdy.db.npTotemColors["totem" .. indexedList[i].id].customText end,
 | 
				
			||||||
                  set = function(info, value) Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].customText = value Gladdy:UpdateFrame() end
 | 
					                    set = function(_, value) Gladdy.db.npTotemColors["totem" .. indexedList[i].id].customText = value Gladdy:UpdateFrame() end
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -201,27 +112,16 @@ local function GetTotemColorDefaultOptions()
 | 
				
			|||||||
    return defaultDB, options, indexedList
 | 
					    return defaultDB, options, indexedList
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function GetTotemOptions()
 | 
					 | 
				
			||||||
    local indexedList = select(3, GetTotemColorDefaultOptions())
 | 
					 | 
				
			||||||
    local colorList = {}
 | 
					 | 
				
			||||||
    for i=1, #indexedList do
 | 
					 | 
				
			||||||
        tinsert(colorList, Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id])
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
    return colorList
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
function Gladdy:GetTotemColors()
 | 
					 | 
				
			||||||
    return GetTotemColorDefaultOptions()
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
---------------------------------------------------
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Core
 | 
					-- Core
 | 
				
			||||||
 | 
					
 | 
				
			||||||
---------------------------------------------------
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local TotemPlates = Gladdy:NewModule("TotemPlates", nil, {
 | 
					local TotemPlates = Gladdy:NewModule("Totem Plates", 2, {
 | 
				
			||||||
    npTotems = true,
 | 
					    npTotems = true,
 | 
				
			||||||
 | 
					    npTotemsShowFriendly = true,
 | 
				
			||||||
 | 
					    npTotemsShowEnemy = true,
 | 
				
			||||||
    npTotemPlatesBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp",
 | 
					    npTotemPlatesBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp",
 | 
				
			||||||
    npTotemPlatesSize = 40,
 | 
					    npTotemPlatesSize = 40,
 | 
				
			||||||
    npTotemPlatesWidthFactor = 1,
 | 
					    npTotemPlatesWidthFactor = 1,
 | 
				
			||||||
@@ -232,12 +132,10 @@ local TotemPlates = Gladdy:NewModule("TotemPlates", nil, {
 | 
				
			|||||||
    npTotemPlatesAlpha = 0.6,
 | 
					    npTotemPlatesAlpha = 0.6,
 | 
				
			||||||
    npTotemPlatesAlphaAlways = false,
 | 
					    npTotemPlatesAlphaAlways = false,
 | 
				
			||||||
    npTotemPlatesAlphaAlwaysTargeted = false,
 | 
					    npTotemPlatesAlphaAlwaysTargeted = false,
 | 
				
			||||||
    npTotemColors = select(1, GetTotemColorDefaultOptions())
 | 
					    npTotemColors = select(1, GetTotemColorDefaultOptions()),
 | 
				
			||||||
 | 
					    npTotemsHideDisabledTotems = false,
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LibStub("AceHook-3.0"):Embed(TotemPlates)
 | 
					 | 
				
			||||||
LibStub("AceTimer-3.0"):Embed(TotemPlates)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
function TotemPlates.OnEvent(self, event, ...)
 | 
					function TotemPlates.OnEvent(self, event, ...)
 | 
				
			||||||
    TotemPlates[event](self, ...)
 | 
					    TotemPlates[event](self, ...)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
@@ -246,24 +144,102 @@ function TotemPlates:Initialize()
 | 
				
			|||||||
    self.numChildren = 0
 | 
					    self.numChildren = 0
 | 
				
			||||||
    self.activeTotemNameplates = {}
 | 
					    self.activeTotemNameplates = {}
 | 
				
			||||||
    self.totemPlateCache = {}
 | 
					    self.totemPlateCache = {}
 | 
				
			||||||
    self:RegisterEvent("PLAYER_ENTERING_WORLD")
 | 
					    if Gladdy.db.npTotems then
 | 
				
			||||||
    self:RegisterEvent("NAME_PLATE_UNIT_ADDED")
 | 
					        self:RegisterEvent("PLAYER_ENTERING_WORLD")
 | 
				
			||||||
    self:RegisterEvent("NAME_PLATE_UNIT_REMOVED")
 | 
					        self:RegisterEvent("NAME_PLATE_UNIT_ADDED")
 | 
				
			||||||
    self:RegisterEvent("PLAYER_TARGET_CHANGED")
 | 
					        self:RegisterEvent("NAME_PLATE_UNIT_REMOVED")
 | 
				
			||||||
    self:SetScript("OnEvent", TotemPlates.OnEvent)
 | 
					        self:RegisterEvent("PLAYER_TARGET_CHANGED")
 | 
				
			||||||
 | 
					        self:SetScript("OnEvent", TotemPlates.OnEvent)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if Gladdy.db.npTotems and Gladdy.db.npTotemsShowEnemy then
 | 
				
			||||||
 | 
					        SetCVar("nameplateShowEnemyTotems", true);
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if Gladdy.db.npTotems and Gladdy.db.npTotemsShowFriendly then
 | 
				
			||||||
 | 
					        SetCVar("nameplateShowFriendlyTotems", true);
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    self.addon = "Blizzard"
 | 
				
			||||||
 | 
					    if (IsAddOnLoaded("Plater")) then
 | 
				
			||||||
 | 
					        self.addon = "Plater"
 | 
				
			||||||
 | 
					    elseif (IsAddOnLoaded("Kui_Nameplates")) then
 | 
				
			||||||
 | 
					        self.addon = "Kui_Nameplates"
 | 
				
			||||||
 | 
					    elseif (IsAddOnLoaded("NeatPlates")) then
 | 
				
			||||||
 | 
					        self.addon = "NeatPlates"
 | 
				
			||||||
 | 
					    elseif (IsAddOnLoaded("TidyPlates_ThreatPlates")) then
 | 
				
			||||||
 | 
					        self.addon = "TidyPlates_ThreatPlates"
 | 
				
			||||||
 | 
					    elseif (IsAddOnLoaded("Tukui")) then
 | 
				
			||||||
 | 
					        local _, C, _ = Tukui:unpack()
 | 
				
			||||||
 | 
					        if C.NamePlates.Enable then
 | 
				
			||||||
 | 
					            self.addon = "Tukui"
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    elseif (IsAddOnLoaded("ElvUI")) then
 | 
				
			||||||
 | 
					        local E = unpack(ElvUI)
 | 
				
			||||||
 | 
					        if E.private.nameplates.enable then
 | 
				
			||||||
 | 
					            self.addon = "ElvUI"
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Events
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function TotemPlates:PLAYER_ENTERING_WORLD()
 | 
					function TotemPlates:PLAYER_ENTERING_WORLD()
 | 
				
			||||||
    self.numChildren = 0
 | 
					    self.numChildren = 0
 | 
				
			||||||
    self.activeTotemNameplates = {}
 | 
					    self.activeTotemNameplates = {}
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function TotemPlates:Reset()
 | 
					function TotemPlates:PLAYER_TARGET_CHANGED()
 | 
				
			||||||
    --self:CancelAllTimers()
 | 
					    for k,nameplate in pairs(self.activeTotemNameplates) do
 | 
				
			||||||
    --self:UnhookAll()
 | 
					        TotemPlates:SetTotemAlpha(nameplate.gladdyTotemFrame, k)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPlates:NAME_PLATE_UNIT_ADDED(unitID)
 | 
				
			||||||
 | 
					    self:OnUnitEvent(unitID)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPlates:NAME_PLATE_UNIT_REMOVED(unitID)
 | 
				
			||||||
 | 
					    local nameplate = C_NamePlate.GetNamePlateForUnit(unitID)
 | 
				
			||||||
 | 
					    self.activeTotemNameplates[unitID] = nil
 | 
				
			||||||
 | 
					    --self:ToggleAddon(nameplate, true)
 | 
				
			||||||
 | 
					    if nameplate.gladdyTotemFrame then
 | 
				
			||||||
 | 
					        nameplate.gladdyTotemFrame:Hide()
 | 
				
			||||||
 | 
					        nameplate.gladdyTotemFrame:SetParent(nil)
 | 
				
			||||||
 | 
					        tinsert(self.totemPlateCache, nameplate.gladdyTotemFrame)
 | 
				
			||||||
 | 
					        nameplate.gladdyTotemFrame = nil
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Gladdy Call
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function TotemPlates:UpdateFrameOnce()
 | 
					function TotemPlates:UpdateFrameOnce()
 | 
				
			||||||
 | 
					    if Gladdy.db.npTotems then
 | 
				
			||||||
 | 
					        self:RegisterEvent("PLAYER_ENTERING_WORLD")
 | 
				
			||||||
 | 
					        self:RegisterEvent("NAME_PLATE_UNIT_ADDED")
 | 
				
			||||||
 | 
					        self:RegisterEvent("NAME_PLATE_UNIT_REMOVED")
 | 
				
			||||||
 | 
					        self:RegisterEvent("PLAYER_TARGET_CHANGED")
 | 
				
			||||||
 | 
					        self:SetScript("OnEvent", TotemPlates.OnEvent)
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        self:UnregisterEvent("PLAYER_ENTERING_WORLD")
 | 
				
			||||||
 | 
					        self:UnregisterEvent("NAME_PLATE_UNIT_ADDED")
 | 
				
			||||||
 | 
					        self:UnregisterEvent("NAME_PLATE_UNIT_REMOVED")
 | 
				
			||||||
 | 
					        self:UnregisterEvent("PLAYER_TARGET_CHANGED")
 | 
				
			||||||
 | 
					        self:SetScript("OnEvent", nil)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if Gladdy.db.npTotems and Gladdy.db.npTotemsShowEnemy then
 | 
				
			||||||
 | 
					        SetCVar("nameplateShowEnemyTotems", true);
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if Gladdy.db.npTotems and Gladdy.db.npTotemsShowFriendly then
 | 
				
			||||||
 | 
					        SetCVar("nameplateShowFriendlyTotems", true);
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for k,nameplate in pairs(self.activeTotemNameplates) do
 | 
					    for k,nameplate in pairs(self.activeTotemNameplates) do
 | 
				
			||||||
        local totemDataEntry = nameplate.gladdyTotemFrame.totemDataEntry
 | 
					        local totemDataEntry = nameplate.gladdyTotemFrame.totemDataEntry
 | 
				
			||||||
        nameplate.gladdyTotemFrame:SetWidth(Gladdy.db.npTotemPlatesSize * Gladdy.db.npTotemPlatesWidthFactor)
 | 
					        nameplate.gladdyTotemFrame:SetWidth(Gladdy.db.npTotemPlatesSize * Gladdy.db.npTotemPlatesWidthFactor)
 | 
				
			||||||
@@ -274,64 +250,184 @@ function TotemPlates:UpdateFrameOnce()
 | 
				
			|||||||
                Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].color.b,
 | 
					                Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].color.b,
 | 
				
			||||||
                Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].color.a)
 | 
					                Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].color.a)
 | 
				
			||||||
        nameplate.gladdyTotemFrame.totemName:SetPoint("TOP", nameplate.gladdyTotemFrame, "BOTTOM", Gladdy.db.npTremorFontXOffset, Gladdy.db.npTremorFontYOffset)
 | 
					        nameplate.gladdyTotemFrame.totemName:SetPoint("TOP", nameplate.gladdyTotemFrame, "BOTTOM", Gladdy.db.npTremorFontXOffset, Gladdy.db.npTremorFontYOffset)
 | 
				
			||||||
        nameplate.gladdyTotemFrame.totemName:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.npTremorFont), Gladdy.db.npTremorFontSize, "OUTLINE")
 | 
					        nameplate.gladdyTotemFrame.totemName:SetFont(Gladdy:SMFetch("font", "npTremorFont"), Gladdy.db.npTremorFontSize, "OUTLINE")
 | 
				
			||||||
        nameplate.gladdyTotemFrame.totemName:SetText(Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].customText or "")
 | 
					        nameplate.gladdyTotemFrame.totemName:SetText(Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].customText or "")
 | 
				
			||||||
        self:SetTotemAlpha(nameplate.gladdyTotemFrame, k)
 | 
					        self:SetTotemAlpha(nameplate.gladdyTotemFrame, k)
 | 
				
			||||||
        nameplate.UnitFrame.selectionHighlight:SetPoint("TOPLEFT", nameplate.gladdyTotemFrame, "TOPLEFT", Gladdy.db.npTotemPlatesSize/16, -Gladdy.db.npTotemPlatesSize/16)
 | 
					
 | 
				
			||||||
        nameplate.UnitFrame.selectionHighlight:SetPoint("BOTTOMRIGHT", nameplate.gladdyTotemFrame, "BOTTOMRIGHT", -Gladdy.db.npTotemPlatesSize/16, Gladdy.db.npTotemPlatesSize/16)
 | 
					        if not Gladdy.db.npTotems then
 | 
				
			||||||
 | 
					            nameplate.gladdyTotemFrame:Hide()
 | 
				
			||||||
 | 
					            self:ToggleAddon(nameplate, true)
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            nameplate.gladdyTotemFrame:Show()
 | 
				
			||||||
 | 
					            self:ToggleAddon(nameplate)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        local isEnemy = UnitIsEnemy("player", nameplate.gladdyTotemFrame.unitID)
 | 
				
			||||||
 | 
					        if Gladdy.db.npTotems and Gladdy.db.npTotemsShowEnemy and isEnemy then
 | 
				
			||||||
 | 
					            nameplate.gladdyTotemFrame:Show()
 | 
				
			||||||
 | 
					            self:ToggleAddon(nameplate)
 | 
				
			||||||
 | 
					        elseif Gladdy.db.npTotems and not Gladdy.db.npTotemsShowEnemy and isEnemy then
 | 
				
			||||||
 | 
					            nameplate.gladdyTotemFrame:Hide()
 | 
				
			||||||
 | 
					            self:ToggleAddon(nameplate, true)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if Gladdy.db.npTotems and Gladdy.db.npTotemsShowFriendly and not isEnemy then
 | 
				
			||||||
 | 
					            nameplate.gladdyTotemFrame:Show()
 | 
				
			||||||
 | 
					            self:ToggleAddon(nameplate)
 | 
				
			||||||
 | 
					        elseif not Gladdy.db.npTotemsShowFriendly and not isEnemy then
 | 
				
			||||||
 | 
					            nameplate.gladdyTotemFrame:Hide()
 | 
				
			||||||
 | 
					            self:ToggleAddon(nameplate, true)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if Gladdy.db.npTotems and Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].enabled then
 | 
				
			||||||
 | 
					            nameplate.gladdyTotemFrame:Show()
 | 
				
			||||||
 | 
					            self:ToggleAddon(nameplate)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if Gladdy.db.npTotems and not Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].enabled then
 | 
				
			||||||
 | 
					            nameplate.gladdyTotemFrame:Hide()
 | 
				
			||||||
 | 
					            self:ToggleAddon(nameplate, true)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if Gladdy.db.npTotems and not Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].enabled and Gladdy.db.npTotemsHideDisabledTotems then
 | 
				
			||||||
 | 
					            nameplate.gladdyTotemFrame:Hide()
 | 
				
			||||||
 | 
					            self:ToggleAddon(nameplate)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    for i,gladdyTotemFrame in ipairs(self.totemPlateCache) do
 | 
					    for _,gladdyTotemFrame in ipairs(self.totemPlateCache) do
 | 
				
			||||||
        gladdyTotemFrame:SetWidth(Gladdy.db.npTotemPlatesSize * Gladdy.db.npTotemPlatesWidthFactor)
 | 
					        gladdyTotemFrame:SetWidth(Gladdy.db.npTotemPlatesSize * Gladdy.db.npTotemPlatesWidthFactor)
 | 
				
			||||||
        gladdyTotemFrame:SetHeight(Gladdy.db.npTotemPlatesSize)
 | 
					        gladdyTotemFrame:SetHeight(Gladdy.db.npTotemPlatesSize)
 | 
				
			||||||
        gladdyTotemFrame.totemBorder:SetTexture(Gladdy.db.npTotemPlatesBorderStyle)
 | 
					        gladdyTotemFrame.totemBorder:SetTexture(Gladdy.db.npTotemPlatesBorderStyle)
 | 
				
			||||||
        gladdyTotemFrame.totemName:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.npTremorFont), Gladdy.db.npTremorFontSize, "OUTLINE")
 | 
					        gladdyTotemFrame.totemName:SetFont(Gladdy:SMFetch("font", "npTremorFont"), Gladdy.db.npTremorFontSize, "OUTLINE")
 | 
				
			||||||
        gladdyTotemFrame.totemName:SetPoint("TOP", gladdyTotemFrame, "BOTTOM", Gladdy.db.npTremorFontXOffset, Gladdy.db.npTremorFontYOffset)
 | 
					        gladdyTotemFrame.totemName:SetPoint("TOP", gladdyTotemFrame, "BOTTOM", Gladdy.db.npTremorFontXOffset, Gladdy.db.npTremorFontYOffset)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
---------------------------------------------------
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- TotemPlates Frame
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPlates:CreateTotemFrame(nameplate)
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame = CreateFrame("Frame")
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame:SetFrameLevel(1)
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame:SetIgnoreParentAlpha(true)
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame:SetWidth(Gladdy.db.npTotemPlatesSize * Gladdy.db.npTotemPlatesWidthFactor)
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame:SetHeight(Gladdy.db.npTotemPlatesSize)
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame.totemIcon = nameplate.gladdyTotemFrame:CreateTexture(nil, "BACKGROUND")
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame.totemIcon:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame.totemIcon:ClearAllPoints()
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame.totemIcon:SetPoint("TOPLEFT", nameplate.gladdyTotemFrame, "TOPLEFT")
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame.totemIcon:SetPoint("BOTTOMRIGHT", nameplate.gladdyTotemFrame, "BOTTOMRIGHT")
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame.totemBorder = nameplate.gladdyTotemFrame:CreateTexture(nil, "BORDER")
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame.totemBorder:ClearAllPoints()
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame.totemBorder:SetPoint("TOPLEFT", nameplate.gladdyTotemFrame, "TOPLEFT")
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame.totemBorder:SetPoint("BOTTOMRIGHT", nameplate.gladdyTotemFrame, "BOTTOMRIGHT")
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame.totemBorder:SetTexture(Gladdy.db.npTotemPlatesBorderStyle)
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame.totemName = nameplate.gladdyTotemFrame:CreateFontString(nil, "OVERLAY")
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame.totemName:SetFont(Gladdy:SMFetch("font", "npTremorFont"), Gladdy.db.npTremorFontSize, "OUTLINE")
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame.totemName:SetPoint("TOP", nameplate.gladdyTotemFrame, "BOTTOM", Gladdy.db.npTremorFontXOffset, Gladdy.db.npTremorFontYOffset)
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame.selectionHighlight = nameplate.gladdyTotemFrame:CreateTexture(nil, "OVERLAY")
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame.selectionHighlight:SetTexture("Interface/TargetingFrame/UI-TargetingFrame-BarFill")
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame.selectionHighlight:SetAlpha(0)
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame.selectionHighlight:SetBlendMode("ADD")
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame.selectionHighlight:SetIgnoreParentAlpha(true)
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame.selectionHighlight:SetPoint("TOPLEFT", nameplate.gladdyTotemFrame, "TOPLEFT", Gladdy.db.npTotemPlatesSize/16, -Gladdy.db.npTotemPlatesSize/16)
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame.selectionHighlight:SetPoint("BOTTOMRIGHT", nameplate.gladdyTotemFrame, "BOTTOMRIGHT", -Gladdy.db.npTotemPlatesSize/16, Gladdy.db.npTotemPlatesSize/16)
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame:SetScript('OnUpdate', TotemPlates.OnUpdate)
 | 
				
			||||||
 | 
					    nameplate.gladdyTotemFrame:SetScript("OnHide", function(self)
 | 
				
			||||||
 | 
					        self.parent = nil
 | 
				
			||||||
 | 
					        self:SetParent(nil)
 | 
				
			||||||
 | 
					    end)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Nameplate functions
 | 
					-- Nameplate functions
 | 
				
			||||||
 | 
					
 | 
				
			||||||
---------------------------------------------------
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function TotemPlates:PLAYER_TARGET_CHANGED()
 | 
					function TotemPlates:GetAddonFrame(nameplate)
 | 
				
			||||||
    for k,nameplate in pairs(self.activeTotemNameplates) do
 | 
					    if self.addon == "Blizzard" then
 | 
				
			||||||
        TotemPlates:SetTotemAlpha(nameplate.gladdyTotemFrame, k)
 | 
					        if nameplate.UnitFrame then
 | 
				
			||||||
 | 
					            return nameplate.UnitFrame
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    elseif self.addon == "Plater" or self.addon == "Tukui" or self.addon == "ElvUI" then
 | 
				
			||||||
 | 
					        if nameplate.unitFrame then
 | 
				
			||||||
 | 
					            return nameplate.unitFrame
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    elseif self.addon == "Kui_Nameplates" then
 | 
				
			||||||
 | 
					        if nameplate.kui then
 | 
				
			||||||
 | 
					            return nameplate.kui
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    elseif self.addon == "NeatPlates" then
 | 
				
			||||||
 | 
					        if nameplate.extended or nameplate.carrier then
 | 
				
			||||||
 | 
					            return nameplate.extended , nameplate.carrier
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    elseif self.addon == "TidyPlates_ThreatPlates" then
 | 
				
			||||||
 | 
					        if nameplate.TPFrame then
 | 
				
			||||||
 | 
					            return nameplate.TPFrame
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function TotemPlates:NAME_PLATE_UNIT_ADDED(...)
 | 
					 | 
				
			||||||
    local unitID = ...
 | 
					 | 
				
			||||||
    local nameplateName = UnitName(unitID)
 | 
					 | 
				
			||||||
    local totemName = string_gsub(nameplateName, "^%s+", "") --trim
 | 
					 | 
				
			||||||
    totemName = string_gsub(totemName, "%s+$", "") --trim
 | 
					 | 
				
			||||||
    totemName = string_gsub(totemName, "%s+[I,V,X]+$", "") --trim rank
 | 
					 | 
				
			||||||
    totemName = string_lower(totemName)
 | 
					 | 
				
			||||||
    local nameplate = C_NamePlate.GetNamePlateForUnit(unitID)
 | 
					 | 
				
			||||||
    local totemDataEntry = localizedTotemData["default"][totemName]
 | 
					 | 
				
			||||||
    if totemDataEntry and Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].enabled then-- modify this nameplates
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPlates:ToggleAddon(nameplate, show)
 | 
				
			||||||
 | 
					    local addonFrames = { self:GetAddonFrame(nameplate) }
 | 
				
			||||||
 | 
					    if addonFrames and #addonFrames > 0 then
 | 
				
			||||||
 | 
					        if show then
 | 
				
			||||||
 | 
					            for _,v in ipairs(addonFrames) do
 | 
				
			||||||
 | 
					                v:Show()
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            for _,v in ipairs(addonFrames) do
 | 
				
			||||||
 | 
					                v:Hide()
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPlates.OnUpdate(self)
 | 
				
			||||||
 | 
					    if (UnitIsUnit("mouseover", self.unitID) or UnitIsUnit("target", self.unitID)) and Gladdy.db.npTotemColors["totem" .. self.totemDataEntry.id].alpha > 0 then
 | 
				
			||||||
 | 
					        self.selectionHighlight:SetAlpha(.25)
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        self.selectionHighlight:SetAlpha(0)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if (TotemPlates.addon == "Plater" or TotemPlates.addon == "Tukui" or TotemPlates.addon == "ElvUI") and self.parent and self.parent.unitFrame then
 | 
				
			||||||
 | 
					        self.parent.unitFrame:Hide()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPlates:OnUnitEvent(unitID)
 | 
				
			||||||
 | 
					    local isEnemy = UnitIsEnemy("player", unitID)
 | 
				
			||||||
 | 
					    local nameplate = C_NamePlate.GetNamePlateForUnit(unitID)
 | 
				
			||||||
 | 
					    if not nameplate then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if not Gladdy.db.npTotems then
 | 
				
			||||||
 | 
					        self:ToggleAddon(nameplate, true)
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if not Gladdy.db.npTotemsShowEnemy and isEnemy then
 | 
				
			||||||
 | 
					        self:ToggleAddon(nameplate, true)
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if not Gladdy.db.npTotemsShowFriendly and not isEnemy then
 | 
				
			||||||
 | 
					        self:ToggleAddon(nameplate, true)
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    local npcType, _, _, _, _, npcId = strsplit("-", UnitGUID(unitID))
 | 
				
			||||||
 | 
					    if npcType ~= "Creature" then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    local totemDataEntry = npcIdToTotemData[tonumber(npcId)]
 | 
				
			||||||
 | 
					    if not totemDataEntry then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if totemDataEntry and Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].enabled then-- modify this nameplates
 | 
				
			||||||
        if #self.totemPlateCache > 0 then
 | 
					        if #self.totemPlateCache > 0 then
 | 
				
			||||||
            nameplate.gladdyTotemFrame = tremove(self.totemPlateCache, #self.totemPlateCache)
 | 
					            nameplate.gladdyTotemFrame = tremove(self.totemPlateCache, #self.totemPlateCache)
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
            nameplate.gladdyTotemFrame = CreateFrame("Frame", nil)
 | 
					            self:CreateTotemFrame(nameplate)
 | 
				
			||||||
            nameplate.gladdyTotemFrame:SetIgnoreParentAlpha(true)
 | 
					 | 
				
			||||||
            nameplate.gladdyTotemFrame:SetWidth(Gladdy.db.npTotemPlatesSize * Gladdy.db.npTotemPlatesWidthFactor)
 | 
					 | 
				
			||||||
            nameplate.gladdyTotemFrame:SetHeight(Gladdy.db.npTotemPlatesSize)
 | 
					 | 
				
			||||||
            nameplate.gladdyTotemFrame.totemIcon = nameplate.gladdyTotemFrame:CreateTexture(nil, "BACKGROUND")
 | 
					 | 
				
			||||||
            nameplate.gladdyTotemFrame.totemIcon:ClearAllPoints()
 | 
					 | 
				
			||||||
            nameplate.gladdyTotemFrame.totemIcon:SetPoint("TOPLEFT", nameplate.gladdyTotemFrame, "TOPLEFT")
 | 
					 | 
				
			||||||
            nameplate.gladdyTotemFrame.totemIcon:SetPoint("BOTTOMRIGHT", nameplate.gladdyTotemFrame, "BOTTOMRIGHT")
 | 
					 | 
				
			||||||
            nameplate.gladdyTotemFrame.totemBorder = nameplate.gladdyTotemFrame:CreateTexture(nil, "BORDER")
 | 
					 | 
				
			||||||
            nameplate.gladdyTotemFrame.totemBorder:ClearAllPoints()
 | 
					 | 
				
			||||||
            nameplate.gladdyTotemFrame.totemBorder:SetPoint("TOPLEFT", nameplate.gladdyTotemFrame, "TOPLEFT")
 | 
					 | 
				
			||||||
            nameplate.gladdyTotemFrame.totemBorder:SetPoint("BOTTOMRIGHT", nameplate.gladdyTotemFrame, "BOTTOMRIGHT")
 | 
					 | 
				
			||||||
            nameplate.gladdyTotemFrame.totemBorder:SetTexture(Gladdy.db.npTotemPlatesBorderStyle)
 | 
					 | 
				
			||||||
            nameplate.gladdyTotemFrame.totemName = nameplate.gladdyTotemFrame:CreateFontString(nil, "OVERLAY")
 | 
					 | 
				
			||||||
            nameplate.gladdyTotemFrame.totemName:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.npTremorFont), Gladdy.db.npTremorFontSize, "OUTLINE")
 | 
					 | 
				
			||||||
            nameplate.gladdyTotemFrame.totemName:SetPoint("TOP", nameplate.gladdyTotemFrame, "BOTTOM", Gladdy.db.npTremorFontXOffset, Gladdy.db.npTremorFontYOffset)
 | 
					 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
 | 
					        nameplate.gladdyTotemFrame.unitID = unitID
 | 
				
			||||||
        nameplate.gladdyTotemFrame.totemDataEntry = totemDataEntry
 | 
					        nameplate.gladdyTotemFrame.totemDataEntry = totemDataEntry
 | 
				
			||||||
        nameplate.gladdyTotemFrame.parent = nameplate
 | 
					        nameplate.gladdyTotemFrame.parent = nameplate
 | 
				
			||||||
        nameplate.gladdyTotemFrame:SetParent(nameplate)
 | 
					        nameplate.gladdyTotemFrame:SetParent(nameplate)
 | 
				
			||||||
@@ -343,34 +439,21 @@ function TotemPlates:NAME_PLATE_UNIT_ADDED(...)
 | 
				
			|||||||
                Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].color.b,
 | 
					                Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].color.b,
 | 
				
			||||||
                Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].color.a)
 | 
					                Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].color.a)
 | 
				
			||||||
        nameplate.gladdyTotemFrame.totemName:SetText(Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].customText or "")
 | 
					        nameplate.gladdyTotemFrame.totemName:SetText(Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].customText or "")
 | 
				
			||||||
 | 
					        nameplate.gladdyTotemFrame.parent = nameplate
 | 
				
			||||||
        nameplate.gladdyTotemFrame:Show()
 | 
					        nameplate.gladdyTotemFrame:Show()
 | 
				
			||||||
        TotemPlates:SetTotemAlpha(nameplate.gladdyTotemFrame, unitID)
 | 
					        TotemPlates:SetTotemAlpha(nameplate.gladdyTotemFrame, unitID)
 | 
				
			||||||
 | 
					        self:ToggleAddon(nameplate)
 | 
				
			||||||
        nameplate.UnitFrame:SetAlpha(0)
 | 
					 | 
				
			||||||
        nameplate.UnitFrame.point = select(2, nameplate.UnitFrame.selectionHighlight:GetPoint())
 | 
					 | 
				
			||||||
        nameplate.UnitFrame.selectionHighlight:ClearAllPoints()
 | 
					 | 
				
			||||||
        nameplate.UnitFrame.selectionHighlight:SetPoint("TOPLEFT", nameplate.gladdyTotemFrame, "TOPLEFT", Gladdy.db.npTotemPlatesSize/16, -Gladdy.db.npTotemPlatesSize/16)
 | 
					 | 
				
			||||||
        nameplate.UnitFrame.selectionHighlight:SetPoint("BOTTOMRIGHT", nameplate.gladdyTotemFrame, "BOTTOMRIGHT", -Gladdy.db.npTotemPlatesSize/16, Gladdy.db.npTotemPlatesSize/16)
 | 
					 | 
				
			||||||
        nameplate.UnitFrame:SetScript("OnHide", function(unitFrame)
 | 
					 | 
				
			||||||
            unitFrame:SetAlpha(1)
 | 
					 | 
				
			||||||
            unitFrame.selectionHighlight:ClearAllPoints()
 | 
					 | 
				
			||||||
            unitFrame.selectionHighlight:SetPoint("TOPLEFT", unitFrame.point, "TOPLEFT")
 | 
					 | 
				
			||||||
            unitFrame.selectionHighlight:SetPoint("BOTTOMRIGHT", unitFrame.point, "BOTTOMRIGHT")
 | 
					 | 
				
			||||||
            unitFrame:SetScript("OnHide", nil)
 | 
					 | 
				
			||||||
        end)
 | 
					 | 
				
			||||||
        self.activeTotemNameplates[unitID] = nameplate
 | 
					        self.activeTotemNameplates[unitID] = nameplate
 | 
				
			||||||
    end
 | 
					    elseif totemDataEntry and not Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].enabled and Gladdy.db.npTotemsHideDisabledTotems then
 | 
				
			||||||
end
 | 
					        if nameplate.gladdyTotemFrame then
 | 
				
			||||||
 | 
					            nameplate.gladdyTotemFrame:Hide()
 | 
				
			||||||
function TotemPlates:NAME_PLATE_UNIT_REMOVED(...)
 | 
					            nameplate.gladdyTotemFrame:SetParent(nil)
 | 
				
			||||||
    local unitID = ...
 | 
					            tinsert(self.totemPlateCache, nameplate.gladdyTotemFrame)
 | 
				
			||||||
    local nameplate = C_NamePlate.GetNamePlateForUnit(unitID)
 | 
					            nameplate.gladdyTotemFrame = nil
 | 
				
			||||||
    self.activeTotemNameplates[unitID] = nil
 | 
					        end
 | 
				
			||||||
    if nameplate.gladdyTotemFrame then
 | 
					        self:ToggleAddon(nameplate)
 | 
				
			||||||
        nameplate.gladdyTotemFrame:Hide()
 | 
					    else
 | 
				
			||||||
        nameplate.gladdyTotemFrame:SetParent(nil)
 | 
					        self:ToggleAddon(nameplate, true)
 | 
				
			||||||
        tinsert(self.totemPlateCache, nameplate.gladdyTotemFrame)
 | 
					 | 
				
			||||||
        nameplate.gladdyTotemFrame = nil
 | 
					 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -398,6 +481,65 @@ end
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
---------------------------------------------------
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPlates:TestOnce()
 | 
				
			||||||
 | 
					    if not self.testFrame then
 | 
				
			||||||
 | 
					        self.testFrame = CreateFrame("Frame", nil, UIParent)
 | 
				
			||||||
 | 
					        self.testFrame:SetWidth(1)
 | 
				
			||||||
 | 
					        self.testFrame:SetHeight(32)
 | 
				
			||||||
 | 
					        self.testFrame:SetPoint("CENTER", UIParent, "CENTER", 0, -140)
 | 
				
			||||||
 | 
					        self.testFrame:SetIgnoreParentScale(true)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    local totemDataEntry = npcIdToTotemData[5913]
 | 
				
			||||||
 | 
					    self.testFrame:Show()
 | 
				
			||||||
 | 
					    if not self.testFrame.gladdyTotemFrame then
 | 
				
			||||||
 | 
					        if #self.totemPlateCache > 0 then
 | 
				
			||||||
 | 
					            self.testFrame.gladdyTotemFrame = tremove(self.totemPlateCache, #self.totemPlateCache)
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            self:CreateTotemFrame(self.testFrame)
 | 
				
			||||||
 | 
					            self.testFrame.gladdyTotemFrame:SetScript("OnHide", nil)
 | 
				
			||||||
 | 
					            self.testFrame.gladdyTotemFrame:SetScript("OnUpdate", nil)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if Gladdy.db.npTotems then
 | 
				
			||||||
 | 
					        self.testFrame.gladdyTotemFrame.unitID = "player"
 | 
				
			||||||
 | 
					        self.testFrame.gladdyTotemFrame.totemDataEntry = totemDataEntry
 | 
				
			||||||
 | 
					        self.testFrame.gladdyTotemFrame.parent = self.testFrame
 | 
				
			||||||
 | 
					        self.testFrame.gladdyTotemFrame:SetParent(self.testFrame)
 | 
				
			||||||
 | 
					        self.testFrame.gladdyTotemFrame:ClearAllPoints()
 | 
				
			||||||
 | 
					        self.testFrame.gladdyTotemFrame:SetPoint("CENTER", self.testFrame, "CENTER", 0, 0)
 | 
				
			||||||
 | 
					        self.testFrame.gladdyTotemFrame.totemIcon:SetTexture(totemDataEntry.texture)
 | 
				
			||||||
 | 
					        self.testFrame.gladdyTotemFrame.totemBorder:SetVertexColor(Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].color.r,
 | 
				
			||||||
 | 
					                Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].color.g,
 | 
				
			||||||
 | 
					                Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].color.b,
 | 
				
			||||||
 | 
					                Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].color.a)
 | 
				
			||||||
 | 
					        self.testFrame.gladdyTotemFrame.totemName:SetText(Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].customText or "")
 | 
				
			||||||
 | 
					        self.testFrame.gladdyTotemFrame.parent = self.testFrame
 | 
				
			||||||
 | 
					        self.testFrame.gladdyTotemFrame:Show()
 | 
				
			||||||
 | 
					        self.activeTotemNameplates["player"] = self.testFrame
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        self.testFrame.gladdyTotemFrame:Hide()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPlates:Reset()
 | 
				
			||||||
 | 
					    if self.testFrame then
 | 
				
			||||||
 | 
					        if self.testFrame.gladdyTotemFrame then
 | 
				
			||||||
 | 
					            self.testFrame.gladdyTotemFrame:Hide()
 | 
				
			||||||
 | 
					            self.testFrame.gladdyTotemFrame:SetParent(nil)
 | 
				
			||||||
 | 
					            tinsert(self.totemPlateCache, self.testFrame.gladdyTotemFrame)
 | 
				
			||||||
 | 
					            self.testFrame.gladdyTotemFrame = nil
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        self.testFrame:Hide()
 | 
				
			||||||
 | 
					        self.activeTotemNameplates["player"] = nil
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Interface options
 | 
					-- Interface options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
---------------------------------------------------
 | 
					---------------------------------------------------
 | 
				
			||||||
@@ -406,19 +548,37 @@ function TotemPlates:GetOptions()
 | 
				
			|||||||
    return {
 | 
					    return {
 | 
				
			||||||
        headerTotems = {
 | 
					        headerTotems = {
 | 
				
			||||||
            type = "header",
 | 
					            type = "header",
 | 
				
			||||||
            name = L["Totem General"],
 | 
					            name = L["Totem Plates"],
 | 
				
			||||||
            order = 2,
 | 
					            order = 2,
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        npTotems = Gladdy:option({
 | 
					        npTotems = Gladdy:option({
 | 
				
			||||||
            type = "toggle",
 | 
					            type = "toggle",
 | 
				
			||||||
            name = L["Totem icons on/off"],
 | 
					            name = L["Enabled"],
 | 
				
			||||||
            desc = L["Turns totem icons instead of nameplates on or off. (Requires reload)"],
 | 
					            desc = L["Turns totem icons instead of nameplates on or off."],
 | 
				
			||||||
            order = 3,
 | 
					            order = 3,
 | 
				
			||||||
 | 
					            width = 0.9,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
 | 
					        npTotemsShowFriendly = Gladdy:option({
 | 
				
			||||||
 | 
					            type = "toggle",
 | 
				
			||||||
 | 
					            name = L["Show friendly"],
 | 
				
			||||||
 | 
					            desc = L["Turns totem icons instead of nameplates on or off."],
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.npTotems end,
 | 
				
			||||||
 | 
					            order = 4,
 | 
				
			||||||
 | 
					            width = 0.65,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
 | 
					        npTotemsShowEnemy = Gladdy:option({
 | 
				
			||||||
 | 
					            type = "toggle",
 | 
				
			||||||
 | 
					            name = L["Show enemy"],
 | 
				
			||||||
 | 
					            desc = L["Turns totem icons instead of nameplates on or off."],
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.npTotems end,
 | 
				
			||||||
 | 
					            order = 5,
 | 
				
			||||||
 | 
					            width = 0.6,
 | 
				
			||||||
        }),
 | 
					        }),
 | 
				
			||||||
        group = {
 | 
					        group = {
 | 
				
			||||||
            type = "group",
 | 
					            type = "group",
 | 
				
			||||||
            childGroups = "tree",
 | 
					            childGroups = "tree",
 | 
				
			||||||
            name = "Frame",
 | 
					            name = L["Frame"],
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.npTotems end,
 | 
				
			||||||
            order = 4,
 | 
					            order = 4,
 | 
				
			||||||
            args = {
 | 
					            args = {
 | 
				
			||||||
                icon = {
 | 
					                icon = {
 | 
				
			||||||
@@ -439,6 +599,7 @@ function TotemPlates:GetOptions()
 | 
				
			|||||||
                            min = 20,
 | 
					                            min = 20,
 | 
				
			||||||
                            max = 100,
 | 
					                            max = 100,
 | 
				
			||||||
                            step = 1,
 | 
					                            step = 1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        npTotemPlatesWidthFactor = Gladdy:option({
 | 
					                        npTotemPlatesWidthFactor = Gladdy:option({
 | 
				
			||||||
                            type = "range",
 | 
					                            type = "range",
 | 
				
			||||||
@@ -448,6 +609,7 @@ function TotemPlates:GetOptions()
 | 
				
			|||||||
                            min = 0.5,
 | 
					                            min = 0.5,
 | 
				
			||||||
                            max = 2,
 | 
					                            max = 2,
 | 
				
			||||||
                            step = 0.05,
 | 
					                            step = 0.05,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
@@ -458,7 +620,7 @@ function TotemPlates:GetOptions()
 | 
				
			|||||||
                    args = {
 | 
					                    args = {
 | 
				
			||||||
                        header = {
 | 
					                        header = {
 | 
				
			||||||
                            type = "header",
 | 
					                            type = "header",
 | 
				
			||||||
                            name = L["Icon"],
 | 
					                            name = L["Font"],
 | 
				
			||||||
                            order = 1,
 | 
					                            order = 1,
 | 
				
			||||||
                        },
 | 
					                        },
 | 
				
			||||||
                        npTremorFont = Gladdy:option({
 | 
					                        npTremorFont = Gladdy:option({
 | 
				
			||||||
@@ -477,6 +639,7 @@ function TotemPlates:GetOptions()
 | 
				
			|||||||
                            min = 1,
 | 
					                            min = 1,
 | 
				
			||||||
                            max = 50,
 | 
					                            max = 50,
 | 
				
			||||||
                            step = 0.1,
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        npTremorFontXOffset = Gladdy:option({
 | 
					                        npTremorFontXOffset = Gladdy:option({
 | 
				
			||||||
                            type = "range",
 | 
					                            type = "range",
 | 
				
			||||||
@@ -486,6 +649,7 @@ function TotemPlates:GetOptions()
 | 
				
			|||||||
                            min = -300,
 | 
					                            min = -300,
 | 
				
			||||||
                            max = 300,
 | 
					                            max = 300,
 | 
				
			||||||
                            step = 1,
 | 
					                            step = 1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        npTremorFontYOffset = Gladdy:option({
 | 
					                        npTremorFontYOffset = Gladdy:option({
 | 
				
			||||||
                            type = "range",
 | 
					                            type = "range",
 | 
				
			||||||
@@ -495,6 +659,7 @@ function TotemPlates:GetOptions()
 | 
				
			|||||||
                            min = -300,
 | 
					                            min = -300,
 | 
				
			||||||
                            max = 300,
 | 
					                            max = 300,
 | 
				
			||||||
                            step = 1,
 | 
					                            step = 1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
@@ -528,21 +693,25 @@ function TotemPlates:GetOptions()
 | 
				
			|||||||
                            min = 0,
 | 
					                            min = 0,
 | 
				
			||||||
                            max = 1,
 | 
					                            max = 1,
 | 
				
			||||||
                            step = 0.1,
 | 
					                            step = 0.1,
 | 
				
			||||||
                            width = "double",
 | 
					                            width = "full",
 | 
				
			||||||
                            order = 23,
 | 
					                            order = 23,
 | 
				
			||||||
                            get = function(info)
 | 
					                            get = function()
 | 
				
			||||||
                                local alphas = GetTotemOptions()
 | 
					                                local alpha, i = nil, 1
 | 
				
			||||||
                                for i=2, #alphas do
 | 
					                                for _,v in pairs(Gladdy.dbi.profile.npTotemColors) do
 | 
				
			||||||
                                    if alphas[i].alpha ~= alphas[1].alpha then
 | 
					                                    if i == 1 then
 | 
				
			||||||
                                        return ""
 | 
					                                        alpha = v.alpha
 | 
				
			||||||
 | 
					                                        i = i + 1
 | 
				
			||||||
 | 
					                                    else
 | 
				
			||||||
 | 
					                                        if v.alpha ~= alpha then
 | 
				
			||||||
 | 
					                                            return ""
 | 
				
			||||||
 | 
					                                        end
 | 
				
			||||||
                                    end
 | 
					                                    end
 | 
				
			||||||
                                end
 | 
					                                end
 | 
				
			||||||
                                return alphas[1].alpha
 | 
					                                return alpha
 | 
				
			||||||
                            end,
 | 
					                            end,
 | 
				
			||||||
                            set = function(info, value)
 | 
					                            set = function(_, value)
 | 
				
			||||||
                                local alphas = GetTotemOptions()
 | 
					                                for _,v in pairs(Gladdy.dbi.profile.npTotemColors) do
 | 
				
			||||||
                                for i=1, #alphas do
 | 
					                                    v.alpha = value
 | 
				
			||||||
                                    alphas[i].alpha = value
 | 
					 | 
				
			||||||
                                end
 | 
					                                end
 | 
				
			||||||
                                Gladdy:UpdateFrame()
 | 
					                                Gladdy:UpdateFrame()
 | 
				
			||||||
                            end,
 | 
					                            end,
 | 
				
			||||||
@@ -570,23 +739,27 @@ function TotemPlates:GetOptions()
 | 
				
			|||||||
                            name = L["All totem border color"],
 | 
					                            name = L["All totem border color"],
 | 
				
			||||||
                            order = 42,
 | 
					                            order = 42,
 | 
				
			||||||
                            hasAlpha = true,
 | 
					                            hasAlpha = true,
 | 
				
			||||||
                            get = function(info)
 | 
					                            get = function()
 | 
				
			||||||
                                local colors = GetTotemOptions()
 | 
					                                local color
 | 
				
			||||||
                                local color = colors[1].color
 | 
					                                local i = 1
 | 
				
			||||||
                                for i=2, #colors do
 | 
					                                for _,v in pairs(Gladdy.dbi.profile.npTotemColors) do
 | 
				
			||||||
                                    if colors[i].r ~= color.r or colors[i].color.r ~= color.r or colors[i].color.r ~= color.r or colors[i].color.r ~= color.r then
 | 
					                                    if i == 1 then
 | 
				
			||||||
                                        return 0, 0, 0, 0
 | 
					                                        color = v.color
 | 
				
			||||||
 | 
					                                        i = i + 1
 | 
				
			||||||
 | 
					                                    else
 | 
				
			||||||
 | 
					                                        if v.color.r ~= color.r or v.color.g ~= color.g or v.color.b ~= color.b or v.color.a ~= color.a then
 | 
				
			||||||
 | 
					                                            return 0, 0, 0, 0
 | 
				
			||||||
 | 
					                                        end
 | 
				
			||||||
                                    end
 | 
					                                    end
 | 
				
			||||||
                                end
 | 
					                                end
 | 
				
			||||||
                                return color.r, color.g, color.b, color.a
 | 
					                                return color.r, color.g, color.b, color.a
 | 
				
			||||||
                            end,
 | 
					                            end,
 | 
				
			||||||
                            set = function(info, r, g, b, a)
 | 
					                            set = function(_, r, g, b, a)
 | 
				
			||||||
                                local colors = GetTotemOptions()
 | 
					                                for _,v in pairs(Gladdy.dbi.profile.npTotemColors) do
 | 
				
			||||||
                                for i=1, #colors do
 | 
					                                    v.color.r = r
 | 
				
			||||||
                                    colors[i].color.r = r
 | 
					                                    v.color.g = g
 | 
				
			||||||
                                    colors[i].color.g = g
 | 
					                                    v.color.b = b
 | 
				
			||||||
                                    colors[i].color.b = b
 | 
					                                    v.color.a = a
 | 
				
			||||||
                                    colors[i].color.a = a
 | 
					 | 
				
			||||||
                                end
 | 
					                                end
 | 
				
			||||||
                                Gladdy:UpdateFrame()
 | 
					                                Gladdy:UpdateFrame()
 | 
				
			||||||
                            end,
 | 
					                            end,
 | 
				
			||||||
@@ -597,10 +770,11 @@ function TotemPlates:GetOptions()
 | 
				
			|||||||
        },
 | 
					        },
 | 
				
			||||||
        npTotemColors = {
 | 
					        npTotemColors = {
 | 
				
			||||||
            order = 50,
 | 
					            order = 50,
 | 
				
			||||||
            name = "Customize Totems",
 | 
					            name = L["Customize Totems"],
 | 
				
			||||||
            type = "group",
 | 
					            type = "group",
 | 
				
			||||||
            childGroups = "tree",
 | 
					            childGroups = "tree",
 | 
				
			||||||
            args = select(2, Gladdy:GetTotemColors())
 | 
					            disabled = function() return not Gladdy.db.npTotems end,
 | 
				
			||||||
 | 
					            args = select(2, GetTotemColorDefaultOptions())
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
							
								
								
									
										782
									
								
								Modules/TotemPulse.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										782
									
								
								Modules/TotemPulse.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,782 @@
 | 
				
			|||||||
 | 
					local select, pairs, tremove, tinsert, format, strsplit, tonumber = select, pairs, tremove, tinsert, format, strsplit, tonumber
 | 
				
			||||||
 | 
					local type = type
 | 
				
			||||||
 | 
					local C_NamePlate = C_NamePlate
 | 
				
			||||||
 | 
					local Gladdy = LibStub("Gladdy")
 | 
				
			||||||
 | 
					local L = Gladdy.L
 | 
				
			||||||
 | 
					local GetSpellInfo, CreateFrame = GetSpellInfo, CreateFrame
 | 
				
			||||||
 | 
					local GetTime, UnitIsEnemy, UnitGUID = GetTime, UnitIsEnemy, UnitGUID
 | 
				
			||||||
 | 
					local CombatLogGetCurrentEventInfo = CombatLogGetCurrentEventInfo
 | 
				
			||||||
 | 
					local UIParent = UIParent
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Helper
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local totemData, npcIdToTotemData, cooldowns = Gladdy:GetTotemData()
 | 
				
			||||||
 | 
					local ninetyDegreeInRad = 90 * math.pi / 180
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function TotemOptions()
 | 
				
			||||||
 | 
					    local defaultDB = {}
 | 
				
			||||||
 | 
					    local options = {}
 | 
				
			||||||
 | 
					    local indexedList = {}
 | 
				
			||||||
 | 
					    for k,v in pairs(totemData) do
 | 
				
			||||||
 | 
					        if v.pulse then
 | 
				
			||||||
 | 
					            tinsert(indexedList, {name = k, id = v.id, color = v.color, texture = v.texture})
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    table.sort(indexedList, function (a, b)
 | 
				
			||||||
 | 
					        return a.name < b.name
 | 
				
			||||||
 | 
					    end)
 | 
				
			||||||
 | 
					    for i=1,#indexedList do
 | 
				
			||||||
 | 
					        defaultDB["totem" .. indexedList[i].id] = {enabled = true, attachToGladdyTotemFrame = true, style = "COOLDOWN", reverse = false}
 | 
				
			||||||
 | 
					        options["totem" .. indexedList[i].id] = {
 | 
				
			||||||
 | 
					            order = i+1,
 | 
				
			||||||
 | 
					            name = select(1, GetSpellInfo(indexedList[i].id)),
 | 
				
			||||||
 | 
					            --inline = true,
 | 
				
			||||||
 | 
					            width  = "3.0",
 | 
				
			||||||
 | 
					            type = "group",
 | 
				
			||||||
 | 
					            icon = indexedList[i].texture,
 | 
				
			||||||
 | 
					            args = {
 | 
				
			||||||
 | 
					                headerTotemConfig = {
 | 
				
			||||||
 | 
					                    type = "header",
 | 
				
			||||||
 | 
					                    name = format("|T%s:20|t %s", indexedList[i].texture, select(1, GetSpellInfo(indexedList[i].id))),
 | 
				
			||||||
 | 
					                    order = 1,
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                enabled = {
 | 
				
			||||||
 | 
					                    order = 2,
 | 
				
			||||||
 | 
					                    name = L["Enabled"],
 | 
				
			||||||
 | 
					                    desc = "Enable " .. format("|T%s:20|t %s", indexedList[i].texture, select(1, GetSpellInfo(indexedList[i].id))),
 | 
				
			||||||
 | 
					                    type = "toggle",
 | 
				
			||||||
 | 
					                    width = "full",
 | 
				
			||||||
 | 
					                    get = function() return Gladdy.dbi.profile.totemPulseTotems["totem" .. indexedList[i].id].enabled end,
 | 
				
			||||||
 | 
					                    set = function(_, value)
 | 
				
			||||||
 | 
					                        Gladdy.dbi.profile.totemPulseTotems["totem" .. indexedList[i].id].enabled = value
 | 
				
			||||||
 | 
					                        Gladdy:UpdateFrame()
 | 
				
			||||||
 | 
					                    end
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                attachToGladdyTotemFrame = {
 | 
				
			||||||
 | 
					                    order = 3,
 | 
				
			||||||
 | 
					                    disabled = function() return not Gladdy.dbi.profile.totemPulseTotems["totem" .. indexedList[i].id].enabled end,
 | 
				
			||||||
 | 
					                    name = L["Attach To TotemPlate"],
 | 
				
			||||||
 | 
					                    desc = "Attach " .. format("|T%s:20|t %s", indexedList[i].texture, select(1, GetSpellInfo(indexedList[i].id))) .. "  To TotemPlate",
 | 
				
			||||||
 | 
					                    type = "toggle",
 | 
				
			||||||
 | 
					                    width = "full",
 | 
				
			||||||
 | 
					                    get = function() return Gladdy.dbi.profile.totemPulseTotems["totem" .. indexedList[i].id].attachToGladdyTotemFrame end,
 | 
				
			||||||
 | 
					                    set = function(_, value)
 | 
				
			||||||
 | 
					                        Gladdy.dbi.profile.totemPulseTotems["totem" .. indexedList[i].id].attachToGladdyTotemFrame = value
 | 
				
			||||||
 | 
					                        Gladdy:UpdateFrame()
 | 
				
			||||||
 | 
					                    end
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                style = {
 | 
				
			||||||
 | 
					                    type = "select",
 | 
				
			||||||
 | 
					                    name = L["Style"],
 | 
				
			||||||
 | 
					                    order = 4,
 | 
				
			||||||
 | 
					                    values = {
 | 
				
			||||||
 | 
					                        COOLDOWN = L["Cooldown"],
 | 
				
			||||||
 | 
					                        Vertical = L["Bar vertical"],
 | 
				
			||||||
 | 
					                        Horizontal = L["Bar horizontal"]
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                    get = function() return Gladdy.dbi.profile.totemPulseTotems["totem" .. indexedList[i].id].style end,
 | 
				
			||||||
 | 
					                    set = function(_, value)
 | 
				
			||||||
 | 
					                        Gladdy.dbi.profile.totemPulseTotems["totem" .. indexedList[i].id].style = value
 | 
				
			||||||
 | 
					                        Gladdy:UpdateFrame()
 | 
				
			||||||
 | 
					                    end
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                reverse = {
 | 
				
			||||||
 | 
					                    order = 5,
 | 
				
			||||||
 | 
					                    disabled = function() return not Gladdy.dbi.profile.totemPulseTotems["totem" .. indexedList[i].id].enabled end,
 | 
				
			||||||
 | 
					                    name = L["Reverse"],
 | 
				
			||||||
 | 
					                    type = "toggle",
 | 
				
			||||||
 | 
					                    width = "full",
 | 
				
			||||||
 | 
					                    get = function() return Gladdy.dbi.profile.totemPulseTotems["totem" .. indexedList[i].id].reverse end,
 | 
				
			||||||
 | 
					                    set = function(_, value)
 | 
				
			||||||
 | 
					                        Gladdy.dbi.profile.totemPulseTotems["totem" .. indexedList[i].id].reverse = value
 | 
				
			||||||
 | 
					                        Gladdy:UpdateFrame()
 | 
				
			||||||
 | 
					                    end
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    return options,defaultDB
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Core
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local TotemPulse = Gladdy:NewModule("Totem Pulse", 1, {
 | 
				
			||||||
 | 
					    totemPulseEnabled = true,
 | 
				
			||||||
 | 
					    totemPulseEnabledShowFriendly = true,
 | 
				
			||||||
 | 
					    totemPulseEnabledShowEnemy = true,
 | 
				
			||||||
 | 
					    totemPulseStyle = "", -- "COOLDOWN", "COOLDOWNREVERSE", "BARVERTICAL", "BARHORIZONTAL"
 | 
				
			||||||
 | 
					    --text
 | 
				
			||||||
 | 
					    totemPulseTextColor = { r = 1, g = 1, b = 1, a = 1 },
 | 
				
			||||||
 | 
					    totemPulseTextSize = 14,
 | 
				
			||||||
 | 
					    totemPulseTextFont = "DorisPP",
 | 
				
			||||||
 | 
					    --bar
 | 
				
			||||||
 | 
					    totemPulseBarWidth = 40,
 | 
				
			||||||
 | 
					    totemPulseBarHeight = 20,
 | 
				
			||||||
 | 
					    totemPulseBarColor =  { r = 1, g = 0, b = 0, a = .5 },
 | 
				
			||||||
 | 
					    totemPulseBarBgColor =  { r = 0, g = 1, b = 0, a = .5 },
 | 
				
			||||||
 | 
					    totemPulseBarBorderColor = { r = 0, g = 0, b = 0, a = 1 },
 | 
				
			||||||
 | 
					    totemPulseBarBorderSize = 4,
 | 
				
			||||||
 | 
					    totemPulseBarBorderStyle = "Gladdy Tooltip squared",
 | 
				
			||||||
 | 
					    totemPulseBarTexture = "Flat",
 | 
				
			||||||
 | 
					    totemPulseBarReverse = false,
 | 
				
			||||||
 | 
					    --cooldown
 | 
				
			||||||
 | 
					    totemPulseCooldownWidth = 40,
 | 
				
			||||||
 | 
					    totemPulseCooldownHeight = 20,
 | 
				
			||||||
 | 
					    totemPulseCooldownAlpha = 1,
 | 
				
			||||||
 | 
					    totemPulseCooldownReverse = true,
 | 
				
			||||||
 | 
					    --totems
 | 
				
			||||||
 | 
					    totemPulseTotems = select(2, TotemOptions())
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPulse.OnEvent(self, event, ...)
 | 
				
			||||||
 | 
					    TotemPulse[event](self, ...)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPulse:Initialize()
 | 
				
			||||||
 | 
					    self.timeStamps = {}
 | 
				
			||||||
 | 
					    self.cooldownCache = {}
 | 
				
			||||||
 | 
					    self.barCache = {}
 | 
				
			||||||
 | 
					    self.activeFrames = { bars = {}, cooldowns = {} }
 | 
				
			||||||
 | 
					    if Gladdy.db.totemPulseEnabled then
 | 
				
			||||||
 | 
					        self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
 | 
				
			||||||
 | 
					        self:RegisterEvent("NAME_PLATE_UNIT_REMOVED")
 | 
				
			||||||
 | 
					        self:RegisterEvent("NAME_PLATE_UNIT_ADDED")
 | 
				
			||||||
 | 
					        self:RegisterEvent("UNIT_NAME_UPDATE")
 | 
				
			||||||
 | 
					        self:SetScript("OnEvent", self.OnEvent)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    self:RegisterEvent("PLAYER_ENTERING_WORLD")
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- EVENTS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPulse:PLAYER_ENTERING_WORLD()
 | 
				
			||||||
 | 
					    self.timeStamps = {}
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPulse:COMBAT_LOG_EVENT_UNFILTERED()
 | 
				
			||||||
 | 
					    local _,eventType,_,sourceGUID,_,_,_,destGUID,_,_,_,spellID,spellName = CombatLogGetCurrentEventInfo()
 | 
				
			||||||
 | 
					    local pulse = cooldowns[spellID] or cooldowns[spellName]
 | 
				
			||||||
 | 
					    local npcId = tonumber(select(6, strsplit("-", destGUID)), 10)
 | 
				
			||||||
 | 
					    if eventType == "UNIT_DESTROYED" and self.timeStamps[destGUID] then
 | 
				
			||||||
 | 
					        self.timeStamps[destGUID] = nil
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if (eventType == "SWING_DAMAGE" or eventType == "SPELL_DAMAGE") and self.timeStamps[destGUID] and npcIdToTotemData[npcId] then
 | 
				
			||||||
 | 
					        self.timeStamps[destGUID] = nil
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if not pulse then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if eventType == "SPELL_CAST_SUCCESS" then
 | 
				
			||||||
 | 
					        self.timeStamps[sourceGUID] = { timeStamp = GetTime(), pulse = pulse }
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if eventType == "SPELL_SUMMON" then
 | 
				
			||||||
 | 
					        if not npcIdToTotemData[npcId] then
 | 
				
			||||||
 | 
					            return
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if not Gladdy.dbi.profile.totemPulseTotems["totem" .. npcIdToTotemData[npcId].id].enabled then
 | 
				
			||||||
 | 
					            return
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if self.timeStamps[sourceGUID] then
 | 
				
			||||||
 | 
					            self.timeStamps[destGUID] = self.timeStamps[sourceGUID]
 | 
				
			||||||
 | 
					            self.timeStamps[destGUID].id = npcIdToTotemData[npcId].id
 | 
				
			||||||
 | 
					            self.timeStamps[sourceGUID] = nil
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            self.timeStamps[destGUID] = { timeStamp = GetTime(), pulse = pulse, id = npcIdToTotemData[npcId].id }
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPulse:NAME_PLATE_UNIT_REMOVED(unitId)
 | 
				
			||||||
 | 
					    local nameplate = C_NamePlate.GetNamePlateForUnit(unitId)
 | 
				
			||||||
 | 
					    if nameplate.totemTick then
 | 
				
			||||||
 | 
					        nameplate.totemTick:SetScript("OnUpdate", nil)
 | 
				
			||||||
 | 
					        nameplate.totemTick:Hide()
 | 
				
			||||||
 | 
					        nameplate.totemTick:SetParent(nil)
 | 
				
			||||||
 | 
					        tinsert(nameplate.totemTick.bar and self.barCache or self.cooldownCache, nameplate.totemTick)
 | 
				
			||||||
 | 
					        self.activeFrames.bars[nameplate.totemTick] = nil
 | 
				
			||||||
 | 
					        self.activeFrames.cooldowns[nameplate.totemTick] = nil
 | 
				
			||||||
 | 
					        nameplate.totemTick = nil
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPulse:NAME_PLATE_UNIT_ADDED(unitId)
 | 
				
			||||||
 | 
					    self:OnUnitAdded(unitId, "NAME_PLATE_UNIT_ADDED")
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPulse:UNIT_NAME_UPDATE(unitId)
 | 
				
			||||||
 | 
					    self:OnUnitAdded(unitId, "UNIT_NAME_UPDATE")
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPulse:OnUnitAdded(unitId)
 | 
				
			||||||
 | 
					    local isEnemy = UnitIsEnemy("player", unitId)
 | 
				
			||||||
 | 
					    local guid = UnitGUID(unitId)
 | 
				
			||||||
 | 
					    if strsplit("-", guid) ~= "Creature" then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    local nameplate = C_NamePlate.GetNamePlateForUnit(unitId)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if nameplate and (isEnemy and Gladdy.db.totemPulseEnabledShowEnemy or not isEnemy and Gladdy.db.totemPulseEnabledShowFriendly) then
 | 
				
			||||||
 | 
					        if self.timeStamps[guid] and strsplit("-", guid) then
 | 
				
			||||||
 | 
					            self:AddTimerFrame(nameplate, self.timeStamps[guid])
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            if nameplate.totemTick then
 | 
				
			||||||
 | 
					                nameplate.totemTick:SetScript("OnUpdate", nil)
 | 
				
			||||||
 | 
					                nameplate.totemTick:Hide()
 | 
				
			||||||
 | 
					                nameplate.totemTick:SetParent(nil)
 | 
				
			||||||
 | 
					                tinsert(nameplate.totemTick.bar and self.barCache or self.cooldownCache, nameplate.totemTick)
 | 
				
			||||||
 | 
					                self.activeFrames.bars[nameplate.totemTick] = nil
 | 
				
			||||||
 | 
					                self.activeFrames.cooldowns[nameplate.totemTick] = nil
 | 
				
			||||||
 | 
					                nameplate.totemTick = nil
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- FRAMES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPulse:CreateCooldownFrame(style)
 | 
				
			||||||
 | 
					    local totemTick
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if style == "COOLDOWN" then
 | 
				
			||||||
 | 
					        if #self.cooldownCache > 0 then
 | 
				
			||||||
 | 
					            totemTick = tremove(self.cooldownCache, #self.cooldownCache)
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            totemTick = CreateFrame("Frame")
 | 
				
			||||||
 | 
					            totemTick:SetWidth(Gladdy.db.totemPulseCooldownWidth)
 | 
				
			||||||
 | 
					            totemTick:SetHeight(Gladdy.db.totemPulseCooldownHeight)
 | 
				
			||||||
 | 
					            totemTick.cd = CreateFrame("Cooldown", nil, totemTick, "CooldownFrameTemplate")
 | 
				
			||||||
 | 
					            totemTick.cd:SetAllPoints(totemTick)
 | 
				
			||||||
 | 
					            totemTick.cd.noCooldownCount = true
 | 
				
			||||||
 | 
					            totemTick:SetFrameStrata("MEDIUM")
 | 
				
			||||||
 | 
					            totemTick:SetFrameLevel(4)
 | 
				
			||||||
 | 
					            totemTick.cd:SetReverse(Gladdy.db.totemPulseCooldownReverse)
 | 
				
			||||||
 | 
					            totemTick.cd:SetHideCountdownNumbers(true)
 | 
				
			||||||
 | 
					            totemTick.cd:SetAlpha(Gladdy.db.totemPulseCooldownAlpha)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            totemTick.textFrame = CreateFrame("Frame", nil, totemTick)
 | 
				
			||||||
 | 
					            totemTick.textFrame:SetAllPoints(totemTick)
 | 
				
			||||||
 | 
					            totemTick.text = totemTick.textFrame:CreateFontString(nil, "OVERLAY")
 | 
				
			||||||
 | 
					            totemTick.text:SetPoint("CENTER", totemTick.textFrame, "CENTER")
 | 
				
			||||||
 | 
					            totemTick.text:SetFont(Gladdy:SMFetch("font", "totemPulseTextFont"), Gladdy.db.totemPulseTextSize, "OUTLINE")
 | 
				
			||||||
 | 
					            totemTick.text:SetJustifyH("CENTER")
 | 
				
			||||||
 | 
					            totemTick.text:SetShadowOffset(1, -1)
 | 
				
			||||||
 | 
					            totemTick.text:SetTextColor(Gladdy:SetColor(Gladdy.db.totemPulseTextColor))
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        if #self.barCache > 0 then
 | 
				
			||||||
 | 
					            totemTick = tremove(self.barCache, #self.barCache)
 | 
				
			||||||
 | 
					            totemTick.bar:SetOrientation(style)
 | 
				
			||||||
 | 
					            totemTick.spark:SetRotation(style == "Vertical" and ninetyDegreeInRad or 0)
 | 
				
			||||||
 | 
					            totemTick.spark:SetHeight(style == "Vertical" and Gladdy.db.totemPulseBarWidth or Gladdy.db.totemPulseBarHeight)
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            totemTick = CreateFrame("Frame", nil)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            totemTick:SetWidth(Gladdy.db.totemPulseBarWidth)
 | 
				
			||||||
 | 
					            totemTick:SetHeight(Gladdy.db.totemPulseBarHeight)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            totemTick.backdrop = CreateFrame("Frame", nil, totemTick, BackdropTemplateMixin and "BackdropTemplate")
 | 
				
			||||||
 | 
					            totemTick.backdrop:SetAllPoints(totemTick)
 | 
				
			||||||
 | 
					            totemTick.backdrop:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "totemPulseBarBorderStyle"),
 | 
				
			||||||
 | 
					                                             edgeSize = Gladdy.db.totemPulseBarBorderSize })
 | 
				
			||||||
 | 
					            totemTick.backdrop:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.totemPulseBarBorderColor))
 | 
				
			||||||
 | 
					            totemTick.backdrop:SetFrameLevel(1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            totemTick.bar = CreateFrame("StatusBar", nil, totemTick)
 | 
				
			||||||
 | 
					            totemTick.bar:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "totemPulseBarTexture"))
 | 
				
			||||||
 | 
					            totemTick.bar:SetStatusBarColor(Gladdy:SetColor(Gladdy.db.totemPulseBarColor))
 | 
				
			||||||
 | 
					            totemTick.bar:SetOrientation(style)
 | 
				
			||||||
 | 
					            totemTick.bar:SetFrameLevel(0)
 | 
				
			||||||
 | 
					            totemTick.bar:SetAllPoints(totemTick)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            totemTick.spark = totemTick.bar:CreateTexture(nil, "OVERLAY")
 | 
				
			||||||
 | 
					            totemTick.spark:SetTexture("Interface\\CastingBar\\UI-CastingBar-Spark")
 | 
				
			||||||
 | 
					            totemTick.spark:SetBlendMode("ADD")
 | 
				
			||||||
 | 
					            totemTick.spark:SetWidth(8)
 | 
				
			||||||
 | 
					            totemTick.spark:SetHeight(style == "Vertical" and Gladdy.db.totemPulseBarWidth or Gladdy.db.totemPulseBarHeight)
 | 
				
			||||||
 | 
					            totemTick.spark.position = 0
 | 
				
			||||||
 | 
					            totemTick.spark:SetRotation(style == "Vertical" and ninetyDegreeInRad or 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            totemTick.bg = totemTick:CreateTexture(nil, "ARTWORK")
 | 
				
			||||||
 | 
					            totemTick.bg:SetTexture(Gladdy:SMFetch("statusbar", "totemPulseBarTexture"))
 | 
				
			||||||
 | 
					            totemTick.bg:SetAllPoints(totemTick.bar)
 | 
				
			||||||
 | 
					            totemTick.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.totemPulseBarBgColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            totemTick.text = totemTick.bar:CreateFontString(nil, "OVERLAY")
 | 
				
			||||||
 | 
					            totemTick.text:SetPoint("CENTER", totemTick, "CENTER", 0, 0)
 | 
				
			||||||
 | 
					            totemTick.text:SetFont(Gladdy:SMFetch("font", "totemPulseTextFont"), Gladdy.db.totemPulseTextSize, "OUTLINE")
 | 
				
			||||||
 | 
					            totemTick.text:SetJustifyH("CENTER")
 | 
				
			||||||
 | 
					            totemTick.text:SetShadowOffset(1, -1)
 | 
				
			||||||
 | 
					            totemTick.text:SetTextColor(Gladdy:SetColor(Gladdy.db.totemPulseTextColor))
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    return totemTick
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPulse:AddTimerFrame(nameplate, timestamp, test)
 | 
				
			||||||
 | 
					    if (nameplate:IsShown() or test) and timestamp and timestamp.id then
 | 
				
			||||||
 | 
					        if not nameplate.totemTick then
 | 
				
			||||||
 | 
					            nameplate.totemTick = TotemPulse:CreateCooldownFrame(Gladdy.db.totemPulseTotems["totem" .. timestamp.id].style)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        nameplate.totemTick:SetParent(nameplate)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        local cd = type(timestamp.pulse) == "table" and timestamp.pulse.cd or timestamp.pulse
 | 
				
			||||||
 | 
					        local once = type(timestamp.pulse) == "table"
 | 
				
			||||||
 | 
					        local cooldown = (timestamp.timeStamp - GetTime()) % cd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        nameplate.totemTick.timestamp = timestamp.timeStamp
 | 
				
			||||||
 | 
					        nameplate.totemTick.maxValue = cd
 | 
				
			||||||
 | 
					        nameplate.totemTick.value = cooldown
 | 
				
			||||||
 | 
					        nameplate.totemTick.once = once
 | 
				
			||||||
 | 
					        nameplate.totemTick.id = timestamp.id
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if nameplate.totemTick.bar then
 | 
				
			||||||
 | 
					            self:UpdateBarPartial(nameplate.totemTick)
 | 
				
			||||||
 | 
					            nameplate.totemTick.bar:SetMinMaxValues(0, cd)
 | 
				
			||||||
 | 
					            nameplate.totemTick.bar:SetValue(cooldown)
 | 
				
			||||||
 | 
					            self.activeFrames.bars[nameplate.totemTick] = nameplate.totemTick
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            self:UpdateCooldown(nameplate.totemTick)
 | 
				
			||||||
 | 
					            self.activeFrames.cooldowns[nameplate.totemTick] = nameplate.totemTick
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if once and GetTime() - timestamp.timeStamp > cd then
 | 
				
			||||||
 | 
					            nameplate.totemTick:SetScript("OnUpdate", nil)
 | 
				
			||||||
 | 
					            nameplate.totemTick:Hide()
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            nameplate.totemTick:SetScript("OnUpdate", TotemPulse.TotemPulseOnUpdate)
 | 
				
			||||||
 | 
					            nameplate.totemTick:Show()
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        if nameplate.totemTick then
 | 
				
			||||||
 | 
					            nameplate.totemTick:SetScript("OnUpdate", nil)
 | 
				
			||||||
 | 
					            nameplate.totemTick:Hide()
 | 
				
			||||||
 | 
					            nameplate.totemTick:SetParent(nil)
 | 
				
			||||||
 | 
					            tinsert(nameplate.totemTick.bar and self.barCache or self.cooldownCache, nameplate.totemTick)
 | 
				
			||||||
 | 
					            self.activeFrames.bars[nameplate.totemTick] = nil
 | 
				
			||||||
 | 
					            self.activeFrames.cooldowns[nameplate.totemTick] = nil
 | 
				
			||||||
 | 
					            nameplate.totemTick = nil
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPulse:SetSparkPosition(totemTick, referenceSize, vertical)
 | 
				
			||||||
 | 
					    if not Gladdy.db.totemPulseTotems["totem" .. totemTick.id].reverse then
 | 
				
			||||||
 | 
					        totemTick.bar:SetValue(totemTick.maxValue - totemTick.value)
 | 
				
			||||||
 | 
					        totemTick.spark.position = referenceSize / 2 - (totemTick.value / totemTick.maxValue) * referenceSize
 | 
				
			||||||
 | 
					        if ( totemTick.spark.position < -referenceSize / 2 ) then
 | 
				
			||||||
 | 
					            totemTick.spark.position = -referenceSize / 2
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        totemTick.bar:SetValue(totemTick.value)
 | 
				
			||||||
 | 
					        totemTick.spark.position = referenceSize / 2 - ((totemTick.maxValue - totemTick.value) / totemTick.maxValue) * referenceSize
 | 
				
			||||||
 | 
					        if ( totemTick.spark.position > referenceSize / 2 ) then
 | 
				
			||||||
 | 
					            totemTick.spark.position = referenceSize / 2
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    totemTick.spark:SetPoint("CENTER", totemTick.bar, "CENTER", vertical and 0 or totemTick.spark.position, vertical and totemTick.spark.position or 0)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPulse.TotemPulseOnUpdate(totemTick)
 | 
				
			||||||
 | 
					    totemTick.now = GetTime()
 | 
				
			||||||
 | 
					    totemTick.value = (totemTick.timestamp - totemTick.now) % totemTick.maxValue
 | 
				
			||||||
 | 
					    if totemTick.once and totemTick.now - totemTick.timestamp >= totemTick.maxValue then
 | 
				
			||||||
 | 
					        totemTick:SetScript("OnUpdate", nil)
 | 
				
			||||||
 | 
					        totemTick:Hide()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if not totemTick.bar and not (totemTick.once and totemTick.now - totemTick.timestamp >= totemTick.maxValue) then
 | 
				
			||||||
 | 
					        if Gladdy.db.totemPulseTotems["totem" .. totemTick.id].reverse then
 | 
				
			||||||
 | 
					            totemTick.cd:SetCooldown(totemTick.now - totemTick.value, totemTick.maxValue)
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            totemTick.cd:SetCooldown(totemTick.now - (totemTick.maxValue - totemTick.value), totemTick.maxValue)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    elseif totemTick.bar then
 | 
				
			||||||
 | 
					        if Gladdy.db.totemPulseTotems["totem" .. totemTick.id].style == "Vertical" then
 | 
				
			||||||
 | 
					            TotemPulse:SetSparkPosition(totemTick, totemTick.bar:GetHeight(), true)
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            TotemPulse:SetSparkPosition(totemTick, totemTick.bar:GetWidth(), false)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    totemTick.text:SetFormattedText("%.1f", totemTick.value)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Update Styles
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPulse:UpdateBarPartial(bar)
 | 
				
			||||||
 | 
					    local style = bar.id and Gladdy.db.totemPulseTotems["totem" .. bar.id].style
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    bar:SetWidth(Gladdy.db.totemPulseBarWidth)
 | 
				
			||||||
 | 
					    bar:SetHeight(Gladdy.db.totemPulseBarHeight)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    bar.spark:SetWidth(8)
 | 
				
			||||||
 | 
					    bar.spark:SetHeight(style == "Vertical" and Gladdy.db.totemPulseBarWidth or Gladdy.db.totemPulseBarHeight)
 | 
				
			||||||
 | 
					    bar.spark:SetRotation(style == "Vertical" and ninetyDegreeInRad or 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if bar:GetParent() and bar:GetParent() ~= UIParent then
 | 
				
			||||||
 | 
					        local gladdyTotemFrame = bar:GetParent().gladdyTotemFrame and bar:GetParent().gladdyTotemFrame
 | 
				
			||||||
 | 
					        local nameplate = bar:GetParent()
 | 
				
			||||||
 | 
					        bar:ClearAllPoints()
 | 
				
			||||||
 | 
					        if bar.id and gladdyTotemFrame and gladdyTotemFrame:IsShown() and Gladdy.db.totemPulseTotems["totem" .. bar.id].attachToGladdyTotemFrame then
 | 
				
			||||||
 | 
					            bar:SetPoint("TOPLEFT", gladdyTotemFrame, "TOPLEFT", Gladdy.db.npTotemPlatesSize/16, -Gladdy.db.npTotemPlatesSize/16)
 | 
				
			||||||
 | 
					            bar:SetPoint("BOTTOMRIGHT", gladdyTotemFrame, "BOTTOMRIGHT", -Gladdy.db.npTotemPlatesSize/16, Gladdy.db.npTotemPlatesSize/16)
 | 
				
			||||||
 | 
					            if style then
 | 
				
			||||||
 | 
					                bar.spark:SetHeight(style == "Vertical" and gladdyTotemFrame:GetWidth() or gladdyTotemFrame:GetHeight())
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        elseif bar.id and gladdyTotemFrame and gladdyTotemFrame:IsShown() and not Gladdy.db.totemPulseTotems["totem" .. bar.id].attachToGladdyTotemFrame then
 | 
				
			||||||
 | 
					            bar:SetPoint("TOP", gladdyTotemFrame, "BOTTOM", 0, -0.5)
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            bar:SetPoint("TOP", nameplate, "BOTTOM", 0, -0.5)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    bar.bar:SetOrientation(style ~= "COOLDOWN" and style or bar.bar:GetOrientation())
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPulse:UpdateBar(bar)
 | 
				
			||||||
 | 
					    self:UpdateBarPartial(bar)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    bar.backdrop:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "totemPulseBarBorderStyle"),
 | 
				
			||||||
 | 
					                               edgeSize = Gladdy.db.totemPulseBarBorderSize })
 | 
				
			||||||
 | 
					    bar.backdrop:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.totemPulseBarBorderColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    bar.bar:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "totemPulseBarTexture"))
 | 
				
			||||||
 | 
					    bar.bar:SetStatusBarColor(Gladdy:SetColor(Gladdy.db.totemPulseBarColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    bar.bg:SetTexture(Gladdy:SMFetch("statusbar", "totemPulseBarTexture"))
 | 
				
			||||||
 | 
					    bar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.totemPulseBarBgColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    bar.text:SetFont(Gladdy:SMFetch("font", "totemPulseTextFont"), Gladdy.db.totemPulseTextSize, "OUTLINE")
 | 
				
			||||||
 | 
					    bar.text:SetTextColor(Gladdy:SetColor(Gladdy.db.totemPulseTextColor))
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPulse:UpdateCooldown(cooldown)
 | 
				
			||||||
 | 
					    cooldown:SetWidth(Gladdy.db.totemPulseCooldownWidth)
 | 
				
			||||||
 | 
					    cooldown:SetHeight(Gladdy.db.totemPulseCooldownHeight)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    cooldown.cd:SetCooldown(0,0)
 | 
				
			||||||
 | 
					    cooldown.cd:SetReverse(Gladdy.db.totemPulseCooldownReverse)
 | 
				
			||||||
 | 
					    cooldown.cd:SetAlpha(Gladdy.db.totemPulseCooldownAlpha)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    cooldown.text:SetFont(Gladdy:SMFetch("font", "totemPulseTextFont"), Gladdy.db.totemPulseTextSize, "OUTLINE")
 | 
				
			||||||
 | 
					    cooldown.text:SetTextColor(Gladdy:SetColor(Gladdy.db.totemPulseTextColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if cooldown:GetParent() and cooldown:GetParent() ~= UIParent then
 | 
				
			||||||
 | 
					        local gladdyTotemFrame = cooldown:GetParent().gladdyTotemFrame and cooldown:GetParent().gladdyTotemFrame
 | 
				
			||||||
 | 
					        local nameplate = cooldown:GetParent()
 | 
				
			||||||
 | 
					        cooldown:ClearAllPoints()
 | 
				
			||||||
 | 
					        if cooldown.id and gladdyTotemFrame and gladdyTotemFrame:IsShown() and Gladdy.db.totemPulseTotems["totem" .. cooldown.id].attachToGladdyTotemFrame then
 | 
				
			||||||
 | 
					            cooldown:SetPoint("TOPLEFT", gladdyTotemFrame, "TOPLEFT", Gladdy.db.npTotemPlatesSize/16, -Gladdy.db.npTotemPlatesSize/16)
 | 
				
			||||||
 | 
					            cooldown:SetPoint("BOTTOMRIGHT", gladdyTotemFrame, "BOTTOMRIGHT", -Gladdy.db.npTotemPlatesSize/16, Gladdy.db.npTotemPlatesSize/16)
 | 
				
			||||||
 | 
					        elseif cooldown.id and gladdyTotemFrame and gladdyTotemFrame:IsShown() and not Gladdy.db.totemPulseTotems["totem" .. cooldown.id].attachToGladdyTotemFrame then
 | 
				
			||||||
 | 
					            cooldown:SetPoint("TOP", gladdyTotemFrame, "BOTTOM", 0, -0.5)
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            cooldown:SetPoint("TOP", nameplate, "BOTTOM", 0, -0.5)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPulse:UpdateFrameOnce()
 | 
				
			||||||
 | 
					    if Gladdy.frame.testing then
 | 
				
			||||||
 | 
					        TotemPulse:TestOnce()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if Gladdy.db.totemPulseEnabled then
 | 
				
			||||||
 | 
					        self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
 | 
				
			||||||
 | 
					        self:RegisterEvent("NAME_PLATE_UNIT_REMOVED")
 | 
				
			||||||
 | 
					        self:RegisterEvent("NAME_PLATE_UNIT_ADDED")
 | 
				
			||||||
 | 
					        self:RegisterEvent("UNIT_NAME_UPDATE")
 | 
				
			||||||
 | 
					        self:SetScript("OnEvent", self.OnEvent)
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        for _,bar in pairs(self.activeFrames.bars) do
 | 
				
			||||||
 | 
					            bar:SetScript("OnUpdate", nil)
 | 
				
			||||||
 | 
					            bar:Hide()
 | 
				
			||||||
 | 
					            bar:SetParent(nil)
 | 
				
			||||||
 | 
					            tinsert(self.barCache, bar)
 | 
				
			||||||
 | 
					            self.activeFrames.bars[bar] = nil
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        for _,cooldown in pairs(self.activeFrames.cooldowns) do
 | 
				
			||||||
 | 
					            cooldown:SetScript("OnUpdate", nil)
 | 
				
			||||||
 | 
					            cooldown:Hide()
 | 
				
			||||||
 | 
					            cooldown:SetParent(nil)
 | 
				
			||||||
 | 
					            tinsert(self.cooldownCache, cooldown)
 | 
				
			||||||
 | 
					            self.activeFrames.cooldowns[cooldown] = nil
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        self:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
 | 
				
			||||||
 | 
					        self:UnregisterEvent("NAME_PLATE_UNIT_REMOVED")
 | 
				
			||||||
 | 
					        self:UnregisterEvent("NAME_PLATE_UNIT_ADDED")
 | 
				
			||||||
 | 
					        self:UnregisterEvent("UNIT_NAME_UPDATE")
 | 
				
			||||||
 | 
					        self:SetScript("OnEvent", nil)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    for _,bar in pairs(self.activeFrames.bars) do
 | 
				
			||||||
 | 
					        self:UpdateBar(bar)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    for _,cooldown in pairs(self.activeFrames.cooldowns) do
 | 
				
			||||||
 | 
					        self:UpdateCooldown(cooldown)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    for _,bar in pairs(self.barCache) do
 | 
				
			||||||
 | 
					        self:UpdateBar(bar)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    for _,cooldown in pairs(self.cooldownCache) do
 | 
				
			||||||
 | 
					        self:UpdateCooldown(cooldown)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- TEST
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPulse:TestOnce()
 | 
				
			||||||
 | 
					    local totemPlatesTestFrame = Gladdy.modules["Totem Plates"].testFrame
 | 
				
			||||||
 | 
					    if totemPlatesTestFrame then
 | 
				
			||||||
 | 
					        if totemPlatesTestFrame.totemTick
 | 
				
			||||||
 | 
					                and (Gladdy.db.totemPulseTotems["totem" .. npcIdToTotemData[5913].id].style == "COOLDOWN" and totemPlatesTestFrame.totemTick.bar
 | 
				
			||||||
 | 
					                or Gladdy.db.totemPulseTotems["totem" .. npcIdToTotemData[5913].id].style ~= "COOLDOWN" and not totemPlatesTestFrame.totemTick.bar) then
 | 
				
			||||||
 | 
					            totemPlatesTestFrame.totemTick:SetScript("OnUpdate", nil)
 | 
				
			||||||
 | 
					            totemPlatesTestFrame.totemTick:Hide()
 | 
				
			||||||
 | 
					            totemPlatesTestFrame.totemTick:SetParent(nil)
 | 
				
			||||||
 | 
					            totemPlatesTestFrame.totemTick.id = nil
 | 
				
			||||||
 | 
					            tinsert(totemPlatesTestFrame.totemTick.bar and self.barCache or self.cooldownCache, totemPlatesTestFrame.totemTick)
 | 
				
			||||||
 | 
					            self.activeFrames.bars[totemPlatesTestFrame.totemTick] = nil
 | 
				
			||||||
 | 
					            self.activeFrames.cooldowns[totemPlatesTestFrame.totemTick] = nil
 | 
				
			||||||
 | 
					            totemPlatesTestFrame.totemTick = nil
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        local timestamp = { timeStamp = GetTime(), pulse = npcIdToTotemData[5913].pulse, id = npcIdToTotemData[5913].id }
 | 
				
			||||||
 | 
					        TotemPulse:AddTimerFrame(totemPlatesTestFrame, timestamp, true)
 | 
				
			||||||
 | 
					        self.testFrame = totemPlatesTestFrame.totemTick
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPulse:Reset()
 | 
				
			||||||
 | 
					    if self.testFrame then
 | 
				
			||||||
 | 
					        self.testFrame:SetScript("OnUpdate", nil)
 | 
				
			||||||
 | 
					        self.testFrame:Hide()
 | 
				
			||||||
 | 
					        self.testFrame:SetParent(nil)
 | 
				
			||||||
 | 
					        tinsert(self.testFrame.bar and self.barCache or self.cooldownCache, self.testFrame)
 | 
				
			||||||
 | 
					        self.activeFrames.bars[self.testFrame] = nil
 | 
				
			||||||
 | 
					        self.activeFrames.cooldowns[self.testFrame] = nil
 | 
				
			||||||
 | 
					        self.testFrame = nil
 | 
				
			||||||
 | 
					        Gladdy.modules["Totem Plates"].testFrame.totemTick = nil
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- OPTIONS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function TotemPulse:GetOptions()
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
					        headerClassicon = {
 | 
				
			||||||
 | 
					            type = "header",
 | 
				
			||||||
 | 
					            name = L["Totem Pulse"],
 | 
				
			||||||
 | 
					            order = 2,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        totemPulseEnabled = Gladdy:option({
 | 
				
			||||||
 | 
					            type = "toggle",
 | 
				
			||||||
 | 
					            name = L["Totem Pulse Enabled"],
 | 
				
			||||||
 | 
					            order = 3,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
 | 
					        group = {
 | 
				
			||||||
 | 
					            type = "group",
 | 
				
			||||||
 | 
					            childGroups = "tree",
 | 
				
			||||||
 | 
					            name = L["Frame"],
 | 
				
			||||||
 | 
					            order = 4,
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.totemPulseEnabled end,
 | 
				
			||||||
 | 
					            args = {
 | 
				
			||||||
 | 
					                barFrame = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Bar"],
 | 
				
			||||||
 | 
					                    order = 2,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        headerSize = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Size"],
 | 
				
			||||||
 | 
					                            order = 10,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        totemPulseBarHeight = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Bar height"],
 | 
				
			||||||
 | 
					                            desc = L["Height of the bar"],
 | 
				
			||||||
 | 
					                            order = 11,
 | 
				
			||||||
 | 
					                            min = 0.1,
 | 
				
			||||||
 | 
					                            max = 200,
 | 
				
			||||||
 | 
					                            step = .1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        totemPulseBarWidth = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Bar width"],
 | 
				
			||||||
 | 
					                            desc = L["Width of the bar"],
 | 
				
			||||||
 | 
					                            order = 12,
 | 
				
			||||||
 | 
					                            min = 0.1,
 | 
				
			||||||
 | 
					                            max = 600,
 | 
				
			||||||
 | 
					                            step = .1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        headerTexture = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Texture"],
 | 
				
			||||||
 | 
					                            order = 20,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        totemPulseBarTexture = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "select",
 | 
				
			||||||
 | 
					                            name = L["Bar texture"],
 | 
				
			||||||
 | 
					                            desc = L["Texture of the bar"],
 | 
				
			||||||
 | 
					                            order = 21,
 | 
				
			||||||
 | 
					                            dialogControl = "LSM30_Statusbar",
 | 
				
			||||||
 | 
					                            values = AceGUIWidgetLSMlists.statusbar,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        totemPulseBarColor = Gladdy:colorOption({
 | 
				
			||||||
 | 
					                            type = "color",
 | 
				
			||||||
 | 
					                            name = L["Bar color"],
 | 
				
			||||||
 | 
					                            desc = L["Color of the cast bar"],
 | 
				
			||||||
 | 
					                            order = 22,
 | 
				
			||||||
 | 
					                            hasAlpha = true,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        totemPulseBarBgColor = Gladdy:colorOption({
 | 
				
			||||||
 | 
					                            type = "color",
 | 
				
			||||||
 | 
					                            name = L["Background color"],
 | 
				
			||||||
 | 
					                            desc = L["Color of the cast bar background"],
 | 
				
			||||||
 | 
					                            order = 23,
 | 
				
			||||||
 | 
					                            hasAlpha = true,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        headerBorder = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Border"],
 | 
				
			||||||
 | 
					                            order = 30,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        totemPulseBarBorderSize = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Border size"],
 | 
				
			||||||
 | 
					                            order = 31,
 | 
				
			||||||
 | 
					                            min = 0.5,
 | 
				
			||||||
 | 
					                            max = Gladdy.db.castBarHeight/2,
 | 
				
			||||||
 | 
					                            step = 0.5,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        totemPulseBarBorderStyle = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "select",
 | 
				
			||||||
 | 
					                            name = L["Status Bar border"],
 | 
				
			||||||
 | 
					                            order = 32,
 | 
				
			||||||
 | 
					                            dialogControl = "LSM30_Border",
 | 
				
			||||||
 | 
					                            values = AceGUIWidgetLSMlists.border,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        totemPulseBarBorderColor = Gladdy:colorOption({
 | 
				
			||||||
 | 
					                            type = "color",
 | 
				
			||||||
 | 
					                            name = L["Status Bar border color"],
 | 
				
			||||||
 | 
					                            order = 33,
 | 
				
			||||||
 | 
					                            hasAlpha = true,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                cooldownFrame = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Cooldown"],
 | 
				
			||||||
 | 
					                    order = 3,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        headerSize = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Frame"],
 | 
				
			||||||
 | 
					                            order = 10,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        totemPulseCooldownHeight = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Height"],
 | 
				
			||||||
 | 
					                            order = 11,
 | 
				
			||||||
 | 
					                            min = 0.1,
 | 
				
			||||||
 | 
					                            max = 200,
 | 
				
			||||||
 | 
					                            step = .1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        totemPulseCooldownWidth = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Width"],
 | 
				
			||||||
 | 
					                            order = 12,
 | 
				
			||||||
 | 
					                            min = 0.1,
 | 
				
			||||||
 | 
					                            max = 600,
 | 
				
			||||||
 | 
					                            step = .1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        totemPulseCooldownAlpha = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Alpha"],
 | 
				
			||||||
 | 
					                            order = 21,
 | 
				
			||||||
 | 
					                            min = 0.1,
 | 
				
			||||||
 | 
					                            max = 1,
 | 
				
			||||||
 | 
					                            step = .1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                text = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Text"],
 | 
				
			||||||
 | 
					                    order = 4,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        headerSize = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Text"],
 | 
				
			||||||
 | 
					                            order = 10,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        totemPulseTextSize = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Size"],
 | 
				
			||||||
 | 
					                            order = 11,
 | 
				
			||||||
 | 
					                            min = 0.5,
 | 
				
			||||||
 | 
					                            max = 30,
 | 
				
			||||||
 | 
					                            step = 0.5,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        totemPulseTextFont = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "select",
 | 
				
			||||||
 | 
					                            name = L["Font"],
 | 
				
			||||||
 | 
					                            desc = L["Font of the bar"],
 | 
				
			||||||
 | 
					                            order = 12,
 | 
				
			||||||
 | 
					                            dialogControl = "LSM30_Font",
 | 
				
			||||||
 | 
					                            values = AceGUIWidgetLSMlists.font,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        totemPulseTextColor = Gladdy:colorOption({
 | 
				
			||||||
 | 
					                            type = "color",
 | 
				
			||||||
 | 
					                            name = L["Font color"],
 | 
				
			||||||
 | 
					                            desc = L["Color of the text"],
 | 
				
			||||||
 | 
					                            order = 13,
 | 
				
			||||||
 | 
					                            hasAlpha = true,
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        customizeTotems = {
 | 
				
			||||||
 | 
					            order = 50,
 | 
				
			||||||
 | 
					            name = L["Customize Totems"],
 | 
				
			||||||
 | 
					            type = "group",
 | 
				
			||||||
 | 
					            childGroups = "tree",
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.totemPulseEnabled end,
 | 
				
			||||||
 | 
					            args = select(1, TotemOptions())
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
@@ -1,106 +1,143 @@
 | 
				
			|||||||
local ceil, floor, string_format, tonumber = ceil, floor, string.format, tonumber
 | 
					local ceil, str_gsub = ceil, string.gsub
 | 
				
			||||||
 | 
					local C_PvP = C_PvP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local CreateFrame = CreateFrame
 | 
					local CreateFrame = CreateFrame
 | 
				
			||||||
local GetTime = GetTime
 | 
					local GetTime = GetTime
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local Gladdy = LibStub("Gladdy")
 | 
					local Gladdy = LibStub("Gladdy")
 | 
				
			||||||
local L = Gladdy.L
 | 
					local L = Gladdy.L
 | 
				
			||||||
local Trinket = Gladdy:NewModule("Trinket", nil, {
 | 
					local Trinket = Gladdy:NewModule("Trinket", 80, {
 | 
				
			||||||
    trinketFont = "DorisPP",
 | 
					    trinketFont = "DorisPP",
 | 
				
			||||||
    trinketFontScale = 1,
 | 
					    trinketFontScale = 1,
 | 
				
			||||||
 | 
					    trinketFontEnabled = true,
 | 
				
			||||||
    trinketEnabled = true,
 | 
					    trinketEnabled = true,
 | 
				
			||||||
    trinketSize = 60 + 20 + 1,
 | 
					    trinketSize = 60 + 20 + 1,
 | 
				
			||||||
    trinketWidthFactor = 0.9,
 | 
					    trinketWidthFactor = 0.9,
 | 
				
			||||||
    trinketPos = "RIGHT",
 | 
					    trinketIconZoomed = false,
 | 
				
			||||||
    trinketBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp",
 | 
					    trinketBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp",
 | 
				
			||||||
    trinketBorderColor = { r = 0, g = 0, b = 0, a = 1 },
 | 
					    trinketBorderColor = { r = 0, g = 0, b = 0, a = 1 },
 | 
				
			||||||
    trinketDisableCircle = false,
 | 
					    trinketDisableCircle = false,
 | 
				
			||||||
    trinketCooldownAlpha = 1,
 | 
					    trinketCooldownAlpha = 1,
 | 
				
			||||||
 | 
					    trinketCooldownNumberAlpha = 1,
 | 
				
			||||||
 | 
					    trinketXOffset = 0,
 | 
				
			||||||
 | 
					    trinketYOffset = 0,
 | 
				
			||||||
 | 
					    trinketFrameStrata = "MEDIUM",
 | 
				
			||||||
 | 
					    trinketFrameLevel = 5,
 | 
				
			||||||
 | 
					    trinketColored = false,
 | 
				
			||||||
 | 
					    trinketColoredCd = { r = 1, g = 0, b = 0, a = 1 },
 | 
				
			||||||
 | 
					    trinketColoredNoCd = { r = 0, g = 1, b = 0, a = 1 },
 | 
				
			||||||
 | 
					    trinketGroup = false,
 | 
				
			||||||
 | 
					    trinketGroupDirection = "DOWN",
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
LibStub("AceComm-3.0"):Embed(Trinket)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Trinket:Initialize()
 | 
					function Trinket:Initialize()
 | 
				
			||||||
    self.frames = {}
 | 
					    self.frames = {}
 | 
				
			||||||
 | 
					    if Gladdy.db.trinketEnabled then
 | 
				
			||||||
 | 
					        self:RegisterMessage("JOINED_ARENA")
 | 
				
			||||||
 | 
					        self:RegisterMessage("TRINKET_USED")
 | 
				
			||||||
 | 
					        if Gladdy.expansion == "Wrath" then
 | 
				
			||||||
 | 
					            self:RegisterMessage("RACIAL_USED")
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    self:RegisterMessage("JOINED_ARENA")
 | 
					function Trinket:UpdateFrameOnce()
 | 
				
			||||||
 | 
					    if Gladdy.db.trinketEnabled then
 | 
				
			||||||
 | 
					        self:RegisterMessage("JOINED_ARENA")
 | 
				
			||||||
 | 
					        if Gladdy.expansion == "Wrath" then
 | 
				
			||||||
 | 
					            self:RegisterMessage("RACIAL_USED")
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        self:UnregisterAllMessages()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function iconTimer(self, elapsed)
 | 
				
			||||||
 | 
					    if (self.active) then
 | 
				
			||||||
 | 
					        if (self.timeLeft <= 0) then
 | 
				
			||||||
 | 
					            self.active = false
 | 
				
			||||||
 | 
					            self.cooldown:Clear()
 | 
				
			||||||
 | 
					            Gladdy:SendMessage("TRINKET_READY", self.unit)
 | 
				
			||||||
 | 
					            if Gladdy.db.trinketColored then
 | 
				
			||||||
 | 
					                self:SetBackdropColor(Gladdy:SetColor(Gladdy.db.trinketColoredNoCd))
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            self.timeLeft = self.timeLeft - elapsed
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        local timeLeft = ceil(self.timeLeft)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if timeLeft >= 60 then
 | 
				
			||||||
 | 
					            self.cooldownFont:SetTextColor(1, 1, 0, Gladdy.db.trinketCooldownNumberAlpha)
 | 
				
			||||||
 | 
					            self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 0.15*self:GetWidth()) * Gladdy.db.trinketFontScale, "OUTLINE")
 | 
				
			||||||
 | 
					        elseif timeLeft < 60 and timeLeft >= 30 then
 | 
				
			||||||
 | 
					            self.cooldownFont:SetTextColor(1, 1, 0, Gladdy.db.trinketCooldownNumberAlpha)
 | 
				
			||||||
 | 
					            self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
 | 
				
			||||||
 | 
					        elseif timeLeft < 30 and timeLeft >= 11 then
 | 
				
			||||||
 | 
					            self.cooldownFont:SetTextColor(1, 0.7, 0, Gladdy.db.trinketCooldownNumberAlpha)
 | 
				
			||||||
 | 
					            self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
 | 
				
			||||||
 | 
					        elseif timeLeft <= 10 and timeLeft >= 5 then
 | 
				
			||||||
 | 
					            self.cooldownFont:SetTextColor(1, 0.7, 0, Gladdy.db.trinketCooldownNumberAlpha)
 | 
				
			||||||
 | 
					            self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
 | 
				
			||||||
 | 
					        elseif timeLeft < 5 and timeLeft > 0 then
 | 
				
			||||||
 | 
					            self.cooldownFont:SetTextColor(1, 0, 0, Gladdy.db.trinketCooldownNumberAlpha)
 | 
				
			||||||
 | 
					            self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        if Gladdy.db.trinketFontEnabled then
 | 
				
			||||||
 | 
					            Gladdy:FormatTimer(self.cooldownFont, self.timeLeft, self.timeLeft < 10, true)
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            self.cooldownFont:SetText("")
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Trinket:CreateFrame(unit)
 | 
					function Trinket:CreateFrame(unit)
 | 
				
			||||||
    local trinket = CreateFrame("Button", "GladdyTrinketButton" .. unit, Gladdy.buttons[unit])
 | 
					    local trinket = CreateFrame("Button", "GladdyTrinketButton" .. unit, Gladdy.buttons[unit], BackdropTemplateMixin and "BackdropTemplate")
 | 
				
			||||||
 | 
					    trinket:SetBackdrop({bgFile = "Interface\\AddOns\\Gladdy\\Images\\trinket" })
 | 
				
			||||||
 | 
					    trinket:EnableMouse(false)
 | 
				
			||||||
 | 
					    trinket:SetFrameStrata(Gladdy.db.trinketFrameStrata)
 | 
				
			||||||
 | 
					    trinket:SetFrameLevel(Gladdy.db.trinketFrameLevel)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    trinket.texture = trinket:CreateTexture(nil, "BACKGROUND")
 | 
					    trinket.texture = trinket:CreateTexture(nil, "BACKGROUND")
 | 
				
			||||||
    trinket.texture:SetAllPoints(trinket)
 | 
					    trinket.texture:SetAllPoints(trinket)
 | 
				
			||||||
    trinket.texture:SetTexture("Interface\\Icons\\INV_Jewelry_TrinketPVP_02")
 | 
					    trinket.texture:SetTexture("Interface\\Icons\\INV_Jewelry_TrinketPVP_02")
 | 
				
			||||||
 | 
					    trinket.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
				
			||||||
 | 
					    trinket.texture.masked = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    trinket.cooldown = CreateFrame("Cooldown", nil, trinket, "CooldownFrameTemplate")
 | 
					    trinket.cooldown = CreateFrame("Cooldown", nil, trinket, "CooldownFrameTemplate")
 | 
				
			||||||
    trinket.cooldown.noCooldownCount = true --Gladdy.db.trinketDisableOmniCC
 | 
					    trinket.cooldown.noCooldownCount = true --Gladdy.db.trinketDisableOmniCC
 | 
				
			||||||
    trinket.cooldown:SetHideCountdownNumbers(true)
 | 
					    trinket.cooldown:SetHideCountdownNumbers(true)
 | 
				
			||||||
 | 
					    trinket.cooldown:SetFrameStrata(Gladdy.db.trinketFrameStrata)
 | 
				
			||||||
 | 
					    trinket.cooldown:SetFrameLevel(Gladdy.db.trinketFrameLevel + 1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    trinket.cooldownFrame = CreateFrame("Frame", nil, trinket)
 | 
					    trinket.cooldownFrame = CreateFrame("Frame", nil, trinket)
 | 
				
			||||||
    trinket.cooldownFrame:ClearAllPoints()
 | 
					    trinket.cooldownFrame:ClearAllPoints()
 | 
				
			||||||
    trinket.cooldownFrame:SetPoint("TOPLEFT", trinket, "TOPLEFT")
 | 
					    trinket.cooldownFrame:SetPoint("TOPLEFT", trinket, "TOPLEFT")
 | 
				
			||||||
    trinket.cooldownFrame:SetPoint("BOTTOMRIGHT", trinket, "BOTTOMRIGHT")
 | 
					    trinket.cooldownFrame:SetPoint("BOTTOMRIGHT", trinket, "BOTTOMRIGHT")
 | 
				
			||||||
 | 
					    trinket.cooldownFrame:SetFrameStrata(Gladdy.db.trinketFrameStrata)
 | 
				
			||||||
 | 
					    trinket.cooldownFrame:SetFrameLevel(Gladdy.db.trinketFrameLevel + 2)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    trinket.cooldownFont = trinket.cooldownFrame:CreateFontString(nil, "OVERLAY")
 | 
					    trinket.cooldownFont = trinket.cooldownFrame:CreateFontString(nil, "OVERLAY")
 | 
				
			||||||
    trinket.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.trinketFont), 20, "OUTLINE")
 | 
					    trinket.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), 20, "OUTLINE")
 | 
				
			||||||
    --trinket.cooldownFont:SetAllPoints(trinket.cooldown)
 | 
					    --trinket.cooldownFont:SetAllPoints(trinket.cooldown)
 | 
				
			||||||
    trinket.cooldownFont:SetJustifyH("CENTER")
 | 
					    trinket.cooldownFont:SetJustifyH("CENTER")
 | 
				
			||||||
    trinket.cooldownFont:SetPoint("CENTER")
 | 
					    trinket.cooldownFont:SetPoint("CENTER")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    trinket.borderFrame = CreateFrame("Frame", nil, trinket)
 | 
					    trinket.borderFrame = CreateFrame("Frame", nil, trinket)
 | 
				
			||||||
    trinket.borderFrame:SetAllPoints(trinket)
 | 
					    trinket.borderFrame:SetAllPoints(trinket)
 | 
				
			||||||
 | 
					    trinket.borderFrame:SetFrameStrata(Gladdy.db.trinketFrameStrata)
 | 
				
			||||||
 | 
					    trinket.borderFrame:SetFrameLevel(Gladdy.db.trinketFrameLevel + 3)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    trinket.texture.overlay = trinket.borderFrame:CreateTexture(nil, "OVERLAY")
 | 
					    trinket.texture.overlay = trinket.borderFrame:CreateTexture(nil, "OVERLAY")
 | 
				
			||||||
    trinket.texture.overlay:SetAllPoints(trinket)
 | 
					    trinket.texture.overlay:SetAllPoints(trinket)
 | 
				
			||||||
    trinket.texture.overlay:SetTexture(Gladdy.db.trinketBorderStyle)
 | 
					    trinket.texture.overlay:SetTexture(Gladdy.db.trinketBorderStyle)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local function formatTimer(num, numDecimalPlaces)
 | 
					    trinket.unit = unit
 | 
				
			||||||
        return tonumber(string_format("%." .. (numDecimalPlaces or 0) .. "f", num))
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    trinket:SetScript("OnUpdate", function(self, elapsed)
 | 
					    trinket:SetScript("OnUpdate", iconTimer)
 | 
				
			||||||
        if (self.active) then
 | 
					 | 
				
			||||||
            if (self.timeLeft <= 0) then
 | 
					 | 
				
			||||||
                self.active = false
 | 
					 | 
				
			||||||
                self.cooldown:Clear()
 | 
					 | 
				
			||||||
                Gladdy:SendMessage("TRINKET_READY", unit)
 | 
					 | 
				
			||||||
            else
 | 
					 | 
				
			||||||
                self.timeLeft = self.timeLeft - elapsed
 | 
					 | 
				
			||||||
            end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            local timeLeft = ceil(self.timeLeft)
 | 
					 | 
				
			||||||
            local timeLeftMilliSec = formatTimer(self.timeLeft, 1)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            if timeLeft >= 60 then
 | 
					 | 
				
			||||||
                -- more than 1 minute
 | 
					 | 
				
			||||||
                self.cooldownFont:SetTextColor(1, 1, 0)
 | 
					 | 
				
			||||||
                self.cooldownFont:SetText(floor(timeLeft / 60) .. ":" .. string_format("%02.f", floor(timeLeft - floor(timeLeft / 60) * 60)))
 | 
					 | 
				
			||||||
                self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.trinketFont), (trinket:GetWidth()/2 - 0.15*trinket:GetWidth()) * Gladdy.db.trinketFontScale, "OUTLINE")
 | 
					 | 
				
			||||||
            elseif timeLeft < 60 and timeLeft >= 21 then
 | 
					 | 
				
			||||||
                -- between 60s and 21s (green)
 | 
					 | 
				
			||||||
                self.cooldownFont:SetTextColor(0.7, 1, 0)
 | 
					 | 
				
			||||||
                self.cooldownFont:SetText(timeLeft)
 | 
					 | 
				
			||||||
                self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.trinketFont), (trinket:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
 | 
					 | 
				
			||||||
            elseif timeLeft < 20.9 and timeLeft >= 11 then
 | 
					 | 
				
			||||||
                -- between 20s and 11s (green)
 | 
					 | 
				
			||||||
                self.cooldownFont:SetTextColor(0, 1, 0)
 | 
					 | 
				
			||||||
                self.cooldownFont:SetText(timeLeft)
 | 
					 | 
				
			||||||
                self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.trinketFont), (trinket:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
 | 
					 | 
				
			||||||
            elseif timeLeftMilliSec <= 10 and timeLeftMilliSec >= 5 then
 | 
					 | 
				
			||||||
                -- between 10s and 5s (orange)
 | 
					 | 
				
			||||||
                self.cooldownFont:SetTextColor(1, 0.7, 0)
 | 
					 | 
				
			||||||
                self.cooldownFont:SetFormattedText("%.1f", timeLeftMilliSec)
 | 
					 | 
				
			||||||
                self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.trinketFont), (trinket:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
 | 
					 | 
				
			||||||
            elseif timeLeftMilliSec < 5 and timeLeftMilliSec > 0 then
 | 
					 | 
				
			||||||
                -- between 5s and 1s (red)
 | 
					 | 
				
			||||||
                self.cooldownFont:SetTextColor(1, 0, 0)
 | 
					 | 
				
			||||||
                self.cooldownFont:SetFormattedText("%.1f", timeLeftMilliSec)
 | 
					 | 
				
			||||||
                self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.trinketFont), (trinket:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
 | 
					 | 
				
			||||||
            else
 | 
					 | 
				
			||||||
                self.cooldownFont:SetText("")
 | 
					 | 
				
			||||||
            end
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
    end)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    self.frames[unit] = trinket
 | 
					    self.frames[unit] = trinket
 | 
				
			||||||
 | 
					    Gladdy.buttons[unit].trinket = trinket
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Trinket:UpdateFrame(unit)
 | 
					function Trinket:UpdateFrame(unit)
 | 
				
			||||||
@@ -109,12 +146,29 @@ function Trinket:UpdateFrame(unit)
 | 
				
			|||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    local testAgain = false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local width, height = Gladdy.db.trinketSize * Gladdy.db.trinketWidthFactor, Gladdy.db.trinketSize
 | 
					    local width, height = Gladdy.db.trinketSize * Gladdy.db.trinketWidthFactor, Gladdy.db.trinketSize
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    trinket:SetFrameStrata(Gladdy.db.trinketFrameStrata)
 | 
				
			||||||
 | 
					    trinket:SetFrameLevel(Gladdy.db.trinketFrameLevel)
 | 
				
			||||||
 | 
					    trinket.cooldown:SetFrameStrata(Gladdy.db.trinketFrameStrata)
 | 
				
			||||||
 | 
					    trinket.cooldown:SetFrameLevel(Gladdy.db.trinketFrameLevel + 1)
 | 
				
			||||||
 | 
					    trinket.cooldownFrame:SetFrameStrata(Gladdy.db.trinketFrameStrata)
 | 
				
			||||||
 | 
					    trinket.cooldownFrame:SetFrameLevel(Gladdy.db.trinketFrameLevel + 2)
 | 
				
			||||||
 | 
					    trinket.borderFrame:SetFrameStrata(Gladdy.db.trinketFrameStrata)
 | 
				
			||||||
 | 
					    trinket.borderFrame:SetFrameLevel(Gladdy.db.trinketFrameLevel + 3)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    trinket:SetWidth(width)
 | 
					    trinket:SetWidth(width)
 | 
				
			||||||
    trinket:SetHeight(height)
 | 
					    trinket:SetHeight(height)
 | 
				
			||||||
    trinket.cooldown:SetWidth(width - width/16)
 | 
					    if Gladdy.db.trinketIconZoomed then
 | 
				
			||||||
    trinket.cooldown:SetHeight(height - height/16)
 | 
					        trinket.cooldown:SetWidth(width)
 | 
				
			||||||
 | 
					        trinket.cooldown:SetHeight(height)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        trinket.cooldown:SetWidth(width - width/16)
 | 
				
			||||||
 | 
					        trinket.cooldown:SetHeight(height - height/16)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
    trinket.cooldown:ClearAllPoints()
 | 
					    trinket.cooldown:ClearAllPoints()
 | 
				
			||||||
    trinket.cooldown:SetPoint("CENTER", trinket, "CENTER")
 | 
					    trinket.cooldown:SetPoint("CENTER", trinket, "CENTER")
 | 
				
			||||||
    trinket.cooldown.noCooldownCount = true -- Gladdy.db.trinketDisableOmniCC
 | 
					    trinket.cooldown.noCooldownCount = true -- Gladdy.db.trinketDisableOmniCC
 | 
				
			||||||
@@ -124,28 +178,81 @@ function Trinket:UpdateFrame(unit)
 | 
				
			|||||||
    trinket.texture:SetAllPoints(trinket)
 | 
					    trinket.texture:SetAllPoints(trinket)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    trinket.texture.overlay:SetTexture(Gladdy.db.trinketBorderStyle)
 | 
					    trinket.texture.overlay:SetTexture(Gladdy.db.trinketBorderStyle)
 | 
				
			||||||
    trinket.texture.overlay:SetVertexColor(Gladdy.db.trinketBorderColor.r, Gladdy.db.trinketBorderColor.g, Gladdy.db.trinketBorderColor.b, Gladdy.db.trinketBorderColor.a)
 | 
					    trinket.texture.overlay:SetVertexColor(Gladdy:SetColor(Gladdy.db.trinketBorderColor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    trinket:ClearAllPoints()
 | 
					    if Gladdy.db.trinketIconZoomed then
 | 
				
			||||||
    local margin = Gladdy.db.highlightBorderSize + Gladdy.db.padding
 | 
					        if trinket.texture.masked then
 | 
				
			||||||
    if (Gladdy.db.classIconPos == "LEFT") then
 | 
					            trinket.texture:SetMask(nil)
 | 
				
			||||||
        if (Gladdy.db.trinketPos == "RIGHT") then
 | 
					            trinket.texture:SetTexCoord(0.1,0.9,0.1,0.9)
 | 
				
			||||||
            trinket:SetPoint("TOPLEFT", Gladdy.buttons[unit].healthBar, "TOPRIGHT", margin, 0)
 | 
					            trinket.texture.masked = nil
 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
            trinket:SetPoint("TOPRIGHT", Gladdy.buttons[unit].classIcon, "TOPLEFT", -Gladdy.db.padding, 0)
 | 
					 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        if (Gladdy.db.trinketPos == "RIGHT") then
 | 
					        if not trinket.texture.masked then
 | 
				
			||||||
            trinket:SetPoint("TOPLEFT", Gladdy.buttons[unit].classIcon, "TOPRIGHT", Gladdy.db.padding, 0)
 | 
					            trinket.texture:SetMask(nil)
 | 
				
			||||||
        else
 | 
					            trinket.texture:SetTexCoord(0,1,0,1)
 | 
				
			||||||
            trinket:SetPoint("TOPRIGHT", Gladdy.buttons[unit].healthBar, "TOPLEFT", -margin, 0)
 | 
					            trinket.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
				
			||||||
 | 
					            trinket.texture.masked = true
 | 
				
			||||||
 | 
					            if Gladdy.frame.testing then
 | 
				
			||||||
 | 
					                testAgain = true
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (Gladdy.db.trinketEnabled == false) then
 | 
					    if Gladdy.db.trinketColored then
 | 
				
			||||||
 | 
					        if trinket.active then
 | 
				
			||||||
 | 
					            trinket:SetBackdropColor(Gladdy:SetColor(Gladdy.db.trinketColoredCd))
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            trinket:SetBackdropColor(Gladdy:SetColor(Gladdy.db.trinketColoredNoCd))
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					        trinket.texture:SetTexture()
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        trinket:SetBackdropColor(0,0,0,0)
 | 
				
			||||||
 | 
					        trinket.texture:SetTexture("Interface\\Icons\\INV_Jewelry_TrinketPVP_02")
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Gladdy:SetPosition(trinket, unit, "trinketXOffset", "trinketYOffset", Trinket:LegacySetPosition(trinket, unit), Trinket)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (Gladdy.db.trinketGroup) then
 | 
				
			||||||
 | 
					        if (unit ~= "arena1") then
 | 
				
			||||||
 | 
					            local previousUnit = "arena" .. str_gsub(unit, "arena", "") - 1
 | 
				
			||||||
 | 
					            self.frames[unit]:ClearAllPoints()
 | 
				
			||||||
 | 
					            if Gladdy.db.trinketGroupDirection == "RIGHT" then
 | 
				
			||||||
 | 
					                self.frames[unit]:SetPoint("LEFT", self.frames[previousUnit], "RIGHT", 0, 0)
 | 
				
			||||||
 | 
					            elseif Gladdy.db.trinketGroupDirection == "LEFT" then
 | 
				
			||||||
 | 
					                self.frames[unit]:SetPoint("RIGHT", self.frames[previousUnit], "LEFT", 0, 0)
 | 
				
			||||||
 | 
					            elseif Gladdy.db.trinketGroupDirection == "UP" then
 | 
				
			||||||
 | 
					                self.frames[unit]:SetPoint("BOTTOM", self.frames[previousUnit], "TOP", 0, 0)
 | 
				
			||||||
 | 
					            elseif Gladdy.db.trinketGroupDirection == "DOWN" then
 | 
				
			||||||
 | 
					                self.frames[unit]:SetPoint("TOP", self.frames[previousUnit], "BOTTOM", 0, 0)
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (unit == "arena1") then
 | 
				
			||||||
 | 
					        Gladdy:CreateMover(trinket,"trinketXOffset", "trinketYOffset", L["Trinket"],
 | 
				
			||||||
 | 
					                {"TOPLEFT", "TOPLEFT"},
 | 
				
			||||||
 | 
					                Gladdy.db.trinketSize * Gladdy.db.trinketWidthFactor,
 | 
				
			||||||
 | 
					                Gladdy.db.trinketSize,
 | 
				
			||||||
 | 
					                0,
 | 
				
			||||||
 | 
					                0, "trinketEnabled")
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    trinket.cooldown:SetAlpha(Gladdy.db.trinketCooldownAlpha)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if Gladdy.db.trinketDisableCircle then
 | 
				
			||||||
 | 
					        trinket.cooldown:Hide()
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        trinket.cooldown:Show()
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (not Gladdy.db.trinketEnabled) then
 | 
				
			||||||
        trinket:Hide()
 | 
					        trinket:Hide()
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        trinket:Show()
 | 
					        trinket:Show()
 | 
				
			||||||
 | 
					        if testAgain then
 | 
				
			||||||
 | 
					            Trinket:ResetUnit(unit)
 | 
				
			||||||
 | 
					            Trinket:Test(unit)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -160,6 +267,7 @@ function Trinket:ResetUnit(unit)
 | 
				
			|||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    trinket.itemID = nil
 | 
				
			||||||
    trinket.timeLeft = nil
 | 
					    trinket.timeLeft = nil
 | 
				
			||||||
    trinket.active = false
 | 
					    trinket.active = false
 | 
				
			||||||
    trinket.cooldown:Clear()
 | 
					    trinket.cooldown:Clear()
 | 
				
			||||||
@@ -171,13 +279,14 @@ function Trinket:Test(unit)
 | 
				
			|||||||
    if (not trinket) then
 | 
					    if (not trinket) then
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    if (unit == "arena2" or unit == "arena3") then
 | 
					    if (unit == "arena1" or unit == "arena2") then
 | 
				
			||||||
        self:Used(unit, GetTime() * 1000, 120000)
 | 
					        Gladdy:SendMessage("TRINKET_USED", unit)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Trinket:JOINED_ARENA()
 | 
					function Trinket:JOINED_ARENA()
 | 
				
			||||||
    self:RegisterEvent("ARENA_COOLDOWNS_UPDATE")
 | 
					    self:RegisterEvent("ARENA_COOLDOWNS_UPDATE")
 | 
				
			||||||
 | 
					    self:RegisterEvent("ARENA_CROWD_CONTROL_SPELL_UPDATE")
 | 
				
			||||||
    self:SetScript("OnEvent", function(self, event, ...)
 | 
					    self:SetScript("OnEvent", function(self, event, ...)
 | 
				
			||||||
        if self[event] then
 | 
					        if self[event] then
 | 
				
			||||||
            self[event](self, ...)
 | 
					            self[event](self, ...)
 | 
				
			||||||
@@ -185,13 +294,52 @@ function Trinket:JOINED_ARENA()
 | 
				
			|||||||
    end)
 | 
					    end)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Trinket:ARENA_CROWD_CONTROL_SPELL_UPDATE(...)
 | 
				
			||||||
 | 
					    local unitID, spellID, itemID = ...
 | 
				
			||||||
 | 
					    Gladdy:Debug("INFO", "Trinket:ARENA_CROWD_CONTROL_SPELL_UPDATE", unitID, spellID, itemID)
 | 
				
			||||||
 | 
					    if Gladdy.buttons[unitID] and Gladdy:GetPvpTrinkets()[itemID] then
 | 
				
			||||||
 | 
					        Gladdy.buttons[unitID].trinket.itemID = itemID
 | 
				
			||||||
 | 
					        if not Gladdy.db.trinketColored then
 | 
				
			||||||
 | 
					            self.frames[unitID].texture:SetTexture(GetItemIcon(itemID))
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Trinket:TRINKET_USED(unit)
 | 
				
			||||||
 | 
					    if Gladdy.buttons[unit] then
 | 
				
			||||||
 | 
					        self:Used(unit, GetTime() * 1000,
 | 
				
			||||||
 | 
					                Gladdy.buttons[unit].trinket.itemID and Gladdy:GetPvpTrinkets()[Gladdy.buttons[unit].trinket.itemID]
 | 
				
			||||||
 | 
					                        or 120000)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Trinket:RACIAL_USED(unit) -- Wrath only
 | 
				
			||||||
 | 
					    local trinket = self.frames[unit]
 | 
				
			||||||
 | 
					    if (not trinket) then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if Gladdy.buttons[unit].race == "Scourge" then
 | 
				
			||||||
 | 
					        if trinket.active and trinket.timeLeft >= 45 then
 | 
				
			||||||
 | 
					            -- do nothing
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            self:Used(unit, GetTime() * 1000, 45000)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    elseif Gladdy.buttons[unit].race == "Human" then
 | 
				
			||||||
 | 
					        self:Used(unit, GetTime() * 1000, 120000)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Trinket:ARENA_COOLDOWNS_UPDATE()
 | 
					function Trinket:ARENA_COOLDOWNS_UPDATE()
 | 
				
			||||||
    for i=1, Gladdy.curBracket do
 | 
					    for i=1, Gladdy.curBracket do
 | 
				
			||||||
        local unit = "arena" .. i
 | 
					        local unitID = "arena" .. i
 | 
				
			||||||
        local spellID, itemID, startTime, duration = C_PvP.GetArenaCrowdControlInfo(unit);
 | 
					        local spellID, itemID, startTime, duration = C_PvP.GetArenaCrowdControlInfo(unitID)
 | 
				
			||||||
        if (spellID) then
 | 
					        if (spellID) then
 | 
				
			||||||
 | 
					            Gladdy:Debug("INFO", "Trinket:ARENA_COOLDOWNS_UPDATE", spellID, itemID, startTime, duration)
 | 
				
			||||||
 | 
					            if not Gladdy.db.trinketColored and Gladdy:GetPvpTrinkets()[itemID] then
 | 
				
			||||||
 | 
					                self.frames[unitID].texture:SetTexture(GetItemIcon(itemID))
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
            if (startTime ~= 0 and duration ~= 0) then
 | 
					            if (startTime ~= 0 and duration ~= 0) then
 | 
				
			||||||
                self:Used(unit, startTime, duration)
 | 
					                self:Used(unitID, startTime, duration)
 | 
				
			||||||
            end
 | 
					            end
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
@@ -199,15 +347,17 @@ end
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
function Trinket:Used(unit, startTime, duration)
 | 
					function Trinket:Used(unit, startTime, duration)
 | 
				
			||||||
    local trinket = self.frames[unit]
 | 
					    local trinket = self.frames[unit]
 | 
				
			||||||
    if (not trinket) then
 | 
					    if (not trinket or not Gladdy.db.trinketEnabled) then
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    if not trinket.active then
 | 
					    --if not trinket.active then
 | 
				
			||||||
        trinket.timeLeft = (startTime/1000.0 + duration/1000.0) - GetTime()
 | 
					        trinket.timeLeft = (startTime/1000.0 + duration/1000.0) - GetTime()
 | 
				
			||||||
        if not Gladdy.db.trinketDisableCircle then trinket.cooldown:SetCooldown(startTime/1000.0, duration/1000.0) end
 | 
					        if not Gladdy.db.trinketDisableCircle then trinket.cooldown:SetCooldown(startTime/1000.0, duration/1000.0) end
 | 
				
			||||||
        trinket.active = true
 | 
					        trinket.active = true
 | 
				
			||||||
        Gladdy:SendMessage("TRINKET_USED", unit)
 | 
					        if Gladdy.db.trinketColored then
 | 
				
			||||||
    end
 | 
					            trinket:SetBackdropColor(Gladdy:SetColor(Gladdy.db.trinketColoredCd))
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    --end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Trinket:GetOptions()
 | 
					function Trinket:GetOptions()
 | 
				
			||||||
@@ -223,29 +373,81 @@ function Trinket:GetOptions()
 | 
				
			|||||||
            desc = L["Enable trinket icon"],
 | 
					            desc = L["Enable trinket icon"],
 | 
				
			||||||
            order = 3,
 | 
					            order = 3,
 | 
				
			||||||
        }),
 | 
					        }),
 | 
				
			||||||
 | 
					        trinketColored = Gladdy:option({
 | 
				
			||||||
 | 
					            type = "toggle",
 | 
				
			||||||
 | 
					            name = L["Colored trinket"],
 | 
				
			||||||
 | 
					            desc = L["Shows a solid colored icon when off/off CD."],
 | 
				
			||||||
 | 
					            order = 4,
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.trinketEnabled end,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
 | 
					        trinketColoredCd = Gladdy:colorOption({
 | 
				
			||||||
 | 
					            type = "color",
 | 
				
			||||||
 | 
					            name = L["Colored trinket CD"],
 | 
				
			||||||
 | 
					            desc = L["Color of the border"],
 | 
				
			||||||
 | 
					            order = 5,
 | 
				
			||||||
 | 
					            hasAlpha = true,
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.trinketEnabled end,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
 | 
					        trinketColoredNoCd = Gladdy:colorOption({
 | 
				
			||||||
 | 
					            type = "color",
 | 
				
			||||||
 | 
					            name = L["Colored trinket No CD"],
 | 
				
			||||||
 | 
					            desc = L["Color of the border"],
 | 
				
			||||||
 | 
					            order = 6,
 | 
				
			||||||
 | 
					            hasAlpha = true,
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.trinketEnabled end,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
 | 
					        trinketGroup = Gladdy:option({
 | 
				
			||||||
 | 
					            type = "toggle",
 | 
				
			||||||
 | 
					            name = L["Group Class Icons"],
 | 
				
			||||||
 | 
					            order = 7,
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.trinketEnabled end,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
 | 
					        trinketGroupDirection = Gladdy:option({
 | 
				
			||||||
 | 
					            type = "select",
 | 
				
			||||||
 | 
					            name = L["Group direction"],
 | 
				
			||||||
 | 
					            order = 8,
 | 
				
			||||||
 | 
					            values = {
 | 
				
			||||||
 | 
					                ["RIGHT"] = L["Right"],
 | 
				
			||||||
 | 
					                ["LEFT"] = L["Left"],
 | 
				
			||||||
 | 
					                ["UP"] = L["Up"],
 | 
				
			||||||
 | 
					                ["DOWN"] = L["Down"],
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					            disabled = function()
 | 
				
			||||||
 | 
					                return not Gladdy.db.trinketGroup or not Gladdy.db.trinketEnabled
 | 
				
			||||||
 | 
					            end,
 | 
				
			||||||
 | 
					        }),
 | 
				
			||||||
        group = {
 | 
					        group = {
 | 
				
			||||||
            type = "group",
 | 
					            type = "group",
 | 
				
			||||||
            childGroups = "tree",
 | 
					            childGroups = "tree",
 | 
				
			||||||
            name = "Frame",
 | 
					            name = L["Frame"],
 | 
				
			||||||
            order = 4,
 | 
					            order = 5,
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db.trinketEnabled end,
 | 
				
			||||||
            args = {
 | 
					            args = {
 | 
				
			||||||
                general = {
 | 
					                general = {
 | 
				
			||||||
                    type = "group",
 | 
					                    type = "group",
 | 
				
			||||||
                    name = L["Size"],
 | 
					                    name = L["Icon"],
 | 
				
			||||||
                    order = 1,
 | 
					                    order = 1,
 | 
				
			||||||
                    args = {
 | 
					                    args = {
 | 
				
			||||||
                        header = {
 | 
					                        header = {
 | 
				
			||||||
                            type = "header",
 | 
					                            type = "header",
 | 
				
			||||||
                            name = L["Size"],
 | 
					                            name = L["Icon"],
 | 
				
			||||||
                            order = 4,
 | 
					                            order = 1,
 | 
				
			||||||
                        },
 | 
					                        },
 | 
				
			||||||
 | 
					                        trinketIconZoomed = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["Zoomed Icon"],
 | 
				
			||||||
 | 
					                            desc = L["Zoomes the icon to remove borders"],
 | 
				
			||||||
 | 
					                            order = 2,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
                        trinketSize = Gladdy:option({
 | 
					                        trinketSize = Gladdy:option({
 | 
				
			||||||
                            type = "range",
 | 
					                            type = "range",
 | 
				
			||||||
                            name = L["Trinket size"],
 | 
					                            name = L["Size"],
 | 
				
			||||||
                            min = 5,
 | 
					                            min = 5,
 | 
				
			||||||
                            max = 100,
 | 
					                            max = 100,
 | 
				
			||||||
                            step = 1,
 | 
					                            step = 1,
 | 
				
			||||||
                            order = 4,
 | 
					                            order = 4,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        trinketWidthFactor = Gladdy:option({
 | 
					                        trinketWidthFactor = Gladdy:option({
 | 
				
			||||||
                            type = "range",
 | 
					                            type = "range",
 | 
				
			||||||
@@ -254,6 +456,7 @@ function Trinket:GetOptions()
 | 
				
			|||||||
                            max = 2,
 | 
					                            max = 2,
 | 
				
			||||||
                            step = 0.05,
 | 
					                            step = 0.05,
 | 
				
			||||||
                            order = 6,
 | 
					                            order = 6,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
@@ -271,6 +474,7 @@ function Trinket:GetOptions()
 | 
				
			|||||||
                            type = "toggle",
 | 
					                            type = "toggle",
 | 
				
			||||||
                            name = L["No Cooldown Circle"],
 | 
					                            name = L["No Cooldown Circle"],
 | 
				
			||||||
                            order = 7,
 | 
					                            order = 7,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                        trinketCooldownAlpha = Gladdy:option({
 | 
					                        trinketCooldownAlpha = Gladdy:option({
 | 
				
			||||||
                            type = "range",
 | 
					                            type = "range",
 | 
				
			||||||
@@ -279,6 +483,16 @@ function Trinket:GetOptions()
 | 
				
			|||||||
                            max = 1,
 | 
					                            max = 1,
 | 
				
			||||||
                            step = 0.1,
 | 
					                            step = 0.1,
 | 
				
			||||||
                            order = 8,
 | 
					                            order = 8,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        trinketCooldownNumberAlpha = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Cooldown number alpha"],
 | 
				
			||||||
 | 
					                            min = 0,
 | 
				
			||||||
 | 
					                            max = 1,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            order = 9,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
@@ -290,13 +504,19 @@ function Trinket:GetOptions()
 | 
				
			|||||||
                        header = {
 | 
					                        header = {
 | 
				
			||||||
                            type = "header",
 | 
					                            type = "header",
 | 
				
			||||||
                            name = L["Font"],
 | 
					                            name = L["Font"],
 | 
				
			||||||
                            order = 4,
 | 
					                            order = 1,
 | 
				
			||||||
                        },
 | 
					                        },
 | 
				
			||||||
 | 
					                        trinketFontEnabled = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "toggle",
 | 
				
			||||||
 | 
					                            name = L["Font Enabled"],
 | 
				
			||||||
 | 
					                            order = 2,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
                        trinketFont = Gladdy:option({
 | 
					                        trinketFont = Gladdy:option({
 | 
				
			||||||
                            type = "select",
 | 
					                            type = "select",
 | 
				
			||||||
                            name = L["Font"],
 | 
					                            name = L["Font"],
 | 
				
			||||||
                            desc = L["Font of the cooldown"],
 | 
					                            desc = L["Font of the cooldown"],
 | 
				
			||||||
                            order = 11,
 | 
					                            order = 3,
 | 
				
			||||||
                            dialogControl = "LSM30_Font",
 | 
					                            dialogControl = "LSM30_Font",
 | 
				
			||||||
                            values = AceGUIWidgetLSMlists.font,
 | 
					                            values = AceGUIWidgetLSMlists.font,
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
@@ -304,32 +524,41 @@ function Trinket:GetOptions()
 | 
				
			|||||||
                            type = "range",
 | 
					                            type = "range",
 | 
				
			||||||
                            name = L["Font scale"],
 | 
					                            name = L["Font scale"],
 | 
				
			||||||
                            desc = L["Scale of the font"],
 | 
					                            desc = L["Scale of the font"],
 | 
				
			||||||
                            order = 12,
 | 
					                            order = 4,
 | 
				
			||||||
                            min = 0.1,
 | 
					                            min = 0.1,
 | 
				
			||||||
                            max = 2,
 | 
					                            max = 2,
 | 
				
			||||||
                            step = 0.1,
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
                position = {
 | 
					                position = {
 | 
				
			||||||
                    type = "group",
 | 
					                    type = "group",
 | 
				
			||||||
                    name = L["Position"],
 | 
					                    name = L["Position"],
 | 
				
			||||||
                    order = 4,
 | 
					                    order = 5,
 | 
				
			||||||
                    args = {
 | 
					                    args = {
 | 
				
			||||||
                        header = {
 | 
					                        header = {
 | 
				
			||||||
                            type = "header",
 | 
					                            type = "header",
 | 
				
			||||||
                            name = L["Position"],
 | 
					                            name = L["Icon position"],
 | 
				
			||||||
                            order = 4,
 | 
					                            order = 4,
 | 
				
			||||||
                        },
 | 
					                        },
 | 
				
			||||||
                        trinketPos = Gladdy:option({
 | 
					                        trinketXOffset = Gladdy:option({
 | 
				
			||||||
                            type = "select",
 | 
					                            type = "range",
 | 
				
			||||||
                            name = L["Trinket position"],
 | 
					                            name = L["Horizontal offset"],
 | 
				
			||||||
                            desc = L["This changes positions of the trinket"],
 | 
					                            order = 23,
 | 
				
			||||||
                            order = 21,
 | 
					                            min = -800,
 | 
				
			||||||
                            values = {
 | 
					                            max = 800,
 | 
				
			||||||
                                ["LEFT"] = L["Left"],
 | 
					                            step = 0.1,
 | 
				
			||||||
                                ["RIGHT"] = L["Right"],
 | 
					                            width = "full",
 | 
				
			||||||
                            },
 | 
					                        }),
 | 
				
			||||||
 | 
					                        trinketYOffset = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Vertical offset"],
 | 
				
			||||||
 | 
					                            order = 24,
 | 
				
			||||||
 | 
					                            min = -800,
 | 
				
			||||||
 | 
					                            max = 800,
 | 
				
			||||||
 | 
					                            step = 0.1,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
@@ -358,7 +587,63 @@ function Trinket:GetOptions()
 | 
				
			|||||||
                        }),
 | 
					                        }),
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
 | 
					                frameStrata = {
 | 
				
			||||||
 | 
					                    type = "group",
 | 
				
			||||||
 | 
					                    name = L["Frame Strata and Level"],
 | 
				
			||||||
 | 
					                    order = 6,
 | 
				
			||||||
 | 
					                    args = {
 | 
				
			||||||
 | 
					                        headerAuraLevel = {
 | 
				
			||||||
 | 
					                            type = "header",
 | 
				
			||||||
 | 
					                            name = L["Frame Strata and Level"],
 | 
				
			||||||
 | 
					                            order = 1,
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        trinketFrameStrata = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "select",
 | 
				
			||||||
 | 
					                            name = L["Frame Strata"],
 | 
				
			||||||
 | 
					                            order = 2,
 | 
				
			||||||
 | 
					                            values = Gladdy.frameStrata,
 | 
				
			||||||
 | 
					                            sorting = Gladdy.frameStrataSorting,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                        trinketFrameLevel = Gladdy:option({
 | 
				
			||||||
 | 
					                            type = "range",
 | 
				
			||||||
 | 
					                            name = L["Frame Level"],
 | 
				
			||||||
 | 
					                            min = 0,
 | 
				
			||||||
 | 
					                            max = 500,
 | 
				
			||||||
 | 
					                            step = 1,
 | 
				
			||||||
 | 
					                            order = 3,
 | 
				
			||||||
 | 
					                            width = "full",
 | 
				
			||||||
 | 
					                        }),
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- LAGACY HANDLER
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Trinket:LegacySetPosition(trinket, unit)
 | 
				
			||||||
 | 
					    if Gladdy.db.newLayout then
 | 
				
			||||||
 | 
					        return Gladdy.db.newLayout
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    trinket:ClearAllPoints()
 | 
				
			||||||
 | 
					    local margin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) + Gladdy.db.padding
 | 
				
			||||||
 | 
					    if (Gladdy.db.classIconPos == "LEFT") then
 | 
				
			||||||
 | 
					        if (Gladdy.db.trinketPos == "RIGHT") then
 | 
				
			||||||
 | 
					            trinket:SetPoint("TOPLEFT", Gladdy.buttons[unit].healthBar, "TOPRIGHT", margin, 0)
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            trinket:SetPoint("TOPRIGHT", Gladdy.buttons[unit].classIcon, "TOPLEFT", -Gladdy.db.padding, 0)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        if (Gladdy.db.trinketPos == "RIGHT") then
 | 
				
			||||||
 | 
					            trinket:SetPoint("TOPLEFT", Gladdy.buttons[unit].classIcon, "TOPRIGHT", Gladdy.db.padding, 0)
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            trinket:SetPoint("TOPRIGHT", Gladdy.buttons[unit].healthBar, "TOPLEFT", -margin, 0)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
@@ -1,7 +1,11 @@
 | 
				
			|||||||
 | 
					local tonumber, tostring, str_format = tonumber, tostring, string.format
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local UnitName = UnitName
 | 
					local UnitName = UnitName
 | 
				
			||||||
 | 
					local IsInGroup, IsInRaid = IsInGroup, IsInRaid
 | 
				
			||||||
 | 
					local LE_PARTY_CATEGORY_HOME, LE_PARTY_CATEGORY_INSTANCE = LE_PARTY_CATEGORY_HOME, LE_PARTY_CATEGORY_INSTANCE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local Gladdy = LibStub("Gladdy")
 | 
					local Gladdy = LibStub("Gladdy")
 | 
				
			||||||
local L = Gladdy.L
 | 
					
 | 
				
			||||||
local VersionCheck = Gladdy:NewModule("VersionCheck", 1, {
 | 
					local VersionCheck = Gladdy:NewModule("VersionCheck", 1, {
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
LibStub("AceComm-3.0"):Embed(VersionCheck)
 | 
					LibStub("AceComm-3.0"):Embed(VersionCheck)
 | 
				
			||||||
@@ -19,24 +23,32 @@ end
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
function VersionCheck:JOINED_ARENA()
 | 
					function VersionCheck:JOINED_ARENA()
 | 
				
			||||||
    self:RegisterComm("GladdyVCheck", VersionCheck.OnCommReceived)
 | 
					    self:RegisterComm("GladdyVCheck", VersionCheck.OnCommReceived)
 | 
				
			||||||
 | 
					    if IsInRaid(LE_PARTY_CATEGORY_HOME) then
 | 
				
			||||||
 | 
					        self:SendCommMessage("GladdyVCheck", str_format("%.2f", Gladdy.version_num), "RAID", self.playerName)
 | 
				
			||||||
 | 
					    elseif IsInGroup(LE_PARTY_CATEGORY_INSTANCE) or IsInRaid(LE_PARTY_CATEGORY_INSTANCE) then
 | 
				
			||||||
 | 
					        self:SendCommMessage("GladdyVCheck", str_format("%.2f", Gladdy.version_num), "INSTANCE_CHAT", self.playerName)
 | 
				
			||||||
 | 
					    elseif IsInGroup(LE_PARTY_CATEGORY_HOME) then
 | 
				
			||||||
 | 
					        self:SendCommMessage("GladdyVCheck", str_format("%.2f", Gladdy.version_num), "PARTY", self.playerName)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function VersionCheck:Test(unit)
 | 
					function VersionCheck:Test(unit)
 | 
				
			||||||
    if unit == "arena1" then
 | 
					    if unit == "arena1" then
 | 
				
			||||||
        self:RegisterComm("GladdyVCheck", VersionCheck.OnCommReceived)
 | 
					        self:RegisterComm("GladdyVCheck", VersionCheck.OnCommReceived)
 | 
				
			||||||
        self:SendCommMessage("GladdyVCheck", Gladdy.version, "RAID", self.playerName)
 | 
					        self:SendCommMessage("GladdyVCheck", tostring(Gladdy.version_num), "RAID", self.playerName)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function VersionCheck.OnCommReceived(prefix, message, distribution, sender)
 | 
					function VersionCheck.OnCommReceived(prefix, message, distribution, sender)
 | 
				
			||||||
    if sender ~= VersionCheck.playerName then
 | 
					    if sender ~= VersionCheck.playerName then
 | 
				
			||||||
        local addonVersion = Gladdy.version
 | 
					        local addonVersion = str_format("%.2f", Gladdy.version_num)
 | 
				
			||||||
        if (message == addonVersion) then
 | 
					        local message_num = tonumber(message) or 0
 | 
				
			||||||
 | 
					        if message and message_num <= Gladdy.version_num then
 | 
				
			||||||
            --Gladdy:Print("Version", "\"".. addonVersion.."\"", "is up to date")
 | 
					            --Gladdy:Print("Version", "\"".. addonVersion.."\"", "is up to date")
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
            Gladdy:Warn("Current version", "\"".. addonVersion.."\"", "is outdated. Most recent version is", "\"".. message.."\"")
 | 
					            Gladdy:Warn("Current version", "\"".. addonVersion.."\"", "is outdated. Most recent version is", "\"".. message.."\"")
 | 
				
			||||||
            Gladdy:Warn("Please download the latest Gladdy version at:")
 | 
					            Gladdy:Warn("Please download the latest Gladdy version at:")
 | 
				
			||||||
            Gladdy:Warn("https://github.com/XiconQoo/Gladdy")
 | 
					            Gladdy:Warn("https://www.curseforge.com/wow/addons/gladdy-tbc or https://github.com/XiconQoo/Gladdy-TBC")
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,285 +4,172 @@ local L = Gladdy.L
 | 
				
			|||||||
local XiconProfiles = Gladdy:NewModule("XiconProfiles", nil, {
 | 
					local XiconProfiles = Gladdy:NewModule("XiconProfiles", nil, {
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function XiconProfiles:ApplyKlimp()
 | 
					local function applyProfile(profileString)
 | 
				
			||||||
    Gladdy.db.castBarXOffset = -7
 | 
					    local deserialized = Gladdy.modules["Export Import"]:Decode(profileString)
 | 
				
			||||||
    Gladdy.db.powerActual = false
 | 
					    if deserialized then
 | 
				
			||||||
    Gladdy.db.npCastbarsBorderSize = 4
 | 
					        Gladdy.modules["Export Import"]:ApplyImport(deserialized, Gladdy.db)
 | 
				
			||||||
    Gladdy.db.healthBarTexture = "Minimalist"
 | 
					    end
 | 
				
			||||||
    Gladdy.db.highlight = false
 | 
					    Gladdy:Reset()
 | 
				
			||||||
    Gladdy.db.healthMax = false
 | 
					    Gladdy:HideFrame()
 | 
				
			||||||
    Gladdy.db.castBarYOffset = -24
 | 
					    Gladdy:ToggleFrame(3)
 | 
				
			||||||
    Gladdy.db.castBarFont = "Friz Quadrata TT"
 | 
					    Gladdy.options.args.lock.name = Gladdy.db.locked and L["Unlock frame"] or L["Lock frame"]
 | 
				
			||||||
    Gladdy.db.drXOffset = -7
 | 
					    Gladdy.options.args.showMover.name = Gladdy.db.showMover and L["Hide Mover"] or L["Show Mover"]
 | 
				
			||||||
    Gladdy.db.classIconBorderColor.a = 0.6200000047683716
 | 
					    LibStub("AceConfigRegistry-3.0"):NotifyChange("Gladdy")
 | 
				
			||||||
    Gladdy.db.auraBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_squared_blp"
 | 
					 | 
				
			||||||
    Gladdy.db.powerBarHeight = 7
 | 
					 | 
				
			||||||
    Gladdy.db.powerBarFontSize = 8
 | 
					 | 
				
			||||||
    Gladdy.db.announcements.dest = "party"
 | 
					 | 
				
			||||||
    Gladdy.db.powerMax = false
 | 
					 | 
				
			||||||
    Gladdy.db.healthBarFontSize = 17
 | 
					 | 
				
			||||||
    Gladdy.db.healthBarBorderSize = 5
 | 
					 | 
				
			||||||
    Gladdy.db.npCastbarsWidth = 85
 | 
					 | 
				
			||||||
    Gladdy.db.npCastbarsTexture = "Minimalist"
 | 
					 | 
				
			||||||
    Gladdy.db.cooldown = false
 | 
					 | 
				
			||||||
    Gladdy.db.barWidth = 190
 | 
					 | 
				
			||||||
    Gladdy.db.healthBarBgColor.a = 0.6700000166893005
 | 
					 | 
				
			||||||
    Gladdy.db.drCooldownPos = "LEFT"
 | 
					 | 
				
			||||||
    Gladdy.db.npCastbarsFont = "Friz Quadrata TT"
 | 
					 | 
				
			||||||
    Gladdy.db.trinketSize = 40
 | 
					 | 
				
			||||||
    Gladdy.db.y = 501.7654729182068
 | 
					 | 
				
			||||||
    Gladdy.db.x = 1048.626941536808
 | 
					 | 
				
			||||||
    Gladdy.db.bottomMargin = 2
 | 
					 | 
				
			||||||
    Gladdy.db.npCastbarsIconSize = 14
 | 
					 | 
				
			||||||
    Gladdy.db.castBarTexture = "Minimalist"
 | 
					 | 
				
			||||||
    Gladdy.db.drFont = "Friz Quadrata TT"
 | 
					 | 
				
			||||||
    Gladdy.db.highlightBorderSize = 1
 | 
					 | 
				
			||||||
    Gladdy.db.healthBarFont = "Friz Quadrata TT"
 | 
					 | 
				
			||||||
    Gladdy.db.padding = 0
 | 
					 | 
				
			||||||
    Gladdy.db.castBarBorderSize = 5
 | 
					 | 
				
			||||||
    Gladdy.db.powerBarFontColor.a = 0
 | 
					 | 
				
			||||||
    Gladdy.db.classIconSize = 40
 | 
					 | 
				
			||||||
    Gladdy.db.npCastbarsHeight = 14
 | 
					 | 
				
			||||||
    Gladdy.db.castBarIconColor.a = 0.6200000047683716
 | 
					 | 
				
			||||||
    Gladdy.db.trinketFontScale = 1.3
 | 
					 | 
				
			||||||
    Gladdy.db.trinketBorderColor.a = 0.6200000047683716
 | 
					 | 
				
			||||||
    Gladdy.db.leaderBorder = false
 | 
					 | 
				
			||||||
    Gladdy.db.powerPercentage = true
 | 
					 | 
				
			||||||
    Gladdy.db.drYOffset = 33
 | 
					 | 
				
			||||||
    Gladdy.db.healthBarHeight = 40
 | 
					 | 
				
			||||||
    Gladdy.db.powerBarTexture = "Minimalist"
 | 
					 | 
				
			||||||
    Gladdy.db.cooldownFont = "Friz Quadrata TT"
 | 
					 | 
				
			||||||
    Gladdy.db.powerBarFont = "Friz Quadrata TT"
 | 
					 | 
				
			||||||
    Gladdy.db.auraFont = "Friz Quadrata TT"
 | 
					 | 
				
			||||||
    Gladdy.db.powerBarBorderSize = 3
 | 
					 | 
				
			||||||
    Gladdy.db.trinketFont = "Friz Quadrata TT"
 | 
					 | 
				
			||||||
    Gladdy.db.castBarIconSize = 20
 | 
					 | 
				
			||||||
    Gladdy.db.cooldownYOffset = 15.10000000000002
 | 
					 | 
				
			||||||
    Gladdy.db.cooldownXOffset = 5
 | 
					 | 
				
			||||||
    Gladdy.db.cooldownMaxIconsPerLine = 4
 | 
					 | 
				
			||||||
    Gladdy.db.cooldownBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_squared_blp"
 | 
					 | 
				
			||||||
    Gladdy.db.cooldownYPos = "RIGHT"
 | 
					 | 
				
			||||||
    Gladdy.db.cooldownCooldownAlpha = 0.6000000000000001
 | 
					 | 
				
			||||||
    Gladdy.db.cooldownSize = 25.25495910644531
 | 
					 | 
				
			||||||
    Gladdy.db.cooldownFontScale = 0.6
 | 
					 | 
				
			||||||
    Gladdy.db.cooldownBorderColor = {
 | 
					 | 
				
			||||||
        b = 0.3019607843137255,
 | 
					 | 
				
			||||||
        g = 0.3019607843137255,
 | 
					 | 
				
			||||||
        r = 0.3019607843137255,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    Gladdy.db.locked = true
 | 
					 | 
				
			||||||
    Gladdy.db.classIconWidthFactor = 1
 | 
					 | 
				
			||||||
    Gladdy.db.buffsFontScale = 0.8
 | 
					 | 
				
			||||||
    Gladdy.db.buffsIconSize = 24
 | 
					 | 
				
			||||||
    Gladdy.db.buffsCooldownAlpha = 0.8
 | 
					 | 
				
			||||||
    Gladdy.db.trinketWidthFactor = 1
 | 
					 | 
				
			||||||
    Gladdy.db.frameScale = 1
 | 
					 | 
				
			||||||
    Gladdy.db.drWidthFactor = 1.3
 | 
					 | 
				
			||||||
    Gladdy:UpdateFrame()
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
function XiconProfiles:ApplyKnall()
 | 
					 | 
				
			||||||
    Gladdy.db["cooldownCooldownAlpha"] = 0.6000000000000001
 | 
					 | 
				
			||||||
    Gladdy.db["buffsIconPadding"] = 1.5
 | 
					 | 
				
			||||||
    Gladdy.db["powerBarBorderSize"] = 5.5
 | 
					 | 
				
			||||||
    Gladdy.db["trinketSize"] = 66
 | 
					 | 
				
			||||||
    Gladdy.db["cooldownFontScale"] = 0.8
 | 
					 | 
				
			||||||
    Gladdy.db["healthBarHeight"] = 54
 | 
					 | 
				
			||||||
    Gladdy.db["drYOffset"] = -14
 | 
					 | 
				
			||||||
    Gladdy.db["classIconSize"] = 70
 | 
					 | 
				
			||||||
    Gladdy.db["padding"] = 0
 | 
					 | 
				
			||||||
    Gladdy.db["buffsFontScale"] = 0.8
 | 
					 | 
				
			||||||
    Gladdy.db["healthBarFontColor"]["a"] = 0
 | 
					 | 
				
			||||||
    Gladdy.db["buffsCooldownGrowDirection"] = "LEFT"
 | 
					 | 
				
			||||||
    Gladdy.db["cooldownXOffset"] = 1
 | 
					 | 
				
			||||||
    Gladdy.db["castBarIconSize"] = 26
 | 
					 | 
				
			||||||
    Gladdy.db["bottomMargin"] = -35
 | 
					 | 
				
			||||||
    Gladdy.db["y"] = 457.111085058903
 | 
					 | 
				
			||||||
    Gladdy.db["x"] = 993.110763706718
 | 
					 | 
				
			||||||
    Gladdy.db["locked"] = true
 | 
					 | 
				
			||||||
    Gladdy.db["drCooldownPos"] = "LEFT"
 | 
					 | 
				
			||||||
    Gladdy.db["castBarWidth"] = 162
 | 
					 | 
				
			||||||
    Gladdy.db["healthBarBorderSize"] = 8.5
 | 
					 | 
				
			||||||
    Gladdy.db["buffsYOffset"] = -47
 | 
					 | 
				
			||||||
    Gladdy.db["frameScale"] = 0.9
 | 
					 | 
				
			||||||
    Gladdy.db["announcements"]["dest"] = "fct"
 | 
					 | 
				
			||||||
    Gladdy.db["powerBarFontSize"] = 8.576186180114746
 | 
					 | 
				
			||||||
    Gladdy.db["powerBarHeight"] = 11
 | 
					 | 
				
			||||||
    Gladdy.db["drIconPadding"] = 2
 | 
					 | 
				
			||||||
    Gladdy.db["buffsXOffset"] = -245.7
 | 
					 | 
				
			||||||
    Gladdy.db["castBarYOffset"] = -13.59999999999997
 | 
					 | 
				
			||||||
    Gladdy.db["drFontScale"] = 0.8
 | 
					 | 
				
			||||||
    Gladdy.db["castBarHeight"] = 26
 | 
					 | 
				
			||||||
    Gladdy.db["castBarHeight"] = 26
 | 
					 | 
				
			||||||
    Gladdy.db["buffsCooldownAlpha"] = 0.8
 | 
					 | 
				
			||||||
    Gladdy.db["drCooldownAlpha"] = 0.7000000000000001
 | 
					 | 
				
			||||||
    Gladdy.db["buffsIconSize"] = 35
 | 
					 | 
				
			||||||
    Gladdy:UpdateFrame()
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
function XiconProfiles:ApplyClassic()
 | 
					 | 
				
			||||||
    Gladdy.db["buffsIconSize"] = 29
 | 
					 | 
				
			||||||
    Gladdy.db["drCooldownAlpha"] = 0.8
 | 
					 | 
				
			||||||
    Gladdy.db["castBarBgColor"] = {
 | 
					 | 
				
			||||||
        ["a"] = 0.4000000357627869,
 | 
					 | 
				
			||||||
        ["b"] = 0.7372549019607844,
 | 
					 | 
				
			||||||
        ["g"] = 0.7372549019607844,
 | 
					 | 
				
			||||||
        ["r"] = 0.7372549019607844,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    Gladdy.db["npCastbarsBorderSize"] = 4
 | 
					 | 
				
			||||||
    Gladdy.db["healthBarTexture"] = "Minimalist"
 | 
					 | 
				
			||||||
    Gladdy.db["drFontScale"] = 0.9
 | 
					 | 
				
			||||||
    Gladdy.db["highlight"] = false
 | 
					 | 
				
			||||||
    Gladdy.db["buffsCooldownPos"] = "LEFT"
 | 
					 | 
				
			||||||
    Gladdy.db["castBarYOffset"] = -67
 | 
					 | 
				
			||||||
    Gladdy.db["castBarFont"] = "Friz Quadrata TT"
 | 
					 | 
				
			||||||
    Gladdy.db["buffsXOffset"] = -1
 | 
					 | 
				
			||||||
    Gladdy.db["drXOffset"] = -1
 | 
					 | 
				
			||||||
    Gladdy.db["classIconBorderColor"]["a"] = 0
 | 
					 | 
				
			||||||
    Gladdy.db["cooldownYOffset"] = 10
 | 
					 | 
				
			||||||
    Gladdy.db["auraBorderStyle"] = "Interface\\AddOns\\Gladdy\\Images\\Border_squared_blp"
 | 
					 | 
				
			||||||
    Gladdy.db["powerBarHeight"] = 16
 | 
					 | 
				
			||||||
    Gladdy.db["powerBarFontSize"] = 10.21056747436523
 | 
					 | 
				
			||||||
    Gladdy.db["announcements"]["dest"] = "party"
 | 
					 | 
				
			||||||
    Gladdy.db["healthBarFontSize"] = 13.42293167114258
 | 
					 | 
				
			||||||
    Gladdy.db["buffsYOffset"] = -2.099999999999966
 | 
					 | 
				
			||||||
    Gladdy.db["healthBarBorderSize"] = 4
 | 
					 | 
				
			||||||
    Gladdy.db["healthBarBorderStyle"] = "Gladdy Tooltip squared"
 | 
					 | 
				
			||||||
    Gladdy.db["barWidth"] = 190
 | 
					 | 
				
			||||||
    Gladdy.db["castBarWidth"] = 265
 | 
					 | 
				
			||||||
    Gladdy.db["cooldownMaxIconsPerLine"] = 4
 | 
					 | 
				
			||||||
    Gladdy.db["drCooldownPos"] = "LEFT"
 | 
					 | 
				
			||||||
    Gladdy.db["locked"] = true
 | 
					 | 
				
			||||||
    Gladdy.db["npCastbarsFont"] = "Friz Quadrata TT"
 | 
					 | 
				
			||||||
    Gladdy.db["cooldownFontScale"] = 0.6
 | 
					 | 
				
			||||||
    Gladdy.db["auraFont"] = "Friz Quadrata TT"
 | 
					 | 
				
			||||||
    Gladdy.db["y"] = 511.0100769632991
 | 
					 | 
				
			||||||
    Gladdy.db["x"] = 912.8048284050892
 | 
					 | 
				
			||||||
    Gladdy.db["bottomMargin"] = 20
 | 
					 | 
				
			||||||
    Gladdy.db["trinketFont"] = "Friz Quadrata TT"
 | 
					 | 
				
			||||||
    Gladdy.db["npCastbarsIconSize"] = 14
 | 
					 | 
				
			||||||
    Gladdy.db["trinketFontScale"] = 1.3
 | 
					 | 
				
			||||||
    Gladdy.db["cooldownBorderStyle"] = "Interface\\AddOns\\Gladdy\\Images\\Border_squared_blp"
 | 
					 | 
				
			||||||
    Gladdy.db["castBarTexture"] = "Minimalist"
 | 
					 | 
				
			||||||
    Gladdy.db["classIconWidthFactor"] = 1
 | 
					 | 
				
			||||||
    Gladdy.db["cooldownYPos"] = "RIGHT"
 | 
					 | 
				
			||||||
    Gladdy.db["castBarIconSize"] = 20
 | 
					 | 
				
			||||||
    Gladdy.db["drFont"] = "Friz Quadrata TT"
 | 
					 | 
				
			||||||
    Gladdy.db["buffsCooldownAlpha"] = 0.8
 | 
					 | 
				
			||||||
    Gladdy.db["cooldownXOffset"] = 1
 | 
					 | 
				
			||||||
    Gladdy.db["buffsCooldownGrowDirection"] = "LEFT"
 | 
					 | 
				
			||||||
    Gladdy.db["highlightBorderSize"] = 1
 | 
					 | 
				
			||||||
    Gladdy.db["drIconSize"] = 34
 | 
					 | 
				
			||||||
    Gladdy.db["powerBarBgColor"] = {
 | 
					 | 
				
			||||||
        ["a"] = 0.3500000238418579,
 | 
					 | 
				
			||||||
        ["r"] = 0.8,
 | 
					 | 
				
			||||||
        ["g"] = 0.8,
 | 
					 | 
				
			||||||
        ["b"] = 0.8,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    Gladdy.db["castBarXOffset"] = 287
 | 
					 | 
				
			||||||
    Gladdy.db["healthBarFont"] = "Friz Quadrata TT"
 | 
					 | 
				
			||||||
    Gladdy.db["buffsFontScale"] = 0.8
 | 
					 | 
				
			||||||
    Gladdy.db["castBarIconStyle"] = "Interface\\AddOns\\Gladdy\\Images\\Border_squared_blp"
 | 
					 | 
				
			||||||
    Gladdy.db["padding"] = 0
 | 
					 | 
				
			||||||
    Gladdy.db["powerBarBorderStyle"] = "Gladdy Tooltip squared"
 | 
					 | 
				
			||||||
    Gladdy.db["castBarBorderSize"] = 4
 | 
					 | 
				
			||||||
    Gladdy.db["classIconSize"] = 48
 | 
					 | 
				
			||||||
    Gladdy.db["castBarColor"]["g"] = 0.8274509803921568
 | 
					 | 
				
			||||||
    Gladdy.db["castBarColor"]["b"] = 0
 | 
					 | 
				
			||||||
    Gladdy.db["castBarIconColor"]["a"] = 0.6200000047683716
 | 
					 | 
				
			||||||
    Gladdy.db["leaderBorder"] = false
 | 
					 | 
				
			||||||
    Gladdy.db["castBarBorderStyle"] = "Gladdy Tooltip squared"
 | 
					 | 
				
			||||||
    Gladdy.db["drYOffset"] = -3
 | 
					 | 
				
			||||||
    Gladdy.db["cooldownCooldownAlpha"] = 0.6000000000000001
 | 
					 | 
				
			||||||
    Gladdy.db["healthBarHeight"] = 30
 | 
					 | 
				
			||||||
    Gladdy.db["healthBarBgColor"] = {
 | 
					 | 
				
			||||||
        ["a"] = 0.3600000143051148,
 | 
					 | 
				
			||||||
        ["r"] = 0.7294117647058823,
 | 
					 | 
				
			||||||
        ["g"] = 0.7294117647058823,
 | 
					 | 
				
			||||||
        ["b"] = 0.7294117647058823,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    Gladdy.db["powerBarTexture"] = "Minimalist"
 | 
					 | 
				
			||||||
    Gladdy.db["healthBarBorderColor"] = {
 | 
					 | 
				
			||||||
        ["r"] = 0.4313725490196079,
 | 
					 | 
				
			||||||
        ["g"] = 0.4313725490196079,
 | 
					 | 
				
			||||||
        ["b"] = 0.4313725490196079,
 | 
					 | 
				
			||||||
        ["a"] = 1,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    Gladdy.db["powerBarFont"] = "Friz Quadrata TT"
 | 
					 | 
				
			||||||
    Gladdy.db["cooldownFont"] = "Friz Quadrata TT"
 | 
					 | 
				
			||||||
    Gladdy.db["cooldownBorderColor"] = {
 | 
					 | 
				
			||||||
        ["r"] = 0.3019607843137255,
 | 
					 | 
				
			||||||
        ["g"] = 0.3019607843137255,
 | 
					 | 
				
			||||||
        ["b"] = 0.3019607843137255,
 | 
					 | 
				
			||||||
        ["a"] = 1,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    Gladdy.db["trinketWidthFactor"] = 1
 | 
					 | 
				
			||||||
    Gladdy.db["powerBarBorderSize"] = 4
 | 
					 | 
				
			||||||
    Gladdy.db["trinketSize"] = 47
 | 
					 | 
				
			||||||
    Gladdy.db["cooldownSize"] = 25.25495910644531
 | 
					 | 
				
			||||||
    Gladdy.db["trinketBorderColor"]["a"] = 0
 | 
					 | 
				
			||||||
    Gladdy.db["npCastbarsTexture"] = "Minimalist"
 | 
					 | 
				
			||||||
    Gladdy:UpdateFrame()
 | 
					 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function XiconProfiles:GetOptions()
 | 
					function XiconProfiles:GetOptions()
 | 
				
			||||||
    return {
 | 
					    return {
 | 
				
			||||||
 | 
					        headerProfileBlizzard = {
 | 
				
			||||||
 | 
					            type = "header",
 | 
				
			||||||
 | 
					            name = "Blizzard " .. L["Profile"],
 | 
				
			||||||
 | 
					            order = 2,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        blizzardProfile = {
 | 
				
			||||||
 | 
					            type = "execute",
 | 
				
			||||||
 | 
					            func = function()
 | 
				
			||||||
 | 
					                Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
 | 
				
			||||||
 | 
					                applyProfile(Gladdy:GetBlizzardProfile())
 | 
				
			||||||
 | 
					            end,
 | 
				
			||||||
 | 
					            name = " ",
 | 
				
			||||||
 | 
					            desc = "Blizzard " .. L["Profile"],
 | 
				
			||||||
 | 
					            image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Blizz1.blp",
 | 
				
			||||||
 | 
					            imageWidth = 350,
 | 
				
			||||||
 | 
					            imageHeight = 175,
 | 
				
			||||||
 | 
					            width = "full",
 | 
				
			||||||
 | 
					            order = 3,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
        headerProfileClassic = {
 | 
					        headerProfileClassic = {
 | 
				
			||||||
            type = "header",
 | 
					            type = "header",
 | 
				
			||||||
            name = L["Classic Profile"],
 | 
					            name = "Classic " .. L["Profile"],
 | 
				
			||||||
            order = 2,
 | 
					            order = 4,
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        classicProfile = {
 | 
					        classicProfile = {
 | 
				
			||||||
            type = "execute",
 | 
					            type = "execute",
 | 
				
			||||||
            func = function()
 | 
					            func = function()
 | 
				
			||||||
                Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
 | 
					                Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
 | 
				
			||||||
                XiconProfiles:ApplyClassic()
 | 
					                applyProfile(Gladdy:GetClassicProfile())
 | 
				
			||||||
            end,
 | 
					            end,
 | 
				
			||||||
            name = " ",
 | 
					            name = " ",
 | 
				
			||||||
            desc = "Classic Profile",
 | 
					            desc = "Classic " .. L["Profile"],
 | 
				
			||||||
            image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Classic1.blp",
 | 
					            image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Classic1.blp",
 | 
				
			||||||
            imageWidth = 256,
 | 
					            imageWidth = 350,
 | 
				
			||||||
            imageHeight = 128,
 | 
					            imageHeight = 175,
 | 
				
			||||||
            width = "full",
 | 
					            width = "full",
 | 
				
			||||||
            order = 3,
 | 
					            order = 5,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        headerProfileClassicNoPet = {
 | 
				
			||||||
 | 
					            type = "header",
 | 
				
			||||||
 | 
					            name = "Classic " .. L["Profile"] .. L[" No Pet"],
 | 
				
			||||||
 | 
					            order = 6,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        classicProfileNoPet = {
 | 
				
			||||||
 | 
					            type = "execute",
 | 
				
			||||||
 | 
					            func = function()
 | 
				
			||||||
 | 
					                Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
 | 
				
			||||||
 | 
					                applyProfile(Gladdy:GetClassicProfileNoPet())
 | 
				
			||||||
 | 
					            end,
 | 
				
			||||||
 | 
					            name = " ",
 | 
				
			||||||
 | 
					            desc = "Classic " .. L["Profile"] .. L[" No Pet"],
 | 
				
			||||||
 | 
					            image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Classic2.blp",
 | 
				
			||||||
 | 
					            imageWidth = 350,
 | 
				
			||||||
 | 
					            imageHeight = 175,
 | 
				
			||||||
 | 
					            width = "full",
 | 
				
			||||||
 | 
					            order = 7,
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        headerProfileKnall = {
 | 
					        headerProfileKnall = {
 | 
				
			||||||
            type = "header",
 | 
					            type = "header",
 | 
				
			||||||
            name = L["Knall's Profile"],
 | 
					            name = "Knall's " .. L["Profile"],
 | 
				
			||||||
            order = 4,
 | 
					            order = 8,
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        knallProfile = {
 | 
					        knallProfile = {
 | 
				
			||||||
            type = "execute",
 | 
					            type = "execute",
 | 
				
			||||||
            func = function()
 | 
					            func = function()
 | 
				
			||||||
                Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
 | 
					                Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
 | 
				
			||||||
                XiconProfiles:ApplyKnall()
 | 
					                applyProfile(Gladdy:GetKnallProfile())
 | 
				
			||||||
            end,
 | 
					            end,
 | 
				
			||||||
            name = " ",
 | 
					            name = " ",
 | 
				
			||||||
            desc = "Knall's Profile",
 | 
					            desc = "Knall's " .. L["Profile"],
 | 
				
			||||||
            image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Knall1.blp",
 | 
					            image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Knall1.blp",
 | 
				
			||||||
            imageWidth = 256,
 | 
					            imageWidth = 350,
 | 
				
			||||||
            imageHeight = 128,
 | 
					            imageHeight = 175,
 | 
				
			||||||
            width = "full",
 | 
					            width = "full",
 | 
				
			||||||
            order = 5,
 | 
					            order = 9,
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        headerProfileKlimp = {
 | 
					        headerProfileKlimp = {
 | 
				
			||||||
            type = "header",
 | 
					            type = "header",
 | 
				
			||||||
            name = L["Klimp's Profile"],
 | 
					            name = "Klimp's " .. L["Profile"],
 | 
				
			||||||
            order = 6,
 | 
					            order = 10,
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        klimpProfiles = {
 | 
					        klimpProfiles = {
 | 
				
			||||||
            type = "execute",
 | 
					            type = "execute",
 | 
				
			||||||
            func = function()
 | 
					            func = function()
 | 
				
			||||||
                Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
 | 
					                Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
 | 
				
			||||||
                XiconProfiles:ApplyKlimp()
 | 
					                applyProfile(Gladdy:GetKlimpProfile())
 | 
				
			||||||
            end,
 | 
					            end,
 | 
				
			||||||
            image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Klimp1.blp",
 | 
					            image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Klimp1.blp",
 | 
				
			||||||
            imageWidth = 256,
 | 
					            imageWidth = 350,
 | 
				
			||||||
            imageHeight = 128,
 | 
					            imageHeight = 175,
 | 
				
			||||||
            name = " ",
 | 
					            name = " ",
 | 
				
			||||||
            desc = "Klimp's Profile",
 | 
					            desc = "Klimp's " .. L["Profile"],
 | 
				
			||||||
            width = "full",
 | 
					            width = "full",
 | 
				
			||||||
            order = 7,
 | 
					            order = 11,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        headerProfileRukk = {
 | 
				
			||||||
 | 
					            type = "header",
 | 
				
			||||||
 | 
					            name = "Rukk1's " .. L["Profile"],
 | 
				
			||||||
 | 
					            order = 12,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        rukkProfile = {
 | 
				
			||||||
 | 
					            type = "execute",
 | 
				
			||||||
 | 
					            func = function()
 | 
				
			||||||
 | 
					                Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
 | 
				
			||||||
 | 
					                applyProfile(Gladdy:GetRukkProfile())
 | 
				
			||||||
 | 
					            end,
 | 
				
			||||||
 | 
					            name = " ",
 | 
				
			||||||
 | 
					            desc = "Rukk1's " .. L["Profile"],
 | 
				
			||||||
 | 
					            image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Rukk1.blp",
 | 
				
			||||||
 | 
					            imageWidth = 350,
 | 
				
			||||||
 | 
					            imageHeight = 175,
 | 
				
			||||||
 | 
					            width = "full",
 | 
				
			||||||
 | 
					            order = 13,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        headerProfileMir = {
 | 
				
			||||||
 | 
					            type = "header",
 | 
				
			||||||
 | 
					            name = "Mir's " .. L["Profile"],
 | 
				
			||||||
 | 
					            order = 14,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        mirProfile = {
 | 
				
			||||||
 | 
					            type = "execute",
 | 
				
			||||||
 | 
					            func = function()
 | 
				
			||||||
 | 
					                Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
 | 
				
			||||||
 | 
					                applyProfile(Gladdy:GetMirProfile())
 | 
				
			||||||
 | 
					            end,
 | 
				
			||||||
 | 
					            name = " ",
 | 
				
			||||||
 | 
					            desc = "Mir's " .. L["Profile"],
 | 
				
			||||||
 | 
					            image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Mir1.blp",
 | 
				
			||||||
 | 
					            imageWidth = 350,
 | 
				
			||||||
 | 
					            imageHeight = 175,
 | 
				
			||||||
 | 
					            width = "full",
 | 
				
			||||||
 | 
					            order = 15,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        headerProfileMirEdited = {
 | 
				
			||||||
 | 
					            type = "header",
 | 
				
			||||||
 | 
					            name = "Mir's " .. L["Profile"] .. " edited",
 | 
				
			||||||
 | 
					            order = 16,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        mirProfileEdited = {
 | 
				
			||||||
 | 
					            type = "execute",
 | 
				
			||||||
 | 
					            func = function()
 | 
				
			||||||
 | 
					                Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
 | 
				
			||||||
 | 
					                applyProfile(Gladdy:GetMirEditedProfile())
 | 
				
			||||||
 | 
					            end,
 | 
				
			||||||
 | 
					            name = " ",
 | 
				
			||||||
 | 
					            desc = "Mir's " .. L["Profile"],
 | 
				
			||||||
 | 
					            image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Mir1_edited.blp",
 | 
				
			||||||
 | 
					            imageWidth = 350,
 | 
				
			||||||
 | 
					            imageHeight = 175,
 | 
				
			||||||
 | 
					            width = "full",
 | 
				
			||||||
 | 
					            order = 17,
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
							
								
								
									
										440
									
								
								Options.lua
									
									
									
									
									
								
							
							
						
						
									
										440
									
								
								Options.lua
									
									
									
									
									
								
							@@ -1,39 +1,74 @@
 | 
				
			|||||||
local type, pairs, tinsert, tsort = type, pairs, table.insert, table.sort
 | 
					local type, pairs, tinsert, tsort = type, pairs, table.insert, table.sort
 | 
				
			||||||
 | 
					local tostring, str_match, tonumber, str_format = tostring, string.match, tonumber, string.format
 | 
				
			||||||
 | 
					local ceil, floor = ceil, floor
 | 
				
			||||||
 | 
					local ReloadUI = ReloadUI
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local InterfaceOptionsFrame_OpenToFrame = InterfaceOptionsFrame_OpenToFrame
 | 
					 | 
				
			||||||
local GetSpellInfo = GetSpellInfo
 | 
					local GetSpellInfo = GetSpellInfo
 | 
				
			||||||
local LOCALIZED_CLASS_NAMES_MALE = LOCALIZED_CLASS_NAMES_MALE
 | 
					local LOCALIZED_CLASS_NAMES_MALE = LOCALIZED_CLASS_NAMES_MALE
 | 
				
			||||||
local CLASS_ICON_TCOORDS = CLASS_ICON_TCOORDS
 | 
					local CLASS_ICON_TCOORDS = CLASS_ICON_TCOORDS
 | 
				
			||||||
 | 
					local AURA_TYPE_DEBUFF, AURA_TYPE_BUFF = AURA_TYPE_DEBUFF, AURA_TYPE_BUFF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local Gladdy = LibStub("Gladdy")
 | 
					local Gladdy = LibStub("Gladdy")
 | 
				
			||||||
local LibClassAuras = LibStub("LibClassAuras-1.0")
 | 
					local LibClassAuras = LibStub("LibClassAuras-1.0")
 | 
				
			||||||
local L = Gladdy.L
 | 
					local L = Gladdy.L
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Gladdy.TIMER_FORMAT = { tenths = "tenths", seconds = "seconds",
 | 
				
			||||||
 | 
					                       values = {
 | 
				
			||||||
 | 
					                           ["tenths"] = "xx:xx Miliseconds",
 | 
				
			||||||
 | 
					                           ["seconds"] = "xx Seconds"
 | 
				
			||||||
 | 
					                       }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Gladdy:FormatTimer(fontString, timeLeft, milibreakpoint, showSeconds)
 | 
				
			||||||
 | 
					    if timeLeft < 0 then
 | 
				
			||||||
 | 
					        fontString:SetText("")
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    local time = timeLeft >= 0.0 and timeLeft or 0.0
 | 
				
			||||||
 | 
					    if Gladdy.db.timerFormat == Gladdy.TIMER_FORMAT.tenths and milibreakpoint then
 | 
				
			||||||
 | 
					        fontString:SetFormattedText("%.1f", time)
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        if time >= 60 then
 | 
				
			||||||
 | 
					            if showSeconds then
 | 
				
			||||||
 | 
					                fontString:SetText(floor(timeLeft / 60) .. ":" .. str_format("%02.f", floor(timeLeft - floor(timeLeft / 60) * 60)))
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					                fontString:SetText(ceil(ceil(time / 60)) .. "m")
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            fontString:SetFormattedText("%d", ceil(time))
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Gladdy.defaults = {
 | 
					Gladdy.defaults = {
 | 
				
			||||||
    profile = {
 | 
					    profile = {
 | 
				
			||||||
        locked = false,
 | 
					        locked = false,
 | 
				
			||||||
 | 
					        hideBlizzard = "arena",
 | 
				
			||||||
        x = 0,
 | 
					        x = 0,
 | 
				
			||||||
        y = 0,
 | 
					        y = 0,
 | 
				
			||||||
        growUp = false,
 | 
					        growDirection = "BOTTOM",
 | 
				
			||||||
 | 
					        growMiddle = false,
 | 
				
			||||||
        frameScale = 1,
 | 
					        frameScale = 1,
 | 
				
			||||||
        padding = 3,
 | 
					        pixelPerfect = false,
 | 
				
			||||||
        barWidth = 180,
 | 
					        barWidth = 180,
 | 
				
			||||||
        bottomMargin = 10,
 | 
					        bottomMargin = 2,
 | 
				
			||||||
        statusbarBorderOffset = 7,
 | 
					        statusbarBorderOffset = 6,
 | 
				
			||||||
 | 
					        timerFormat = Gladdy.TIMER_FORMAT.tenths,
 | 
				
			||||||
 | 
					        backgroundColor = {r = 0, g = 0, b = 0, a = 0},
 | 
				
			||||||
 | 
					        newLayout = false,
 | 
				
			||||||
 | 
					        showMover = true,
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SLASH_GLADDY1 = "/gladdy"
 | 
					SLASH_GLADDY1 = "/gladdy"
 | 
				
			||||||
SlashCmdList["GLADDY"] = function(msg)
 | 
					SlashCmdList["GLADDY"] = function(msg)
 | 
				
			||||||
    if (msg == "test2") then
 | 
					    if (str_match(msg, "test[1-5]")) then
 | 
				
			||||||
        Gladdy:ToggleFrame(2)
 | 
					        local _, num = str_match(msg, "(test)([1-5])")
 | 
				
			||||||
    elseif (msg == "test5") then
 | 
					        Gladdy:ToggleFrame(tonumber(num))
 | 
				
			||||||
        Gladdy:ToggleFrame(5)
 | 
					    elseif (msg == "test") then
 | 
				
			||||||
    elseif (msg:find("test")) then
 | 
					 | 
				
			||||||
        Gladdy:ToggleFrame(3)
 | 
					        Gladdy:ToggleFrame(3)
 | 
				
			||||||
    elseif (msg == "ui" or msg == "options" or msg == "config") then
 | 
					    elseif (msg == "ui" or msg == "options" or msg == "config") then
 | 
				
			||||||
        LibStub("AceConfigDialog-3.0"):Open("Gladdy")
 | 
					        LibStub("AceConfigDialog-3.0"):Open("Gladdy")
 | 
				
			||||||
        --Gladdy:ShowOptions()
 | 
					 | 
				
			||||||
    elseif (msg == "reset") then
 | 
					    elseif (msg == "reset") then
 | 
				
			||||||
        Gladdy.dbi:ResetProfile()
 | 
					        Gladdy.dbi:ResetProfile()
 | 
				
			||||||
    elseif (msg == "hide") then
 | 
					    elseif (msg == "hide") then
 | 
				
			||||||
@@ -42,7 +77,8 @@ SlashCmdList["GLADDY"] = function(msg)
 | 
				
			|||||||
    else
 | 
					    else
 | 
				
			||||||
        Gladdy:Print(L["Valid slash commands are:"])
 | 
					        Gladdy:Print(L["Valid slash commands are:"])
 | 
				
			||||||
        Gladdy:Print("/gladdy ui")
 | 
					        Gladdy:Print("/gladdy ui")
 | 
				
			||||||
        Gladdy:Print("/gladdy test2-5")
 | 
					        Gladdy:Print("/gladdy test")
 | 
				
			||||||
 | 
					        Gladdy:Print("/gladdy test1-5")
 | 
				
			||||||
        Gladdy:Print("/gladdy hide")
 | 
					        Gladdy:Print("/gladdy hide")
 | 
				
			||||||
        Gladdy:Print("/gladdy reset")
 | 
					        Gladdy:Print("/gladdy reset")
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
@@ -68,6 +104,13 @@ function Gladdy:option(params)
 | 
				
			|||||||
    return defaults
 | 
					    return defaults
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Gladdy:SetColor(option, factor, altAlpha)
 | 
				
			||||||
 | 
					    if not factor then
 | 
				
			||||||
 | 
					        factor = 1
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    return option.r / factor, option.g / factor, option.b / factor, altAlpha or option.a
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Gladdy:colorOption(params)
 | 
					function Gladdy:colorOption(params)
 | 
				
			||||||
    local defaults = {
 | 
					    local defaults = {
 | 
				
			||||||
        get = function(info)
 | 
					        get = function(info)
 | 
				
			||||||
@@ -96,6 +139,11 @@ local function setOpt(info, value)
 | 
				
			|||||||
    local key = info.arg or info[#info]
 | 
					    local key = info.arg or info[#info]
 | 
				
			||||||
    Gladdy.dbi.profile[key] = value
 | 
					    Gladdy.dbi.profile[key] = value
 | 
				
			||||||
    Gladdy:UpdateFrame()
 | 
					    Gladdy:UpdateFrame()
 | 
				
			||||||
 | 
					    if Gladdy.db.hideBlizzard == "always" then
 | 
				
			||||||
 | 
					        SetCVar("showArenaEnemyFrames", 0)
 | 
				
			||||||
 | 
					    elseif Gladdy.db.hideBlizzard == "never" then
 | 
				
			||||||
 | 
					        SetCVar("showArenaEnemyFrames", 1)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
local function getColorOpt(info)
 | 
					local function getColorOpt(info)
 | 
				
			||||||
    local key = info.arg or info[#info]
 | 
					    local key = info.arg or info[#info]
 | 
				
			||||||
@@ -113,7 +161,7 @@ function Gladdy:SetupModule(name, module, order)
 | 
				
			|||||||
        self.options.args[name] = {
 | 
					        self.options.args[name] = {
 | 
				
			||||||
            type = "group",
 | 
					            type = "group",
 | 
				
			||||||
            name = L[name],
 | 
					            name = L[name],
 | 
				
			||||||
            desc = L[name .. " settings"],
 | 
					            desc = L[name] .. " " .. L["settings"],
 | 
				
			||||||
            childGroups = "tab",
 | 
					            childGroups = "tab",
 | 
				
			||||||
            order = order,
 | 
					            order = order,
 | 
				
			||||||
            args = {},
 | 
					            args = {},
 | 
				
			||||||
@@ -151,7 +199,7 @@ local function pairsByKeys(t)
 | 
				
			|||||||
    for k in pairs(t) do
 | 
					    for k in pairs(t) do
 | 
				
			||||||
        tinsert(a, k)
 | 
					        tinsert(a, k)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    tsort(a)
 | 
					    tsort(a, function(a, b) return L[a] < L[b] end)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local i = 0
 | 
					    local i = 0
 | 
				
			||||||
    return function()
 | 
					    return function()
 | 
				
			||||||
@@ -168,35 +216,105 @@ end
 | 
				
			|||||||
function Gladdy:SetupOptions()
 | 
					function Gladdy:SetupOptions()
 | 
				
			||||||
    self.options = {
 | 
					    self.options = {
 | 
				
			||||||
        type = "group",
 | 
					        type = "group",
 | 
				
			||||||
        name = "Gladdy",
 | 
					        name = L["Gladdy"],
 | 
				
			||||||
        plugins = {},
 | 
					        plugins = {},
 | 
				
			||||||
        childGroups = "tree",
 | 
					        childGroups = "tree",
 | 
				
			||||||
        get = getOpt,
 | 
					        get = getOpt,
 | 
				
			||||||
        set = setOpt,
 | 
					        set = setOpt,
 | 
				
			||||||
        args = {
 | 
					        args = {
 | 
				
			||||||
 | 
					            lock = {
 | 
				
			||||||
 | 
					                order = 1,
 | 
				
			||||||
 | 
					                width = 0.7,
 | 
				
			||||||
 | 
					                name = Gladdy.db.locked and L["Unlock frame"] or L["Lock frame"],
 | 
				
			||||||
 | 
					                desc = L["Toggle if frame can be moved"],
 | 
				
			||||||
 | 
					                type = "execute",
 | 
				
			||||||
 | 
					                func = function()
 | 
				
			||||||
 | 
					                    Gladdy.db.locked = not Gladdy.db.locked
 | 
				
			||||||
 | 
					                    Gladdy:UpdateFrame()
 | 
				
			||||||
 | 
					                    self.options.args.lock.name = Gladdy.db.locked and L["Unlock frame"] or L["Lock frame"]
 | 
				
			||||||
 | 
					                end,
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					            showMover = {
 | 
				
			||||||
 | 
					                order = 2,
 | 
				
			||||||
 | 
					                width = 0.7,
 | 
				
			||||||
 | 
					                name = Gladdy.db.showMover and L["Hide Mover"] or L["Show Mover"],
 | 
				
			||||||
 | 
					                desc = L["Toggle to show Mover Frames"],
 | 
				
			||||||
 | 
					                type = "execute",
 | 
				
			||||||
 | 
					                func = function()
 | 
				
			||||||
 | 
					                    Gladdy.db.showMover = not Gladdy.db.showMover
 | 
				
			||||||
 | 
					                    Gladdy:UpdateFrame()
 | 
				
			||||||
 | 
					                    self.options.args.showMover.name = Gladdy.db.showMover and L["Hide Mover"] or L["Show Mover"]
 | 
				
			||||||
 | 
					                end,
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					            test = {
 | 
				
			||||||
 | 
					                order = 2,
 | 
				
			||||||
 | 
					                width = 0.7,
 | 
				
			||||||
 | 
					                name = L["Test"],
 | 
				
			||||||
 | 
					                desc = L["Show Test frames"],
 | 
				
			||||||
 | 
					                type = "execute",
 | 
				
			||||||
 | 
					                func = function()
 | 
				
			||||||
 | 
					                    Gladdy:ToggleFrame(3)
 | 
				
			||||||
 | 
					                end,
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					            hide = {
 | 
				
			||||||
 | 
					                order = 3,
 | 
				
			||||||
 | 
					                width = 0.7,
 | 
				
			||||||
 | 
					                name = L["Hide"],
 | 
				
			||||||
 | 
					                desc = L["Hide frames"],
 | 
				
			||||||
 | 
					                type = "execute",
 | 
				
			||||||
 | 
					                func = function()
 | 
				
			||||||
 | 
					                    Gladdy:Reset()
 | 
				
			||||||
 | 
					                    Gladdy:HideFrame()
 | 
				
			||||||
 | 
					                end,
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					            reload = {
 | 
				
			||||||
 | 
					                order = 4,
 | 
				
			||||||
 | 
					                width = 0.7,
 | 
				
			||||||
 | 
					                name = L["ReloadUI"],
 | 
				
			||||||
 | 
					                desc = L["Reloads the UI"],
 | 
				
			||||||
 | 
					                type = "execute",
 | 
				
			||||||
 | 
					                func = function()
 | 
				
			||||||
 | 
					                    ReloadUI()
 | 
				
			||||||
 | 
					                end,
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					            version = {
 | 
				
			||||||
 | 
					                order = 5,
 | 
				
			||||||
 | 
					                width = 1,
 | 
				
			||||||
 | 
					                type = "description",
 | 
				
			||||||
 | 
					                name = "     " .. Gladdy.version
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
            general = {
 | 
					            general = {
 | 
				
			||||||
                type = "group",
 | 
					                type = "group",
 | 
				
			||||||
                name = L["General"],
 | 
					                name = L["General"],
 | 
				
			||||||
                desc = L["General settings"],
 | 
					                desc = L["General settings"],
 | 
				
			||||||
                childGroups = "tab",
 | 
					                childGroups = "tab",
 | 
				
			||||||
                order = 1,
 | 
					                order = 5,
 | 
				
			||||||
                args = {
 | 
					                args = {
 | 
				
			||||||
                    locked = {
 | 
					                    growDirection = {
 | 
				
			||||||
                        type = "toggle",
 | 
					                        type = "select",
 | 
				
			||||||
                        name = L["Lock frame"],
 | 
					                        name = L["Grow Direction"],
 | 
				
			||||||
                        desc = L["Toggle if frame can be moved"],
 | 
					                        order = 3,
 | 
				
			||||||
                        order = 1,
 | 
					                        values = {
 | 
				
			||||||
 | 
					                            ["BOTTOM"] = L["Down"],
 | 
				
			||||||
 | 
					                            ["TOP"] = L["Up"],
 | 
				
			||||||
 | 
					                            ["LEFT"] = L["Left"],
 | 
				
			||||||
 | 
					                            ["RIGHT"] = L["Right"],
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                    growUp = {
 | 
					                    hideBlizzard = {
 | 
				
			||||||
                        type = "toggle",
 | 
					                        type = "select",
 | 
				
			||||||
                        name = L["Grow frame upwards"],
 | 
					                        name = L["Hide Blizzard"],
 | 
				
			||||||
                        desc = L["If enabled the frame will grow upwards instead of downwards"],
 | 
					                        values = {
 | 
				
			||||||
                        order = 2,
 | 
					                            ["arena"] = L["Arena only"],
 | 
				
			||||||
 | 
					                            ["never"] = L["Never"],
 | 
				
			||||||
 | 
					                            ["always"] = L["Always"],
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        order = 4,
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                    group = {
 | 
					                    group = {
 | 
				
			||||||
                        type = "group",
 | 
					                        type = "group",
 | 
				
			||||||
                        name = "General",
 | 
					                        name = L["General"],
 | 
				
			||||||
                        order = 3,
 | 
					                        order = 6,
 | 
				
			||||||
                        childGroups = "tree",
 | 
					                        childGroups = "tree",
 | 
				
			||||||
                        args = {
 | 
					                        args = {
 | 
				
			||||||
                            frameGeneral = {
 | 
					                            frameGeneral = {
 | 
				
			||||||
@@ -207,44 +325,57 @@ function Gladdy:SetupOptions()
 | 
				
			|||||||
                                    headerFrame = {
 | 
					                                    headerFrame = {
 | 
				
			||||||
                                        type = "header",
 | 
					                                        type = "header",
 | 
				
			||||||
                                        name = L["Frame General"],
 | 
					                                        name = L["Frame General"],
 | 
				
			||||||
 | 
					                                        order = 2,
 | 
				
			||||||
 | 
					                                    },
 | 
				
			||||||
 | 
					                                    growMiddle = {
 | 
				
			||||||
 | 
					                                        type = "toggle",
 | 
				
			||||||
 | 
					                                        name = L["Grow Middle"],
 | 
				
			||||||
 | 
					                                        desc = L["Frames expand along a centric anchor"],
 | 
				
			||||||
                                        order = 3,
 | 
					                                        order = 3,
 | 
				
			||||||
                                    },
 | 
					                                    },
 | 
				
			||||||
 | 
					                                    pixelPerfect = {
 | 
				
			||||||
 | 
					                                        type = "toggle",
 | 
				
			||||||
 | 
					                                        name = L["Pixel Perfect Scale"],
 | 
				
			||||||
 | 
					                                        desc = L["Enables Pixel Perfect Scale - disables manual "].. L["Frame scale"],
 | 
				
			||||||
 | 
					                                        order = 4,
 | 
				
			||||||
 | 
					                                    },
 | 
				
			||||||
                                    frameScale = {
 | 
					                                    frameScale = {
 | 
				
			||||||
                                        type = "range",
 | 
					                                        type = "range",
 | 
				
			||||||
                                        name = L["Frame scale"],
 | 
					                                        name = L["Frame scale"],
 | 
				
			||||||
                                        desc = L["Scale of the frame"],
 | 
					                                        desc = L["Scale of the frame"],
 | 
				
			||||||
                                        order = 4,
 | 
					                                        disabled = function() return Gladdy.db.pixelPerfect end,
 | 
				
			||||||
 | 
					                                        order = 5,
 | 
				
			||||||
                                        min = .1,
 | 
					                                        min = .1,
 | 
				
			||||||
                                        max = 2,
 | 
					                                        max = 2,
 | 
				
			||||||
                                        step = .1,
 | 
					                                        step = .01,
 | 
				
			||||||
                                    },
 | 
					 | 
				
			||||||
                                    padding = {
 | 
					 | 
				
			||||||
                                        type = "range",
 | 
					 | 
				
			||||||
                                        name = L["Frame padding"],
 | 
					 | 
				
			||||||
                                        desc = L["Padding of the frame"],
 | 
					 | 
				
			||||||
                                        order = 5,
 | 
					 | 
				
			||||||
                                        min = 0,
 | 
					 | 
				
			||||||
                                        max = 20,
 | 
					 | 
				
			||||||
                                        step = 1,
 | 
					 | 
				
			||||||
                                    },
 | 
					                                    },
 | 
				
			||||||
                                    barWidth = {
 | 
					                                    barWidth = {
 | 
				
			||||||
                                        type = "range",
 | 
					                                        type = "range",
 | 
				
			||||||
                                        name = L["Frame width"],
 | 
					                                        name = L["Frame width"],
 | 
				
			||||||
                                        desc = L["Width of the bars"],
 | 
					                                        desc = L["Width of the bars"],
 | 
				
			||||||
                                        order = 6,
 | 
					                                        order = 7,
 | 
				
			||||||
                                        min = 10,
 | 
					                                        min = 10,
 | 
				
			||||||
                                        max = 500,
 | 
					                                        max = 500,
 | 
				
			||||||
                                        step = 5,
 | 
					                                        step = 5,
 | 
				
			||||||
                                    },
 | 
					                                    },
 | 
				
			||||||
                                    bottomMargin = {
 | 
					                                    bottomMargin = {
 | 
				
			||||||
                                        type = "range",
 | 
					                                        type = "range",
 | 
				
			||||||
                                        name = L["Bottom margin"],
 | 
					                                        name = L["Margin"],
 | 
				
			||||||
                                        desc = L["Margin between each button"],
 | 
					                                        desc = L["Margin between each button"],
 | 
				
			||||||
                                        order = 7,
 | 
					                                        order = 8,
 | 
				
			||||||
                                        min = -100,
 | 
					                                        min = -200,
 | 
				
			||||||
                                        max = 100,
 | 
					                                        max = 200,
 | 
				
			||||||
                                        step = 1,
 | 
					                                        step = 1,
 | 
				
			||||||
                                    },
 | 
					                                    },
 | 
				
			||||||
 | 
					                                    backgroundColor = {
 | 
				
			||||||
 | 
					                                        type = "color",
 | 
				
			||||||
 | 
					                                        name = L["Background color"],
 | 
				
			||||||
 | 
					                                        desc = L["Background Color of the frame"],
 | 
				
			||||||
 | 
					                                        order = 9,
 | 
				
			||||||
 | 
					                                        hasAlpha = true,
 | 
				
			||||||
 | 
					                                        get = getColorOpt,
 | 
				
			||||||
 | 
					                                        set = setColorOpt,
 | 
				
			||||||
 | 
					                                    },
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
                            },
 | 
					                            },
 | 
				
			||||||
                            cooldownGeneral = {
 | 
					                            cooldownGeneral = {
 | 
				
			||||||
@@ -267,7 +398,8 @@ function Gladdy:SetupOptions()
 | 
				
			|||||||
                                            local c = Gladdy.db.trinketDisableCircle
 | 
					                                            local c = Gladdy.db.trinketDisableCircle
 | 
				
			||||||
                                            local d = Gladdy.db.drDisableCircle
 | 
					                                            local d = Gladdy.db.drDisableCircle
 | 
				
			||||||
                                            local e = Gladdy.db.buffsDisableCircle
 | 
					                                            local e = Gladdy.db.buffsDisableCircle
 | 
				
			||||||
                                            if (a == b and a == c and a == d and a == e) then
 | 
					                                            local f = Gladdy.db.racialDisableCircle
 | 
				
			||||||
 | 
					                                            if (a == b and a == c and a == d and a == e and a == f) then
 | 
				
			||||||
                                                return a
 | 
					                                                return a
 | 
				
			||||||
                                            else
 | 
					                                            else
 | 
				
			||||||
                                                return ""
 | 
					                                                return ""
 | 
				
			||||||
@@ -279,6 +411,7 @@ function Gladdy:SetupOptions()
 | 
				
			|||||||
                                            Gladdy.db.trinketDisableCircle = value
 | 
					                                            Gladdy.db.trinketDisableCircle = value
 | 
				
			||||||
                                            Gladdy.db.drDisableCircle = value
 | 
					                                            Gladdy.db.drDisableCircle = value
 | 
				
			||||||
                                            Gladdy.db.buffsDisableCircle = value
 | 
					                                            Gladdy.db.buffsDisableCircle = value
 | 
				
			||||||
 | 
					                                            Gladdy.db.racialDisableCircle = value
 | 
				
			||||||
                                            Gladdy:UpdateFrame()
 | 
					                                            Gladdy:UpdateFrame()
 | 
				
			||||||
                                        end,
 | 
					                                        end,
 | 
				
			||||||
                                        width= "full",
 | 
					                                        width= "full",
 | 
				
			||||||
@@ -296,7 +429,8 @@ function Gladdy:SetupOptions()
 | 
				
			|||||||
                                            local c = Gladdy.db.auraCooldownAlpha
 | 
					                                            local c = Gladdy.db.auraCooldownAlpha
 | 
				
			||||||
                                            local d = Gladdy.db.trinketCooldownAlpha
 | 
					                                            local d = Gladdy.db.trinketCooldownAlpha
 | 
				
			||||||
                                            local e = Gladdy.db.buffsCooldownAlpha
 | 
					                                            local e = Gladdy.db.buffsCooldownAlpha
 | 
				
			||||||
                                            if (a == b and a == c and a == d and a == e) then
 | 
					                                            local f = Gladdy.db.racialCooldownAlpha
 | 
				
			||||||
 | 
					                                            if (a == b and a == c and a == d and a == e and a == f) then
 | 
				
			||||||
                                                return a
 | 
					                                                return a
 | 
				
			||||||
                                            else
 | 
					                                            else
 | 
				
			||||||
                                                return ""
 | 
					                                                return ""
 | 
				
			||||||
@@ -308,9 +442,16 @@ function Gladdy:SetupOptions()
 | 
				
			|||||||
                                            Gladdy.db.auraCooldownAlpha = value
 | 
					                                            Gladdy.db.auraCooldownAlpha = value
 | 
				
			||||||
                                            Gladdy.db.trinketCooldownAlpha = value
 | 
					                                            Gladdy.db.trinketCooldownAlpha = value
 | 
				
			||||||
                                            Gladdy.db.buffsCooldownAlpha = value
 | 
					                                            Gladdy.db.buffsCooldownAlpha = value
 | 
				
			||||||
 | 
					                                            Gladdy.db.racialCooldownAlpha = value
 | 
				
			||||||
                                            Gladdy:UpdateFrame()
 | 
					                                            Gladdy:UpdateFrame()
 | 
				
			||||||
                                        end
 | 
					                                        end
 | 
				
			||||||
                                    },
 | 
					                                    },
 | 
				
			||||||
 | 
					                                    timerFormat = Gladdy:option({
 | 
				
			||||||
 | 
					                                        type = "select",
 | 
				
			||||||
 | 
					                                        name = L["Timer Format"],
 | 
				
			||||||
 | 
					                                        order = 11,
 | 
				
			||||||
 | 
					                                        values = Gladdy.TIMER_FORMAT.values
 | 
				
			||||||
 | 
					                                    })
 | 
				
			||||||
                                },
 | 
					                                },
 | 
				
			||||||
                            },
 | 
					                            },
 | 
				
			||||||
                            fontGeneral = {
 | 
					                            fontGeneral = {
 | 
				
			||||||
@@ -331,33 +472,42 @@ function Gladdy:SetupOptions()
 | 
				
			|||||||
                                        dialogControl = "LSM30_Font",
 | 
					                                        dialogControl = "LSM30_Font",
 | 
				
			||||||
                                        values = AceGUIWidgetLSMlists.font,
 | 
					                                        values = AceGUIWidgetLSMlists.font,
 | 
				
			||||||
                                        get = function(info)
 | 
					                                        get = function(info)
 | 
				
			||||||
                                            local a = Gladdy.db.castBarFont
 | 
					                                            local a = Gladdy.db.auraFont
 | 
				
			||||||
                                            local b = Gladdy.db.healthBarFont
 | 
					                                            local b = Gladdy.db.buffsFont
 | 
				
			||||||
                                            local c = Gladdy.db.powerBarFont
 | 
					                                            local c = Gladdy.db.castBarFont
 | 
				
			||||||
                                            local d = Gladdy.db.cooldownFont
 | 
					                                            local d = Gladdy.db.cooldownFont
 | 
				
			||||||
                                            local e = Gladdy.db.drFont
 | 
					                                            local e = Gladdy.db.drFont
 | 
				
			||||||
                                            local f = Gladdy.db.auraFont
 | 
					                                            local f = Gladdy.db.healthBarFont
 | 
				
			||||||
                                            local g = Gladdy.db.buffsFont
 | 
					                                            local g = Gladdy.db.petHealthBarFont
 | 
				
			||||||
                                            if (a == b and a == c and a == d and a == e and a == f and a == g) then
 | 
					                                            local h = Gladdy.db.powerBarFont
 | 
				
			||||||
 | 
					                                            local i = Gladdy.db.racialFont
 | 
				
			||||||
 | 
					                                            local j = Gladdy.db.npTremorFont
 | 
				
			||||||
 | 
					                                            local k = Gladdy.db.trinketFont
 | 
				
			||||||
 | 
					                                            if (a == b and a == c and a == d and a == e and a == f
 | 
				
			||||||
 | 
					                                                    and a == g and a == h and a == i and a == j and a == k) then
 | 
				
			||||||
                                                return a
 | 
					                                                return a
 | 
				
			||||||
                                            else
 | 
					                                            else
 | 
				
			||||||
                                                return ""
 | 
					                                                return ""
 | 
				
			||||||
                                            end
 | 
					                                            end
 | 
				
			||||||
                                        end,
 | 
					                                        end,
 | 
				
			||||||
                                        set = function(info, value)
 | 
					                                        set = function(info, value)
 | 
				
			||||||
                                            Gladdy.db.castBarFont = value
 | 
					 | 
				
			||||||
                                            Gladdy.db.healthBarFont = value
 | 
					 | 
				
			||||||
                                            Gladdy.db.powerBarFont = value
 | 
					 | 
				
			||||||
                                            Gladdy.db.cooldownFont = value
 | 
					 | 
				
			||||||
                                            Gladdy.db.drFont = value
 | 
					 | 
				
			||||||
                                            Gladdy.db.auraFont = value
 | 
					                                            Gladdy.db.auraFont = value
 | 
				
			||||||
                                            Gladdy.db.buffsFont = value
 | 
					                                            Gladdy.db.buffsFont = value
 | 
				
			||||||
 | 
					                                            Gladdy.db.castBarFont = value
 | 
				
			||||||
 | 
					                                            Gladdy.db.cooldownFont = value
 | 
				
			||||||
 | 
					                                            Gladdy.db.drFont = value
 | 
				
			||||||
 | 
					                                            Gladdy.db.healthBarFont = value
 | 
				
			||||||
 | 
					                                            Gladdy.db.petHealthBarFont = value
 | 
				
			||||||
 | 
					                                            Gladdy.db.powerBarFont = value
 | 
				
			||||||
 | 
					                                            Gladdy.db.racialFont = value
 | 
				
			||||||
 | 
					                                            Gladdy.db.npTremorFont = value
 | 
				
			||||||
 | 
					                                            Gladdy.db.trinketFont = value
 | 
				
			||||||
                                            Gladdy:UpdateFrame()
 | 
					                                            Gladdy:UpdateFrame()
 | 
				
			||||||
                                        end,
 | 
					                                        end,
 | 
				
			||||||
                                    },
 | 
					                                    },
 | 
				
			||||||
                                    fontColor = {
 | 
					                                    fontColor = {
 | 
				
			||||||
                                        type = "color",
 | 
					                                        type = "color",
 | 
				
			||||||
                                        name = L["Font color"],
 | 
					                                        name = L["Font color text"],
 | 
				
			||||||
                                        desc = L["Color of the text"],
 | 
					                                        desc = L["Color of the text"],
 | 
				
			||||||
                                        order = 12,
 | 
					                                        order = 12,
 | 
				
			||||||
                                        hasAlpha = true,
 | 
					                                        hasAlpha = true,
 | 
				
			||||||
@@ -365,8 +515,10 @@ function Gladdy:SetupOptions()
 | 
				
			|||||||
                                            local a = Gladdy.db.healthBarFontColor
 | 
					                                            local a = Gladdy.db.healthBarFontColor
 | 
				
			||||||
                                            local b = Gladdy.db.powerBarFontColor
 | 
					                                            local b = Gladdy.db.powerBarFontColor
 | 
				
			||||||
                                            local c = Gladdy.db.castBarFontColor
 | 
					                                            local c = Gladdy.db.castBarFontColor
 | 
				
			||||||
 | 
					                                            local d = Gladdy.db.petHealthBarFontColor
 | 
				
			||||||
                                            if (a.r == b.r and a.g == b.g and a.b == b.b and a.a == b.a
 | 
					                                            if (a.r == b.r and a.g == b.g and a.b == b.b and a.a == b.a
 | 
				
			||||||
                                                    and a.r == c.r and a.g == c.g and a.b == c.b and a.a == c.a) then
 | 
					                                                    and a.r == c.r and a.g == c.g and a.b == c.b and a.a == c.a
 | 
				
			||||||
 | 
					                                                    and a.r == d.r and a.g == d.g and a.b == d.b and a.a == d.a) then
 | 
				
			||||||
                                                return a.r, a.g, a.b, a.a
 | 
					                                                return a.r, a.g, a.b, a.a
 | 
				
			||||||
                                            else
 | 
					                                            else
 | 
				
			||||||
                                                return { r = 0, g = 0, b = 0, a = 0 }
 | 
					                                                return { r = 0, g = 0, b = 0, a = 0 }
 | 
				
			||||||
@@ -377,6 +529,35 @@ function Gladdy:SetupOptions()
 | 
				
			|||||||
                                            Gladdy.db.healthBarFontColor = rgb
 | 
					                                            Gladdy.db.healthBarFontColor = rgb
 | 
				
			||||||
                                            Gladdy.db.powerBarFontColor = rgb
 | 
					                                            Gladdy.db.powerBarFontColor = rgb
 | 
				
			||||||
                                            Gladdy.db.castBarFontColor = rgb
 | 
					                                            Gladdy.db.castBarFontColor = rgb
 | 
				
			||||||
 | 
					                                            Gladdy.db.petHealthBarFontColor = rgb
 | 
				
			||||||
 | 
					                                            Gladdy:UpdateFrame()
 | 
				
			||||||
 | 
					                                        end,
 | 
				
			||||||
 | 
					                                    },
 | 
				
			||||||
 | 
					                                    fontColorCD = {
 | 
				
			||||||
 | 
					                                        type = "color",
 | 
				
			||||||
 | 
					                                        name = L["Font color timer"],
 | 
				
			||||||
 | 
					                                        desc = L["Color of the timers"],
 | 
				
			||||||
 | 
					                                        order = 12,
 | 
				
			||||||
 | 
					                                        hasAlpha = true,
 | 
				
			||||||
 | 
					                                        get = function(info)
 | 
				
			||||||
 | 
					                                            local a = Gladdy.db.auraFontColor
 | 
				
			||||||
 | 
					                                            local b = Gladdy.db.buffsFontColor
 | 
				
			||||||
 | 
					                                            local c = Gladdy.db.cooldownFontColor
 | 
				
			||||||
 | 
					                                            local d = Gladdy.db.drFontColor
 | 
				
			||||||
 | 
					                                            if (a.r == b.r and a.g == b.g and a.b == b.b and a.a == b.a
 | 
				
			||||||
 | 
					                                                    and a.r == c.r and a.g == c.g and a.b == c.b and a.a == c.a
 | 
				
			||||||
 | 
					                                                    and a.r == d.r and a.g == d.g and a.b == d.b and a.a == d.a) then
 | 
				
			||||||
 | 
					                                                return a.r, a.g, a.b, a.a
 | 
				
			||||||
 | 
					                                            else
 | 
				
			||||||
 | 
					                                                return { r = 0, g = 0, b = 0, a = 0 }
 | 
				
			||||||
 | 
					                                            end
 | 
				
			||||||
 | 
					                                        end,
 | 
				
			||||||
 | 
					                                        set = function(info, r, g, b, a)
 | 
				
			||||||
 | 
					                                            local rgb = {r = r, g = g, b = b, a = a}
 | 
				
			||||||
 | 
					                                            Gladdy.db.auraFontColor = rgb
 | 
				
			||||||
 | 
					                                            Gladdy.db.buffsFontColor = rgb
 | 
				
			||||||
 | 
					                                            Gladdy.db.cooldownFontColor = rgb
 | 
				
			||||||
 | 
					                                            Gladdy.db.drFontColor = rgb
 | 
				
			||||||
                                            Gladdy:UpdateFrame()
 | 
					                                            Gladdy:UpdateFrame()
 | 
				
			||||||
                                        end,
 | 
					                                        end,
 | 
				
			||||||
                                    },
 | 
					                                    },
 | 
				
			||||||
@@ -399,27 +580,34 @@ function Gladdy:SetupOptions()
 | 
				
			|||||||
                                        order = 14,
 | 
					                                        order = 14,
 | 
				
			||||||
                                        values = Gladdy:GetIconStyles(),
 | 
					                                        values = Gladdy:GetIconStyles(),
 | 
				
			||||||
                                        get = function(info)
 | 
					                                        get = function(info)
 | 
				
			||||||
                                            if (Gladdy.db.classIconBorderStyle == Gladdy.db.trinketBorderStyle
 | 
					                                            if (Gladdy.db.auraBorderStyle == Gladdy.db.buffsBorderStyle
 | 
				
			||||||
                                                    and Gladdy.db.classIconBorderStyle == Gladdy.db.castBarIconStyle
 | 
					                                                    and Gladdy.db.auraBorderStyle == Gladdy.db.castBarIconStyle
 | 
				
			||||||
                                                    and Gladdy.db.classIconBorderStyle == Gladdy.db.auraBorderStyle
 | 
					                                                    and Gladdy.db.auraBorderStyle == Gladdy.db.classIconBorderStyle
 | 
				
			||||||
                                                    and Gladdy.db.classIconBorderStyle == Gladdy.db.cooldownBorderStyle
 | 
					                                                    and Gladdy.db.auraBorderStyle == Gladdy.db.cooldownBorderStyle
 | 
				
			||||||
                                                    and Gladdy.db.classIconBorderStyle == Gladdy.db.buffsBorderStyle
 | 
					                                                    and Gladdy.db.auraBorderStyle == Gladdy.db.ciBorderStyle
 | 
				
			||||||
                                                    and Gladdy.db.classIconBorderStyle == Gladdy.db.drBorderStyle
 | 
					                                                    and Gladdy.db.auraBorderStyle == Gladdy.db.cooldownBorderStyle
 | 
				
			||||||
                                                    and Gladdy.db.classIconBorderStyle == Gladdy.db.npTotemPlatesBorderStyle) then
 | 
					                                                    and Gladdy.db.auraBorderStyle == Gladdy.db.drBorderStyle
 | 
				
			||||||
                                                return Gladdy.db.classIconBorderStyle
 | 
					                                                    and Gladdy.db.auraBorderStyle == Gladdy.db.racialBorderStyle
 | 
				
			||||||
 | 
					                                                    and Gladdy.db.auraBorderStyle == Gladdy.db.npTotemPlatesBorderStyle
 | 
				
			||||||
 | 
					                                                    and Gladdy.db.auraBorderStyle == Gladdy.db.petPortraitBorderStyle
 | 
				
			||||||
 | 
					                                                    and Gladdy.db.auraBorderStyle == Gladdy.db.trinketBorderStyle) then
 | 
				
			||||||
 | 
					                                                return Gladdy.db.auraBorderStyle
 | 
				
			||||||
                                            else
 | 
					                                            else
 | 
				
			||||||
                                                return ""
 | 
					                                                return ""
 | 
				
			||||||
                                            end
 | 
					                                            end
 | 
				
			||||||
                                        end,
 | 
					                                        end,
 | 
				
			||||||
                                        set = function(info, value)
 | 
					                                        set = function(info, value)
 | 
				
			||||||
                                            Gladdy.db.classIconBorderStyle = value
 | 
					 | 
				
			||||||
                                            Gladdy.db.trinketBorderStyle = value
 | 
					 | 
				
			||||||
                                            Gladdy.db.castBarIconStyle = value
 | 
					 | 
				
			||||||
                                            Gladdy.db.auraBorderStyle = value
 | 
					                                            Gladdy.db.auraBorderStyle = value
 | 
				
			||||||
                                            Gladdy.db.npTotemPlatesBorderStyle = value
 | 
					 | 
				
			||||||
                                            Gladdy.db.cooldownBorderStyle = value
 | 
					 | 
				
			||||||
                                            Gladdy.db.buffsBorderStyle = value
 | 
					                                            Gladdy.db.buffsBorderStyle = value
 | 
				
			||||||
 | 
					                                            Gladdy.db.castBarIconStyle = value
 | 
				
			||||||
 | 
					                                            Gladdy.db.classIconBorderStyle = value
 | 
				
			||||||
 | 
					                                            Gladdy.db.ciBorderStyle = value
 | 
				
			||||||
 | 
					                                            Gladdy.db.cooldownBorderStyle = value
 | 
				
			||||||
                                            Gladdy.db.drBorderStyle = value
 | 
					                                            Gladdy.db.drBorderStyle = value
 | 
				
			||||||
 | 
					                                            Gladdy.db.racialBorderStyle = value
 | 
				
			||||||
 | 
					                                            Gladdy.db.npTotemPlatesBorderStyle = value
 | 
				
			||||||
 | 
					                                            Gladdy.db.petPortraitBorderStyle = value
 | 
				
			||||||
 | 
					                                            Gladdy.db.trinketBorderStyle = value
 | 
				
			||||||
                                            Gladdy:UpdateFrame()
 | 
					                                            Gladdy:UpdateFrame()
 | 
				
			||||||
                                        end,
 | 
					                                        end,
 | 
				
			||||||
                                    },
 | 
					                                    },
 | 
				
			||||||
@@ -430,11 +618,25 @@ function Gladdy:SetupOptions()
 | 
				
			|||||||
                                        order = 15,
 | 
					                                        order = 15,
 | 
				
			||||||
                                        hasAlpha = true,
 | 
					                                        hasAlpha = true,
 | 
				
			||||||
                                        get = function(info)
 | 
					                                        get = function(info)
 | 
				
			||||||
                                            local a = Gladdy.db.classIconBorderColor
 | 
					                                            local a = Gladdy.db.auraBuffBorderColor
 | 
				
			||||||
                                            local b = Gladdy.db.trinketBorderColor
 | 
					                                            local b = Gladdy.db.auraDebuffBorderColor
 | 
				
			||||||
                                            local c = Gladdy.db.castBarIconColor
 | 
					                                            local c = Gladdy.db.buffsBorderColor
 | 
				
			||||||
 | 
					                                            local d = Gladdy.db.castBarIconColor
 | 
				
			||||||
 | 
					                                            local e = Gladdy.db.classIconBorderColor
 | 
				
			||||||
 | 
					                                            local f = Gladdy.db.ciBorderColor
 | 
				
			||||||
 | 
					                                            local g = Gladdy.db.cooldownBorderColor
 | 
				
			||||||
 | 
					                                            local h = Gladdy.db.drBorderColor
 | 
				
			||||||
 | 
					                                            local i = Gladdy.db.trinketBorderColor
 | 
				
			||||||
 | 
					                                            local j = Gladdy.db.racialBorderColor
 | 
				
			||||||
                                            if (a.r == b.r and a.g == b.g and a.b == b.b and a.a == b.a
 | 
					                                            if (a.r == b.r and a.g == b.g and a.b == b.b and a.a == b.a
 | 
				
			||||||
                                                    and a.r == c.r and a.g == c.g and a.b == c.b and a.a == c.a) then
 | 
					                                                    and a.r == c.r and a.g == c.g and a.b == c.b and a.a == c.a
 | 
				
			||||||
 | 
					                                                    and a.r == d.r and a.g == d.g and a.b == d.b and a.a == d.a
 | 
				
			||||||
 | 
					                                                    and a.r == e.r and a.g == e.g and a.b == e.b and a.a == e.a
 | 
				
			||||||
 | 
					                                                    and a.r == f.r and a.g == f.g and a.b == f.b and a.a == f.a
 | 
				
			||||||
 | 
					                                                    and a.r == g.r and a.g == g.g and a.b == g.b and a.a == g.a
 | 
				
			||||||
 | 
					                                                    and a.r == h.r and a.g == h.g and a.b == h.b and a.a == h.a
 | 
				
			||||||
 | 
					                                                    and a.r == i.r and a.g == i.g and a.b == i.b and a.a == i.a
 | 
				
			||||||
 | 
					                                                    and a.r == j.r and a.g == j.g and a.b == j.b and a.a == j.a) then
 | 
				
			||||||
                                                return a.r, a.g, a.b, a.a
 | 
					                                                return a.r, a.g, a.b, a.a
 | 
				
			||||||
                                            else
 | 
					                                            else
 | 
				
			||||||
                                                return { r = 0, g = 0, b = 0, a = 0 }
 | 
					                                                return { r = 0, g = 0, b = 0, a = 0 }
 | 
				
			||||||
@@ -442,13 +644,16 @@ function Gladdy:SetupOptions()
 | 
				
			|||||||
                                        end,
 | 
					                                        end,
 | 
				
			||||||
                                        set = function(info, r, g, b, a)
 | 
					                                        set = function(info, r, g, b, a)
 | 
				
			||||||
                                            local rgb = {r = r, g = g, b = b, a = a}
 | 
					                                            local rgb = {r = r, g = g, b = b, a = a}
 | 
				
			||||||
                                            Gladdy.db.classIconBorderColor = rgb
 | 
					                                            Gladdy.db.auraBuffBorderColor = rgb
 | 
				
			||||||
                                            Gladdy.db.trinketBorderColor = rgb
 | 
					                                            Gladdy.db.auraDebuffBorderColor = rgb
 | 
				
			||||||
                                            Gladdy.db.castBarIconColor = rgb
 | 
					 | 
				
			||||||
                                            Gladdy.db.npTotemPlatesBorderColor = rgb
 | 
					 | 
				
			||||||
                                            Gladdy.db.drBorderColor = rgb
 | 
					 | 
				
			||||||
                                            Gladdy.db.cooldownBorderColor = rgb
 | 
					 | 
				
			||||||
                                            Gladdy.db.buffsBorderColor = rgb
 | 
					                                            Gladdy.db.buffsBorderColor = rgb
 | 
				
			||||||
 | 
					                                            Gladdy.db.castBarIconColor = rgb
 | 
				
			||||||
 | 
					                                            Gladdy.db.classIconBorderColor = rgb
 | 
				
			||||||
 | 
					                                            Gladdy.db.ciBorderColor = rgb
 | 
				
			||||||
 | 
					                                            Gladdy.db.cooldownBorderColor = rgb
 | 
				
			||||||
 | 
					                                            Gladdy.db.drBorderColor = rgb
 | 
				
			||||||
 | 
					                                            Gladdy.db.trinketBorderColor = rgb
 | 
				
			||||||
 | 
					                                            Gladdy.db.racialBorderColor = rgb
 | 
				
			||||||
                                            Gladdy:UpdateFrame()
 | 
					                                            Gladdy:UpdateFrame()
 | 
				
			||||||
                                        end,
 | 
					                                        end,
 | 
				
			||||||
                                    },
 | 
					                                    },
 | 
				
			||||||
@@ -475,7 +680,8 @@ function Gladdy:SetupOptions()
 | 
				
			|||||||
                                            local a = Gladdy.db.healthBarTexture
 | 
					                                            local a = Gladdy.db.healthBarTexture
 | 
				
			||||||
                                            local b = Gladdy.db.powerBarTexture
 | 
					                                            local b = Gladdy.db.powerBarTexture
 | 
				
			||||||
                                            local c = Gladdy.db.castBarTexture
 | 
					                                            local c = Gladdy.db.castBarTexture
 | 
				
			||||||
                                            if (a == b and a == c) then
 | 
					                                            local d = Gladdy.db.petHealthBarTexture
 | 
				
			||||||
 | 
					                                            if (a == b and a == c and a == d) then
 | 
				
			||||||
                                                return a
 | 
					                                                return a
 | 
				
			||||||
                                            else
 | 
					                                            else
 | 
				
			||||||
                                                return ""
 | 
					                                                return ""
 | 
				
			||||||
@@ -485,6 +691,7 @@ function Gladdy:SetupOptions()
 | 
				
			|||||||
                                            Gladdy.db.healthBarTexture = value
 | 
					                                            Gladdy.db.healthBarTexture = value
 | 
				
			||||||
                                            Gladdy.db.powerBarTexture = value
 | 
					                                            Gladdy.db.powerBarTexture = value
 | 
				
			||||||
                                            Gladdy.db.castBarTexture = value
 | 
					                                            Gladdy.db.castBarTexture = value
 | 
				
			||||||
 | 
					                                            Gladdy.db.petHealthBarTexture = value
 | 
				
			||||||
                                            Gladdy:UpdateFrame()
 | 
					                                            Gladdy:UpdateFrame()
 | 
				
			||||||
                                        end,
 | 
					                                        end,
 | 
				
			||||||
                                        width= "full",
 | 
					                                        width= "full",
 | 
				
			||||||
@@ -500,7 +707,8 @@ function Gladdy:SetupOptions()
 | 
				
			|||||||
                                            local a = Gladdy.db.healthBarBorderStyle
 | 
					                                            local a = Gladdy.db.healthBarBorderStyle
 | 
				
			||||||
                                            local b = Gladdy.db.powerBarBorderStyle
 | 
					                                            local b = Gladdy.db.powerBarBorderStyle
 | 
				
			||||||
                                            local c = Gladdy.db.castBarBorderStyle
 | 
					                                            local c = Gladdy.db.castBarBorderStyle
 | 
				
			||||||
                                            if (a == b and a == c) then
 | 
					                                            local d = Gladdy.db.petHealthBarBorderStyle
 | 
				
			||||||
 | 
					                                            if (a == b and a == c and a == d) then
 | 
				
			||||||
                                                return a
 | 
					                                                return a
 | 
				
			||||||
                                            else
 | 
					                                            else
 | 
				
			||||||
                                                return ""
 | 
					                                                return ""
 | 
				
			||||||
@@ -510,6 +718,7 @@ function Gladdy:SetupOptions()
 | 
				
			|||||||
                                            Gladdy.db.healthBarBorderStyle = value
 | 
					                                            Gladdy.db.healthBarBorderStyle = value
 | 
				
			||||||
                                            Gladdy.db.powerBarBorderStyle = value
 | 
					                                            Gladdy.db.powerBarBorderStyle = value
 | 
				
			||||||
                                            Gladdy.db.castBarBorderStyle = value
 | 
					                                            Gladdy.db.castBarBorderStyle = value
 | 
				
			||||||
 | 
					                                            Gladdy.db.petHealthBarBorderStyle = value
 | 
				
			||||||
                                            Gladdy:UpdateFrame()
 | 
					                                            Gladdy:UpdateFrame()
 | 
				
			||||||
                                        end,
 | 
					                                        end,
 | 
				
			||||||
                                    },
 | 
					                                    },
 | 
				
			||||||
@@ -531,8 +740,10 @@ function Gladdy:SetupOptions()
 | 
				
			|||||||
                                            local a = Gladdy.db.castBarBorderColor
 | 
					                                            local a = Gladdy.db.castBarBorderColor
 | 
				
			||||||
                                            local b = Gladdy.db.healthBarBorderColor
 | 
					                                            local b = Gladdy.db.healthBarBorderColor
 | 
				
			||||||
                                            local c = Gladdy.db.powerBarBorderColor
 | 
					                                            local c = Gladdy.db.powerBarBorderColor
 | 
				
			||||||
 | 
					                                            local d = Gladdy.db.petHealthBarBorderColor
 | 
				
			||||||
                                            if (a.r == b.r and a.g == b.g and a.b == b.b and a.a == b.a
 | 
					                                            if (a.r == b.r and a.g == b.g and a.b == b.b and a.a == b.a
 | 
				
			||||||
                                                    and a.r == c.r and a.g == c.g and a.b == c.b and a.a == c.a) then
 | 
					                                                    and a.r == c.r and a.g == c.g and a.b == c.b and a.a == c.a
 | 
				
			||||||
 | 
					                                                    and a.r == d.r and a.g == d.g and a.b == d.b and a.a == d.a) then
 | 
				
			||||||
                                                return a.r, a.g, a.b, a.a
 | 
					                                                return a.r, a.g, a.b, a.a
 | 
				
			||||||
                                            else
 | 
					                                            else
 | 
				
			||||||
                                                return { r = 0, g = 0, b = 0, a = 0 }
 | 
					                                                return { r = 0, g = 0, b = 0, a = 0 }
 | 
				
			||||||
@@ -543,6 +754,7 @@ function Gladdy:SetupOptions()
 | 
				
			|||||||
                                            Gladdy.db.castBarBorderColor = rgb
 | 
					                                            Gladdy.db.castBarBorderColor = rgb
 | 
				
			||||||
                                            Gladdy.db.healthBarBorderColor = rgb
 | 
					                                            Gladdy.db.healthBarBorderColor = rgb
 | 
				
			||||||
                                            Gladdy.db.powerBarBorderColor = rgb
 | 
					                                            Gladdy.db.powerBarBorderColor = rgb
 | 
				
			||||||
 | 
					                                            Gladdy.db.petHealthBarBorderColor = rgb
 | 
				
			||||||
                                            Gladdy:UpdateFrame()
 | 
					                                            Gladdy:UpdateFrame()
 | 
				
			||||||
                                        end,
 | 
					                                        end,
 | 
				
			||||||
                                    },
 | 
					                                    },
 | 
				
			||||||
@@ -555,19 +767,19 @@ function Gladdy:SetupOptions()
 | 
				
			|||||||
        },
 | 
					        },
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local order = 2
 | 
					    local order = 6
 | 
				
			||||||
    for k, v in pairsByKeys(self.modules) do
 | 
					    for k, v in pairsByKeys(self.modules) do
 | 
				
			||||||
        self:SetupModule(k, v, order)
 | 
					        self:SetupModule(k, v, order)
 | 
				
			||||||
        order = order + 1
 | 
					        order = order + 1
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local options = {
 | 
					    local options = {
 | 
				
			||||||
        name = "Gladdy",
 | 
					        name = L["Gladdy"],
 | 
				
			||||||
        type = "group",
 | 
					        type = "group",
 | 
				
			||||||
        args = {
 | 
					        args = {
 | 
				
			||||||
            load = {
 | 
					            load = {
 | 
				
			||||||
                name = "Load configuration",
 | 
					                name = L["Load configuration"],
 | 
				
			||||||
                desc = "Load configuration options",
 | 
					                desc = L["Load configuration options"],
 | 
				
			||||||
                type = "execute",
 | 
					                type = "execute",
 | 
				
			||||||
                func = function()
 | 
					                func = function()
 | 
				
			||||||
                    HideUIPanel(InterfaceOptionsFrame)
 | 
					                    HideUIPanel(InterfaceOptionsFrame)
 | 
				
			||||||
@@ -586,7 +798,7 @@ function Gladdy:SetupOptions()
 | 
				
			|||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Gladdy:ShowOptions()
 | 
					function Gladdy:ShowOptions()
 | 
				
			||||||
    InterfaceOptionsFrame_OpenToFrame("Gladdy")
 | 
					    LibStub("AceConfigDialog-3.0"):Open("Gladdy")
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Gladdy:GetAuras(auraType)
 | 
					function Gladdy:GetAuras(auraType)
 | 
				
			||||||
@@ -594,22 +806,34 @@ function Gladdy:GetAuras(auraType)
 | 
				
			|||||||
        ckeckAll = {
 | 
					        ckeckAll = {
 | 
				
			||||||
            order = 1,
 | 
					            order = 1,
 | 
				
			||||||
            width = "0.7",
 | 
					            width = "0.7",
 | 
				
			||||||
            name = "Check All",
 | 
					            name = L["Check All"],
 | 
				
			||||||
            type = "execute",
 | 
					            type = "execute",
 | 
				
			||||||
            func = function(info)
 | 
					            func = function(info)
 | 
				
			||||||
                for k,v in pairs(Gladdy.dbi.profile.trackedDebuffs) do
 | 
					                if auraType == AURA_TYPE_DEBUFF then
 | 
				
			||||||
                    Gladdy.dbi.profile.trackedDebuffs[k] = true
 | 
					                    for k,v in pairs(Gladdy.defaults.profile.trackedDebuffs) do
 | 
				
			||||||
 | 
					                        Gladdy.dbi.profile.trackedDebuffs[k] = true
 | 
				
			||||||
 | 
					                    end
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                    for k,v in pairs(Gladdy.defaults.profile.trackedBuffs) do
 | 
				
			||||||
 | 
					                        Gladdy.dbi.profile.trackedBuffs[k] = true
 | 
				
			||||||
 | 
					                    end
 | 
				
			||||||
                end
 | 
					                end
 | 
				
			||||||
            end,
 | 
					            end,
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        uncheckAll = {
 | 
					        uncheckAll = {
 | 
				
			||||||
            order = 2,
 | 
					            order = 2,
 | 
				
			||||||
            width = "0.7",
 | 
					            width = "0.7",
 | 
				
			||||||
            name = "Uncheck All",
 | 
					            name = L["Uncheck All"],
 | 
				
			||||||
            type = "execute",
 | 
					            type = "execute",
 | 
				
			||||||
            func = function(info)
 | 
					            func = function(info)
 | 
				
			||||||
                for k,v in pairs(Gladdy.dbi.profile.trackedDebuffs) do
 | 
					                if auraType == AURA_TYPE_DEBUFF then
 | 
				
			||||||
                    Gladdy.dbi.profile.trackedDebuffs[k] = false
 | 
					                    for k,v in pairs(Gladdy.defaults.profile.trackedDebuffs) do
 | 
				
			||||||
 | 
					                        Gladdy.dbi.profile.trackedDebuffs[k] = false
 | 
				
			||||||
 | 
					                    end
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                    for k,v in pairs(Gladdy.defaults.profile.trackedBuffs) do
 | 
				
			||||||
 | 
					                        Gladdy.dbi.profile.trackedBuffs[k] = false
 | 
				
			||||||
 | 
					                    end
 | 
				
			||||||
                end
 | 
					                end
 | 
				
			||||||
            end,
 | 
					            end,
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
@@ -689,28 +913,38 @@ function Gladdy:GetAuras(auraType)
 | 
				
			|||||||
    local defaultDebuffs = {}
 | 
					    local defaultDebuffs = {}
 | 
				
			||||||
    local assignForClass = function(class)
 | 
					    local assignForClass = function(class)
 | 
				
			||||||
        local args = {}
 | 
					        local args = {}
 | 
				
			||||||
        local classSpells = auraType == "debuff" and LibClassAuras.GetClassDebuffs(class) or LibClassAuras.GetClassBuffs(class)
 | 
					        local classSpells = auraType == AURA_TYPE_DEBUFF and LibClassAuras.GetClassDebuffs(class) or LibClassAuras.GetClassBuffs(class)
 | 
				
			||||||
        table.sort(classSpells, function(a, b)
 | 
					        table.sort(classSpells, function(a, b)
 | 
				
			||||||
            return a.name:upper() < b.name:upper()
 | 
					            return a.name:upper() < b.name:upper()
 | 
				
			||||||
        end)
 | 
					        end)
 | 
				
			||||||
        for i=1, #classSpells do
 | 
					        for i=1, #classSpells do
 | 
				
			||||||
            local spellName, _, texture = GetSpellInfo(classSpells[i].id[#classSpells[i].id])
 | 
					            local _, _, texture = GetSpellInfo(classSpells[i].id[#classSpells[i].id])
 | 
				
			||||||
            --spellName = (classSpells[i].id[#classSpells[i].id] == 31117 or classSpells[i].id[#classSpells[i].id] ==  43523) and "Unstable Affliction Silence" or spellName
 | 
					 | 
				
			||||||
            if classSpells[i].texture then
 | 
					            if classSpells[i].texture then
 | 
				
			||||||
                texture = classSpells[i].texture
 | 
					                texture = classSpells[i].texture
 | 
				
			||||||
            end
 | 
					            end
 | 
				
			||||||
            args[classSpells[i].name] = {
 | 
					            args[tostring(classSpells[i].id[1])] = {
 | 
				
			||||||
                order = i,
 | 
					                order = i,
 | 
				
			||||||
                name = classSpells[i].name,
 | 
					                name = classSpells[i].name,
 | 
				
			||||||
                type = "toggle",
 | 
					                type = "toggle",
 | 
				
			||||||
                image = texture,
 | 
					                image = texture,
 | 
				
			||||||
                width = "2",
 | 
					                width = "full",
 | 
				
			||||||
                arg = classSpells[i].name
 | 
					                arg = tostring(classSpells[i].id[1])
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            defaultDebuffs[classSpells[i].name] = true
 | 
					            defaultDebuffs[tostring(classSpells[i].id[1])] = true
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
        return args
 | 
					        return args
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					    if Gladdy.expansion == "Wrath" then
 | 
				
			||||||
 | 
					        spells.deathknight = {
 | 
				
			||||||
 | 
					            order = 3,
 | 
				
			||||||
 | 
					            type = "group",
 | 
				
			||||||
 | 
					            name = LOCALIZED_CLASS_NAMES_MALE["DEATHKNIGHT"],
 | 
				
			||||||
 | 
					            icon = "Interface\\Glues\\CharacterCreate\\UI-CharacterCreate-Classes",
 | 
				
			||||||
 | 
					            iconCoords = CLASS_ICON_TCOORDS["DEATHKNIGHT"],
 | 
				
			||||||
 | 
					            args = {},
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        spells.deathknight.args = assignForClass("DEATHKNIGHT")
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
    spells.druid.args = assignForClass("DRUID")
 | 
					    spells.druid.args = assignForClass("DRUID")
 | 
				
			||||||
    spells.hunter.args = assignForClass("HUNTER")
 | 
					    spells.hunter.args = assignForClass("HUNTER")
 | 
				
			||||||
    spells.mage.args = assignForClass("MAGE")
 | 
					    spells.mage.args = assignForClass("MAGE")
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										353
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										353
									
								
								README.md
									
									
									
									
									
								
							@@ -1,31 +1,51 @@
 | 
				
			|||||||
# Gladdy - TBC
 | 
					# Gladdy - Classic
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### The most powerful arena addon for WoW TBC 2.5.1
 | 
					### The most powerful arena addon for WoW TBC 2.5.4 & WotLK 3.4.0
 | 
				
			||||||
## [v1.0.3-Beta Download Here](https://github.com/XiconQoo/Gladdy-TBC/releases/download/v1.0.3-Beta/Gladdy_TBC-Classic_v1.0.3-Beta.zip)
 | 
					
 | 
				
			||||||
 | 
					---
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [v2.20-Beta Download Here](https://github.com/XiconQoo/Gladdy-TBC/releases/download/v2.20-Release/Gladdy_Classic_v2.20-Beta.zip)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
###### <a target="_blank" rel="noopener noreferrer" href="https://www.paypal.me/xiconqoo/10"><img src="https://raw.githubusercontent.com/XiconQoo/Gladdy/readme-media/Paypal-Donate.png" height="30" style="margin-top:-30px;position:relative;top:20px;"></a> Please consider donating if you like my work
 | 
					###### <a target="_blank" rel="noopener noreferrer" href="https://www.paypal.me/xiconqoo/10"><img src="https://raw.githubusercontent.com/XiconQoo/Gladdy/readme-media/Paypal-Donate.png" height="30" style="margin-top:-30px;position:relative;top:20px;"></a> Please consider donating if you like my work
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Origin
 | 
					### Origin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Based on https://github.com/Schaka/gladdy
 | 
					Based on https://github.com/miraage/gladdy
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Motivation for this edit
 | 
					### Motivation for this edit
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The goal is to make Gladdy highly configurable in it's appearance. Everything can be arranged left or right independently. Also I gave Gladdy a new look with black borders. A lot can be configured.
 | 
					The goal is to make Gladdy highly configurable in it's appearance. Everything can be arranged left or right independently. Also I gave Gladdy a new look with black borders. A lot can be configured.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Modules:
 | 
					### Modules:
 | 
				
			||||||
- Announcement (drink, trinket usage, spec detection ...)
 | 
					- **Announcement** (drink, trinket usage, spec detection ...)
 | 
				
			||||||
- ArenaCountDown
 | 
					- **ArenaCountDown**
 | 
				
			||||||
- Auras (show important (de)buffs in the class icon)
 | 
					- **Auras** (show important (de)buffs as well as interrupts on the class icon)
 | 
				
			||||||
- Cooldown (tracks important cooldowns)
 | 
					- **BuffsDebuffs** (show buffs and debuffs on arena frames - can be filtered)
 | 
				
			||||||
- Diminishing (tracks DRs)
 | 
					- **CastBar** (shows a castbar, can be disabled)
 | 
				
			||||||
- ExportImport (share your profile with your friends in the form of a string, which can be imported)
 | 
					- **ClassIcon** (or specicon, once detected)
 | 
				
			||||||
- Highlight (highlights focus and target)
 | 
					- **Clicks** (bind spells or macros to click actions)
 | 
				
			||||||
- Pets (show arena pets)
 | 
					- **CombatIndicator** (shows a sword icon if unit is in combat)
 | 
				
			||||||
- TotemPlates (show totem icons instead of normal nameplates)
 | 
					- **Cooldown** (tracks important cooldowns)
 | 
				
			||||||
- Trinket (tracks trinket usage)
 | 
					- **Diminishing** (tracks DRs)
 | 
				
			||||||
- VersionCheck (checks if you use an older version that your teammate)
 | 
					- **ExportImport** (share your profile with your friends in the form of a string, which can be imported)
 | 
				
			||||||
- XiconProfiles (predefined profiles to start your configuration from)
 | 
					- **Highlight** (highlights focus and target)
 | 
				
			||||||
 | 
					- **Pets** (show arena pets)
 | 
				
			||||||
 | 
					- **Racial** (show arena racial cooldowns)
 | 
				
			||||||
 | 
					- **Range Check** (checks the range to a unit by a configurable spell)
 | 
				
			||||||
 | 
					- **Shadowsight Timer** (shows a little movable frame with time left until Shadow Eyes spawn)
 | 
				
			||||||
 | 
					- **TotemPlates** (show totem icons instead of normal nameplates, compatible with **Plater, NeatPlates, KUI, ThreatPlates, ElvUI, TukUI**)
 | 
				
			||||||
 | 
					- **TotemPulse** (shows pulse on TotemPlate icon or beneath nameplate)
 | 
				
			||||||
 | 
					- **Trinket** (tracks trinket usage)
 | 
				
			||||||
 | 
					- **VersionCheck** (checks if you use an older version that your teammate)
 | 
				
			||||||
 | 
					- **XiconProfiles** (predefined profiles to start your configuration from)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Valid Slash commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- **/gladdy ui** (shows config)
 | 
				
			||||||
 | 
					- **/gladdy test** (standard 3v3 test mode)
 | 
				
			||||||
 | 
					- **/gladdy test1** to **/gladdy test5** (test mode with 1-5 frames active)
 | 
				
			||||||
 | 
					- **/gladdy hide** (hides the frames)
 | 
				
			||||||
 | 
					- **/gladdy reset** (resets current profile to default settings)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Screenshots
 | 
					## Screenshots
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -33,7 +53,308 @@ The goal is to make Gladdy highly configurable in it's appearance. Everything ca
 | 
				
			|||||||
<img src="https://raw.githubusercontent.com/XiconQoo/Gladdy/readme-media/sample2.jpg" align="right" width="48.5%">
 | 
					<img src="https://raw.githubusercontent.com/XiconQoo/Gladdy/readme-media/sample2.jpg" align="right" width="48.5%">
 | 
				
			||||||
<img src="https://raw.githubusercontent.com/XiconQoo/Gladdy/readme-media/sample3.png" width="48.5%">
 | 
					<img src="https://raw.githubusercontent.com/XiconQoo/Gladdy/readme-media/sample3.png" width="48.5%">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## Contributors
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- [ManneN1](https://github.com/ManneN1)
 | 
				
			||||||
 | 
					- [AlexFolland](https://github.com/AlexFolland)
 | 
				
			||||||
 | 
					- [dfherr](https://github.com/dfherr)
 | 
				
			||||||
 | 
					- [miraage](https://github.com/miraage)
 | 
				
			||||||
 | 
					- [veiz](https://github.com/veiz)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Thank you!
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## Special Thanks
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- **miraage** - the origininal author of Gladdy! Your work set the foundation for this edit. Thanks!
 | 
				
			||||||
 | 
					- **Schaka** - the maintainer of Gladdy! (thanks for letting me continue Gladdy and all the work you put into the TBC community)
 | 
				
			||||||
 | 
					- **Macumba** (thanks for all the support, your feedback and your dedication for the TBC community)
 | 
				
			||||||
 | 
					- **RMO** (without you I would not have modified Gladdy at all and thanks for all the suggestions and active feedback)
 | 
				
			||||||
 | 
					- **Ur0b0r0s aka DrainTheLock** (thanks for testing, giving feedback and correcting/adding wrong CDs)
 | 
				
			||||||
 | 
					- **Klimp** (thanks for all the suggestions and active feedback)
 | 
				
			||||||
 | 
					- **the whole TBC addons 2.4.3 discord** (thanks for the support and great community, especially the MVPs)
 | 
				
			||||||
 | 
					- **Hydra** (thanks for constructive feedback and suggestions)
 | 
				
			||||||
 | 
					- **Xyz** (thanks for suggestions and extensive testing <3)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Changes
 | 
					### Changes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v2.20-Beta
 | 
				
			||||||
 | 
					- **Wrath** & **BCC** support
 | 
				
			||||||
 | 
					  - different auras/DRs/Cooldowns/Buffs per expansion
 | 
				
			||||||
 | 
					- **Zoomed Icon** options added for all modules
 | 
				
			||||||
 | 
					- **Cooldowns**
 | 
				
			||||||
 | 
					  - desaturate icon on cd added
 | 
				
			||||||
 | 
					  - alpha on cd added
 | 
				
			||||||
 | 
					  - glow on CD active added
 | 
				
			||||||
 | 
					- **Diminishing**
 | 
				
			||||||
 | 
					  - replaced DRData with DRList (your dr-categories options will be reset like "force icon" and what is enabled)
 | 
				
			||||||
 | 
					  - zoomed icons
 | 
				
			||||||
 | 
					  - changed DR-tracking behaviour (DR will show once aura is applied and start CD once aura fades)
 | 
				
			||||||
 | 
					- **Trinket & Racial**
 | 
				
			||||||
 | 
					  - in Wrath racials like wotf share CD with Trinket and vice versa
 | 
				
			||||||
 | 
					  - fixed some potential API bug in Trinket use detection
 | 
				
			||||||
 | 
					- **ArenaCountdown**
 | 
				
			||||||
 | 
					  - uses C_Timer now
 | 
				
			||||||
 | 
					- **Import/Export of Profiles**
 | 
				
			||||||
 | 
					  - profiles should now be able to import/export between BCC and Wrath
 | 
				
			||||||
 | 
					  - auras, cooldowns, DRs and buffs/debuffs are ignored
 | 
				
			||||||
 | 
					  - positioning, style etc will be transferred between expansions
 | 
				
			||||||
 | 
					- proper Feign Death detection
 | 
				
			||||||
 | 
					- fix detect pet abilities CD like Spell Lock
 | 
				
			||||||
 | 
					- minor bugfixes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v2.11-Release
 | 
				
			||||||
 | 
					- **Cooldowns**
 | 
				
			||||||
 | 
					  - fixed cooldowns not showing properly for detected spec
 | 
				
			||||||
 | 
					  - Nature's Swiftness (Druid/Shaman) now properly tracked
 | 
				
			||||||
 | 
					  - improved cd out of stealth detection
 | 
				
			||||||
 | 
					- **HealthBar**
 | 
				
			||||||
 | 
					  - added options class colored or custom colors
 | 
				
			||||||
 | 
					  - custom colors for 100%, 50% 0% hp values added
 | 
				
			||||||
 | 
					  - custom stealth color added
 | 
				
			||||||
 | 
					- add group option for DRs
 | 
				
			||||||
 | 
					- intercept cd adjusted (-5s for 4pc set bonus)
 | 
				
			||||||
 | 
					- totempulse minor adjustments
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v2.10-Release
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- **Totems**:
 | 
				
			||||||
 | 
					  - added new module **TotemPulse** (sorry Shamans)
 | 
				
			||||||
 | 
					    - displays pulse ticks on all totems that have a pulse mechanic (e.g. tremor totem)
 | 
				
			||||||
 | 
					    - either cooldown or bar style
 | 
				
			||||||
 | 
					    - attaches to TotemPlates if enabled (con be configured individually by totem)
 | 
				
			||||||
 | 
					  - completely hide totem nameplate option added
 | 
				
			||||||
 | 
					  - added a dummy totemplate in config mode
 | 
				
			||||||
 | 
					  - totem detection is completely localization independent now
 | 
				
			||||||
 | 
					- **Cooldowns**:
 | 
				
			||||||
 | 
					  - completely refactored to fix general bugs
 | 
				
			||||||
 | 
					  - can now be ordered individually
 | 
				
			||||||
 | 
					  - some cooldown tracking improved for units coming out of stealth (e.g. perception, sprint, shadowstep)
 | 
				
			||||||
 | 
					- **Custom Text Tags**
 | 
				
			||||||
 | 
					  - PowerBar and HealthBar can now have custom tags. Check it out
 | 
				
			||||||
 | 
					  - also the texts can be moved to achieve a Blizzlike style with names above HealthBar
 | 
				
			||||||
 | 
					- general improvements to spec detection
 | 
				
			||||||
 | 
					  - no more restoration warlocks :D
 | 
				
			||||||
 | 
					  - tree of life spec detection should work now
 | 
				
			||||||
 | 
					- fix Announcements
 | 
				
			||||||
 | 
					- added grouping option for Auras (+ Interrupts) in detached mode, ClassIcon, Cooldowns, Trinket, Racial
 | 
				
			||||||
 | 
					- added a "Grow Middle" option, which aligns the gladdy frames on a centric point
 | 
				
			||||||
 | 
					- added frFR localization by Macumba
 | 
				
			||||||
 | 
					- added Flat statusbar texture
 | 
				
			||||||
 | 
					- added some auras (e.g. disarm)
 | 
				
			||||||
 | 
					- added disarm DRs
 | 
				
			||||||
 | 
					- improved some class icons
 | 
				
			||||||
 | 
					- added font OUTLINE option for Health-/Power-/CastBar texts
 | 
				
			||||||
 | 
					- fixed health bug since 2.5.4
 | 
				
			||||||
 | 
					- updated Mir Profile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v2.00-Release
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					This is a packed release with new features and bugfixes. Most importantly, positioning of all elements has been redone with movable frames.
 | 
				
			||||||
 | 
					Thank you for the great feedback and active contribution.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					***Attention: Once you install this version it will drastically change your current profile! You can't go back to an earlier version. Either back up your WTF or export your Profile before updating!***
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Here is a list of all changes:**
 | 
				
			||||||
 | 
					- **major release version set to v2**
 | 
				
			||||||
 | 
					  - this will mean, that export strings will still be backwards compatible, but not forward (Gladdy v2.x String can't be imported into Gladdy v1.x but vice versa)
 | 
				
			||||||
 | 
					- **big overhaul of positioning elements added! All elements besides HP and PowerBar can be moved separately**
 | 
				
			||||||
 | 
					  - added Mover Frames for Auras, Interrupts, (De)Buffs, CastBar, ClassIcon, CombatIndicator, Cooldowns, DRs, Pets, Racial, Trinket
 | 
				
			||||||
 | 
					  - this will hopefully make configuration a lot easier
 | 
				
			||||||
 | 
					  - all visible elements' FrameStrata and FrameLevel can be configured (overlap frames how you want it)
 | 
				
			||||||
 | 
					- **SpecDetection:**
 | 
				
			||||||
 | 
					  - fixed spec detection for Paladins
 | 
				
			||||||
 | 
					  - added following spells for better spec detection:
 | 
				
			||||||
 | 
					      - Expose Weakness (Survival Hunter)
 | 
				
			||||||
 | 
					      - Slow (Arcane Mage)
 | 
				
			||||||
 | 
					      - Improved Blink (Arcane Mage)
 | 
				
			||||||
 | 
					      - Vindication (Retribution Paladin)
 | 
				
			||||||
 | 
					      - Holy Shield (Protection Paladin)
 | 
				
			||||||
 | 
					      - Vampiric Embrace (Shadow Priest)
 | 
				
			||||||
 | 
					      - Blade Flurry (Combat Rogue)
 | 
				
			||||||
 | 
					      - Unleashed Rage (Enhancement Shaman)
 | 
				
			||||||
 | 
					      - Flurry (Enhancement Shaman)
 | 
				
			||||||
 | 
					      - Shamanistic Rage (Enhancement Shaman)
 | 
				
			||||||
 | 
					      - Healing Way (Restoration Shaman)
 | 
				
			||||||
 | 
					      - Totem of Wrath (Elemental Shaman)
 | 
				
			||||||
 | 
					      - Dark Pact (Affliction Warlock)
 | 
				
			||||||
 | 
					      - Conflagrate (Destruction Warlock)
 | 
				
			||||||
 | 
					      - Shield Slam (Protection Warrior)
 | 
				
			||||||
 | 
					- **Cooldowns:**
 | 
				
			||||||
 | 
					  - added Fear Ward and Fear Ward Cooldown Detection in case it was used before arena
 | 
				
			||||||
 | 
					  - added following cooldowns:
 | 
				
			||||||
 | 
					      - Scare Beast (Hunter)
 | 
				
			||||||
 | 
					      - Feign Death (Hunter)
 | 
				
			||||||
 | 
					      - Viper Sting (Hunter)
 | 
				
			||||||
 | 
					      - Flare (Hunter)
 | 
				
			||||||
 | 
					      - Fear Ward (Priest)
 | 
				
			||||||
 | 
					      - Shadow Word: Death (Priest)
 | 
				
			||||||
 | 
					      - Evocation (Mage)
 | 
				
			||||||
 | 
					      - Grounding Totem (Shaman)
 | 
				
			||||||
 | 
					      - Spell Lock (Warlock)
 | 
				
			||||||
 | 
					      - Devour Magic (Warlock)
 | 
				
			||||||
 | 
					      - Intercept (Warrior)
 | 
				
			||||||
 | 
					- **Auras/Interrupts:**
 | 
				
			||||||
 | 
					  - can now be detached from ClassIcon and positioned/scaled anywhere separately
 | 
				
			||||||
 | 
					  - added Auras:
 | 
				
			||||||
 | 
					      - Scare Beast (Hunter)
 | 
				
			||||||
 | 
					      - Fear Ward (Priest)
 | 
				
			||||||
 | 
					- **Shadowsight:**
 | 
				
			||||||
 | 
					  - reset timer when buff was taken
 | 
				
			||||||
 | 
					  - add a configurable 2nd timer or show one timer with the closest CD
 | 
				
			||||||
 | 
					- **CastBar Icon can be enabled/disabled**
 | 
				
			||||||
 | 
					- **Trinket solid color option added**
 | 
				
			||||||
 | 
					  - color for Trinket on/off CD can be configured (red/green by default)
 | 
				
			||||||
 | 
					- **fixed some DR-categories** (Hibernate / Chastice / Dragonsbreath / ImpConcussiveShot / Counterattack)
 | 
				
			||||||
 | 
					- **Pixel Perfect option added** (makes your Gladdy Frames pixel perfect - no more weird scaling interferences)
 | 
				
			||||||
 | 
					- **Pets can be grouped** (not perfect yet, but a first step)
 | 
				
			||||||
 | 
					- **added DR-Level Text** (thanks https://github.com/ManneN1)
 | 
				
			||||||
 | 
					- **added zhCN Locale** (thanks https://github.com/veiz)
 | 
				
			||||||
 | 
					- **ClassIcon can be disabled**
 | 
				
			||||||
 | 
					- **add interrupt announcement**
 | 
				
			||||||
 | 
					- **detect SpellLock and Devour Magic cooldowns properly**
 | 
				
			||||||
 | 
					- **minor fixes:**
 | 
				
			||||||
 | 
					  - fixed reloading during arena to properly show all frames
 | 
				
			||||||
 | 
					  - fix grow up positioning
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v1.22-Release
 | 
				
			||||||
 | 
					- fixed import for some localizations not working
 | 
				
			||||||
 | 
					- added cooldown number alpha configurations for Auras, BuffsDebuffs, Cooldowns, Diminishings, Racial & Trinket
 | 
				
			||||||
 | 
					- grounding totem effect fix
 | 
				
			||||||
 | 
					- fixed some buffs/debuffs not being present in BuffsDebuffs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v1.21-Release
 | 
				
			||||||
 | 
					- fixed error when hiding blizzard frames ArenaEnemyFrames related to ElvUI
 | 
				
			||||||
 | 
					- added Pummel cooldown
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v1.20-Release
 | 
				
			||||||
 | 
					- configurable DR duration
 | 
				
			||||||
 | 
					- scale in 0.01 percent steps
 | 
				
			||||||
 | 
					- added Net-o-Matic, Nigh Invulnerablility Shield, Nigh Invulnerablility Backfire & Flee (Skull of Impending Doom) to Auras
 | 
				
			||||||
 | 
					- added Mangle, Chastise, Avenging Wrath, Rapid Fire to BuffsDebuffs
 | 
				
			||||||
 | 
					- improved testmode to only activate Auras/Buffs/Debuffs/Dr's that are actually enabled
 | 
				
			||||||
 | 
					- added Mir's profile to XiconProfiles
 | 
				
			||||||
 | 
					- added zhTW localization
 | 
				
			||||||
 | 
					- added buttons for Test, Hide & Reload in the config
 | 
				
			||||||
 | 
					- added version in config
 | 
				
			||||||
 | 
					- ArenaCountdown upgrade
 | 
				
			||||||
 | 
					- Repentance, Freezing Trap & Wyvern Sting are now disorients
 | 
				
			||||||
 | 
					- import string now ignores errors on deleted options
 | 
				
			||||||
 | 
					- added (un)checkAll button in DR-Categories in Diminishing Module
 | 
				
			||||||
 | 
					- totemplates fix option to alter all colors/alphas
 | 
				
			||||||
 | 
					- hide blizzard arena pets as well
 | 
				
			||||||
 | 
					- fix shadowsight timer showing when not in arena or testmode
 | 
				
			||||||
 | 
					- some minor refactoring / optimization
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v1.19-Beta
 | 
				
			||||||
 | 
					- fix gladdy frames not showing v2
 | 
				
			||||||
 | 
					- minor bug fixes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v1.18-Beta
 | 
				
			||||||
 | 
					- castbar font now working properly
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v1.17-Beta
 | 
				
			||||||
 | 
					- option TimerFormat added (seconds or seconds + milliseconds) (General > Cooldown General > Timer Format)
 | 
				
			||||||
 | 
					- hide blizzard arena frames without cvars
 | 
				
			||||||
 | 
					- fix Gladdy bugging out on arena join when in combat
 | 
				
			||||||
 | 
					- fix some TotemPlates issues
 | 
				
			||||||
 | 
					- fix Feign Death causing to reset DR and Aura tracking
 | 
				
			||||||
 | 
					- ArenaX option in Healthbar module now only shows the number
 | 
				
			||||||
 | 
					- add background for all frames (General > Frame General > Background Color)
 | 
				
			||||||
 | 
					- add evasion and banish to Aura
 | 
				
			||||||
 | 
					- add MSBT to Announcement module
 | 
				
			||||||
 | 
					- Shadowsight timer can be locked now
 | 
				
			||||||
 | 
					- add "All" modifier to Clicks module
 | 
				
			||||||
 | 
					- updated testmode for BuffsDebuffs (show only from enabled set)
 | 
				
			||||||
 | 
					- updated Klimp's profile
 | 
				
			||||||
 | 
					- added a new Profile in XiconProfiles -> Rukk1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v1.16-Beta
 | 
				
			||||||
 | 
					- unit gray in stealth when rangecheck module disabled
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v1.15-Beta
 | 
				
			||||||
 | 
					- hotfix added entangling roots nature's grasp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v1.14-Beta
 | 
				
			||||||
 | 
					- hotfix for secure button grow direction up
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v1.13-Beta
 | 
				
			||||||
 | 
					- frames behave now to mouseover macros
 | 
				
			||||||
 | 
					- added Range Check module (configurable which spell is used for range check)
 | 
				
			||||||
 | 
					- added Shadowsight Timer module (with announce)
 | 
				
			||||||
 | 
					- added Clicks module
 | 
				
			||||||
 | 
					- added Interrupt Tracker in Aura module (border color by spell school locked)
 | 
				
			||||||
 | 
					- TotemPlates compatible with Plater, NeatPlates, KUI, ThreatPlates, ElvUI, TukUI
 | 
				
			||||||
 | 
					- added a new Classic Profile in XiconProfiles
 | 
				
			||||||
 | 
					- hide blizzard arena frames option added in General
 | 
				
			||||||
 | 
					- castbar enable/disable
 | 
				
			||||||
 | 
					- powerbar enable/disable
 | 
				
			||||||
 | 
					- added some auras (Blackout, Improved Hamstring, Mace Stun, Stormherald Stun, Shadowsight Buff)
 | 
				
			||||||
 | 
					- added Swiftmend and Berserker Rage cooldowns
 | 
				
			||||||
 | 
					- changed textures for Mace Stun, Charge Stun and Intercept Stun
 | 
				
			||||||
 | 
					- reduced BLP size by 80%
 | 
				
			||||||
 | 
					- show XiconProfiles on first login
 | 
				
			||||||
 | 
					- DR bigger icons possible
 | 
				
			||||||
 | 
					- minor fixes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v1.12-Beta
 | 
				
			||||||
 | 
					- fix classic profile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v1.11-Beta
 | 
				
			||||||
 | 
					- TotemPlates fix after blizzard update
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v1.10-Beta
 | 
				
			||||||
 | 
					- fix german and russian client not working
 | 
				
			||||||
 | 
					- ArenaCountdown loacalization now working for all languages (except itIT...beta has no option to select italian)
 | 
				
			||||||
 | 
					- Race and Class localization working for all languages
 | 
				
			||||||
 | 
					- Localization finished for German
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#### v1.09-Beta
 | 
				
			||||||
 | 
					- fix Blizzard profile not having all modules preconfigured
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#### v1.08-Beta
 | 
				
			||||||
 | 
					- fix Buffs not showing on class icon
 | 
				
			||||||
 | 
					- added option highlight to be inside
 | 
				
			||||||
 | 
					- added option to grow frames vertically
 | 
				
			||||||
 | 
					- added new profile to XiconProfile (Blizzard raid style)
 | 
				
			||||||
 | 
					- minor bugfixes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#### v1.07-Beta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- CombatIndicator module added
 | 
				
			||||||
 | 
					- spec icon option added to Classicon module
 | 
				
			||||||
 | 
					- arena1-5 for name option added
 | 
				
			||||||
 | 
					- add a couple buffs to LibClassAuras
 | 
				
			||||||
 | 
					- add blessing of sacrifice and intervene to auras
 | 
				
			||||||
 | 
					- general options updated to apply font/borders/etc for all frames
 | 
				
			||||||
 | 
					- XiconProfiles updated
 | 
				
			||||||
 | 
					- /gladdy test1-5 now possible
 | 
				
			||||||
 | 
					- fix PowerBar text updates
 | 
				
			||||||
 | 
					- click through frames exept health/power bar
 | 
				
			||||||
 | 
					- add mask texture for icons
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#### v1.06-Beta
 | 
				
			||||||
 | 
					- fixed BuffsDebuff module
 | 
				
			||||||
 | 
					- fix racial texture reset
 | 
				
			||||||
 | 
					- minor bugfixes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#### v1.0.5-Beta
 | 
				
			||||||
 | 
					- fixed Aura-Module
 | 
				
			||||||
 | 
					- Racial module added to EventListener and Version check updated
 | 
				
			||||||
 | 
					- constants for auras/cooldowns/racials updated
 | 
				
			||||||
 | 
					- anchoring for modules rewritten
 | 
				
			||||||
 | 
					- fix Aura module options (localization independent for profile export)
 | 
				
			||||||
 | 
					- Power-/HealthBar customize texts added and UNIT_DESTROYED added
 | 
				
			||||||
 | 
					- Racial module added and trinket modified
 | 
				
			||||||
 | 
					- XiconProfiles import strings
 | 
				
			||||||
 | 
					- Pets position extended
 | 
				
			||||||
 | 
					- delete unused saved variables
 | 
				
			||||||
 | 
					- ExportImport, VersionCheck & XiconProfiles fix
 | 
				
			||||||
 | 
					- TotemPlates add option to show friendly/enemy icons
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#### v1.0.4-Beta
 | 
				
			||||||
 | 
					- XiconProfiles fixed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#### v1.0.0-Beta
 | 
					#### v1.0.0-Beta
 | 
				
			||||||
- port form 2.4.3
 | 
					- port form 2.4.3
 | 
				
			||||||
							
								
								
									
										182
									
								
								Util.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										182
									
								
								Util.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,182 @@
 | 
				
			|||||||
 | 
					local pairs, ipairs = pairs, ipairs
 | 
				
			||||||
 | 
					local floor = math.floor
 | 
				
			||||||
 | 
					local str_find, str_gsub, str_sub, tinsert = string.find, string.gsub, string.sub, table.insert
 | 
				
			||||||
 | 
					local Gladdy = LibStub("Gladdy")
 | 
				
			||||||
 | 
					local L = Gladdy.L
 | 
				
			||||||
 | 
					local AuraUtil = AuraUtil
 | 
				
			||||||
 | 
					local GetSpellInfo = GetSpellInfo
 | 
				
			||||||
 | 
					local UnitIsUnit = UnitIsUnit
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- TAGS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local tags = {
 | 
				
			||||||
 | 
					    ["current"] = true,
 | 
				
			||||||
 | 
					    ["max"] = true,
 | 
				
			||||||
 | 
					    ["percent"] = true,
 | 
				
			||||||
 | 
					    ["race"] = "race",
 | 
				
			||||||
 | 
					    ["class"] = "class",
 | 
				
			||||||
 | 
					    ["arena"] = true,
 | 
				
			||||||
 | 
					    ["name"] = "name",
 | 
				
			||||||
 | 
					    ["status"] = true,
 | 
				
			||||||
 | 
					    ["spec"] = "spec",
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function str_extract(s, pattern)
 | 
				
			||||||
 | 
					    local t = {} -- table to store the indices
 | 
				
			||||||
 | 
					    local i, j = 0,0
 | 
				
			||||||
 | 
					    while true do
 | 
				
			||||||
 | 
					        i, j = str_find(s, pattern, i+1) -- find 'next' occurrence
 | 
				
			||||||
 | 
					        if i == nil then break end
 | 
				
			||||||
 | 
					        tinsert(t, str_sub(s, i, j))
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    return t
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--TODO optimize this function as it's being called often!
 | 
				
			||||||
 | 
					local function getTagText(unit, tag, current, max, status)
 | 
				
			||||||
 | 
					    local button = Gladdy.buttons[unit]
 | 
				
			||||||
 | 
					    if not button then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if str_find(tag, "percent") then
 | 
				
			||||||
 | 
					        return current and max and floor(current * 100 / max) .. "%%" or ""
 | 
				
			||||||
 | 
					    elseif str_find(tag, "current") then
 | 
				
			||||||
 | 
					        return current and max > 999 and ("%.1fk"):format(current / 1000) or current or ""
 | 
				
			||||||
 | 
					    elseif str_find(tag, "max") then
 | 
				
			||||||
 | 
					        return max and max > 999 and ("%.1fk"):format(max / 1000) or max or ""
 | 
				
			||||||
 | 
					    elseif str_find(tag, "status") then
 | 
				
			||||||
 | 
					        if str_find(tag, "%|") and status == nil then
 | 
				
			||||||
 | 
					            return nil
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            return status or ""
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    elseif str_find(tag, "name") then
 | 
				
			||||||
 | 
					        return button.name or ""
 | 
				
			||||||
 | 
					    elseif str_find(tag, "class") then
 | 
				
			||||||
 | 
					        return button.classLoc or ""
 | 
				
			||||||
 | 
					    elseif str_find(tag, "race") then
 | 
				
			||||||
 | 
					        return button.raceLoc or ""
 | 
				
			||||||
 | 
					    elseif str_find(tag, "arena") then
 | 
				
			||||||
 | 
					        local str,found = str_gsub(unit, "arena", "")
 | 
				
			||||||
 | 
					        return found == 1 and str or ""
 | 
				
			||||||
 | 
					    elseif str_find(tag, "spec") then
 | 
				
			||||||
 | 
					        if str_find(tag, "%|") and button.spec == nil then
 | 
				
			||||||
 | 
					            return nil
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            return button.spec or ""
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Gladdy:SetTag(unit, tagOption, current, max, status)
 | 
				
			||||||
 | 
					    local button = self.buttons[unit]
 | 
				
			||||||
 | 
					    if not button then
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    local returnStr = tagOption
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    local t = str_extract(returnStr, "%[[^%[].-%]")
 | 
				
			||||||
 | 
					    for _, tag in ipairs(t) do
 | 
				
			||||||
 | 
					        local replace
 | 
				
			||||||
 | 
					        if str_find(tag, "|") then -- or operator
 | 
				
			||||||
 | 
					            local indicators = str_extract(tag, "[%[|%|]%a+[%||%]]")
 | 
				
			||||||
 | 
					            local replaces = {}
 | 
				
			||||||
 | 
					            for _, indicator in ipairs(indicators) do
 | 
				
			||||||
 | 
					                tinsert(replaces, getTagText(unit, indicator, current, max, status))
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					            replace = replaces[#replaces]
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            replace = getTagText(unit, tag, current, max, status)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if replace then
 | 
				
			||||||
 | 
					            local find = str_gsub(tag, "%[", "%%[")
 | 
				
			||||||
 | 
					            find = str_gsub(find, "%]", "%%]")
 | 
				
			||||||
 | 
					            find = str_gsub(find, "%|", "%%|")
 | 
				
			||||||
 | 
					            returnStr = str_gsub(returnStr, find, replace)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    return returnStr
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Gladdy:GetTagOption(name, order, enabledOption, func, toggle)
 | 
				
			||||||
 | 
					    if toggle then
 | 
				
			||||||
 | 
					        return func({
 | 
				
			||||||
 | 
					            type = "toggle",
 | 
				
			||||||
 | 
					            name = name,
 | 
				
			||||||
 | 
					            order = order,
 | 
				
			||||||
 | 
					            width = "full",
 | 
				
			||||||
 | 
					            desc = L["Custom Tags:\n"..
 | 
				
			||||||
 | 
					                    "\n|cff1ac742[current]|r - Shows current\n" ..
 | 
				
			||||||
 | 
					                    "\n|cff1ac742[max]|r - Shows max\n" ..
 | 
				
			||||||
 | 
					                    "\n|cff1ac742[percent]|r - Shows percent\n" ..
 | 
				
			||||||
 | 
					                    "\n|cff1ac742[name]|r - Shows name\n" ..
 | 
				
			||||||
 | 
					                    "\n|cff1ac742[arena]|r - Shows arena number\n" ..
 | 
				
			||||||
 | 
					                    "\n|cff1ac742[status]|r - Shows status (eg DEATH)\n" ..
 | 
				
			||||||
 | 
					                    "\n|cff1ac742[race]|r - Shows race\n" ..
 | 
				
			||||||
 | 
					                    "\n|cff1ac742[class]|r - Shows class\n" ..
 | 
				
			||||||
 | 
					                    "\n|cff1ac742[spec]|r - Shows spec\n\n" ..
 | 
				
			||||||
 | 
					                    "Can be combined with OR operator like |cff1ac742[percent|status]|r. The last valid option will be used.\n"],
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        return func({
 | 
				
			||||||
 | 
					            type = "input",
 | 
				
			||||||
 | 
					            name = name,
 | 
				
			||||||
 | 
					            order = order,
 | 
				
			||||||
 | 
					            width = "full",
 | 
				
			||||||
 | 
					            disabled = function() return not Gladdy.db[enabledOption] end,
 | 
				
			||||||
 | 
					            desc = L["Custom Tags:\n"..
 | 
				
			||||||
 | 
					                    "\n|cff1ac742[current]|r - Shows current\n" ..
 | 
				
			||||||
 | 
					                    "\n|cff1ac742[max]|r - Shows max\n" ..
 | 
				
			||||||
 | 
					                    "\n|cff1ac742[percent]|r - Shows percent\n" ..
 | 
				
			||||||
 | 
					                    "\n|cff1ac742[name]|r - Shows name\n" ..
 | 
				
			||||||
 | 
					                    "\n|cff1ac742[arena]|r - Shows arena number\n" ..
 | 
				
			||||||
 | 
					                    "\n|cff1ac742[status]|r - Shows status (eg DEATH)\n" ..
 | 
				
			||||||
 | 
					                    "\n|cff1ac742[race]|r - Shows race\n" ..
 | 
				
			||||||
 | 
					                    "\n|cff1ac742[class]|r - Shows class\n" ..
 | 
				
			||||||
 | 
					                    "\n|cff1ac742[spec]|r - Shows spec\n\n" ..
 | 
				
			||||||
 | 
					                    "Can be combined with OR operator like |cff1ac742[percent|status]|r. The last valid option will be used.\n"],
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Gladdy:contains(entry, list)
 | 
				
			||||||
 | 
					    for _,v in pairs(list) do
 | 
				
			||||||
 | 
					        if entry == v then
 | 
				
			||||||
 | 
					            return true
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    return false
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local feignDeath = GetSpellInfo(5384)
 | 
				
			||||||
 | 
					function Gladdy:isFeignDeath(unit)
 | 
				
			||||||
 | 
					    return AuraUtil.FindAuraByName(feignDeath, unit)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Gladdy:GetArenaUnit(unitCaster, unify)
 | 
				
			||||||
 | 
					    if unitCaster then
 | 
				
			||||||
 | 
					        for i=1,5 do
 | 
				
			||||||
 | 
					            local arenaUnit = "arena" .. i
 | 
				
			||||||
 | 
					            local arenaUnitPet = "arenapet" .. i
 | 
				
			||||||
 | 
					            if unify then
 | 
				
			||||||
 | 
					                if unitCaster and (UnitIsUnit(arenaUnit, unitCaster) or UnitIsUnit(arenaUnitPet, unitCaster)) then
 | 
				
			||||||
 | 
					                    return arenaUnit
 | 
				
			||||||
 | 
					                end
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					                if unitCaster and UnitIsUnit(arenaUnit, unitCaster) then
 | 
				
			||||||
 | 
					                    return arenaUnit
 | 
				
			||||||
 | 
					                end
 | 
				
			||||||
 | 
					                if unitCaster and UnitIsUnit(arenaUnitPet, unitCaster) then
 | 
				
			||||||
 | 
					                    return arenaUnitPet
 | 
				
			||||||
 | 
					                end
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
@@ -12,6 +12,8 @@
 | 
				
			|||||||
    <Include file="libs\LibDeflate\lib.xml"/>
 | 
					    <Include file="libs\LibDeflate\lib.xml"/>
 | 
				
			||||||
    <Include file="libs\LibSharedMedia-3.0\lib.xml"/>
 | 
					    <Include file="libs\LibSharedMedia-3.0\lib.xml"/>
 | 
				
			||||||
    <Include file="libs\AceGUI-3.0-SharedMediaWidgets\widget.xml"/>
 | 
					    <Include file="libs\AceGUI-3.0-SharedMediaWidgets\widget.xml"/>
 | 
				
			||||||
    <Include file="libs\DRData-1.0\DRData-1.0.xml"/>
 | 
					    <Include file="libs\DRList-1.0\DRList-1.0.xml"/>
 | 
				
			||||||
    <Include file="libs\LibClassAuras-1.0\lib.xml"/>
 | 
					    <Include file="libs\LibClassAuras-1.0\lib.xml"/>
 | 
				
			||||||
 | 
					    <Include file="libs\LibSpellRange-1.0\lib.xml"/>
 | 
				
			||||||
 | 
					    <Include file="libs\LibCustomGlow-1.0\LibCustomGlow-1.0.lua"/>
 | 
				
			||||||
</Ui>
 | 
					</Ui>
 | 
				
			||||||
		Reference in New Issue
	
	Block a user