Raised This Month: $ Target: $400
 0% 

Menu Page


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
insane8472
Member
Join Date: Dec 2010
Old 02-01-2011 , 20:48   Menu Page
Reply With Quote #1

I have a menu that reopens itself once a selection is made. It reopens on the first page. Is there a way to have it reopen on the page it was on when the selection was made? Thanks.
insane8472 is offline
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 02-01-2011 , 21:00   Re: Menu Page
Reply With Quote #2

http://docs.sourcemod.net/api/index....d=show&id=183&
__________________
thetwistedpanda is offline
insane8472
Member
Join Date: Dec 2010
Old 02-02-2011 , 07:40   Re: Menu Page
Reply With Quote #3

Thanks. I got it to open on the same page using DisplayMenuAtItem and GetMenuSelectionPosition. But, when I make a second selection, the menu closes, and does not perform the selected option. What am I doing wrong?
insane8472 is offline
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 02-02-2011 , 13:13   Re: Menu Page
Reply With Quote #4

Here's some sample code I ripped from one of my plugins; it's how I usually handle DisplayMenuAtItem. It doesn't work in all cases, especially if you can't pass in the index to the menu item, but it might suit your needs:

PHP Code:
void:Void_MenuCreate(clientindex 0)
{
    
decl String:g_sDisplay[128], String:g_sTemp[8];
    new 
g_iTempHandle:g_hMenu CreateMenu(MenuHandler_CreateMenu);
    
Format(g_sDisplaysizeof(g_sDisplay), "Yo Yo!");
    
SetMenuTitle(g_hMenug_sDisplay);
    
SetMenuExitButton(g_hMenutrue);
    
SetMenuExitBackButton(g_hMenutrue);

    for(new 
1<= 21i++)
    {
        
Format(g_sTemp8"%d"g_iTemp);
        
AddMenuItem(g_hMenug_sTempg_sTemp);
        
        
g_iTemp++;
    }

    
DisplayMenuAtItem(g_hMenuclientindexMENU_TIME_FOREVER);
}

public 
MenuHandler_CreateMenu(Handle:menuMenuAction:actionparam1param2)
{
    switch (
action)
    {
        case 
MenuAction_End:
            
CloseHandle(menu);
        case 
MenuAction_Cancel:
            
Void_MenuProp(param1);
        case 
MenuAction_Select:
        {
            
decl String:g_sTemp[32], String:g_sBuffer[2][4];
            
GetMenuItem(menuparam2g_sTempsizeof(g_sTemp));
            new 
g_iTemp StringToInt(g_sTemp);
            
            
g_iTemp RoundToFloor(float(g_iTemp 7)) * 7;
            
Void_MenuCreate(param1g_iTemp);
        }
    }
    
    return;

__________________
thetwistedpanda is offline
insane8472
Member
Join Date: Dec 2010
Old 02-02-2011 , 14:26   Re: Menu Page
Reply With Quote #5

Thanks for the help. Im recently just started learning this. I tried adapting your code, the best I got was that it reopened the menu on page 1 and just closes when selecting a second choice.
insane8472 is offline
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 02-02-2011 , 14:44   Re: Menu Page
Reply With Quote #6

Could you post your code here? It'll be easier to figure out what's going wrong .
__________________
thetwistedpanda is offline
insane8472
Member
Join Date: Dec 2010
Old 02-05-2011 , 12:49   Re: Menu Page
Reply With Quote #7

resolved

Last edited by insane8472; 02-08-2011 at 08:42.
insane8472 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode