Skip to content
Snippets Groups Projects

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

Merged Eric Oulashin requested to merge dd_lightbar_menu_clear_after_menu_draw_fix into master
1 file
+ 13
0
Compare changes
  • Side-by-side
  • Inline
@@ -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
Loading