JeViCo Posted October 19, 2018 Share Posted October 19, 2018 Hello everyone! I tried to make something like this: 1-st resource (where i calculate everything) function choosed(colors) if choosed then return colors else return false end end addEventHandler("onDGSPickerChoose", getRootElement(), choosed) 2-nd resource (where i use data to make something awesome) addEventHandler("onDGSPickerChoose", getRootElement(), function(rgba) --i use rgb stuff here end) I'm not sure that i'm doing it right Link to comment
Moderators IIYAMA Posted October 19, 2018 Moderators Share Posted October 19, 2018 Nope, it doesn't work like that. You can't change arguments of events after they are fired. But you can do something like this. function choosed(processed, colors) if not processed then if choosed then triggerEvent("onDGSPickerChoose", root, true, colors) end end end addEventHandler("onDGSPickerChoose", root, choosed, false) -- addEventHandler("onResourceStart", resourceRoot, function () setElementData(root, "onDGSPickerChoose_blocking", true, false) end) addEventHandler("onResourceStop", resourceRoot, function () removeElementData(root, "onDGSPickerChoose_blocking") end) addEventHandler("onDGSPickerChoose", root, function(processed, rgba) if not getElementData(root, "onDGSPickerChoose_blocking") or processed then end end, false) triggerEvent("onDGSPickerChoose", root, false, {255, 100, 100, 255}) 1 Link to comment
Moderators IIYAMA Posted October 23, 2018 Moderators Share Posted October 23, 2018 @JeViCo Link to comment
JeViCo Posted October 23, 2018 Author Share Posted October 23, 2018 On 19/10/2018 at 19:24, IIYAMA said: Nope, it doesn't work like that. You can't change arguments of events after they are fired. But you can do something like this. function choosed(processed, colors) if not processed then if choosed then triggerEvent("onDGSPickerChoose", root, true, colors) end end end addEventHandler("onDGSPickerChoose", root, choosed, false) -- addEventHandler("onResourceStart", resourceRoot, function () setElementData(root, "onDGSPickerChoose_blocking", true, false) end) addEventHandler("onResourceStop", resourceRoot, function () removeElementData(root, "onDGSPickerChoose_blocking") end) addEventHandler("onDGSPickerChoose", root, function(processed, rgba) if not getElementData(root, "onDGSPickerChoose_blocking") or processed then end end, false) triggerEvent("onDGSPickerChoose", root, false, {255, 100, 100, 255}) that's rather hard to understand at the moment. I'll try to make some experiments with it. Thank you anyway =3 1 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