SMART_SETSCALE_ENABLE = true;
function SmartUnitFrame_SetScaleLoadUp()
	if (not SUF_SetScale) or (SUF_SetScale == nil) then
		SUF_SetScale = {player=100,pet=100,target=100,focus=100,party=100,partypet=100,tot=100};
	end
	SmartUnitFrame_SetScaleChange(1);
	SmartUnitFrame_SetScaleChange(2);
	SmartUnitFrame_SetScaleChange(3);
	if SMART_FOCUS_ENABLE then
		SmartUnitFrame_SetScaleChange(4);
	end
	SmartUnitFrame_SetScaleChange(5);
	SmartUnitFrame_SetScaleChange(6);
	SmartUnitFrame_SetScaleChange(7);
	if SCONFIG_ENABLE then
		CreateFrame("BUTTON","SmartSetScaleButton",SmartConfigUIFrame,"SmartConfigUIButtonTemplate");
		SmartSetScaleButton:SetPoint("TOPLEFT",SmartConfigUIFrame,"TOPLEFT",15,-15);
		SmartSetScaleButton:SetWidth(150);
		SmartSetScaleButton:SetScript("OnClick",function() SmartUnitFrame_SetScaleOpen() end);
		SmartSetScaleButton.tooltip = "유닛프레임 크기설정창 열기/닫기";
		SmartSetScaleButtonText:SetText("유닛프레임 크기설정");
	end
end

function SmartUnitFrame_SetScaleOpen()
	if SmartSetScaleFrame:IsShown() then
		SmartSetScaleFrame:Hide();
	else
		SmartSetScaleFrame:ClearAllPoints();
		SmartSetScaleFrame:SetPoint("CENTER",UIParent,"CENTER",0,0);
		SmartSetScaleFrame:Show();
	end
end

function SmartUnitFrame_SetScaleChange(id)
	if not id then
	 return;
	end
	if id == 1 then
		if not SUF_SetScale.player then
			SUF_SetScale.player = 100;
		end
		PlayerFrame:SetScale(SUF_SetScale.player/100);
		PetFrame:SetScale(SUF_SetScale.player/100);
	elseif id == 2 then
		if not SUF_SetScale.pet then
			SUF_SetScale.pet = 100;
		end
		PetFrame:SetScale(SUF_SetScale.pet/100);
	elseif id == 3 then
		if not SUF_SetScale.target then
			SUF_SetScale.target = 100;
		end
		TargetFrame:SetScale(SUF_SetScale.target/100);
	elseif id == 4 then
		if not SUF_SetScale.focus then
			SUF_SetScale.focus = 100;
		end
		if SMART_FOCUS_ENABLE then
			SmartFocusFrame:SetScale(SUF_SetScale.focus/100);
		end
	elseif id == 5 then
		if not SUF_SetScale.party then
			SUF_SetScale.party = 100;
		end
		for i=1, 4 do
			getglobal("PartyMemberFrame"..i):SetScale(SUF_SetScale.party/100);
		end	
	elseif id == 6 then
		if not SUF_SetScale.partypet then
			SUF_SetScale.partypet = 100;
		end
		for i=1, 4 do
			getglobal("PartyMemberFrame"..i.."PetFrame"):SetScale(SUF_SetScale.partypet/100);
		end	
	elseif id == 7 then
		if not SUF_SetScale.tot then
			SUF_SetScale.tot = 100;
		end
		SmartToTFrame:SetScale(SUF_SetScale.tot/100);
--		SmartToTTFrame:SetScale(SUF_SetScale.tot/100);
	end
end
