core/MenuManager.cpp
changeset 1005 b15b5682d181
parent 1004 23ff0bc12973
child 1006 d8100bb2b07f
     1.1 --- a/core/MenuManager.cpp	Fri Jun 22 18:44:27 2007 +0000
     1.2 +++ b/core/MenuManager.cpp	Fri Jun 22 21:04:13 2007 +0000
     1.3 @@ -625,6 +625,7 @@
     1.4  	{
     1.5  		bool canDrawDisabled = display->CanDrawItem(ITEMDRAW_DISABLED|ITEMDRAW_CONTROL);
     1.6  		bool exitButton = menu->GetExitButton();
     1.7 +		bool exitBackButton = menu->GetExitBackButton();
     1.8  		char text[50];
     1.9  
    1.10  		/* Calculate how many items we are allowed for control stuff */
    1.11 @@ -650,6 +651,17 @@
    1.12  		/* Subtract two slots for the displayNext/displayPrev padding */
    1.13  		padding -= 2;
    1.14  
    1.15 +		/* If we have an "Exit Back" button and the space to draw it, do so. */
    1.16 +		if (exitBackButton)
    1.17 +		{
    1.18 +			if (!displayPrev)
    1.19 +			{
    1.20 +				displayPrev = true;
    1.21 +			} else {
    1.22 +				exitBackButton = false;
    1.23 +			}
    1.24 +		}
    1.25 +
    1.26  		/**
    1.27  		 * We allow next/prev to be undrawn if neither exists.
    1.28  		 * Thus, we only need padding if one of them will be drawn,
    1.29 @@ -690,10 +702,18 @@
    1.30  			ItemDrawInfo padCtrlItem(NULL, ITEMDRAW_SPACER|ITEMDRAW_CONTROL);
    1.31  			if (displayPrev || canDrawDisabled)
    1.32  			{
    1.33 -				CorePlayerTranslate(client, text, sizeof(text), "Back", NULL);
    1.34 -				dr.style = (displayPrev ? 0 : ITEMDRAW_DISABLED)|ITEMDRAW_CONTROL;
    1.35 -				position = display->DrawItem(dr);
    1.36 -				slots[position].type = ItemSel_Back;
    1.37 +				if (exitBackButton)
    1.38 +				{
    1.39 +					CorePlayerTranslate(client, text, sizeof(text), "Back", NULL);
    1.40 +					dr.style = ITEMDRAW_CONTROL;
    1.41 +					position = display->DrawItem(dr);
    1.42 +					slots[position].type = ItemSel_ExitBack;
    1.43 +				} else {
    1.44 +					CorePlayerTranslate(client, text, sizeof(text), "Previous", NULL);
    1.45 +					dr.style = (displayPrev ? 0 : ITEMDRAW_DISABLED)|ITEMDRAW_CONTROL;
    1.46 +					position = display->DrawItem(dr);
    1.47 +					slots[position].type = ItemSel_Back;
    1.48 +				}
    1.49  			} else if (displayNext || exitButton) {
    1.50  				/* If we can't display this, and there is an exit button,
    1.51  				 * we need to pad!