default language & white popup background fix

This commit is contained in:
eevee
2024-07-13 12:06:58 +03:00
parent 98f6f9e5a2
commit c407874e93
3 changed files with 16 additions and 10 deletions
+10 -8
View File
@@ -27,15 +27,17 @@ class EncoreLabelHook: ClassHook<UIView> {
}
}
class SPTEncorePopUpDialogHook: ClassHook<NSObject> {
class SPTEncorePopUpContainerHook: ClassHook<UIViewController> {
typealias Group = DarkPopUps
static let targetName = "SPTEncorePopUpDialog"
func uiView() -> UIView {
let view = orig.uiView()
view.backgroundColor = UIColor(Color(hex: "#242424"))
return view
static let targetName = "SPTEncorePopUpContainer"
func containedView() -> SPTEncorePopUpDialog {
return orig.containedView()
}
func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
containedView().uiView().backgroundColor = UIColor(Color(hex: "#242424"))
return orig.supportedInterfaceOrientations()
}
}
@@ -53,7 +53,10 @@ extension UserDefaults {
return lyricsOptions
}
return LyricsOptions(romanization: false, musixmatchLanguage: "")
return LyricsOptions(
romanization: false,
musixmatchLanguage: Locale.current.languageCode ?? ""
)
}
set (lyricsOptions) {
defaults.set(try! JSONEncoder().encode(lyricsOptions), forKey: lyricsOptionsKey)
@@ -1,7 +1,8 @@
import Foundation
import UIKit
@objc protocol SPTEncorePopUpDialog {
func `init`() -> SPTEncorePopUpDialog
func uiView() -> UIView
func update(_ popUpModel: SPTEncorePopUpDialogModel)
func setEventHandler(_ handler: @escaping (_ state: ClickState) -> Void)
}