Files

> > CS2D > Lua Scripts > VisualLua [v1.3]
Files overviewCS2D overviewLua Scripts overview

English VisualLua [v1.3] >

119 comments7 kb, 1,565 Downloads

old VisualLua [v1.3]

EngiN33R
Moderator Off Offline

Some of you have probably noticed that CS2D has few UI functions. It's not enough for me, so I decided to make UI functions myself. And therefore, behold - the VisualLua mod!

Sorry everyone, the window creating function was absent in the uploaded version! Thanks to user tom282f3 for pointing that out. Updated now.

Features:
√ Create UI elements - windows, buttons, text
√ Customize them any way you want - style sheet tables
√ Hover and click states for buttons
√ Assign ANY Lua functions to buttons - they will be executed on button click

Documentation about style sheet tables is INSIDE the archive in a txt file. Read it if you want to add your own styles.

Comments about usage of functions and their arguments are in the script before every function.

Write anything that's not clear to you in the comments - I'll gladly explain.

Video preview: http://www.youtube.com/watch?v=WKPjjVrtNog

Style tables documentation:
More >


Examples of usage:
More >


EDIT 1: If box versions of this are ever to be released, then they'll probably look like the third image

Download, rate and comment, but most importantly - have fun.
edited 6×, last 10.03.15 02:48:50 pm
Approved by Starkkz

Download Download

7 kb, 1,565 Downloads

Comments

119 comments
Page
To the start Previous 1 2 3 4 5 6 Next To the start

Log in!

You need to log in to be able to write comments!Log in

old

Rygna
User Off Offline

something error when combine it with Serveraction
1
2
3
4
5
6
7
8
9
10
11
12
13
LUA ERROR: sys/lua/vl.lua:260: attempt to concatenate local 'b' (a nil value)
 -> sys/lua/vl.lua:260: in function 'colorcode'
 -> sys/lua/vl.lua:239: in function 'createButton'
 -> sys/lua/1.lua:8: in function <sys/lua/1.lua:3>
 -> in Lua hook 'serveraction', params: 1, 3
1
1

LUA ERROR: sys/lua/vl.lua:260: attempt to concatenate local 'b' (a nil value)
 -> sys/lua/vl.lua:260: in function 'colorcode'
 -> sys/lua/vl.lua:239: in function 'createButton'
 -> sys/lua/1.lua:8: in function <sys/lua/1.lua:3>
 -> in Lua hook 'serveraction', params: 1, 3

old

ChasPeR
BANNED Off Offline

WOW its COOL im love this , i love robots too i love all robots and look like robots
i like it
I like it!

old

Waldin
User Off Offline

new menus? omg this is amazing
I like it!
edited 2×, last 26.05.16 07:36:29 pm

old

Ajmin
User Off Offline

WoW.
extremely great.
I like it!

old

ImTihh
User Off Offline

Engin33R you're amazing man!!
I like it!

old

Avo
User Off Offline

@user Gajos: We've got a badass here. Go, learn Engin33r how he should script.

---

Edit (after user Gajos's edit):
Quote
10 kB * 11 vars = 110 kb + 1,7 kB * 3 = 15,1 kB
110 kb or 11kB? Something is wrong here.

And I really think that your Internet connection speed is 7,2Mb/s, not 7,2MB/s.

More >
I like it!
edited 1×, last 23.08.13 11:08:36 pm

old

Gajos
BANNED Off Offline

Do you know why your visual lua lagging?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
addhook("clientdata","vl.read")
function vl.read(ply,type,a1,a2)
	if type==0 then
		for buttons=1,1024 do
			if (not player(ply,"bot")) then
				if (a1>=vl.buttonpos[buttons][1]-vl.buttonsize[buttons][1]/2 and a1<=vl.buttonpos[buttons][1]+vl.buttonsize[buttons][1]/2 and a2>=vl.buttonpos[buttons][2]-vl.buttonsize[buttons][2]/2 and a2<=vl.buttonpos[buttons][2]+vl.buttonsize[buttons][2]/2) then
					--if (vl.buttonply[buttons]==ply) then
						vl.hoverButton(buttons,ply)
					--end
				else
					--if (vl.buttonply[buttons]==ply) then
						vl.dehoverButton(buttons,ply)
					--end
				end
			end
		end
	end
end


addhook("ms100","vl.send")
function vl.send()
	for ply=1,32 do
		if (player(ply,"exists")) then
			reqcld(ply,0)
		end
	end
end

1024B = 1kB
so
If ten people use this then
10 * 1kB = 10kB

10 kB * 11 vars = 110 kb + 1,7 kB * 3 = 150,1 kB

My internet is 7,2MB / sec
idk why this lagging.
I like it!
edited 4×, last 23.08.13 11:18:03 pm

old

G3tWr3ck3d
User Off Offline

The script is awesome, I appreciate engy for his scripts
and @Lubo you suck ! No offence
I like it!

old

Sneaky
BANNED Off Offline

Happy Halloween! xDDD
I like it!

old

EngiN33R
Moderator Off Offline

@user Noname12345 -GER-: What sort of USGN authorisation are you talking about? This is an interface library.

You can see the examples to get an answer to your other question.

old

Noname12345 -GER-
User Off Offline

is there an usgn authorization?
how to put commands and names on the button?
thats too complex

old

Divine
User Off Offline

Lol i love the box
I like it!

old

Suprise
BANNED Off Offline

Cool script
I like it!

old

EndDead
User Off Offline

Awes0me!
Thanks for it, gonna learn some new things in lua by it
I like it!

old

Viper97
User Off Offline

how to use visual lua?
I would even add these Welcome, but do not know how to do it ;/

old

Lubo
User Off Offline

OMG I said LAU!
No way!
Now I have to cry that i am not a nerd.
I don't give a shit

old

Jela331
User Off Offline

Lubo has written
lau


Epic shit.
I like it!

old

Lubo
User Off Offline

well I don't know what is your proble...
puberty?
To the start Previous 1 2 3 4 5 6 Next To the start