Tout fonctionne juste c'est moche

pull/24/head
Louis DUFOUR 10 months ago
parent f129ea661c
commit 5d9333d765

BIN
.DS_Store vendored

Binary file not shown.

@ -7,6 +7,10 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
16038A272C197B800074346E /* FlagManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16038A262C197B800074346E /* FlagManager.swift */; };
165725EA2C1984CC0052D7EF /* FontManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 165725E92C1984CC0052D7EF /* FontManager.swift */; };
165725F12C1985920052D7EF /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 165725EC2C1985920052D7EF /* Localizable.strings */; };
165725F22C1985920052D7EF /* nuku1.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 165725F02C1985920052D7EF /* nuku1.ttf */; };
82CE59E92C045D1100ADEE24 /* GameScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82CE59E82C045D1100ADEE24 /* GameScene.swift */; }; 82CE59E92C045D1100ADEE24 /* GameScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82CE59E82C045D1100ADEE24 /* GameScene.swift */; };
82CE59EB2C045E3800ADEE24 /* GameView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82CE59EA2C045E3800ADEE24 /* GameView.swift */; }; 82CE59EB2C045E3800ADEE24 /* GameView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82CE59EA2C045E3800ADEE24 /* GameView.swift */; };
82CE59EF2C0460E500ADEE24 /* SpriteMoople.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82CE59EE2C0460E500ADEE24 /* SpriteMoople.swift */; }; 82CE59EF2C0460E500ADEE24 /* SpriteMoople.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82CE59EE2C0460E500ADEE24 /* SpriteMoople.swift */; };
@ -35,8 +39,6 @@
C2F015262C09D3E7000F7221 /* ProfileEdit.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2F0151D2C09D3E7000F7221 /* ProfileEdit.swift */; }; C2F015262C09D3E7000F7221 /* ProfileEdit.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2F0151D2C09D3E7000F7221 /* ProfileEdit.swift */; };
C2F0152A2C09D420000F7221 /* Stub.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2F015282C09D420000F7221 /* Stub.swift */; }; C2F0152A2C09D420000F7221 /* Stub.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2F015282C09D420000F7221 /* Stub.swift */; };
C2F0152B2C09D420000F7221 /* PartyEnregistery.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2F015292C09D420000F7221 /* PartyEnregistery.swift */; }; C2F0152B2C09D420000F7221 /* PartyEnregistery.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2F015292C09D420000F7221 /* PartyEnregistery.swift */; };
C2F015392C09D5A5000F7221 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = C2F015372C09D5A5000F7221 /* Localizable.strings */; };
C2F0153D2C09D5C0000F7221 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = C2F0153B2C09D5C0000F7221 /* Localizable.strings */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
@ -57,6 +59,12 @@
/* End PBXContainerItemProxy section */ /* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
16038A262C197B800074346E /* FlagManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlagManager.swift; sourceTree = "<group>"; };
16038A2A2C197DEC0074346E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
165725E92C1984CC0052D7EF /* FontManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FontManager.swift; sourceTree = "<group>"; };
165725ED2C1985920052D7EF /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
165725EE2C1985920052D7EF /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = "<group>"; };
165725F02C1985920052D7EF /* nuku1.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = nuku1.ttf; sourceTree = "<group>"; };
82CE59E82C045D1100ADEE24 /* GameScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameScene.swift; sourceTree = "<group>"; }; 82CE59E82C045D1100ADEE24 /* GameScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameScene.swift; sourceTree = "<group>"; };
82CE59EA2C045E3800ADEE24 /* GameView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameView.swift; sourceTree = "<group>"; }; 82CE59EA2C045E3800ADEE24 /* GameView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameView.swift; sourceTree = "<group>"; };
82CE59EE2C0460E500ADEE24 /* SpriteMoople.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpriteMoople.swift; sourceTree = "<group>"; }; 82CE59EE2C0460E500ADEE24 /* SpriteMoople.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpriteMoople.swift; sourceTree = "<group>"; };
@ -70,7 +78,7 @@
C205A2CD2BF373380097BD93 /* ArkitDoushiQiUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ArkitDoushiQiUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; C205A2CD2BF373380097BD93 /* ArkitDoushiQiUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ArkitDoushiQiUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
C205A2D12BF373380097BD93 /* WtaTennisUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WtaTennisUITests.swift; sourceTree = "<group>"; }; C205A2D12BF373380097BD93 /* WtaTennisUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WtaTennisUITests.swift; sourceTree = "<group>"; };
C205A2D32BF373380097BD93 /* WtaTennisUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WtaTennisUITestsLaunchTests.swift; sourceTree = "<group>"; }; C205A2D32BF373380097BD93 /* WtaTennisUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WtaTennisUITestsLaunchTests.swift; sourceTree = "<group>"; };
C24659E42BF5FE09004E80D5 /* MainMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMenu.swift; sourceTree = "<group>"; }; C24659E42BF5FE09004E80D5 /* MainMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMenu.swift; sourceTree = "<group>"; usesTabs = 0; };
C25220ED2C00AC7E0026B71F /* GameParametersMenuView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameParametersMenuView.swift; sourceTree = "<group>"; }; C25220ED2C00AC7E0026B71F /* GameParametersMenuView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameParametersMenuView.swift; sourceTree = "<group>"; };
C2A535D82C0F56A700503472 /* DSQ.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = DSQ.xcframework; path = ../NEPASTOUCHER/DSQ.xcframework; sourceTree = "<group>"; }; C2A535D82C0F56A700503472 /* DSQ.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = DSQ.xcframework; path = ../NEPASTOUCHER/DSQ.xcframework; sourceTree = "<group>"; };
C2F015082C09D366000F7221 /* LanguageSettings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LanguageSettings.swift; sourceTree = "<group>"; }; C2F015082C09D366000F7221 /* LanguageSettings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LanguageSettings.swift; sourceTree = "<group>"; };
@ -88,8 +96,6 @@
C2F0151D2C09D3E7000F7221 /* ProfileEdit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProfileEdit.swift; sourceTree = "<group>"; }; C2F0151D2C09D3E7000F7221 /* ProfileEdit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProfileEdit.swift; sourceTree = "<group>"; };
C2F015282C09D420000F7221 /* Stub.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Stub.swift; sourceTree = "<group>"; }; C2F015282C09D420000F7221 /* Stub.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Stub.swift; sourceTree = "<group>"; };
C2F015292C09D420000F7221 /* PartyEnregistery.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PartyEnregistery.swift; sourceTree = "<group>"; }; C2F015292C09D420000F7221 /* PartyEnregistery.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PartyEnregistery.swift; sourceTree = "<group>"; };
C2F015382C09D5A5000F7221 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Localizable.strings; sourceTree = "<group>"; };
C2F0153C2C09D5C0000F7221 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = Localizable.strings; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
@ -118,6 +124,23 @@
/* End PBXFrameworksBuildPhase section */ /* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */ /* Begin PBXGroup section */
165725EB2C1985920052D7EF /* Ressources */ = {
isa = PBXGroup;
children = (
165725EC2C1985920052D7EF /* Localizable.strings */,
165725EF2C1985920052D7EF /* Font */,
);
path = Ressources;
sourceTree = "<group>";
};
165725EF2C1985920052D7EF /* Font */ = {
isa = PBXGroup;
children = (
165725F02C1985920052D7EF /* nuku1.ttf */,
);
path = Font;
sourceTree = "<group>";
};
8203E9052BF60117005F5C4A /* Frameworks */ = { 8203E9052BF60117005F5C4A /* Frameworks */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -147,6 +170,7 @@
C205A2AA2BF373360097BD93 = { C205A2AA2BF373360097BD93 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
165725EB2C1985920052D7EF /* Ressources */,
C205A2B52BF373360097BD93 /* ArkitDoushiQi */, C205A2B52BF373360097BD93 /* ArkitDoushiQi */,
C205A2C62BF373380097BD93 /* ArkitDoushiQiTests */, C205A2C62BF373380097BD93 /* ArkitDoushiQiTests */,
C205A2D02BF373380097BD93 /* ArkitDoushiQiUITests */, C205A2D02BF373380097BD93 /* ArkitDoushiQiUITests */,
@ -168,7 +192,7 @@
C205A2B52BF373360097BD93 /* ArkitDoushiQi */ = { C205A2B52BF373360097BD93 /* ArkitDoushiQi */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
C2F015352C09D592000F7221 /* Resources */, 16038A2A2C197DEC0074346E /* Info.plist */,
C2F015072C09D366000F7221 /* Utils */, C2F015072C09D366000F7221 /* Utils */,
82CE59E52C045C7500ADEE24 /* Game */, 82CE59E52C045C7500ADEE24 /* Game */,
C205A2B62BF373360097BD93 /* ArkitDoushiQiApp.swift */, C205A2B62BF373360097BD93 /* ArkitDoushiQiApp.swift */,
@ -230,6 +254,8 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
C2F015082C09D366000F7221 /* LanguageSettings.swift */, C2F015082C09D366000F7221 /* LanguageSettings.swift */,
16038A262C197B800074346E /* FlagManager.swift */,
165725E92C1984CC0052D7EF /* FontManager.swift */,
); );
path = Utils; path = Utils;
sourceTree = "<group>"; sourceTree = "<group>";
@ -292,31 +318,6 @@
path = PartyEnregistery; path = PartyEnregistery;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
C2F015352C09D592000F7221 /* Resources */ = {
isa = PBXGroup;
children = (
C2F0153A2C09D5C0000F7221 /* fr.lproj */,
C2F015362C09D5A5000F7221 /* en.lproj */,
);
path = Resources;
sourceTree = "<group>";
};
C2F015362C09D5A5000F7221 /* en.lproj */ = {
isa = PBXGroup;
children = (
C2F015372C09D5A5000F7221 /* Localizable.strings */,
);
path = en.lproj;
sourceTree = SOURCE_ROOT;
};
C2F0153A2C09D5C0000F7221 /* fr.lproj */ = {
isa = PBXGroup;
children = (
C2F0153B2C09D5C0000F7221 /* Localizable.strings */,
);
path = fr.lproj;
sourceTree = SOURCE_ROOT;
};
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
@ -423,8 +424,8 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
C205A2BE2BF373380097BD93 /* Preview Assets.xcassets in Resources */, C205A2BE2BF373380097BD93 /* Preview Assets.xcassets in Resources */,
C2F0153D2C09D5C0000F7221 /* Localizable.strings in Resources */, 165725F22C1985920052D7EF /* nuku1.ttf in Resources */,
C2F015392C09D5A5000F7221 /* Localizable.strings in Resources */, 165725F12C1985920052D7EF /* Localizable.strings in Resources */,
C205A2BB2BF373380097BD93 /* Assets.xcassets in Resources */, C205A2BB2BF373380097BD93 /* Assets.xcassets in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
@ -457,6 +458,7 @@
C2F0150C2C09D3A4000F7221 /* KeyboardReadable.swift in Sources */, C2F0150C2C09D3A4000F7221 /* KeyboardReadable.swift in Sources */,
82CE59E92C045D1100ADEE24 /* GameScene.swift in Sources */, 82CE59E92C045D1100ADEE24 /* GameScene.swift in Sources */,
C2F015242C09D3E7000F7221 /* ProfileComponent.swift in Sources */, C2F015242C09D3E7000F7221 /* ProfileComponent.swift in Sources */,
16038A272C197B800074346E /* FlagManager.swift in Sources */,
C2F0151E2C09D3E7000F7221 /* PickerComponent.swift in Sources */, C2F0151E2C09D3E7000F7221 /* PickerComponent.swift in Sources */,
C2F015212C09D3E7000F7221 /* EditImageComponent.swift in Sources */, C2F015212C09D3E7000F7221 /* EditImageComponent.swift in Sources */,
C24659E52BF5FE09004E80D5 /* MainMenu.swift in Sources */, C24659E52BF5FE09004E80D5 /* MainMenu.swift in Sources */,
@ -471,6 +473,7 @@
82CE59EB2C045E3800ADEE24 /* GameView.swift in Sources */, 82CE59EB2C045E3800ADEE24 /* GameView.swift in Sources */,
C2F0152B2C09D420000F7221 /* PartyEnregistery.swift in Sources */, C2F0152B2C09D420000F7221 /* PartyEnregistery.swift in Sources */,
C2F015102C09D3C3000F7221 /* Language.swift in Sources */, C2F015102C09D3C3000F7221 /* Language.swift in Sources */,
165725EA2C1984CC0052D7EF /* FontManager.swift in Sources */,
C25220EE2C00AC7E0026B71F /* GameParametersMenuView.swift in Sources */, C25220EE2C00AC7E0026B71F /* GameParametersMenuView.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
@ -508,18 +511,11 @@
/* End PBXTargetDependency section */ /* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */ /* Begin PBXVariantGroup section */
C2F015372C09D5A5000F7221 /* Localizable.strings */ = { 165725EC2C1985920052D7EF /* Localizable.strings */ = {
isa = PBXVariantGroup;
children = (
C2F015382C09D5A5000F7221 /* en */,
);
name = Localizable.strings;
sourceTree = "<group>";
};
C2F0153B2C09D5C0000F7221 /* Localizable.strings */ = {
isa = PBXVariantGroup; isa = PBXVariantGroup;
children = ( children = (
C2F0153C2C09D5C0000F7221 /* fr */, 165725ED2C1985920052D7EF /* en */,
165725EE2C1985920052D7EF /* fr */,
); );
name = Localizable.strings; name = Localizable.strings;
sourceTree = "<group>"; sourceTree = "<group>";
@ -651,6 +647,7 @@
DEVELOPMENT_ASSET_PATHS = "\"ArkitDoushiQi/Views\""; DEVELOPMENT_ASSET_PATHS = "\"ArkitDoushiQi/Views\"";
ENABLE_PREVIEWS = YES; ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = ArkitDoushiQi/Info.plist;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES;
@ -679,6 +676,7 @@
DEVELOPMENT_ASSET_PATHS = "\"ArkitDoushiQi/Views\""; DEVELOPMENT_ASSET_PATHS = "\"ArkitDoushiQi/Views\"";
ENABLE_PREVIEWS = YES; ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = ArkitDoushiQi/Info.plist;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES;

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UTImportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeIconFiles</key>
<array/>
<key>UTTypeTagSpecification</key>
<dict/>
</dict>
</array>
<key>UIAppFonts</key>
<array>
<string>nuku1.ttf</string>
</array>
</dict>
</plist>

@ -4,9 +4,36 @@
// //
// Created by Johan LACHENAL on 16/05/2024. // Created by Johan LACHENAL on 16/05/2024.
// //
import SwiftUI import SwiftUI
struct AnimatedCherryBlossomView: View {
@State private var moveTrees = false
@Environment(\.colorScheme) var colorScheme
var body: some View {
ZStack {
// Arbre gauche
Image(colorScheme == .dark ? "cherry_tree_dark" : "cherry_tree_light")
.resizable()
.scaledToFit()
.frame(width: 200, height: 400)
.offset(x: moveTrees ? -20 : -40, y: moveTrees ? 10 : 30)
.animation(Animation.easeInOut(duration: 3).repeatForever(autoreverses: true))
// Arbre droit
Image(colorScheme == .dark ? "cherry_tree_dark" : "cherry_tree_light")
.resizable()
.scaledToFit()
.frame(width: 200, height: 400)
.offset(x: moveTrees ? 20 : 40, y: moveTrees ? 10 : 30)
.animation(Animation.easeInOut(duration: 3).repeatForever(autoreverses: true))
}
.onAppear {
moveTrees.toggle()
}
}
}
struct MainMenu: View { struct MainMenu: View {
@EnvironmentObject var languageSettings: LanguageSettings @EnvironmentObject var languageSettings: LanguageSettings
let playButtonText: String let playButtonText: String
@ -14,78 +41,94 @@ struct MainMenu: View {
@State private var action: Int? = 0 @State private var action: Int? = 0
@AppStorage("isDarkMode") private var isDarkMode = false @AppStorage("isDarkMode") private var isDarkMode = false
@State private var reloadView = false @State private var reloadView = false
@State private var showLanguagePicker = false
@ScaledMetric(relativeTo: .body) var scaledPadding: CGFloat = 10
@Environment(\.colorScheme) var colorScheme
var body: some View { var body: some View {
NavigationView { NavigationView {
ZStack { ZStack {
// Ajouter l'image en arrière-plan // Utiliser la vue animée en arrière-plan
Image("BackGroundMenu") AnimatedCherryBlossomView()
.resizable()
.aspectRatio(contentMode: .fill)
.edgesIgnoringSafeArea(.all) .edgesIgnoringSafeArea(.all)
.frame(width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height)
VStack { VStack {
// Ajouter un HStack pour le titre et l'icône des paramètres // Ajouter le titre du jeu
HStack { Text("DOUSHIQI")
.font(.custom("Nuku Nuku", size: 48, relativeTo: .largeTitle)) // Utilisez le nom PostScript correct
Button(action: { .padding()
isDarkMode.toggle() .foregroundColor(colorScheme == .dark ? .white : .black)
}) { .offset(x: 0, y: 15)
Image(systemName: isDarkMode ? "sun.max.fill" : "moon.fill")
.foregroundColor(.white)
.padding()
}
Button(action: { Text("GAME")
// Action pour changer la langue .font(.custom("Nuku Nuku", size: 48, relativeTo: .largeTitle)) // Utilisez le nom PostScript correct
NotificationCenter.default.post(name: NSNotification.Name("LanguageChanged"), object: nil) .foregroundColor(colorScheme == .dark ? .white : .black)
}) {
Image(systemName: "globe")
.foregroundColor(.white)
.padding()
}
}
Spacer() Spacer()
// Bouton "Jouer" au centre et plus grand, sans bandeau bleu // Bouton "Jouer" au centre et plus grand, sans bandeau bleu
NavigationLink(destination: GameParametersMenuView()) NavigationLink(destination: GameParametersMenuView()) {
{
Text(playButtonText) Text(playButtonText)
.font(.largeTitle) .font(.custom("Nuku Nuku", size: 32, relativeTo: .title))
.bold() .bold()
.frame(maxWidth: .infinity) .frame(maxWidth: .infinity)
.padding() .padding()
.background(Color.white.opacity(0.2)) .background(Color.white.opacity(0.2))
.foregroundColor(.white) .foregroundColor(colorScheme == .dark ? .white : .black)
.cornerRadius(10) .cornerRadius(10)
.overlay( .overlay(
RoundedRectangle(cornerRadius: 10) RoundedRectangle(cornerRadius: 10)
.stroke(Color.white, lineWidth: 2) .stroke(colorScheme == .dark ? Color.white : Color.black, lineWidth: 2)
) )
.shadow(radius: 10) .shadow(radius: 10)
.padding(scaledPadding)
} }
.padding(.horizontal, 50) .padding(.horizontal, 50)
Spacer().frame(height: 40) Spacer().frame(height: 40)
// Bouton "Parties enregistrées" plus discret // Bouton "Parties enregistrées" plus discret
NavigationLink(destination: PartyListView()) NavigationLink(destination: PartyListView()) {
{
Text(registeredGamesButtonText) Text(registeredGamesButtonText)
.font(.headline) .font(.custom("Nuku Nuku", size: 18, relativeTo: .body))
.padding() .padding()
.background(Color.gray.opacity(0.7)) .background(Color.gray.opacity(0.7))
.foregroundColor(.white) .foregroundColor(colorScheme == .dark ? .white : .black)
.cornerRadius(10) .cornerRadius(10)
.shadow(radius: 5) .shadow(radius: 5)
.padding(scaledPadding)
} }
.padding(.horizontal, 50) .padding(.horizontal, 50)
Spacer().frame(height: 20)
// Ajouter les icônes pour les paramètres en bas du bouton "Registered Games"
HStack {
Button(action: {
isDarkMode.toggle()
}) {
Image(systemName: isDarkMode ? "sun.max.fill" : "moon.fill")
.foregroundColor(colorScheme == .dark ? .white : .black)
.padding()
.scaleEffect(1.2)
}
Button(action: {
// Afficher le sélecteur de langue
showLanguagePicker.toggle()
}) {
Image(systemName: "globe")
.foregroundColor(colorScheme == .dark ? .white : .black)
.padding()
.scaleEffect(1.2)
}
.sheet(isPresented: $showLanguagePicker) {
LanguagePickerView(showLanguagePicker: $showLanguagePicker)
.environmentObject(languageSettings)
}
}
.padding(scaledPadding)
Spacer() Spacer()
} }
.padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32)) .padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32))
@ -98,6 +141,62 @@ struct MainMenu: View {
} }
} }
struct LanguagePickerView: View {
@Binding var showLanguagePicker: Bool
@EnvironmentObject var languageSettings: LanguageSettings
@Environment(\.colorScheme) var colorScheme
var body: some View {
VStack(spacing: 30) {
Text("Choose Language")
.font(.headline)
.padding()
.foregroundColor(colorScheme == .dark ? .white : .black)
HStack(spacing: 50) {
Button(action: {
languageSettings.selectedLanguage = .French
showLanguagePicker = false
}) {
VStack {
Text(flag(country: "FR"))
.font(.system(size: 50))
Text("French")
.font(.title2)
.foregroundColor(colorScheme == .dark ? .white : .black)
}
}
Button(action: {
languageSettings.selectedLanguage = .English
showLanguagePicker = false
}) {
VStack {
Text(flag(country: "GB"))
.font(.system(size: 50))
Text("English")
.font(.title2)
.foregroundColor(colorScheme == .dark ? .white : .black)
}
}
}
Button(action: {
showLanguagePicker = false
}) {
Text("Cancel")
.font(.title2)
.padding()
.background(Color.red.opacity(0.7))
.foregroundColor(.white)
.cornerRadius(10)
}
.padding(.top, 20)
}
.padding()
}
}
struct MainMenu_Previews: PreviewProvider { struct MainMenu_Previews: PreviewProvider {
static var previews: some View { static var previews: some View {
MainMenu(playButtonText: "Play", registeredGamesButtonText: "Registered Games") MainMenu(playButtonText: "Play", registeredGamesButtonText: "Registered Games")

@ -0,0 +1,17 @@
//
// FlagManager.swift
// ArkitDoushiQi
//
// Created by Louis DUFOUR on 12/06/2024.
//
import SwiftUI
func flag(country: String) -> String {
let base = 127397
var usv = String.UnicodeScalarView()
for i in country.utf16 {
usv.append(UnicodeScalar(base + Int(i))!)
}
return String(usv)
}

@ -0,0 +1,24 @@
//
// FontManager.swift
// ArkitDoushiQi
//
// Created by Louis DUFOUR on 12/06/2024.
//
import Foundation
import UIKit
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
for family in UIFont.familyNames.sorted() {
let names = UIFont.fontNames(forFamilyName: family)
print("Family: \(family) Font names: \(names)")
}
return true
}
}
Loading…
Cancel
Save