Thread Tools Display Modes
06-15-14, 11:16 AM   #1
Uitat
A Chromatic Dragonspawn
 
Uitat's Avatar
AddOn Author - Click to view addons
Join Date: May 2011
Posts: 162
BNToastFrame

ok so here it is, in my UI i am placing my unit frames however where i have the player frame the Battle.net toast frame just loves to pop up durring battle covering up part of my player frame and part of my pet frame

ive tried this, to no avail.

Code:
-- BNToastFrame:ClearAllPoints
BNToastFrame:SetPoint("TOPRIGHT", LeftChatBaseFrame, "TOPRIGHT", -7,-25)
-- Location Test for Toast Frame
-- This just shows it on reload and is temporary until finalization
 BNToastFrame:Show(true)
the problem here is it does exactly what i want it to do
...
however

when anyone actualy logs in or out by via battle.net, it pops up in its original place
  Reply With Quote
06-15-14, 11:44 AM   #2
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Yeah, it's gonna keep resetting the anchors. Here's what I done to make sure it "stays":
Code:
hooksecurefunc("BNToastFrame_UpdateAnchor", function()
	BNToastFrame:ClearAllPoints()
	BNToastFrame:SetPoint("BOTTOMRIGHT", ChatFrame1, "TOPRIGHT", 0, 2)
end)
__________________
Grab your sword and fight the Horde!
  Reply With Quote
06-15-14, 12:24 PM   #3
Uitat
A Chromatic Dragonspawn
 
Uitat's Avatar
AddOn Author - Click to view addons
Join Date: May 2011
Posts: 162
Originally Posted by Lombra View Post
Yeah, it's gonna keep resetting the anchors. Here's what I done to make sure it "stays":
Code:
hooksecurefunc("BNToastFrame_UpdateAnchor", function()
	BNToastFrame:ClearAllPoints()
	BNToastFrame:SetPoint("BOTTOMRIGHT", ChatFrame1, "TOPRIGHT", 0, 2)
end)
ok i tried this, doesnt seem to work properly, hell i aint got enough frineds to keep testing it to see if its placed right anyway haha
here's the complete code considering this frame if anyone can help

Code:
-- welcome to Project Deranjata Artwork, Visual Style Portion of Project Deranjata
local aspect = CreateFrame("frame", nil, UIParent)
aspect:RegisterEvent("PLAYER_ENTERING_WORLD")
aspect:SetScript("OnEvent", function(self, event)
	UIParent:SetScale(0.6)	-- you can change the scale here but you will break the entire add-on
	aspect:UnregisterAllEvents()
end)
local resolHeight = GetScreenHeight()
local resolWidth = GetScreenWidth()
local aspectRatio = (resolWidth/resolHeight)
print(format("Your aspect ratio is %.2f.", aspectRatio))
print ("Your Resolution Scale has been changed to 0.6")
print ("Welcome to Project Deranjata, Version 0.0.2.3a, Your input is Needed,") 
print ("Please be sure to visit us on www.wowinterface.com . all input is welcomed,") 
print ("Next stage is BuffBars. Have fun and !!!Good Luck!!!")
-- This is the Backdrop Variable
local backdrop = {
	bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background",
	edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border",
	tile = true,
	tileSize = 32,
	edgeSize = 20,
	insets = {
		left = 4,
		right = 4,
		top = 4,
		bottom = 4,
	}
}
local backdropClear = {
	edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border",
	tile = true,
	tileSize = 32,
	edgeSize = 20,
	insets = {
		left = 4,
		right = 4,
		top = 4,
		bottom = 4,
	}
}
-- This is Left Main Frame Chunk
local frame = CreateFrame("frame", "LeftChatBaseFrame", UIParent)
LeftChatBaseFrame:SetWidth(resolWidth*.34)
LeftChatBaseFrame:SetHeight(resolHeight*.33)
LeftChatBaseFrame:SetPoint("BOTTOMLEFT", UIParent,"BOTTOMLEFT", -6, -6)
LeftChatBaseFrame:SetFrameStrata("BACKGROUND")
LeftChatBaseFrame:SetFrameLevel(1)
LeftChatBaseFrame:SetAlpha(1)
LeftChatBaseFrame:SetBackdrop(backdrop)

hooksecurefunc("BNToastFrame_UpdateAnchor", function()
	BNToastFrame:ClearAllPoints()
	BNToastFrame:SetPoint("TOPRIGHT", LeftChatBaseFrame, "TOPRIGHT", -7, -35)
end)
not sure what to do, in theory this should be working perfectly

"post note"
the toast frame should end up appearing inside LeftChatBaseFrame
  Reply With Quote
07-11-14, 06:01 AM   #4
Aanson
A Flamescale Wyrmkin
Join Date: Aug 2009
Posts: 124
Hey,

I'm surprised that Lombra's suggestion isn't working for you.

You could try dictating the anchor points whenever the frame shows:

Lua Code:
  1. BNToastFrame:HookScript("OnShow", function(self)
  2.     self:ClearAllPoints();
  3.     self:SetPoint("TOPRIGHT", LeftChatBaseFrame, "TOPRIGHT", -7, -35);
  4. end);

On a side note after looking at your code. I know it's tempting to change something like reducing scale with an addon, and I appreciate that you've commented on the fact that increasing the scale will break your addon. Remember though that some people have over 100 addons installed at any one time. They'll likely not take kindly to a change in scale destroying the setup of all their other addons!
__________________
__________________
  Reply With Quote
07-24-14, 04:31 AM   #5
Uitat
A Chromatic Dragonspawn
 
Uitat's Avatar
AddOn Author - Click to view addons
Join Date: May 2011
Posts: 162
Originally Posted by Aanson View Post
Hey,

I'm surprised that Lombra's suggestion isn't working for you.

You could try dictating the anchor points whenever the frame shows:

Lua Code:
  1. BNToastFrame:HookScript("OnShow", function(self)
  2.     self:ClearAllPoints();
  3.     self:SetPoint("TOPRIGHT", LeftChatBaseFrame, "TOPRIGHT", -7, -35);
  4. end);

On a side note after looking at your code. I know it's tempting to change something like reducing scale with an addon, and I appreciate that you've commented on the fact that increasing the scale will break your addon. Remember though that some people have over 100 addons installed at any one time. They'll likely not take kindly to a change in scale destroying the setup of all their other addons!
eventually this addon will incorporate near 50 addons itself. so in effect, many addons wont be needed. almost like tukUI and such other suites
__________________
  Reply With Quote
07-24-14, 02:34 PM   #6
Uitat
A Chromatic Dragonspawn
 
Uitat's Avatar
AddOn Author - Click to view addons
Join Date: May 2011
Posts: 162
Originally Posted by Aanson View Post
Hey,

I'm surprised that Lombra's suggestion isn't working for you.

You could try dictating the anchor points whenever the frame shows:

Lua Code:
  1. BNToastFrame:HookScript("OnShow", function(self)
  2.     self:ClearAllPoints();
  3.     self:SetPoint("TOPRIGHT", LeftChatBaseFrame, "TOPRIGHT", -7, -35);
  4. end);

On a side note after looking at your code. I know it's tempting to change something like reducing scale with an addon, and I appreciate that you've commented on the fact that increasing the scale will break your addon. Remember though that some people have over 100 addons installed at any one time. They'll likely not take kindly to a change in scale destroying the setup of all their other addons!
great this worked like a charm man thank you!!
__________________
  Reply With Quote
07-24-14, 02:46 PM   #7
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by Aanson View Post
Hey,

I'm surprised that Lombra's suggestion isn't working for you.

You could try dictating the anchor points whenever the frame shows:

Lua Code:
  1. BNToastFrame:HookScript("OnShow", function(self)
  2.     self:ClearAllPoints();
  3.     self:SetPoint("TOPRIGHT", LeftChatBaseFrame, "TOPRIGHT", -7, -35);
  4. end);

On a side note after looking at your code. I know it's tempting to change something like reducing scale with an addon, and I appreciate that you've commented on the fact that increasing the scale will break your addon. Remember though that some people have over 100 addons installed at any one time. They'll likely not take kindly to a change in scale destroying the setup of all their other addons!
If you anchor everything to top/bottom/left/right of the UIParent, then changing the UIScale should not be a problem, since thoose points won't change.
  Reply With Quote
07-24-14, 04:38 PM   #8
Uitat
A Chromatic Dragonspawn
 
Uitat's Avatar
AddOn Author - Click to view addons
Join Date: May 2011
Posts: 162
Originally Posted by Resike View Post
If you anchor everything to top/bottom/left/right of the UIParent, then changing the UIScale should not be a problem, since thoose points won't change.
this frame it is tied to is scaled to the UIParent, and therefore by parenting it to leftChatBaseFrame it will always be to the inside right corner of the frame no mater what resolution someone is running
__________________
  Reply With Quote
07-24-14, 11:18 PM   #9
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Uitat View Post
eventually this addon will incorporate near 50 addons itself. so in effect, many addons wont be needed. almost like tukUI and such other suites
People still use other addons with TukUI and other "all in one" suites. No matter how bloated your suite becomes, it will never provide every feature that every user wants.

Also, players with poor eyesight need to increase the UI scale so that text is readable. If you forcibly decrease the scale of the entire UI simply because you're too lazy to position your frames correctly, then such users cannot use your UI, because they will not be able to read anything.

It's just not that hard to place and size frames correctly. See LibWindow-1.1 for an example of proper resolution-independent frame placement and scaling that doesn't destroy the user's existing UI and screw over visually impaired users.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » BNToastFrame

Thread Tools
Display Modes

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