Making dps/threat meter disappear

Making dps/threat meter disappear

by jakeadams » Thu Nov 05, 2015 8:40 am

Hello Guys!

I need some help with to things. I have gotten help with something similar, so I hope someone can help me again!

First, I want to make my dps meter and threat meter to appear when I join a group/raid and disappear when I leave. It it not a function in any of them and I have tried to script it, but I simply don't have the expertise. I thought that I might be able to use the GetNumPartyMembers to check if I am in a party and then hide/show it. Sadly I haven't got it working. Also It would be nice if it would start out with hiding and first appearing when I join a group. I use PlayerMeter for dps and ktm for threat. Any ideas?

Second, I would love to hide my chat with a macr/script, but the only one I have found makes it reappear each time I enter a new subzone and therefore it doesn't really work. I would like to hear if there is a better way?

I hope to get some help and maybe learn something ;)
User avatar
jakeadams
Sergeant
Sergeant
 

Re: Making dps/threat meter disappear

by LYQ » Thu Nov 05, 2015 9:05 am

I've had such features for swstats / ktm in the ViroUI beta I've released couple years ago. If you want to spend time on digging through my code from then, someone else(not me) reuploaded that beta version somewhere. I'm sure it's linked in http://www.wow-one.com/forum/topic/4053 ... roui-1121/ somewhere in the mid-last pages.

regarding hiding chat, I guess you're hiding it with /run ChatFrame1:Hide() or something similar, you would need need to make something to trigger the event which notifes entering a subzone to hide it again
something like
/run if HideChat==nil then CreateFrame("Frame","HideChat") HideChat:SetScript('OnEvent', function() ChatFrame1:Hide() end) HideChat:RegisterEvent("ZONE_CHANGED") ChatFrame1:Hide() else HideChat = nil ChatFrame1:Show() end


^ should work by triggering event ZONE_CHANGED, I don't know if it's enough, you may need another event or simply a different one
on first use it should hide the default chatframe and register ZONE_CHANGED to hide it if this event fires, on second use it should show the frame again and disable the function
LYQ / Virose
Talentsaver (viewtopic.php?f=63&t=15429) - Totemtimers Enhanced (viewtopic.php?f=63&t=24422)
NostalriusAcceptTrade (viewtopic.php?f=63&t=31729)
User avatar
LYQ
Sergeant Major
Sergeant Major
 

Re: Making dps/threat meter disappear

by jakeadams » Thu Nov 05, 2015 10:41 am

Hey LYQ!

Thanks for responding (and thanks again for the help last time!).

Found the download version for your UI , verson 0.1.3. I tried using your version of sw_stats and KTM, but the hiding and showing doesn't work. I tried looking through the LUA-files, but it's hard when you don't know wich one :(. Can you perhabs specify which I should look in?

About the chat: Yeah thanks, that worked. Although it reappears everytime I loot something... Didn't think about that.
User avatar
jakeadams
Sergeant
Sergeant
 

Re: Making dps/threat meter disappear

by LYQ » Thu Nov 05, 2015 10:56 am

everytime you loot well that's weird, before we do any other adjustment to the macro we should dig what is triggering the visibility all the time.

I mean ofc we could simple write a loop to do so all the time in the background but I technically want to use loops only if I don't have anything better, so looking into blizzards FrameXML would make sense

but tbh you can try
/run if HideChat==nil then CreateFrame("Frame","HideChat") HideChat:SetScript('OnUpdate, function() if ChatFrame1:IsVisible() then ChatFrame1:Hide() end end) else HideChat = nil ChatFrame1:Show() end

^ test that, especially I'm interested if it works if you use the 2nd time so that it stops hiding, and if it stops hiding and you use it a 3rd time if it works also.
this is the easier version with a loop :D, the not so professional one


yeah I can relate to that :D but tbh I don't have my old code too, would have to download it too and check for it.
and yeah you're right, I've made the adjustment to hiding/showing them in the !ViroUI AddOn and not in swstats /ktm directly. If I don't forget it by this evening or if I'm too bored before that I can take a look where I made the code

edit: could you maybe link me the download of the 0.1.3 version you found? :D just spend 5mins scattering through all thes pages but didn't find it.
- just if you still have it in your history or something, else I will take a look again this evening
LYQ / Virose
Talentsaver (viewtopic.php?f=63&t=15429) - Totemtimers Enhanced (viewtopic.php?f=63&t=24422)
NostalriusAcceptTrade (viewtopic.php?f=63&t=31729)
User avatar
LYQ
Sergeant Major
Sergeant Major
 

Re: Making dps/threat meter disappear

by jakeadams » Thu Nov 05, 2015 2:32 pm

I haven't been able to recreate the chatbar popping up after I loot, so I quess that was my mistake. Anyway, it works just fine now with the first macro. Sorry for confusing you and wasting you're time.

Alright, I will see if I can find it in the VIroUI addon instead. It doesn't look like there's something in the ViroUI but I might have missed something.

I found it on page 21.

http://www.mediafire.com/download/ohpod ... n_Reupload).rar
User avatar
jakeadams
Sergeant
Sergeant
 

Re: Making dps/threat meter disappear

by LYQ » Thu Nov 05, 2015 2:41 pm

oh thanks, I was looking around page 10-15 :D
LYQ / Virose
Talentsaver (viewtopic.php?f=63&t=15429) - Totemtimers Enhanced (viewtopic.php?f=63&t=24422)
NostalriusAcceptTrade (viewtopic.php?f=63&t=31729)
User avatar
LYQ
Sergeant Major
Sergeant Major
 

Re: Making dps/threat meter disappear

by jakeadams » Thu Nov 05, 2015 2:43 pm

Uh, think I've found it!

Code: Select all
function VUI_BasicUpdates()
   if (GetNumRaidMembers()> 1) then if AddonActive("GridEnhanced") then if GridLayout ~= nil then GridLayout:Grid_UpdateSort() end end end
   if ((GetNumPartyMembers() < 1) and (GetNumRaidMembers() < 1)) or VUI_IsInBG() then
      if AddonActive("KLHThreatmeter") then if KLHTM_Frame ~= nil then if KLHTM_Frame:IsVisible() then KLHTM_Frame:Hide() end end end
      if AddonActive("SW_Stats") then if SW_BarFrame1 ~= nil then if SW_BarFrame1:IsVisible() then SW_BarFrame1:Hide() end end end
   end
   if (GetNumPartyMembers() > 1) and not VUI_IsInBG() or (GetNumRaidMembers() > 1) and not VUI_IsInBG() then if AddonActive("KLHThreatmeter") then if not KLHTM_Frame:IsVisible() then KLHTM_Frame:Show() end end end
end

function VUI_KTM_AUTOHIDE()   -- todo
   if vuiktmhidden == nil then vuiktmhidden = false end
   if not vuiktmhidden then
      if VUI_IsInBG() then
         KLHTM_Frame:Hide()
         vuiktmhidden = true
      end
   elseif vuiktmhidden then
      if ((GetNumPartyMembers() > 1) or (GetNumRaidMembers() > 1)) then
         if not VUI_IsInBG() then
            KLHTM_Frame:Show()
            vuiktmhidden = false
         end
      end
   end
end


But it's made around your addon, so I can't use it right away i quess.
User avatar
jakeadams
Sergeant
Sergeant
 

Re: Making dps/threat meter disappear

by LYQ » Thu Nov 05, 2015 2:57 pm

jakeadams wrote:Uh, think I've found it!

Code: Select all
function VUI_BasicUpdates()
   if (GetNumRaidMembers()> 1) then if AddonActive("GridEnhanced") then if GridLayout ~= nil then GridLayout:Grid_UpdateSort() end end end
   if ((GetNumPartyMembers() < 1) and (GetNumRaidMembers() < 1)) or VUI_IsInBG() then
      if AddonActive("KLHThreatmeter") then if KLHTM_Frame ~= nil then if KLHTM_Frame:IsVisible() then KLHTM_Frame:Hide() end end end
      if AddonActive("SW_Stats") then if SW_BarFrame1 ~= nil then if SW_BarFrame1:IsVisible() then SW_BarFrame1:Hide() end end end
   end
   if (GetNumPartyMembers() > 1) and not VUI_IsInBG() or (GetNumRaidMembers() > 1) and not VUI_IsInBG() then if AddonActive("KLHThreatmeter") then if not KLHTM_Frame:IsVisible() then KLHTM_Frame:Show() end end end
end

function VUI_KTM_AUTOHIDE()   -- todo
   if vuiktmhidden == nil then vuiktmhidden = false end
   if not vuiktmhidden then
      if VUI_IsInBG() then
         KLHTM_Frame:Hide()
         vuiktmhidden = true
      end
   elseif vuiktmhidden then
      if ((GetNumPartyMembers() > 1) or (GetNumRaidMembers() > 1)) then
         if not VUI_IsInBG() then
            KLHTM_Frame:Show()
            vuiktmhidden = false
         end
      end
   end
end


But it's made around your addon, so I can't use it right away i quess.


yeah I just found it as well in this version, I think there was even a newer version I released but like said I don't have it myself (==> meaning, from my first look at this code, I'm not sure if the logic I made back then was perfect^^)
not that I refer to that function in the code
Code: Select all
function VUI_IsInBG()
   local IsInBG = false;
   for i=1,80 do
      local bgname = GetBattlefieldScore(i)   
      if bgname then
         IsInBG = true
      end
   end
   return IsInBG
end


but then again, I know for a fact that this version is not perfect and that I created a perfect one in my current WiP version of the UI
which looks like
Code: Select all
function IsInBG()
    local inBG = false
    if GetMapInfo() == VUI_WARSONG or
        GetMapInfo() == VUI_ARATHI or
        GetMapInfo() == VUI_ALTERAC then
        inBG = true
    else    -- in case locales are missing, this second method only works after the scoreboard was called at least once by the player
        for i=1,80 do
            local bgname = GetBattlefieldScore(i)   
            if bgname then
                inBG = true
            end
        end
    end
    return inBG
end

where I used three locales which are for the english client:
VUI_WARSONG = "WarsongGulch"
VUI_ARATHI = "ArathiBasin"
VUI_ALTERAC = "AlteracValley"

=============

but yeah, To make a perfect logic to hide/show KTM&SWS in all situations it would take more spaces than just a macro.
Maybe someone else wants to use my ressources to do the job.

If not, I will surely rework this to make such functionalities for my new UI version, shouldn't take a great effort but I'm kinda busy lately.
LYQ / Virose
Talentsaver (viewtopic.php?f=63&t=15429) - Totemtimers Enhanced (viewtopic.php?f=63&t=24422)
NostalriusAcceptTrade (viewtopic.php?f=63&t=31729)
User avatar
LYQ
Sergeant Major
Sergeant Major
 

Re: Making dps/threat meter disappear

by jakeadams » Thu Nov 05, 2015 3:08 pm

Alright thanks for the help mate! Maybe I'll find someone else to make it work. Right now I just have macros to hide/ show them manually and I can live with that.

If not, I will wait till you maybe release something!
User avatar
jakeadams
Sergeant
Sergeant
 


Return to Addons & macros