Details | Compare with Previous | View Log
Line No. | Rev | Author | Line |
---|---|---|---|
1 | 2 | SilentShanx-14440 | UltimateUIHider = {} |
2 | SilentShanx-14440 | UltimateUIHider.name = "UltimateUIHider" |
|
3 | 31 | SilentShanx-14440 | UltimateUIHider.version = 1.69 |
4 | 2 | SilentShanx-14440 | |
5 | SilentShanx-14440 | UltimateUIHider.default = { |
|
6 | SilentShanx-14440 | isInterfaceEventHandler = 0, |
|
7 | SilentShanx-14440 | UltimateUIHider_isUIHidden = false, |
|
8 | 16 | SilentShanx-14440 | |
9 | 26 | SilentShanx-14440 | defaultInteractableGlow = GetSetting(SETTING_TYPE_IN_WORLD, IN_WORLD_UI_SETTING_INTERACTABLE_GLOW_ENABLED), |
10 | 2 | SilentShanx-14440 | defaultTargetGlow = GetSetting(SETTING_TYPE_IN_WORLD, IN_WORLD_UI_SETTING_TARGET_GLOW_ENABLED), |
11 | 16 | SilentShanx-14440 | defaultQuestBestowerIndicator = GetSetting(SETTING_TYPE_UI, UI_SETTING_SHOW_QUEST_BESTOWER_INDICATORS), |
12 | 2 | SilentShanx-14440 | defaultGroupIndicators = GetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_GROUP_INDICATORS), |
13 | SilentShanx-14440 | defaultFollowIndicator = GetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_FOLLOWER_INDICATORS), |
|
14 | SilentShanx-14440 | defaultAllianceIndicators = GetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_ALLIANCE_INDICATORS), |
|
15 | SilentShanx-14440 | defaultResurrectIndicator = GetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_RESURRECT_INDICATORS), |
|
16 | SilentShanx-14440 | defaultAllHealthBars = GetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_ALL_HEALTHBARS), |
|
17 | 22 | SilentShanx-14440 | defaultAllNamePlates = GetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_ALL_NAMEPLATES), |
18 | 29 | SilentShanx-14440 | defaultChatBubbles = GetSetting(SETTING_TYPE_CHAT_BUBBLE, CHAT_BUBBLE_SETTING_ENABLED), |
19 | SilentShanx-14440 | defaultChatBubbleSpeed = GetSetting(SETTING_TYPE_CHAT_BUBBLE, CHAT_BUBBLE_SETTING_SPEED_MODIFIER) |
|
20 | 2 | SilentShanx-14440 | } |
21 | SilentShanx-14440 | ||
22 | 28 | SilentShanx-14440 | function UltimateUIHider.setSettingsFromFile() |
23 | 25 | SilentShanx-14440 | SetSetting(SETTING_TYPE_IN_WORLD, IN_WORLD_UI_SETTING_INTERACTABLE_GLOW_ENABLED, UltimateUIHider.savedVariables.defaultInteractableGlow) |
24 | SilentShanx-14440 | SetSetting(SETTING_TYPE_IN_WORLD, IN_WORLD_UI_SETTING_TARGET_GLOW_ENABLED, UltimateUIHider.savedVariables.defaultTargetGlow) |
|
25 | SilentShanx-14440 | SetSetting(SETTING_TYPE_UI, UI_SETTING_SHOW_QUEST_BESTOWER_INDICATORS, UltimateUIHider.savedVariables.defaultQuestBestowerIndicator) |
|
26 | SilentShanx-14440 | SetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_GROUP_INDICATORS, UltimateUIHider.savedVariables.defaultGroupIndicators) |
|
27 | SilentShanx-14440 | SetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_FOLLOWER_INDICATORS, UltimateUIHider.savedVariables.defaultFollowIndicator) |
|
28 | SilentShanx-14440 | SetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_ALLIANCE_INDICATORS, UltimateUIHider.savedVariables.defaultAllianceIndicators) |
|
29 | SilentShanx-14440 | SetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_RESURRECT_INDICATORS, UltimateUIHider.savedVariables.defaultResurrectIndicator) |
|
30 | SilentShanx-14440 | SetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_ALL_HEALTHBARS, UltimateUIHider.savedVariables.defaultAllHealthBars) |
|
31 | SilentShanx-14440 | SetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_ALL_NAMEPLATES, UltimateUIHider.savedVariables.defaultAllNamePlates) |
|
32 | SilentShanx-14440 | SetSetting(SETTING_TYPE_CHAT_BUBBLE, CHAT_BUBBLE_SETTING_ENABLED, UltimateUIHider.savedVariables.defaultChatBubbles) |
|
33 | 29 | SilentShanx-14440 | SetSetting(SETTING_TYPE_CHAT_BUBBLE, CHAT_BUBBLE_SETTING_SPEED_MODIFIER, UltimateUIHider.savedVariables.defaultChatBubbleSpeed) |
34 | 2 | SilentShanx-14440 | end |
35 | SilentShanx-14440 | ||
36 | 22 | SilentShanx-14440 | --Saves current settings to file. |
37 | 28 | SilentShanx-14440 | function UltimateUIHider.saveSettingsToFile() |
38 | 16 | SilentShanx-14440 | if UltimateUIHider.savedVariables.UltimateUIHider_isUIHidden == false then |
39 | 25 | SilentShanx-14440 | UltimateUIHider.savedVariables.defaultInteractableGlow = GetSetting(SETTING_TYPE_IN_WORLD, IN_WORLD_UI_SETTING_INTERACTABLE_GLOW_ENABLED) |
40 | SilentShanx-14440 | UltimateUIHider.savedVariables.defaultTargetGlow = GetSetting(SETTING_TYPE_IN_WORLD, IN_WORLD_UI_SETTING_TARGET_GLOW_ENABLED) |
|
41 | SilentShanx-14440 | UltimateUIHider.savedVariables.defaultQuestBestowerIndicator = GetSetting(SETTING_TYPE_UI, UI_SETTING_SHOW_QUEST_BESTOWER_INDICATORS) |
|
42 | SilentShanx-14440 | UltimateUIHider.savedVariables.defaultGroupIndicators = GetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_GROUP_INDICATORS) |
|
43 | SilentShanx-14440 | UltimateUIHider.savedVariables.defaultFollowIndicator = GetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_FOLLOWER_INDICATORS) |
|
44 | SilentShanx-14440 | UltimateUIHider.savedVariables.defaultAllianceIndicators = GetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_ALLIANCE_INDICATORS) |
|
45 | SilentShanx-14440 | UltimateUIHider.savedVariables.defaultResurrectIndicator = GetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_RESURRECT_INDICATORS) |
|
46 | SilentShanx-14440 | UltimateUIHider.savedVariables.defaultAllHealthBars = GetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_ALL_HEALTHBARS) |
|
47 | SilentShanx-14440 | UltimateUIHider.savedVariables.defaultAllNamePlates = GetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_ALL_NAMEPLATES) |
|
48 | SilentShanx-14440 | UltimateUIHider.savedVariables.defaultChatBubbles = GetSetting(SETTING_TYPE_CHAT_BUBBLE, CHAT_BUBBLE_SETTING_ENABLED) |
|
49 | 29 | SilentShanx-14440 | UltimateUIHider.savedVariables.defaultChatBubbleSpeed = GetSetting(SETTING_TYPE_CHAT_BUBBLE, CHAT_BUBBLE_SETTING_SPEED_MODIFIER) |
50 | 16 | SilentShanx-14440 | end |
51 | 2 | SilentShanx-14440 | end |
52 | SilentShanx-14440 | ||
53 | 22 | SilentShanx-14440 | --Event Handler |
54 | 28 | SilentShanx-14440 | function UltimateUIHider.interfaceEventHandlerToggle() |
55 | 16 | SilentShanx-14440 | if UltimateUIHider.savedVariables.isInterfaceEventHandler == 1 then |
56 | 25 | SilentShanx-14440 | EVENT_MANAGER:UnregisterForEvent(UltimateUIHider.name, EVENT_INTERFACE_SETTING_CHANGED) |
57 | 16 | SilentShanx-14440 | else |
58 | 25 | SilentShanx-14440 | EVENT_MANAGER:RegisterForEvent(UltimateUIHider.name, EVENT_INTERFACE_SETTING_CHANGED, UltimateUIHider.saveSettingsToFile) |
59 | 16 | SilentShanx-14440 | end |
60 | 2 | SilentShanx-14440 | end |
61 | SilentShanx-14440 | ||
62 | 22 | SilentShanx-14440 | --Turns off UI |
63 | SilentShanx-14440 | --Sets all settings to zero. |
|
64 | 28 | SilentShanx-14440 | function UltimateUIHider.turnOffUI() |
65 | 2 | SilentShanx-14440 | SetSetting(SETTING_TYPE_IN_WORLD, IN_WORLD_UI_SETTING_INTERACTABLE_GLOW_ENABLED, 0) |
66 | SilentShanx-14440 | SetSetting(SETTING_TYPE_IN_WORLD, IN_WORLD_UI_SETTING_TARGET_GLOW_ENABLED, 0) |
|
67 | SilentShanx-14440 | SetSetting(SETTING_TYPE_UI, UI_SETTING_SHOW_QUEST_BESTOWER_INDICATORS, 0) |
|
68 | SilentShanx-14440 | SetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_GROUP_INDICATORS, 0) |
|
69 | SilentShanx-14440 | SetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_FOLLOWER_INDICATORS, 0) |
|
70 | SilentShanx-14440 | SetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_ALLIANCE_INDICATORS, 0) |
|
71 | SilentShanx-14440 | SetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_RESURRECT_INDICATORS, 0) |
|
72 | SilentShanx-14440 | SetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_ALL_HEALTHBARS, 0) |
|
73 | SilentShanx-14440 | SetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_ALL_NAMEPLATES, 0) |
|
74 | 22 | SilentShanx-14440 | SetSetting(SETTING_TYPE_CHAT_BUBBLE, CHAT_BUBBLE_SETTING_ENABLED, 0) |
75 | 30 | SilentShanx-14440 | SetSetting(SETTING_TYPE_CHAT_BUBBLE, CHAT_BUBBLE_SETTING_SPEED_MODIFIER, 1) |
76 | 2 | SilentShanx-14440 | end |
77 | SilentShanx-14440 | ||
78 | SilentShanx-14440 | --Toggle UI on an off. |
|
79 | SilentShanx-14440 | --Toggle 1: Turns everything off. |
|
80 | SilentShanx-14440 | --Toggle 2: Sets user preferred settings and toggles the default ui back on. |
|
81 | 28 | SilentShanx-14440 | function UltimateUIHider.UltimateUIHiderToggler() |
82 | 25 | SilentShanx-14440 | if not UltimateUIHider.savedVariables.UltimateUIHider_isUIHidden then |
83 | SilentShanx-14440 | UltimateUIHider.interfaceEventHandlerToggle() |
|
84 | SilentShanx-14440 | UltimateUIHider.turnOffUI() |
|
85 | SilentShanx-14440 | ToggleShowIngameGui() |
|
86 | SilentShanx-14440 | SetGameCameraUIMode(false) |
|
87 | 27 | SilentShanx-14440 | SetFloatingMarkerGlobalAlpha(0) |
88 | SilentShanx-14440 | UltimateUIHider.savedVariables.UltimateUIHider_isUIHidden = true |
|
89 | 16 | SilentShanx-14440 | else |
90 | 25 | SilentShanx-14440 | UltimateUIHider.setSettingsFromFile() |
91 | SilentShanx-14440 | ToggleShowIngameGui() |
|
92 | SilentShanx-14440 | SetGameCameraUIMode(true) |
|
93 | SilentShanx-14440 | SetFloatingMarkerGlobalAlpha(100) |
|
94 | SilentShanx-14440 | UltimateUIHider.savedVariables.UltimateUIHider_isUIHidden = false |
|
95 | SilentShanx-14440 | UltimateUIHider.interfaceEventHandlerToggle() |
|
96 | 16 | SilentShanx-14440 | end |
97 | 2 | SilentShanx-14440 | end |
98 | SilentShanx-14440 | ||
99 | SilentShanx-14440 | --Initialize settings/get default settings |
|
100 | SilentShanx-14440 | function UltimateUIHider:Initialize() |
|
101 | 16 | SilentShanx-14440 | --Our saved variables file. Needs to be in the initializer. |
102 | 25 | SilentShanx-14440 | UltimateUIHider.savedVariables = ZO_SavedVars:New("UltimateUIHiderSavedVariables", UltimateUIHider.version, nil, UltimateUIHider.default) |
103 | 16 | SilentShanx-14440 | |
104 | SilentShanx-14440 | --Handles logic to store user preferred settings. (prevents errors if logged out while UI is hidden) |
|
105 | 25 | SilentShanx-14440 | if UltimateUIHider.savedVariables.UltimateUIHider_isUIHidden == true then |
106 | SilentShanx-14440 | UltimateUIHider.setSettingsFromFile() |
|
107 | SilentShanx-14440 | UltimateUIHider.savedVariables.UltimateUIHider_isUIHidden = false |
|
108 | 16 | SilentShanx-14440 | else |
109 | 25 | SilentShanx-14440 | UltimateUIHider.saveSettingsToFile() |
110 | SilentShanx-14440 | UltimateUIHider.savedVariables.UltimateUIHider_isUIHidden = false |
|
111 | 16 | SilentShanx-14440 | end |
112 | 24 | SilentShanx-14440 | --turn on the event listener for on interface change |
113 | 25 | SilentShanx-14440 | UltimateUIHider.savedVariables.isInterfaceEventHandler = 0 |
114 | SilentShanx-14440 | UltimateUIHider.interfaceEventHandlerToggle() |
|
115 | SilentShanx-14440 | EVENT_MANAGER:UnregisterForEvent(UltimateUIHider.name, EVENT_ADD_ON_LOADED) |
|
116 | 2 | SilentShanx-14440 | end |
117 | SilentShanx-14440 | ||
118 | SilentShanx-14440 | --Function to call the initializer when this specific addon is loaded. |
|
119 | 28 | SilentShanx-14440 | function UltimateUIHider.OnAddOnLoaded(event, addonName) |
120 | 25 | SilentShanx-14440 | if addonName == UltimateUIHider.name then |
121 | 16 | SilentShanx-14440 | UltimateUIHider:Initialize() |
122 | SilentShanx-14440 | end |
|
123 | 2 | SilentShanx-14440 | end |
124 | SilentShanx-14440 | ||
125 | SilentShanx-14440 | --Events |
|
126 | SilentShanx-14440 | EVENT_MANAGER:RegisterForEvent(UltimateUIHider.name, EVENT_ADD_ON_LOADED, UltimateUIHider.OnAddOnLoaded) |
|
127 | SilentShanx-14440 | ||
128 | SilentShanx-14440 | --Slash commands |
|
129 | SilentShanx-14440 | SLASH_COMMANDS["/hideui"] = UltimateUIHider.UltimateUIHiderToggler |