Raised This Month: $ Target: $400
 0% 

Panel Menus


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
WolfGang
BANNED
Join Date: Oct 2010
Old 10-20-2012 , 19:11   Panel Menus
Reply With Quote #1

Hi, i would like to know how to draw a menu but is selectable but not highlighted? Heres what im trying to do:

PHP Code:
Format(textsizeof(text), "/trails = Customize bullet trail color"ITEMDRAW_DISABLED);
DrawPanelItem(menutext); 
I tried " ITEMDRAW_DISABLED " but doesn't work.

Last edited by WolfGang; 10-20-2012 at 19:12.
WolfGang is offline
ReFlexPoison
☠☠☠
Join Date: Jul 2011
Location: ☠☠☠
Old 10-20-2012 , 19:13   Re: Panel Menus
Reply With Quote #2

Try ITEMDRAW_CONTROL
ReFlexPoison is offline
minimoney1
SourceMod Donor
Join Date: Dec 2010
Old 10-20-2012 , 19:16   Re: Panel Menus
Reply With Quote #3

What...?
Why do you add ITEMDRAW_DISABLED to Format?
You're apparently making a panel (with the handle named... menu), if so then you have 2 natives to work with: DrawPanelItem and DrawPanelText.
The former adds a selectable item to the list while the latter adds text which cannot be selected.
To achieve what you want to do, you can use DrawPanelItem and then redisplay the text in MenuAction_Select of your panel callback.
__________________
Need help? PM me or add me on Steam.
My Steam




Quote:
Originally Posted by Rp.KryptoNite View Post
For some reason his Plugin never worked for me ,
@credits were added
im not stealing any plugins dude its my THING
minimoney1 is offline
WolfGang
BANNED
Join Date: Oct 2010
Old 10-20-2012 , 19:16   Re: Panel Menus
Reply With Quote #4

Quote:
Originally Posted by ReFlexPoison View Post
Try ITEMDRAW_CONTROL
Thanks for the quick reply, but the option is still highlighted. I need the option to be selectable but not highlighted.
WolfGang is offline
WolfGang
BANNED
Join Date: Oct 2010
Old 10-20-2012 , 19:18   Re: Panel Menus
Reply With Quote #5

Quote:
Originally Posted by minimoney1 View Post
What...?
Why do you add ITEMDRAW_DISABLED to Format?
You're apparently making a panel (with the handle named... menu), if so then you have 2 natives to work with: DrawPanelItem and DrawPanelText.
The former adds a selectable item to the list while the latter adds text which cannot be selected.
To achieve what you want to do, you can use DrawPanelItem and then redisplay the text in MenuAction_Select of your panel callback.
I tried that but still isn't working. Maybe i put something down wrong?

PHP Code:
Format(textsizeof(text), "/trails = Customize bullet trail color"MenuAction_Select);
DrawPanelItem(menutext); 
WolfGang is offline
minimoney1
SourceMod Donor
Join Date: Dec 2010
Old 10-20-2012 , 19:29   Re: Panel Menus
Reply With Quote #6

You're doing everything wrong.
Go read the Menu/Panel API, figure out how panels work, and then you'll figure out what I'm talking about.
Here: http://wiki.alliedmods.net/Menu_API_(SourceMod)
__________________
Need help? PM me or add me on Steam.
My Steam




Quote:
Originally Posted by Rp.KryptoNite View Post
For some reason his Plugin never worked for me ,
@credits were added
im not stealing any plugins dude its my THING
minimoney1 is offline
WolfGang
BANNED
Join Date: Oct 2010
Old 10-20-2012 , 19:39   Re: Panel Menus
Reply With Quote #7

Quote:
Originally Posted by minimoney1 View Post
You're doing everything wrong.
Go read the Menu/Panel API, figure out how panels work, and then you'll figure out what I'm talking about.
Here: http://wiki.alliedmods.net/Menu_API_(SourceMod)
I'm new at this. I'm still trying but don't know how to figure it out.

Heres an overall of my panel:

PHP Code:
public Handle:PublicCommandsMenu (client)
{
    new 
Handle:menu CreatePanel();
    new 
String:text[512];
    
Format(textsizeof(text), "%T""Commands Menu"client);
    
SetPanelTitle(menutext);
    
    
Format(textsizeof(text), "/trails = Customize bullet trail color"MenuAction_Select);
    
DrawPanelItem(menutext);
    
    
Format(textsizeof(text), "\n0. Exit"client);
    
DrawPanelText(menutext);
    
    return 
menu;
}

public 
PublicCommandsMenu_Init (Handle:topmenuMenuAction:actionclientparam2)
{
    if (
topmenu != INVALID_HANDLECloseHandle(topmenu);

    if (
action == MenuAction_Select)
    {
        switch (
param2)
        {
            case 
1:
            {
                
PrintToChat(client"[pistol | uzi | shotgun | rifle | sniper | [red] [green] [blue] [transparency] , ranges 0 - 255\nExample: /trails uzi  255 0 0 255  - SMGs trails bullet trails would be RED and TRANSPARENT"client);
                
SendPanelToClientAndClose(PublicCommandsMenu(client), clientPublicCommandsMenu_InitMENU_TIME_FOREVER);
            }
        }
    }

WolfGang is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 10-20-2012 , 20:04   Re: Panel Menus
Reply With Quote #8

Quote:
Originally Posted by WolfGang View Post
I'm new at this. I'm still trying but don't know how to figure it out.

Heres an overall of my panel:

PHP Code:
public Handle:PublicCommandsMenu (client)
{
    new 
Handle:menu CreatePanel();
    new 
String:text[512];
    
Format(textsizeof(text), "%T""Commands Menu"client);
    
SetPanelTitle(menutext);
    
    
Format(textsizeof(text), "/trails = Customize bullet trail color"MenuAction_Select);
    
DrawPanelItem(menutext);
    
    
Format(textsizeof(text), "\n0. Exit"client);
    
DrawPanelText(menutext);
    
    return 
menu;
}

public 
PublicCommandsMenu_Init (Handle:topmenuMenuAction:actionclientparam2)
{
    if (
topmenu != INVALID_HANDLECloseHandle(topmenu);

    if (
action == MenuAction_Select)
    {
        switch (
param2)
        {
            case 
1:
            {
                
PrintToChat(client"[pistol | uzi | shotgun | rifle | sniper | [red] [green] [blue] [transparency] , ranges 0 - 255\nExample: /trails uzi  255 0 0 255  - SMGs trails bullet trails would be RED and TRANSPARENT"client);
                
SendPanelToClientAndClose(PublicCommandsMenu(client), clientPublicCommandsMenu_InitMENU_TIME_FOREVER);
            }
        }
    }

Quote:
Originally Posted by minimoney1 View Post
What...?
Why do you add ITEMDRAW_DISABLED to Format?
You're apparently making a panel (with the handle named... menu), if so then you have 2 natives to work with: DrawPanelItem and DrawPanelText.
The former adds a selectable item to the list while the latter adds text which cannot be selected.
To achieve what you want to do, you can use DrawPanelItem and then redisplay the text in MenuAction_Select of your panel callback.
Read his post, he tells you what is wrong.
Mitchell is offline
WolfGang
BANNED
Join Date: Oct 2010
Old 10-20-2012 , 20:19   Re: Panel Menus
Reply With Quote #9

Quote:
Originally Posted by Mitchell View Post
Read his post, he tells you what is wrong.
I'm still confuse. -.-
WolfGang is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 10-20-2012 , 21:20   Re: Panel Menus
Reply With Quote #10

Why are you using a panel instead of a menu again?
__________________
Not currently working on SourceMod plugin development.
Powerlord 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 09:26.


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