--
[ Picked text/plain from multipart/alternative ]
Well first off, you don't need to navigate to the game ui panel from
PANEL_ROOT, you can use
enginevgui->GetPanel( PANEL_GAMEUIDLL );
Regarding SendMessage it looks like the KeyValues needs to be named
"Command" and the key/value pairs are just like parameters to the "Command"
message, ie,
kv->SetName( "Command" );
kv->SetString( "command", "OpenOptionsDialog" );
An example that illustrates the reason for this is if you were going to send
"OnCursorMoved" you would set up the KeyValues like this:
kv->SetName( "OnCursorMoved" );
kv->SetInt( "x", x );
kv->SetInt( "y", y );
Regards,
Paul
On 10/24/06, Oliver <[EMAIL PROTECTED]> wrote:
>
> --
> [ Picked text/plain from multipart/alternative ]
> Thanks for the help!
>
> I've got the server browser working by using these methods:
>
> vgui::VPANEL GetChildByName(vgui::VPANEL parent, const char *name)
> {
> for(int i=0;i<vgui::ipanel()->GetChildCount(parent);i++)
> {
> vgui::VPANEL child = vgui::ipanel()->GetChild(parent, i);
> if(Q_strcmp(name, vgui::ipanel()->GetName(child)) == 0) return
> child;
> }
> return NULL;
> }
>
> vgui::VPANEL GetServerBrowser()
> {
> vgui::VPANEL root = enginevgui->GetPanel(PANEL_ROOT);
> vgui::VPANEL GameUI = GetChildByName(root, "GameUI Panel");
> if(GameUI)
> {
> vgui::VPANEL BaseGameUI = GetChildByName(GameUI,
> "BaseGameUIPanel");
> if(BaseGameUI)
> {
> vgui::VPANEL ServerBrowser = GetChildByName(BaseGameUI,
> "CServerBrowserDialog");
> if(ServerBrowser) return ServerBrowser;
> }
> }
> return NULL;
> }
>
> void ToggleServerPanel()
> {
> vgui::VPANEL server = GetServerBrowser();
> vgui::ipanel()->SetVisible(server,
> !vgui::ipanel()->IsVisible(server));
>
> if(vgui::ipanel()->IsVisible(server))
> vgui::ipanel()->MoveToFront(server);
> }
>
> Now I'm working on the options menu. I can get access to the GameMenu
> VPANEL, but SendMessage is defined as: SendMessage(VPANEL vguiPanel,
> KeyValues *params, VPANEL ifromPanel).
>
> I'm guessing vguiPanel and ifromPanel are the GameMenu. I'm not sure of
> the
> correct format for the params KeyValues. I tried this without success:
>
> KeyValues *kv = new KeyValues();
> kv->SetString("command", "OpenOptionsDialog")
>
> vgui::ipanel()->SendMessage(gameMenu, kv, gameMenu);
>
> Any ideas?
> --
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>
--
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders