1. 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.
     
  2. 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.
     
  3. 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 :)
     
  4. Sounds good, thanks :)
     
  5. I'm also developing a plugin in python, but I have yet to do any GUI work. I'll be watching this thread closely!
     
  6. chekc out Draw for Rust | Oxide
    [DOUBLEPOST=1456942619,1456891610][/DOUBLEPOST]I will try to make something soon as soon as i finish my current plug-in.
     
  7. 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.
     
  8. Wulf

    Wulf Community Admin

    Oxide provides the Rust CUI helper, so you should be able to use it just fine, no JSON needed. Oxide/RustCui.cs at master · OxideMod/Oxide · GitHub
     
  9. Just take in mind that this is .net, so you're dealing with IronPython, not much difference, but learning Pyke to code a 2.7 version could cause you to create bad habbits or coding things wrong.
    [DOUBLEPOST=1456980346][/DOUBLEPOST]
    Im not sure about that, I did made some test plugins when the namespaces were finally whitelisted to Python, but something else kept pushing me back, and still needed some more Oxide support. But I've deleted these tests a while ago so I can't really point out what was wrong.

    Never the less, perhaps some else should give it a shot and see if it works.
     
  10. Wulf, thanks for the information. I will try this top priority today at home to make a working example plug-in on Python to help out.
     
  11. 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))
    This gives the following output:
    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'>
     
  12. I will be looking into this soon, thanks for the info.
     
  13. Just FYI , you dont need to importa Rust, none of my plugins have it and never brought me any issues
     
  14. I guess you can use all the default CuiHelper functions as you see them in the InfoPanel (cs).
     
  15. Is there a way to make GUI with python for rust plugins?
     
  16. Yes. I'm writing plugin in python half of gui is done.
    [DOUBLEPOST=1460034256][/DOUBLEPOST]
    Hey, can you explain me how to load images? I don't understand that part of Cui class. Classes Cui Image doesn't have reacttransform to hold positon on the the screen. I tried to research InfoPanel.cs but without results. Other components I can use easily.
     
  17. 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:

  18. In my opinion, calling some other plugin's functions is not using Python for the UI features, is more like a way around it. Don't take me wrong though, after all the goal was to use some UI , true... but as a Python "fan boy" I would rather have a Python plugin doing what GUIAnnouncements does as much useless some people in this community might think that is.

    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.
     
  19. Wulf

    Wulf Community Admin

    To me it sounded likely he copied some elements (hence the "mashup"), not using other plugins. ;)
     
  20. 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