Skip to content

Commit

Permalink
In start menu, show mount status and image name right aligned if the …
Browse files Browse the repository at this point in the history
…name is wider than the screen (useful when trying to switch CD while in-game at lower resolutions)
  • Loading branch information
schellingb committed Sep 16, 2024
1 parent 60e94de commit ea7b947
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions dosbox_pure_osd.h
Original file line number Diff line number Diff line change
Expand Up @@ -1209,10 +1209,9 @@ struct DBP_PureMenuState : DBP_MenuState
if (item.type == IT_MOUNT) // mountable file system
{
bool mounted = dbp_images[item.info].mounted;
int lbllen = (mounted ? sizeof("UNMOUNT") : sizeof("MOUNT")), len = strlen + lbllen;
int lblx = (w - buf.CW*(lbllen + strlen)) / 2;
buf.Print(lh, lblx, y, (mounted ? "UNMOUNT " : "MOUNT "), (i == se ? buf.COL_HIGHLIGHT : buf.COL_NORMAL));
buf.Print(lh, lblx + buf.CW*lbllen, y, item.str.c_str(), (i == se ? buf.COL_HIGHLIGHT : buf.COL_NORMAL));
int xdiff = (w - buf.CW*(strlen + 7)), mntx = (xdiff >= 0 ? xdiff / 2 : w - (buf.CW*9)), strx = (xdiff >= 0 ? mntx + (buf.CW*7) : xdiff - (buf.CW*3));
buf.Print(lh, mntx + ((mounted && xdiff >= 0) ? buf.CW : 0), y, (mounted ? "EJECT" : "INSERT"), (i == se ? buf.COL_HIGHLIGHT : buf.COL_NORMAL));
buf.Print(lh, strx, y, item.str.c_str(), (i == se ? buf.COL_HIGHLIGHT : buf.COL_NORMAL));
}
else if (item.type == IT_RUN || item.type == IT_BOOTOS || item.type == IT_BOOTIMG_MACHINE || item.type == IT_RUNSHELL || item.type == IT_RUNVARIANT)
{
Expand Down

0 comments on commit ea7b947

Please sign in to comment.