Skip to content
Snippets Groups Projects
Commit e9561852 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Merge branch 'dd_lightbar_menu_clear_after_menu_draw_fix' into 'master'

DDLightbarMenu: When clearing the remainder of the screen after drawing the menu, ensure the console attributes are reset. Also, refactored that section of code.

See merge request !478
parents 0e8e1ae7 d88c4435
No related branches found
No related tags found
1 merge request!478DDLightbarMenu: When clearing the remainder of the screen after drawing the menu, ensure the console attributes are reset. Also, refactored that section of code.
......@@ -1045,6 +1045,18 @@ function DDLightbarMenu_Draw(pSelectedItemIndexes, pDrawBorders, pDrawScrollbar,
// the rest of the height of the menu.
if (numItemsWritten < numPossibleItems)
{
console.attributes = 0;
for (; numItemsWritten < numPossibleItems; ++numItemsWritten)
{
writeTheItem = ((this.nextDrawOnlyItems.length == 0) || (this.nextDrawOnlyItems.indexOf(numItemsWritten) > -1));
if (writeTheItem)
{
console.gotoxy(curPos.x, curPos.y++);
printf("%*s", itemLen, "");
}
}
// Old way - Not sure why I was doing it this way:
/*
var numberFormatStr = "%" + this.itemNumLen + "s ";
var itemFormatStr = "%-" + itemLen + "s";
for (; numItemsWritten < numPossibleItems; ++numItemsWritten)
......@@ -1060,6 +1072,7 @@ function DDLightbarMenu_Draw(pSelectedItemIndexes, pDrawBorders, pDrawScrollbar,
console.print(itemText);
}
}
*/
}
}
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment