Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

Commit

Permalink
Merge pull request #148 from atfinke/2020.09
Browse files Browse the repository at this point in the history
2020.09
  • Loading branch information
atfinke committed Aug 21, 2020
2 parents f30f580 + 4d7a848 commit af6df3c
Show file tree
Hide file tree
Showing 249 changed files with 59 additions and 58,425 deletions.
29 changes: 2 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# WikiRaces ![Build Status](https://github.com/atfinke/WikiRaces/workflows/CI/badge.svg)
# WikiRaces

The source code for [WikiRaces 3](https://itunes.apple.com/us/app/wikiraces-3/id1030997904?mt=8) on the App Store.

Feature work is merged into master when the update containing the corresponding changes is released on the App Store.
![screenshot](https://raw.githubusercontent.com/atfinke/WikiRaces/master/Resources/screenshot.png)

Feel free to ping me with questions.
***

## App Store Reviews
#### "Best Game Ever"
Expand All @@ -32,29 +30,6 @@ Feel free to ping me with questions.
"Great work creating an addicting and fun game to play with friends"<br>
\- Hubbytubby

## Player Tweets

[Hiatus](https://twitter.com/SHINICHlKUDOU/status/1071589372028436480)<br>
[Jumping Jacks](https://twitter.com/SHINICHlKUDOU/status/1037168065547591680)<br>
[Intense](https://twitter.com/SHINICHlKUDOU/status/1036492428868505600)<br>

## Repo Overview

#### /Resources
- Various design resources.
#### /WKRPython
- Python scripts I use to compile the final articles list.
#### /WKRArticlesPreviewer
- macOS app for previewing the final articles list.
#### /WKRCloudStats
- macOS app that pulls app analytics from CloudKit.
#### /WKRKit
- Framework responsible for most of the core game logic.
#### /WKRUIKit
- Framework responsible for the shared UI across the app.
#### /WikiRaces
- Contains the main project with the release and multi-window debug targets.

## Other

[Spectator Mode Alpha](https://atfinke.github.io/WikiRaces/Spectator)
Binary file added Resources/Videos/WikiRaces 1 Menus.mov
Binary file not shown.
Binary file added Resources/Videos/WikiRaces 1 Tutorial.mov
Binary file not shown.
File renamed without changes.
Binary file added Resources/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion WKRKit/WKRKit/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>13396</string>
<string>13457</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
Expand Down
2 changes: 1 addition & 1 deletion WKRUIKit/WKRUIKit/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>14299</string>
<string>14365</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
Expand Down
22 changes: 16 additions & 6 deletions WKRUIKit/WKRUIKit/WKRUIPlayerImageManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ public class WKRUIPlayerImageManager {

public func connected(to player: GKPlayer, completion: (() -> Void)?) {
DispatchQueue.main.async {
assert(Thread.isMainThread)

let placeholder = WKRUIPlayerPlaceholderImageRenderer.render(name: player.displayName)
os_log("%{public}s: generated placeholder for %{public}s", log: .imageManager, type: .info, #function, player.alias)

self.update(image: placeholder, for: player.alias)
self.update(image: placeholder, for: player.alias, isPlaceholder: true)

player.loadPhoto(for: .small) { photo, _ in
guard let photo = photo else {
Expand All @@ -63,8 +65,8 @@ public class WKRUIPlayerImageManager {
self.isLocalPlayerImageFromGameCenter = true
}

self.update(image: photo, for: player.alias)
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
self.update(image: photo, for: player.alias, isPlaceholder: false)
completion?()
}
}
Expand All @@ -73,21 +75,28 @@ public class WKRUIPlayerImageManager {

@discardableResult
private func generatePlaceholder(for player: String) -> UIImage {
assert(Thread.isMainThread)
let placeholder = WKRUIPlayerPlaceholderImageRenderer.render(name: player)
os_log("%{public}s: generated placeholder for %{public}s", log: .imageManager, type: .info, #function, player)
update(image: placeholder, for: player)
update(image: placeholder, for: player, isPlaceholder: true)
return placeholder
}

private func update(image: UIImage, for playerID: String) {
private func update(image: UIImage, for playerID: String, isPlaceholder: Bool) {
assert(Thread.isMainThread)
if playerID == GKLocalPlayer.local.alias {
localPlayerImage = image
if localPlayerImage == nil || !isPlaceholder {
localPlayerImage = image
}
} else {
connectedPlayerImages[playerID] = image
if connectedPlayerImages[playerID] == nil || !isPlaceholder {
connectedPlayerImages[playerID] = image
}
}
}

public func image(for player: String) -> UIImage {
assert(Thread.isMainThread)
if player == GKLocalPlayer.local.displayName, let image = localPlayerImage {
return image
} else if let image = connectedPlayerImages[player] {
Expand All @@ -98,6 +107,7 @@ public class WKRUIPlayerImageManager {
}

public func clearConnectedPlayers() {
assert(Thread.isMainThread)
connectedPlayerImages.removeAll()
}

Expand Down

This file was deleted.

Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Loading

0 comments on commit af6df3c

Please sign in to comment.