Script for KG Panel?

Work with other players to create your own special custom interfaces and macros.
Post Reply
User avatar
Fastor
Posts: 4031
Joined: 16 Dec 2012 17:38

Script for KG Panel?

#1 » Post by Fastor » 13 Feb 2016 01:39

Ok here is what l want. l want to have two panels that are at same position but once one is activated, other will deactivated and in reverse. To rotate them l want one small button above it.

l would like switching to be easy as switching default chat window, one click and you are on combat log, another click you are back on chat log.

Now what is script for it? Panel names are 1 and 2. Can make button as panel 3.

User avatar
dunCan.d
Posts: 23
Joined: 27 Jan 2014 13:33

Re: Script for KG Panel?

#2 » Post by dunCan.d » 14 Feb 2016 16:31

"There is no knowledge that is not power"
Mortal Kombat.

User avatar
Fastor
Posts: 4031
Joined: 16 Dec 2012 17:38

Re: Script for KG Panel?

#3 » Post by Fastor » 14 Feb 2016 18:12

Saw first one already but being me with limited knowledge of it, l could not even change to make windows turn on and off.

About second, l think

Code: Select all

if down then return end -- run OnMouseUp only, not OnMouseDown, since kgPanels is a liar
if button == "RightButton" then
self.currentFrame = self.currentFrame - 1
if self.currentFrame < 1 then self.currentFrame = #self.frames end
else
self.currentFrame = self.currentFrame + 1
if self.currentFrame > #self.frames then self.currentFrame = 1 end
end
for i, frame in ipairs(self.frames) do
frame:SetShown(i == self.currentFrame)
end
Is idea but does not seems to work for me.

User avatar
Naxp
Posts: 146
Joined: 04 Aug 2015 17:49

Re: Script for KG Panel?

#4 » Post by Naxp » 15 Feb 2016 21:19

Fastor wrote:

Code: Select all

if down then return end -- run OnMouseUp only, not OnMouseDown, since kgPanels is a liar
if button == "RightButton" then
self.currentFrame = self.currentFrame - 1
if self.currentFrame < 1 then self.currentFrame = #self.frames end
else
self.currentFrame = self.currentFrame + 1
if self.currentFrame > #self.frames then self.currentFrame = 1 end
end
for i, frame in ipairs(self.frames) do
frame:SetShown(i == self.currentFrame)
end
code invalid, feature not scripted properly and dont think its merged with main either ^_^

User avatar
gecko32
Posts: 208
Joined: 05 Sep 2010 02:54

Re: Script for KG Panel?

#5 » Post by gecko32 » 16 Feb 2016 08:13

Non Default Panel
OnLoad

Code: Select all


self:Hide()
Button Panel OnClick Code

Code: Select all


if released and button == "LeftButton" then
local Panel1 = kgPanels:FetchFrame("Panel1")
local Panel2 = kgPanels:FetchFrame("Panel2")
if Panel1:IsVisible() then
Panel1:Hide()
Panel2:Show()
else
Panel2:Hide()
Panel1:Show()
end
end
Layout for example
[hide]

Code: Select all


^1^T^SPanelButton^T^Sbg_orientation^SHORIZONTAL^Sstrata^SBACKGROUND^Sscripts^T^SCLICK^Sif~`released~`and~`button~`==~`"LeftButton"~`then~J~`~`local~`Panel1~`=~`kgPanels:FetchFrame("Panel1")~J~`~`local~`Panel2~`=~`kgPanels:FetchFrame("Panel2")~J~`~`if~`Panel1:IsVisible()~`then~J~`~`~`~`Panel1:Hide()~J~`~`~`~`Panel2:Show()~J~`~`else~J~`~`~`~`Panel2:Hide()~J~`~`~`~`Panel1:Show()~J~`~`end~Jend^SLOAD^S^t^SanchorTo^SCENTER^Sparent^SUIParent^Sabsolute_bg^T^SLLy^N1^SLLx^N0^SLRy^N1^SLRx^N1^SURx^N1^SURy^N0^SULy^N0^SULx^N0^t^SanchorFrom^SCENTER^Shflip^b^Sbg_insets^T^Sb^N4^St^N-4^Sl^N4^Sr^N-4^t^Svflip^b^StileSize^N0^Sbg_texture^SNone^Sanchor^SUIParent^Slevel^N0^Stext^T^Sy^N0^Sfont^SBlizzard^SjustifyH^SCENTER^Sx^N0^Scolor^T^Sa^N1^Sr^N1^Sg^N1^Sb^N1^t^Stext^SPANEL~`BUTTON^SjustifyV^SMIDDLE^Ssize^N18^t^Suse_absolute_bg^b^Sbg_blend^SBLEND^Sy^F8747647090225167^f-45^Sbg_style^SSOLID^Sgradient_color^T^Sa^N1^Sr^N1^Sg^N1^Sb^N1^t^Sborder_color^T^Sa^N1^Sr^N1^Sg^N1^Sb^N1^t^Sborder_texture^SBlizzard~`Tooltip^Sbg_color^T^Sa^N0.6^Sr^N0.3^Sg^N0.3^Sb^N0.3^t^Swidth^F5802870172284685^f-44^Srotation^N0^Sx^F5558787859003587^f-44^Sbg_alpha^N1^Sborder_edgeSize^N16^Sheight^F5010797958444937^f-47^Smouse^B^Scrop^b^Stiling^b^t^SPanel2^T^Sbg_orientation^SHORIZONTAL^Sstrata^SBACKGROUND^Sscripts^T^SLOAD^Sself:Hide()^t^SanchorTo^SCENTER^Sparent^SUIParent^Sabsolute_bg^T^SLLy^N1^SLLx^N0^SLRy^N1^SLRx^N1^SURx^N1^SURy^N0^SULy^N0^SULx^N0^t^SanchorFrom^SCENTER^Shflip^b^Sbg_insets^T^Sb^N4^St^N-4^Sl^N4^Sr^N-4^t^Svflip^b^StileSize^N0^Sbg_texture^SNone^Sanchor^SUIParent^Slevel^N0^Stext^T^Sy^N0^Sfont^SBlizzard^SjustifyH^SCENTER^Sx^N0^Scolor^T^Sa^N1^Sr^F5086418402677266^f-57^Sg^N0^Sb^N1^t^Stext^SPANEL2^SjustifyV^SMIDDLE^Ssize^N30^t^Suse_absolute_bg^b^Sbg_blend^SBLEND^Sy^F6339979687035456^f-47^Sbg_style^SSOLID^Sgradient_color^T^Sa^N1^Sr^N1^Sg^N1^Sb^N1^t^Sborder_color^T^Sa^N1^Sr^N1^Sg^N1^Sb^N1^t^Sborder_texture^SNone^Sbg_color^T^Sa^F5404319767592960^f-53^Sr^N1^Sg^F4733194902491345^f-54^Sb^N0^t^Swidth^F5620703452620182^f-43^Srotation^N0^Sx^F8314220264054692^f-44^Sbg_alpha^N1^Sborder_edgeSize^N16^Sheight^F6579477963191356^f-44^Smouse^b^Scrop^b^Stiling^b^t^SPanel1^T^Sbg_orientation^SHORIZONTAL^Sstrata^SBACKGROUND^Sscripts^T^t^SanchorTo^SCENTER^Sparent^SUIParent^Sabsolute_bg^T^SLLy^N1^SLLx^N0^SLRy^N1^SLRx^N1^SURx^N1^SURy^N0^SULy^N0^SULx^N0^t^SanchorFrom^SCENTER^Shflip^b^Sbg_insets^T^Sb^N4^St^N-4^Sl^N4^Sr^N-4^t^Svflip^b^StileSize^N0^Sbg_texture^SNone^Sanchor^SUIParent^Slevel^N0^Stext^T^Sy^N0^Sfont^SBlizzard^SjustifyH^SCENTER^Sx^N0^Scolor^T^Sa^N1^Sr^N1^Sg^F5015773702640082^f-54^Sb^N0^t^Stext^SPANEL1^SjustifyV^SMIDDLE^Ssize^N30^t^Suse_absolute_bg^b^Sbg_blend^SBLEND^Sy^F6352876475164403^f-47^Sbg_style^SSOLID^Sgradient_color^T^Sa^N1^Sr^N1^Sg^N1^Sb^N1^t^Sborder_color^T^Sa^N1^Sr^N1^Sg^N1^Sb^N1^t^Sborder_texture^SNone^Sbg_color^T^Sa^F5404319767592960^f-53^Sr^N0^Sg^F7912206404164640^f-56^Sb^F7523660553960123^f-53^t^Swidth^F5642759142709678^f-43^Srotation^N0^Sx^F8282529585166378^f-44^Sbg_alpha^N1^Sborder_edgeSize^N16^Sheight^F6567410348139595^f-44^Smouse^b^Scrop^b^Stiling^b^t^t^^
[/hide]

User avatar
Fastor
Posts: 4031
Joined: 16 Dec 2012 17:38

Re: Script for KG Panel?

#6 » Post by Fastor » 16 Feb 2016 08:39

Aww yiss, level 1 passed!

Now to find way to stick Recount on panel 1 and chat on panel 2.

User avatar
Fastor
Posts: 4031
Joined: 16 Dec 2012 17:38

Re: Script for KG Panel?

#7 » Post by Fastor » 16 Feb 2016 09:16

Ok, it seems lm retarded for this.

Gecko halp!

User avatar
gecko32
Posts: 208
Joined: 05 Sep 2010 02:54

Re: Script for KG Panel?

#8 » Post by gecko32 » 16 Feb 2016 18:33

Basic would be add Recount as script dependency for the panel you what recount on. Then move chat & recount to correct positions and lock in place.
Onload Panel 1

Code: Select all

Recount_MainWindow:SetParent(self)
Onload Panel 2

Code: Select all

ChatFrame1:SetParent(self)
self:Hide()

User avatar
Fastor
Posts: 4031
Joined: 16 Dec 2012 17:38

Re: Script for KG Panel?

#9 » Post by Fastor » 16 Feb 2016 19:34

Sumthingwrong.

Ok so for Recount is working,
Image

however problem with chat tab button or how to call it.
Image

Now being that chat is only configurated once, is there an option to remove it? Or some KG script could do that?

User avatar
gecko32
Posts: 208
Joined: 05 Sep 2010 02:54

Re: Script for KG Panel?

#10 » Post by gecko32 » 16 Feb 2016 20:10

Okay new Onload Panel 2

Code: Select all


local _G = _G
for i=1, NUM_CHAT_WINDOWS do
_G["ChatFrame"..i]:SetParent(self)
_G["ChatFrame"..i.."Tab"]:SetParent(self)
end
self:Hide()
New full Layout
[hide]

Code: Select all

^1^T^SPanelButton^T^Sabsolute_bg^T^SLRy^N1^SLRx^N1^SULx^N0^SULy^N0^SURy^N0^SURx^N1^SLLx^N0^SLLy^N1^t^Sstrata^SBACKGROUND^Sbg_insets^T^Sr^N-4^St^N-4^Sl^N4^Sb^N4^t^SanchorTo^SCENTER^Sparent^SUIParent^Sbg_orientation^SHORIZONTAL^SanchorFrom^SCENTER^Shflip^b^Scrop^b^Svflip^b^StileSize^N0^Sbg_texture^SNone^Sanchor^SUIParent^Slevel^N0^Sborder_texture^SBlizzard~`Tooltip^Suse_absolute_bg^b^Sbg_blend^SBLEND^Srotation^N0^Sbg_style^SSOLID^Sgradient_color^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Sborder_color^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Stext^T^Sy^N0^Sfont^SBlizzard^SjustifyH^SCENTER^Sx^N0^Scolor^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Stext^SPANEL~`BUTTON^SjustifyV^SMIDDLE^Ssize^N18^t^Sx^F5558787859003587^f-44^Swidth^F5802870172284685^f-44^Sy^F8747647090225167^f-45^Sbg_color^T^Sa^N0.6^Sb^N0.3^Sg^N0.3^Sr^N0.3^t^Sbg_alpha^N1^Sborder_edgeSize^N16^Sheight^F5010797958444937^f-47^Smouse^B^Sscripts^T^SLOAD^S^SCLICK^Sif~`released~`and~`button~`==~`"LeftButton"~`then~J~`~`local~`Panel1~`=~`kgPanels:FetchFrame("Panel1")~J~`~`local~`Panel2~`=~`kgPanels:FetchFrame("Panel2")~J~`~`if~`Panel1:IsVisible()~`then~J~`~`~`~`Panel1:Hide()~J~`~`~`~`Panel2:Show()~J~`~`else~J~`~`~`~`Panel2:Hide()~J~`~`~`~`Panel1:Show()~J~`~`end~Jend^t^Stiling^b^t^SPanel1^T^Sabsolute_bg^T^SLRy^N1^SLRx^N1^SULx^N0^SULy^N0^SURy^N0^SURx^N1^SLLx^N0^SLLy^N1^t^Sstrata^SBACKGROUND^Sbg_insets^T^Sr^N-4^St^N-4^Sl^N4^Sb^N4^t^SanchorTo^SCENTER^Sparent^SUIParent^Sbg_orientation^SHORIZONTAL^SanchorFrom^SCENTER^Shflip^b^Scrop^b^Svflip^b^StileSize^N0^Sbg_texture^SSolid^Sanchor^SUIParent^Slevel^N0^Sborder_texture^SNone^Suse_absolute_bg^b^Sbg_blend^SBLEND^Srotation^N0^Sbg_style^SSOLID^Sgradient_color^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Sborder_color^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Stext^T^Sy^N0^Sfont^SBlizzard^SjustifyH^SCENTER^Sx^N0^Scolor^T^Sa^N1^Sb^N0^Sg^F5015773702640082^f-54^Sr^N1^t^Stext^S^SjustifyV^SMIDDLE^Ssize^N30^t^Sx^S355.12081939402^Swidth^S404.02423014604^Sy^S114.92263536245^Sbg_color^T^Sa^F5404319767592960^f-53^Sb^N0^Sg^N0^Sr^N0^t^Sbg_alpha^N0^Sborder_edgeSize^N11^Sheight^S234.25125594875^Smouse^b^Sscripts^T^SLOAD^SRecount_MainWindow:SetParent(self)^t^Stiling^b^t^SPanel2^T^Sabsolute_bg^T^SLRy^N1^SLRx^N1^SULx^N0^SULy^N0^SURy^N0^SURx^N1^SLLx^N0^SLLy^N1^t^Sstrata^SBACKGROUND^Sbg_insets^T^Sr^N-4^St^N-4^Sl^N4^Sb^N4^t^SanchorTo^SCENTER^Sparent^SUIParent^Sbg_orientation^SHORIZONTAL^SanchorFrom^SCENTER^Shflip^b^Scrop^b^Svflip^b^StileSize^N0^Sbg_texture^SNone^Sanchor^SUIParent^Slevel^N0^Sborder_texture^SNone^Suse_absolute_bg^b^Sbg_blend^SBLEND^Srotation^N0^Sbg_style^SNONE^Sgradient_color^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Sborder_color^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Stext^T^Sy^N0^Sfont^SBlizzard^SjustifyH^SCENTER^Sx^N0^Scolor^T^Sa^N1^Sb^N1^Sg^N0^Sr^F5086418402677266^f-57^t^Stext^S^SjustifyV^SMIDDLE^Ssize^N30^t^Sx^F6247351523025039^f-44^Swidth^F7107669423181064^f-44^Sy^F8086961528043446^f-46^Sbg_color^T^Sa^F5404319767592960^f-53^Sb^F4521260802379793^f-55^Sg^F4662550202454159^f-55^Sr^F4521260802379793^f-55^t^Sbg_alpha^N1^Sborder_edgeSize^N16^Sheight^F8241983351577023^f-45^Smouse^b^Sscripts^T^SLOAD^Slocal~`_G~`=~`_G~Jfor~`i=1,~`NUM_CHAT_WINDOWS~`do~J~`~`_G["ChatFrame"..i]:SetParent(self)~J~`~`_G["ChatFrame"..i.."Tab"]:SetParent(self)~Jend~Jself:Hide()^t^Stiling^b^t^t^^
[/hide]

User avatar
Fastor
Posts: 4031
Joined: 16 Dec 2012 17:38

Re: Script for KG Panel?

#11 » Post by Fastor » 17 Feb 2016 11:25

Ok, l just switched i=1 to i=4 and it works !

I hereby promote Gecko32 to Gecko64!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest