forked from MeloNX/MeloNX
GameList layout cleanup and proper colors applied
This commit is contained in:
parent
89ad9b6457
commit
b9d598a459
@ -238,7 +238,7 @@ struct GameLibraryView: View {
|
|||||||
|
|
||||||
private var gameListView: some View {
|
private var gameListView: some View {
|
||||||
ScrollView {
|
ScrollView {
|
||||||
LazyVStack(spacing: 0) {
|
LazyVStack(alignment: .leading, spacing: 0) {
|
||||||
if !isSearching && !realRecentGames.isEmpty {
|
if !isSearching && !realRecentGames.isEmpty {
|
||||||
// Recent Games Section
|
// Recent Games Section
|
||||||
VStack(alignment: .leading, spacing: 0) {
|
VStack(alignment: .leading, spacing: 0) {
|
||||||
@ -278,44 +278,27 @@ struct GameLibraryView: View {
|
|||||||
.foregroundColor(.primary)
|
.foregroundColor(.primary)
|
||||||
.padding(.horizontal)
|
.padding(.horizontal)
|
||||||
.padding(.top)
|
.padding(.top)
|
||||||
|
|
||||||
ForEach(filteredGames) { game in
|
|
||||||
GameListRow(
|
|
||||||
game: game,
|
|
||||||
startemu: $startemu,
|
|
||||||
games: games,
|
|
||||||
isViewingGameInfo: $isViewingGameInfo,
|
|
||||||
isSelectingGameUpdate: $isSelectingGameUpdate,
|
|
||||||
isSelectingGameDLC: $isSelectingGameDLC,
|
|
||||||
gameRequirements: $gameRequirements,
|
|
||||||
gameInfo: $gameInfo,
|
|
||||||
isShowingGameController: $gameController,
|
|
||||||
perGameSettings: $gamePerGameSettings
|
|
||||||
)
|
|
||||||
.padding(.horizontal)
|
|
||||||
.padding(.vertical, 8)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
ForEach(filteredGames) { game in
|
|
||||||
GameListRow(
|
|
||||||
game: game,
|
|
||||||
startemu: $startemu,
|
|
||||||
games: games,
|
|
||||||
isViewingGameInfo: $isViewingGameInfo,
|
|
||||||
isSelectingGameUpdate: $isSelectingGameUpdate,
|
|
||||||
isSelectingGameDLC: $isSelectingGameDLC,
|
|
||||||
gameRequirements: $gameRequirements,
|
|
||||||
gameInfo: $gameInfo,
|
|
||||||
isShowingGameController: $gameController,
|
|
||||||
perGameSettings: $gamePerGameSettings
|
|
||||||
)
|
|
||||||
.padding(.horizontal)
|
|
||||||
.padding(.vertical, 8)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ForEach(filteredGames) { game in
|
||||||
|
GameListRow(
|
||||||
|
game: game,
|
||||||
|
startemu: $startemu,
|
||||||
|
games: games,
|
||||||
|
isViewingGameInfo: $isViewingGameInfo,
|
||||||
|
isSelectingGameUpdate: $isSelectingGameUpdate,
|
||||||
|
isSelectingGameDLC: $isSelectingGameDLC,
|
||||||
|
gameRequirements: $gameRequirements,
|
||||||
|
gameInfo: $gameInfo,
|
||||||
|
isShowingGameController: $gameController,
|
||||||
|
perGameSettings: $gamePerGameSettings
|
||||||
|
)
|
||||||
|
.padding(.horizontal)
|
||||||
|
.padding(.vertical, 8)
|
||||||
|
}
|
||||||
|
|
||||||
Spacer(minLength: 50)
|
Spacer(minLength: 50)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -891,19 +874,9 @@ struct GameListRow: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
if $settingsManager.config.wrappedValue.contains(where: { $0.key == game.titleId }) {
|
|
||||||
Image(systemName: "gearshape.circle")
|
|
||||||
.resizable()
|
|
||||||
.aspectRatio(contentMode: .fill)
|
|
||||||
.foregroundStyle(.blue)
|
|
||||||
.frame(width: 20, height: 20)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .trailing) {
|
||||||
// Compatibility badges
|
// Compatibility badges
|
||||||
HStack {
|
|
||||||
if let gameReq = gameRequirements.first(where: { $0.game_id == game.titleId }) {
|
if let gameReq = gameRequirements.first(where: { $0.game_id == game.titleId }) {
|
||||||
let totalMemory = ProcessInfo.processInfo.physicalMemory
|
let totalMemory = ProcessInfo.processInfo.physicalMemory
|
||||||
|
|
||||||
@ -937,6 +910,15 @@ struct GameListRow: View {
|
|||||||
.layoutPriority(1)
|
.layoutPriority(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HStack {
|
||||||
|
if $settingsManager.config.wrappedValue.contains(where: { $0.key == game.titleId }) {
|
||||||
|
Image(systemName: "gearshape.circle")
|
||||||
|
.resizable()
|
||||||
|
.aspectRatio(contentMode: .fill)
|
||||||
|
.foregroundStyle(.blue)
|
||||||
|
.frame(width: 20, height: 20)
|
||||||
|
}
|
||||||
|
|
||||||
// Play button
|
// Play button
|
||||||
Image(systemName: "play.circle.fill")
|
Image(systemName: "play.circle.fill")
|
||||||
@ -950,71 +932,6 @@ struct GameListRow: View {
|
|||||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||||
}
|
}
|
||||||
.contentShape(Rectangle())
|
.contentShape(Rectangle())
|
||||||
.contextMenu {
|
|
||||||
Section {
|
|
||||||
Button {
|
|
||||||
startemu = game
|
|
||||||
} label: {
|
|
||||||
Label("Play Now", systemImage: "play.fill")
|
|
||||||
}
|
|
||||||
|
|
||||||
Button {
|
|
||||||
gameInfo = game
|
|
||||||
isViewingGameInfo.toggle()
|
|
||||||
|
|
||||||
if game.titleName.lowercased() == "portal" || game.titleName.lowercased() == "portal 2" {
|
|
||||||
gamepo = true
|
|
||||||
}
|
|
||||||
} label: {
|
|
||||||
Label("Game Info", systemImage: "info.circle")
|
|
||||||
}
|
|
||||||
|
|
||||||
Button {
|
|
||||||
perGameSettings = game
|
|
||||||
} label: {
|
|
||||||
Label("\(game.titleName) Settings", systemImage: "gear")
|
|
||||||
}
|
|
||||||
|
|
||||||
// isShowingGameController
|
|
||||||
|
|
||||||
Button {
|
|
||||||
isShowingGameController = game
|
|
||||||
} label: {
|
|
||||||
Label("Controller Layout", systemImage: "formfitting.gamecontroller")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Section {
|
|
||||||
Button {
|
|
||||||
gameInfo = game
|
|
||||||
isSelectingGameUpdate.toggle()
|
|
||||||
} label: {
|
|
||||||
Label("Update Manager", systemImage: "arrow.up.circle")
|
|
||||||
}
|
|
||||||
|
|
||||||
Button {
|
|
||||||
gameInfo = game
|
|
||||||
isSelectingGameDLC.toggle()
|
|
||||||
} label: {
|
|
||||||
Label("DLC Manager", systemImage: "plus.circle")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Section {
|
|
||||||
Button(role: .destructive) {
|
|
||||||
Ryujinx.clearShaderCache(game.titleId)
|
|
||||||
} label: {
|
|
||||||
Label("Clear Shader Cache", systemImage: "trash")
|
|
||||||
}
|
|
||||||
|
|
||||||
Button(role: .destructive) {
|
|
||||||
gametoDelete = game
|
|
||||||
showGameDeleteConfirmation.toggle()
|
|
||||||
} label: {
|
|
||||||
Label("Delete", systemImage: "trash")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.swipeActions(edge: .trailing) {
|
.swipeActions(edge: .trailing) {
|
||||||
Button(role: .destructive) {
|
Button(role: .destructive) {
|
||||||
gametoDelete = game
|
gametoDelete = game
|
||||||
@ -1051,6 +968,71 @@ struct GameListRow: View {
|
|||||||
}
|
}
|
||||||
.listRowInsets(EdgeInsets())
|
.listRowInsets(EdgeInsets())
|
||||||
.wow(colorScheme)
|
.wow(colorScheme)
|
||||||
|
.contextMenu {
|
||||||
|
Section {
|
||||||
|
Button {
|
||||||
|
startemu = game
|
||||||
|
} label: {
|
||||||
|
Label("Play Now", systemImage: "play.fill")
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
gameInfo = game
|
||||||
|
isViewingGameInfo.toggle()
|
||||||
|
|
||||||
|
if game.titleName.lowercased() == "portal" || game.titleName.lowercased() == "portal 2" {
|
||||||
|
gamepo = true
|
||||||
|
}
|
||||||
|
} label: {
|
||||||
|
Label("Game Info", systemImage: "info.circle")
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
perGameSettings = game
|
||||||
|
} label: {
|
||||||
|
Label("\(game.titleName) Settings", systemImage: "gear")
|
||||||
|
}
|
||||||
|
|
||||||
|
// isShowingGameController
|
||||||
|
|
||||||
|
Button {
|
||||||
|
isShowingGameController = game
|
||||||
|
} label: {
|
||||||
|
Label("Controller Layout", systemImage: "formfitting.gamecontroller")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Section {
|
||||||
|
Button {
|
||||||
|
gameInfo = game
|
||||||
|
isSelectingGameUpdate.toggle()
|
||||||
|
} label: {
|
||||||
|
Label("Update Manager", systemImage: "arrow.up.circle")
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
gameInfo = game
|
||||||
|
isSelectingGameDLC.toggle()
|
||||||
|
} label: {
|
||||||
|
Label("DLC Manager", systemImage: "plus.circle")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Section {
|
||||||
|
Button(role: .destructive) {
|
||||||
|
Ryujinx.clearShaderCache(game.titleId)
|
||||||
|
} label: {
|
||||||
|
Label("Clear Shader Cache", systemImage: "trash")
|
||||||
|
}
|
||||||
|
|
||||||
|
Button(role: .destructive) {
|
||||||
|
gametoDelete = game
|
||||||
|
showGameDeleteConfirmation.toggle()
|
||||||
|
} label: {
|
||||||
|
Label("Delete", systemImage: "trash")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Button(action: {
|
Button(action: {
|
||||||
startemu = game
|
startemu = game
|
||||||
@ -1302,7 +1284,7 @@ extension View {
|
|||||||
self
|
self
|
||||||
.background(
|
.background(
|
||||||
RoundedRectangle(cornerRadius: 12)
|
RoundedRectangle(cornerRadius: 12)
|
||||||
.fill(colorScheme == .dark ? Color(.systemGray6) : Color(.systemGray6).opacity(0.5))
|
.fill(Color(uiColor: .secondarySystemGroupedBackground))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user