This commit is contained in:
lizzie 2026-04-01 16:39:54 +00:00
parent 1ef902a6ad
commit f1519c82b6
6 changed files with 23 additions and 30 deletions

View file

@ -21,11 +21,11 @@ struct EmulationGame : Comparable, Hashable, Identifiable {
hasher.combine(title)
}
static func < (lhs: EmulationGame, rhs: Yuzu) -> Bool {
static func < (lhs: EmulationGame, rhs: EmulationGame) -> Bool {
lhs.title < rhs.title
}
static func == (lhs: EmulationGame, rhs: Yuzu) -> Bool {
static func == (lhs: EmulationGame, rhs: EmulationGame) -> Bool {
lhs.title == rhs.title
}
}

View file

@ -153,7 +153,6 @@ struct ControllerView: View {
motion.valueChangedHandler = { motion in
// Get current time
let currentTimestamp = Date().timeIntervalSince1970
let deltaTimestamp = Int32((currentTimestamp - lastTimestamp) * 1000) // Difference in milliseconds
// Update last timestamp
lastTimestamp = currentTimestamp

View file

@ -52,7 +52,7 @@ struct GameListView: View {
var body: some View {
let filteredGames = core.games.filter { game in
guard let EmulationGame = game as? PoYuzume else { return false }
guard let EmulationGame = game as? EmulationGame else { return false }
return searchText.isEmpty || EmulationGame.title.localizedCaseInsensitiveContains(searchText)
}
ScrollView {

View file

@ -18,13 +18,13 @@ public struct Joystick: View {
let appui = AppUI.shared
@ObservedObject public var joystickMonitor = SwiftUIJoystick.JoystickMonitor()
@ObservedObject public var joystickMonitor = JoystickMonitor()
private let dragDiameter: CGFloat = 160
private let shape: SwiftUIJoystick.JoystickShape = .circle
private let shape: JoystickShape = .circle
public var body: some View {
VStack{
SwiftUIJoystick.JoystickBuilder(
JoystickBuilder(
monitor: self.joystickMonitor,
width: self.dragDiameter,
shape: .circle,

View file

@ -18,10 +18,10 @@ class KeyboardHostingController<Content: View>: UIHostingController<Content> {
override var keyCommands: [UIKeyCommand]? {
return [
UIKeyCommand(input: UIKeyCommand.inputUpArrow, modifierFlags: [], action: #selector(handleKeyCommand)),
UIKeyCommand(input: UIKeyCommand.inputDownArrow, modifierFlags: [], action: #selector(handleKeyCommand)),
UIKeyCommand(input: UIKeyCommand.inputLeftArrow, modifierFlags: [], action: #selector(handleKeyCommand)),
UIKeyCommand(input: UIKeyCommand.inputRightArrow, modifierFlags: [], action: #selector(handleKeyCommand)),
UIKeyCommand(input: UIKeyInputUpArrow, modifierFlags: [], action: #selector(handleKeyCommand)),
UIKeyCommand(input: UIKeyInputDownArrow, modifierFlags: [], action: #selector(handleKeyCommand)),
UIKeyCommand(input: UIKeyInputLeftArrow, modifierFlags: [], action: #selector(handleKeyCommand)),
UIKeyCommand(input: UIKeyInputRightArrow, modifierFlags: [], action: #selector(handleKeyCommand)),
UIKeyCommand(input: "w", modifierFlags: [], action: #selector(handleKeyCommand)),
UIKeyCommand(input: "s", modifierFlags: [], action: #selector(handleKeyCommand)),
UIKeyCommand(input: "a", modifierFlags: [], action: #selector(handleKeyCommand)),
@ -32,13 +32,13 @@ class KeyboardHostingController<Content: View>: UIHostingController<Content> {
@objc func handleKeyCommand(_ sender: UIKeyCommand) {
if let input = sender.input {
switch input {
case UIKeyCommand.inputUpArrow:
case UIKeyInputUpArrow:
print("Up Arrow Pressed")
case UIKeyCommand.inputDownArrow:
case UIKeyInputDownArrow:
print("Down Arrow Pressed")
case UIKeyCommand.inputLeftArrow:
case UIKeyInputLeftArrow:
print("Left Arrow Pressed")
case UIKeyCommand.inputRightArrow:
case UIKeyInputRightArrow:
print("Right Arrow Pressed")
case "w":
print("W Key Pressed")

View file

@ -32,7 +32,7 @@ struct LibraryView: View {
if doesitexist.0, doesitexist.1 {
HomeView(core: core)
} else {
let (doesKeyExist, doesProdExist) = doeskeysexist()
let (doesKeyExist, doesProdExist) = doesKeysExist()
ScrollView {
Text("You Are Missing These Files:")
.font(.headline)
@ -73,7 +73,7 @@ struct LibraryView: View {
}
}
.refreshable {
doesitexist = doeskeysexist()
doesitexist = doesKeysExist()
}
@ -116,7 +116,7 @@ struct LibraryView: View {
}
})
.onAppear() {
doesitexist = doeskeysexist()
doesitexist = doesKeysExist()
}
.navigationBarTitle("Library", displayMode: .inline)
.toolbar {
@ -155,36 +155,30 @@ struct LibraryView: View {
}
}
func doeskeysexist() -> (Bool, Bool) {
func doesKeysExist() -> (Bool, Bool) {
var doesprodexist = false
var doestitleexist = false
let title = core.root.appendingPathComponent("keys").appendingPathComponent("title.keys")
let prod = core.root.appendingPathComponent("keys").appendingPathComponent("prod.keys")
let fileManager = FileManager.default
let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0]
if fileManager.fileExists(atPath: prod.path) {
doesprodexist = true
} else {
print("File does not exist")
}
if fileManager.fileExists(atPath: title.path) {
doestitleexist = true
} else {
print("File does not exist")
}
return (doestitleexist, doesprodexist)
}
}
func getDeveloperNames() -> String {
guard let s = infoDictionary?["CFBundleIdentifier"] as? String else {
return "Unknown"
}
return s
// guard let s = infoDictionary?["CFBundleIdentifier"] as? String else {
// return "Unknown"
// }
// return s
return "what"
}