From c56dc05f3ab8e7a386fdac27a1f9f2517a231a5f Mon Sep 17 00:00:00 2001 From: "johan.lachenal" Date: Tue, 28 May 2024 17:32:44 +0200 Subject: [PATCH] Add a ProfileEditComponent --- .DS_Store | Bin 6148 -> 6148 bytes .../ArkitDoushiQi.xcodeproj/project.pbxproj | 4 +++ .../profil.imageset}/Contents.json | 1 + .../images/profil.imageset/Unknown.jpeg | Bin 0 -> 7928 bytes .../Components/Controls/EditComponent.swift | 11 +++--- .../Components/Visuals/ProfileComponent.swift | 32 ++++++++++++++++-- .../Components/Visuals/ProfileEdit.swift | 27 +++++++++++++++ .../GameParametersMenuView.swift | 16 +++++++-- 8 files changed, 83 insertions(+), 8 deletions(-) rename ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/{Image.imageset => images/profil.imageset}/Contents.json (88%) create mode 100644 ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/images/profil.imageset/Unknown.jpeg create mode 100644 ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ProfileEdit.swift diff --git a/.DS_Store b/.DS_Store index cccd18acbb30e571e79408b1ef058db81fa3f2ce..8112cff6248d1057d6d391f132a91e82f4adb8b9 100644 GIT binary patch delta 20 bcmZoMXffFEl!@KaSVzIs&|vc$CJ9jhMw|vC delta 20 bcmZoMXffFEl!@KUL`T8Y*mCn5CJ9jhM#ly$ diff --git a/ArkitDoushiQi/ArkitDoushiQi.xcodeproj/project.pbxproj b/ArkitDoushiQi/ArkitDoushiQi.xcodeproj/project.pbxproj index 20a11ba..107c71d 100644 --- a/ArkitDoushiQi/ArkitDoushiQi.xcodeproj/project.pbxproj +++ b/ArkitDoushiQi/ArkitDoushiQi.xcodeproj/project.pbxproj @@ -27,6 +27,7 @@ C24659E92BF60FAA004E80D5 /* ButtonComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = C24659E82BF60FAA004E80D5 /* ButtonComponent.swift */; }; C24DAB5C2C061DC700681CD0 /* AI.swift in Sources */ = {isa = PBXBuildFile; fileRef = C24DAB5B2C061DC700681CD0 /* AI.swift */; }; C24DAB5E2C061E3A00681CD0 /* Language.swift in Sources */ = {isa = PBXBuildFile; fileRef = C24DAB5D2C061E3A00681CD0 /* Language.swift */; }; + C24DAB622C062DBC00681CD0 /* ProfileEdit.swift in Sources */ = {isa = PBXBuildFile; fileRef = C24DAB612C062DBC00681CD0 /* ProfileEdit.swift */; }; C25220EE2C00AC7E0026B71F /* GameParametersMenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C25220ED2C00AC7E0026B71F /* GameParametersMenuView.swift */; }; C25220F32C00AF490026B71F /* EditComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = C25220F22C00AF490026B71F /* EditComponent.swift */; }; C2F394082C0462400070B4F6 /* PhotoButtonComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2F394072C0462400070B4F6 /* PhotoButtonComponent.swift */; }; @@ -74,6 +75,7 @@ C24659E82BF60FAA004E80D5 /* ButtonComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonComponent.swift; sourceTree = ""; }; C24DAB5B2C061DC700681CD0 /* AI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AI.swift; sourceTree = ""; }; C24DAB5D2C061E3A00681CD0 /* Language.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Language.swift; sourceTree = ""; }; + C24DAB612C062DBC00681CD0 /* ProfileEdit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileEdit.swift; sourceTree = ""; }; C25220ED2C00AC7E0026B71F /* GameParametersMenuView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameParametersMenuView.swift; sourceTree = ""; }; C25220F22C00AF490026B71F /* EditComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditComponent.swift; sourceTree = ""; }; C2F394072C0462400070B4F6 /* PhotoButtonComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhotoButtonComponent.swift; sourceTree = ""; }; @@ -262,6 +264,7 @@ isa = PBXGroup; children = ( C2F3940A2C0463940070B4F6 /* ProfileComponent.swift */, + C24DAB612C062DBC00681CD0 /* ProfileEdit.swift */, ); path = Visuals; sourceTree = ""; @@ -415,6 +418,7 @@ 82CE59EB2C045E3800ADEE24 /* GameView.swift in Sources */, C20310DA2BFCC8600031657D /* ToggleComponent.swift in Sources */, C25220EE2C00AC7E0026B71F /* GameParametersMenuView.swift in Sources */, + C24DAB622C062DBC00681CD0 /* ProfileEdit.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/Image.imageset/Contents.json b/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/images/profil.imageset/Contents.json similarity index 88% rename from ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/Image.imageset/Contents.json rename to ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/images/profil.imageset/Contents.json index a19a549..42378de 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/Image.imageset/Contents.json +++ b/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/images/profil.imageset/Contents.json @@ -1,6 +1,7 @@ { "images" : [ { + "filename" : "Unknown.jpeg", "idiom" : "universal", "scale" : "1x" }, diff --git a/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/images/profil.imageset/Unknown.jpeg b/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/images/profil.imageset/Unknown.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..9148723aac74342e1f9de78bbd8d571a046f28d9 GIT binary patch literal 7928 zcma)fWl$VUuU4G0^i=oj^6M4=S4kc$4}gOM0N~yX@VW;03P3|f0pjBm0)aq6B0^#kLSjM^ z5+XuELSo{#LGrdCB%xrUCIQit5fZ-RdPmR9%FfPCOvNL}!zRGQ#?A_dj*gCvg$=^R z1+mdn)3d#S_09h8c#@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ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/EditComponent.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/EditComponent.swift index 073ca2b..60d522d 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/EditComponent.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/EditComponent.swift @@ -9,12 +9,15 @@ import SwiftUI struct EditComponent: View { let explanation : String - let value : String - @State private var name = "Joueur 1" + @State private var name : String + init(explanation: String, value: String) { + self.explanation = explanation + self.name = value + } var body: some View { Form { Section(header : Text(explanation)) { - TextField(value, text : $name) + TextField(name, text : $name) } } } @@ -22,6 +25,6 @@ struct EditComponent: View { struct EditComponent_Previews: PreviewProvider { static var previews: some View { - EditComponent(explanation: "Nom du joueur 1", value : "Joueur 1") + EditComponent(explanation: "Nom du Joueur 1", value: "Joueur 1") } } diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ProfileComponent.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ProfileComponent.swift index 4f12d75..242d2f8 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ProfileComponent.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ProfileComponent.swift @@ -8,13 +8,41 @@ import SwiftUI struct ProfileComponent: View { + let imageName: String + let color : Color + let profileWidth : CGFloat + let profileHeight : CGFloat var body: some View { - Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + GeometryReader { geometry in + ZStack { + // Background color + color + + // Profile Image + Image(imageName) + .resizable() + .scaledToFill() + .clipShape(Circle()) + .frame(width: geometry.size.width * 0.9, height: geometry.size.height * 0.95) // Smaller than the ZStack + } + // Ensure the ZStack takes the size of the GeometryReader + .frame(width: geometry.size.width, height: geometry.size.height) + .clipShape(Circle()) + } + .aspectRatio(1, contentMode: .fit) + .frame(width: profileWidth, height: profileHeight) // Optional fixed size } } struct ProfileComponent_Previews: PreviewProvider { static var previews: some View { - ProfileComponent() + ProfileComponent( + imageName: "profil", + color: Color(.red), + profileWidth: 200, + profileHeight : 200 + ) + .previewLayout(.sizeThatFits) + .padding() } } diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ProfileEdit.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ProfileEdit.swift new file mode 100644 index 0000000..35987fe --- /dev/null +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ProfileEdit.swift @@ -0,0 +1,27 @@ +// +// ProfileEdit.swift +// ArkitDoushiQi +// +// Created by Johan LACHENAL on 28/05/2024. +// + +import SwiftUI + +struct ProfileEdit: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct ProfileEdit_Previews: PreviewProvider { + static var previews: some View { + VStack { + ProfileComponent(imageName: "profil", color: Color(.red), profileWidth: 100, profileHeight: 100) + VStack(alignment: .trailing) { + HStack { + EditComponent(explanation: "Nom du Joueur 1", value: "Joueur 1") + } + } + } + } +} diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/GameParametersMenu/GameParametersMenuView.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/GameParametersMenu/GameParametersMenuView.swift index 79893b5..0c04497 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/GameParametersMenu/GameParametersMenuView.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/GameParametersMenu/GameParametersMenuView.swift @@ -37,8 +37,20 @@ struct GameParametersMenuView: View { PickerComponent(title: "Sélectionne une IA :", selectedOption: $selectedAIOption, options: AIT.allCases) - EditComponent(explanation: "Nom du joueur 1", value: "Joueur 1") - EditComponent(explanation: "Nom du joueur 2",value: "Joueur 2") + ProfileComponent( + imageName: "profil", + color: Color(.red), + profileWidth: 100, + profileHeight : 100 + ) + EditComponent(explanation: "Nom du joueur 1", value: "Joueur 1").frame(width: .infinity,height: 100) + ProfileComponent( + imageName: "profil", + color: Color(.red), + profileWidth: 100, + profileHeight : 100 + ) + EditComponent(explanation: "Nom du joueur 2",value: "Joueur 2").frame(width: .infinity,height: 100) ButtonComponent(title: "Lancer la partie") { GameView() }.padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32))