core/MenuManager.cpp
changeset 785 bca431afd754
parent 781 d5a9953793c4
child 787 52283fe61d42
     1.1 --- a/core/MenuManager.cpp	Sun May 13 07:48:36 2007 +0000
     1.2 +++ b/core/MenuManager.cpp	Sun May 13 17:12:16 2007 +0000
     1.3 @@ -468,7 +468,7 @@
     1.4  	/* Now, we need to check if we need to add anything extra */
     1.5  	if (pgn != MENU_NO_PAGINATION)
     1.6  	{
     1.7 -		bool canDrawDisabled = display->CanDrawItem(ITEMDRAW_DISABLED);
     1.8 +		bool canDrawDisabled = display->CanDrawItem(ITEMDRAW_DISABLED|ITEMDRAW_CONTROL);
     1.9  		bool exitButton = menu->GetExitButton();
    1.10  		char text[50];
    1.11  
    1.12 @@ -517,34 +517,48 @@
    1.13  			display->DrawItem(draw);
    1.14  		}
    1.15  
    1.16 -		/* PREVIOUS */
    1.17  		ItemDrawInfo dr(text, 0);
    1.18 -		if (displayPrev || canDrawDisabled)
    1.19 +		/**
    1.20 +		 * If we have one or the other, we need to have spacers for both.
    1.21 +		 */
    1.22 +		if (displayPrev || displayNext)
    1.23  		{
    1.24 -			CorePlayerTranslate(client, text, sizeof(text), "Back", NULL);
    1.25 -			dr.style = displayPrev ? 0 : ITEMDRAW_DISABLED;
    1.26 -			position = display->DrawItem(dr);
    1.27 -			slots[position].type = ItemSel_Back;
    1.28 -		} else if ((displayNext || canDrawDisabled) || exitButton) {
    1.29 -			/* If we can't display this, 
    1.30 -			 * but there is a "next" or "exit" button, we need to pad!
    1.31 -			 */
    1.32 -			position = display->DrawItem(padItem);
    1.33 +			/* PREVIOUS */
    1.34 +			ItemDrawInfo padCtrlItem(NULL, ITEMDRAW_SPACER|ITEMDRAW_CONTROL);
    1.35 +			if (displayPrev || canDrawDisabled)
    1.36 +			{
    1.37 +				CorePlayerTranslate(client, text, sizeof(text), "Back", NULL);
    1.38 +				dr.style = (displayPrev ? 0 : ITEMDRAW_DISABLED)|ITEMDRAW_CONTROL;
    1.39 +				position = display->DrawItem(dr);
    1.40 +				slots[position].type = ItemSel_Back;
    1.41 +			} else if (displayNext || exitButton) {
    1.42 +				/* If we can't display this, and there is an exit button,
    1.43 +				 * we need to pad!
    1.44 +				 */
    1.45 +				position = display->DrawItem(padCtrlItem);
    1.46 +				slots[position].type = ItemSel_None;
    1.47 +			}
    1.48 +
    1.49 +			/* NEXT */
    1.50 +			if (displayNext || canDrawDisabled)
    1.51 +			{
    1.52 +				CorePlayerTranslate(client, text, sizeof(text), "Next", NULL);
    1.53 +				dr.style = (displayNext ? 0 : ITEMDRAW_DISABLED)|ITEMDRAW_CONTROL;
    1.54 +				position = display->DrawItem(dr);
    1.55 +				slots[position].type = ItemSel_Next;
    1.56 +			} else if (exitButton) {
    1.57 +				/* If we can't display this,
    1.58 +				 * but there is an "exit" button, we need to pad!
    1.59 +				 */
    1.60 +				position = display->DrawItem(padCtrlItem);
    1.61 +				slots[position].type = ItemSel_None;
    1.62 +			}
    1.63 +		} else {
    1.64 +			/* Otherwise, bump to two slots! */
    1.65 +			ItemDrawInfo numBump(NULL, ITEMDRAW_NOTEXT);
    1.66 +			position = display->DrawItem(numBump);
    1.67  			slots[position].type = ItemSel_None;
    1.68 -		}
    1.69 -
    1.70 -		/* NEXT */
    1.71 -		if (displayNext || canDrawDisabled)
    1.72 -		{
    1.73 -			CorePlayerTranslate(client, text, sizeof(text), "Next", NULL);
    1.74 -			dr.style = displayNext ? 0 : ITEMDRAW_DISABLED;
    1.75 -			position = display->DrawItem(dr);
    1.76 -			slots[position].type = ItemSel_Next;
    1.77 -		} else if (exitButton) {
    1.78 -			/* If we can't display this,
    1.79 -			 * but there is an exit button, we need to pad!
    1.80 -			 */
    1.81 -			position = display->DrawItem(padItem);
    1.82 +			position = display->DrawItem(numBump);
    1.83  			slots[position].type = ItemSel_None;
    1.84  		}
    1.85  
    1.86 @@ -552,7 +566,7 @@
    1.87  		if (exitButton)
    1.88  		{
    1.89  			CorePlayerTranslate(client, text, sizeof(text), "Exit", NULL);
    1.90 -			dr.style = 0;
    1.91 +			dr.style = ITEMDRAW_CONTROL;
    1.92  			position = display->DrawItem(dr);
    1.93  			slots[position].type = ItemSel_Exit;
    1.94  		}