--
[ Picked text/plain from multipart/alternative ]
To get information from my panels to the server, I made a command on the
player that is sent from the panel via engine->ClientCmd. You can setup a
message that calls a function whenever the listbox selection is changed, it
is called "ItemSelected", and it passes the index of the currently selected
item in via keyvalues as "itemID". You might need to look at the
vgui_controls.lib source to understand this better as there are no examples
in the sdk (afaik). Howevre, an example of message function usage is
"OnTextChanged" in CSpectatorMenu.
I don't think this is the best way to do it, but I couldn't find an
alternative when I wrote that stuff and it works well enough. :)
On 4/6/06, Michael Kramer <[EMAIL PROTECTED]> wrote:
>
> --
> [ Picked text/plain from multipart/alternative ]
> hmm, basically what I have, is a panel, that has a list of objects,(well
> spells)
>
> So say that you select magic,
> I want it then to change a variable m_pCurrentSpell, which is on the
> weapon,
> to that current spell.
> m_pCurrentSpell, is an integer with a bunch of values, and depending on
> the
> value, then picks
> the spell. So all I want to do, is have my panel, change that value,
> depending on what is selected
> in my ListPanel.
>
> Does this explain more?
>
> And thanks for your help.
>
> On 4/6/06, Garry Newman <[EMAIL PROTECTED]> wrote:
> >
> > --
> > [ Picked text/plain from multipart/alternative ]
> > Huh not sure I understand but:
> >
> > C_BasePlayer* pPlayer = C_BasePlayer::GetLocalPlayer();
> >
> > if (pPlayer)
> > {
> > pPlayer->GetActiveWeapon()
> > }
> >
> > On 4/6/06, Michael Kramer <[EMAIL PROTECTED]> wrote:
> > >
> > > --
> > > [ Picked text/plain from multipart/alternative ]
> > > I have a weapon, in which you can select multiple things, using a VGUI
> > > Panel.
> > >
> > > After you select from this list, It needs to send the keyvalues of the
> > > selected item, back
> > > to the weapon and then , get the values from KeyValues.
> > >
> > > Basically the weapon calls
> > >
> > > engine->ClientCmd("ToggleSpellPanel");
> > >
> > > Which then toggles my panel.
> > >
> > > My panel then has a list, with added items,
> > >
> > > So basically what im wanting to know, is either how to send my Player,
> > or
> > > Weapon, the Currently Selected Items, KeyValues, (Which I know how to
> > get,
> > > just now howto send to player/weapon)
> > > .
> > >
> > > Any help would be greatly appreciated.
> > >
> > > Thanks
> > >
> > > -Kramer
> > > --
> > >
> > > _______________________________________________
> > > 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
> >
> >
> --
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>
--
Programmer for RnL
www.resistanceandliberation.com
--
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders