Skip to content

Commit

Permalink
Actually fix the livesplit flickering this time
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodewarrior committed Dec 7, 2020
1 parent ab0484a commit 754f1ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions SwiftSplit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.1.0;
MARKETING_VERSION = 1.1.1;
PRODUCT_BUNDLE_IDENTIFIER = dev.thecodewarrior.SwiftSplit;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "SwiftSplit/SwiftSplit-Bridging-Header.h";
Expand All @@ -421,7 +421,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.1.0;
MARKETING_VERSION = 1.1.1;
PRODUCT_BUNDLE_IDENTIFIER = dev.thecodewarrior.SwiftSplit;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "SwiftSplit/SwiftSplit-Bridging-Header.h";
Expand Down
5 changes: 3 additions & 2 deletions SwiftSplit/CelesteSplitter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ class CelesteSplitter {
let time = routeConfig.useFileTime ? autoSplitterInfo.fileTime : autoSplitterInfo.chapterTime
server.setGameTime(seconds: time)

processEvents(events)

// when using the chapter time, `timerActive` will be true before the chapter time starts ticking.
// This is because the *file* timer is active even before the *chapter* timer is active
let timerActive = autoSplitterInfo.timerActive && time != 0
if timerActive != gameTimeRunning {
server.setGameTime(running: timerActive)
gameTimeRunning = timerActive
}

processEvents(events)
return events
}

Expand Down Expand Up @@ -131,6 +131,7 @@ class CelesteSplitter {
if routeIndex == 0 {
server.reset()
server.start()
gameTimeRunning = true
} else if !nextEvent.starts(with: "!") {
server.split()
}
Expand Down

0 comments on commit 754f1ff

Please sign in to comment.