Thread Tools Display Modes
10-20-10, 01:23 AM   #1
Taigen
A Defias Bandit
 
Taigen's Avatar
Join Date: Oct 2009
Posts: 3
Viewport textures and oUF_Arp

Hi all. I used to be a really big fan of oUF_viv, particularly the old version r5.2. I know a bit about LUA, enough to tweak things a bit, but not enough to make major changes.

Here's my problem: I like oUF_Arp as it is close to old versions of oUF_viv and it is a suitable replacement. HOWEVER.. I really liked the viewport panels (not necessarily the viewport itself, but the artwork panels) of that version of oUF_viv and would like to find a way to integrate them back into my UI now.. but I can't figure out how. I was thinking I could add a bit of the old code to oUF_Arp but it just made everything go nuts. Does anyone have any suggestions?

Oh, and I tried to figure out what media from oUF_viv it was and deposited those in oUF_Arp's media folder thinking that would help as well and maybe it did, but the code didn't work so I had to remove it.

Last edited by Taigen : 10-20-10 at 01:33 AM.
  Reply With Quote
10-20-10, 03:54 PM   #2
Tobbe8716
An Aku'mai Servant
 
Tobbe8716's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 36
kgPanels or LitePanels? You should probly be able to make something like that with one of them. And the panels texture was made up of dO.tga and dQ.tga

Code:
local BottomPanelTex = mediaFolder.."dO"
local TopPanelTex = mediaFolder.."dO"

local BottomPanelOvTex = mediaFolder.."dQ"		
local TopPanelOvTex = mediaFolder.."dQ"
__________________
Arp UI oUF_Arp

Last edited by Tobbe8716 : 10-20-10 at 04:06 PM. Reason: Add stuff
  Reply With Quote
10-21-10, 09:57 AM   #3
Tobbe8716
An Aku'mai Servant
 
Tobbe8716's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 36
Btw how shall the veiwport look? just black? Ive copy pasted the old code with some adjustments and if it should look like this it still works.

__________________
Arp UI oUF_Arp
  Reply With Quote
10-23-10, 06:39 AM   #4
Tobbe8716
An Aku'mai Servant
 
Tobbe8716's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 36
So after actually look at the code I saw something wasnt quite right lolz
So this is how it should look or? Otherwis I do not know but this became rather nice.


Heres the code anyways.

in arp.lua
Code:
-- background frames
if useviewport == true then
	local bottompan = CreateFrame("Frame",nil,UIParent)
	bottompan:SetFrameStrata("BACKGROUND")
	bottompan:SetFrameLevel(3)	
	bottompan:SetWidth(1366)
	bottompan:SetHeight(viewportTextureBottomValue)
	bottompan:SetPoint("BOTTOMLEFT", 0, 0)
	bottompan:Show()
	bottompan:SetScale(panelscale)
	local bottompan2 = bottompan:CreateTexture(nil,"BACKGROUND")
	bottompan2:SetTexture(cfg.BottomPanelTex)
	bottompan2:SetAllPoints(bottompan)	
	bottompan2:SetVertexColor(cfg.maincolor[1], cfg.maincolor[2], cfg.maincolor[3]) 	
	bottompan2:SetAlpha(1)
	
	bottompan.overlay = bottompan:CreateTexture(nil, "OVERLAY")
	bottompan.overlay:SetTexture(cfg.BottomPanelOvTex)
	bottompan.overlay:SetWidth(1366)
	bottompan.overlay:SetHeight(1.5)		
	bottompan.overlay:SetPoint("BOTTOM", bottompan, "TOP", 0, 0)	
	bottompan.overlay:SetVertexColor(cfg.trdcolor[1], cfg.trdcolor[2], cfg.trdcolor[3])
	bottompan.overlay:SetAlpha(0.5)
	
	local BPanel = CreateFrame("Frame",nil,UIParent)
	BPanel:SetFrameStrata("BACKGROUND")
	BPanel:SetFrameLevel(3)	
	BPanel:SetWidth(1366)
	BPanel:SetHeight(14)
	BPanel:SetPoint("BOTTOM", bottompan, "TOP", 0, 0)
	BPanel:Show()
	BPanel:SetScale(panelscale)
	local BPanel2 = BPanel:CreateTexture(nil,"BACKGROUND")
	BPanel2:SetTexture(cfg.BottomPanelTex)
	BPanel2:SetAllPoints(BPanel)	
	BPanel2:SetVertexColor(cfg.sndcolor[1],cfg.sndcolor[2],cfg.sndcolor[3])	
	BPanel2:SetAlpha(0.3)	
	
	BPanel.overlay = BPanel:CreateTexture(nil, "OVERLAY")
	BPanel.overlay:SetTexture(cfg.BottomPanelOvTex)
	BPanel.overlay:SetWidth(1366)
	BPanel.overlay:SetHeight(1)		
	BPanel.overlay:SetPoint("BOTTOM", BPanel, "TOP", 0, 0)	
	BPanel.overlay:SetVertexColor(cfg.trdcolor[1], cfg.trdcolor[2], cfg.trdcolor[3])
	BPanel.overlay:SetAlpha(0.5)	
	
	local toppan = CreateFrame("Frame",nil,UIParent)
	toppan:SetFrameStrata("BACKGROUND")
	toppan:SetFrameLevel(3)		
	toppan:SetWidth(1366)
	toppan:SetHeight(viewportTextureTopValue)
	toppan:SetPoint("TOPLEFT", 0, 0)
	toppan:Show()
	toppan:SetScale(panelscale)
	local toppan2 = toppan:CreateTexture(nil,"BACKGROUND")
	toppan2:SetTexture(cfg.TopPanelTex)
	toppan2:SetAllPoints(toppan)	
	toppan2:SetVertexColor(cfg.maincolor[1], cfg.maincolor[2], cfg.maincolor[3]) 	
	toppan2:SetAlpha(1)	

	toppan.overlay = toppan:CreateTexture(nil, "OVERLAY");
	toppan.overlay:SetTexture(cfg.TopPanelOvTex);
	toppan.overlay:SetWidth(1366)
	toppan.overlay:SetHeight(1.5)	
	toppan.overlay:SetPoint("TOP", toppan, "BOTTOM", 0, 0)
	toppan.overlay:SetVertexColor(cfg.trdcolor[1], cfg.trdcolor[2], cfg.trdcolor[3])
	toppan.overlay:SetAlpha(0.5)
	
	local TPanel = CreateFrame("Frame",nil,UIParent)
	TPanel:SetFrameStrata("BACKGROUND")
	TPanel:SetFrameLevel(3)	
	TPanel:SetWidth(1366)
	TPanel:SetHeight(14)
	TPanel:SetPoint("TOP", toppan, "BOTTOM", 0, 0)
	TPanel:Show()
	TPanel:SetScale(panelscale)
	local TPanel2 = TPanel:CreateTexture(nil,"BACKGROUND")
	TPanel2:SetTexture(cfg.BottomPanelTex)
	TPanel2:SetAllPoints(TPanel)	
	TPanel2:SetVertexColor(cfg.sndcolor[1],cfg.sndcolor[2],cfg.sndcolor[3])
	TPanel2:SetAlpha(0.3)	
	
	TPanel.overlay = TPanel:CreateTexture(nil, "OVERLAY")
	TPanel.overlay:SetTexture(cfg.BottomPanelOvTex)
	TPanel.overlay:SetWidth(1366)
	TPanel.overlay:SetHeight(1)		
	TPanel.overlay:SetPoint("TOP", TPanel, "BOTTOM", 0, 0)	
	TPanel.overlay:SetVertexColor(cfg.trdcolor[1], cfg.trdcolor[2], cfg.trdcolor[3])
	TPanel.overlay:SetAlpha(0.5)		
	
-- modify the worldframe (create a viewport)
local top = viewportTopValue
local bottom = viewportBOTTOMValue
local left = 0
local right = 0
local currentYResolution = 1050

local scaling = 768 / 1050
	
ViewportOverlay = WorldFrame:CreateTexture(nil, "BACKGROUND")
ViewportOverlay:SetTexture(0, 0, 0, 1)
ViewportOverlay:SetPoint("TOPLEFT", UIParent, "TOPLEFT", -1, 1)
ViewportOverlay:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", 1, -1)

WorldFrame:SetPoint("TOPLEFT", (left * scaling), -(top * scaling))
WorldFrame:SetPoint("BOTTOMRIGHT", -(right * scaling), (bottom * scaling))
WorldFrame:SetPoint("TOPLEFT", 0, -(top * 0.75))
WorldFrame:SetPoint("BOTTOMRIGHT", 0, (bottom * 0.75))
end
in config
Code:
	useviewport = true	-- show/hide viewport

-- set the scale of the texture panel overlaying the viewport - 1.0 = 1680x1050 @ UI scale of 1.0 (aka no UI scale)
-- this is for people using an UI scale and/or having a different resolution than 1680x1050 to make viewport textures fit
    panelscale = 1.5

-- set viewport height value for top and bottom
	viewportTopValue = 44		
	viewportBOTTOMValue = 44 	

-- set texture height value for top and bottom panel
	viewportTextureTopValue = 36		
	viewportTextureBottomValue = 36

-- change viewport textures
	cfg.BottomPanelTex = mediaFolder.."dO"
	cfg.TopPanelTex = mediaFolder.."dO"

	cfg.BottomPanelOvTex = mediaFolder.."dQ"		
	cfg.TopPanelOvTex = mediaFolder.."dQ"
NOTE: Do not forget to put dO.tga and dQ.tga in the oUF_Arp/media folder.

NOTE: You must restart wow when implementing new texture (.tga), or atleast i did

NOTE: Change trdcolor if you are still using my colors to get it to look like my pic above

Code:
cfg.trdcolor = {90/255, 110/255, 120/255}
to

Code:
cfg.trdcolor = {220/255, 220/255, 220/255}
NOTE: I scaled it up a bit due to i cba to adjust the height and width its at 1.5 now
__________________
Arp UI oUF_Arp

Last edited by Tobbe8716 : 10-23-10 at 09:29 AM. Reason: Included code
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Viewport textures and oUF_Arp


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