|
|
|
@ -14,10 +14,16 @@ struct MainMenuView: View {
|
|
|
|
|
@State private var timer: Timer?
|
|
|
|
|
@State private var showImage = false
|
|
|
|
|
|
|
|
|
|
@State var showSelectPlayer = false
|
|
|
|
|
@State var showHistoric = false
|
|
|
|
|
@State var showBestScores = false
|
|
|
|
|
@State var showPlayers = false
|
|
|
|
|
@State var showSettings = false
|
|
|
|
|
|
|
|
|
|
let images: [String] = [AppImages.SemiLion, AppImages.SemiDog, AppImages.SemiRat, AppImages.SemiWolf, AppImages.SemiLeopard, AppImages.SemiElephant, AppImages.SemiCat] // Add your image names here
|
|
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
|
NavigationView {
|
|
|
|
|
NavigationStack {
|
|
|
|
|
VStack {
|
|
|
|
|
if showSplash {
|
|
|
|
|
SplashScreenView()
|
|
|
|
@ -37,12 +43,28 @@ struct MainMenuView: View {
|
|
|
|
|
VStack {
|
|
|
|
|
HStack {
|
|
|
|
|
VStack(spacing: 25) {
|
|
|
|
|
MainMenuButton(text: "Play", destination: SelectPlayerView(), sound: "TitleScreenButtonSound", topRightCorner: 10, bottomRightCorner: 10)
|
|
|
|
|
MainMenuButton(text: "Historique", destination: HistoricView(historicVM: HistoricVM()), sound: "TitleScreenButtonSound", topRightCorner: 10, bottomRightCorner: 10)
|
|
|
|
|
MainMenuButton(text: "Best Scores", destination: ScoreBoardView(), sound: "TitleScreenButtonSound", topRightCorner: 10, bottomRightCorner: 10)
|
|
|
|
|
MainMenuButton(text: "Players", destination: PlayersView(), sound: "TitleScreenButtonSound", topRightCorner: 10, bottomRightCorner: 10)
|
|
|
|
|
MainMenuButton(text: "Settings", destination: SettingsView(), sound: "TitleScreenButtonSound", topRightCorner: 10, bottomRightCorner: 10)
|
|
|
|
|
MainMenuButton(text: "Play", sound: "TitleScreenButtonSound",onClick: { showSelectPlayer = true }, topRightCorner: 10, bottomRightCorner: 10)
|
|
|
|
|
MainMenuButton(text: "Historique", sound: "TitleScreenButtonSound",onClick: { showHistoric = true }, topRightCorner: 10, bottomRightCorner: 10)
|
|
|
|
|
MainMenuButton(text: "Best Scores", sound: "TitleScreenButtonSound",onClick: { showBestScores = true }, topRightCorner: 10, bottomRightCorner: 10)
|
|
|
|
|
MainMenuButton(text: "Players", sound: "TitleScreenButtonSound",onClick: { showPlayers = true }, topRightCorner: 10, bottomRightCorner: 10)
|
|
|
|
|
MainMenuButton(text: "Settings", sound: "TitleScreenButtonSound",onClick: { showSettings = true }, topRightCorner: 10, bottomRightCorner: 10)
|
|
|
|
|
}
|
|
|
|
|
.navigationDestination(isPresented: $showSelectPlayer) {
|
|
|
|
|
SelectPlayerView(isDisplayed: $showSelectPlayer)
|
|
|
|
|
}
|
|
|
|
|
.navigationDestination(isPresented: $showHistoric) {
|
|
|
|
|
HistoricView(historicVM: HistoricVM())
|
|
|
|
|
}
|
|
|
|
|
.navigationDestination(isPresented: $showBestScores) {
|
|
|
|
|
ScoreBoardView()
|
|
|
|
|
}
|
|
|
|
|
.navigationDestination(isPresented: $showPlayers) {
|
|
|
|
|
PlayersView()
|
|
|
|
|
}
|
|
|
|
|
.navigationDestination(isPresented: $showSettings) {
|
|
|
|
|
SettingsView()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if let currentImage = currentImage {
|
|
|
|
|
Image(currentImage)
|
|
|
|
|
.resizable()
|
|
|
|
|