UnrealScript Game Programming Cookbook

(Chris Devlin) #1
Chapter 8

237

foreach CommandDebugPages(page,index_array)
{
// For the currently selected item in the array...
if (index_array == CurrentIndex)
{
// set text color to red
cmnd_color = H.RedColor;
}
else
{
// All other text is white
cmnd_color = H.WhiteColor;
}


/* Draws the text on screen based on the preceding info
that we've provided
/
TutorialHUD(H).DrawDebugText
(index_array$":"@page.PageName,vect2d(0,YPos),
H.Canvas.Font,cmnd_color);
// Draws next line beneath current one
YPos += YL;
}
}
else
{
page = CommandDebugPages[CurrentPage];
TutorialHUD(H).DrawDebugText("Debug Menu -
"$page.PageName,vect2d(0,YPos),
H.Canvas.Font,H.WhiteColor);


// Draws next line beneath current one
YPos += YL;
foreach page.PageCommands(command,index_array)
{
if (index_array == CurrentIndex)
{
// Active text is red
cmnd_color = H.RedColor;
}
else
{
// All other text is white
cmnd_color = H.WhiteColor;
}

Free download pdf