Jump to content

Recommended Posts

On 07.06.2017 at 19:06, thisdp said:

Ok. DGS 1.62 Update has been delivered with new tab panel. You can find the update notice when you run dgs.

To find the update log : http://angel.mtaip.cn:233/dgsUpdate/

I think the tab panel isn't smarter than that you do yourself by dgs-dximage and dgs-dxbutton or dgs-dxgridlist

Very good update! 

Now you need to make memo, checkbox, radio button and small functions, and everyone could change their entire gui's to this better looking one!

Example of functions (not tested):


function dgsDxLabelSetColor(label, r,g,b,a)
	if isElement(label) then
		dgsSetData(label,"textcolor",tocolor(r or 255,g or 255,b or 255,a or 255))
		return true
	end
	return false
end

function dgsDxLabelGetColor(label, r,g,b,a)
	if isElement(label) then
		local r,g,b,a = dgsGetData(label,"textcolor")
		return r,g,b,a
	end
	return false
end

(in Core/label.lua)

Edited by Axel
Link to comment
  • Scripting Moderators
1 hour ago, Axel said:

Very good update! 

Now you need to make memo, checkbox, radio button and small functions, and everyone could change their entire gui's to this better looking one!

Example of functions (not tested):


function dgsDxLabelSetColor(label, r,g,b,a)
	if isElement(label) then
		dgsSetData(label,"textcolor",tocolor(r or 255,g or 255,b or 255,a or 255))
		return true
	end
	return false
end

function dgsDxLabelGetColor(label, r,g,b,a)
	if isElement(label) then
		local r,g,b,a = dgsGetData(label,"textcolor")
		return r,g,b,a
	end
	return false
end

(in Core/label.lua)

Good idea. And here is a funny property

DGS = exports.dgs
local labelfunction = [[return math.random(0,100)]]
local label = DGS:dgsDxCreateLabel(100,100,30,10,"test",false)
DGS:dgsDxGUISetProperty(label,"functions",labelfunction)

 

1 hour ago, Axel said:

Very good update! 

Now you need to make memo, checkbox, radio button and small functions, and everyone could change their entire gui's to this better looking one!

Example of functions (not tested):


function dgsDxLabelSetColor(label, r,g,b,a)
	if isElement(label) then
		dgsSetData(label,"textcolor",tocolor(r or 255,g or 255,b or 255,a or 255))
		return true
	end
	return false
end

function dgsDxLabelGetColor(label, r,g,b,a)
	if isElement(label) then
		local r,g,b,a = dgsGetData(label,"textcolor")
		return r,g,b,a
	end
	return false
end

(in Core/label.lua)

Update has pushed

Edited by thisdp
  • Like 1
Link to comment
2 hours ago, thisdp said:

Good idea. And here is a funny property


DGS = exports.dgs
local labelfunction = [[return math.random(0,100)]]
local label = DGS:dgsDxCreateLabel(100,100,30,10,"test",false)
DGS:dgsDxGUISetProperty(label,"functions",labelfunction)

 

Update has pushed

Now that we are at label functions, we could do guiLabelSetHorizontalAlign and guiLabelSetVerticalAlign counterparts. This might work:

 

function dgsDxLabelSetHorizontalAlign(label,align)
	assert(dgsGetType(label) == "dgs-dxlabel","@dgsDxLabelSetHorizontalAlign at argument 1, except a dgs-dxlabel got "..(dgsGetType(label) or type(label)))
	if tostring(align) then
		return dgsSetData(label,"rightbottom",{align or "center",dgsElementData[label].rightbottom[2] or "bottom"})
	end
end

function dgsDxLabelSetVerticalAlign(label,align)
	assert(dgsGetType(label) == "dgs-dxlabel","@dgsDxLabelSetVerticalAlign at argument 1, except a dgs-dxlabel got "..(dgsGetType(label) or type(label)))
	if tostring(align) then
		return dgsSetData(label,"rightbottom",{dgsElementData[label].rightbottom[1] or "center",align or "bottom"})
	end
end

 

Edited by Axel
Link to comment
[2017-06-13 00:13:33] WARNING: Script 'dgs/code.lua' is not encoded in UTF-8.  Loading as ANSI...
[2017-06-13 00:13:33] SCRIPT ERROR: dgs/code.lua:1: unexpected symbol near '?'
[2017-06-13 00:13:33] ERROR: Loading script failed: dgs/code.lua:1: unexpected symbol near '?'
[2017-06-13 00:13:33] ERROR: dgs/update.lua:9: attempt to call global 'DPXLDecode' (a nil value)

Getting these errors whilst starting it? Tried to upgrade the script via console, still nothing.

Link to comment
  • Scripting Moderators
20 minutes ago, mint3d said:

[2017-06-13 00:13:33] WARNING: Script 'dgs/code.lua' is not encoded in UTF-8.  Loading as ANSI...
[2017-06-13 00:13:33] SCRIPT ERROR: dgs/code.lua:1: unexpected symbol near '?'
[2017-06-13 00:13:33] ERROR: Loading script failed: dgs/code.lua:1: unexpected symbol near '?'
[2017-06-13 00:13:33] ERROR: dgs/update.lua:9: attempt to call global 'DPXLDecode' (a nil value)

Getting these errors whilst starting it? Tried to upgrade the script via console, still nothing.

You can not upgrade dgs if this script load failed. Plz redownload it. I don't think mtaserver can not load compiled script. This will be a bug of mta, if your server can't load compiled script while others' can.

Edited by thisdp
Link to comment
  • Scripting Moderators
6 minutes ago, eggman said:

Why is it compiled? you didn't answer the first time. You said it contains server update stuff, but you didn't say why you compiled it. Just post the decompiled version so there won't be any issues.

Why I compiled it is that I just want to protect the version. And I don't have the source code of it either.xD If you think it is useless, I will delete it.

Link to comment
  • Scripting Moderators
23 hours ago, Axel said:

Now that we are at label functions, we could do guiLabelSetHorizontalAlign and guiLabelSetVerticalAlign counterparts. This might work:

 


function dgsDxLabelSetHorizontalAlign(label,align)
	assert(dgsGetType(label) == "dgs-dxlabel","@dgsDxLabelSetHorizontalAlign at argument 1, except a dgs-dxlabel got "..(dgsGetType(label) or type(label)))
	if tostring(align) then
		return dgsSetData(label,"rightbottom",{align or "center",dgsElementData[label].rightbottom[2] or "bottom"})
	end
end

function dgsDxLabelSetVerticalAlign(label,align)
	assert(dgsGetType(label) == "dgs-dxlabel","@dgsDxLabelSetVerticalAlign at argument 1, except a dgs-dxlabel got "..(dgsGetType(label) or type(label)))
	if tostring(align) then
		return dgsSetData(label,"rightbottom",{dgsElementData[label].rightbottom[1] or "center",align or "bottom"})
	end
end

 

DGS  2.64 with 4 functions has pushed.


	<export function="dgsDxLabelSetHorizontalAlign" type="client" />
	<export function="dgsDxLabelSetVerticalAlign" type="client" />
	<export function="dgsDxLabelGetHorizontalAlign" type="client" />
	<export function="dgsDxLabelGetVerticalAlign" type="client" />

 

Edited by thisdp
  • Like 1
Link to comment
  • Scripting Moderators
3 hours ago, Hamatora said:

Wow great.. I suggest if there were a tab panel enabling

tab panel is already done.

Link to comment
  • Scripting Moderators
12 hours ago, Hamatora said:

dgsDxGUISetEnabled only works on button I mean it should work on tabs too

It doesn't works on tab panel? I haven't tested it yet. xD

Edited by thisdp
Link to comment
  • Scripting Moderators

dgsSetData and dgsGetData are interior functions ( if you use it outside, will cause problems)

You can use dgsDxGUISetProperty and dgsDxGUIGetProperty instead.

Actually I don't have any idea on how to make ComboBoxes and Memo.

7 minutes ago, Axel said:

For label, the last functions needed are: 

You should also export the functions:


	<export function="dgsGetData" type="client" />	<export function="dgsSetData" type="client" />

They can be usefull.

Also have you thought about doing something like ComboBoxes, ut more like this than the original gui

jquery-combobox-bound-to-remote-data.png

  •  

The fonts in dgs are created by dxCreateFont.

Edited by thisdp
Link to comment
  • Scripting Moderators
Just now, Axel said:

Indeed, memo and comboox are pretty difficult and if not possible, comine actual gui in mta with your functions. We should let it for the last, until then, for progress bar: 

It is much easier and usefull. There is even a usefull function on wiki: dxDrawProgressBar or dxDrawLoading

This one is easy. I will try to script memo and comboBox

Link to comment

Really good job

But listen my friend, i tried to make simple Dx Window but i didn't know how to set it visible, i used the function but nothing, can you just give me an example of simple window script and lemme solve my problem . and Thnx

Link to comment
  • Scripting Moderators
5 hours ago, xMKHx said:

Really good job

But listen my friend, i tried to make simple Dx Window but i didn't know how to set it visible, i used the function but nothing, can you just give me an example of simple window script and lemme solve my problem . and Thnx

dxDraw* in onClientRender?

Link to comment
  • Scripting Moderators
On 2017-6-8 at 01:22, eggman said:

Pretty nice of you to release this. I can tell by looking at the code that you've put in a lot of time and effort into this. I'm just wondering though, could you tell me what code.lua is/does? The file seems to be compiled.

Now I deleted it.

  • Like 1
Link to comment
  • Scripting Moderators
3 hours ago, Senpai said:

I can try to help you

Thx. If there are some problem that you want to solve. You can contact me. :D

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...