Hey,
As part of me learning how things work and my plugins I am working on I am playing around with a concept similar to InfoPanel for Rust | Oxide.
One thing I am looking at is when and how to call the UI render update.
So far I have thought of either using a repeating timer at a specific interval or the OnTick hook. Each time a render update would happen it will;
1. Iterate through the list of players.
2. For each player iterate through the list of "ui frames" and see what needs to be updated (destroy/addui).
[Probably answering my own question here] What I have gathered is that using OnTick might cause some lag, especially if the server is large, but this could be overcome telling it to only process it every nth OnTick.
The last way of doing it, which could be the right way (thought of it as I was writing this) is to update all players UIs when things happen pertaining to the specific or all users. For example, let's say I want to have an icon like Info Panel which shows the HeliCopter, then OnEntitySpawn (if heli) I will update all players UI (same with when players join or leave to track online players).
Regards
UI Render Update (Place to Call)
Discussion in 'Rust Development' started by IŊŦΣCҴ¤Ŋ, May 16, 2016.
