Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(client/dui): implement dui handling #650

Merged
merged 8 commits into from
Oct 14, 2024

Conversation

CeebDev
Copy link
Contributor

@CeebDev CeebDev commented Oct 6, 2024

It's really simple to create new dui and don't have to handle for resource stop etc

local dui = lib.dui:new({
	url = ("nui://%s/web/index.html"):format(cache.resource), 
	width = 1920, 
	height = 1080,
	debug = true
})

-- Change url
dui:setUrl("https://google.com")

-- Send a message
dui:sendMessage({
	action = "play",
	value = "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
})

-- Destroy
dui:remove()

It's just a utility, all texture replace etc need to be handle by other scripts

JS version is not tested

@thelindat
Copy link
Member

Should be using ox_lib features, i.e. lib.class and cache.resource

@CeebDev
Copy link
Contributor Author

CeebDev commented Oct 6, 2024

Should be using ox_lib features, i.e. lib.class and cache.resource

I didn't know that cache has a resource prop, also, i've worked with the point file in mind which doesn't use the new lib.class, have made changes

package/client/resource/dui/index.ts Outdated Show resolved Hide resolved
package/client/resource/dui/index.ts Outdated Show resolved Hide resolved
package/client/resource/dui/index.ts Outdated Show resolved Hide resolved
package/client/resource/dui/index.ts Outdated Show resolved Hide resolved
package/client/resource/dui/index.ts Outdated Show resolved Hide resolved
@CeebDev CeebDev requested a review from thelindat October 14, 2024 05:30
@thelindat thelindat merged commit 24b2d62 into overextended:master Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants