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.
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....
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.
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!
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!
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.
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.
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.
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.
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.
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.
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 :).
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.
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.
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!
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.
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.
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.
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.
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.
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!
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.
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.
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....
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.
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!
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!
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!
Pulled out the the library list mgmt from SteamGame
and put it in a new SteamLibrary class. This means I
can replicate the learnings from the ShortcutRepo
amd Profile Repo, and can save separate JSON files
in the future if I so desire.
There is a little bit outstanding to make the SteamGame
Properties to be writeable as well as readable, otherwise
the SteamGame.CopyTo function won't work.