Fixes issue where GameViewController’s ControllerView remained visible after connecting MFi controller

This commit is contained in:
Riley Testut 2017-01-03 20:07:19 -06:00
parent efdd00ba9e
commit 23ecd83e73
2 changed files with 10 additions and 4 deletions

@ -1 +1 @@
Subproject commit 55ea13366edc40bb7cd9978c6127bd4f49aa45d1 Subproject commit 3a78b44803610e9dd9e71cd1c1a8d573eb79362a

View File

@ -344,6 +344,12 @@ private extension GameViewController
if let index = Settings.localControllerPlayerIndex if let index = Settings.localControllerPlayerIndex
{ {
self.controllerView.playerIndex = index self.controllerView.playerIndex = index
self.controllerView.isHidden = false
}
else
{
self.controllerView.playerIndex = nil
self.controllerView.isHidden = true
} }
var controllers = [GameController]() var controllers = [GameController]()
@ -368,6 +374,7 @@ private extension GameViewController
} }
self.view.setNeedsLayout() self.view.setNeedsLayout()
self.view.layoutIfNeeded()
} }
func updateControllerSkin() func updateControllerSkin()
@ -775,6 +782,8 @@ private extension GameViewController
switch settingsName switch settingsName
{ {
case .localControllerPlayerIndex: self.updateControllers()
case .preferredControllerSkin: case .preferredControllerSkin:
guard guard
let gameType = notification.userInfo?[Settings.NotificationUserInfoKey.gameType] as? GameType, let gameType = notification.userInfo?[Settings.NotificationUserInfoKey.gameType] as? GameType,
@ -795,9 +804,6 @@ private extension GameViewController
self.controllerView.alpha = Settings.translucentControllerSkinOpacity self.controllerView.alpha = Settings.translucentControllerSkinOpacity
} }
} }
default: break
} }
} }
} }