Skip to content
Snippets Groups Projects
Commit d88c4435 authored by Eric Oulashin's avatar Eric Oulashin Committed by Rob Swindell
Browse files

DDLightbarMenu: When clearing the remainder of the screen after drawing the...

DDLightbarMenu: When clearing the remainder of the screen after drawing the menu, ensure the console attributes are reset. Also, refactored that section of code.
parent 0e8e1ae7
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, ...@@ -1045,6 +1045,18 @@ function DDLightbarMenu_Draw(pSelectedItemIndexes, pDrawBorders, pDrawScrollbar,
// the rest of the height of the menu. // the rest of the height of the menu.
if (numItemsWritten < numPossibleItems) 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 numberFormatStr = "%" + this.itemNumLen + "s ";
var itemFormatStr = "%-" + itemLen + "s"; var itemFormatStr = "%-" + itemLen + "s";
for (; numItemsWritten < numPossibleItems; ++numItemsWritten) for (; numItemsWritten < numPossibleItems; ++numItemsWritten)
...@@ -1060,6 +1072,7 @@ function DDLightbarMenu_Draw(pSelectedItemIndexes, pDrawBorders, pDrawScrollbar, ...@@ -1060,6 +1072,7 @@ function DDLightbarMenu_Draw(pSelectedItemIndexes, pDrawBorders, pDrawScrollbar,
console.print(itemText); console.print(itemText);
} }
} }
*/
} }
} }
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment