Axel Posted June 12, 2017 Share Posted June 12, 2017 (edited) 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 June 12, 2017 by Axel Link to comment
Scripting Moderators thisdp Posted June 12, 2017 Author Scripting Moderators Share Posted June 12, 2017 (edited) 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 June 12, 2017 by thisdp 1 Link to comment
Axel Posted June 12, 2017 Share Posted June 12, 2017 (edited) 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 June 12, 2017 by Axel Link to comment
mint3d Posted June 12, 2017 Share Posted June 12, 2017 [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 thisdp Posted June 12, 2017 Author Scripting Moderators Share Posted June 12, 2017 (edited) 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 June 12, 2017 by thisdp Link to comment
PeaceBomb99 Posted June 12, 2017 Share Posted June 12, 2017 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. Link to comment
Scripting Moderators thisdp Posted June 12, 2017 Author Scripting Moderators Share Posted June 12, 2017 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. If you think it is useless, I will delete it. Link to comment
Scripting Moderators thisdp Posted June 13, 2017 Author Scripting Moderators Share Posted June 13, 2017 (edited) 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 June 13, 2017 by thisdp 1 Link to comment
Hamatora Posted June 13, 2017 Share Posted June 13, 2017 Wow great.. I suggest if there were a tab panel enabling Link to comment
Scripting Moderators thisdp Posted June 13, 2017 Author Scripting Moderators Share Posted June 13, 2017 3 hours ago, Hamatora said: Wow great.. I suggest if there were a tab panel enabling tab panel is already done. Link to comment
Hamatora Posted June 13, 2017 Share Posted June 13, 2017 dgsDxGUISetEnabled only works on button I mean it should work on tabs too Link to comment
Scripting Moderators thisdp Posted June 14, 2017 Author Scripting Moderators Share Posted June 14, 2017 (edited) 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. Edited June 14, 2017 by thisdp Link to comment
Axel Posted June 14, 2017 Share Posted June 14, 2017 (edited) For label, the last functions needed are: guiLabelGetFontHeight guiLabelGetTextExtent 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 Edited June 14, 2017 by Axel Link to comment
Scripting Moderators thisdp Posted June 14, 2017 Author Scripting Moderators Share Posted June 14, 2017 (edited) 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: guiLabelGetFontHeight guiLabelGetTextExtent 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 The fonts in dgs are created by dxCreateFont. Edited June 14, 2017 by thisdp Link to comment
Axel Posted June 14, 2017 Share Posted June 14, 2017 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: guiCreateProgressBar guiProgressBarGetProgress guiProgressBarSetProgress It is much easier and usefull. There is even a usefull function on wiki: dxDrawProgressBar or dxDrawLoading Link to comment
Scripting Moderators thisdp Posted June 14, 2017 Author Scripting Moderators Share Posted June 14, 2017 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: guiCreateProgressBar guiProgressBarGetProgress guiProgressBarSetProgress 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
xMKHx Posted June 14, 2017 Share Posted June 14, 2017 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 thisdp Posted June 14, 2017 Author Scripting Moderators Share Posted June 14, 2017 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 thisdp Posted June 15, 2017 Author Scripting Moderators Share Posted June 15, 2017 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. 1 Link to comment
Senpai Posted June 15, 2017 Share Posted June 15, 2017 I'm glad to see how far things got with this... Love the new functions. Keep up the good work @thisdp 1 Link to comment
Scripting Moderators thisdp Posted June 15, 2017 Author Scripting Moderators Share Posted June 15, 2017 4 hours ago, Senpai said: I'm glad to see how far things got with this... Love the new functions. Keep up the good work @thisdp thanks. Link to comment
Scripting Moderators thisdp Posted June 16, 2017 Author Scripting Moderators Share Posted June 16, 2017 (edited) Any one who can help me to finish the wiki page? https://wiki.multitheftauto.com/wiki/Dgs I will write down his/her contribution on the wiki page. It is very huge for me to finish these things myself. Edited June 16, 2017 by thisdp Link to comment
Senpai Posted June 17, 2017 Share Posted June 17, 2017 On 6/16/2017 at 06:36, thisdp said: Any one who can help me to finish the wiki page? https://wiki.multitheftauto.com/wiki/Dgs I will write down his/her contribution on the wiki page. It is very huge for me to finish these things myself. I can try to help you Link to comment
Scripting Moderators thisdp Posted June 17, 2017 Author Scripting Moderators Share Posted June 17, 2017 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. Link to comment
Scripting Moderators thisdp Posted June 18, 2017 Author Scripting Moderators Share Posted June 18, 2017 (edited) On 2017-6-14 at 07:18, Hamatora said: dgsDxGUISetEnabled only works on button I mean it should work on tabs too Update dgs. And now tabs can be disabled. Update Logs are here: http://angel.mtaip.cn:233/dgsUpdate/ Edited June 18, 2017 by thisdp Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now