diff --git a/TheGameExtreme/view/GamePreparationPage.xaml b/TheGameExtreme/view/GamePreparationPage.xaml
index f0737fb..716d432 100644
--- a/TheGameExtreme/view/GamePreparationPage.xaml
+++ b/TheGameExtreme/view/GamePreparationPage.xaml
@@ -7,155 +7,164 @@
xmlns:resources="clr-namespace:TheGameExtreme.Resx"
x:Class="TheGameExtreme.view.GamePreparationPage">
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Grid.Row="1"
+ Grid.Column="1">
+
+
+
-
-
-
-
-
-
-
+
-
-
+
+
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
diff --git a/TheGameExtreme/view/GamePreparationPage.xaml.cs.orig b/TheGameExtreme/view/GamePreparationPage.xaml.cs.orig
deleted file mode 100644
index f6c431a..0000000
--- a/TheGameExtreme/view/GamePreparationPage.xaml.cs.orig
+++ /dev/null
@@ -1,132 +0,0 @@
-using System;
-using System.Collections.Generic;
-using TheGameExtreme.IO;
-using TheGameExtreme.Resx;
-using Xamarin.Forms;
-
-namespace TheGameExtreme.view
-{
- public partial class GamePreparationPage : ContentPage
- {
- public List listNbPlayer = new List { 1, 2, 3, 4, 5 };
-<<<<<<< HEAD
- public List listGameMode = new List { "entières", "relatives", "dizaines", "centaines", "millièmes", "fractionnées" };
-=======
- public List listGameMode = new List { AppResources.TypeValueWhole, AppResources.TypeValueRelative, AppResources.TypeValueTens, AppResources.TypeValuehundredth, AppResources.TypeValuethousandth, AppResources.TypeValuefractionated };
->>>>>>> bluetoothtest
- public List listNbStack = new List { 4, 6, 8 };
- public List listNbCard = new List { 100, 80, 60, 40 };
-
-
- public GamePreparationPage()
- {
- InitializeComponent();
- NavigationPage.SetHasNavigationBar(this, false);
-
- PlayerSelecter.ItemsSource = listNbPlayer;
- LoadParameterNbPlayerGamePreparation();
-
- SelectMode.ItemsSource = listGameMode;
- LoadParameterGameModeValueGamePreparation();
-
- SelectNbStack.ItemsSource = listNbStack;
- LoadParameterNbStacksGamePreparation();
-
- SelectNbCard.ItemsSource = listNbCard;
- LoadParameterNbCardsGamePreparation();
-
-
-
- }
-
- private async void Back(object sender, EventArgs e)
- {
- IOGamePreparation.SaveParamaterGamePreparationNbPlayers(PlayerSelecter.SelectedIndex);
- IOGamePreparation.SaveParameterGamePreparationGameModeValue(SelectMode.SelectedIndex);
- IOGamePreparation.SaveParameterGamePreparationNbStacks(SelectNbStack.SelectedIndex);
- IOGamePreparation.SaveParameterGamePreparationNbCards(SelectNbCard.SelectedIndex);
- await Navigation.PopAsync();
- }
- protected override bool OnBackButtonPressed()
- {
- IOGamePreparation.SaveParamaterGamePreparationNbPlayers(PlayerSelecter.SelectedIndex);
- IOGamePreparation.SaveParameterGamePreparationGameModeValue(SelectMode.SelectedIndex);
- IOGamePreparation.SaveParameterGamePreparationNbStacks(SelectNbStack.SelectedIndex);
- IOGamePreparation.SaveParameterGamePreparationNbCards(SelectNbCard.SelectedIndex);
- return base.OnBackButtonPressed();
- }
-
- private async void Play(object sender, EventArgs args)
- {
- List playersNames = new List();
-
-
- for (int i = 1; i < NameList.Children.Count; i++)
- {
- playersNames.Add(((Entry)NameList.Children[i]).Text);
- if (string.IsNullOrWhiteSpace(playersNames[playersNames.Count - 1]))
- {
- await DisplayAlert("Erreur pseudo", AppResources.StrEnterPseudo, "OK");
- return;
- }
- }
- IOGamePreparation.SaveParamaterGamePreparationNbPlayers(PlayerSelecter.SelectedIndex);
- IOGamePreparation.SaveParameterGamePreparationGameModeValue(SelectMode.SelectedIndex);
- IOGamePreparation.SaveParameterGamePreparationNbStacks(SelectNbStack.SelectedIndex);
- IOGamePreparation.SaveParameterGamePreparationNbCards(SelectNbCard.SelectedIndex);
- await Navigation.PushAsync(new MainPage(playersNames, (int)SelectNbStack.SelectedItem, (int)SelectMode.SelectedIndex, (int)SelectNbCard.SelectedItem));
- }
-
- private void ChangedPseudo(object sender, EventArgs args)
- {
- while (NameList.Children.Count - 1 != (int)PlayerSelecter.SelectedItem)
- {
- if (NameList.Children.Count - 1 < (int)PlayerSelecter.SelectedItem)
- {
-
- Entry e = new Entry
- {
- Placeholder = "Pseudo",
- BackgroundColor = (Color)Application.Current.Resources["SkyBlueColor"],
- WidthRequest = 200,
- MinimumWidthRequest = 50,
- HorizontalOptions = LayoutOptions.Center,
- MaxLength = 18
- };
-
-
- NameList.Children.Add(e);
- }
- else
- {
- NameList.Children.RemoveAt(NameList.Children.Count - 1);
- }
- }
- }
- public void LoadParameterNbPlayerGamePreparation()
- {
- int nbJoueurs = IOGamePreparation.LoadParameterGamePreparationNbPlayers();
- PlayerSelecter.SelectedIndex = nbJoueurs;
- }
-
- public void LoadParameterGameModeValueGamePreparation()
- {
- int gameModeValue = IOGamePreparation.LoadParameterGamePreparationGameModeValue();
- SelectMode.SelectedIndex = gameModeValue;
- }
-
- public void LoadParameterNbStacksGamePreparation()
- {
- int nbStackSer = IOGamePreparation.LoadParamaterGamePreparationNbStacks();
- SelectNbStack.SelectedIndex = nbStackSer;
- }
- public void LoadParameterNbCardsGamePreparation()
- {
- int nbCards = IOGamePreparation.LoadParameterGamePreparationNbCards();
- SelectNbCard.SelectedIndex = nbCards;
- }
-
-
-
- }
-}
diff --git a/TheGameExtreme/view/GamePreparationPage.xaml.orig b/TheGameExtreme/view/GamePreparationPage.xaml.orig
deleted file mode 100644
index e37acdd..0000000
--- a/TheGameExtreme/view/GamePreparationPage.xaml.orig
+++ /dev/null
@@ -1,200 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<<<<<<< HEAD
-
-
-
- -->
-
- >>>>>> 0a2872694d54a6c5d0dc0475d2c05d9fc914ee7c
- Grid.Column="0"
- Grid.Row="1"
- Margin="10,0,0,0">
-
-
-
-
-
-
-
-=======
- WidthRequest="200"/>
-
->>>>>>> 0a2872694d54a6c5d0dc0475d2c05d9fc914ee7c
-
-
-
-
-
-
-
diff --git a/TheGameExtreme/view/MainPage.xaml.cs b/TheGameExtreme/view/MainPage.xaml.cs
index 75eca93..3147bbb 100644
--- a/TheGameExtreme/view/MainPage.xaml.cs
+++ b/TheGameExtreme/view/MainPage.xaml.cs
@@ -220,9 +220,9 @@ namespace TheGameExtreme.view
SKPoint position = new SKPoint((float)((DeviceDisplay.MainDisplayInfo.Width * 0.9) / (viewmodel.getListOrderedStacks().Count * 2)) + (float)(DeviceDisplay.MainDisplayInfo.Width * 0.01), (float)((DeviceDisplay.MainDisplayInfo.Height * 0.1) + (DeviceDisplay.MainDisplayInfo.Height * 0.9) * 0.01 + 2 * (0.05f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("001"))));
float inflateWidth;
- if (indexMode == 4)
+ if (indexMode == 4 || indexMode == 3)
{
- inflateWidth = 0.01f * (float)DeviceDisplay.MainDisplayInfo.Width;
+ inflateWidth = 0.02f * (float)DeviceDisplay.MainDisplayInfo.Width;
}
else
{
@@ -237,12 +237,23 @@ namespace TheGameExtreme.view
if (indexMode == 5)
{
textWidth = textPaint.MeasureText("00");
- textPaint.TextSize = 0.05f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textWidth;
+ textPaint.TextSize = 0.04f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("00");
}
else
{
+ if (indexMode == 3)
+ {
+ textPaint.TextSize = 0.035f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("00");
+ }
+ else if (indexMode == 4)
+ {
+ textPaint.TextSize = 0.025f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("00");
+ }
+ else
+ {
+ textPaint.TextSize = 0.04f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("00");
+ }
textWidth = textPaint.MeasureText(viewmodel.getListOrderedStacks()[i].Peek().Value.ToString());
- textPaint.TextSize = 0.05f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textWidth;
}
position.X -= textWidth * 0.5f;
@@ -267,7 +278,7 @@ namespace TheGameExtreme.view
SKPoint position = new SKPoint((float)((DeviceDisplay.MainDisplayInfo.Width * 0.9) / (viewmodel.CurrentHand.Count * 2)) + (float)(DeviceDisplay.MainDisplayInfo.Width * 0.01), (float)((DeviceDisplay.MainDisplayInfo.Height * 0.9) - (DeviceDisplay.MainDisplayInfo.Height * 0.9) * 0.1 - 2 * (0.05f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("001"))));
float inflateWidth;
- if (indexMode == 4)
+ if (indexMode == 4 || indexMode == 3)
{
inflateWidth = 0.01f * (float)DeviceDisplay.MainDisplayInfo.Width;
}
@@ -284,12 +295,23 @@ namespace TheGameExtreme.view
if (indexMode == 5)
{
textWidth = textPaint.MeasureText("00");
- textPaint.TextSize = 0.05f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textWidth;
+ textPaint.TextSize = 0.048f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("00");
}
else
{
+ if (indexMode == 3)
+ {
+ textPaint.TextSize = 0.038f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("00");
+ }
+ else if (indexMode == 4)
+ {
+ textPaint.TextSize = 0.028f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("00");
+ }
+ else
+ {
+ textPaint.TextSize = 0.048f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("00");
+ }
textWidth = textPaint.MeasureText(viewmodel.CurrentHand[i].Value.ToString());
- textPaint.TextSize = 0.05f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textWidth;
}
position.X -= textWidth * 0.5f;
diff --git a/TheGameExtreme/view/TouchManipulationCard.cs b/TheGameExtreme/view/TouchManipulationCard.cs
index d517613..8c0b5ad 100644
--- a/TheGameExtreme/view/TouchManipulationCard.cs
+++ b/TheGameExtreme/view/TouchManipulationCard.cs
@@ -85,11 +85,13 @@ namespace TheGameExtreme.view
textPaint.StrokeWidth = 5;
textPaint.Style = SKPaintStyle.Stroke;
- SKRect card = new SKRect();
+ //SKRect card = new SKRect(0, 0, 100, 100);
+
+ SKRect card;
if (Value.View.GetType() == typeof(FractionCard))
{
- textPaint.MeasureText("00", ref card);
+ card = new SKRect(-width, -height - textPaint.TextSize, width + textPaint.MeasureText("00"), height);
textPaint1.Color = color;
textPaint1.StrokeWidth = 5;
textPaint1.Style = SKPaintStyle.Stroke;
@@ -99,9 +101,8 @@ namespace TheGameExtreme.view
}
else
{
- textPaint.MeasureText(display, ref card);
+ card = new SKRect(-width, -height - textPaint.TextSize, width + textPaint.MeasureText(display), height);
}
- card.Inflate(width, height);
if (Value.View.GetType() == typeof(FractionCard))
{
@@ -114,7 +115,7 @@ namespace TheGameExtreme.view
{
canvas.DrawText(((FractionCard)Value.View).Fraction.Numerateur.ToString(), 0, -50, textPaint);
}
- canvas.DrawText("__", 0, -textPaint.TextSize * 0.4f, textPaint1);
+ canvas.DrawText("__", textPaint.MeasureText("__") * 0.1f, -textPaint.TextSize * 0.4f, textPaint1);
if (((FractionCard)Value.View).Fraction.Denominateur < 10 && ((FractionCard)Value.View).Fraction.Denominateur > 0)
{
canvas.DrawText(((FractionCard)Value.View).Fraction.Denominateur.ToString(), textPaint.MeasureText(((FractionCard)Value.View).Fraction.Denominateur.ToString()) * 0.5f, 50, textPaint2);