From 6836fb5bae8d37ed5f46196a3a2ccc9ef63f7296 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Mon, 18 Dec 2017 18:14:28 -0600 Subject: [PATCH] Moves core ControllerSkin translucency logic to ControllerView --- Cores/DeltaCore | 2 +- Delta/Emulation/GameViewController.swift | 20 +++----------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/Cores/DeltaCore b/Cores/DeltaCore index dd292d6..0102a81 160000 --- a/Cores/DeltaCore +++ b/Cores/DeltaCore @@ -1 +1 @@ -Subproject commit dd292d6ceaa1c0543e3dd0453251379287a923a7 +Subproject commit 0102a815adf25da3841d4273c044cbb59261709b diff --git a/Delta/Emulation/GameViewController.swift b/Delta/Emulation/GameViewController.swift index d8f1133..7733a61 100644 --- a/Delta/Emulation/GameViewController.swift +++ b/Delta/Emulation/GameViewController.swift @@ -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 } } }