Well, I've made a basic one with decent functionality.
Only supports DButton and DTextEntry, but it's not hard to add new controls.
My question is, should I continue with it?
It generates the derma code at the end using the names you have given the controls. You can change the size of the window etc and drag and drop it. It hardly took any time and works quite well.
So.. Yeah.. If I add all the derma controls would you like me to release it? It'd save everyone a hell of a lot of time in my opinion :P
Latest Screenshot:
[IMG]http://img688.imageshack.us/img688/1120/ataboutmidnight.png[/IMG]
Below this line is a reply where I added a screenshot and generated code to go with it:
Alright I can't be bothered to post it tonight, it's midnight.
The screenshot and code is of RANDOM BULLSHIT because I'd have to be a sad fuck to recreate that just to make you all believe me.
I'll add ALL the Derma controls at a later point. I'll start tommorow.
So here's a screenshot:
[IMG]http://img62.imageshack.us/img62/1550/dermaide.png[/IMG]
Generated code to go along with that image:
[code]
local Random_bullshit_is_fun = vgui.Create("DFrame")
Random_bullshit_is_fun:SetSize(745.5,489.5)
Random_bullshit_is_fun:Center()
Random_bullshit_is_fun:SetTitle("Random bullshit is fun")
Random_bullshit_is_fun:MakePopup()
local New_Button1 = vgui.Create("DButton", Random_bullshit_is_fun)
New_Button1:SetSize(289.5, 42)
New_Button1:SetPos(28.5, 46)
New_Button1:SetText("New Button")
New_Button1.DoClick = function( New_Button1 )
// your code here
end
local New_Button2 = vgui.Create("DButton", Random_bullshit_is_fun)
New_Button2:SetSize(289.5, 42)
New_Button2:SetPos(34.5, 193)
New_Button2:SetText("New Button")
New_Button2.DoClick = function( New_Button2 )
// your code here
end
local New_Button3 = vgui.Create("DButton", Random_bullshit_is_fun)
New_Button3:SetSize(289.5, 42)
New_Button3:SetPos(72, 130)
New_Button3:SetText("New Button")
New_Button3.DoClick = function( New_Button3 )
// your code here
end
local New_Button4 = vgui.Create("DButton", Random_bullshit_is_fun)
New_Button4:SetSize(289.5, 42)
New_Button4:SetPos(379.5, 53.5)
New_Button4:SetText("New Button")
New_Button4.DoClick = function( New_Button4 )
// your code here
end
local New_Button5 = vgui.Create("DButton", Random_bullshit_is_fun)
New_Button5:SetSize(289.5, 42)
New_Button5:SetPos(397.5, 115)
New_Button5:SetText("New Button")
New_Button5.DoClick = function( New_Button5 )
// your code here
end
local New_Button6 = vgui.Create("DButton", Random_bullshit_is_fun)
New_Button6:SetSize(289.5, 42)
New_Button6:SetPos(187.5, 164.5)
New_Button6:SetText("New Button")
New_Button6.DoClick = function( New_Button6 )
// your code here
end
local New_Button7 = vgui.Create("DButton", Random_bullshit_is_fun)
New_Button7:SetSize(289.5, 42)
New_Button7:SetPos(169.5, 83.5)
New_Button7:SetText("New Button")
New_Button7.DoClick = function( New_Button7 )
// your code here
end
local New_Button8 = vgui.Create("DButton", Random_bullshit_is_fun)
New_Button8:SetSize(289.5, 42)
New_Button8:SetPos(69, 250)
New_Button8:SetText("New Button")
New_Button8.DoClick = function( New_Button8 )
// your code here
end
local DTextEntry9 = vgui.Create("DTextEntry", Random_bullshit_is_fun)
DTextEntry9:SetSize(289.5, 37.5)
DTextEntry9:SetPos(70.5, 319)
DTextEntry9:SetText("Default Text")
local DTextEntry10 = vgui.Create("DTextEntry", Random_bullshit_is_fun)
DTextEntry10:SetSize(289.5, 37.5)
DTextEntry10:SetPos(51, 383.5)
DTextEntry10:SetText("")
[/code]
That shows that it has default text and non-default text.
Also, when you click on a DTextEntry, it gives Name and Text as options, so thought I'd say that.
I'll add more like Editable etc later.
EDIT:
New preview!
Design View:
[IMG]http://img717.imageshack.us/img717/2388/designview.png[/IMG]
^^ Note just noticed a bug in that where the properties label didn't change - I'll fix that now, but just ignore it.
Code output:
[CODE]
local Cake_Window = vgui.Create("DFrame")
Cake_Window:SetSize(320,420)
Cake_Window:Center()
Cake_Window:SetTitle("Cake Window")
Cake_Window:MakePopup()
local Click_for_old_Cake1 = vgui.Create("DButton", Cake_Window)
Click_for_old_Cake1:SetSize(289.5, 42)
Click_for_old_Cake1:SetPos(16.5, 125.5)
Click_for_old_Cake1:SetText("Click for old Cake")
Click_for_old_Cake1.DoClick = function( Click_for_old_Cake1 )
// your code here
end
local Click_for_stale_Cake2 = vgui.Create("DButton", Cake_Window)
Click_for_stale_Cake2:SetSize(289.5, 42)
Click_for_stale_Cake2:SetPos(15, 218.5)
Click_for_stale_Cake2:SetText("Click for stale Cake")
Click_for_stale_Cake2.DoClick = function( Click_for_stale_Cake2 )
// your code here
end
local Click_for_Cake7 = vgui.Create("DButton", Cake_Window)
Click_for_Cake7:SetSize(289.5, 42)
Click_for_Cake7:SetPos(13.5, 29.5)
Click_for_Cake7:SetText("Click for Cake")
Click_for_Cake7.DoClick = function( Click_for_Cake7 )
// your code here
end
local Click_for_fudge_Cake9 = vgui.Create("DButton", Cake_Window)
Click_for_fudge_Cake9:SetSize(289.5, 42)
Click_for_fudge_Cake9:SetPos(16.5, 316)
Click_for_fudge_Cake9:SetText("Click for fudge Cake")
Click_for_fudge_Cake9.DoClick = function( Click_for_fudge_Cake9 )
// your code here
end
local DTextEntry3 = vgui.Create("DTextEntry", Cake_Window)
DTextEntry3:SetSize(289.5, 37.5)
DTextEntry3:SetPos(15, 176.5)
DTextEntry3:SetText("")
local DTextEntry6 = vgui.Create("DTextEntry", Cake_Window)
DTextEntry6:SetSize(289.5, 37.5)
DTextEntry6:SetPos(15, 77.5)
DTextEntry6:SetText("")
local DTextEntry8 = vgui.Create("DTextEntry", Cake_Window)
DTextEntry8:SetSize(289.5, 37.5)
DTextEntry8:SetPos(16.5, 269.5)
DTextEntry8:SetText("")
local DTextEntry10 = vgui.Create("DTextEntry", Cake_Window)
DTextEntry10:SetSize(289.5, 37.5)
DTextEntry10:SetPos(18, 364)
DTextEntry10:SetText("")
[/CODE]
In-Game View:
[IMG]http://img249.imageshack.us/img249/6910/ingameview.png[/IMG]
Note: I'll change where the code is outputted, make it into a proper menu, etc later.
Screenshot:
[IMG]http://img651.imageshack.us/img651/2686/dlistviewhu.png[/IMG]
If you want a really old and horrible version use this:
[url=http://www.garrysmod.org/downloads/?a=view&id=96467][img]http://www.garrysmod.org/img/?t=dll&id=96467[/img][/url]
It's awful and read the description.
Can you post some images of it in actions, and maybe give some details on how you make a simple derma menu.
It would help [b]a lot[/b] of lazy people, such as myself.
A great feature would be to add (Commented out) empty function examples of each method. Just so as people get arguments right and such.
[editline]06:52PM[/editline]
Not that I would use it, but it would be useful for those learning to study the outputted code, and for lazy people.
Would save loads of time. I say; do it :)
I tried making this. It's a lot harder than it sounds. :xd:
[QUOTE=grea$emonkey;21350424]I tried making this. It's a lot harder than it sounds. :xd:[/QUOTE]
Same :frown:
[QUOTE=Kopimi;21350725]Same :frown:[/QUOTE]
I tried it in VB mind you. I could probably make this in lua if I had the time.
[QUOTE=grea$emonkey;21350980]I tried it in VB mind you. I could probably make this in lua if I had the time.[/QUOTE]
Exactly this. I felt like doing it last week, never did because I have exams coming up, for which I failed the prelim exam. Probably will make one sometime in June if I get the chance.
I'll give it a try tomorrow.
I take it the overall vote is yes?
Well, it works decently :P
Want me to post a video or something for evidence?
Yes.
Alright I can't be bothered to post it tonight, it's midnight.
The screenshot and code is of RANDOM BULLSHIT because I'd have to be a sad fuck to recreate that just to make you all believe me.
I'll add ALL the Derma controls at a later point. I'll start tommorow.
So here's a screenshot:
[IMG]http://img62.imageshack.us/img62/1550/dermaide.png[/IMG]
Generated code to go along with that image:
[code]
local Random_bullshit_is_fun = vgui.Create("DFrame")
Random_bullshit_is_fun:SetSize(745.5,489.5)
Random_bullshit_is_fun:Center()
Random_bullshit_is_fun:SetTitle("Random bullshit is fun")
Random_bullshit_is_fun:MakePopup()
local New_Button1 = vgui.Create("DButton", Random_bullshit_is_fun)
New_Button1:SetSize(289.5, 42)
New_Button1:SetPos(28.5, 46)
New_Button1:SetText("New Button")
New_Button1.DoClick = function( New_Button1 )
// your code here
end
local New_Button2 = vgui.Create("DButton", Random_bullshit_is_fun)
New_Button2:SetSize(289.5, 42)
New_Button2:SetPos(34.5, 193)
New_Button2:SetText("New Button")
New_Button2.DoClick = function( New_Button2 )
// your code here
end
local New_Button3 = vgui.Create("DButton", Random_bullshit_is_fun)
New_Button3:SetSize(289.5, 42)
New_Button3:SetPos(72, 130)
New_Button3:SetText("New Button")
New_Button3.DoClick = function( New_Button3 )
// your code here
end
local New_Button4 = vgui.Create("DButton", Random_bullshit_is_fun)
New_Button4:SetSize(289.5, 42)
New_Button4:SetPos(379.5, 53.5)
New_Button4:SetText("New Button")
New_Button4.DoClick = function( New_Button4 )
// your code here
end
local New_Button5 = vgui.Create("DButton", Random_bullshit_is_fun)
New_Button5:SetSize(289.5, 42)
New_Button5:SetPos(397.5, 115)
New_Button5:SetText("New Button")
New_Button5.DoClick = function( New_Button5 )
// your code here
end
local New_Button6 = vgui.Create("DButton", Random_bullshit_is_fun)
New_Button6:SetSize(289.5, 42)
New_Button6:SetPos(187.5, 164.5)
New_Button6:SetText("New Button")
New_Button6.DoClick = function( New_Button6 )
// your code here
end
local New_Button7 = vgui.Create("DButton", Random_bullshit_is_fun)
New_Button7:SetSize(289.5, 42)
New_Button7:SetPos(169.5, 83.5)
New_Button7:SetText("New Button")
New_Button7.DoClick = function( New_Button7 )
// your code here
end
local New_Button8 = vgui.Create("DButton", Random_bullshit_is_fun)
New_Button8:SetSize(289.5, 42)
New_Button8:SetPos(69, 250)
New_Button8:SetText("New Button")
New_Button8.DoClick = function( New_Button8 )
// your code here
end
local DTextEntry9 = vgui.Create("DTextEntry", Random_bullshit_is_fun)
DTextEntry9:SetSize(289.5, 37.5)
DTextEntry9:SetPos(70.5, 319)
DTextEntry9:SetText("Default Text")
local DTextEntry10 = vgui.Create("DTextEntry", Random_bullshit_is_fun)
DTextEntry10:SetSize(289.5, 37.5)
DTextEntry10:SetPos(51, 383.5)
DTextEntry10:SetText("")
[/code]
That shows that it has default text and non-default text.
Also, when you click on a DTextEntry, it gives Name and Text as options, so thought I'd say that.
I'll add more like Editable etc later.
I may just try doing this in Lua. When I get time. So probably not for a while.
Holy crap, yes continue it, yes release what you've got. You'd save me loads of time.
you should output it as a main panel registered to be used later
[lua]
local PANEL = {}
function PANEL:Init()
--blah blah
end
vgui.Register("PanelName",PANEL,"DFrame")
[/lua]
Rather than just creating the panel straight up like that
Then you could add features like vertical dividers and other stuff without it getting messy
yay, i might be able to actually make menus now!
[QUOTE=NonExistent;21348338]My question is, should I continue with it?[/QUOTE]
Pluhleez continue with it.
The whole reason I don't do Derma is because I don't have the patience to place things so with this I won't be :smithicide:'ing every time I try to make them.
I think you should do a pre-release :sax: because even with just the DTextentry and DButton it would save so much time for everyone
Yeah Brosky i hate spending the time on menus! This would save me so much time!
Admittedly I've already used it for something and just changed the controls :P
Oh and DarkSpider, maybe I'll do something like that another time, I'd rather get it done with a lot of the controls ready before I do anything else.
The size of frame should be done with ScrH() & ScrW() so its the same for everyone
Yeah, I gathered that, but I want to keep it simple for now until it's finished.
The way I'm coding it allows me to change that stuff quickly, but I want to finish it before doing that.
I never had a problem placing derma windows since there are functions that help you align them. And I usually use the ones that put derma stuff inside them and automatically aligns them in order. (I can't remember which one it was, it's been a while since I did anything lua related in gmod)
[editline]10:49AM[/editline]
This could be good for some things, but the example you're doing could easily be done without the IDE and more so properly.
This is designed for VERY quick design. It'll have all the main controls soon anyway.
Just added DLabel. I'm going to work on tabs today, once that's done I'll do spawn icons, then all the standard stuff.
[QUOTE=Overv;21353394]I'll give it a try tomorrow.[/QUOTE]
In Lua?
Done DListView now as well.
Evidence:
Design View:
[IMG]http://img651.imageshack.us/img651/2686/dlistviewhu.png[/IMG]
^^ Note: Columns are added by a test box that only shows up if you have a DListView selected. It's in this format: Name;SteamID
Code Output:
[code]
local DermaWindow = vgui.Create("DFrame")
DermaWindow:SetSize(745.5,489.5)
DermaWindow:Center()
DermaWindow:SetTitle("DermaWindow")
DermaWindow:MakePopup()
local DListView1 = vgui.Create("DListView", DermaWindow)
DListView1:SetSize(700, 294)
DListView1:SetPos(21, 32.5)
DListView1:SetText("DListView")
DListView1:AddColumn("Name")
DListView1:AddColumn("SteamID")
local Kick2 = vgui.Create("DButton", DermaWindow)
Kick2:SetSize(289.5, 42)
Kick2:SetPos(21, 340)
Kick2:SetText("Kick")
Kick2.DoClick = function( Kick2 )
// your code here
end
local Ban3 = vgui.Create("DButton", DermaWindow)
Ban3:SetSize(289.5, 42)
Ban3:SetPos(430.5, 340)
Ban3:SetText("Ban")
Ban3.DoClick = function( Ban3 )
// your code here
end
local Slay4 = vgui.Create("DButton", DermaWindow)
Slay4:SetSize(289.5, 42)
Slay4:SetPos(21, 409)
Slay4:SetText("Slay")
Slay4.DoClick = function( Slay4 )
// your code here
end
local Mute5 = vgui.Create("DButton", DermaWindow)
Mute5:SetSize(289.5, 42)
Mute5:SetPos(430.5, 409)
Mute5:SetText("Mute")
Mute5.DoClick = function( Mute5 )
// your code here
end
[/code]
In-Game:
[IMG]http://img88.imageshack.us/img88/1719/dlistviewingame.png[/IMG]
Your God.
That is looking very nice cant wait for a release
Going to start on DPanels now. I've coded a parenting system so to speak now. What this means is you type either the derma windows name or the DPanels name, and it will attach it to that, if you get what I mean. It did mean I had to change the positioning code, but even though I haven't added DPanels I've already done that :p
By default however, the parent is the main window, and changing the parent will not change the position on the window, so you'll have to make sure it's in a decent place, not outside of it (I really can't be bothered to code THAT).
NonExistent, this is awesome as hell dude.
You should do a pre-release, whenever you're done adding the DPanels.
For everyones sake :D
I, myself, am having some problems with Derma at the moment.
I've made a SNPC, which opens a Derma Menu when you press "Use" on him, and that works fine.
But whenever I press a button, I have 2 which both should close the menu, nothing happens.
I have to freaking spam the button to close the menu, gotta click like 8 times.
If anyone's got a solution, I've already made a thread about this, so please reply there.
@ Topic again; Still awesome :]
[editline]15:41[/editline]
[QUOTE=Dave_Parker;21348360]Sure why not.[/QUOTE]
Enthusiasm for the win, huh?
Sorry, you need to Log In to post a reply to this thread.