schmaldeo / DS4Windows

DS4Windows but maintained
GNU General Public License v3.0
96 stars 8 forks source link

[Feature Request] Change lightbar color in macro manager #6

Closed eVenent closed 3 weeks ago

eVenent commented 2 months ago

Hello, I would like to be able to set macros for changing lightbar color.

For example, throwing nade (R1) is setting lightbar to red, then there is "waiting block" for 3,5 seconds and then lightbar is changing color for 1 second on white - because after this time nade is blowing. In this way I will have animation for throwing nades which is showing me that area is safe.

It's only my sugestion, but I think it can work like Insert Wait block in "Record A Macro" section. image It will add "lighbar block" where we can set RGB color like it is when we are remapping buttons. image

In games, many easy actions are time related, so DS4Windows would be able to handle LED changing in this way. It can be used with granades, activating ultimate attacks, reviving teammates or even showing cooldown of used skills.

schmaldeo commented 2 months ago

Should start working on it at the end of next week.

schmaldeo commented 1 month ago

Would something like this where you can:

satisfy your needs?

As for when the macro would run, I was thinking of adding a selection between when the button is pressed (state going from 0 to 1) or when it's released (state going from 1 to 0), don't know if there's a need for that?

I've done some work and I've got some good progress, just need to figure out how exactly the button settings are saved and read, but I'm sure I'll be on it soon.

image of the lightbar macro creator window

eVenent commented 1 month ago

Yes, in this way, configuration will be perfect. Start of button and release button is great idea too, throwing nades will start timer when button is released, activating skill when button is pressed. It will be a great feature!

schmaldeo commented 1 month ago

Little update: I'm done with the UI and DTO part. Now just need to implement functions that will actually change the colour of the lightbar which should take much shorter as here I don't need to figure everything out and can get straight to work. If everything goes well it should be released in a beta tomorrow, maybe on friday.

EDIT: having thought of it I might actually take a bit longer to make sure I implement it in the best possible way, so tomorrow is probably slightly unrealistic

schmaldeo commented 1 month ago

I've got an important implementation question: would you want it to have cancellation or for it to always run until the end, as in:

The macro lasts 1000ms, starts on a key press

Now the question in this situation is, should it

Queueing is definitely not an option in my opinion. I think this issue could be resolved in the future by adding a dropdown to select which option to choose, but for now I'd like to implement only one.

eVenent commented 1 month ago

I think stop the currently running macro and start a new one will be more acurate in majority of use cases. Ofc, dropdown to select would the the best, but for now it can work like this.

schmaldeo commented 1 month ago

Happy to announce the feature is now available in the latest beta.

Please note there are some llimitations:

eVenent commented 1 month ago

Tested with my DualShock 4 v.2 and DualSense, and as always new feature works great! I like that after macro, lightbar is coming back to default color, so I don't have to think which color to set at the end. It's a really good job, thank you.

schmaldeo commented 1 month ago

Happy to hear that! It should work with all controllers that have a supported lightbar (so DS4, DualSense and probably the supported replicas). I'll be adding the shift modifier support, selection mentioned in https://github.com/schmaldeo/DS4Windows/issues/6#issuecomment-2360641000 and if there are no bugs reported I reckon it will be available in a stable release next week :))

schmaldeo commented 1 month ago

Available in v3.8.0.

Cancellation mentioned in https://github.com/schmaldeo/DS4Windows/issues/6#issuecomment-2360641000 has been ignored for now, I'm planning to address it in a future patch.

schmaldeo commented 4 weeks ago

Cancellation added in 3.9.3-beta.1, also made the responsible code much more friendly and much less spaghetti-like.

Please test and if everything is OK it will be added to the next latest stable.

schmaldeo commented 3 weeks ago

Finished in v3.9.2