Giter Club home page Giter Club logo

dgs's People

Contributors

ahmed-ly avatar alexbavgamer avatar armisael2k avatar crosroad95 avatar deihim007 avatar dmi7ry avatar eragon007 avatar flyingfork avatar gta191977649 avatar kingleonide avatar martinofy avatar mrsol0 avatar obaidah-jbreel avatar pieter-dewachter avatar ratajvaver avatar temois avatar thisdp avatar truestm avatar unde-r avatar vschst avatar xlive avatar zhvachka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dgs's Issues

absSize

image

when i try create checkbox inside tab tabpanel

on .38 my code work fine.

dgsGetVisible misfunction

Line 273 in fucntions.lua
if not dgsElementData[p].visible then return false end
p doesn't exist as if it does the loop will break
Not sure what the idea is of that code but I changed it to
if dgsElementData[p] and not dgsElementData[p].visible then return false end
To make it work

Problem with edit

Hi
i have a trouble with dgs
i used dgs to a custom chat and when i'm trying to write after a turn on writing, dgs is "blocked" and i cant write
i'm using dgs to a loginpanel and everything is ok, only in custom chat is problem

Line of creating :
typing_message=exports.dgs:dgsCreateEdit((28/1920)*s.x, (348/1080)*s.y, (277/1920)*s.x, (30/1080)*s.y,"",false,false,tocolor(0,0,0,255),1,1,false,tocolor(0,0,0,0))

turn on writing

addEventHandler("onClientKey",root,function(button,state)
if button=="t" and not state and not typing then
toggleAllControls(false)
exports.dgs:dgsSetVisible(typing_message,true)
exports.dgs:dgsFocus(typing_message)
exports.dgs:dgsSetFont(typing_message,font_dgs)
exports.dgs:dgsSetText(typing_message,"")
typing=true
showCursor(false)

and when i taped "t", i cant write in this edit
not always, 50/50, one time i can and one time i cant

i use this version

https://community.multitheftauto.com/index.php?p=resources&s=details&id=14420

i dont wanna to update to latest version, because size of text in edit in new version dont working in dgsCreateEdit

Creating memo with relative size doesn't work

As the title says, I am unable to create memo with relative size, but I fixed my problem with one line of code added at line 55 in file core/memo.lua. I'd create pull request but I don't know how can I do that.
local renderTarget = dxCreateRenderTarget(abx-4,aby,true)

dgsDxGridListGetSelectedItem returns even if nothing selected

dgsDxGridListGetSelectedItem is used to get the value of a selected item in grid list, but even if nothing is selected, it returns a value.

Example:

local myItem = dgsDxGridListGetSelectedItem(gridList)

if (myItem) then -- It will always be this
     outputDebugString("Something was selected.", 3)
else
    outputDebugString("Nothing is selected.", 3)
end

So you cannot check if a player did not select anything yet.

Layouts system

Hi, do you have any plans to implement a system for automatic layout of GUI components? Here are some examples of the idea from GUI toolkits in other languages:

What do you think about it? Could such layouting concept land in the DGS? I think it would be a great feature and would speed up GUI development a bit but it would probably take some good amount of time to implement it well.

It appears that r20765 broke DGS

On the nightly that did this change to the textures something broke in DGS. No debug message appears, but I am unable to close any window or even move them correctly.

In r20762 it works just fine. I didn't test other versions, but I suspect that this or probably this broke DGS.

Video about the issue: https://youtu.be/OvjEY4L7khI

If it can't be fixed due to being a problem with MTA I could make an issue about it, but I didn't take the time to dissect the problem or read the DGS code.

EDIT: The bug starts happening on r20765. I think it's related to the editbox since DGS brakes after seeing one afaik.

This could be the issue.

dxbutton iconImage doesn't update

local btn = dgsCreateButton(0.15, 0.2, 0.3, 0.2, "A simple button", true)
dgsSetProperties(
    btn,
    {
        ["iconImage"] = ":ThisResource/Files/SomeImage.png",
    }
)

The first problem is that dgs won't load the image if you simply use relative path to current resources files, e.g ("File/Images/SomeImage.png")

and the second one works but if you change the file server-side and restart that resource, the texture won't get updated

Solution:
Maybe we can attach an event handler with onClientResourceStart/Stop when a file get's loaded from that resource and reload the textures loaded from that resource into dgs

OOP PostGUI always TRUE

When using OOP all elements are always postGUI TRUE, even using :setPostGUI(false). POP version (dgsSetPostGUI) works fine.

I'm using wiki OOP window example, adding :setPostGUI(false)

 loadstring(exports.dgs:dgsImportOOPClass(true))()-- load OOP class
 window = dgsWindow(0,0,0.5,0.1,"test",true):setPostGUI(false) --create a window with oop
 label = window:dgsLabel(0,0,1,1,"label",true) --create a label inside the window ( Correct )
 label.text = "DGS OOP Test" --set text

dgsGridListClear removes scrollbars from gridlist

If you create a gridlist and give it alot of columns so it has scroll bars, then use dgsGridListClear on it, the gridlist is cleared.

After this if you add items into the gridlist again, they will no longer have scroll bars.

These lines clear the scrollbars completely so they do not exist anymore even if it is needed.

dgsSetData(scrollbars[1],"length",{0,true})

dgsSetVisible(scrollbars[1],false)

dgsSetCustomCursorImage

dgs/Core/customCursor.lua
Line 14
Fix
From:
local texture = dgsCreateTextureFromStyle(_,_style[k].image)
To:
local texture = dgsCreateTextureFromStyle(using, res, style[k].image)

Scrollbar in gridlist bug

When i both left mouse button and click the right or middle mouse button on scroll bar, on debugscript3 appears: ERROR: dgs\Core\scrollbar.lua:274: attempt to index field 'MoveScroll' (a boolean value)

image

dgsGridListSetItemText

Can you check this function: dgsGridListSetItemText?Just standart guiGridListSetItemText works with this script, but dgsGridListSetItemText doesn't
[2018-01-24 14:55:11] ERROR: dgs\Core\gridlist.lua:444: attempt to index field '?' (a nil value)
[2018-01-24 14:55:11] ERROR: [DayZ-MTA][system][addons]\addons_building\client.lua:91: call: failed to call 'dgs:dgsGridListSetItemText' [string "?"]

HLDisk color pick issue

When setting the color to 255, 255, 255 in a HLDisk you can not change the color anymore (besides darker shade of white only)
255, 255, 254 works

DGS does a memory leak (Streaming video card etc.. a lot of kb and even after closing it doesn't get better)

Hello, I just want to point out and also ask how should I delete all ELEMENTS when DGS elements are deleted using destroyElement but the KB still remains in Lua Memory, for example, in a few windows it is added but then deleted again, but after spamming the given script, the MTA subsequently crashes and or the images (dxCreateTexture) or (dgsCreateImage) are not shown at first, so after spamming that script, they do not show after a while and become white, and then the MTA client crashes. I'm asking for help on how to improve this and make it so that all elements are removed, I'm using the mod for RolePlay, more precisely OWLGAMING 2020, which is almost entirely redone by Odem and another scripter and is also de facto completely changed to DGS, so as I say please help or simply how to remove that save from DGS.

Add property to change dgs selector behavior

image

I'm a fan of the DGS Selector. It would be nice to have the following behavior (can be enabled via a dgs-dxselector property):

  • clicking right arrow when the last item is selected => selects the first item instead of doing nothing
  • clicking left arrow when the first item is selected => selects the last item instead of doing nothing
  • same behavior for scrolling with mouse up/down ontop of the slider

colorScheme backup (/updatedgs)

How /updatedgs should work in my opinion:

  • it should rename my current colorScheme.txt to colorScheme.txt.backup and download new colorScheme as colorScheme.txt

How it works at the moment:

  • it keeps colorScheme.txt untouched and new colorScheme will be colorScheme.txt.backup

Dgs-dxwindow doesn't close

Reproduce:

local window = dgsCreateWindow(.....)
dgsSetProperty(window, "dontClose", true)


addEventHandler("onDgsWindowClose", root,
function()
    local dontClose = dgsGetProperty(source, "dontClose")
    if (dontClose) then
        cancelEvent()
        dgsAlphaTo(source, 0.0, "Linear", 350)
        setTimer(function(elem)
            dgsSetVisible(elem, false)
            dgsSetAlpha(elem, 1.0)
        end, 750, 1, source)
    end
end
)

Try to close the window, it will close and the animation works.
But when you set window visible to true again and try to close it, it won't trigger and won't close

DGS update

Hello, I have a problem after the DGS update, nothing is displayed, no errors in db3.

3dInterfaces appear black after version 3.468

After updating my DGS to the lastest version I discovered that 3dInterfaces (or at least 3dInterfaces with windows) now appear black.

Click me to see the images

How it looks in 3.494 onwards

How it should look

I have no clue what the issue is, but 3.468 works just fine

TabPanel issue

Hello, everything was working correctly, but when I inserted TabPanel method utility.lua returns an error. It was working on my old version 3.5, but when I updated to 3.517 this happens.

image
image

License question

Hi there, I really liked the project since the first time I stumbled upon it a while back. I also love the fact that it is still under active development ๐Ÿ‘ Sadly there is almost no chance for me to use DGS because of the license which requires me to disclose source code of any program which would use it. Is there any chance for re-license or dual-license under less restrictive terms?

edit box cursor

them i apply the code :

DGS:dgsSetVisible( Edit, false )
DGS:dgsFocus(image1)
DGS:dgsSetEnabled ( Edit, false )

disappears correctly but cursor still on screen. only clicking somewhere the cursor show off.
Who can i do to cursor show off with the dgsSetVisible false.

another thing is if i m in car doing this the edit box dont type the letters

Suggestion Theme

Hello friends, what do you think about modifying the theme of the game ?!
We make it with dgs technology
An example is taken and modified.
cgui

Some Dgs elements not shown

Hello
Some players can't see some DGS elements
they can't see labels, tab panels just empty window
and I'm sure my code is working fine

This image is taken from a player who has the problem
image
Thank you.

DGS on idle uses a lot of processing power

DGS while idle runs dgsCoreRender every frame. This should be unnecesary, since no DGS elements are on screen or even loaded.

You can check this by opening a clean server, starting DGS and IPB and search Lua timing (option d).

image

This should not be the case. Unless there is a DGS element created or something like debugdgs enabled, there should be no onClientRender or onClientPreRender functions running. They should be added after a DGS element has been created, or even better, when a DGS element is being rendered. This will make DGS perform MUCH better while is not loaded.

On high FPS it can lead for up to 1.5% CPU usage (AMD Ryzen 5 2600 on Windows 10), while on low FPS it gets like 0.4-0.5% CPU usage.

Make small circular progress bar antialiased

The problem:

When I create a small circular progress bar, the edges are not smooth.

Code to produce the bug:

dgsSetProperty(progressBar,"bgColor", tocolor(0, 0, 0, 255))
dgsProgressBarSetStyle(progressBar,"ring-round")
local progress = 0
addEventHandler("onClientRender", root,
    function()
    dgsProgressBarSetProgress(progressBar,progress)
    progress = progress + 0.1
end)

Screenshot:
circle

Error loading image for "dgsCreate3DImage"

I had to put ":resource/image.png" for him to take my image and put it in "dgsCreate3DImage"

Image already created
https://imgur.com/a/kc6jaBN

Error Image
https://imgur.com/a/fcX4ehC

Before

DGS = exports.dgs

local image = DGS:dgsCreate3DImage(0, 0, 4, "test.png",tocolor(255,255,255,255), 20, 20)
DGS:dgsSetProperty(image,"fadeDistance",20)
DGS:dgsSetProperty(image,"outline",{"out",1,tocolor(255,255,255,255)})
DGS:dgs3DImageAttachToElement(image,localPlayer,0,5)

Later

DGS = exports.dgs

local image = DGS:dgsCreate3DImage(0, 0, 4, ":test/test.png",tocolor(255,255,255,255), 20, 20)
DGS:dgsSetProperty(image,"fadeDistance",20)
DGS:dgsSetProperty(image,"outline",{"out",1,tocolor(255,255,255,255)})
DGS:dgs3DImageAttachToElement(image,localPlayer,0,5)

Code line

Simple problem ^^"

function dgsGradientSetColor(gradShader,colorFrom,colorTo)

assert(type(colorFrom) == "number","Bad argument @dgsGetGradientColor at argument 2, expect number got "..type(color1))
assert(type(color2) == "number","Bad argument @dgsGetGradientColor at argument 3, expect number got "..type(color2))

function dgsGradientSetColor(gradShader,colorFrom,colorTo)
assert(dgsGetPluginType(gradShader) == "dgs-dxgradient","Bad argument @dgsGradientSetColor at argument 1, expect dgs-dxgradient got "..type(gradShader))
assert(type(colorFrom) == "number","Bad argument @dgsGetGradientColor at argument 2, expect number got "..type(colorFrom))
assert(type(colorTo) == "number","Bad argument @dgsGetGradientColor at argument 3, expect number got "..type(colorTo))
dgsSetData(gradShader,"colorFrom",colorFrom)
dgsSetData(gradShader,"colorTo",colorTo)
dxSetShaderValue(gradShader,"colorFrom",{fromcolor(colorFrom,true,true)})
dxSetShaderValue(gradShader,"colorTo",{fromcolor(colorTo,true,true)})
return true
end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.