

if( TS2HelpPanel ) then
	
	TS2HelpPanel:Remove();

end
TS2HelpPanel = nil;

HelpSelectedLink = 1;

function ShowHelp()

	if( TS2HelpPanel and TS2HelpPanel:IsVisible() ) then
	
		TS2HelpPanel:Remove();
		HideMouse();
		return;
	
	end

	gui.EnableScreenClicker( true );

	TS2HelpPanel = CreateBPanel( "Chernobyl Help", 0, 0, 800, 600 );
	
	TS2HelpPanel:SetBodyColor( Color( 50, 50, 50, 100 ) );
	
	TS2HelpPanel.LeftPane = CreateBPanel( nil, 5, 0, 200, 570 );
	TS2HelpPanel.LeftPane:SetParent( TS2HelpPanel );
	TS2HelpPanel.LeftPane:SetBodyColor( Color( 30, 30, 30, 240 ) );
	TS2HelpPanel.LeftPane.Links = { }
	
	local function CreateRightPane()
	
		if( TS2HelpPanel.RightPane ) then
			TS2HelpPanel.RightPane:Remove();
		end
	
		TS2HelpPanel.RightPane = CreateBPanel( nil, 210, 0, 580, 570 );
		TS2HelpPanel.RightPane:SetParent( TS2HelpPanel );
		TS2HelpPanel.RightPane:EnableScrolling( true )
		TS2HelpPanel.RightPane:SetBodyColor( Color( 30, 30, 30, 240 ) );
		
	end
	
	for n = 1, #TS2HelpOptions do
	
		TS2HelpPanel.LeftPane.Links[n] = TS2HelpPanel.LeftPane:AddLink( TS2HelpOptions[n].Name, "NewChatFont", 3, 5 + ( n - 1 ) * 14, Color( 255, 255, 255, 200 ), function() CreateRightPane(); TS2HelpPanel.LeftPane.Links[HelpSelectedLink].NormalColor = Color( 255, 255, 255, 200 ); TS2HelpPanel.LeftPane.Links[n].NormalColor = Color( 80, 80, 255, 200 ); HelpSelectedLink = n; TS2HelpPanel.RightPane.PaintHook = nil; TS2HelpOptions[n].Func(); end );
		TS2HelpPanel.LeftPane.Links[n].HighlightColor = Color( 80, 80, 255, 255 );
		
	end
	
	TS2HelpPanel.LeftPane.Links[1].Action();
	
	TS2HelpPanel.OnClose = function()
	
		HideMouse();
	
	end

end
usermessage.Hook( "SH", ShowHelp );

function Help_Info()

	TS2HelpPanel.RightPane.PaintHook = function()
	
		draw.DrawTextOutlined( "C", "GModToolName", 5, 5, Color( 255, 0, 0, 255 ), nil, nil, 2, Color( 0, 0, 0, 255 ) );
		draw.DrawTextOutlined( "her", "GModToolName", 25, 5, Color( 255, 255, 255, 255 ), nil, nil, 2, Color( 0, 0, 0, 255 ) );
		draw.DrawTextOutlined( "n", "GModToolName", 95, 5, Color( 255, 0, 0, 255 ), nil, nil, 2, Color( 0, 0, 0, 255 ) );
		draw.DrawTextOutlined( "obyl", "GModToolName", 123, 5, Color( 255, 255, 255, 255 ), nil, nil, 2, Color( 0, 0, 0, 255 ) );
		
	end
	
	TS2HelpPanel.RightPane:AddLabel( "Welcome to PubGamer HL2RP: www.pubgamer.org\nThis is the help menu. We ask that you take this time to read over the contents.\n\nServer Rules:\n\n- No Prop Killing/Surfing/Blocking\n- No Random Killing/Punchwhoring\n- Don't walk around with your phys/grav gun out.\n- Listen to admins.\n- Be Respectful, Kind, and Welcoming.", "NewChatFont", 10, 60, Color( 255, 255, 255, 255 ) );

end

function Help_Credits()

	TS2HelpPanel.RightPane:AddLabel( "TS2 Credits", "NewChatFont", 10, 10, Color( 255, 0, 0, 255 ) );

	local HelpString = "\n\nRick Dark, Waffler - Creating/Developing/Scripting\n\n\nSpecial thanks to..\n\n";
	HelpString = HelpString .. "Sharpy, Looter, Ghost, Kane, Kahn - Some coding and original TS2 base lol.(Thnx riech).\n";
	HelpString = HelpString .. "Janorkie - Helping me with some stuff.\n";

	HelpString = FormatLine( HelpString, "NewChatFont", 570 );
	TS2HelpPanel.RightPane:AddLabel( HelpString, "NewChatFont", 10, 10, Color( 255, 255, 255, 255 ) );


end

function Help_Chatting()

	local HelpString = "Information on OOC/IC chatting.\n\n";
	HelpString = HelpString .. "In-Character:\n\n";
	HelpString = HelpString .. "/w - Whisper\n/y - Yell\n/me - Narrate your action\n/it - Narrate your surroundings\n[[ or .// - Local OOC\n\n";
	
	HelpString = HelpString .. "Out-Of-Character:\n\n";
	HelpString = HelpString .. "// or /a or /ooc - Talk in OOC chat.  Note, OOC delays can prohibit this.";
	
	HelpString = HelpString .. "Important:\n\n";
	HelpString = HelpString .. "Always follow the Out-Of-Character Rule!\nDo not mix up IC and OOC or you will be banned!";
	
	HelpString = FormatLine( HelpString, "NewChatFont", 570 );
	TS2HelpPanel.RightPane:AddLabel( HelpString, "NewChatFont", 10, 10, Color( 255, 255, 255, 255 ) );
		

end

function Help_Animations()

	local HelpString = "TacoScript 2 has a list of special animations/poses that players can use.  Note, many animations are only usable for certain player models and teams.  Most only usable on male citizens due to HL2 model limitations.\n\nThese animations can be toggled by doing them twice, some can be untoggled using the chat command /stand\n\n";
	HelpString = HelpString .. ")  Sitting - Only citizen models can use these.  To sit, back up to a chair or bench, and get as close as you can to it but do NOT get on top of it.  With your back towards whatever you're wanting to sit on, type in chat /sit or use rp_ic_sit.  There are 4 sitting animations available, so you can specify what type of animation you want by following the command with a number, such as /sit 3 or rp_ic_sit 4. You cannot sit in all seats.\n\n";
	HelpString = FormatLine( HelpString, "NewChatFont", 570 );
	HelpString = HelpString .. ")  Sitting on the ground - Only citizen models can use these.  To sit on the ground, just use /sitground or rp_ic_sitground.  There are 2 ground sitting animations you can use, which you can access by following the command by a number, such as /sitground 2.\n";

	HelpString = FormatLine( HelpString, "NewChatFont", 570 );
	TS2HelpPanel.RightPane:AddLabel( HelpString, "NewChatFont", 10, 10, Color( 255, 255, 255, 255 ) );
	
	HelpString = "";
	HelpString = HelpString .. ")  Lean against wall - Only citizen models can use this.  This animation is normally used for when trying to look cool.  Just put your back against a wall and do /lean or use console command rp_ic_lean.\n\n";
	
	HelpString = FormatLine( HelpString, "NewChatFont", 570 );
	TS2HelpPanel.RightPane:AddLabel( HelpString, "NewChatFont", 10, nil, Color( 255, 255, 255, 255 ) );
	
end

function Help_Commands()

	local HelpString = "Information on console commands used in TS2.\n\n";
	HelpString = HelpString .. "rp_toggleholster - Holster/unholster your weapon.\n";
	HelpString = HelpString .. "rp_userlist - Get a list of the server's players and their SF/RP names and SteamID\n";
	HelpString = HelpString .. "rp_changename - 'rp_changename [name]' Change your current name.\n";
	HelpString = HelpString .. "rp_motd - See MOTD.  Can also be accessed via F3.\n\n";
	HelpString = HelpString .. "rp_cl_sadcolors <1 or 0> - Toggles color filter.\n";
	HelpString = HelpString .. "rp_cl_ts1hud <1 or 0> - Toggles TS1-style HUD bars.\n\n";
	HelpString = HelpString .. "gm_showhelp - F1 key.\n";
	HelpString = HelpString .. "gm_showteam - F2 key.\n";
	HelpString = HelpString .. "gm_showspare1 - F3 key.\n";
	HelpString = HelpString .. "gm_showspare2 - F4 key.\n";

	HelpString = FormatLine( HelpString, "NewChatFont", 570 );
	TS2HelpPanel.RightPane:AddLabel( HelpString, "NewChatFont", 10, 10, Color( 255, 255, 255, 255 ) );
	

end

function Help_PropOwnership()

	local HelpString = "To interact with properties or doors, simply press F4 on them and a small menu will pop up.\n\n";
	HelpString = HelpString .. ") To own properties, press F4 on the front door of an unowned property.  You may be given a menu with options of how long you want to rent the property.  When the time is up on renting a property, your ownership will be revoked unless you re-rent it.\n\n";
	HelpString = FormatLine( HelpString, "NewChatFont", 570 );
	TS2HelpPanel.RightPane:AddLabel( HelpString, "NewChatFont", 10, nil, Color( 255, 255, 255, 255 ) );
	

end

TS2HelpOptions = {

	{ Name = "- Information", Func = Help_Info },
	{ Name = "- Credits", Func = Help_Credits },
	{ Name = "- TacoScript 2", Func = function() end },
	{ Name = "   * Chatting", Func = Help_Chatting },
	{ Name = "   * Console", Func = Help_Commands },
	{ Name = "   * Animations", Func = Help_Animations },
	{ Name = "   * Doors/Properties", Func = Help_PropOwnership },


}

