Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TestHUD = {}
- TestHUD.addonName = "TestHUD"
- TestHUD.questTrackerAlpha = 0.5
- TestHUD.subtitlesAlpha = 0.5
- TestHUD.compassAlpha = 0.5
- TestHUD.reticleAlpha = 0.5
- TestHUD.chatAlpha = 0.5
- TestHUD.performanceMetersAlpha = 0.1
- TestHUD.questTrackerScale = 0.8
- TestHUD.subtitlesScale = 0.8
- TestHUD.compassScale = 0.8
- TestHUD.reticleScale = 0.8
- TestHUD.chatScale = 0.75
- TestHUD.performanceMetersScale = 0.8
- function TestHUD.QuestTracker()
- -- Position
- ZO_FocusedQuestTrackerPanel:ClearAnchors()
- ZO_FocusedQuestTrackerPanel:SetAnchor(TOPRIGHT, GuiRoot, TOPRIGHT, -40, 120)
- -- Scale
- ZO_FocusedQuestTrackerPanel:SetScale(TestHUD.questTrackerScale)
- -- Alpha
- ZO_FocusedQuestTrackerPanel:SetAlpha(TestHUD.questTrackerAlpha)
- ZO_FocusedQuestTrackerPanelContainerQuestContainerAssisted:SetAlpha(TestHUD.questTrackerAlpha)
- ZO_FocusedQuestTrackerPanelContainerQuestContainerTrackedHeader1:SetAlpha(TestHUD.questTrackerAlpha)
- -- Remove Hotkey Icon
- ZO_FocusedQuestTrackerPanelContainerQuestContainerAssistedKeyLabel:SetParent(GuiRoot)
- end
- function TestHUD.Subtitles()
- -- Position
- ZO_Subtitles:ClearAnchors()
- ZO_Subtitles:SetAnchor(BOTTOM, GuiRoot, BOTTOM, 0, -200)
- -- Scale
- ZO_Subtitles:SetScale(TestHUD.subtitlesScale)
- -- Alpha
- ZO_Subtitles:SetAlpha(TestHUD.subtitlesAlpha)
- -- Remove Background
- ZO_SubtitlesTextBackground:SetParent(GuiRoot)
- ZO_SubtitlesTextBackgroundLeft:SetParent(GuiRoot)
- ZO_SubtitlesTextBackgroundRight:SetParent(GuiRoot)
- end
- function TestHUD.Compass()
- -- Scale Compass
- ZO_CompassContainer:SetInheritScale(false)
- ZO_CompassContainer:SetInheritAlpha(false)
- ZO_CompassFrame:SetAlpha(TestHUD.compassAlpha)
- ZO_CompassFrame:SetScale(TestHUD.compassScale)
- -- Compass Icons
- ZO_CompassContainer:SetInheritScale(false)
- ZO_CompassContainer:SetInheritAlpha(false)
- ZO_CompassContainer:SetScale(1.1875*TestHUD.compassScale)
- ZO_CompassContainer:SetAlpha(TestHUD.compassAlpha)
- -- Compass Background (Center)
- ZO_CompassFrameCenter:SetAlpha(0.2)
- ZO_CompassFrameCenter:SetDesaturation(1)
- -- Compass Background (Left)
- ZO_CompassFrameLeft:SetAlpha(0.2)
- ZO_CompassFrameLeft:SetDesaturation(1)
- -- Compass Background (Right)
- ZO_CompassFrameRight:SetAlpha(0.2)
- ZO_CompassFrameRight:SetDesaturation(1)
- end
- function TestHUD.Reticle()
- -- Reticle Graphic (White Triangles)
- ZO_ReticleContainerReticle:SetAlpha(TestHUD.reticleAlpha)
- ZO_ReticleContainerReticle:SetScale(TestHUD.reticleScale/2)
- -- Remove the "E" Button Icon
- ZO_ReticleContainerInteractKeybindButton:SetParent(GuiRoot)
- -- Interaction Text Container (Position)
- ZO_ReticleContainerInteract:SetDimensions(0, 0)
- ZO_ReticleContainerInteract:SetResizeToFitDescendents(true)
- ZO_ReticleContainerInteract:ClearAnchors()
- ZO_ReticleContainerInteract:SetAnchor(TOP, GuiRoot, CENTER, 0, 50)
- ZO_ReticleContainerInteract:SetAlpha(TestHUD.reticleAlpha)
- ZO_ReticleContainerInteract:SetScale(TestHUD.reticleScale)
- -- Name of the Item (Container, NPC's Name, etc)
- ZO_ReticleContainerInteractContext:ClearAnchors()
- ZO_ReticleContainerInteractContext:SetAnchor(TOP, ZO_ReticleContainerInteract, TOP)
- ZO_ReticleContainerInteractContext:SetWidth(200)
- ZO_ReticleContainerInteractContext:SetHorizontalAlignment(TEXT_ALIGN_CENTER)
- ZO_ReticleContainerInteractContext:SetScale(TestHUD.reticleScale)
- -- Name of the Action (Talk, Open, etc)
- ZO_ReticleContainerInteractKeybindButtonNameLabel:ClearAnchors()
- ZO_ReticleContainerInteractKeybindButtonNameLabel:SetAnchor(TOP, ZO_ReticleContainerInteractContext, BOTTOM, 0, 5)
- ZO_ReticleContainerInteractKeybindButtonNameLabel:SetWidth(250)
- ZO_ReticleContainerInteractKeybindButtonNameLabel:SetHorizontalAlignment(TEXT_ALIGN_CENTER)
- ZO_ReticleContainerInteractKeybindButtonNameLabel:SetParent(ZO_ReticleContainerInteract)
- ZO_ReticleContainerInteractKeybindButtonNameLabel:SetScale(TestHUD.reticleScale)
- -- Extra Info (Fishing Hole Type, etc)
- ZO_ReticleContainerInteractAdditionalInfo:ClearAnchors()
- ZO_ReticleContainerInteractAdditionalInfo:SetAnchor(TOP, ZO_ReticleContainerInteractKeybindButtonNameLabel, BOTTOM, 0, 5)
- ZO_ReticleContainerInteractAdditionalInfo:SetWidth(250)
- ZO_ReticleContainerInteractAdditionalInfo:SetHorizontalAlignment(TEXT_ALIGN_CENTER)
- ZO_ReticleContainerInteractAdditionalInfo:SetScale(TestHUD.reticleScale)
- end
- function TestHUD.Chat()
- -- Remove the Maximized Grunge Background
- ZO_ChatWindowBg:SetParent(GuiRoot)
- -- Remove the Minimized Grunge Texture
- ZO_ChatWindowMinBarBG:SetParent(GuiRoot)
- -- Set Minimized Size
- ZO_ChatWindowMinBar:SetScale(TestHUD.chatScale)
- ZO_ChatWindowMinBar:SetAlpha(TestHUD.chatAlpha)
- ZO_ChatWindowMinBar:SetAnchor(BOTTOMLEFT, GuiRoot, BOTTOMLEFT, 0, -120)
- end
- function TestHUD.PerformanceMeters()
- -- Size and scale
- ZO_PerformanceMeters:SetScale(TestHUD.performanceMetersScale)
- ZO_PerformanceMeters:SetAlpha(TestHUD.performanceMetersAlpha)
- -- Remove background
- ZO_PerformanceMetersBg:SetParent(GuiRoot)
- end
- function TestHUD.OnLoad(eventCode, addonName)
- if (TestHUD.addonName ~= addonName) then
- return
- end
- zo_callLater(function () TestHUD.QuestTracker() end, 1000)
- zo_callLater(function () TestHUD.Subtitles() end, 1000)
- zo_callLater(function () TestHUD.Compass() end, 1000)
- zo_callLater(function () TestHUD.Reticle() end, 1000)
- zo_callLater(function () TestHUD.Chat() end, 1000)
- zo_callLater(function () TestHUD.PerformanceMeters() end, 1000)
- EVENT_MANAGER:UnregisterForEvent(TestHUD.addonName, EVENT_ADD_ON_LOADED)
- end
- EVENT_MANAGER:RegisterForEvent("TestHUD", EVENT_ADD_ON_LOADED, TestHUD.OnLoad)
- -- Undo rollbacks caused during main menu transitions
- SCENE_MANAGER:GetScene("hud"):RegisterCallback("StateChange", function(oldState, newState)
- if newState == "showing" then
- zo_callLater(function () TestHUD.Compass() end, 250)
- zo_callLater(function () TestHUD.PerformanceMeters() end, 250)
- end
- end)
- -- Undo rollback caused by changing tracked quest
- FOCUSED_QUEST_TRACKER:RegisterCallback("QuestTrackerTrackingStateChanged", function ()
- zo_callLater(function () TestHUD.QuestTracker() end, 0)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement