/Tukui/modules/skins/options.lua

http://github.com/Asphyxia/Tukui · Lua · 354 lines · 353 code · 1 blank · 0 comment · 1 complexity · 33a7a5da5cc5e4fba20a29e1544aef3c MD5 · raw file

  1. local T, C, L = unpack(select(2, ...))
  2. local function LoadSkin()
  3. local frames = {
  4. "VideoOptionsFrameCategoryFrame",
  5. "VideoOptionsFramePanelContainer",
  6. "InterfaceOptionsFrameCategories",
  7. "InterfaceOptionsFramePanelContainer",
  8. "InterfaceOptionsFrameAddOns",
  9. "AudioOptionsSoundPanelPlayback",
  10. "AudioOptionsSoundPanelVolume",
  11. "AudioOptionsSoundPanelHardware",
  12. "AudioOptionsVoicePanelTalking",
  13. "AudioOptionsVoicePanelBinding",
  14. "AudioOptionsVoicePanelListening",
  15. }
  16. for i = 1, getn(frames) do
  17. local SkinFrames = _G[frames[i]]
  18. if SkinFrames then
  19. SkinFrames:StripTextures()
  20. SkinFrames:CreateBackdrop("Transparent")
  21. if SkinFrames ~= _G["VideoOptionsFramePanelContainer"] and SkinFrames ~= _G["InterfaceOptionsFramePanelContainer"] then
  22. SkinFrames.backdrop:Point("TOPLEFT",-1,0)
  23. SkinFrames.backdrop:Point("BOTTOMRIGHT",0,1)
  24. else
  25. SkinFrames.backdrop:Point("TOPLEFT", 0, 0)
  26. SkinFrames.backdrop:Point("BOTTOMRIGHT", 0, 0)
  27. end
  28. end
  29. end
  30. local interfacetab = {
  31. "InterfaceOptionsFrameTab1",
  32. "InterfaceOptionsFrameTab2",
  33. }
  34. for i = 1, getn(interfacetab) do
  35. local itab = _G[interfacetab[i]]
  36. if itab then
  37. itab:StripTextures()
  38. T.SkinTab(itab)
  39. end
  40. end
  41. InterfaceOptionsFrameTab1:ClearAllPoints()
  42. InterfaceOptionsFrameTab1:SetPoint("BOTTOMLEFT",InterfaceOptionsFrameCategories,"TOPLEFT",-11,-2)
  43. VideoOptionsFrameDefaults:ClearAllPoints()
  44. InterfaceOptionsFrameDefaults:ClearAllPoints()
  45. InterfaceOptionsFrameCancel:ClearAllPoints()
  46. VideoOptionsFrameDefaults:SetPoint("TOPLEFT",VideoOptionsFrameCategoryFrame,"BOTTOMLEFT",-1,-5)
  47. InterfaceOptionsFrameDefaults:SetPoint("TOPLEFT",InterfaceOptionsFrameCategories,"BOTTOMLEFT",-1,-5)
  48. InterfaceOptionsFrameCancel:SetPoint("TOPRIGHT",InterfaceOptionsFramePanelContainer,"BOTTOMRIGHT",0,-6)
  49. local interfacecheckbox = {
  50. -- Controls
  51. "ControlsPanelStickyTargeting",
  52. "ControlsPanelAutoDismount",
  53. "ControlsPanelAutoClearAFK",
  54. "ControlsPanelBlockTrades",
  55. "ControlsPanelBlockGuildInvites",
  56. "ControlsPanelLootAtMouse",
  57. "ControlsPanelAutoLootCorpse",
  58. -- Combat
  59. "CombatPanelAttackOnAssist",
  60. "CombatPanelStopAutoAttack",
  61. "CombatPanelNameplateClassColors",
  62. "CombatPanelTargetOfTarget",
  63. "CombatPanelShowSpellAlerts",
  64. "CombatPanelReducedLagTolerance",
  65. "CombatPanelActionButtonUseKeyDown",
  66. "CombatPanelEnemyCastBarsOnPortrait",
  67. "CombatPanelEnemyCastBarsOnNameplates",
  68. -- Display
  69. "DisplayPanelShowCloak",
  70. "DisplayPanelShowHelm",
  71. "DisplayPanelShowAggroPercentage",
  72. "DisplayPanelPlayAggroSounds",
  73. "DisplayPanelDetailedLootInfo",
  74. "DisplayPanelShowSpellPointsAvg",
  75. "DisplayPanelemphasizeMySpellEffects",
  76. "DisplayPanelShowFreeBagSpace",
  77. "DisplayPanelColorblindMode", -- Delete when 4.2 is out
  78. "DisplayPanelCinematicSubtitles",
  79. "DisplayPanelRotateMinimap",
  80. "DisplayPanelScreenEdgeFlash",
  81. --Objectives
  82. "ObjectivesPanelAutoQuestTracking",
  83. "ObjectivesPanelAutoQuestProgress",
  84. "ObjectivesPanelMapQuestDifficulty",
  85. "ObjectivesPanelAdvancedWorldMap",
  86. "ObjectivesPanelWatchFrameWidth",
  87. -- Social
  88. "SocialPanelProfanityFilter",
  89. "SocialPanelSpamFilter",
  90. "SocialPanelChatBubbles",
  91. "SocialPanelPartyChat",
  92. "SocialPanelChatHoverDelay",
  93. "SocialPanelGuildMemberAlert",
  94. "SocialPanelChatMouseScroll",
  95. -- Action bars
  96. "ActionBarsPanelLockActionBars",
  97. "ActionBarsPanelSecureAbilityToggle",
  98. -- Names
  99. "NamesPanelMyName",
  100. "NamesPanelFriendlyPlayerNames",
  101. "NamesPanelFriendlyPets",
  102. "NamesPanelFriendlyGuardians",
  103. "NamesPanelFriendlyTotems",
  104. "NamesPanelUnitNameplatesFriends",
  105. "NamesPanelUnitNameplatesFriendlyGuardians",
  106. "NamesPanelUnitNameplatesFriendlyPets",
  107. "NamesPanelUnitNameplatesFriendlyTotems",
  108. "NamesPanelGuilds",
  109. "NamesPanelGuildTitles",
  110. "NamesPanelTitles",
  111. "NamesPanelNonCombatCreature",
  112. "NamesPanelEnemyPlayerNames",
  113. "NamesPanelEnemyPets",
  114. "NamesPanelEnemyGuardians",
  115. "NamesPanelEnemyTotems",
  116. "NamesPanelUnitNameplatesEnemyPets",
  117. "NamesPanelUnitNameplatesEnemies",
  118. "NamesPanelUnitNameplatesEnemyGuardians",
  119. "NamesPanelUnitNameplatesEnemyTotems",
  120. -- Combat Text
  121. "CombatTextPanelTargetDamage",
  122. "CombatTextPanelPeriodicDamage",
  123. "CombatTextPanelPetDamage",
  124. "CombatTextPanelHealing",
  125. "CombatTextPanelTargetEffects",
  126. "CombatTextPanelOtherTargetEffects",
  127. "CombatTextPanelEnableFCT",
  128. "CombatTextPanelDodgeParryMiss",
  129. "CombatTextPanelDamageReduction",
  130. "CombatTextPanelRepChanges",
  131. "CombatTextPanelReactiveAbilities",
  132. "CombatTextPanelFriendlyHealerNames",
  133. "CombatTextPanelCombatState",
  134. "CombatTextPanelComboPoints",
  135. "CombatTextPanelLowManaHealth",
  136. "CombatTextPanelEnergyGains",
  137. "CombatTextPanelPeriodicEnergyGains",
  138. "CombatTextPanelHonorGains",
  139. "CombatTextPanelAuras",
  140. "CombatTextPanelAutoSelfCast",
  141. -- Buffs & Debuffs
  142. "BuffsPanelBuffDurations",
  143. "BuffsPanelDispellableDebuffs",
  144. "BuffsPanelCastableBuffs",
  145. "BuffsPanelShowCastableDebuffs",
  146. -- Camera
  147. "CameraPanelFollowTerrain",
  148. "CameraPanelHeadBob",
  149. "CameraPanelWaterCollision",
  150. "CameraPanelSmartPivot",
  151. -- Mouse
  152. "MousePanelInvertMouse",
  153. "MousePanelClickToMove",
  154. "MousePanelWoWMouse",
  155. -- Help
  156. "HelpPanelShowTutorials",
  157. "HelpPanelLoadingScreenTips",
  158. "HelpPanelEnhancedTooltips",
  159. "HelpPanelBeginnerTooltips",
  160. "HelpPanelShowLuaErrors",
  161. "HelpPanelColorblindMode",
  162. "HelpPanelMovePad",
  163. "BattlenetPanelOnlineFriends",
  164. "BattlenetPanelOfflineFriends",
  165. "BattlenetPanelOnlineFriendsBroadcasts",
  166. "BattlenetPanelOnlineFriendsFriendRequests",
  167. "BattlenetPanelOnlineFriendsConversations",
  168. "BattlenetPanelOnlineFriendsShowToastWindow",
  169. }
  170. for i = 1, getn(interfacecheckbox) do
  171. local icheckbox = _G["InterfaceOptions"..interfacecheckbox[i]]
  172. if icheckbox then
  173. T.SkinCheckBox(icheckbox)
  174. end
  175. end
  176. local interfacedropdown ={
  177. -- Controls
  178. "ControlsPanelAutoLootKeyDropDown",
  179. -- Combat
  180. "CombatPanelTOTDropDown",
  181. "CombatPanelFocusCastKeyDropDown",
  182. "CombatPanelSelfCastKeyDropDown",
  183. -- Display
  184. "DisplayPanelAggroWarningDisplay",
  185. "DisplayPanelWorldPVPObjectiveDisplay",
  186. -- Social
  187. "SocialPanelChatStyle",
  188. "SocialPanelWhisperMode",
  189. "SocialPanelTimestamps",
  190. "SocialPanelBnWhisperMode",
  191. -- Action bars
  192. "ActionBarsPanelPickupActionKeyDropDown",
  193. -- Names
  194. "NamesPanelNPCNamesDropDown",
  195. "NamesPanelUnitNameplatesMotionDropDown",
  196. -- Combat Text
  197. "CombatTextPanelFCTDropDown",
  198. -- Camera
  199. "CameraPanelStyleDropDown",
  200. -- Mouse
  201. "MousePanelClickMoveStyleDropDown",
  202. "LanguagesPanelLocaleDropDown",
  203. }
  204. for i = 1, getn(interfacedropdown) do
  205. local idropdown = _G["InterfaceOptions"..interfacedropdown[i]]
  206. if idropdown then
  207. T.SkinDropDownBox(idropdown)
  208. DropDownList1:SetTemplate("Transparent")
  209. end
  210. end
  211. T.SkinButton(InterfaceOptionsHelpPanelResetTutorials)
  212. local optioncheckbox = {
  213. -- Advanced
  214. "Advanced_MaxFPSCheckBox",
  215. "Advanced_MaxFPSBKCheckBox",
  216. -- Audio
  217. "AudioOptionsSoundPanelEnableSound",
  218. "AudioOptionsSoundPanelSoundEffects",
  219. "AudioOptionsSoundPanelErrorSpeech",
  220. "AudioOptionsSoundPanelEmoteSounds",
  221. "AudioOptionsSoundPanelPetSounds",
  222. "AudioOptionsSoundPanelMusic",
  223. "AudioOptionsSoundPanelLoopMusic",
  224. "AudioOptionsSoundPanelAmbientSounds",
  225. "AudioOptionsSoundPanelSoundInBG",
  226. "AudioOptionsSoundPanelReverb",
  227. "AudioOptionsSoundPanelHRTF",
  228. "AudioOptionsSoundPanelEnableDSPs",
  229. "AudioOptionsSoundPanelUseHardware",
  230. "AudioOptionsVoicePanelEnableVoice",
  231. "AudioOptionsVoicePanelEnableMicrophone",
  232. "AudioOptionsVoicePanelPushToTalkSound",
  233. -- Network
  234. "NetworkOptionsPanelOptimizeSpeed",
  235. "NetworkOptionsPanelUseIPv6",
  236. }
  237. for i = 1, getn(optioncheckbox) do
  238. local ocheckbox = _G[optioncheckbox[i]]
  239. if ocheckbox then
  240. T.SkinCheckBox(ocheckbox)
  241. end
  242. end
  243. local optiondropdown = {
  244. -- Graphics
  245. "Graphics_DisplayModeDropDown",
  246. "Graphics_ResolutionDropDown",
  247. "Graphics_RefreshDropDown",
  248. "Graphics_PrimaryMonitorDropDown",
  249. "Graphics_MultiSampleDropDown",
  250. "Graphics_VerticalSyncDropDown",
  251. "Graphics_TextureResolutionDropDown",
  252. "Graphics_FilteringDropDown",
  253. "Graphics_ProjectedTexturesDropDown",
  254. "Graphics_ViewDistanceDropDown",
  255. "Graphics_EnvironmentalDetailDropDown",
  256. "Graphics_GroundClutterDropDown",
  257. "Graphics_ShadowsDropDown",
  258. "Graphics_LiquidDetailDropDown",
  259. "Graphics_SunshaftsDropDown",
  260. "Graphics_ParticleDensityDropDown",
  261. -- Advanced
  262. "Advanced_BufferingDropDown",
  263. "Advanced_LagDropDown",
  264. "Advanced_HardwareCursorDropDown",
  265. "Advanced_GraphicsAPIDropDown",
  266. -- Audio
  267. "AudioOptionsSoundPanelHardwareDropDown",
  268. "AudioOptionsSoundPanelSoundChannelsDropDown",
  269. "AudioOptionsVoicePanelInputDeviceDropDown",
  270. "AudioOptionsVoicePanelChatModeDropDown",
  271. "AudioOptionsVoicePanelOutputDeviceDropDown",
  272. }
  273. for i = 1, getn(optiondropdown) do
  274. local odropdown = _G[optiondropdown[i]]
  275. if odropdown then
  276. T.SkinDropDownBox(odropdown,165)
  277. DropDownList1:SetTemplate("Transparent")
  278. end
  279. end
  280. local buttons = {
  281. "RecordLoopbackSoundButton",
  282. "PlayLoopbackSoundButton",
  283. "AudioOptionsVoicePanelChatMode1KeyBindingButton",
  284. }
  285. for _, button in pairs(buttons) do
  286. T.SkinButton(_G[button])
  287. end
  288. AudioOptionsVoicePanelChatMode1KeyBindingButton:ClearAllPoints()
  289. AudioOptionsVoicePanelChatMode1KeyBindingButton:Point("CENTER", AudioOptionsVoicePanelBinding, "CENTER", 0, -10)
  290. local slides = {
  291. -------- >> Interface
  292. -- Combat
  293. "InterfaceOptionsCombatPanelSpellAlertOpacitySlider",
  294. "InterfaceOptionsCombatPanelMaxSpellStartRecoveryOffset",
  295. -- Battle.net
  296. "InterfaceOptionsBattlenetPanelToastDurationSlider",
  297. -- Camera
  298. "InterfaceOptionsCameraPanelMaxDistanceSlider",
  299. "InterfaceOptionsCameraPanelFollowSpeedSlider",
  300. -- Mouse
  301. "InterfaceOptionsMousePanelMouseSensitivitySlider",
  302. "InterfaceOptionsMousePanelMouseLookSpeedSlider",
  303. --------- >> Options
  304. -- Advanced
  305. "Advanced_MaxFPSSlider",
  306. "Advanced_MaxFPSBKSlider",
  307. -- Audio
  308. "AudioOptionsSoundPanelSoundQuality",
  309. "AudioOptionsSoundPanelMasterVolume",
  310. "AudioOptionsSoundPanelSoundVolume",
  311. "AudioOptionsSoundPanelMusicVolume",
  312. "AudioOptionsSoundPanelAmbienceVolume",
  313. -- Voice
  314. "AudioOptionsVoicePanelMicrophoneVolume",
  315. "AudioOptionsVoicePanelSpeakerVolume",
  316. "AudioOptionsVoicePanelSoundFade",
  317. "AudioOptionsVoicePanelMusicFade",
  318. "AudioOptionsVoicePanelAmbienceFade",
  319. }
  320. for i = 1, getn(slides) do
  321. if _G[slides[i]] then
  322. if _G[slides[i]] ~= AudioOptionsSoundPanelSoundVolume then
  323. T.SkinSlideBar(_G[slides[i]],8,true)
  324. else
  325. T.SkinSlideBar(_G[slides[i]],8)
  326. end
  327. end
  328. end
  329. -- Graphics_Quality is not like the other sliders
  330. Graphics_Quality:SetScript("OnUpdate", function(self)
  331. T.SkinSlideBar(Graphics_Quality,11)
  332. end)
  333. Graphics_RightQuality:SetAlpha(0) -- Graphics Quality Slide background =O
  334. -- Graphics_Quality Values
  335. Graphics_QualityLow2:Point("BOTTOM",0,-20)
  336. Graphics_QualityFair:Point("BOTTOM",0,-20)
  337. Graphics_RightQualityLabel:Point("TOP",0,16)
  338. Graphics_QualityMed:Point("BOTTOM",0,-20)
  339. Graphics_QualityHigh2:Point("BOTTOM",0,-20)
  340. Graphics_QualityUltra:Point("BOTTOM",0,-20)
  341. end
  342. tinsert(T.SkinFuncs["Tukui"], LoadSkin)