Some of you sure recognize this. Especially when have add one bot in game and server start generate nav file if it not exist.
And that time you almost can't do anything, you see your mouse cursor on screen and this panel what show server progress.
You can close this panel ALT+F4 or go your menu with ESC.
Lets create this.
*tip
Can quick test in game, type in console
showpanel nav_progress
hidepanel nav_progress
Simple way, using ShowVGUIPanel, we get it appear in player screen.
PHP Code:
ShowVGUIPanel(client, "nav_progress");
At this point if you get already some message and different load bar status, it's because there have been remaining some data last time when player seen this panel and have not been erased.
Yeah, this data are store in players.
As you can see my picture, it have not message and loading bar full (data empty).
Start customize our panel!
Need build proper keyvalue structure to get it work. (I peek from sourcecode2007)
/*
* Copy most from sourcecode2007 file.
* Will build keyvalue structure to panel "nav_progress"
*
* @param msg Message what will print to panel
* @param ticks Maximum loading bar ticks
* @param current Loading bar progress
* @param showPercent Add in message, progress in percent
*
*/
stock Handle:Build_NAV_PROGRESS( const String:msg[], ticks, current, bool:showPercent = true )
{
decl String:buffer[192];
buffer[0] = '\0';
new Handle:hBf = Handle:StartMessageOne("VGUIMenu", client);
BfWriteString(hBf, "nav_progress"); // Panel name
BfWriteChar(hBf, 0x01); // 0x01 (SOH) - Use normal color from this point forward
BfWriteChar(hBf, 0x03); // 0x03 (ETX) - Use team color from this point forward
BfWriteString(hBf, "msg"); // keyvalue name. Whole string would be "\x01\x03msg" in usermessage actually, thanks to above two characters.
BfWriteString(hBf, "My custom message"); // Message
BfWriteString(hBf, "total"); // keyvalue name
BfWriteString(hBf, "300"); // Max ticks in loading bar
BfWriteString(hBf, "current");// keyvalue name
BfWriteString(hBf, "30"); // Current loading bar status by ticks
EndMessage();
Last edited by Bacardi; 06-06-2012 at 10:05.
Reason: update title :P NOT WORK in TF2