mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-30 15:06:06 +00:00 
			
		
		
		
	Grid
This commit is contained in:
		
							parent
							
								
									d0977d626a
								
							
						
					
					
						commit
						2a325ce406
					
				
					 6 changed files with 205 additions and 19 deletions
				
			
		|  | @ -160,6 +160,12 @@ | |||
|     <EmbeddedResource Update="Views\PlayerCharacter\AbilitiesView.xaml"> | ||||
|       <Generator>MSBuild:UpdateDesignTimeXaml</Generator> | ||||
|     </EmbeddedResource> | ||||
|     <EmbeddedResource Update="Views\PlayerCharacter\AbilityBaseValueView.xaml"> | ||||
|       <Generator>MSBuild:UpdateDesignTimeXaml</Generator> | ||||
|     </EmbeddedResource> | ||||
|     <EmbeddedResource Update="Views\PlayerCharacter\AbilityRacialBonusView.xaml"> | ||||
|       <Generator>MSBuild:UpdateDesignTimeXaml</Generator> | ||||
|     </EmbeddedResource> | ||||
|     <EmbeddedResource Update="Views\PlayerCharacter\BackgroundView.xaml"> | ||||
|       <Generator>MSBuild:UpdateDesignTimeXaml</Generator> | ||||
|     </EmbeddedResource> | ||||
|  |  | |||
|  | @ -4,6 +4,7 @@ | |||
|              xmlns:tools="clr-namespace:AideDeJeu.Tools" | ||||
|              xmlns:mdview="clr-namespace:Xam.Forms.Markdown" | ||||
|              xmlns:pickers="clr-namespace:AideDeJeu.Views.Pickers" | ||||
|              xmlns:pcviews="clr-namespace:AideDeJeu.Views.PlayerCharacter" | ||||
|              x:Class="AideDeJeu.Views.PlayerCharacter.AbilitiesView"> | ||||
|     <ContentView.Resources> | ||||
|         <ResourceDictionary> | ||||
|  | @ -33,26 +34,71 @@ | |||
|                     <ImageButton Source="trash_can.png" Command="{Binding RollDicesCommand}" /> | ||||
|                 </Frame> | ||||
|                 <Frame Grid.Row="1" Grid.ColumnSpan="3" BorderColor="Black" Padding="2" Margin="10"> | ||||
|                     <StackLayout> | ||||
|                         <Grid> | ||||
|                             <Grid.ColumnDefinitions> | ||||
|                                 <ColumnDefinition Width="100" /> | ||||
|                                 <ColumnDefinition Width="50" /> | ||||
|                                 <ColumnDefinition Width="50" /> | ||||
|                                 <ColumnDefinition Width="50" /> | ||||
|                                 <ColumnDefinition Width="50" /> | ||||
|                             </Grid.ColumnDefinitions> | ||||
|                             <Label Grid.Column="1" Text="Base" /> | ||||
|                             <Label Grid.Column="2" Text="Bonus" /> | ||||
|                             <Label Grid.Column="3" Text="Valeur" /> | ||||
|                             <Label Grid.Column="4" Text="Mod" /> | ||||
|                         </Grid> | ||||
|                         <pickers:AbilityPickerView  | ||||
|                     <!--<StackLayout>--> | ||||
|                     <Grid ColumnSpacing="10" RowSpacing="5"> | ||||
|                         <Grid.ColumnDefinitions> | ||||
|                             <ColumnDefinition Width="*" /> | ||||
|                             <ColumnDefinition Width="auto" /> | ||||
|                             <ColumnDefinition Width="auto" /> | ||||
|                             <ColumnDefinition Width="auto" /> | ||||
|                             <ColumnDefinition Width="auto" /> | ||||
|                         </Grid.ColumnDefinitions> | ||||
|                         <Grid.RowDefinitions> | ||||
|                             <RowDefinition Height="auto" /> | ||||
|                             <RowDefinition Height="auto" /> | ||||
|                             <RowDefinition Height="auto" /> | ||||
|                             <RowDefinition Height="auto" /> | ||||
|                             <RowDefinition Height="auto" /> | ||||
|                             <RowDefinition Height="auto" /> | ||||
|                             <RowDefinition Height="auto" /> | ||||
|                         </Grid.RowDefinitions> | ||||
|                         <Label Grid.Column="1" Text="Base" /> | ||||
|                         <Label Grid.Column="2" Text="Bonus" /> | ||||
|                         <Label Grid.Column="3" Text="Valeur" /> | ||||
|                         <Label Grid.Column="4" Text="Mod" /> | ||||
| 
 | ||||
|                         <Label Grid.Row="1" Grid.Column="0" Text="Force" /> | ||||
|                         <pcviews:AbilityBaseValueView Grid.Row="1" Grid.Column="1" BindingContext="{Binding}" Ability="{Binding SelectedPlayerCharacter.Abilities.Strength}" /> | ||||
|                         <pcviews:AbilityRacialBonusView Grid.Row="1" Grid.Column="2" BindingContext="{Binding}" Ability="{Binding SelectedPlayerCharacter.Abilities.Strength}" /> | ||||
|                         <Label Grid.Row="1" Grid.Column="3" Text="{Binding SelectedPlayerCharacter.Abilities.Strength.Value, FallbackValue=''}" /> | ||||
|                         <Label Grid.Row="1" Grid.Column="4" Text="{Binding SelectedPlayerCharacter.Abilities.Strength.Mod, StringFormat='{}{0:+0;-#}', FallbackValue=''}" /> | ||||
| 
 | ||||
|                         <Label Grid.Row="2" Grid.Column="0" Text="Dextérité" /> | ||||
|                         <pcviews:AbilityBaseValueView Grid.Row="2" Grid.Column="1" BindingContext="{Binding}" Ability="{Binding SelectedPlayerCharacter.Abilities.Dexterity}" /> | ||||
|                         <pcviews:AbilityRacialBonusView Grid.Row="2" Grid.Column="2" BindingContext="{Binding}" Ability="{Binding SelectedPlayerCharacter.Abilities.Dexterity}" /> | ||||
|                         <Label Grid.Row="2" Grid.Column="3" Text="{Binding SelectedPlayerCharacter.Abilities.Dexterity.Value, FallbackValue=''}" /> | ||||
|                         <Label Grid.Row="2" Grid.Column="4" Text="{Binding SelectedPlayerCharacter.Abilities.Dexterity.Mod, StringFormat='{}{0:+0;-#}', FallbackValue=''}" /> | ||||
| 
 | ||||
|                         <Label Grid.Row="3" Grid.Column="0" Text="Constitution" /> | ||||
|                         <pcviews:AbilityBaseValueView Grid.Row="3" Grid.Column="1" BindingContext="{Binding}" Ability="{Binding SelectedPlayerCharacter.Abilities.Constitution}" /> | ||||
|                         <pcviews:AbilityRacialBonusView Grid.Row="3" Grid.Column="2" BindingContext="{Binding}" Ability="{Binding SelectedPlayerCharacter.Abilities.Constitution}" /> | ||||
|                         <Label Grid.Row="3" Grid.Column="3" Text="{Binding SelectedPlayerCharacter.Abilities.Constitution.Value, FallbackValue=''}" /> | ||||
|                         <Label Grid.Row="3" Grid.Column="4" Text="{Binding SelectedPlayerCharacter.Abilities.Constitution.Mod, StringFormat='{}{0:+0;-#}', FallbackValue=''}" /> | ||||
| 
 | ||||
|                         <Label Grid.Row="4" Grid.Column="0" Text="Intelligence" /> | ||||
|                         <pcviews:AbilityBaseValueView Grid.Row="4" Grid.Column="1" BindingContext="{Binding}" Ability="{Binding SelectedPlayerCharacter.Abilities.Intelligence}" /> | ||||
|                         <pcviews:AbilityRacialBonusView Grid.Row="4" Grid.Column="2" BindingContext="{Binding}" Ability="{Binding SelectedPlayerCharacter.Abilities.Intelligence}" /> | ||||
|                         <Label Grid.Row="4" Grid.Column="3" Text="{Binding SelectedPlayerCharacter.Abilities.Intelligence.Value, FallbackValue=''}" /> | ||||
|                         <Label Grid.Row="4" Grid.Column="4" Text="{Binding SelectedPlayerCharacter.Abilities.Intelligence.Mod, StringFormat='{}{0:+0;-#}', FallbackValue=''}" /> | ||||
| 
 | ||||
|                         <Label Grid.Row="5" Grid.Column="0" Text="Sagesse" /> | ||||
|                         <pcviews:AbilityBaseValueView Grid.Row="5" Grid.Column="1" BindingContext="{Binding}" Ability="{Binding SelectedPlayerCharacter.Abilities.Wisdom}" /> | ||||
|                         <pcviews:AbilityRacialBonusView Grid.Row="5" Grid.Column="2" BindingContext="{Binding}" Ability="{Binding SelectedPlayerCharacter.Abilities.Wisdom}" /> | ||||
|                         <Label Grid.Row="5" Grid.Column="3" Text="{Binding SelectedPlayerCharacter.Abilities.Wisdom.Value, FallbackValue=''}" /> | ||||
|                         <Label Grid.Row="5" Grid.Column="4" Text="{Binding SelectedPlayerCharacter.Abilities.Wisdom.Mod, StringFormat='{}{0:+0;-#}', FallbackValue=''}" /> | ||||
| 
 | ||||
|                         <Label Grid.Row="6" Grid.Column="0" Text="Charisme" /> | ||||
|                         <pcviews:AbilityBaseValueView Grid.Row="6" Grid.Column="1" BindingContext="{Binding}" Ability="{Binding SelectedPlayerCharacter.Abilities.Charisma}" /> | ||||
|                         <pcviews:AbilityRacialBonusView Grid.Row="6" Grid.Column="2" BindingContext="{Binding}" Ability="{Binding SelectedPlayerCharacter.Abilities.Charisma}" /> | ||||
|                         <Label Grid.Row="6" Grid.Column="3" Text="{Binding SelectedPlayerCharacter.Abilities.Charisma.Value, FallbackValue=''}" /> | ||||
|                         <Label Grid.Row="6" Grid.Column="4" Text="{Binding SelectedPlayerCharacter.Abilities.Charisma.Mod, StringFormat='{}{0:+0;-#}', FallbackValue=''}" /> | ||||
|                     </Grid> | ||||
|                     <!--<pickers:AbilityPickerView  | ||||
|                             BindingContext="{Binding}"  | ||||
|                             Title="Force"  | ||||
|                             Ability="{Binding SelectedPlayerCharacter.Abilities.Strength}"  | ||||
|                             /> | ||||
|                         <pickers:AbilityPickerView  | ||||
|                             />--> | ||||
|                     <!--<pickers:AbilityPickerView  | ||||
|                             BindingContext="{Binding}"  | ||||
|                             Title="Dextérité"  | ||||
|                             Ability="{Binding SelectedPlayerCharacter.Abilities.Dexterity}"  | ||||
|  | @ -76,8 +122,8 @@ | |||
|                             BindingContext="{Binding}"  | ||||
|                             Title="Charisme"  | ||||
|                             Ability="{Binding SelectedPlayerCharacter.Abilities.Charisma}"  | ||||
|                             /> | ||||
|                     </StackLayout> | ||||
|                             />--> | ||||
|                     <!--</StackLayout>--> | ||||
|                 </Frame> | ||||
|             </Grid> | ||||
|         </ScrollView> | ||||
|  |  | |||
|  | @ -0,0 +1,30 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <ContentView xmlns="http://xamarin.com/schemas/2014/forms"  | ||||
|              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||||
|              x:Class="AideDeJeu.Views.PlayerCharacter.AbilityBaseValueView" | ||||
|              x:Name="this"> | ||||
|     <ContentView.Content> | ||||
|         <Picker SelectedItem="{Binding Ability.BaseValue, Source={x:Reference this}, Mode=TwoWay}"> | ||||
|             <Picker.ItemsSource> | ||||
|                 <x:Array Type="{x:Type x:Int32}"> | ||||
|                     <x:Int32>18</x:Int32> | ||||
|                     <x:Int32>17</x:Int32> | ||||
|                     <x:Int32>16</x:Int32> | ||||
|                     <x:Int32>15</x:Int32> | ||||
|                     <x:Int32>14</x:Int32> | ||||
|                     <x:Int32>13</x:Int32> | ||||
|                     <x:Int32>12</x:Int32> | ||||
|                     <x:Int32>11</x:Int32> | ||||
|                     <x:Int32>10</x:Int32> | ||||
|                     <x:Int32>9</x:Int32> | ||||
|                     <x:Int32>8</x:Int32> | ||||
|                     <x:Int32>7</x:Int32> | ||||
|                     <x:Int32>6</x:Int32> | ||||
|                     <x:Int32>5</x:Int32> | ||||
|                     <x:Int32>4</x:Int32> | ||||
|                     <x:Int32>3</x:Int32> | ||||
|                 </x:Array> | ||||
|             </Picker.ItemsSource> | ||||
|         </Picker> | ||||
|     </ContentView.Content> | ||||
| </ContentView> | ||||
|  | @ -0,0 +1,32 @@ | |||
| using AideDeJeu.ViewModels.PlayerCharacter; | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Text; | ||||
| using System.Threading.Tasks; | ||||
| 
 | ||||
| using Xamarin.Forms; | ||||
| using Xamarin.Forms.Xaml; | ||||
| 
 | ||||
| namespace AideDeJeu.Views.PlayerCharacter | ||||
| { | ||||
|     [XamlCompilation(XamlCompilationOptions.Compile)] | ||||
|     public partial class AbilityBaseValueView : ContentView | ||||
|     { | ||||
|         public AbilityBaseValueView() | ||||
|         { | ||||
|             InitializeComponent(); | ||||
|         } | ||||
| 
 | ||||
|         public AbilityViewModel Ability | ||||
|         { | ||||
|             get { return (AbilityViewModel)GetValue(AbilityProperty); } | ||||
|             set { SetValue(AbilityProperty, value); } | ||||
|         } | ||||
|         public static readonly BindableProperty AbilityProperty = BindableProperty.Create( | ||||
|             nameof(Ability), | ||||
|             typeof(AbilityViewModel), | ||||
|             typeof(AbilityBaseValueView), | ||||
|             defaultValue: default(AbilityViewModel)); | ||||
|     } | ||||
| } | ||||
|  | @ -0,0 +1,40 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <ContentView xmlns="http://xamarin.com/schemas/2014/forms"  | ||||
|              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||||
|              x:Class="AideDeJeu.Views.PlayerCharacter.AbilityRacialBonusView" | ||||
|              xmlns:tools="clr-namespace:AideDeJeu.Tools" | ||||
|              x:Name="this"> | ||||
|     <ContentView.Resources> | ||||
|         <ResourceDictionary> | ||||
|             <tools:MonsterMarkdownTheme x:Key="MonsterMarkdownTheme" /> | ||||
|             <tools:NullToFalseConverter x:Key="NullToFalseConverter" /> | ||||
|         </ResourceDictionary> | ||||
|     </ContentView.Resources> | ||||
|     <ContentView.Content> | ||||
|         <Grid> | ||||
|             <Label Text="{Binding Ability.RacialBonus, Source={x:Reference this}, StringFormat='{}{0:+0;-#}', FallbackValue=''}"> | ||||
|                 <Label.IsVisible> | ||||
|                     <Binding Source="{x:Reference this}" Path="Ability.RacialBonus"> | ||||
|                         <Binding.Converter> | ||||
|                             <tools:IntComparerToBooleanConverter  | ||||
|                                 GreaterThan="True" | ||||
|                                 Default="False" | ||||
|                                 /> | ||||
|                         </Binding.Converter> | ||||
|                         <Binding.ConverterParameter> | ||||
|                             <x:Int32>0</x:Int32> | ||||
|                         </Binding.ConverterParameter> | ||||
|                     </Binding> | ||||
|                 </Label.IsVisible> | ||||
|             </Label> | ||||
|             <Picker SelectedItem="{Binding Ability.RacialDispatchedBonus, Source={x:Reference this}, FallbackValue=''}" ItemDisplayBinding="{Binding StringFormat='{}{0:+0;-#}'}" IsVisible="{Binding Ability.HasRacialDispatchedBonus, Source={x:Reference this}}"> | ||||
|                 <Picker.ItemsSource> | ||||
|                     <x:Array Type="{x:Type x:Int32}"> | ||||
|                         <x:Int32>1</x:Int32> | ||||
|                         <x:Int32>0</x:Int32> | ||||
|                     </x:Array> | ||||
|                 </Picker.ItemsSource> | ||||
|             </Picker> | ||||
|         </Grid> | ||||
|     </ContentView.Content> | ||||
| </ContentView> | ||||
|  | @ -0,0 +1,32 @@ | |||
| using AideDeJeu.ViewModels.PlayerCharacter; | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Text; | ||||
| using System.Threading.Tasks; | ||||
| 
 | ||||
| using Xamarin.Forms; | ||||
| using Xamarin.Forms.Xaml; | ||||
| 
 | ||||
| namespace AideDeJeu.Views.PlayerCharacter | ||||
| { | ||||
|     [XamlCompilation(XamlCompilationOptions.Compile)] | ||||
|     public partial class AbilityRacialBonusView : ContentView | ||||
|     { | ||||
|         public AbilityRacialBonusView() | ||||
|         { | ||||
|             InitializeComponent(); | ||||
|         } | ||||
| 
 | ||||
|         public AbilityViewModel Ability | ||||
|         { | ||||
|             get { return (AbilityViewModel)GetValue(AbilityProperty); } | ||||
|             set { SetValue(AbilityProperty, value); } | ||||
|         } | ||||
|         public static readonly BindableProperty AbilityProperty = BindableProperty.Create( | ||||
|             nameof(Ability), | ||||
|             typeof(AbilityViewModel), | ||||
|             typeof(AbilityRacialBonusView), | ||||
|             defaultValue: default(AbilityViewModel)); | ||||
|     } | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yan Maniez
						Yan Maniez