Add icon and fix crashes

This commit is contained in:
Stossy11 2024-12-01 11:06:05 +11:00
parent 464f14f143
commit 73f14cf59c
5 changed files with 9 additions and 13 deletions

View File

@ -1,6 +1,7 @@
{ {
"images" : [ "images" : [
{ {
"filename" : "nxgradientpng.png",
"idiom" : "universal", "idiom" : "universal",
"platform" : "ios", "platform" : "ios",
"size" : "1024x1024" "size" : "1024x1024"

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

View File

@ -158,7 +158,7 @@ class Ryujinx {
} }
if config.nintendoinput { if config.nintendoinput {
// args.append("--correct-ons-controller") args.append("--correct-ons-controller")
} }
if config.enableInternet { if config.enableInternet {
args.append("--enable-internet-connection") args.append("--enable-internet-connection")

View File

@ -25,7 +25,7 @@ struct ContentView: View {
@State private var config: Ryujinx.Configuration @State private var config: Ryujinx.Configuration
@State private var settings: [MoltenVKSettings] @State private var settings: [MoltenVKSettings]
@State private var isVirtualControllerActive: Bool = false @State private var isVirtualControllerActive: Bool = false
@State var onscreencontroller: Controller? @State var onscreencontroller: Controller = Controller(id: "", name: "")
// MARK: - Initialization // MARK: - Initialization
init() { init() {
@ -85,6 +85,9 @@ struct ContentView: View {
Section("Settings") { Section("Settings") {
NavigationLink("Config") { NavigationLink("Config") {
SettingsView(config: $config, MoltenVKSettings: $settings) SettingsView(config: $config, MoltenVKSettings: $settings)
.onAppear() {
virtualController?.disconnect()
}
} }
} }
@ -171,21 +174,13 @@ struct ContentView: View {
private func refreshControllersList() { private func refreshControllersList() {
Timer.scheduledTimer(withTimeInterval: 0.5, repeats: false) { _ in Timer.scheduledTimer(withTimeInterval: 0.5, repeats: false) { _ in
controllersList = Ryujinx.shared.getConnectedControllers() controllersList = Ryujinx.shared.getConnectedControllers()
var controller = controllersList.first(where: { $0.name == "Apple Touch Controller" }) var controller = controllersList.first(where: { $0.name.hasPrefix("Apple")})
self.onscreencontroller = (controller ?? Controller(id: "", name: ""))
controllersList.removeAll(where: { $0.name == "Apple Touch Controller" })
controller?.name = "On-Screen Controller"
onscreencontroller = controller
controllersList.append(controller!)
// controllersList.removeAll(where: { $0.name == "Apple Touch Controller" })
if controllersList.count > 2 { if controllersList.count > 2 {
let controller = controllersList[2] let controller = controllersList[2]
currentControllers.append(controller) currentControllers.append(controller)
} else if let controller = controllersList.first(where: { $0.id == controller?.id }), !controllersList.isEmpty { } else if let controller = controllersList.first(where: { $0.id == onscreencontroller.id }), !controllersList.isEmpty {
currentControllers.append(controller) currentControllers.append(controller)
} }
} }