Game Development Community

Help.cs function getHelp

by Zod · in Torque Game Engine · 05/06/2005 (12:23 pm) · 0 replies

I never really noticed until I started using it but function getHelp(%helpName) was broken in the 1.3 demo scripts. So I fixed it so It works properly. Figured I'd share for those who ran into the same problem of it not selecting the proper row.

function getHelp(%helpName)
{
   Canvas.pushDialog(HelpDlg);
   %index = -1;
   if(%helpName !$= "")
   {
      for(%i = 0; %i < HelpFileList.entryCount; %i++)
      {
         %text = HelpFileList.getRowText(%i);
         if(%text $= %helpName)
         {
            %index = %i;
            break;
         }
      }
      HelpFileList.setSelectedRow(%index);
   }
}