AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   panel nav_progress [Cs:s] (https://forums.alliedmods.net/showthread.php?t=184088)

Bacardi 04-30-2012 17:54

panel nav_progress [Cs:s]
 
UserMessage "VGUIMenu" "nav_progress"

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)
It looks like this!

You build like this
PHP Code:

    new Handle:kv CreateKeyValues("data");
    
KvSetString(kv"msg",     "My own message");
    
KvSetNum(kv,    "total",    100);
    
KvSetNum(kv,    "current",  33); 

Then send it to player and close handel just make sure no leak appears.
PHP Code:

    ShowVGUIPanel(client"nav_progress"kv);
    
CloseHandle(kv); 



Here example plugin, if you want test for fun


When use UserMsg to send "nav_progress"
UserMessage

TnTSCS 04-30-2012 18:16

Re: panel nav_progress
 
nice... this would be good for a plugin or two of mine :)

ReFlexPoison 04-30-2012 21:44

Re: panel nav_progress
 
What games would this support?

Bacardi 05-01-2012 01:40

Re: panel nav_progress
 
Quote:

Originally Posted by ReFlexPoison (Post 1699658)
What games would this support?

Not sure,
- Cs:s show it center of screen.
- HL2MP & Dod:s show it little box upper left corner.
http://dl.dropbox.com/u/38118182/pictures/dodnav.jpg
I assume, in those games where bots use nav files, have better panel layout to see server progress when generate it. :?

It could depend players HUD/clientschemes files what kind panel it will create...

*edit
found, from <mod>/Resource/UI/NavProgress.res
*edit
Yep, I copy this file from Cs:s to HL2MP and it created same panel.

ReFlexPoison 05-02-2012 12:45

Re: panel nav_progress
 
Well, seeing that it will be supported in DoD and HL2:MP, I'm assuming it will work in TF2 aswell.
Only reason I say that is I've noticed that TF2 has many similar resources that DoD wand HL2:MP have. (Including Hud Text)

Blowst 05-04-2012 14:03

Re: panel nav_progress
 
Wow... Great!

Ixel 05-13-2012 08:54

Re: panel nav_progress
 
Nicely done but sadly doesn't work in Team Fortress 2.

bl4nk 05-14-2012 18:07

Re: panel nav_progress
 
Quote:

Originally Posted by Ixel (Post 1708104)
Nicely done but sadly doesn't work in Team Fortress 2.

Did you try copying the above mentioned file over? I noticed it wasn't included in the tf2 gcf files, so you could probably just download it to clients.

Bacardi 05-15-2012 07:55

Re: panel nav_progress
 
Quote:

Originally Posted by bl4nk (Post 1708982)
Quote:

Originally Posted by Ixel (Post 1708104)
Nicely done but sadly doesn't work in Team Fortress 2.

Did you try copying the above mentioned file over? I noticed it wasn't included in the tf2 gcf files, so you could probably just download it to clients.

I tested in TF2, with and without this NavProgress.res file.
I executed nav_generate to start creating nav file and there not appear any panel to show this "progress", in console it print output text.
Player can move during this progress but lags like hell...

NameUser 06-06-2012 01:15

Re: panel nav_progress
 
Quote:

Originally Posted by Bacardi (Post 1709312)
I tested in TF2, with and without this NavProgress.res file.
I executed nav_generate to start creating nav file and there not appear any panel to show this "progress", in console it print output text.
Player can move during this progress but lags like hell...

Maybe you're not supposed to (normally) move whilst a progress bar like that is happening?


All times are GMT -4. The time now is 20:06.

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