create(GameParametersMenuView): add edit component so

the players can choose their names
pull/16/head
Johan LACHENAL 11 months ago
parent dfd5393fc9
commit 9d6e262f20

@ -21,7 +21,9 @@
C205A2D22BF373380097BD93 /* WtaTennisUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C205A2D12BF373380097BD93 /* WtaTennisUITests.swift */; }; C205A2D22BF373380097BD93 /* WtaTennisUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C205A2D12BF373380097BD93 /* WtaTennisUITests.swift */; };
C205A2D42BF373380097BD93 /* WtaTennisUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C205A2D32BF373380097BD93 /* WtaTennisUITestsLaunchTests.swift */; }; C205A2D42BF373380097BD93 /* WtaTennisUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C205A2D32BF373380097BD93 /* WtaTennisUITestsLaunchTests.swift */; };
C24659E52BF5FE09004E80D5 /* MainMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = C24659E42BF5FE09004E80D5 /* MainMenu.swift */; }; C24659E52BF5FE09004E80D5 /* MainMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = C24659E42BF5FE09004E80D5 /* MainMenu.swift */; };
C24659E92BF60FAA004E80D5 /* MainMenuButtonComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = C24659E82BF60FAA004E80D5 /* MainMenuButtonComponent.swift */; }; C24659E92BF60FAA004E80D5 /* ButtonComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = C24659E82BF60FAA004E80D5 /* ButtonComponent.swift */; };
C25220EE2C00AC7E0026B71F /* GameParametersMenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C25220ED2C00AC7E0026B71F /* GameParametersMenuView.swift */; };
C25220F32C00AF490026B71F /* EditComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = C25220F22C00AF490026B71F /* EditComponent.swift */; };
C2F417702BFE2FBE00CFF0B3 /* howto.md in Resources */ = {isa = PBXBuildFile; fileRef = C2F4176C2BFE2FBD00CFF0B3 /* howto.md */; }; C2F417702BFE2FBE00CFF0B3 /* howto.md in Resources */ = {isa = PBXBuildFile; fileRef = C2F4176C2BFE2FBD00CFF0B3 /* howto.md */; };
C2F417722BFE2FBE00CFF0B3 /* capture.png in Resources */ = {isa = PBXBuildFile; fileRef = C2F4176E2BFE2FBD00CFF0B3 /* capture.png */; }; C2F417722BFE2FBE00CFF0B3 /* capture.png in Resources */ = {isa = PBXBuildFile; fileRef = C2F4176E2BFE2FBD00CFF0B3 /* capture.png */; };
C2F417732BFE2FBE00CFF0B3 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = C2F4176F2BFE2FBD00CFF0B3 /* README.md */; }; C2F417732BFE2FBE00CFF0B3 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = C2F4176F2BFE2FBD00CFF0B3 /* README.md */; };
@ -62,7 +64,9 @@
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>"; };
C24659E82BF60FAA004E80D5 /* MainMenuButtonComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMenuButtonComponent.swift; sourceTree = "<group>"; }; C24659E82BF60FAA004E80D5 /* ButtonComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonComponent.swift; sourceTree = "<group>"; };
C25220ED2C00AC7E0026B71F /* GameParametersMenuView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameParametersMenuView.swift; sourceTree = "<group>"; };
C25220F22C00AF490026B71F /* EditComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditComponent.swift; sourceTree = "<group>"; };
C2F4176C2BFE2FBD00CFF0B3 /* howto.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = howto.md; sourceTree = "<group>"; }; C2F4176C2BFE2FBD00CFF0B3 /* howto.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = howto.md; sourceTree = "<group>"; };
C2F4176D2BFE2FBD00CFF0B3 /* DSQ.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = DSQ.xcframework; sourceTree = "<group>"; }; C2F4176D2BFE2FBD00CFF0B3 /* DSQ.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = DSQ.xcframework; sourceTree = "<group>"; };
C2F4176E2BFE2FBD00CFF0B3 /* capture.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = capture.png; sourceTree = "<group>"; }; C2F4176E2BFE2FBD00CFF0B3 /* capture.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = capture.png; sourceTree = "<group>"; };
@ -147,6 +151,8 @@
C205A2BC2BF373380097BD93 /* Views */ = { C205A2BC2BF373380097BD93 /* Views */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
C25220F02C00AD7F0026B71F /* Components */,
C25220EC2C00AC530026B71F /* GameParametersMenu */,
C25220EB2C00A9230026B71F /* GeneralParametersMenu */, C25220EB2C00A9230026B71F /* GeneralParametersMenu */,
C25220EA2C00A9010026B71F /* MainMenu */, C25220EA2C00A9010026B71F /* MainMenu */,
82F9D32F2BFE3A75009EDFAF /* History */, 82F9D32F2BFE3A75009EDFAF /* History */,
@ -175,7 +181,6 @@
C25220EA2C00A9010026B71F /* MainMenu */ = { C25220EA2C00A9010026B71F /* MainMenu */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
C24659E82BF60FAA004E80D5 /* MainMenuButtonComponent.swift */,
C24659E42BF5FE09004E80D5 /* MainMenu.swift */, C24659E42BF5FE09004E80D5 /* MainMenu.swift */,
); );
path = MainMenu; path = MainMenu;
@ -184,13 +189,38 @@
C25220EB2C00A9230026B71F /* GeneralParametersMenu */ = { C25220EB2C00A9230026B71F /* GeneralParametersMenu */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
C20310D92BFCC8600031657D /* ToggleComponent.swift */,
C20310D52BFCB5FB0031657D /* PickerComponent.swift */,
C20310D72BFCC2410031657D /* GeneralParametersMenuView.swift */, C20310D72BFCC2410031657D /* GeneralParametersMenuView.swift */,
); );
path = GeneralParametersMenu; path = GeneralParametersMenu;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
C25220EC2C00AC530026B71F /* GameParametersMenu */ = {
isa = PBXGroup;
children = (
C25220ED2C00AC7E0026B71F /* GameParametersMenuView.swift */,
);
path = GameParametersMenu;
sourceTree = "<group>";
};
C25220F02C00AD7F0026B71F /* Components */ = {
isa = PBXGroup;
children = (
C25220F12C00ADF70026B71F /* Controls */,
);
path = Components;
sourceTree = "<group>";
};
C25220F12C00ADF70026B71F /* Controls */ = {
isa = PBXGroup;
children = (
C20310D52BFCB5FB0031657D /* PickerComponent.swift */,
C20310D92BFCC8600031657D /* ToggleComponent.swift */,
C24659E82BF60FAA004E80D5 /* ButtonComponent.swift */,
C25220F22C00AF490026B71F /* EditComponent.swift */,
);
path = Controls;
sourceTree = "<group>";
};
C2F4176A2BFE2F8C00CFF0B3 /* Model */ = { C2F4176A2BFE2F8C00CFF0B3 /* Model */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -345,14 +375,16 @@
files = ( files = (
C205A2B92BF373360097BD93 /* ContentView.swift in Sources */, C205A2B92BF373360097BD93 /* ContentView.swift in Sources */,
82F9D3312BFE3A9F009EDFAF /* HistoryGameDetail.swift in Sources */, 82F9D3312BFE3A9F009EDFAF /* HistoryGameDetail.swift in Sources */,
C24659E92BF60FAA004E80D5 /* MainMenuButtonComponent.swift in Sources */, C24659E92BF60FAA004E80D5 /* ButtonComponent.swift in Sources */,
C24659E52BF5FE09004E80D5 /* MainMenu.swift in Sources */, C24659E52BF5FE09004E80D5 /* MainMenu.swift in Sources */,
82F9D3362BFE3B3C009EDFAF /* HistoryView.swift in Sources */, 82F9D3362BFE3B3C009EDFAF /* HistoryView.swift in Sources */,
C20310D82BFCC2410031657D /* GeneralParametersMenuView.swift in Sources */, C20310D82BFCC2410031657D /* GeneralParametersMenuView.swift in Sources */,
C205A2B72BF373360097BD93 /* ArkitDoushiQiApp.swift in Sources */, C205A2B72BF373360097BD93 /* ArkitDoushiQiApp.swift in Sources */,
C25220F32C00AF490026B71F /* EditComponent.swift in Sources */,
C20310D62BFCB5FB0031657D /* PickerComponent.swift in Sources */, C20310D62BFCB5FB0031657D /* PickerComponent.swift in Sources */,
82F9D3332BFE3B12009EDFAF /* HistoryHeader.swift in Sources */, 82F9D3332BFE3B12009EDFAF /* HistoryHeader.swift in Sources */,
C20310DA2BFCC8600031657D /* ToggleComponent.swift in Sources */, C20310DA2BFCC8600031657D /* ToggleComponent.swift in Sources */,
C25220EE2C00AC7E0026B71F /* GameParametersMenuView.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };

@ -7,7 +7,7 @@
import SwiftUI import SwiftUI
struct MainMenuButtonComponent<Content : View>: View { struct ButtonComponent<Content : View>: View {
let content: Content let content: Content
let title: String let title: String
@ -33,11 +33,11 @@ struct MainMenuButtonComponent<Content : View>: View {
} }
} }
struct MainMenuButtonComponent_Previews: PreviewProvider { struct ButtonComponent_Previews: PreviewProvider {
static var previews: some View { static var previews: some View {
NavigationView { NavigationView {
VStack { VStack {
MainMenuButtonComponent(title: "Parties enregistrées") { ButtonComponent(title: "Parties enregistrées") {
Text("Je suis un test") Text("Je suis un test")
} }
} }

@ -0,0 +1,25 @@
//
// EditComponent.swift
// ArkitDoushiQi
//
// Created by Johan LACHENAL on 24/05/2024.
//
import SwiftUI
struct EditComponent: View {
@State private var name = "Joueur 1"
var body: some View {
Form {
Section(header : Text("Nom du joueur 1")) {
TextField("Joueur 1", text : $name)
}
}
}
}
struct EditComponent_Previews: PreviewProvider {
static var previews: some View {
EditComponent()
}
}

@ -0,0 +1,20 @@
//
// GameParametersMenuView.swift
// ArkitDoushiQi
//
// Created by Johan LACHENAL on 24/05/2024.
//
import SwiftUI
struct GameParametersMenuView: View {
var body: some View {
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
}
}
struct GameParametersMenuView_Previews: PreviewProvider {
static var previews: some View {
GameParametersMenuView()
}
}

@ -25,13 +25,13 @@ struct MainMenu: View {
} }
Spacer().frame(height: 40) Spacer().frame(height: 40)
VStack(alignment: .leading) { VStack(alignment: .leading) {
MainMenuButtonComponent(title: playButtonText) ButtonComponent(title: playButtonText)
{ Text("jeu page") } { Text("jeu page") }
Spacer().frame(height: 30) Spacer().frame(height: 30)
MainMenuButtonComponent(title: registeredGamesButtonText) ButtonComponent(title: registeredGamesButtonText)
{ Text("parties enregistrées page") } { Text("parties enregistrées page") }
Spacer().frame(height: 30) Spacer().frame(height: 30)
MainMenuButtonComponent(title: ParametersButtontText) ButtonComponent(title: ParametersButtontText)
{ GeneralParametersMenuView() } { GeneralParametersMenuView() }
} }
Spacer() Spacer()

Loading…
Cancel
Save