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