Raised This Month: $51 Target: $400
 12% 

IN Game Menu -


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RenEvo
New Member
Join Date: Dec 2004
Old 01-02-2005 , 23:37   IN Game Menu -
Reply With Quote #1

Hey guys, was wondering exactly how forcing the client to show a menu could be done. I saw that Mani pulled it off quite smoothly, and love that ability.

I read up a bit on everything that has posted so far, and can pretty much follow anything you post up. If it helps to know, i have already implemented serverside posting of chat messages using IRecipientFilter etc... Just to show i can get the hang of stuff lol.

Anywho, i played around for about 4 hours last night before my head started hurting from the frustration.

Why couldn't valve had done there "menu" sample as that type of menu and not a freekin builtin VGUI2 menu stored on the clientside....

anywho, if anyone can help me out, that would be totally great.

Thanks in advance.
RenEvo is offline
RenEvo
New Member
Join Date: Dec 2004
Old 01-03-2005 , 03:14  
Reply With Quote #2

Well, after taking a long break today, and coming back to it.

I have it figured out, as well as all the other user messages.

I am going to make a helper class for them with documentation and post it up sometime this week.
RenEvo is offline
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 01-03-2005 , 07:55  
Reply With Quote #3

Sounds good, I've been trying to figure this out as well.
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
RenEvo
New Member
Join Date: Dec 2004
Old 01-05-2005 , 15:51  
Reply With Quote #4

until i can get this sample & doc finished, here is a quick rundown.

First, you will need to be able to do the saytext example that is on this forum (usermessage 3 using bitbuff.h & bitbuff.cpp as well as having your own MRecipientFilter created).

now, from there, instead of sending message 3, you will send message 9.

From this point, you can find the correct ordering in the menu.cpp that is located in the cpp look for the ShowMenu function, from memory it is:

Short
Byte
*Char

short = bitfield of items the user can select (i.e. 1-9 + 0)
byte = true/false of whether this is the last send
*char = the text

for the bitfield, you will need to do the following format, then convert to short:

100 0000 0000

starting AFTER the 1, it starts in reverse order, and acts like a true false, 1 for true, 0 for false.

so

110 0000 0011 is will make it so that the user can enter 1, 2, and 0

110 0001 1111 will make it so the user can select 1,2,3,4,5 and 0

111 1111 1111 will make it so options 1-9 and 0 can be selected.

remember that you DONT have to do your text in order, as long as you know what option links.

i.e. Say you send the following menu:

775
false
Pick an Option\n1. Option 1\n2. Option 2\n3. Option 3\n \n0. Exit\n

775 = bitfield 110 000 0111 (use calculator with the scientific view if you aren't familiar with binary)

false = there are no more for this menu, so display it

the last line is the text for the menu, and will display like the following

Code:
Pick an Option
1. Option 1
2. Option 2
3. Option 3
 
0. Exit
options will be returned as user commands in the following format:

menuselect %d

where %d is the number they chose


hope that provides enough information for you, and i hope i remembered everything, if you have any troubles, please post your code, and im sure i can spot the issue.


I should have the full version up soon, with code samples.
RenEvo is offline
RenEvo
New Member
Join Date: Dec 2004
Old 01-05-2005 , 15:54  
Reply With Quote #5

*note, if you don't use the 0 for an entry, the actual function is as follows:

if (yournum & (1 << selectedNum -1))

thats what is ran, so for just 1, 2, and 3, your bitfield would be

1111, which = 15
RenEvo is offline
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 01-05-2005 , 16:04  
Reply With Quote #6

Sweet thats perfect, thanks!!!!
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
theqizmo
Member
Join Date: Oct 2004
Old 01-08-2005 , 17:45  
Reply With Quote #7

Code:
//-----------------------------------------------------------------------------
// Purpose: Message handler for ShowMenu message
//   takes four values:
//		short: a bitfield of keys that are valid input
//		char : the duration, in seconds, the menu should stay up. -1 means is stays until something is chosen.
//		byte : a boolean, TRUE if there is more string yet to be received before displaying the menu, false if it's the last string
//		string: menu string to display
//  if this message is never received, then scores will simply be the combined totals of the players.
//-----------------------------------------------------------------------------
theqizmo is offline
Send a message via ICQ to theqizmo Send a message via AIM to theqizmo Send a message via MSN to theqizmo
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 15:52.


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