Raised This Month: $ Target: $400
 0% 

Refresh menu / Get menu page?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Merudo
Senior Member
Join Date: Feb 2016
Old 04-08-2016 , 01:30   Refresh menu / Get menu page?
Reply With Quote #1

I wish to make a menu that updates itself constantly. My menu shows a list of players and their health, and the health is updated to reflect changes in health.

I do so by constantly showing the same menu every few seconds via timers.

It works great when there are only a few players (< 8 ). However once there are too many players, the menu system created a "next page" entry, and the menu thus has multiple pages.

The problem is that each time the timer shows the menu with updated info, the menu goes back to the first page. My questions are the following:

1. Is it possible to store the page the menu is at, and reopen it on that page?
2. If not, is there a better way to make menus that update themselves?
__________________

Last edited by Merudo; 04-08-2016 at 01:31.
Merudo is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-08-2016 , 03:56   Re: Refresh menu / Get menu page?
Reply With Quote #2

well there is GetMenuSelectionPosition()

But "This is only valid inside a MenuAction_Select callback"
It not get trigger by pagination (next, previous), need choose menu item.

And it is not recommended send fake client command "menuselect1" (or what was it ?) to interrupt player actions.

Should those menu "player" items to be selectable ?
Because you can fill menu with text and use multiple lines...
__________________
Do not Private Message @me
Bacardi is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 04-08-2016 , 04:17   Re: Refresh menu / Get menu page?
Reply With Quote #3

You can override a menu items text as it's drawn to make a dynamic menu.

I dont have an example right now but I learnt this through the standard wiki page for menus/panels.
__________________
Neuro Toxin is offline
Merudo
Senior Member
Join Date: Feb 2016
Old 04-08-2016 , 13:22   Re: Refresh menu / Get menu page?
Reply With Quote #4

Quote:
Originally Posted by Bacardi View Post
Should those menu "player" items to be selectable ?
Because you can fill menu with text and use multiple lines...
Yes, they need to be selectable. Otherwise as you said I'd just add a line for every person on the server.
__________________

Last edited by Merudo; 04-08-2016 at 13:28.
Merudo is offline
Merudo
Senior Member
Join Date: Feb 2016
Old 04-08-2016 , 13:27   Re: Refresh menu / Get menu page?
Reply With Quote #5

Quote:
Originally Posted by Neuro Toxin View Post
I dont have an example right now but I learnt this through the standard wiki page for menus/panels.
Are you referring to this: https://wiki.alliedmods.net/Custom_A...u_(SourceMod)?

It's not really helping me. I know how to display the menu once with the health information, I just don't know how to make it update itself as it is shown.
__________________
Merudo is offline
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 10:49.


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