InsanityServers

Join the community and register Smile

...or login as an existing member!
InsanityServers Dark RP is Open to all Beta-testers Join now@ 50.31.23.173:27015

    I'm having GUI trouble

    Share
    avatar
    Ray Hopkins
    Dev Team
    Dev Team

    Posts : 29
    Join date : 2012-05-13
    Age : 24
    Location : Pheonix, Arizona

    I'm having GUI trouble

    Post  Ray Hopkins on Tue May 15, 2012 7:14 pm

    I know this isnt me showing off my code, but i did this, and i don't know how to use the command for it. I tried binding a key to say +our_concommand in the console, but nothing is popping up. please help.



    Code:
    function frame_create()
       frame = vgui.Create("DFrame")
       frame:SetPos(50,50)
       frame:SetSize(500,350)
       frame:SetTitle("Testing Derma Controls")
       frame:SetVisible(false)
       frame:SetDraggable(true)
       frame:ShowCloseButton(true)
       frame:SetBackgroundBlur(false)
       frame:MakePopup()

       button = vgui.Create("DButton",frame)
       button:SetText("Suicide")
       button:SetPos(5,27)
       button:SetSize(150,50)
       button.DoClick = function()
          error("Derma Is Da Best! (Left Click)")
       end
       button.DoRightClick = function()
          error("Woohoo! (Right Click)")
       end
    end

    function frame_open()
       frame:SetVisible(true)
    end

    function frame_close()
       frame:SetVisible(false)
    end

    concommand.Add("-our_concommand",frame_close)
    concommand.Add("+our_concommand",frame_open)
    hook.Add("Initialize","frame_create",frame_create)


    _________________
    I got two pickles I got two pickles I got two pickles yeah...yeah yeah.
    avatar
    Kittai
    Dev Team
    Dev Team

    Posts : 8
    Join date : 2012-05-14
    Age : 22
    Location : United States

    Re: I'm having GUI trouble

    Post  Kittai on Tue May 15, 2012 8:38 pm

    You don't have a function for your +-our_concommand. Do this:
    Code:
    function frame_command()
    concommand.Add("-our_concommand",frame_close)
    concommand.Add("+our_concommand",frame_open)
    end
    hook.Add("Initialize", "frame_command", frame_command)
    avatar
    Ray Hopkins
    Dev Team
    Dev Team

    Posts : 29
    Join date : 2012-05-13
    Age : 24
    Location : Pheonix, Arizona

    Re: I'm having GUI trouble

    Post  Ray Hopkins on Wed May 16, 2012 8:14 am

    Odd...I just noticed that when I join a server, it says

    LuaGetfile: Not Loading autorun\client\New Menu.lua
    Couldn't include file 'autorun\client\New Menu.lua' (File not found) (<nowhere>)


    _________________
    I got two pickles I got two pickles I got two pickles yeah...yeah yeah.

    Sponsored content

    Re: I'm having GUI trouble

    Post  Sponsored content


      Current date/time is Fri Nov 16, 2018 4:04 pm