Jump to content

Recommended Posts

  • Scripting Moderators
On 2017/11/13 at 11:36, Lowner said:

dgsDxGUIBringToFront dont work with dgsDxCreateEdit.
If I try to do:


dgsDxGUIBringToFront (EditBox, 'left')
dgsDxEditSetCaretPosition (EditBox, 1)


The cursor simply flashes and I can not start writing without clicking the mouse on the dgsDxCreateEdit.

I don't have such problem. try to update your dgs to the latest version with  updatedgs

Edited by thisdp
Link to comment

Hi there.

I have an idea for you, as soon as you seem to be interested in GUI programming. I'm not using your GUI system, but what I want to suggest has nothing to do with specific GUI, it's more like MTA problem atm.

So, when you're programming a GUI, you are forced to constantly keep in mind all those numbers: buttons positions, windows sizes, font scales and so on. This information is a garbage that doesn't really help to improve script logic, but acts like stones attached to your legs that doesn't allow your brain to put some ideas into working script as fast as you may want to.

So what I suppose for you is to make an editor where you can create GUI using drag/drop technique, that will generate GUI script automatically. This will allow brain to focus on things that really matter (design, comfort of usage, game logic), instead of wasting energy on dealing with garbage.

If you are interested in making improvements over your current script version (maybe v2.0?) I guess this is a worthy thing to go for.

P.S. Thanks for your efforts anyways.

  • Like 2
Link to comment
  • Scripting Moderators
7 hours ago, AfterAll14 said:

Hi there.

I have an idea for you, as soon as you seem to be interested in GUI programming. I'm not using your GUI system, but what I want to suggest has nothing to do with specific GUI, it's more like MTA problem atm.

So, when you're programming a GUI, you are forced to constantly keep in mind all those numbers: buttons positions, windows sizes, font scales and so on. This information is a garbage that doesn't really help to improve script logic, but acts like stones attached to your legs that doesn't allow your brain to put some ideas into working script as fast as you may want to.

So what I suppose for you is to make an editor where you can create GUI using drag/drop technique, that will generate GUI script automatically. This will allow brain to focus on things that really matter (design, comfort of usage, game logic), instead of wasting energy on dealing with garbage.

If you are interested in making improvements over your current script version (maybe v2.0?) I guess this is a worthy thing to go for.

P.S. Thanks for your efforts anyways.

Thanks for your advice. Actually my dxlib focus on the designing. There are a lot of properties of every dxgui. Most of original gui functions can be replaced by dgs' ones directly.

Link to comment
  • Scripting Moderators

Thanks for your report. And I will fix them soon.

2 hours ago, Ahmed Ly said:

that function doesn't work 



dgsDxMemoSetReadOnly

 

 

8 hours ago, Taka said:

dgsDxEditSetMaxLength not work if paste text through dgsDxGUISetText

 

  • Like 2
Link to comment

Why memo invisible? No errors

function openSmsWindow(number)
	smartGUI.sms.smsLabel = DGS:dgsDxCreateLabel(0.05, 0.15, 1, 0.1, "Введите SMS для номера "..number.."", true, smartGUI.desktop, 0xFF000000)
	smartGUI.sms.memo = DGS:dgsDxCreateMemo(0.1, 0.3, 0.8, 0.4, "WHERE YOU?!", true, smartGUI.desktop, 0xFF0000FF, 1, 1, nil, 0xFFBFBFBF)
end

k9TiIjb.png

Edited by Taka
  • Like 1
Link to comment
  • Scripting Moderators
2 minutes ago, Taka said:

Why memo invisible? No errors


function openSmsWindow(number)
	smartGUI.sms.smsLabel = DGS:dgsDxCreateLabel(0.05, 0.15, 1, 0.1, "Введите SMS для номера "..number.."", true, smartGUI.desktop, 0xFF000000)
	smartGUI.sms.memo = DGS:dgsDxCreateMemo(0.1, 0.3, 0.8, 0.4, "WHERE YOU?!", true, smartGUI.desktop, 0xFF0000FF, 1, 1, nil, 0xFFBFBFBF)
end

k9TiIjb.png

What will it happen when you turn off "debugdgs" ?

Link to comment
  • Scripting Moderators
1 hour ago, Taka said:

Nothing. Memo still invisible. 

If enter a lot of characters horizontally, it starts to work, but if enter a lot of characters vertically, it broken.

The problem is found.

Edited by thisdp
Link to comment
local AnimationWindow = exports.EKdgs:dgsDxCreateWindow(584,226,262,421,"TRYO ~ Animasyonlar",false)
local stop = exports.EKdgs:dgsDxCreateButton(9,367,122,25,"Durdur",false,AnimationWindow)
local close = exports.EKdgs:dgsDxCreateButton(133,367,120,25,"Kapat",false,AnimationWindow)
local animgrid = exports.EKdgs:dgsDxCreateGridList(9,3,244,358,false,AnimationWindow)
local column1 = exports.EKdgs:dgsDxGridListAddColumn(animgrid,"Kategoriler",0.35)
local column2 = exports.EKdgs:dgsDxGridListAddColumn(animgrid,"Animasyon",0.5)

for i=1,#anims do
	local cato, name = anims[i][1], anims[i][2]
	local row = exports.EKdgs:dgsDxGridListAddRow ( animgrid )
	exports.EKdgs:dgsDxGridListSetItemText ( animgrid, row, column1, cato, false, false )
	exports.EKdgs:dgsDxGridListSetItemText ( animgrid, row, column2, name, false, false )
	exports.EKdgs:dgsDxGridListSetItemData ( animgrid, row, column1, {anims[i][3],anims[i][4]} )
end

And buttons havent got wordwrap. Add it and it will be good. Thanks.

  • Like 1
Link to comment
  • Scripting Moderators
51 minutes ago, ahmedo01 said:

local AnimationWindow = exports.EKdgs:dgsDxCreateWindow(584,226,262,421,"TRYO ~ Animasyonlar",false)
local stop = exports.EKdgs:dgsDxCreateButton(9,367,122,25,"Durdur",false,AnimationWindow)
local close = exports.EKdgs:dgsDxCreateButton(133,367,120,25,"Kapat",false,AnimationWindow)
local animgrid = exports.EKdgs:dgsDxCreateGridList(9,3,244,358,false,AnimationWindow)
local column1 = exports.EKdgs:dgsDxGridListAddColumn(animgrid,"Kategoriler",0.35)
local column2 = exports.EKdgs:dgsDxGridListAddColumn(animgrid,"Animasyon",0.5)

for i=1,#anims do
	local cato, name = anims[i][1], anims[i][2]
	local row = exports.EKdgs:dgsDxGridListAddRow ( animgrid )
	exports.EKdgs:dgsDxGridListSetItemText ( animgrid, row, column1, cato, false, false )
	exports.EKdgs:dgsDxGridListSetItemText ( animgrid, row, column2, name, false, false )
	exports.EKdgs:dgsDxGridListSetItemData ( animgrid, row, column1, {anims[i][3],anims[i][4]} )
end

And buttons havent got wordwrap. Add it and it will be good. Thanks.

DGS:dgsDxGUISetProperty(button,"wordbreak",true)

1 hour ago, ahmedo01 said:

Good library. Thanks for it.

http://prntscr.com/hcf9e8

I have a gridlist and second column is blurred why? Can you help me with that?

Don't worry about it, it will be fixed in the next update/version.

Thanks for your advice.

Link to comment

I got a very important bug. Needs hot fix.

I use edit in my gui and added this code

addEventHandler("onClientDgsDxGUITextChange", add_item_amount, function(element)
            fixEdits()
            LAST_AMOUNT = exports.EKdgs:dgsDxGUIGetText(add_item_amount)
            reloadPriceCalc()
        end)

function fixEdits()
    local price = tonumber(exports.EKdgs:dgsDxGUIGetText(add_item_price))
    local amount = tonumber(exports.EKdgs:dgsDxGUIGetText(add_item_amount))
    local buyamount = tonumber(exports.EKdgs:dgsDxGUIGetText(buy_select_edit))
    if not price then
        exports.EKdgs:dgsDxGUISetText(add_item_price,"")
    end
    if not amount then
        exports.EKdgs:dgsDxGUISetText(add_item_amount,"")
    end
    if not buyamount then
        exports.EKdgs:dgsDxGUISetText(buy_select_edit,"")
    end
    if exports.EKdgs:dgsDxGUIGetText(add_item_price):len() > 5 then
        exports.EKdgs:dgsDxGUISetText(add_item_price,LAST_PRICE)
    end
    if exports.EKdgs:dgsDxGUIGetText(add_item_amount):len() > 5 then
        exports.EKdgs:dgsDxGUISetText(add_item_amount,LAST_AMOUNT)
    end
    if exports.EKdgs:dgsDxGUIGetText(buy_select_edit):len() > 5 then
        exports.EKdgs:dgsDxGUISetText(buy_select_edit,LAST_BUYAMOUNT)
    end
end
function reloadPriceCalc()
    local price = tonumber(exports.EKdgs:dgsDxGUIGetText(add_item_price)) or 0
    local amount = tonumber(exports.EKdgs:dgsDxGUIGetText(add_item_amount)) or 0
    exports.EKdgs:dgsDxGUISetText(GUIEditor.label[5],"Toplam: $"..(price*amount))
    local buyamount = tonumber(exports.EKdgs:dgsDxGUIGetText(buy_select_edit))
    if buyamount then
        exports.EKdgs:dgsDxGUISetText(GUIEditor.label[10],"Alınacak eşya sayısı: "..buyamount)
    end
    local selectedbuy = exports.EKdgs:dgsDxGridListGetSelectedItem( items_list )
    if selectedbuy and selectedbuy > -1 and buyamount then
        local idata = exports.EKdgs:dgsDxGridListGetItemData( items_list, selectedbuy, 1 )
        exports.EKdgs:dgsDxGUISetText(GUIEditor.label[12],"Ödenecek miktar: $"..(buyamount * idata.price))
    end
end

and when you try to enter something into edit. Game freeze''.s. Waiting for fix.

  • Like 1
Link to comment
  • Scripting Moderators
On 2017/11/20 at 02:44, ahmedo01 said:

I think it's about dgsDxGUISetText.

Stack Over Flow. I mean you make the code into a dead loop.

If you set text under the event "onClientDgsDxGUITextChange" without conditions. It will lead the thread into a dead loop.

TextChanged->SetText->TextChanged->SetText...

 

From your code I think that what you need may be this function.

dgsDxEditSetWhiteList(edit,"[^0-9$]")
On 2017/11/19 at 21:40, ahmedo01 said:

Good library. Thanks for it.

http://prntscr.com/hcf9e8

I have a gridlist and second column is blurred why? Can you help me with that?

I fixed the problem, updatedgs.

Edited by thisdp
  • Thanks 1
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...