public override void Draw(System.Drawing.Rectangle drawRegion, Tricycle.GameWindow gw) { filesPerPage = (drawRegion.Height / (_drawFont.Height + 2)) - 2; maxPages = (_romList.Count / filesPerPage); int yOffset = (drawRegion.Height - (filesPerPage * (_drawFont.Height + 2))) / 2; int page = _selected / filesPerPage; var basePage = page * filesPerPage; gw.DrawString(drawRegion.X + drawRegion.Width - (60), drawRegion.Y , Color.Red, _drawFont, "{0}|{1}", (page + 1).ToString(), maxPages.ToString()); for (int i = page * filesPerPage; i < Math.Min((page + 1) * filesPerPage, _romList.Count()); i++) { var pathStr = Path.GetFileNameWithoutExtension(_romList[i]); pathStr = pathStr.Substring(0, Math.Min(30, pathStr.Length)); if (pathStr.Length >= 30) pathStr = pathStr.Remove(pathStr.Length - 1) + "…"; if (i == _selected) { gw.DrawString(drawRegion.X, drawRegion.Y + ((i - basePage) * (_drawFont.Height + 2)), Color.Red, _drawFont, pathStr); } else { gw.DrawString(drawRegion.X + 20, drawRegion.Y + ((i - basePage) * (_drawFont.Height + 2)), Color.Black, _drawFont, pathStr); } } }
public override void Draw(System.Drawing.Rectangle drawRegion, Tricycle.GameWindow gw) { for(int i = 0; i < _actionItems.Count; i++) { if(i == _selected) { gw.DrawString(drawRegion.X, drawRegion.Y + (i*(_drawFont.Height + 2)), Color.Red, _drawFont, _actionItems.Keys.ToList()[i]); } else { gw.DrawString(drawRegion.X+20, drawRegion.Y+ (i * (_drawFont.Height + 2)), Color.Black, _drawFont, _actionItems.Keys.ToList()[i]); } } }