Thread: tiny issue
View Single Post
03-13-10, 02:03 AM   #20
menfbeast
A Murloc Raider
Join Date: Mar 2010
Posts: 4
Frame VdAc1 is screwing around....

Code:
if not nUI_InfoPanels then nUI_InfoPanels = {}; end

local CreateFrame = CreateFrame;
local MouseIsOver = MouseIsOver;

nUI_INFOMODE_VUHDO  = 10;
nUI_INFOPANEL_VUHDO = "nUI_InfoPanel_VuhDo";

nUI_L[nUI_INFOPANEL_VUHDO]	      		= "Info Panel: VuhDo Mode";
nUI_L[nUI_INFOPANEL_VUHDO.."Label"]		= "VuhDo";


local CreateFrame = CreateFrame;
local GetTime     = GetTime;

-------------------------------------------------------------------------------
-- default configuration for the VuhDo info panel

nUI_InfoPanels[nUI_INFOPANEL_VUHDO] =
{	
	enabled   = true,
	desc      = nUI_L[nUI_INFOPANEL_VUHDO],			-- player friendly name/description of the panel
	label     = nUI_L[nUI_INFOPANEL_VUHDO.."Label"],	-- label to use on the panel selection button face
	rotation  = nUI_INFOMODE_VUHDO,					-- index or position this panel appears on/in when clicking the selector button
	full_size = true;								-- this plugin requires the entire info panel port without the button bag
	
	options  =
	{
		enabled  = true,
	},
};

-------------------------------------------------------------------------------
-- master frame for the plugin

local plugin    = CreateFrame( "Frame", nUI_INFOPANEL_VUHDO, nUI_Dashboard.Anchor );
plugin.active   = true;

local function onVuhDoEvent()
	
	if event == "VARIABLES_LOADED" then
		
		if not IsAddOnLoaded( "VuhDo" ) then 
			LoadAddOn( "VuhDo" );
		end

		plugin.active = IsAddOnLoaded( "VuhDo" );

	end	
	
end

plugin:SetScript( "OnEvent", onVuhDoEvent );
plugin:RegisterEvent( "VARIABLES_LOADED" );

-------------------------------------------------------------------------------

plugin.initPanel = function( container, options )

	plugin.container = container;
	plugin.options   = options;

	if options and options.enabled then
			
		plugin.setEnabled( true );
		
	end
end

-------------------------------------------------------------------------------

plugin.sizeChanged = function( scale, height, width )
	
	local options  = plugin.options;
	local V_Frame   = plugin.container;
	
	plugin.scale = scale;

	nUI_Movers:lockFrame( V_Frame, false, nil );
	
	VUHDO_CONFIG["SHOW_PANELS"] = false;

	V_Frame:SetWidth( width + 10); 
	V_Frame:SetHeight( height + 10 ); 

	VUHDO_CONFIG["SHOW_PANELS"] = true;
	
	nUI_Movers:lockFrame( V_Frame, true, nil );
		
end	

-------------------------------------------------------------------------------

plugin.setEnabled = function( enabled )

	if plugin.enabled ~= enabled then
		
		plugin.enabled = enabled;
		
		if not enabled then

			local V_Frame = VuhDo;
			
			if V_Frame.saved_parent then

				nUI_Movers:lockFrame( V_Frame, false, nil );
				
				V_Frame:SetParent( V_Frame.saved_parent );
				V_Frame:SetBackdropBorderColor( V_Frame.border_color );
				V_Frame:SetBackdropColor( V_Frame.backdrop_color );

				VUHDO_CONFIG["SHOW_PANELS"] = false;
				
			end
		
		else

			local V_Frame = VdAc1;
			
			plugin.VuhDo_Frame = V_Frame;
			
			if not V_Frame.saved_parent then
				V_Frame.saved_parent   = V_Frame:GetParent();
				V_Frame.border_color   = V_Frame:GetBackdropBorderColor();
				V_Frame.backdrop_color = V_Frame:GetBackdropColor();
			end
			
			V_Frame:SetParent( plugin.container );
			V_Frame:SetPoint( "TOPLEFT", plugin.container, "TOPLEFT", 0, 0 );
			V_Frame:SetPoint( "BOTTOMRIGHT", plugin.container, "BOTTOMRIGHT", 0, 0 );
			V_Frame:SetFrameStrata( plugin.container:GetFrameStrata() );
			V_Frame:SetFrameLevel( plugin.container:GetFrameLevel()+1 );
			V_Frame:SetBackdropBorderColor( 0, 0, 0, 1 );
			V_Frame:SetBackdropColor( 0, 0, 0, 0 );

			VUHDO_CONFIG["SHOW_PANELS"] = true;
			nUI_Movers:lockFrame( V_Frame, true, nil );
			
		end				
	end
	---DEFAULT_CHAT_FRAME:AddMessage("VuhDo = "..VuhDo:GetParent());
--	TitanReloadUI["VuhDo"] = HB_Frame:GetParent();
--	TitanReloadUI["VuhDo"] = G_Frame:GetParent();
end

-------------------------------------------------------------------------------

plugin.setSelected = function( selected )

	if selected ~= plugin.selected then

		plugin.selected = selected;
		
		if selected then
			
			
		else
			
			
		end
	end
end
----> local V_Frame = VdAc1;

It is in the plugin code from VuhDo, (didn't disable that1 :S)

I posted the code also and from what I see it makes a frame that is bugging around.

Maybe you can see what is wrong in the code?

Ty for the quick response. (actualy deleted my reply on this 1 because the issue is slight different than this original post, so that is why I made a new thread)

Last edited by menfbeast : 03-13-10 at 02:22 AM.