Skip to content

Commit

Permalink
Somewhat proper standalone timer implementation (#27)
Browse files Browse the repository at this point in the history
* Somewhat proper standalone timer implementation
* Changes I totally didn't forget to add to the previous commit
* Minor PR suggestions

---------

Co-authored-by: Frank <[email protected]>
  • Loading branch information
Vinjul1704 and FrankvdStam authored Mar 3, 2024
1 parent 0a23a2b commit cc30016
Show file tree
Hide file tree
Showing 4 changed files with 374 additions and 56 deletions.
7 changes: 7 additions & 0 deletions SoulSplitter.sln
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoulMemory.Tests", "tests\S
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoulSplitter.Tests", "tests\SoulSplitter.Tests\SoulSplitter.Tests.csproj", "{13D6FF7F-E774-424C-940C-C76FF98D8916}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "clitimer", "src\clitimer\clitimer.csproj", "{F7482938-4DEE-4BEB-BBA7-D9AE696404F3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand All @@ -74,6 +76,10 @@ Global
{13D6FF7F-E774-424C-940C-C76FF98D8916}.Debug|x64.Build.0 = Debug|x64
{13D6FF7F-E774-424C-940C-C76FF98D8916}.Release|x64.ActiveCfg = Release|x64
{13D6FF7F-E774-424C-940C-C76FF98D8916}.Release|x64.Build.0 = Release|x64
{F7482938-4DEE-4BEB-BBA7-D9AE696404F3}.Debug|x64.ActiveCfg = Debug|x64
{F7482938-4DEE-4BEB-BBA7-D9AE696404F3}.Debug|x64.Build.0 = Debug|x64
{F7482938-4DEE-4BEB-BBA7-D9AE696404F3}.Release|x64.ActiveCfg = Release|x64
{F7482938-4DEE-4BEB-BBA7-D9AE696404F3}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -84,6 +90,7 @@ Global
{A30986D1-6B5A-415D-A737-AE0D9EF4CE9C} = {DAF9C4D1-2E17-44C9-BC7B-0F26EDBE97E2}
{A8FE4ABB-A952-49B0-B39A-9B3B4574587B} = {FCB71284-721B-4845-AF63-F80DD168D949}
{13D6FF7F-E774-424C-940C-C76FF98D8916} = {FCB71284-721B-4845-AF63-F80DD168D949}
{F7482938-4DEE-4BEB-BBA7-D9AE696404F3} = {DAF9C4D1-2E17-44C9-BC7B-0F26EDBE97E2}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C356BE2C-9585-4CCF-A852-29C6DFCCD5A5}
Expand Down
56 changes: 0 additions & 56 deletions src/cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -344,62 +344,6 @@ void Test(string name, Action f)

#endregion

#region stand alone bs removal for ER
private static void StandAloneErBlackscreenRemoval()
{
Console.CursorVisible = false;
int _inGameTime = 0;
var _eldenRing = new EldenRing();
while (true)
{
//Refresh, display errors if there are any

var result = _eldenRing.TryRefresh();
if (result.IsErr)
{
var err = result.GetErr();
Console.Clear();
Console.WriteLine(err.ToString());
Console.Out.Flush();
Thread.Sleep(3000);
Console.Clear();
continue;
}

//
var currentIgt = _eldenRing.GetInGameTimeMilliseconds();
var blackscreenActive = _eldenRing.IsBlackscreenActive();


//Blackscreens/meme loading screens - timer is running, but game is actually loading
if (currentIgt != 0 && currentIgt > _inGameTime && currentIgt < _inGameTime + 1000 && blackscreenActive)
{
//Trace.WriteLine($"Writing IGT: {TimeSpan.FromMilliseconds(_inGameTime)}");
_eldenRing.WriteInGameTimeMilliseconds(_inGameTime);
}
else
{
if (currentIgt != 0)
{
_inGameTime = currentIgt;
}
}

if (_inGameTime == 0)
{
Console.SetCursorPosition(0, 1);
Console.WriteLine(" ");
}

Console.SetCursorPosition(0, 1);
Console.WriteLine(TimeSpan.FromMilliseconds(_inGameTime).ToString(@"hh\:mm\:ss\.fff"));

Thread.Sleep(16);
}
}

#endregion

#region Param generation

private static void GenerateParams()
Expand Down
Loading

0 comments on commit cc30016

Please sign in to comment.