Thread Tools Display Modes
11-27-22, 03:36 AM   #1
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
Remove/Hide clock under minimap

Hi all,

Is there someone that knows how to remove or hide the clock of the minimap ?



I have succeded in removing other elements I wanted to hide in this way but I am unable to do the same with the clock :

Lua Code:
  1. local function HideIt(frame)
  2.     frame:HookScript("OnShow", frame.Hide)
  3.     frame:SetAlpha(0)
  4.     frame:Hide()
  5. end
  6. ... blabla ...
  7. if cfg["cleanminimap"] == true then
  8.     -- zone text
  9.     HideIt(MinimapCluster.ZoneTextButton)
  10.     MinimapCluster.BorderTop:SetAlpha(0)
  11.     -- calendar
  12.     HideIt(GameTimeFrame)
  13.     -- tracking
  14.     HideIt(MinimapCluster.Tracking)
  15.     -- zooms
  16.     HideIt(Minimap.ZoomIn)
  17.     HideIt(Minimap.ZoomOut)
  18. end

Thanks.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote
12-06-22, 08:25 AM   #2
Uitat
A Chromatic Dragonspawn
 
Uitat's Avatar
AddOn Author - Click to view addons
Join Date: May 2011
Posts: 162
Originally Posted by gmarco View Post
Hi all,

Is there someone that knows how to remove or hide the clock of the minimap ?



I have succeded in removing other elements I wanted to hide in this way but I am unable to do the same with the clock :

Lua Code:
  1. local function HideIt(frame)
  2.     frame:HookScript("OnShow", frame.Hide)
  3.     frame:SetAlpha(0)
  4.     frame:Hide()
  5. end
  6. ... blabla ...
  7. if cfg["cleanminimap"] == true then
  8.     -- zone text
  9.     HideIt(MinimapCluster.ZoneTextButton)
  10.     MinimapCluster.BorderTop:SetAlpha(0)
  11.     -- calendar
  12.     HideIt(GameTimeFrame)
  13.     -- tracking
  14.     HideIt(MinimapCluster.Tracking)
  15.     -- zooms
  16.     HideIt(Minimap.ZoomIn)
  17.     HideIt(Minimap.ZoomOut)
  18. end

Thanks.
i believe that is TimeManagerClockTicker or TimeManagerClockButton
__________________
  Reply With Quote
12-07-22, 05:04 PM   #3
watchout
A Fallenroot Satyr
Join Date: Mar 2008
Posts: 20
It should be the "GameTimeFrame", just do
Lua Code:
  1. GameTimeFrame:Hide()

If that doesn't do it, you can also hide TimeManagerClockButton, but you may need to "force" it hidden, Blizzard likes to show them again

I'm doing that here https://github.com/watchout-mods/Ana...Clock.lua#L210
  Reply With Quote
12-08-22, 05:14 AM   #4
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
Hi, thanks for your reply.

But I got an error even if I do a trivial copy paste of your relevant part of code:

Lua Code:
  1. local function framehider(self)
  2.     self:Hide();
  3. end
  4.  
  5. ... other code ...
  6.  
  7. TimeManagerClockButton:HookScript("OnShow", framehider);
  8. TimeManagerClockButton:Hide();

But I always finish to get the error:
Lua Code:
  1. attempt to index global 'TimeManagerClockButton' (a nil value)

even if it works nicely if I load your addon ... so I surely miss something important here

Thanks so much for patience and help.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote
12-08-22, 08:01 AM   #5
watchout
A Fallenroot Satyr
Join Date: Mar 2008
Posts: 20
Maybe you're running it too early?

You can see (https://github.com/watchout-mods/Ana...Clock.lua#L193) I'm deliberately not doing anything on-init
  Reply With Quote
12-08-22, 11:18 AM   #6
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
Unless an alarm has been set, the game doesn't load the Blizzard_TimeManager addon until the PLAYER_LOGIN event.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
12-09-22, 02:01 AM   #7
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
Thanks all for tips and suggestions.

I was finally able to make it works in this way:

Lua Code:
  1. local function HideIt(frame)
  2.     frame:HookScript("OnShow", frame.Hide)
  3.     frame:SetAlpha(0)
  4.     frame:Hide()
  5. end
  6.  
  7. ... other code ...
  8.  
  9. if cfg["cleanminimap"] == true then
  10.  
  11.     -- load the stuff
  12.     LoadAddOn("Blizzard_TimeManager")
  13.     -- zone text
  14.     HideIt(MinimapZoneText)
  15.     HideIt(MinimapCluster.ZoneTextButton)
  16.     HideIt(MinimapCluster.BorderTop)
  17.     -- calendar
  18.     HideIt(GameTimeFrame)
  19.     -- tracking
  20.     HideIt(MinimapCluster.Tracking)
  21.     -- zooms
  22.     HideIt(Minimap.ZoomIn)
  23.     HideIt(Minimap.ZoomOut)
  24.     -- clock
  25.     HideIt(GameTimeFrame)
  26.     HideIt(TimeManagerClockButton)
  27.  
  28. end

I was not able to make it happens during PLAYER_LOGIN event but it was surely something I wrong in the event triggering.

Btw I think AnalogueClock is a very cute addons so'll use it instead

Thanks so muche to everyone... it is really appreciated.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote
12-09-22, 02:17 PM   #8
watchout
A Fallenroot Satyr
Join Date: Mar 2008
Posts: 20
You mean the LoadAddon line?
This is interesting, because I'm not doing that in analogueclock either, only on right-click, now I wonder why it works for me...

Btw I think AnalogueClock is a very cute addons so'll use it instead
Aww thanks! The new face required all of my artistic talent to match the new Dragonflight UI 😂
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Remove/Hide clock under minimap


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off