View Single Post
08-07-13, 12:33 AM   #51
Akatosh
A Black Drake
AddOn Compiler - Click to view compilations
Join Date: Jun 2013
Posts: 84
Originally Posted by Fizzlemizz View Post
So that the colour changes to default immediately when a button is "unclicked" (self.clicked = false) you might want to make OnClick
Code:
if pressed then
    return
end

local _, Class = UnitClass("player")
local Color = RAID_CLASS_COLORS[Class]
if not self.clicked then
    self.clicked = true
    
    ChatFrame1:Show()
    ChatFrame2:Hide()
    ChatFrame3:Hide()
    
    self.text:SetTextColor(1, 1, 1)
    
    local tab2 = kgPanels:FetchFrame("PanelLog")
    local tab3 = kgPanels:FetchFrame("PanelTrash")
    
    tab2.text:SetTextColor(Color.r,Color.g,Color.b)
    tab2.clicked = false
    tab3.text:SetTextColor(Color.r,Color.g,Color.b)
    tab3.clicked = false
else
    self.clicked = false
    self:SetTextColor(Color.r,Color.g,Color.b)
end
Also I'm unsure what you want to do about ChatFrame Hide/Show when buttons are "unclicked".

With the code presented here it is possiible to have one button "clicked" and two buttons "unclicked" or none of the buttons "clicked":

General Log Trash
or
General Log Trash
or
General Log Trash
or
General Log Trash
I Explain.

At inicial the text is class colored.

General Log Trash


1 -When I OnEnter, the text comes white. (for expample I put the cursor over the panel general)

1 -General Log Trash

2 -When I OnLeave, the text comes class colored. (for example I leave the panel general and I put the cursor in another place of the screen out of the panels of tabs).

2 -General Log Trash

3 -But If I click the panel, the text hold the white color, and dont change at mouseleave. (for example I clicked the general panel, and I leave the cursor in another place of the screen out of the panel of tabs).

3 -General Log Trash

If I OnEnter on "Log" or "Trash" panel, (when "general" is clicked), but dont click they, OnEnter and Onleave work as the 2 first points), for example general is clicked and at this moment I mouseover the panel "Log".

3 -General LogTrash

3 -General Log Trash (And now I mouseleave).

4 -When I click another panel the Last clicked panel take class colored color again.

4 -General Log Trash (Inicial state).

4 -General Log Trash (Inicial state) (Mouseover over "Log").

4 -General Log Trash (log at this moment its clicked).


I want exactly the some efects like the standart tabs of the basic chat of wow.

I dont know how can I explain It better, in general term I want a panels of 3 buttons with identical efects of basic wow chat.

Thanks!!.

PD: I hate sleep (is a loss of time, how many things I can do In 5 or 6 ours...), but I need it again... and one more time a long lua text night, can be a perfect tittle for a film to sleep.

I try to find that post Phanx, thanks, but in a little while, now I have to rest.

Last edited by Akatosh : 08-07-13 at 12:44 AM.
  Reply With Quote