Commit Graph

40 Commits

Author SHA1 Message Date
WarmUpTill
e61539a878 Reuse macro segment widgets if possible 2022-03-26 10:05:50 -07:00
WarmUpTill
e0763a4957 Improve performance for drag and drop
- Changing the style sheets for the selection frame dynamically considerably
  slowed down the handling of the mouse events.
  Instead two separate widgets with fixed style sheets are now used.
- Recreating the macro segments after dropping a widget took too much
  time leading to unresponsive drop operations
2022-03-26 10:05:50 -07:00
WarmUpTill
1ab9a38914 Selection idx handling was moved to macro segment list widget 2022-03-26 10:05:50 -07:00
WarmUpTill
0a8f279e97 Rework macro segment list widget
- Allows drag and drop reorder
- Handles selection change
- Handles highlight
- Handles changing collapse change
- Handles add, insert, remove, and clear functionality
2022-03-26 10:05:50 -07:00
WarmUpTill
71b6ae4d78 Add additional settings dialog to macro tab
This settings dialog currently contains debug features to highlight
recently executed macros, actions and conditions.
2022-03-12 06:35:59 -08:00
WarmUpTill
428e114a0a Highlight recently executed action and true conditions 2022-03-12 06:35:59 -08:00
WarmUpTill
da28fea2e0 Fix potential freeze or crash with "Show match" dialog
This is a workaround to handle random segfaults triggered when using ...
QMetaObject::invokeMethod(this, "RedrawImage", -Qt::QueuedConnection,
		   Q_ARG(QImage, image));
... from within CheckForMatchLoop().
Even using BlockingQueuedConnection causes deadlocks.
2022-02-26 16:08:55 -08:00
WarmUpTill
04825e4b88 Fix warning 2022-02-26 08:23:10 -08:00
WarmUpTill
4253c99cf2 Fade out segment controls which will likely not be needed
This was done to give some hints which controls will likely need to be
used to avoid mistakenly clicking on the action controls when editing
conditions.
2022-02-26 08:23:10 -08:00
WarmUpTill
89efb6d1c8 Allow selecting either an action or condition but not both 2022-02-24 14:15:23 -08:00
WarmUpTill
8e3eb8519b Fix potential crashes when adding or removing macro segments
I wrongly assumed that std::deque would guarantee that pointers to
elements in deque would not be invalidated by insert() or erase() but
this is not the case it seems.

""
An erase in the middle of the deque invalidates all the iterators and
references to elements of the deque. An erase at either end of the deque
invalidates only the iterators and the references to the erased
elements.
""

I guess I got lucky noone ran into these sorts of crashes for now?
2022-02-20 04:50:12 -08:00
WarmUpTill
354ef56070 Do not select any item if pressing add without any active selection 2022-02-20 04:50:12 -08:00
WarmUpTill
352dac5e32 Add MacroSegmentList to allow deselecting items
Previously once a macro segement was selected you could only deselect it
by clicking on different macro segment, thus never allowing the user to
deselect all macro segments
2022-02-20 04:50:12 -08:00
WarmUpTill
584fe4b3b6 Copy logic type when adding conditions 2022-02-20 04:50:12 -08:00
WarmUpTill
0b2e725471 Do not run collapse animation when calling SetContent() 2022-02-20 04:50:12 -08:00
WarmUpTill
45e8378021 Remove old macro segment controls 2022-02-20 04:50:12 -08:00
WarmUpTill
955f308c59 Add list-like controls to macro actions and conditions 2022-02-20 04:50:12 -08:00
WarmUpTill
08a8157f3a Reduce spacing between macro segments 2022-02-04 11:38:42 -08:00
WarmUpTill
e13f20c860 Adding frame highlighting individual macro segments 2022-02-04 11:38:42 -08:00
WarmUpTill
48368f4bd6 Move vertical / horizontal control handling to macro segment 2022-02-04 11:38:42 -08:00
WarmUpTill
61d9031933 Add option to toggle between vertical and horizontal macro controls 2022-02-04 11:38:42 -08:00
WarmUpTill
7a34c334bd Highlight macro segments new position when moving it up or down 2022-02-04 11:38:42 -08:00
WarmUpTill
eda161de39 Sort condition and action selection alphabetically 2022-01-21 09:51:00 -08:00
WarmUpTill
5d58269b02 Add function to access parent macro from condition or action 2022-01-21 09:50:19 -08:00
WarmUpTill
c40a3af8ca Fix add, delete, reorder not working when changing macro segment type 2021-11-17 12:06:53 -08:00
WarmUpTill
c34308f743 Fix scroll position being lost when adding or removing macro segments 2021-10-23 13:53:56 -07:00
WarmUpTill
ab5bdb32f5 Highlight newly added macro segments 2021-08-27 08:43:28 -07:00
WarmUpTill
8cfed048cc Create copy of previous macro segment when inserting new segment 2021-08-27 08:43:28 -07:00
WarmUpTill
810235e0b7 Clean up duplicate code 2021-07-22 09:40:31 -07:00
WarmUpTill
84e4b740a8 Prevent accidental edits of actions and conditions when scrolling 2021-07-22 09:40:31 -07:00
WarmUpTill
fd789b476b Persist collapse / expand state 2021-07-22 09:40:31 -07:00
WarmUpTill
3fc82df278 Handle macro control signals 2021-07-22 09:40:31 -07:00
WarmUpTill
80b824e0a7 Fix Macro slots not being connected properly
Problem was introduced when adding header info.

To avoid the issue in future forward signals of the main plugin window
via condition and action edit widgets instead of relying on parent()
being the main window.
2021-06-20 11:05:29 -07:00
WarmUpTill
57c0734ba6 Display more information about macros in collapsed state 2021-06-19 06:58:06 -07:00
WarmUpTill
326cc0c46f Add generic time constraint to macro conditions
Almost every macro condition can benefit from having the option to
specify a time constraint.
Instead of adding it to each condition separately add it to all
conditions with the option of excluding it when registering a new
condition type.
2021-06-03 10:19:19 -07:00
WarmUpTill
86d4e59dc2 Adjust to section widget rework 2021-05-28 10:23:24 -07:00
WarmUpTill
c2d2a27d44 Use more const refs where applicable 2021-05-23 17:52:15 -07:00
WarmUpTill
572b974b82 Switch to using string as ids for actions and conditions
Using int is an id was getting messy with more and more conditions and
actions beeing added.
It also made the order of conditions and actions in the respective
comboboxes unchangable as there was a 1 to 1 relation of index and id.
2021-05-22 03:07:09 -07:00
WarmUpTill
72bd905e7c Improve logging for macros 2021-05-20 11:36:08 -07:00
WarmUpTill
675021c284
Add Macro tab (#170)
* add action switch scene

* add window condition

* Add macro action wait

* Add macro condition region

* Add audio macro condition

* Add file based macro condition

* Add macro condition media

* Add video macro condition

* Add macro action audio

* Add macro action streaming

* Add macro action recording

* Add replay buffer macro action

* Add stream macro condition

* Add macro condition recording

* Add macro condition plugin state

* Add macro action to run an arbitrary command
2021-05-14 16:37:01 +02:00