Hello,
Does anyone have an example of GUI in the game in python? Although I'm looking for docs about libs which are available on OXIDE runtime.
GUI example for Python?
Discussion in 'Rust Development' started by zloidemon, Jan 23, 2016.
-
I also made a plug-in in Python. I will soon be posting some useful documentation for Python as soon as I figure out how to add references for Methods for example the Friends API as some of the imports are blocked.
-
As far as I know the only plugins written in Python so far are Notifier, welcome messages, Rules & adverts.
[DOUBLEPOST=1456846851,1456628019][/DOUBLEPOST]Very cool, I'm still learning to program with Python 3 - So far I've learned a huge amount just from checking out the different plugins already out there for Oxide - Unfortunately I'm still a rather weak programmer. I'll keep an eye out for that plugin! If you need a test server let me know -
Sounds good, thanks
-
I'm also developing a plugin in python, but I have yet to do any GUI work. I'll be watching this thread closely!
-
[DOUBLEPOST=1456942619,1456891610][/DOUBLEPOST]I will try to make something soon as soon as i finish my current plug-in. -
As far as I know it's not quite possible to add UI with Python at the moment, this is something I tried before, but to be honest I don't recall the issue in hand, but I remember talking with Wulf and Nogrod about this, but nothing was really done but they whitelisted the required namespaces to Python.
I believe the issue was because there wasn't a way to format JSON in python code , or something like that, but I also remember that I forgot to test a new method using u (unicode) in the JSON strings in code. -
Wulf Community Admin
-
[DOUBLEPOST=1456980346][/DOUBLEPOST]
Never the less, perhaps some else should give it a shot and see if it works. -
-
I'm doing some research too.
Look at this:
Code:import Rust import Oxide.Game.Rust.Cui as Cuiclass test3: def __init__(self): self.Title = "Python UI Test" self.Description = "Parses UI Test" self.Author = "Mijago" self.Version = V(0, 1, 1) for a,b in Cui.__dict__.iteritems(): print ("%s %s" % (a,b))
Code:[Oxide] 10:35 PM [Info] CuiPanel <type 'CuiPanel'> [Oxide] 10:35 PM [Info] CuiRawImageComponent <type 'CuiRawImageComponent'> [Oxide] 10:35 PM [Info] ComponentConverter <type 'ComponentConverter'> [Oxide] 10:35 PM [Info] CuiElementContainer <type 'CuiElementContainer'> [Oxide] 10:35 PM [Info] CuiOutlineComponent <type 'CuiOutlineComponent'> [Oxide] 10:35 PM [Info] CuiNeedsCursorComponent <type 'CuiNeedsCursorComponent'> [Oxide] 10:35 PM [Info] CuiRectTransformComponent <type 'CuiRectTransformComponent'> [Oxide] 10:35 PM [Info] CuiImageComponent <type 'CuiImageComponent'> [Oxide] 10:35 PM [Info] CuiLabel <type 'CuiLabel'> [Oxide] 10:35 PM [Info] CuiButton <type 'CuiButton'> [Oxide] 10:35 PM [Info] CuiHelper <type 'CuiHelper'> [Oxide] 10:35 PM [Info] CuiElement <type 'CuiElement'> [Oxide] 10:35 PM [Info] ICuiColor <type 'ICuiColor'> [Oxide] 10:35 PM [Info] CuiTextComponent <type 'CuiTextComponent'> [Oxide] 10:35 PM [Info] CuiButtonComponent <type 'CuiButtonComponent'> [Oxide] 10:35 PM [Info] ICuiComponent <type 'ICuiComponent'>
-
I will be looking into this soon, thanks for the info.
-
Just FYI , you dont need to importa Rust, none of my plugins have it and never brought me any issues
-
I guess you can use all the default CuiHelper functions as you see them in the InfoPanel (cs).
-
Is there a way to make GUI with python for rust plugins?
-
[DOUBLEPOST=1460034256][/DOUBLEPOST] -
After about 2 hours of work I have managed to make a simple plugin with a GUI entirely in python, and it works.
It's a mashup of the Notifier Plugin by SkinN and JoeSheep's GUIAnnouncements. It can display a simple text message into a simple GUI at the top of every player's screen. At the moment it's just a hardcoded message as it's a proof of concept. but it works! Send me a message if you'd like to know more.-Mojo
Attached Files:
-
-
EDIT: My point with this is, with your way, you're making people having to download a third party plugin for yours to work, just seems blaaah... also is just some other plugin running on your server. -
Wulf Community Admin
-
ah ha sorry for the confusion - my python code is entirely standalone and just borrows elements from the other two plugins!
It basically performs the job of GUIAnnouncements but in python instead of cs