-- 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)


-- This is Right Main Frame Chunk
local frame = CreateFrame("frame", "RightChatBaseFrame", UIParent)
RightChatBaseFrame:SetWidth(resolWidth*.34)
RightChatBaseFrame:SetHeight(resolHeight*.33)
RightChatBaseFrame:SetPoint("BOTTOMRIGHT", UIParent,"BOTTOMRIGHT", 6, -6)
RightChatBaseFrame:SetFrameStrata("BACKGROUND")
RightChatBaseFrame:SetFrameLevel(1)
RightChatBaseFrame:SetAlpha(1)
RightChatBaseFrame:SetBackdrop(backdrop)
--set chat Frame to proper position
local DummyFrame = CreateFrame("Frame")
DummyFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
DummyFrame:SetScript("OnEvent", function(self, event, ...)
	ChatFrame1:ClearAllPoints() 
	ChatFrame2:ClearAllPoints()
	ChatFrame1:SetPoint("BOTTOMLEFT", LeftChatBaseFrame, "BOTTOMLEFT", 8, 0)
	ChatFrame1:SetPoint("TOPRIGHT", LeftChatBaseFrame, "BOTTOMLEFT", (resolWidth*.334), (resolHeight*.310))
	ChatFrame2:SetPoint("BOTTOMLEFT", RightChatBaseFrame, "BOTTOMLEFT", 8, 0)
	ChatFrame2:SetPoint("TOPRIGHT", RightChatBaseFrame, "BOTTOMLEFT", (resolWidth*.334), (resolHeight*.161))
	DummyFrame:UnregisterEvent("PLAYER_ENTERING_WORLD")
end)
--Right SubFrame a.k.a. XP frame
local frame = CreateFrame("frame", "XPFrame", RightChatBaseFrame)
	XPFrame:SetWidth(resolWidth*.34)
	XPFrame:SetHeight(resolHeight*.04)
	XPFrame:SetPoint("TOPRIGHT", RightChatBaseFrame,"TOPRIGHT", 0, 0)
	XPFrame:SetFrameStrata("BACKGROUND")
	XPFrame:SetFrameLevel(2)
	XPFrame:SetAlpha(1)
	XPFrame:SetBackdrop(backdropClear)
-- This is the Center Main Frame Chunk
local frame = CreateFrame("frame", "CenterBase", UIParent)
CenterBase:SetWidth(resolWidth*1.007)
CenterBase:SetHeight(resolHeight*.21)
CenterBase:SetPoint("BOTTOM", UIParent,"BOTTOM", 0, -6)
CenterBase:SetFrameStrata("BACKGROUND")
CenterBase:SetFrameLevel(2)
CenterBase:SetBackdrop(backdrop)
-- This is map frame chunk
local frame = CreateFrame("frame", "CenterMapBase", UIParent)
CenterMapBase:SetWidth(resolHeight*.21)
CenterMapBase:SetHeight(resolHeight*.21)
CenterMapBase:SetPoint("BOTTOM", UIParent,"BOTTOM", 0, -6)
CenterMapBase:SetFrameStrata("BACKGROUND")
CenterMapBase:SetFrameLevel(3)
CenterMapBase:SetBackdrop(backdropClear)
-- this is top frame chunk
local frame = CreateFrame("frame", "TopFrame", UIParent)
TopFrame:SetWidth(resolWidth*1.675)
TopFrame:SetHeight(resolHeight*.045)
TopFrame:SetPoint("TOPLEFT", UIParent,"TOPLEFT", -6, 6)
TopFrame:SetFrameStrata("BACKGROUND")
TopFrame:SetFrameLevel(1)
TopFrame:SetAlpha(1)
TopFrame:SetBackdrop(backdrop)

--[[
--Button False Embed--
local frame = CreateFrame("Button", "ExpandLeft", LeftChatBaseFrame, "UIPanelButtonTemplate")
frame:SetHeight(21)
frame:SetWidth(21)
frame:SetText("R")
frame:ClearAllPoints()
frame:SetPoint("TOPRIGHT", -4, -4)
frame:SetFrameStrata("LOW")
ExpandLeft:SetScript("OnClick", ReloadUI)
--Button False Embed--
local frame = CreateFrame("Button", "ExpandRight", RightChatBaseFrame, "UIPanelButtonTemplate")
frame:SetHeight(21)
frame:SetWidth(22)
frame:SetFrameStrata("HIGH")
frame:SetText("B")
frame:ClearAllPoints()
frame:SetPoint("BOTTOMRIGHT", -4, 4)
ExpandRight:SetScript("OnClick", ToggleAllBags)

]]--