@StateprivatevarplayerName1=NSLocalizedString("Nom du Joueur 1",comment:"")
@StateprivatevarplayerName2=NSLocalizedString("Nom du Joueur 2",comment:"")
@StateprivatevarkeyboardHeight:CGFloat=0
varbody:someView{
NavigationStack{
VStack(alignment:.leading,spacing:15){
Text(LocalizedStringKey("Paramètres de partie"))
.bold()
.font(.largeTitle)
.padding(.top,20)
GeometryReader{geometryin
ScrollView{
VStack(alignment:.leading){
Text("Paramètres de partie")
.bold()
.font(.title)
.padding()
PickerComponent(title:LocalizedStringKey("Sélectionne le type de partie :"),
selectedOption:$selectedGameType,
options:GameType.allCases)
.padding(.horizontal)
PickerComponent(title:"Sélectionne le type de partie :",selectedOption:$selectedGameType,options:GameType.allCases)
PickerComponent(title:"Sélectionne les règles :",selectedOption:$selectedRulesOption,options:Rules.allCases)
PickerComponent(title:LocalizedStringKey("Sélectionne les règles :"),
selectedOption:$selectedRulesOption,
options:Rules.allCases)
.padding(.horizontal)
ifselectedGameType==.PvAI{
PickerComponent(title:"Sélectionne une IA :",selectedOption:$selectedAIOption,options:AI.allCases)
}
ifselectedGameType==.PvAI{
PickerComponent(title:LocalizedStringKey("Sélectionne une IA :"),
selectedOption:$selectedAIOption,
options:AI.allCases)
.padding(.horizontal)
}
ProfileEdit(color:Color(.red),profileWidth:100,profileHeight:100,defaultImage:Image("profil"),imageTextChange:"Changer l'avatar du joueur 1",playerNameKey:"Nom du Joueur 1",playerName:$playerName1)
ProfileEdit(color:Color(.red),profileWidth:80,profileHeight:80,defaultImage:Image("profil"),imageTextChange:LocalizedStringKey("changer l'avatar du joueur 1"),playerNameKey:LocalizedStringKey("Nom du Joueur 1"))
ifselectedGameType==.PvP{
ProfileEdit(color:Color(.blue),profileWidth:100,profileHeight:100,defaultImage:Image("profil"),imageTextChange:"Changer l'avatar du joueur 2",playerNameKey:"Nom du Joueur 2",playerName:$playerName2)
}
ifselectedGameType==.PvP{
ProfileEdit(color:Color(.blue),profileWidth:80,profileHeight:80,defaultImage:Image("profil"),imageTextChange:LocalizedStringKey("changer l'avatar du joueur 2"),playerNameKey:LocalizedStringKey("Nom du Joueur 2"))