Getting GUI width and height?
Discussion in 'Rust Development' started by DELPROTV, May 23, 2018.
-
Wulf Community Admin
You'd already have that info, as the plugin would be the one sending it. There's no way to get what CUI is currently displayed on the client that I am aware of, you can only send.
-
Ok, how send new width to CUI panel?
Simple default plugin config values
How can i send new BackgroundColor or Height value to change it, from plugin use ChatCommand or ConsoleCommandCode:"ProgressBar": { "AnchorX": "Left", "AnchorY": "Bottom", "BackgroundColor": "0.2 0.75 0.2 1", "FadeOut": 0.0, "Height": 0.7, "Margin": "0 -0.05 0.1 0.01", "Width": 1 }, -
Wulf Community Admin
Destroy the old, and send the new as you sent the first one. -
Hm, thx i try...
-
Wulf Community Admin
If you aren't already storing the previous instance's name, you'll need to do that in order to destroy it. Most GUI plugins will have examples of this. -
The question is more about how to download it again, I just have not one panel
-
Wulf Community Admin
Download what? If you mean send the CUI to the client, the you'd create it and send it like you did originally. -
Sorry (= How can like me again load the panel after destroy
-
DELPROTV, you should abstract the creation of your CUI to a reusable method, then use that to create the GUI initially. When you need to update it, destroy the existing CUI and then execute that same method to generate the CUI like you did initially, only this time with the new information/changes.
Think of it like this...
- Create first CUI reflecting your current data, use a static name or store the name.
- Something happens that requires changing the CUI.
- Destroy the first CUI using it's name, start back at #1.
