Moves core ControllerSkin translucency logic to ControllerView

This commit is contained in:
Riley Testut 2017-12-18 18:14:28 -06:00
parent bb418038e2
commit 6836fb5bae
2 changed files with 4 additions and 18 deletions

@ -1 +1 @@
Subproject commit dd292d6ceaa1c0543e3dd0453251379287a923a7
Subproject commit 0102a815adf25da3841d4273c044cbb59261709b

View File

@ -192,6 +192,8 @@ extension GameViewController
let gameViewContainerView = self.gameView.superview!
self.controllerView.translucentControllerSkinOpacity = Settings.translucentControllerSkinOpacity
self.sustainButtonsContentView = UIView(frame: CGRect(x: 0, y: 0, width: self.gameView.bounds.width, height: self.gameView.bounds.height))
self.sustainButtonsContentView.translatesAutoresizingMaskIntoConstraints = false
self.sustainButtonsContentView.isHidden = true
@ -444,15 +446,6 @@ private extension GameViewController
let controllerSkin = Settings.preferredControllerSkin(for: system, traits: traits)
self.controllerView.controllerSkin = controllerSkin
if controllerSkin?.isTranslucent(for: traits) ?? false
{
self.controllerView.alpha = Settings.translucentControllerSkinOpacity
}
else
{
self.controllerView.alpha = 1.0
}
}
}
@ -860,14 +853,7 @@ private extension GameViewController
self.updateControllerSkin()
}
case .translucentControllerSkinOpacity:
if let traits = self.controllerView.controllerSkinTraits
{
if self.controllerView.controllerSkin?.isTranslucent(for: traits) ?? false
{
self.controllerView.alpha = Settings.translucentControllerSkinOpacity
}
}
case .translucentControllerSkinOpacity: self.controllerView.translucentControllerSkinOpacity = Settings.translucentControllerSkinOpacity
}
}
}