Recommended Posts

1 minute ago, thisdp said:

Got it. Will fix these days. Thanks to report bugs.

It seems to them that they do not exist

Share this post


Link to post
23 minutes ago, Fact55 said:

It seems to them that they do not exist

OK. I think it is fixed. plz update dgs with "updatedgs".

Share this post


Link to post
6 minutes ago, thisdp said:

OK. I think it is fixed. plz update dgs with "updatedgs".

http://imgur.com/tvMi7c0

Share this post


Link to post
On 2017/7/11 at 18:46, Axel said:

Can you not do smething like this: 

 


local nr = 8
function formatString( text ) -- function to format the entire text into a table
	if string.len(text) > nr then
		return string.sub(text, 1, nr-1), formatString( string.sub(text, nr) )
	else
		return text
	end
end

local testText = "we are testing here something, if it makes our table"
local textTable = { formatString(testText) }

And then just use the table in your code?

If the code works more efficiently, I can continue to finish the memo.

function getTextIndexFromPosition(text,font,position)
	local pos = 0
	for i=1,utf8.len(text) do
		local t = utf8.sub(text,i,i)
		local p = dxGetTextWidth(t,font)
		if position < pos+0.5*p then
			return index-1
		elseif position < pos+p then
			return index
		end
		pos = pos+p
	end
	return false
end

 

Share this post


Link to post

Well, dgsDxGridlistSetItemColor doesnt works or only for me.. You might check it

Share this post


Link to post
8 hours ago, Hamatora said:

Well, dgsDxGridlistSetItemColor doesnt works or only for me.. You might check it

thanks for your report, I will check it.

Share this post


Link to post
8 hours ago, Hamatora said:

Well, dgsDxGridlistSetItemColor doesnt works or only for me.. You might check it

Now I think I fixed it. plz updatedgs and check it.

Share this post


Link to post
6 minutes ago, thisdp said:

Hard to solve some problems.

You should make a GitHub repo and allow other people to contribute, it'll help in finding a solution faster.

Edited by Skully

Share this post


Link to post
1 hour ago, Skully said:

You should make a GitHub repo and allow other people to contribute, it'll help in finding a solution faster.

Good Idea, but I have never worked on it. xD

Share this post


Link to post

hi, it's need dgs script is running? because if all player joined the server and each one downloading 8mb or more  it's very high.???

Share this post


Link to post
3 hours ago, Ridden said:

hi, it's need dgs script is running? because if all player joined the server and each one downloading 8mb or more  it's very high.???

8MB? In dgs, there is just a msyh.tff ( a font ) that is big. But once a player downloaded it, it won't be download it again if he doesn't clear mta cache. 

Share this post


Link to post

ok thx. otherone question ;3 :

how can i bind it with a key, as dgs didn't have yet visible function?

Share this post


Link to post

i try to do a function for to open/close the panel by bindkey,but it show this error

 call:failed to call 'dgs:dgsDXGUISetVisible'[string"?"]

script file:

DGS = exports.dgs
matable = {}
matable.window = DGS:dgsDxCreateWindow (0.10, 0.28, 0.78, 0.29, "VIP panel", true)
matable.button = DGS:dgsDxCreateButton(0.34, 0.77, 0.31, 0.18, "set", true, window)
matable.label = DGS:dgsCreateLabel(0.42, 0.31, 0.36, 0.43, "TrollSkin", true, window)

function outputEditBox ( player)
	if source == matable.button then
	print("works1")
        			setElementModel(getLocalPlayer (player ) ,10 )
			print("skin of"..getPlayerName(player).."has been changed to VIP Troll Skin", 10, 186, 31)
				else 
				print("don't work")
		
    end
end



function guiToggleVisible ( )        
        if ( DGS:dgsDxGUIGetVisible ( window ) == true ) then -- check if the dgs element is visible               
                DGS:dgsDxGUISetVisible ( window, false ) -- if it is, we hide it
							showCursor(false)
							print("works2")
        else              
                DGS:dgsDxGUISetVisible ( window, true ) -- if not, we make it visible
							showCursor(true)
				end		
        end
		
bindKey ( "F2", "down", guiToggleVisible )
--EventHandlers


    addEventHandler ( "onClientDgsDxMouseClick", matable.button, outputEditBox )

 

Edited by Ridden

Share this post


Link to post

What is the tatu  Memo? Can you use that function for it? Can we help somehow?

Edited by Axel

Share this post


Link to post

@Ridden

DGS = exports.dgs
matable = {}
matable.window = DGS:dgsDxCreateWindow (0.10, 0.28, 0.78, 0.29, "VIP panel", true)
matable.button = DGS:dgsDxCreateButton(0.34, 0.77, 0.31, 0.18, "set", true, window)
matable.label = DGS:dgsCreateLabel(0.42, 0.31, 0.36, 0.43, "TrollSkin", true, window)

function outputEditBox ()
	if source == matable.button then
		setElementModel(getLocalPlayer(), 10)
		print("skin of"..getPlayerName(getLocalPlayer()).."has been changed to VIP Troll Skin", 10, 186, 31)
	else 
		print("don't work")
    end
end

function guiToggleVisible()        
	if (DGS:dgsDxGUIGetVisible(matable.window) == true) then               
		DGS:dgsDxGUISetVisible (matable.window, false) 
		showCursor(false)
		print("works2")
    else              
		DGS:dgsDxGUISetVisible(matable.window, true) 
		showCursor(true)
	end		
end
		
bindKey ("F2", "down", guiToggleVisible)
addEvent("onClientDgsDxMouseClick", true)
addEventHandler("onClientDgsDxMouseClick", matable.button, outputEditBox )

didn't really test but it should work

Edited by kikos500
  • Like 1
  • Thanks 1

Share this post


Link to post

maybe i can make a memo. but don't complain about the performance xD

Share this post


Link to post

Hi man,

very nice class but here are two things:

1. You wrote the wrong Script in the meta.xml (Line 84-86)

   <export function="dgsDxCreateRadioButton" type="client" />
    <export function="dgsDxRadioButtonGetSelected" type="client" />
    <export function="dgsDxRadioButtonGetSelected" type="client" />

You export the same Function two times, so dgsDxRadioButtonSetSelected don't work, if the user of the script don't edit it.

 

2. Can u update the GitHub Version ?

Share this post


Link to post
On 2017/8/17 at 02:58, SmoothGarlic said:

Hi man,

very nice class but here are two things:

1. You wrote the wrong Script in the meta.xml (Line 84-86)

   <export function="dgsDxCreateRadioButton" type="client" />
    <export function="dgsDxRadioButtonGetSelected" type="client" />
    <export function="dgsDxRadioButtonGetSelected" type="client" />

You export the same Function two times, so dgsDxRadioButtonSetSelected don't work, if the user of the script don't edit it.

 

2. Can u update the GitHub Version ?

OK, Thanks To Report ! :D

Share this post


Link to post

@thisdp Is the combobox working? I'm getting this error everytime I try to make one.

dgs\functions.lua:239: attempt to index field '?' (a nil value)

This is the code I'm testing it with;

addEventHandler("onClientResourceStart", resourceRoot,
    function()
        mainWindow = exports.dgs:dgsDxCreateWindow(0.65, 0.59, 0.22, 0.14, "ComboBox Window", true)
	        testCombo = exports.dgs:dgsDxCreateComboBox(0.09, 0.27, 0.52, 0.54, true, mainWindow)
        exports.dgs:dgsDxComboBoxAddItem(testCombo, "Test Item")
    end
)

I'm on update 2.75.

Edited by Skully

Share this post


Link to post

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.