local o=InventoryFrame.Main.Weapons local W=o.Actions local x=o.Equipped local t=o.Items local k=W.ActionContainer local h=k.Craft local C=W.Equip local F=W.Craft local S=W.Recycle local b=InventoryFrame.Recipes local d={[t]={[C]={Size=t.Size,Position=t.Position};[F]={Size=UDim2.new(0,-427,1,-155),Position=t.Position},[S]={Size=UDim2.new(0,-427,1,-200);Position=t.Position}},[W]={[C]={Size=W.Size;Position=W.Position};[F]={Size=UDim2.new(1,0,0,160);Position=UDim2.new(0,0,1,-160)},[S]={Size=UDim2.new(1,0,0,205);Position=UDim2.new(0,0,1,-205)}},[x]={[C]={Size=x.Size;Position=x.Position};[F]={Size=UDim2.new(0,130,1,-155),Position=UDim2.new(1,0,0,0)},[S]={Size=UDim2.new(0,130,1,-200);Position=x.Position}},[b]={[C]={Size=b.Size,Position=b.Position},[F]={Size=UDim2.new(0,292,1,-155),Position=b.Position},[S]={Size=UDim2.new(0,0,1,-200);Position=t.Position}}}local U={C;F,S}local function N(o,W)CurrentAction=o.Name for W,x in pairs(U)do x.Style=x==o and Enum.ButtonStyle.RobloxRoundDefaultButton or Enum.ButtonStyle.RobloxRoundButton end if o.Name~="\069\113\117\105\112"then for W,x in pairs(k:GetChildren())do x.Visible=x.Name==o.Name end end for x,t in pairs(d)do x:TweenSizeAndPosition(t[o].Size,t[o].Position,Direction,Style,tonumber(W)~=nil and W or Time)end end for o,W in pairs(U)do W.MouseButton1Click:connect(function()N(W)end)end

local WeaponsFrame = InventoryFrame.Main.Weapons;

local ActionsFrame = WeaponsFrame.Actions;
local EquippedFrame = WeaponsFrame.Equipped;
local ItemsFrame = WeaponsFrame.Items;

local ActionContainer = ActionsFrame.ActionContainer
local CraftingFrame = ActionContainer.Craft;

local EquipButton = ActionsFrame.Equip;
local CraftButton = ActionsFrame.Craft;
local RecycleButton = ActionsFrame.Recycle;
local RecipesFrame = InventoryFrame.Recipes;

local Sizes = {
	
	[ItemsFrame] = {
		[EquipButton] = {
			Size = ItemsFrame.Size;
			Position = ItemsFrame.Position;
		};
		[CraftButton] = {
			Size = UDim2.new(0,-427,1,-155);
			Position = ItemsFrame.Position;
		};
		[RecycleButton] = {
			Size = UDim2.new(0,-427,1,-200);
			Position = ItemsFrame.Position;
		};
	};
	
	[ActionsFrame] = {
		[EquipButton] = {
			Size = ActionsFrame.Size;
			Position = ActionsFrame.Position;
		};
		[CraftButton] = {
			Size = UDim2.new(1,0,0,160);
			Position = UDim2.new(0,0,1,-160);
		};
		[RecycleButton] = {
			Size = UDim2.new(1,0,0,205);
			Position = UDim2.new(0,0,1,-205);
		};
	};
	
	[EquippedFrame] = {
		[EquipButton] = {
			Size = EquippedFrame.Size;
			Position = EquippedFrame.Position;
		};
		[CraftButton] = {
			Size = UDim2.new(0,130,1,-155);
			Position = UDim2.new(1,0,0,0);
		};
		[RecycleButton] = {
			Size = UDim2.new(0,130,1,-200);
			Position = EquippedFrame.Position;
		};
	};
	
	[RecipesFrame] = {
		[EquipButton] = {
			Size = RecipesFrame.Size;
			Position = RecipesFrame.Position;
		};
		[CraftButton] = {
			Size = UDim2.new(0,292,1,-155);
			Position = RecipesFrame.Position; --EquippedFrame.Position;
		};
		[RecycleButton] = {
			Size = UDim2.new(0,0,1,-200);
			Position = ItemsFrame.Position;
		};
	};
	
};

local Buttons = {EquipButton,CraftButton,RecycleButton};

local function ChangeAction(Button,CustomTime)
	CurrentAction = Button.Name;
	for _,B in pairs(Buttons) do B.Style = (B==Button and Enum.ButtonStyle.RobloxRoundDefaultButton) or Enum.ButtonStyle.RobloxRoundButton; end;
	if Button.Name ~= "Equip" then for _,F in pairs(ActionContainer:GetChildren()) do F.Visible = (F.Name==Button.Name); end; end;
	for Frame,Data in pairs(Sizes) do
		Frame:TweenSizeAndPosition(
			Data[Button].Size,
			Data[Button].Position,
			Direction,Style,((tonumber(CustomTime)~=nil and CustomTime) or Time)
		);
	end
end
for _,Button in pairs(Buttons) do
	Button.MouseButton1Click:connect(function()
		ChangeAction(Button);
	end)
end

