blaberry / FullscreenLock

Like AKADEVILs PrimaryLock, but different.
GNU Lesser General Public License v3.0
93 stars 16 forks source link

Rework #3

Closed RyadaProductions closed 6 years ago

RyadaProductions commented 6 years ago

Saw this shared on /r/globaloffensive and thought i wanted to help out by making it even better :)

major changes are:

RyadaProductions commented 6 years ago

If you have any questions feel free to ask. Also i figured it might be cool to join the /r/csharp discord where a lot of people are willing to help/explain things about C#. Here is the link: https://discord.gg/FTqNnyS

blaberry commented 6 years ago

Nah

blaberry commented 6 years ago

Should probably add a gitignore and remove all the binary crap tho, tbf

I'll do that when I have some time.

RyadaProductions commented 6 years ago

Those errors are probably the case because of an outdated language version on your end. Are you using visual studio 2017? If so is it updated to the latest version? If this is the case i can fix it by changing the inline out variable assignments to just be created before the out. Otherwise it should be solvable by using the latest language version on your end.

blaberry commented 6 years ago

It's VS2015

RyadaProductions commented 6 years ago

I will update my fork to circumvent the compiler errors. Although it is advised to upgrade to VS2017.

RyadaProductions commented 6 years ago

I removed the inline variable declarations. You should have no compiler errors anymore on VS2015.

blaberry commented 6 years ago

BW doesn't automatically start. (This should already be resolved before I have to test it.)

RyadaProductions commented 6 years ago

Should start automatically now.

blaberry commented 6 years ago

So it's guaranteed to work?

RyadaProductions commented 6 years ago

It is guaranteed to work on my machine. I would assume you want to test it yourself. The non automatic start was an oversight from me.

blaberry commented 6 years ago

CPU usage is now 30-40% for one core, compared to 1-5% for timer-version. Closing this PR until performance issues are resolved.

RyadaProductions commented 6 years ago

Performance issues should be fixed now.

Reason it was performance hungry, was because in the old version this was in the code.

// Sets the timer interval to 5 seconds.
t.Interval = 100;

Due to the comment not matching the time you set the interval to I thought it was unnecessary to add any delay to it to improve response time on the user their end. I added a sleep of 100ms to the end of the BW which solves the high usage and makes it hit 5% cpu usage on a single core at most inside of a windows 10 VM, which is lower than the timer version which ended up hitting 8% on my end.