Commit Graph

66 Commits

Author SHA1 Message Date
Terry MacDonald
25cf0265fd First working ShellContextMenu extension
Can now apply saved display profiles by
right-clicking on the Desktop Background and
selecting the display profile that you want to
use. It will run <HeliosPlus> ChangeProfile <uuid>
where <HeliosPlus> is the HeliosPlus binary and
<uuid> is the UUID of the relevant display profile.
2020-11-22 20:53:30 +13:00
Terry MacDonald
dce0ed8252 Fixed application process monitoring
Stopped the application threat monitoring halting
the UI completely, which fixed some UI updating
issues. Now UI thread continues to poll waiting for
appl/game to exit, but does it in a loop rather than
blocking using WaitForExit(). Means that the
notification icon gets updated and the UI gets a
MaskedForm over it.
2020-11-22 09:26:17 +13:00
Terry MacDonald
ccefa80642 Added overlay to inform user UI is locked
This informs the user that the user UI is locked
until they close the game/application that is
started.
2020-11-21 14:48:32 +13:00
Terry MacDonald
e9a821e594 [WIP] Working notifyIcon during run
notifyIcon works if run from Shortcutlibrary,
or from clicked shortcut. Next step is to make
the main window show some sort of indication
that the UI is locked until the game exits....
2020-11-19 22:40:08 +13:00
Terry MacDonald
73284c03f8 Fixed open application window menu
The Open Application Window notification icon
popup menu item wouldn't restore the window
if it was minimised before running the Open
Application Window command. Added some cool
code from https://stackoverflow.com/questions/
354445/restore-windowstate-from-minimized and
then tweaked it to work in this situation. I could have
added this a much better place in the application but
I am planning on rewriting the app in WPF
eventually so I don't really need to do so.
2020-11-15 21:28:15 +13:00
Terry MacDonald
401e76c6e4 Can create Uplay shortcuts now
Added support to read Uplay games and
to load them into the interface. Also added
the ability to save the Uplay shortcuts.
Now need to test and then add the ability
to run Uplay Games!
2020-11-14 18:00:57 +13:00
Terry MacDonald
dd85aeb0f1 Fixed notification icon menu
Also fixed console messages as well. The programme
is just about working properly! I'm going to start
creating branches now as it is nearly at ready for a
v1.0!
2020-11-04 18:47:41 +13:00
Terry MacDonald
d952059e08 Fixes resizing of MainForm
Some elements weren't resizing properly.
2020-10-26 17:13:23 +13:00
Terry MacDonald
5e9135ed30 Completed adding "minimise on start" ability
Am able to minimise on start, or run normally
using a simple checkbox on the main form.
Maintains the setting over different runs using
a settings json file stored in the AppData directory.
2020-10-26 17:08:55 +13:00
Terry MacDonald
23930a2a15 Added initial ability to minimise to notification area
Used some awesome help from Hans Passant to build
logic to allow minimise to notification area as well as
be able to change profiles etc from the notification area.

https://stackoverflow.com/questions/1730731/how-to-start-winform-app-minimized-to-tray
2020-10-26 14:30:00 +13:00
Terry MacDonald
ed0ccede4c Added initial notify icon shortcut
Added initial notify icon shortcut menu. Have yet
to hook it up to programme start so that it gets
populated.

Also tried to do some tiy up of the Main procedure
of the Program.cs.
2020-10-26 12:39:14 +13:00
Terry MacDonald
de445bc601 Change to new icon
Changed to new icon. Removed icons from the
various forms.
2020-10-23 18:11:34 +13:00
Terry MacDonald
7355b419e8 Added ChangeProfile startup action
Added the ChangeProfile startup action so that
the Notification Icon in the Notification Tray will
be able to change the display profile easily.
2020-10-22 22:05:15 +13:00
Terry MacDonald
964853ff34 Changed the HeliosPlus Icon
Still not really happy with this one, but it's better
than the last one at least...
2020-10-22 21:46:36 +13:00
Terry MacDonald
ca1b760d9e Fixed Profile reverting after game execution
The ApplyProfile had some logic that would stop
reverting the profile after the game/exe was exited.
This should now be fixed.

Also attempted a fix to centralise the timer circle
in the middle window while applying a profile.
2020-10-22 20:08:26 +13:00
Terry MacDonald
a5d581fec8 Fixed shortcut editing and icon updates
The shortcut editing window was broken and was
not copying the information across properly to the
new shortcuts when the shortcut was edited. I have
now moved to actually replacing the shortcut when
the form updates it. So basically the ShortcutForm
loads the shortcut info from the ShortcutItem, then
when you save the form, it returns a new ShortcutItem.
The shortcut library then removes the old shortcut
(which removes the icons, and updates the file), then
it saves the new shortcut we just created (which saves
the icons and updates the save file). This was the easiest
way to make the shortcut modification process work.
2020-10-20 21:22:07 +13:00
Terry MacDonald
464545fbc7 Made Icons as reliable as possible
Icon logic works well now except for a single issue.
It will not change the shortcut image if the profile
or the game has been changed, and it needs to.
2020-10-19 22:58:23 +13:00
Terry MacDonald
e34d59c1f7 Cleaned up Icon creation (mostly)
Managed to fix large icon creation thanks to
work from Maurizio. Fied an issue with file
selection for Icon generation. Also found a
new issue with ShortcutList that needs
fixing shortly.

https://tabbles.net/how-to-have-large-file-icons-with-shgetfileinfo-in-c/
2020-10-19 21:50:42 +13:00
Terry MacDonald
683bf3d936 Fixed Bitmap processing for Shortcuts
The Bitmap processing wasm't working in the
listitemview. Traced it to a problem with a missing
GenerateThumbnailView call.

Also adjusted when the save to icon cache happens
so that it is part of the ShortcutItem and is called
when a new shortcut is created. This saves times.
2020-10-18 23:04:08 +13:00
Terry MacDonald
3b63953648 Revert "Revert "Refactored Common Base Games""
This reverts commit a71b866545.
2020-10-18 21:17:21 +13:00
Terry MacDonald
a71b866545 Revert "Refactored Common Base Games"
This reverts commit c2c11bd722.
2020-10-18 21:15:19 +13:00
Terry MacDonald
c2c11bd722 Refactored Common Base Games
Created a Common Base Game object in order
to support multiple additional libraries and games
in the future.
2020-10-18 21:02:00 +13:00
Terry MacDonald
ba54c9b99b [WIP] Fixing application runshortcut
Dies in ToBitmapOverlay because originalBitmap
isn't set.
2020-10-13 22:32:41 +13:00
Terry MacDonald
7c34a02213 Start programs details saved and loaded
Next step is to make them actually do something.
2020-10-11 20:14:22 +13:00
Terry MacDonald
2fa3ce0eb5 Loads the start programs into form
This change loads the start programs into
the form. The structure of the ShortcutItem
changes are designed to be extensible to a
large number of start programs, but the UI
only supports 4. The plan is to add as many
as you want in the WPF version of this app,
but right now its not worth the effort :).
2020-10-11 18:21:06 +13:00
Terry MacDonald
c6408648ee [WIP] StartPrograms are now saved
This puts in place some logic to save start
programs to the shortcut so they get
saved automatically.
2020-10-11 18:11:08 +13:00
Terry MacDonald
66d9ee8b74 Program to start UI works
Program to start UI works as intended. It's
a bit basic but will be good enough until
I manage to get to the WPF rewrite in a
year or so! Next step is to start adding the
background changes to the ShortcutItem
to store the information in the JSON.
2020-10-11 17:38:46 +13:00
Terry MacDonald
383f7a114f Shortcut save button works on load
Had missed the shortcutsave button so it
wold be disabled on load, even if the shortcut
was a valid shortcut. This is now changed so
that it works fine on load.

Have also changed the shortcut library selection
colours to match the rest of the application.
2020-10-11 17:26:11 +13:00
Terry MacDonald
3835840e78 Fixed profile selection colour highlighting 2020-10-11 17:16:06 +13:00
Terry MacDonald
b7bdefa705 Fixing default profile selection in shortcut form 2020-10-11 17:04:36 +13:00
Terry MacDonald
959bfe62aa Added start prog checkbox for usability
Adding these checkboxes will let the user
easily temporarily disable running a program
without losing the very complicated arguments
passed to the program. This is especially true if
it is a thing like SimHub or something like that!
2020-10-11 13:52:28 +13:00
Terry MacDonald
250e6c477f Renamed 'happens before' UI components
Renamed the UI bits to make more sense in prep
for actually making them do things :).
2020-10-11 13:38:47 +13:00
Terry MacDonald
e43e6d945c [WIP] Create initial design for 'Before' tab
This is the first design for a simple form to
detail the programs that the user wants us to start
before the main Game. This is a first go and
is only the initial draft.
2020-10-10 18:09:19 +13:00
Terry MacDonald
a39a9d202c Improving Profile Form messages 2020-10-10 17:50:27 +13:00
Terry MacDonald
7fd4a8117d Fixed error with Paths and Topologies equality
I'd made a revision to the Paths and Topologies
equality comparison and it  used Equals for
sequences rather than SequenceEqual as it should.
Comparison works correctly now.
2020-10-09 17:14:23 +13:00
Terry MacDonald
8421acbd8d CurrentProfile detected in loadedProfiles
Fixed up some broken logic around detecting
loadedProfiles as the currentProfile. Now when
we load the profiles from disk we also correctly
check whether one of the profiles is in use now
and if it is then we use that profile instead of
creating a new one.
2020-10-09 16:27:59 +13:00
Terry MacDonald
189e3271a0 Fixed incorrectly displaying progressBar
I broke the circularProgressBar but now it works
fine. Messed with the style a bit to get the look
I wanted. Also adjusted the positioning of the
text in the middle.
2020-10-08 22:03:02 +13:00
Terry MacDonald
ca7c696b06 Bypassed NVIDIA Grid Topology if not needed
Added some logic to check if either the from or to
profile conatins an NVIDIA surround screen. If not,
then there is no need to apply a GridTopology as it
is all single devices! Saves up to 15 seconds on
swap over.
2020-10-07 21:58:05 +13:00
Terry MacDonald
f0088d08e2 [WIP] trying to fix path error 2020-10-06 23:49:10 +13:00
Terry MacDonald
0b5937d25c Removing old ApplyingChangesForm 2020-10-06 20:08:36 +13:00
Terry MacDonald
3847bae972 [WIP] DisplayUI works but needs error handling
DisplayUI is mostly working but it needs some work
fixing the error situations when the PathInfo can't be
applied properly. Need a way of setting the Task
result from the Task Action. Don't know how to do that
so something new to learn!
2020-10-05 00:18:22 +13:00
Terry MacDonald
17cc302d17 [WIP] Partial refactor of applying profile display UI 2020-10-04 23:01:03 +13:00
Terry MacDonald
77ae3c4789 Basic working code to apply a display profile change
This code makes the display profile change work. There
are a few things broken still.... namely the showing of a
timer when the profile is being applied, the accuracy of
the display detection code, and the correct logic for
determining a profile can be used.
2020-10-02 18:10:34 +13:00
Terry MacDonald
9d5a5ebd62 [WIP] Creates different displayIdentifiers for NVIDIA or other
There are different displayIdentifiers created if the video card
is an NVidia card, or if it is anything else. These identifiers
are saved in the display profiles, and that allows us to compare
the display identifiers we currently have with the ones in various
profiles, and then work out which profiles are valid.

This code committed today ensures that the nvidia device
identifier will always use the NVAPIWrapper lib (whether in
surround mode or not) so that the application allows both
surround mode profiles and non-surround mode profiles
to be selected if the same displays are present.

For all other display adapters it just uses the
WindowsDisplayAPI to create a different displayIdentifier
which isn't as smart. It means that if you have an AMD and
use EyeInfinity, then this isn't clever enough to understand
the profiles use the same matching screens. I will have to
fix this eventually when i build in native AMD support in
the future.
2020-09-18 22:52:18 +12:00
Terry MacDonald
0912ee5896 Added DisplayIdentifiers to Profile storage
DisplayIdentifiers are the minimum GPU/Display
that will allow us to identify whether a profile
will actually work. We look for the same DisplayIdentifiers
or a subset of them to determine whether a profile
will be valid to show. This is different from the data
stored under DisplayTarget, as that is used for detailed
compatibility....
2020-08-19 18:55:50 +12:00
terrymacdonald
5004f5f76a Silenced the System.Drawing.Image exceptions
The ProfileAdapter and ShortcutAdapters used
by the ImageListView Control unfortunately
have to access the sizes of the bitmaps being
loaded into the respective imagelistviews. I
can't find anyway of stopping the GDI+
from complaining about the Bitmap being
accessed by multiple different threads (as
ImageListView creates one thread per image.
This will be fixed once I move to this being a
WPF application as we'll use a different control.
2020-07-24 16:51:48 +12:00
terrymacdonald
f23ae340a7 Fixed DisplayProfileForm profile selection logic
Profile selection logic was running functions multiple
times which was resulting in a lot of extra delay
while using the DisplayProfileFOrm. These changes
streamline it and make it work a lot faster!
2020-07-24 13:11:42 +12:00
terrymacdonald
e83a893640 [WIP] Partial cleanup of compiler warnings
Fixed most of the string related compiler
warnings. Still lots to go!
2020-07-24 11:06:33 +12:00
terrymacdonald
c358bc9087 [WIP] Moving Shortcut run logic to repo
Moved the shortcut running logic from the
main Program into the ShortcutRepository
so that it can be used from the
Shortcut Library UI as well as from the
commandline.

It's marked as WIP because I also moved
the ApplyingChangesForm and accompanying
ApplyTopos/ApplyProfiles logic and I broke
it. It needs refactoring and hopefully
simplifying but I need to work on that next!
2020-07-23 18:31:00 +12:00
terrymacdonald
ee7703255e Fixed SteamGame so it handles copies
Fixed SteamGame so it handles copies, and also
fixed the SteamLibrary so it works properly and
works. HeliosPlus now will run shortcuts and
load the game perfectly!
2020-07-22 21:52:36 +12:00