mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-12-16 23:29:47 +00:00
Merge branch 'master' of https://github.com/Nioux/AideDeJeu
This commit is contained in:
commit
97ae49ed5c
880 changed files with 150112 additions and 8110 deletions
|
|
@ -81,13 +81,13 @@
|
|||
<Version>1.6.258-beta</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="SQLitePCLRaw.bundle_green">
|
||||
<Version>1.1.13</Version>
|
||||
<Version>1.1.14</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="SQLitePCLRaw.core">
|
||||
<Version>1.1.13</Version>
|
||||
<Version>1.1.14</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="SQLitePCLRaw.lib.e_sqlite3.linux">
|
||||
<Version>1.1.13</Version>
|
||||
<Version>1.1.14</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="System.Buffers">
|
||||
<Version>4.5.0</Version>
|
||||
|
|
@ -96,10 +96,10 @@
|
|||
<Version>1.1.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xamarin.Forms">
|
||||
<Version>4.0.0.425677</Version>
|
||||
<Version>4.0.0.497661</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xamarin.Forms.Visual.Material">
|
||||
<Version>4.0.0.425677</Version>
|
||||
<Version>4.0.0.497661</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="XamiTextSharpLGPLv2">
|
||||
<Version>1.0.0</Version>
|
||||
|
|
@ -432,8 +432,21 @@
|
|||
<AndroidAsset Include="Assets\pdfjs\web\locale\zh-CN\viewer.properties" />
|
||||
<AndroidAsset Include="Assets\pdfjs\web\locale\zh-TW\viewer.properties" />
|
||||
<AndroidAsset Include="Assets\pdfjs\web\locale\zu\viewer.properties" />
|
||||
<AndroidAsset Include="Assets\MarcellusSC-Regular.ttf" />
|
||||
<AndroidAsset Include="Assets\Cinzel-Black.otf" />
|
||||
<AndroidAsset Include="Assets\Cinzel-Bold.otf" />
|
||||
<AndroidAsset Include="Assets\CinzelDecorative-Black.otf" />
|
||||
<AndroidAsset Include="Assets\CinzelDecorative-Bold.otf" />
|
||||
<AndroidAsset Include="Assets\CinzelDecorative-Regular.otf" />
|
||||
<AndroidAsset Include="Assets\Cinzel-Regular.otf" />
|
||||
<None Include="Resources\AboutResources.txt" />
|
||||
<None Include="Assets\AboutAssets.txt" />
|
||||
<AndroidResource Include="Resources\font\cinzel_black.otf" />
|
||||
<AndroidResource Include="Resources\font\cinzel_bold.otf" />
|
||||
<AndroidResource Include="Resources\font\cinzel_regular.otf" />
|
||||
<AndroidResource Include="Resources\font\cinzeldecorative_black.otf" />
|
||||
<AndroidResource Include="Resources\font\cinzeldecorative_bold.otf" />
|
||||
<AndroidResource Include="Resources\font\cinzeldecorative_regular.otf" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\icon.png" />
|
||||
|
|
|
|||
BIN
AideDeJeu/AideDeJeu.Android/Assets/Cinzel-Black.otf
Normal file
BIN
AideDeJeu/AideDeJeu.Android/Assets/Cinzel-Black.otf
Normal file
Binary file not shown.
BIN
AideDeJeu/AideDeJeu.Android/Assets/Cinzel-Bold.otf
Normal file
BIN
AideDeJeu/AideDeJeu.Android/Assets/Cinzel-Bold.otf
Normal file
Binary file not shown.
BIN
AideDeJeu/AideDeJeu.Android/Assets/Cinzel-Regular.otf
Normal file
BIN
AideDeJeu/AideDeJeu.Android/Assets/Cinzel-Regular.otf
Normal file
Binary file not shown.
BIN
AideDeJeu/AideDeJeu.Android/Assets/CinzelDecorative-Black.otf
Normal file
BIN
AideDeJeu/AideDeJeu.Android/Assets/CinzelDecorative-Black.otf
Normal file
Binary file not shown.
BIN
AideDeJeu/AideDeJeu.Android/Assets/CinzelDecorative-Bold.otf
Normal file
BIN
AideDeJeu/AideDeJeu.Android/Assets/CinzelDecorative-Bold.otf
Normal file
Binary file not shown.
BIN
AideDeJeu/AideDeJeu.Android/Assets/CinzelDecorative-Regular.otf
Normal file
BIN
AideDeJeu/AideDeJeu.Android/Assets/CinzelDecorative-Regular.otf
Normal file
Binary file not shown.
BIN
AideDeJeu/AideDeJeu.Android/Assets/MarcellusSC-Regular.ttf
Normal file
BIN
AideDeJeu/AideDeJeu.Android/Assets/MarcellusSC-Regular.ttf
Normal file
Binary file not shown.
|
|
@ -6,6 +6,8 @@ using Android.Runtime;
|
|||
using Android.Views;
|
||||
using Android.Widget;
|
||||
using Android.OS;
|
||||
using System.Threading.Tasks;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace AideDeJeu.Droid
|
||||
{
|
||||
|
|
@ -19,6 +21,10 @@ namespace AideDeJeu.Droid
|
|||
ToolbarResource = Resource.Layout.Toolbar;
|
||||
|
||||
base.OnCreate(bundle);
|
||||
|
||||
AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
|
||||
TaskScheduler.UnobservedTaskException += TaskSchedulerOnUnobservedTaskException;
|
||||
|
||||
Xamarin.Essentials.Platform.Init(this, bundle);
|
||||
Xamarin.Essentials.ExperimentalFeatures.Enable(Xamarin.Essentials.ExperimentalFeatures.ShareFileRequest);
|
||||
|
||||
|
|
@ -30,6 +36,8 @@ namespace AideDeJeu.Droid
|
|||
//global::Xamarin.Forms.FormsMaterial.Init(this, bundle);
|
||||
SQLitePCL.raw.SetProvider(new SQLitePCL.SQLite3Provider_e_sqlite3());
|
||||
|
||||
DisplayCrashReport();
|
||||
|
||||
LoadApplication(new App());
|
||||
}
|
||||
|
||||
|
|
@ -52,6 +60,71 @@ namespace AideDeJeu.Droid
|
|||
|
||||
base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
|
||||
|
||||
private static void TaskSchedulerOnUnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs unobservedTaskExceptionEventArgs)
|
||||
{
|
||||
var newExc = new Exception("TaskSchedulerOnUnobservedTaskException", unobservedTaskExceptionEventArgs.Exception);
|
||||
LogUnhandledException(newExc);
|
||||
}
|
||||
|
||||
private static void CurrentDomainOnUnhandledException(object sender, UnhandledExceptionEventArgs unhandledExceptionEventArgs)
|
||||
{
|
||||
var newExc = new Exception("CurrentDomainOnUnhandledException", unhandledExceptionEventArgs.ExceptionObject as Exception);
|
||||
LogUnhandledException(newExc);
|
||||
}
|
||||
|
||||
internal static void LogUnhandledException(Exception exception)
|
||||
{
|
||||
try
|
||||
{
|
||||
const string errorFileName = "Fatal.log";
|
||||
var libraryPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal); // iOS: Environment.SpecialFolder.Resources
|
||||
var errorFilePath = System.IO.Path.Combine(libraryPath, errorFileName);
|
||||
var errorMessage = String.Format("Time: {0}\r\nError: Unhandled Exception\r\n{1}",
|
||||
DateTime.Now, exception.ToString());
|
||||
System.IO.File.WriteAllText(errorFilePath, errorMessage);
|
||||
|
||||
// Log to Android Device Logging.
|
||||
Android.Util.Log.Error("Crash Report", errorMessage);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// just suppress any error logging exceptions
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
// If there is an unhandled exception, the exception information is diplayed
|
||||
// on screen the next time the app is started (only in debug configuration)
|
||||
/// </summary>
|
||||
[Conditional("DEBUG")]
|
||||
private void DisplayCrashReport()
|
||||
{
|
||||
const string errorFilename = "Fatal.log";
|
||||
var libraryPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
|
||||
var errorFilePath = System.IO.Path.Combine(libraryPath, errorFilename);
|
||||
|
||||
if (!System.IO.File.Exists(errorFilePath))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var errorText = System.IO.File.ReadAllText(errorFilePath);
|
||||
new AlertDialog.Builder(this)
|
||||
.SetPositiveButton("Clear", (sender, args) =>
|
||||
{
|
||||
System.IO.File.Delete(errorFilePath);
|
||||
})
|
||||
.SetNegativeButton("Close", (sender, args) =>
|
||||
{
|
||||
// User pressed Close.
|
||||
})
|
||||
.SetMessage(errorText)
|
||||
.SetTitle("Crash Report")
|
||||
.Show();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
5533
AideDeJeu/AideDeJeu.Android/Resources/Resource.designer.cs
generated
5533
AideDeJeu/AideDeJeu.Android/Resources/Resource.designer.cs
generated
File diff suppressed because it is too large
Load diff
BIN
AideDeJeu/AideDeJeu.Android/Resources/font/cinzel_black.otf
Normal file
BIN
AideDeJeu/AideDeJeu.Android/Resources/font/cinzel_black.otf
Normal file
Binary file not shown.
BIN
AideDeJeu/AideDeJeu.Android/Resources/font/cinzel_bold.otf
Normal file
BIN
AideDeJeu/AideDeJeu.Android/Resources/font/cinzel_bold.otf
Normal file
Binary file not shown.
BIN
AideDeJeu/AideDeJeu.Android/Resources/font/cinzel_regular.otf
Normal file
BIN
AideDeJeu/AideDeJeu.Android/Resources/font/cinzel_regular.otf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -8,4 +8,5 @@
|
|||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:tabIndicatorColor="@color/HDRed"
|
||||
app:tabGravity="fill"
|
||||
app:tabMode="scrollable" />
|
||||
app:tabMode="scrollable"
|
||||
app:tabTextAppearance="@style/TabBar.TitleText"/>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
<android.support.v7.widget.Toolbar
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
android:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
|
||||
android:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||
app:titleTextAppearance="@style/Toolbar.TitleText"
|
||||
/>
|
||||
|
||||
|
|
|
|||
|
|
@ -42,4 +42,14 @@
|
|||
<style name="MyTheme.Splash" parent="MainTheme">
|
||||
<item name="android:windowBackground">@drawable/splash</item>
|
||||
</style>
|
||||
|
||||
<style name="Toolbar.TitleText" parent="TextAppearance.Widget.AppCompat.Toolbar.Title">
|
||||
<!--set your custom font properties-->
|
||||
<item name="android:fontFamily">@font/cinzel_bold</item>
|
||||
</style>
|
||||
|
||||
<style name="TabBar.TitleText" parent="TextAppearance.Design.Tab">
|
||||
<!--set your custom font properties-->
|
||||
<item name="android:fontFamily">@font/cinzel_bold</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\packages\Xamarin.Forms.4.0.0.425677\build\Xamarin.Forms.props" Condition="Exists('..\..\packages\Xamarin.Forms.4.0.0.425677\build\Xamarin.Forms.props')" />
|
||||
<Import Project="..\..\packages\Xamarin.Forms.4.0.0.497661\build\Xamarin.Forms.props" Condition="Exists('..\..\packages\Xamarin.Forms.4.0.0.497661\build\Xamarin.Forms.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
|
@ -150,17 +150,17 @@
|
|||
<Reference Include="SQLite-net, Version=1.6.258.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\sqlite-net-pcl.1.6.258-beta\lib\netstandard1.1\SQLite-net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SQLitePCLRaw.batteries_green, Version=1.1.13.388, Culture=neutral, PublicKeyToken=a84b7dcfb1391f7f, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SQLitePCLRaw.bundle_green.1.1.13\lib\net45\SQLitePCLRaw.batteries_green.dll</HintPath>
|
||||
<Reference Include="SQLitePCLRaw.batteries_green, Version=1.1.14.520, Culture=neutral, PublicKeyToken=a84b7dcfb1391f7f, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SQLitePCLRaw.bundle_green.1.1.14\lib\net45\SQLitePCLRaw.batteries_green.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SQLitePCLRaw.batteries_v2, Version=1.1.13.388, Culture=neutral, PublicKeyToken=8226ea5df37bcae9, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SQLitePCLRaw.bundle_green.1.1.13\lib\net45\SQLitePCLRaw.batteries_v2.dll</HintPath>
|
||||
<Reference Include="SQLitePCLRaw.batteries_v2, Version=1.1.14.520, Culture=neutral, PublicKeyToken=8226ea5df37bcae9, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SQLitePCLRaw.bundle_green.1.1.14\lib\net45\SQLitePCLRaw.batteries_v2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SQLitePCLRaw.core, Version=1.1.13.388, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SQLitePCLRaw.core.1.1.13\lib\net45\SQLitePCLRaw.core.dll</HintPath>
|
||||
<Reference Include="SQLitePCLRaw.core, Version=1.1.14.520, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SQLitePCLRaw.core.1.1.14\lib\net45\SQLitePCLRaw.core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SQLitePCLRaw.provider.e_sqlite3, Version=1.1.13.388, Culture=neutral, PublicKeyToken=9c301db686d0bd12, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SQLitePCLRaw.provider.e_sqlite3.net45.1.1.13\lib\net45\SQLitePCLRaw.provider.e_sqlite3.dll</HintPath>
|
||||
<Reference Include="SQLitePCLRaw.provider.e_sqlite3, Version=1.1.14.520, Culture=neutral, PublicKeyToken=9c301db686d0bd12, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SQLitePCLRaw.provider.e_sqlite3.net45.1.1.14\lib\net45\SQLitePCLRaw.provider.e_sqlite3.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
|
|
@ -206,28 +206,28 @@
|
|||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="webkit-sharp, Version=1.1.15.0, Culture=neutral, PublicKeyToken=eaa1d335d2e19745, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.Platform.GTK.4.0.0.425677\lib\net45\webkit-sharp.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xamarin.Forms.Platform.GTK.4.0.0.497661\lib\net45\webkit-sharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Essentials, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xamarin.Essentials.1.1.0\lib\netstandard2.0\Xamarin.Essentials.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.4.0.0.425677\lib\netstandard2.0\Xamarin.Forms.Core.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xamarin.Forms.4.0.0.497661\lib\netstandard2.0\Xamarin.Forms.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.4.0.0.425677\lib\netstandard2.0\Xamarin.Forms.Platform.dll</HintPath>
|
||||
<Reference Include="Xamarin.Forms.Platform, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.4.0.0.497661\lib\netstandard2.0\Xamarin.Forms.Platform.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Platform.GTK, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.Platform.GTK.4.0.0.425677\lib\net45\Xamarin.Forms.Platform.GTK.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xamarin.Forms.Platform.GTK.4.0.0.497661\lib\net45\Xamarin.Forms.Platform.GTK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.4.0.0.425677\lib\netstandard2.0\Xamarin.Forms.Xaml.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xamarin.Forms.4.0.0.497661\lib\netstandard2.0\Xamarin.Forms.Xaml.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="XamiTextSharpLGPLv2, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\XamiTextSharpLGPLv2.1.0.0\lib\netstandard2.0\XamiTextSharpLGPLv2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="YamlDotNet, Version=6.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\YamlDotNet.6.0.0\lib\net45\YamlDotNet.dll</HintPath>
|
||||
<HintPath>..\..\packages\YamlDotNet.6.1.1\lib\net45\YamlDotNet.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
|
@ -303,16 +303,16 @@
|
|||
<PropertyGroup>
|
||||
<ErrorText>Ce projet fait référence à des packages NuGet qui sont manquants sur cet ordinateur. Utilisez l'option de restauration des packages NuGet pour les télécharger. Pour plus d'informations, consultez http://go.microsoft.com/fwlink/?LinkID=322105. Le fichier manquant est : {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.13\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.13\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.13\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.13\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.13\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.13\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\SkiaSharp.1.68.0\build\net45\SkiaSharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\SkiaSharp.1.68.0\build\net45\SkiaSharp.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.4.0.0.425677\build\Xamarin.Forms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.4.0.0.425677\build\Xamarin.Forms.props'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.4.0.0.425677\build\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.4.0.0.425677\build\Xamarin.Forms.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.4.0.0.497661\build\Xamarin.Forms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.4.0.0.497661\build\Xamarin.Forms.props'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.4.0.0.497661\build\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.4.0.0.497661\build\Xamarin.Forms.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\..\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.13\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets" Condition="Exists('..\..\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.13\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets')" />
|
||||
<Import Project="..\..\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.13\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets" Condition="Exists('..\..\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.13\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets')" />
|
||||
<Import Project="..\..\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.13\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets" Condition="Exists('..\..\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.13\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets')" />
|
||||
<Import Project="..\..\packages\SkiaSharp.1.68.0\build\net45\SkiaSharp.targets" Condition="Exists('..\..\packages\SkiaSharp.1.68.0\build\net45\SkiaSharp.targets')" />
|
||||
<Import Project="..\..\packages\Xamarin.Forms.4.0.0.425677\build\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.4.0.0.425677\build\Xamarin.Forms.targets')" />
|
||||
<Import Project="..\..\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets" Condition="Exists('..\..\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets')" />
|
||||
<Import Project="..\..\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets" Condition="Exists('..\..\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets')" />
|
||||
<Import Project="..\..\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets" Condition="Exists('..\..\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets')" />
|
||||
<Import Project="..\..\packages\Xamarin.Forms.4.0.0.497661\build\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.4.0.0.497661\build\Xamarin.Forms.targets')" />
|
||||
</Project>
|
||||
|
|
@ -44,11 +44,11 @@
|
|||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="SQLitePCLRaw.core" publicKeyToken="1488e028ca7ab535" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.1.13.388" newVersion="1.1.13.388" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.1.14.520" newVersion="1.1.14.520" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="SQLitePCLRaw.batteries_v2" publicKeyToken="8226ea5df37bcae9" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.1.13.388" newVersion="1.1.13.388" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.1.14.520" newVersion="1.1.14.520" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.EntityFrameworkCore" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||
|
|
|
|||
|
|
@ -27,12 +27,12 @@
|
|||
<package id="SkiaSharp" version="1.68.0" targetFramework="net471" />
|
||||
<package id="SkiaSharp.Views" version="1.68.0" targetFramework="net471" />
|
||||
<package id="sqlite-net-pcl" version="1.6.258-beta" targetFramework="net471" />
|
||||
<package id="SQLitePCLRaw.bundle_green" version="1.1.13" targetFramework="net471" />
|
||||
<package id="SQLitePCLRaw.core" version="1.1.13" targetFramework="net471" />
|
||||
<package id="SQLitePCLRaw.lib.e_sqlite3.linux" version="1.1.13" targetFramework="net471" />
|
||||
<package id="SQLitePCLRaw.lib.e_sqlite3.osx" version="1.1.13" targetFramework="net471" />
|
||||
<package id="SQLitePCLRaw.lib.e_sqlite3.v110_xp" version="1.1.13" targetFramework="net471" />
|
||||
<package id="SQLitePCLRaw.provider.e_sqlite3.net45" version="1.1.13" targetFramework="net471" />
|
||||
<package id="SQLitePCLRaw.bundle_green" version="1.1.14" targetFramework="net471" />
|
||||
<package id="SQLitePCLRaw.core" version="1.1.14" targetFramework="net471" />
|
||||
<package id="SQLitePCLRaw.lib.e_sqlite3.linux" version="1.1.14" targetFramework="net471" />
|
||||
<package id="SQLitePCLRaw.lib.e_sqlite3.osx" version="1.1.14" targetFramework="net471" />
|
||||
<package id="SQLitePCLRaw.lib.e_sqlite3.v110_xp" version="1.1.14" targetFramework="net471" />
|
||||
<package id="SQLitePCLRaw.provider.e_sqlite3.net45" version="1.1.14" targetFramework="net471" />
|
||||
<package id="System.Buffers" version="4.5.0" targetFramework="net471" />
|
||||
<package id="System.Collections.Immutable" version="1.5.0" targetFramework="net471" />
|
||||
<package id="System.ComponentModel.Annotations" version="4.5.0" targetFramework="net471" />
|
||||
|
|
@ -44,9 +44,9 @@
|
|||
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net471" />
|
||||
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net471" />
|
||||
<package id="Xamarin.Essentials" version="1.1.0" targetFramework="net471" />
|
||||
<package id="Xamarin.Forms" version="4.0.0.425677" targetFramework="net471" />
|
||||
<package id="Xamarin.Forms.Platform.GTK" version="4.0.0.425677" targetFramework="net471" />
|
||||
<package id="Xamarin.Forms.Visual.Material" version="4.0.0.425677" targetFramework="net471" />
|
||||
<package id="Xamarin.Forms" version="4.0.0.497661" targetFramework="net471" />
|
||||
<package id="Xamarin.Forms.Platform.GTK" version="4.0.0.497661" targetFramework="net471" />
|
||||
<package id="Xamarin.Forms.Visual.Material" version="4.0.0.497661" targetFramework="net471" />
|
||||
<package id="XamiTextSharpLGPLv2" version="1.0.0" targetFramework="net471" />
|
||||
<package id="YamlDotNet" version="6.0.0" targetFramework="net471" />
|
||||
<package id="YamlDotNet" version="6.1.1" targetFramework="net471" />
|
||||
</packages>
|
||||
|
|
@ -309,6 +309,13 @@
|
|||
<Content Include="Assets\pdfjs\web\cmaps\V.bcmap" />
|
||||
<Content Include="Assets\pdfjs\web\cmaps\WP-Symbol.bcmap" />
|
||||
<Content Include="Assets\pdfjs\web\compressed.tracemonkey-pldi-09.pdf" />
|
||||
<Content Include="Assets\Fonts\Cinzel-Black.otf" />
|
||||
<Content Include="Assets\Fonts\Cinzel-Bold.otf" />
|
||||
<Content Include="Assets\Fonts\CinzelDecorative-Black.otf" />
|
||||
<Content Include="Assets\Fonts\CinzelDecorative-Bold.otf" />
|
||||
<Content Include="Assets\Fonts\CinzelDecorative-Regular.otf" />
|
||||
<Content Include="Assets\Fonts\Cinzel-Regular.otf" />
|
||||
<Content Include="Assets\Fonts\MarcellusSC-Regular.ttf" />
|
||||
<None Include="Assets\pdfjs\web\locale\ach\viewer.properties" />
|
||||
<None Include="Assets\pdfjs\web\locale\af\viewer.properties" />
|
||||
<None Include="Assets\pdfjs\web\locale\ak\viewer.properties" />
|
||||
|
|
@ -632,10 +639,10 @@
|
|||
<Version>1.1.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xamarin.Forms">
|
||||
<Version>4.0.0.425677</Version>
|
||||
<Version>4.0.0.497661</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xamarin.Forms.Visual.Material">
|
||||
<Version>4.0.0.425677</Version>
|
||||
<Version>4.0.0.497661</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="XamiTextSharpLGPLv2">
|
||||
<Version>1.0.0</Version>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using System.Text;
|
||||
using Windows.ApplicationModel;
|
||||
using Windows.ApplicationModel.Activation;
|
||||
using Windows.Foundation;
|
||||
|
|
@ -61,6 +62,7 @@ namespace AideDeJeu.UWP
|
|||
|
||||
Xamarin.Forms.Forms.Init(e, Rg.Plugins.Popup.Popup.GetExtraAssemblies());
|
||||
SQLitePCL.raw.SetProvider(new SQLitePCL.SQLite3Provider_e_sqlite3());
|
||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||
|
||||
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
|
||||
{
|
||||
|
|
|
|||
BIN
AideDeJeu/AideDeJeu.UWP/Assets/Fonts/Cinzel-Black.otf
Normal file
BIN
AideDeJeu/AideDeJeu.UWP/Assets/Fonts/Cinzel-Black.otf
Normal file
Binary file not shown.
BIN
AideDeJeu/AideDeJeu.UWP/Assets/Fonts/Cinzel-Bold.otf
Normal file
BIN
AideDeJeu/AideDeJeu.UWP/Assets/Fonts/Cinzel-Bold.otf
Normal file
Binary file not shown.
BIN
AideDeJeu/AideDeJeu.UWP/Assets/Fonts/Cinzel-Regular.otf
Normal file
BIN
AideDeJeu/AideDeJeu.UWP/Assets/Fonts/Cinzel-Regular.otf
Normal file
Binary file not shown.
BIN
AideDeJeu/AideDeJeu.UWP/Assets/Fonts/CinzelDecorative-Black.otf
Normal file
BIN
AideDeJeu/AideDeJeu.UWP/Assets/Fonts/CinzelDecorative-Black.otf
Normal file
Binary file not shown.
BIN
AideDeJeu/AideDeJeu.UWP/Assets/Fonts/CinzelDecorative-Bold.otf
Normal file
BIN
AideDeJeu/AideDeJeu.UWP/Assets/Fonts/CinzelDecorative-Bold.otf
Normal file
Binary file not shown.
Binary file not shown.
BIN
AideDeJeu/AideDeJeu.UWP/Assets/Fonts/MarcellusSC-Regular.ttf
Normal file
BIN
AideDeJeu/AideDeJeu.UWP/Assets/Fonts/MarcellusSC-Regular.ttf
Normal file
Binary file not shown.
|
|
@ -450,10 +450,10 @@
|
|||
<Version>1.1.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xamarin.Forms">
|
||||
<Version>4.0.0.425677</Version>
|
||||
<Version>4.0.0.497661</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xamarin.Forms.Visual.Material">
|
||||
<Version>4.0.0.425677</Version>
|
||||
<Version>4.0.0.497661</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="XamiTextSharpLGPLv2">
|
||||
<Version>1.0.0</Version>
|
||||
|
|
|
|||
|
|
@ -23,6 +23,12 @@
|
|||
<None Remove="Pdf\178_hd_01_feuille_de_perso_v1.pdf" />
|
||||
<None Remove="Pdf\AlverataIrregularPEMedium.ttf" />
|
||||
<None Remove="Pdf\BLKCHCRY.TTF" />
|
||||
<None Remove="Pdf\Cinzel-Black.otf" />
|
||||
<None Remove="Pdf\Cinzel-Bold.otf" />
|
||||
<None Remove="Pdf\Cinzel-Regular.otf" />
|
||||
<None Remove="Pdf\CinzelDecorative-Black.otf" />
|
||||
<None Remove="Pdf\CinzelDecorative-Bold.otf" />
|
||||
<None Remove="Pdf\CinzelDecorative-Regular.otf" />
|
||||
<None Remove="Pdf\feuille_de_personnage_editable.pdf" />
|
||||
<None Remove="Pdf\LinLibertine_aBL.ttf" />
|
||||
<None Remove="Pdf\LinLibertine_aBS.ttf" />
|
||||
|
|
@ -40,7 +46,9 @@
|
|||
<None Remove="Pdf\LinLibertine_RI.ttf" />
|
||||
<None Remove="Pdf\LinLibertine_RZ.ttf" />
|
||||
<None Remove="Pdf\LinLibertine_RZI.ttf" />
|
||||
<None Remove="Pdf\MarcellusSC-Regular.ttf" />
|
||||
<None Remove="Pdf\MinionPro_It.ttf" />
|
||||
<None Remove="Pdf\poker_size.pdf" />
|
||||
<None Remove="test.svg" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
@ -49,6 +57,12 @@
|
|||
<EmbeddedResource Include="Pdf\178_hd_01_feuille_de_perso_v1.pdf" />
|
||||
<EmbeddedResource Include="Pdf\AlverataIrregularPEMedium.ttf" />
|
||||
<EmbeddedResource Include="Pdf\BLKCHCRY.TTF" />
|
||||
<EmbeddedResource Include="Pdf\Cinzel-Black.otf" />
|
||||
<EmbeddedResource Include="Pdf\Cinzel-Bold.otf" />
|
||||
<EmbeddedResource Include="Pdf\Cinzel-Regular.otf" />
|
||||
<EmbeddedResource Include="Pdf\CinzelDecorative-Black.otf" />
|
||||
<EmbeddedResource Include="Pdf\CinzelDecorative-Bold.otf" />
|
||||
<EmbeddedResource Include="Pdf\CinzelDecorative-Regular.otf" />
|
||||
<EmbeddedResource Include="Pdf\feuille_de_personnage_editable.pdf" />
|
||||
<EmbeddedResource Include="Pdf\LinLibertine_aBL.ttf" />
|
||||
<EmbeddedResource Include="Pdf\LinLibertine_aBS.ttf" />
|
||||
|
|
@ -66,7 +80,9 @@
|
|||
<EmbeddedResource Include="Pdf\LinLibertine_RI.ttf" />
|
||||
<EmbeddedResource Include="Pdf\LinLibertine_RZ.ttf" />
|
||||
<EmbeddedResource Include="Pdf\LinLibertine_RZI.ttf" />
|
||||
<EmbeddedResource Include="Pdf\MarcellusSC-Regular.ttf" />
|
||||
<EmbeddedResource Include="Pdf\MinionPro_It.ttf" />
|
||||
<EmbeddedResource Include="Pdf\poker_size.pdf" />
|
||||
<EmbeddedResource Include="test.svg" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
@ -80,10 +96,10 @@
|
|||
<PackageReference Include="SkiaSharp.Views.Forms" Version="1.68.0" />
|
||||
<PackageReference Include="sqlite-net-pcl" Version="1.6.258-beta" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.1.0" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.0.0.425677" />
|
||||
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.0.0.425677" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.0.0.497661" />
|
||||
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.0.0.497661" />
|
||||
<PackageReference Include="XamiTextSharpLGPLv2" Version="1.0.0" />
|
||||
<PackageReference Include="YamlDotNet" Version="6.0.0" />
|
||||
<PackageReference Include="YamlDotNet" Version="6.1.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -24,26 +24,26 @@
|
|||
|
||||
<OnPlatform x:Key="LinuxLibertineCapitals" x:TypeArguments="x:String">
|
||||
<On Platform="iOS" Value="Linux Libertine Capitals" />
|
||||
<On Platform="Android" Value="LinLibertine_aS.ttf#Linux Libertine Capitals" />
|
||||
<On Platform="UWP, WinRT, WinPhone" Value="Assets/Fonts/LinLibertine_R.ttf#Linux Libertine" />
|
||||
<On Platform="Android" Value="Cinzel-Regular.otf#Cinzel" />
|
||||
<On Platform="UWP, WinRT, WinPhone" Value="Assets/Fonts/Cinzel-Regular.otf#Cinzel" />
|
||||
</OnPlatform>
|
||||
|
||||
<OnPlatform x:Key="LinuxLibertineCapitalsBold" x:TypeArguments="x:String">
|
||||
<On Platform="iOS" Value="Linux Libertine Capitals" />
|
||||
<On Platform="Android" Value="LinLibertine_aBS.ttf#Linux Libertine Capitals" />
|
||||
<On Platform="UWP, WinRT, WinPhone" Value="Assets/Fonts/LinLibertine_R.ttf#Linux Libertine" />
|
||||
<On Platform="Android" Value="Cinzel-Bold.otf#Cinzel Bold" />
|
||||
<On Platform="UWP, WinRT, WinPhone" Value="Assets/Fonts/Cinzel-Bold.otf#Cinzel" />
|
||||
</OnPlatform>
|
||||
|
||||
<OnPlatform x:Key="LinuxLibertineCapitalsItal" x:TypeArguments="x:String">
|
||||
<On Platform="iOS" Value="Linux Libertine Capitals" />
|
||||
<On Platform="Android" Value="LinLibertine_aSI.ttf#Linux Libertine Capitals" />
|
||||
<On Platform="UWP, WinRT, WinPhone" Value="Assets/Fonts/LinLibertine_R.ttf#Linux Libertine" />
|
||||
<On Platform="Android" Value="Cinzel-Regular.otf#Cinzel" />
|
||||
<On Platform="UWP, WinRT, WinPhone" Value="Assets/Fonts/Cinzel-Regular.otf#Cinzel" />
|
||||
</OnPlatform>
|
||||
|
||||
<OnPlatform x:Key="LinuxLibertineCapitalsBoldItal" x:TypeArguments="x:String">
|
||||
<On Platform="iOS" Value="Linux Libertine Capitals" />
|
||||
<On Platform="Android" Value="LinLibertine_aSZI.ttf#Linux Libertine Capitals" />
|
||||
<On Platform="UWP, WinRT, WinPhone" Value="Assets/Fonts/LinLibertine_R.ttf#Linux Libertine" />
|
||||
<On Platform="Android" Value="Cinzel-Bold.otf#Cinzel Bold" />
|
||||
<On Platform="UWP, WinRT, WinPhone" Value="Assets/Fonts/Cinzel-Bold.otf#Cinzel" />
|
||||
</OnPlatform>
|
||||
|
||||
<OnPlatform x:Key="LinuxLibertine" x:TypeArguments="x:String">
|
||||
|
|
@ -117,35 +117,35 @@
|
|||
<Style TargetType="Label" x:Key="heading2">
|
||||
<Setter Property="FontSize" Value="25" />
|
||||
<Setter Property="TextColor" Value="{StaticResource HDBlack}" />
|
||||
<Setter Property="FontFamily" Value="{DynamicResource LinuxLibertineCapitalsBold}" />
|
||||
<Setter Property="FontFamily" Value="{DynamicResource LinuxLibertineCapitals}" />
|
||||
<Setter Property="FontAttributes" Value="Bold" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Label" x:Key="heading3">
|
||||
<Setter Property="FontSize" Value="20" />
|
||||
<Setter Property="TextColor" Value="{StaticResource HDBlack}" />
|
||||
<Setter Property="FontFamily" Value="{DynamicResource LinuxLibertineCapitalsBold}" />
|
||||
<Setter Property="FontFamily" Value="{DynamicResource LinuxLibertineCapitals}" />
|
||||
<Setter Property="FontAttributes" Value="Bold" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Label" x:Key="heading4">
|
||||
<Setter Property="FontSize" Value="18" />
|
||||
<Setter Property="TextColor" Value="{StaticResource HDBlack}" />
|
||||
<Setter Property="FontFamily" Value="{DynamicResource LinuxLibertineCapitalsBold}" />
|
||||
<Setter Property="FontFamily" Value="{DynamicResource LinuxLibertineCapitals}" />
|
||||
<Setter Property="FontAttributes" Value="Bold" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Label" x:Key="heading5">
|
||||
<Setter Property="FontSize" Value="16" />
|
||||
<Setter Property="TextColor" Value="{StaticResource HDBlack}" />
|
||||
<Setter Property="FontFamily" Value="{DynamicResource LinuxLibertineCapitalsBold}" />
|
||||
<Setter Property="FontFamily" Value="{DynamicResource LinuxLibertineCapitals}" />
|
||||
<Setter Property="FontAttributes" Value="Bold" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Label" x:Key="heading6">
|
||||
<Setter Property="FontSize" Value="15" />
|
||||
<Setter Property="TextColor" Value="{StaticResource HDBlack}" />
|
||||
<Setter Property="FontFamily" Value="{DynamicResource LinuxLibertineCapitalsBold}" />
|
||||
<Setter Property="FontFamily" Value="{DynamicResource LinuxLibertineCapitals}" />
|
||||
<Setter Property="FontAttributes" Value="Bold" />
|
||||
</Style>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using AideDeJeu.ViewModels;
|
||||
using AideDeJeu.Pdf;
|
||||
using AideDeJeu.ViewModels;
|
||||
using AideDeJeu.ViewModels.Library;
|
||||
using AideDeJeu.ViewModels.PlayerCharacter;
|
||||
using AideDeJeu.Views;
|
||||
|
|
@ -19,6 +20,7 @@ namespace AideDeJeu
|
|||
InitializeComponent();
|
||||
|
||||
DependencyService.Register<MainViewModel>();
|
||||
DependencyService.Register<PdfService>();
|
||||
DependencyService.Register<BookmarksViewModel>();
|
||||
DependencyService.Register<StoreViewModel>();
|
||||
DependencyService.Register<PlayerCharacterEditorViewModel>();
|
||||
|
|
|
|||
|
|
@ -64,13 +64,13 @@
|
|||
view.RenderMarkdown();
|
||||
}
|
||||
|
||||
private StackLayout stack;
|
||||
private StackLayout _Stack;
|
||||
|
||||
private List<KeyValuePair<string, string>> links = new List<KeyValuePair<string, string>>();
|
||||
|
||||
private void RenderMarkdown()
|
||||
{
|
||||
stack = new StackLayout()
|
||||
_Stack = new StackLayout()
|
||||
{
|
||||
Spacing = this.Theme.Margin,
|
||||
};
|
||||
|
|
@ -83,19 +83,27 @@
|
|||
{
|
||||
var pipeline = new Markdig.MarkdownPipelineBuilder().UseYamlFrontMatter().UsePipeTables().Build();
|
||||
var parsed = Markdig.Markdown.Parse(this.Markdown, pipeline);
|
||||
this.Render(parsed.AsEnumerable());
|
||||
var views = this.Render(parsed.AsEnumerable());
|
||||
views.ToList().ForEach(view => _Stack.Children.Add(view));
|
||||
}
|
||||
|
||||
this.Content = stack;
|
||||
this.Content = _Stack;
|
||||
|
||||
}
|
||||
|
||||
private void Render(IEnumerable<Block> blocks)
|
||||
private IEnumerable<View> Render(IEnumerable<Block> blocks)
|
||||
{
|
||||
var views = new List<View>();
|
||||
foreach (var block in blocks)
|
||||
{
|
||||
this.Render(block);
|
||||
var subviews = this.Render(block);
|
||||
if(subviews != null)
|
||||
{
|
||||
views.AddRange(subviews);
|
||||
//views.Add(view);
|
||||
}
|
||||
}
|
||||
return views;
|
||||
}
|
||||
|
||||
private void AttachLinks(View view)
|
||||
|
|
@ -103,24 +111,21 @@
|
|||
if (links.Any())
|
||||
{
|
||||
var blockLinks = links.Distinct().OrderBy(l => l.Key).ToList();
|
||||
if (blockLinks.Count > 1)
|
||||
{
|
||||
if (Device.RuntimePlatform == Device.GTK)
|
||||
if (blockLinks.Count > 1 && Device.RuntimePlatform == Device.GTK)
|
||||
{
|
||||
view.GestureRecognizers.Add(new TapGestureRecognizer
|
||||
{
|
||||
view.GestureRecognizers.Add(new TapGestureRecognizer
|
||||
Command = new Command(async () =>
|
||||
{
|
||||
Command = new Command(async () =>
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = await Application.Current.MainPage.DisplayActionSheet("Ouvrir le lien", "Annuler", null, blockLinks.Select(x => x.Key).ToArray());
|
||||
var link = blockLinks.FirstOrDefault(x => x.Key == result);
|
||||
NavigateToLinkCommand?.Execute(link.Value);
|
||||
}
|
||||
catch (Exception) { }
|
||||
}),
|
||||
});
|
||||
}
|
||||
var result = await Application.Current.MainPage.DisplayActionSheet("Ouvrir le lien", "Annuler", null, blockLinks.Select(x => x.Key).ToArray());
|
||||
var link = blockLinks.FirstOrDefault(x => x.Key == result);
|
||||
NavigateToLinkCommand?.Execute(link.Value);
|
||||
}
|
||||
catch (Exception) { }
|
||||
}),
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -159,100 +164,118 @@
|
|||
|
||||
#region Rendering blocks
|
||||
|
||||
private void Render(Block block)
|
||||
private IEnumerable<View> Render(Block block)
|
||||
{
|
||||
var views = new List<View>();
|
||||
IEnumerable<View> subviews = null;
|
||||
switch (block)
|
||||
{
|
||||
case HeadingBlock heading:
|
||||
Render(heading);
|
||||
subviews = Render(heading);
|
||||
break;
|
||||
|
||||
case ParagraphBlock paragraph:
|
||||
Render(paragraph);
|
||||
subviews = Render(paragraph);
|
||||
break;
|
||||
|
||||
case QuoteBlock quote:
|
||||
Render(quote);
|
||||
subviews = Render(quote);
|
||||
break;
|
||||
|
||||
case CodeBlock code:
|
||||
Render(code);
|
||||
subviews = Render(code);
|
||||
break;
|
||||
|
||||
case ListBlock list:
|
||||
Render(list);
|
||||
subviews = Render(list);
|
||||
break;
|
||||
|
||||
case ThematicBreakBlock thematicBreak:
|
||||
Render(thematicBreak);
|
||||
subviews = Render(thematicBreak);
|
||||
break;
|
||||
|
||||
case HtmlBlock html:
|
||||
Render(html);
|
||||
subviews = Render(html);
|
||||
break;
|
||||
|
||||
case Markdig.Extensions.Tables.Table table:
|
||||
Render(table);
|
||||
subviews = Render(table);
|
||||
break;
|
||||
|
||||
default:
|
||||
Debug.WriteLine($"Can't render {block.GetType()} blocks.");
|
||||
break;
|
||||
}
|
||||
|
||||
if(queuedViews.Any())
|
||||
if(subviews != null)
|
||||
{
|
||||
foreach (var view in queuedViews)
|
||||
{
|
||||
this.stack.Children.Add(view);
|
||||
}
|
||||
queuedViews.Clear();
|
||||
views.AddRange(subviews);
|
||||
}
|
||||
|
||||
if (views != null)
|
||||
{
|
||||
if (queuedViews.Any())
|
||||
{
|
||||
foreach (var view in queuedViews)
|
||||
{
|
||||
views.Add(view);
|
||||
}
|
||||
queuedViews.Clear();
|
||||
}
|
||||
}
|
||||
return views;
|
||||
}
|
||||
|
||||
private int listScope;
|
||||
|
||||
private void Render(ThematicBreakBlock block)
|
||||
private IEnumerable<View> Render(ThematicBreakBlock block)
|
||||
{
|
||||
var style = this.Theme.Separator;
|
||||
|
||||
if (style.BorderSize > 0)
|
||||
{
|
||||
stack.Children.Add(new BoxView
|
||||
return new View[] { new BoxView
|
||||
{
|
||||
HeightRequest = style.BorderSize,
|
||||
BackgroundColor = style.BorderColor,
|
||||
});
|
||||
} };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void Render(ListBlock block)
|
||||
private IEnumerable<View> Render(ListBlock block)
|
||||
{
|
||||
listScope++;
|
||||
|
||||
var views = new List<View>();
|
||||
for (int i = 0; i < block.Count(); i++)
|
||||
{
|
||||
var item = block.ElementAt(i);
|
||||
|
||||
if (item is ListItemBlock itemBlock)
|
||||
{
|
||||
this.Render(block, i + 1, itemBlock);
|
||||
var subviews = this.Render(block, i + 1, itemBlock);
|
||||
if(subviews != null)
|
||||
{
|
||||
views.AddRange(subviews);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
listScope--;
|
||||
return views;
|
||||
}
|
||||
|
||||
private void Render(ListBlock parent, int index, ListItemBlock block)
|
||||
private IEnumerable<View> Render(ListBlock parent, int index, ListItemBlock block)
|
||||
{
|
||||
var initialStack = this.stack;
|
||||
//var initialStack = this.stack;
|
||||
|
||||
this.stack = new StackLayout()
|
||||
var stack = new StackLayout()
|
||||
{
|
||||
Spacing = this.Theme.Margin,
|
||||
};
|
||||
|
||||
this.Render(block.AsEnumerable());
|
||||
var subv = this.Render(block.AsEnumerable());
|
||||
subv.ToList().ForEach(v => stack.Children.Add(v));
|
||||
|
||||
var horizontalStack = new StackLayout
|
||||
{
|
||||
|
|
@ -299,13 +322,14 @@
|
|||
horizontalStack.Children.Add(bullet);
|
||||
}
|
||||
|
||||
horizontalStack.Children.Add(this.stack);
|
||||
initialStack.Children.Add(horizontalStack);
|
||||
horizontalStack.Children.Add(stack);
|
||||
//initialStack.Children.Add(horizontalStack);
|
||||
|
||||
this.stack = initialStack;
|
||||
//this.stack = initialStack;
|
||||
return new View[] { horizontalStack };
|
||||
}
|
||||
|
||||
private void Render(HeadingBlock block)
|
||||
private IEnumerable<View> Render(HeadingBlock block)
|
||||
{
|
||||
MarkdownStyle style;
|
||||
|
||||
|
|
@ -349,16 +373,16 @@
|
|||
HeightRequest = style.BorderSize,
|
||||
BackgroundColor = style.BorderColor,
|
||||
});
|
||||
stack.Children.Add(headingStack);
|
||||
return new View[] { headingStack };
|
||||
}
|
||||
else
|
||||
{
|
||||
stack.Children.Add(label);
|
||||
return new View[] { label };
|
||||
}
|
||||
}
|
||||
|
||||
private void Render(ParagraphBlock block)
|
||||
{
|
||||
private IEnumerable<View> Render(ParagraphBlock block)
|
||||
{
|
||||
var style = this.Theme.Paragraph;
|
||||
var foregroundColor = isQuoted ? this.Theme.Quote.ForegroundColor : style.ForegroundColor;
|
||||
var label = new Label
|
||||
|
|
@ -366,10 +390,10 @@
|
|||
FormattedText = CreateFormatted(block.Inline, style.FontFamily, style.Attributes, foregroundColor, style.BackgroundColor, style.FontSize),
|
||||
};
|
||||
AttachLinks(label);
|
||||
this.stack.Children.Add(label);
|
||||
return new View[] { label };
|
||||
}
|
||||
|
||||
private void Render(HtmlBlock block)
|
||||
private IEnumerable<View> Render(HtmlBlock block)
|
||||
{
|
||||
if(block.Type == HtmlBlockType.NonInterruptingBlock || block.Type == HtmlBlockType.Comment)
|
||||
{
|
||||
|
|
@ -380,7 +404,7 @@
|
|||
{
|
||||
Text = "\n",
|
||||
};
|
||||
this.stack.Children.Add(label);
|
||||
return new View[] { label };
|
||||
|
||||
}
|
||||
else
|
||||
|
|
@ -393,15 +417,17 @@
|
|||
// ?
|
||||
}
|
||||
// ?
|
||||
return null;
|
||||
}
|
||||
|
||||
private void Render(QuoteBlock block)
|
||||
private IEnumerable<View> Render(QuoteBlock block)
|
||||
{
|
||||
var initialIsQuoted = this.isQuoted;
|
||||
var initialStack = this.stack;
|
||||
//var initialStack = this.stack;
|
||||
var views = new List<View>();
|
||||
|
||||
this.isQuoted = true;
|
||||
this.stack = new StackLayout()
|
||||
var stack = new StackLayout()
|
||||
{
|
||||
Spacing = this.Theme.Margin,
|
||||
};
|
||||
|
|
@ -422,23 +448,25 @@
|
|||
BackgroundColor = style.BorderColor,
|
||||
});
|
||||
|
||||
horizontalStack.Children.Add(this.stack);
|
||||
initialStack.Children.Add(horizontalStack);
|
||||
horizontalStack.Children.Add(stack);
|
||||
views.Add(horizontalStack);
|
||||
}
|
||||
else
|
||||
{
|
||||
stack.BackgroundColor = this.Theme.Quote.BackgroundColor;
|
||||
initialStack.Children.Add(this.stack);
|
||||
views.Add(stack);
|
||||
}
|
||||
|
||||
this.Render(block.AsEnumerable());
|
||||
var subviews = this.Render(block.AsEnumerable());
|
||||
|
||||
this.isQuoted = initialIsQuoted;
|
||||
this.stack = initialStack;
|
||||
//this.stack = initialStack;
|
||||
return subviews;
|
||||
}
|
||||
|
||||
private void Render(CodeBlock block)
|
||||
private IEnumerable<View> Render(CodeBlock block)
|
||||
{
|
||||
var views = new List<View>();
|
||||
var style = this.Theme.Code;
|
||||
var label = new Label
|
||||
{
|
||||
|
|
@ -448,7 +476,7 @@
|
|||
FontSize = style.FontSize,
|
||||
Text = string.Join(Environment.NewLine, block.Lines),
|
||||
};
|
||||
stack.Children.Add(new Frame()
|
||||
views.Add(new Frame()
|
||||
{
|
||||
CornerRadius = 3,
|
||||
HasShadow = false,
|
||||
|
|
@ -456,9 +484,10 @@
|
|||
BackgroundColor = style.BackgroundColor,
|
||||
Content = label
|
||||
});
|
||||
return views;
|
||||
}
|
||||
|
||||
private void Render(Markdig.Extensions.Tables.Table tableBlock)
|
||||
private IEnumerable<View> Render(Markdig.Extensions.Tables.Table tableBlock)
|
||||
{
|
||||
var scroll = new ScrollView() { HorizontalScrollBarVisibility = ScrollBarVisibility.Default, Orientation = ScrollOrientation.Horizontal };
|
||||
var grid = new Grid() { HorizontalOptions = LayoutOptions.Start, Margin = 0, Padding = 1, BackgroundColor = Theme.TableHeader.BackgroundColor, RowSpacing = 1, ColumnSpacing = 1 };
|
||||
|
|
@ -514,8 +543,9 @@
|
|||
}
|
||||
top++;
|
||||
}
|
||||
stack.Children.Add(scroll);
|
||||
//stack.Children.Add(scroll);
|
||||
scroll.Content = grid;
|
||||
return new View[] { scroll };
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -586,7 +616,7 @@
|
|||
image.Source = url;
|
||||
}
|
||||
|
||||
queuedViews.Add(image);
|
||||
//queuedViews.Add(image);
|
||||
return new Span[0];
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -339,9 +339,14 @@ namespace AideDeJeuLib
|
|||
}
|
||||
else
|
||||
{
|
||||
id = id.Replace(".md#", "_");
|
||||
id = id.Replace(".md", "");
|
||||
}
|
||||
id = id.Replace("-", "_").Replace("?", "").Replace("’", "_").Replace("'", "_").Replace("__", "_").ToLower() + ".md";
|
||||
if (id.Contains("#"))
|
||||
{
|
||||
Console.WriteLine(id);
|
||||
}
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using AideDeJeu;
|
||||
using AideDeJeu.Tools;
|
||||
using Markdig.Syntax;
|
||||
using SQLite;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
|
@ -12,10 +13,16 @@ namespace AideDeJeuLib
|
|||
{
|
||||
public class MonsterItem : Item
|
||||
{
|
||||
[Indexed]
|
||||
public string Family { get; set; }
|
||||
[Indexed]
|
||||
public string Type { get; set; }
|
||||
[Indexed]
|
||||
public string Size { get; set; }
|
||||
[Indexed]
|
||||
public string Alignment { get; set; }
|
||||
[Indexed]
|
||||
public string Terrain { get; set; }
|
||||
public string Legendary { get; set; }
|
||||
//public string Source { get; set; }
|
||||
public string ArmorClass { get; set; }
|
||||
|
|
@ -35,6 +42,7 @@ namespace AideDeJeuLib
|
|||
public string DamageResistances { get; set; }
|
||||
public string Senses { get; set; }
|
||||
public string Languages { get; set; }
|
||||
[Indexed]
|
||||
public string Challenge { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ namespace AideDeJeuLib
|
|||
public string Challenges { get; set; }
|
||||
public string Sizes { get; set; }
|
||||
public string Sources { get; set; }
|
||||
public string Terrains { get; set; }
|
||||
|
||||
public override FilterViewModel GetNewFilterViewModel()
|
||||
{
|
||||
|
|
@ -19,7 +20,8 @@ namespace AideDeJeuLib
|
|||
Split(Types),
|
||||
Split(Challenges),
|
||||
Split(Sizes),
|
||||
Split(Sources)
|
||||
Split(Sources),
|
||||
Split(Terrains)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
BIN
AideDeJeu/AideDeJeu/Pdf/Cinzel-Black.otf
Normal file
BIN
AideDeJeu/AideDeJeu/Pdf/Cinzel-Black.otf
Normal file
Binary file not shown.
BIN
AideDeJeu/AideDeJeu/Pdf/Cinzel-Bold.otf
Normal file
BIN
AideDeJeu/AideDeJeu/Pdf/Cinzel-Bold.otf
Normal file
Binary file not shown.
BIN
AideDeJeu/AideDeJeu/Pdf/Cinzel-Regular.otf
Normal file
BIN
AideDeJeu/AideDeJeu/Pdf/Cinzel-Regular.otf
Normal file
Binary file not shown.
BIN
AideDeJeu/AideDeJeu/Pdf/CinzelDecorative-Black.otf
Normal file
BIN
AideDeJeu/AideDeJeu/Pdf/CinzelDecorative-Black.otf
Normal file
Binary file not shown.
BIN
AideDeJeu/AideDeJeu/Pdf/CinzelDecorative-Bold.otf
Normal file
BIN
AideDeJeu/AideDeJeu/Pdf/CinzelDecorative-Bold.otf
Normal file
Binary file not shown.
BIN
AideDeJeu/AideDeJeu/Pdf/CinzelDecorative-Regular.otf
Normal file
BIN
AideDeJeu/AideDeJeu/Pdf/CinzelDecorative-Regular.otf
Normal file
Binary file not shown.
BIN
AideDeJeu/AideDeJeu/Pdf/MarcellusSC-Regular.ttf
Normal file
BIN
AideDeJeu/AideDeJeu/Pdf/MarcellusSC-Regular.ttf
Normal file
Binary file not shown.
442
AideDeJeu/AideDeJeu/Pdf/PdfService.cs
Normal file
442
AideDeJeu/AideDeJeu/Pdf/PdfService.cs
Normal file
|
|
@ -0,0 +1,442 @@
|
|||
using AideDeJeu.Tools;
|
||||
using iTextSharp.text;
|
||||
using iTextSharp.text.pdf;
|
||||
using Markdig;
|
||||
using Markdig.Syntax;
|
||||
using Markdig.Syntax.Inlines;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace AideDeJeu.Pdf
|
||||
{
|
||||
public class PdfService
|
||||
{
|
||||
public static PdfService Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
return DependencyService.Get<PdfService>();
|
||||
}
|
||||
}
|
||||
public static void DrawText(PdfContentByte cb, string text, iTextSharp.text.Font font, float x, float y, float width, float height, int alignment)
|
||||
{
|
||||
cb.SetRGBColorFill(127, 127, 127);
|
||||
//cb.Rectangle(x, y, width, height);
|
||||
//cb.Stroke();
|
||||
ColumnText ct = new ColumnText(cb);
|
||||
ct.SetSimpleColumn(x, y, x + width, y + height);
|
||||
var p = new Paragraph(text); //, font);
|
||||
p.Alignment = alignment;
|
||||
ct.AddElement(p);
|
||||
ct.Go();
|
||||
|
||||
}
|
||||
|
||||
Document _Document = null;
|
||||
PdfWriter _Writer = null;
|
||||
|
||||
public string BasePdfDirectory
|
||||
{
|
||||
get
|
||||
{
|
||||
return Path.Combine(Xamarin.Essentials.FileSystem.CacheDirectory, "pdf");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<string> MarkdownToPDF(List<string> mds)
|
||||
{
|
||||
var basePath = BasePdfDirectory;
|
||||
Directory.CreateDirectory(basePath);
|
||||
using (var stream = new FileStream(Path.Combine(BasePdfDirectory, "test.pdf"), FileMode.Create))
|
||||
{
|
||||
MarkdownToPdf(mds, stream);
|
||||
}
|
||||
return "test.pdf";
|
||||
}
|
||||
public void MarkdownToPdf(List<string> mds, Stream stream)
|
||||
{
|
||||
var pipeline = new Markdig.MarkdownPipelineBuilder().UseYamlFrontMatter().UsePipeTables().Build();
|
||||
|
||||
_Document = new Document(new iTextSharp.text.Rectangle(822, 1122));
|
||||
_Writer = PdfWriter.GetInstance(_Document, stream);
|
||||
_Document.Open();
|
||||
//PdfReader reader = null;
|
||||
//reader = new PdfReader(AideDeJeu.Tools.Helpers.GetResourceStream("AideDeJeu.Pdf.poker_size.pdf"));
|
||||
//PdfStamper stamper = null;
|
||||
//stamper = new PdfStamper(reader, stream);
|
||||
|
||||
foreach (var md in mds)
|
||||
{
|
||||
var parsed = Markdig.Markdown.Parse(md, pipeline);
|
||||
Render(parsed.AsEnumerable(), _Document);
|
||||
}
|
||||
|
||||
_Document.Close();
|
||||
_Writer.Close();
|
||||
//stamper.Close();
|
||||
//reader.Close();
|
||||
}
|
||||
|
||||
private BaseFont GetBaseFont(string fontName)
|
||||
{
|
||||
string fontPath = fontName;
|
||||
if(Xamarin.Essentials.DeviceInfo.Platform != Xamarin.Essentials.DevicePlatform.Unknown)
|
||||
{
|
||||
fontPath = Path.Combine(Xamarin.Essentials.FileSystem.CacheDirectory, fontPath);
|
||||
}
|
||||
using (var inFont = AideDeJeu.Tools.Helpers.GetResourceStream($"AideDeJeu.Pdf.{fontName}"))
|
||||
{
|
||||
using (var outFont = new FileStream(fontPath, FileMode.Create, FileAccess.ReadWrite))
|
||||
{
|
||||
inFont.CopyTo(outFont);
|
||||
}
|
||||
}
|
||||
FontFactory.Register(fontPath);
|
||||
|
||||
return iTextSharp.text.pdf.BaseFont.CreateFont(fontPath, iTextSharp.text.pdf.BaseFont.IDENTITY_H, iTextSharp.text.pdf.BaseFont.EMBEDDED);
|
||||
}
|
||||
|
||||
BaseFont _CinzelRegular = null;
|
||||
public BaseFont CinzelRegular
|
||||
{
|
||||
get
|
||||
{
|
||||
return _CinzelRegular ?? (_CinzelRegular = GetBaseFont("Cinzel-Regular.otf"));
|
||||
}
|
||||
}
|
||||
BaseFont _CinzelBold = null;
|
||||
public BaseFont CinzelBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return _CinzelBold ?? (_CinzelBold = GetBaseFont("Cinzel-Bold.otf"));
|
||||
}
|
||||
}
|
||||
BaseFont _LinuxLibertine = null;
|
||||
public BaseFont LinuxLibertine
|
||||
{
|
||||
get
|
||||
{
|
||||
return _LinuxLibertine ?? (_LinuxLibertine = GetBaseFont("LinLibertine_R.ttf"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
iTextSharp.text.Font _Header1Font = null;
|
||||
public iTextSharp.text.Font Header1Font
|
||||
{
|
||||
get
|
||||
{
|
||||
return _Header1Font ?? (_Header1Font = new iTextSharp.text.Font(CinzelBold, 30));
|
||||
}
|
||||
}
|
||||
iTextSharp.text.Font _Header2Font = null;
|
||||
public iTextSharp.text.Font Header2Font
|
||||
{
|
||||
get
|
||||
{
|
||||
return _Header2Font ?? (_Header2Font = new iTextSharp.text.Font(CinzelRegular, 25));
|
||||
}
|
||||
}
|
||||
iTextSharp.text.Font _Header3Font = null;
|
||||
public iTextSharp.text.Font Header3Font
|
||||
{
|
||||
get
|
||||
{
|
||||
return _Header3Font ?? (_Header3Font = new iTextSharp.text.Font(CinzelRegular, 20));
|
||||
}
|
||||
}
|
||||
iTextSharp.text.Font _Header4Font = null;
|
||||
public iTextSharp.text.Font Header4Font
|
||||
{
|
||||
get
|
||||
{
|
||||
return _Header4Font ?? (_Header4Font = new iTextSharp.text.Font(CinzelRegular, 18));
|
||||
}
|
||||
}
|
||||
iTextSharp.text.Font _Header5Font = null;
|
||||
public iTextSharp.text.Font Header5Font
|
||||
{
|
||||
get
|
||||
{
|
||||
return _Header5Font ?? (_Header5Font = new iTextSharp.text.Font(CinzelRegular, 16));
|
||||
}
|
||||
}
|
||||
iTextSharp.text.Font _Header6Font = null;
|
||||
public iTextSharp.text.Font Header6Font
|
||||
{
|
||||
get
|
||||
{
|
||||
return _Header6Font ?? (_Header6Font = new iTextSharp.text.Font(CinzelRegular, 15));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
iTextSharp.text.Font _ParagraphFont = null;
|
||||
iTextSharp.text.Font ParagraphFont
|
||||
{
|
||||
get
|
||||
{
|
||||
return _ParagraphFont ?? (_ParagraphFont = new iTextSharp.text.Font(LinuxLibertine, 15));
|
||||
}
|
||||
}
|
||||
|
||||
private void Render(IEnumerable<Block> blocks, Document document)
|
||||
{
|
||||
//if(ParagraphFont == null)
|
||||
//{
|
||||
// if(CinzelRegular == null)
|
||||
// {
|
||||
|
||||
// }
|
||||
// //var fontPath = Path.Combine(Xamarin.Essentials.FileSystem.CacheDirectory, "Cinzel-Regular.otf");
|
||||
// //var fontPath = @"C:\Users\yanma\Documents\Visual Studio 2017\Projects\AideDeJeu\AideDeJeu\AideDeJeuCmd\bin\Debug\netcoreapp2.1\Cinzel-Regular.otf";
|
||||
// var fontPath = @"Cinzel-Regular.otf";
|
||||
// using (var inFont = AideDeJeu.Tools.Helpers.GetResourceStream("AideDeJeu.Pdf.Cinzel-Regular.otf"))
|
||||
// {
|
||||
// using (var outFont = new FileStream(fontPath, FileMode.Create, FileAccess.ReadWrite))
|
||||
// {
|
||||
// inFont.CopyTo(outFont);
|
||||
// }
|
||||
// }
|
||||
// FontFactory.Register(fontPath);
|
||||
|
||||
// //var mafont = FontFactory.GetFont("cinzel", 20, iTextSharp.text.Font.NORMAL);
|
||||
// var mafont = iTextSharp.text.pdf.BaseFont.CreateFont(fontPath, iTextSharp.text.pdf.BaseFont.IDENTITY_H, iTextSharp.text.pdf.BaseFont.EMBEDDED);
|
||||
// //var font = mafont.BaseFont;
|
||||
// var bigFont = new iTextSharp.text.Font(mafont, 20);
|
||||
|
||||
// var fonts = FontFactory.RegisteredFonts;
|
||||
|
||||
// ParagraphFont = bigFont;
|
||||
//}
|
||||
var phrases = Render(blocks);
|
||||
|
||||
|
||||
ColumnText ct = new ColumnText(_Writer.DirectContent);
|
||||
|
||||
int column = 0;
|
||||
ct.SetSimpleColumn(10, 10 + 200 * column, 200, 200 + 200 * column);
|
||||
int status = 0;
|
||||
Phrase p = null;
|
||||
float y = 0;
|
||||
foreach (var phrase in phrases)
|
||||
{
|
||||
//var pphrase = new Phrase("test", bigFont);
|
||||
//phrase.Font = ParagraphFont;
|
||||
y = ct.YLine;
|
||||
|
||||
document.Add(phrase);
|
||||
//ct.AddText(phrase);
|
||||
//status = ct.Go(true);
|
||||
//if(ColumnText.HasMoreText(status))
|
||||
//{
|
||||
|
||||
// column++;
|
||||
// ct.SetSimpleColumn(10, 10 + 200 * column, 200, 200 + 200 * column);
|
||||
// y += 200;
|
||||
//}
|
||||
//ct.YLine = y;
|
||||
//ct.SetText(phrase);
|
||||
//status = ct.Go(false);
|
||||
|
||||
|
||||
|
||||
//ColumnText ct = new ColumnText(_Writer.DirectContent);
|
||||
//ct.AddText(CreateFormatted(block.Inline, Font.HELVETICA, 0, new Color(0, 0, 0), 12));
|
||||
//ct.Alignment = Element.ALIGN_JUSTIFIED;
|
||||
//ct.SetSimpleColumn(10, 10, 200, 200);
|
||||
//ct.Go();
|
||||
}
|
||||
}
|
||||
private IEnumerable<Phrase> Render(IEnumerable<Block> blocks)
|
||||
{
|
||||
var phrases = new List<Phrase>();
|
||||
foreach (var block in blocks)
|
||||
{
|
||||
var phrase = this.Render(block);
|
||||
if(phrase != null)
|
||||
{
|
||||
phrases.Add(phrase);
|
||||
}
|
||||
if (block.IsBreakable)
|
||||
{
|
||||
phrases.Add(new Phrase(Chunk.NEWLINE));
|
||||
}
|
||||
}
|
||||
return phrases;
|
||||
}
|
||||
private Phrase Render(Block block)
|
||||
{
|
||||
switch (block)
|
||||
{
|
||||
case HeadingBlock heading:
|
||||
return Render(heading);
|
||||
|
||||
case ParagraphBlock paragraph:
|
||||
return Render(paragraph);
|
||||
|
||||
//case QuoteBlock quote:
|
||||
// Render(quote);
|
||||
// break;
|
||||
|
||||
//case CodeBlock code:
|
||||
// Render(code);
|
||||
// break;
|
||||
|
||||
//case ListBlock list:
|
||||
// Render(list);
|
||||
// break;
|
||||
|
||||
//case ThematicBreakBlock thematicBreak:
|
||||
// Render(thematicBreak);
|
||||
// break;
|
||||
|
||||
//case HtmlBlock html:
|
||||
// Render(html);
|
||||
// break;
|
||||
|
||||
//case Markdig.Extensions.Tables.Table table:
|
||||
// Render(table);
|
||||
// break;
|
||||
|
||||
default:
|
||||
Debug.WriteLine($"Can't render {block.GetType()} blocks.");
|
||||
return null;
|
||||
}
|
||||
|
||||
//if (queuedViews.Any())
|
||||
//{
|
||||
// foreach (var view in queuedViews)
|
||||
// {
|
||||
// this.stack.Children.Add(view);
|
||||
// }
|
||||
// queuedViews.Clear();
|
||||
//}
|
||||
}
|
||||
|
||||
private Phrase Render(HeadingBlock block)
|
||||
{
|
||||
var fonts = new iTextSharp.text.Font[] { Header1Font, Header2Font, Header3Font, Header4Font, Header5Font, Header6Font };
|
||||
var colors = new iTextSharp.text.Color[] { new iTextSharp.text.Color(0x9B1C47), new iTextSharp.text.Color(0, 0, 0), new iTextSharp.text.Color(0, 0, 0), new iTextSharp.text.Color(0, 0, 0), new iTextSharp.text.Color(0, 0, 0), new iTextSharp.text.Color(0, 0, 0) };
|
||||
return CreateFormatted(block.Inline, fonts[block.Level - 1], 0, colors[block.Level - 1]);
|
||||
}
|
||||
|
||||
private Phrase Render(ParagraphBlock block)
|
||||
{
|
||||
return CreateFormatted(block.Inline, ParagraphFont, 0, new iTextSharp.text.Color(0, 0, 0));
|
||||
//_Document.Add(CreateFormatted(block.Inline, Font.HELVETICA, 0, new Color(0, 0, 0), 20));
|
||||
}
|
||||
|
||||
private Phrase CreateFormatted(ContainerInline inlines, iTextSharp.text.Font fontFamily, int fontStyle, iTextSharp.text.Color fontColor)
|
||||
{
|
||||
var phrase = new Phrase();
|
||||
foreach (var inline in inlines)
|
||||
{
|
||||
var spans = CreateChunks(inline, fontFamily, fontStyle, fontColor);
|
||||
if (spans != null)
|
||||
{
|
||||
foreach (var span in spans)
|
||||
{
|
||||
phrase.Add(span);
|
||||
}
|
||||
}
|
||||
}
|
||||
return phrase;
|
||||
}
|
||||
private Chunk[] CreateChunks(Inline inline, iTextSharp.text.Font fontFamily, int fontStyle, iTextSharp.text.Color fontColor)
|
||||
{
|
||||
switch (inline)
|
||||
{
|
||||
case LiteralInline literal:
|
||||
return new Chunk[]
|
||||
{
|
||||
new Chunk()
|
||||
{
|
||||
Content = literal.Content.Text.Substring(literal.Content.Start, literal.Content.Length),
|
||||
Font = new iTextSharp.text.Font(fontFamily.BaseFont, fontFamily.Size, fontStyle, fontColor)
|
||||
}
|
||||
};
|
||||
case EmphasisInline emphasis:
|
||||
var childStyle = fontStyle | (emphasis.DelimiterCount == 2 ? iTextSharp.text.Font.BOLD : iTextSharp.text.Font.ITALIC);
|
||||
var espans = emphasis.SelectMany(x => CreateChunks(x, fontFamily, childStyle, fontColor));
|
||||
return espans.ToArray();
|
||||
|
||||
case LineBreakInline breakline:
|
||||
return new Chunk[] { Chunk.NEWLINE };
|
||||
|
||||
case LinkInline link:
|
||||
case CodeInline code:
|
||||
|
||||
case HtmlInline html:
|
||||
|
||||
default:
|
||||
return new Chunk[] { };
|
||||
}
|
||||
//var cb = stamper.GetOverContent(1);
|
||||
////ColumnText.ShowTextAligned(cb, iTextSharp.text.Element.ALIGN_LEFT, new Phrase("Galefrin"), 40, 40, 0);
|
||||
|
||||
|
||||
//ColumnText ct = new ColumnText(cb);
|
||||
//ct.SetSimpleColumn(10f, 48f, 200f, 600f);
|
||||
//Font f = new Font();
|
||||
//Paragraph pz = new Paragraph(new Phrase(20, "Hello World!", f));
|
||||
//ct.AddElement(pz);
|
||||
//ct.Go();
|
||||
//BaseFont bf = BaseFont.CreateFont(BaseFont.HELVETICA_BOLD, "Cp1252", BaseFont.EMBEDDED);
|
||||
//f = new Font(bf, 13);
|
||||
//ct = new ColumnText(cb);
|
||||
//ct.SetSimpleColumn(10f, 48f, 200f, 700f);
|
||||
//pz = new Paragraph("Hello World!", f);
|
||||
//ct.AddElement(pz);
|
||||
//ct.Go();
|
||||
|
||||
|
||||
|
||||
|
||||
//return;
|
||||
/*
|
||||
var text = block.ToMarkdownString();
|
||||
//DrawText(content, md, null, 100, 100, 300, 300, 0);
|
||||
|
||||
float x = 10;
|
||||
float y = 10;
|
||||
float width = 300;
|
||||
float height = 300;
|
||||
cb.SetRGBColorFill(127, 127, 127);
|
||||
//cb.Rectangle(x, y, width, height);
|
||||
//cb.Stroke();
|
||||
ColumnText ct = new ColumnText(cb);
|
||||
ct.SetSimpleColumn(x, y, x + width, y + height);
|
||||
|
||||
Font font = new Font(BaseFont.CreateFont());
|
||||
//int rectWidth = 80;
|
||||
//float maxFontSize = getMaxFontSize(BaseFont.CreateFont(), "text", rectWidth);
|
||||
font.Size = 20;
|
||||
|
||||
|
||||
var p = new Paragraph(text, font);
|
||||
//p.Alignment = alignment;
|
||||
ct.AddElement(p);
|
||||
ct.Go();
|
||||
|
||||
|
||||
|
||||
//var style = this.Theme.Paragraph;
|
||||
//var foregroundColor = isQuoted ? this.Theme.Quote.ForegroundColor : style.ForegroundColor;
|
||||
//var label = new Label
|
||||
//{
|
||||
// FormattedText = CreateFormatted(block.Inline, style.FontFamily, style.Attributes, foregroundColor, style.BackgroundColor, style.FontSize),
|
||||
//};
|
||||
//AttachLinks(label);
|
||||
//this.stack.Children.Add(label);
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
1045
AideDeJeu/AideDeJeu/Pdf/poker_size.pdf
Normal file
1045
AideDeJeu/AideDeJeu/Pdf/poker_size.pdf
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -98,6 +98,7 @@ namespace AideDeJeu.ViewModels.Library
|
|||
MaxWeight,
|
||||
Rarity,
|
||||
Attunement,
|
||||
Terrain,
|
||||
}
|
||||
|
||||
public class Filter : BaseViewModel
|
||||
|
|
@ -298,6 +299,7 @@ namespace AideDeJeu.ViewModels.Library
|
|||
new Filter() { Key = FilterKeys.Size, Name = "Taille", KeyValues = Sizes, _Index = 0 },
|
||||
//new Filter() { Key = FilterKeys.Legendary, Name = "Légendaire", KeyValues = Legendaries, _Index = 0 },
|
||||
new Filter() { Key = FilterKeys.Source, Name = "Source", KeyValues = Sources, _Index = 0 },
|
||||
new Filter() { Key = FilterKeys.Terrain, Name = "Terrain", KeyValues = Terrains, _Index = 0 },
|
||||
};
|
||||
RegisterFilters();
|
||||
}
|
||||
|
|
@ -312,13 +314,15 @@ namespace AideDeJeu.ViewModels.Library
|
|||
List<KeyValuePair<string, string>> types,
|
||||
List<KeyValuePair<string, string>> challenges,
|
||||
List<KeyValuePair<string, string>> sizes,
|
||||
List<KeyValuePair<string, string>> sources)
|
||||
List<KeyValuePair<string, string>> sources,
|
||||
List<KeyValuePair<string, string>> terrains)
|
||||
{
|
||||
this.Family = family;
|
||||
this.Types = types;
|
||||
this.Challenges = challenges;
|
||||
this.Sizes = sizes;
|
||||
this.Sources = sources;
|
||||
this.Terrains = terrains;
|
||||
}
|
||||
|
||||
public List<KeyValuePair<string, string>> Categories { get; }
|
||||
|
|
@ -332,6 +336,7 @@ namespace AideDeJeu.ViewModels.Library
|
|||
public List<KeyValuePair<string, string>> Legendaries { get; }
|
||||
|
||||
public List<KeyValuePair<string, string>> Sources { get; }
|
||||
public List<KeyValuePair<string, string>> Terrains { get; }
|
||||
|
||||
public string ChallengeConverter(string challenge)
|
||||
{
|
||||
|
|
@ -347,6 +352,7 @@ namespace AideDeJeu.ViewModels.Library
|
|||
var maxChallenge = ChallengeConverter(Filters.SingleOrDefault(filter => filter.Key == FilterKeys.MaxChallenge).SelectedKey) ?? "30 (155000 PX)";
|
||||
var size = Filters.SingleOrDefault(filter => filter.Key == FilterKeys.Size).SelectedKey ?? "";
|
||||
var source = Filters.SingleOrDefault(filter => filter.Key == FilterKeys.Source).SelectedKey ?? "";
|
||||
var terrain = Filters.SingleOrDefault(filter => filter.Key == FilterKeys.Terrain).SelectedKey ?? "";
|
||||
token.ThrowIfCancellationRequested();
|
||||
|
||||
try
|
||||
|
|
@ -355,17 +361,12 @@ namespace AideDeJeu.ViewModels.Library
|
|||
using (var context = await StoreViewModel.GetLibraryContextAsync())
|
||||
{
|
||||
return context.Monsters.Where(monster =>
|
||||
monster != null &&
|
||||
monster.Family == this.Family &&
|
||||
monster.Type.Contains(type) &&
|
||||
(string.IsNullOrEmpty(size) || monster.Size.Equals(size)) &&
|
||||
(string.IsNullOrEmpty(source) || (monster.Source != null && monster.Source.Contains(source))) &&
|
||||
challengeComparer.Compare(monster.Challenge, minChallenge) >= 0 &&
|
||||
challengeComparer.Compare(monster.Challenge, maxChallenge) <= 0 &&
|
||||
(
|
||||
(Helpers.RemoveDiacritics(monster.Name).ToLower().Contains(Helpers.RemoveDiacritics(SearchText ?? string.Empty).ToLower())) ||
|
||||
(Helpers.RemoveDiacritics(monster.AltNameText ?? string.Empty).ToLower().Contains(Helpers.RemoveDiacritics(SearchText ?? string.Empty).ToLower()))
|
||||
)
|
||||
MatchEquals(monster.Family, this.Family) &&
|
||||
MatchContains(monster.Type, type) &&
|
||||
MatchEquals(monster.Size, size) &&
|
||||
MatchContains(monster.Terrain, terrain) &&
|
||||
MatchRange(monster.Challenge, minChallenge, maxChallenge, challengeComparer) &&
|
||||
MatchSearch(monster)
|
||||
).OrderBy(monster => Helpers.RemoveDiacritics(monster.Name)).ToList();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
using AideDeJeu.Tools;
|
||||
using AideDeJeu.Pdf;
|
||||
using AideDeJeu.Tools;
|
||||
using AideDeJeu.ViewModels.Library;
|
||||
using AideDeJeu.Views;
|
||||
using AideDeJeu.Views.Library;
|
||||
using AideDeJeu.Views.PlayerCharacter;
|
||||
using AideDeJeuLib;
|
||||
using Rg.Plugins.Popup.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
|
@ -152,11 +155,11 @@ namespace AideDeJeu.ViewModels
|
|||
var lastPage = navigationPage.Navigation.NavigationStack.LastOrDefault();
|
||||
var context = lastPage.BindingContext;
|
||||
Item item = null;
|
||||
if(context is ItemDetailViewModel)
|
||||
if (context is ItemDetailViewModel)
|
||||
{
|
||||
item = (context as ItemDetailViewModel).Item;
|
||||
}
|
||||
else if(context is ItemsViewModel)
|
||||
else if (context is ItemsViewModel)
|
||||
{
|
||||
item = (context as ItemsViewModel).AllItems;
|
||||
}
|
||||
|
|
@ -165,10 +168,10 @@ namespace AideDeJeu.ViewModels
|
|||
var result = await Application.Current.MainPage.DisplayActionSheet("Ajouter à", "Annuler", "Nouvelle liste", vm.BookmarkCollectionNames.ToArray<string>());
|
||||
if (result != "Annuler")
|
||||
{
|
||||
if(result == "Nouvelle liste")
|
||||
if (result == "Nouvelle liste")
|
||||
{
|
||||
int i = 1;
|
||||
while(vm.BookmarkCollectionNames.Contains(result = $"Nouvelle liste ({i})"))
|
||||
while (vm.BookmarkCollectionNames.Contains(result = $"Nouvelle liste ({i})"))
|
||||
{
|
||||
i++;
|
||||
}
|
||||
|
|
@ -230,7 +233,7 @@ namespace AideDeJeu.ViewModels
|
|||
{
|
||||
get
|
||||
{
|
||||
return _NavigateToLinkCommand ?? (_NavigateToLinkCommand = new Command<string>(async(s) => await NavigateToLinkAsync(s)));
|
||||
return _NavigateToLinkCommand ?? (_NavigateToLinkCommand = new Command<string>(async (s) => await NavigateToLinkAsync(s)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -261,7 +264,7 @@ namespace AideDeJeu.ViewModels
|
|||
var filterViewModel = items.GetNewFilterViewModel();
|
||||
var itemsViewModel = new ItemsViewModel() { AllItems = items, Filter = filterViewModel };
|
||||
itemsViewModel.LoadItemsCommand.Execute(null);
|
||||
if(!string.IsNullOrEmpty(with))
|
||||
if (!string.IsNullOrEmpty(with))
|
||||
{
|
||||
var swith = with.Split('_');
|
||||
for (int i = 0; i < swith.Length / 2; i++)
|
||||
|
|
@ -306,7 +309,7 @@ namespace AideDeJeu.ViewModels
|
|||
// create the Transparent Popup Page
|
||||
// of type string since we need a string return
|
||||
var popup = new InputAlertDialogBase<Tuple<string, PopupResultEnum>>(inputView);
|
||||
|
||||
|
||||
|
||||
// subscribe to the TextInputView's Button click event
|
||||
inputView.SaveButtonEventHandler +=
|
||||
|
|
@ -349,5 +352,24 @@ namespace AideDeJeu.ViewModels
|
|||
return result;
|
||||
}
|
||||
|
||||
private Command<string> _GeneratePDFCommand = null;
|
||||
public Command<string> GeneratePDFCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return _GeneratePDFCommand ?? (_GeneratePDFCommand = new Command<string>(async (markdown) => await ExecuteGeneratePDFCommandAsync(markdown)));
|
||||
}
|
||||
}
|
||||
|
||||
public async Task ExecuteGeneratePDFCommandAsync(string markdown)
|
||||
{
|
||||
var page = new PdfViewPage();
|
||||
page.PdfFile = new Tools.NotifyTaskCompletion<string>(Task.Run(async() =>
|
||||
{ return await PdfService.Instance.MarkdownToPDF(new List<string>() { markdown }); }
|
||||
));
|
||||
page.BindingContext = page;
|
||||
await Navigation.PushAsync(page, true);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -125,9 +125,8 @@
|
|||
<Label>
|
||||
<Label.FormattedText>
|
||||
<FormattedString>
|
||||
<Span Text="Le contenu provient du jeu " />
|
||||
<Span Text="Héros & Dragons" FontAttributes="Bold" />
|
||||
<Span Text=" et du SRD VO" />
|
||||
<Span Text="Héros & Dragons est édité par " />
|
||||
<Span Text="Black Book Editions" FontAttributes="Bold" />
|
||||
</FormattedString>
|
||||
</Label.FormattedText>
|
||||
<Label.GestureRecognizers>
|
||||
|
|
@ -135,6 +134,19 @@
|
|||
</Label.GestureRecognizers>
|
||||
</Label>
|
||||
|
||||
<Label>
|
||||
<Label.FormattedText>
|
||||
<FormattedString>
|
||||
<Span Text="Le contenu provient du DRS de " />
|
||||
<Span Text="Héros & Dragons" FontAttributes="Bold" />
|
||||
<Span Text=" et du SRD de la 5è édition" />
|
||||
</FormattedString>
|
||||
</Label.FormattedText>
|
||||
<Label.GestureRecognizers>
|
||||
<TapGestureRecognizer Command="{Binding OpenWebCommand}" CommandParameter="https://heros-et-dragons.fr/" />
|
||||
</Label.GestureRecognizers>
|
||||
</Label>
|
||||
|
||||
<Label Text="Il est soumis à la licence OGL" />
|
||||
|
||||
<Label Text="{Binding OGL}" />
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
<ContentPage.ToolbarItems>
|
||||
<ToolbarItem Name="Print" Text="Générer un PDF" Order="Secondary" Icon="round_star.png" Command="{Binding Main.Navigator.GeneratePDFCommand}" CommandParameter="{Binding Item.Markdown}" />
|
||||
<ToolbarItem Name="AddToFavorites" Text="Ajouter aux favoris" Order="Primary" Icon="round_star.png" Command="{Binding Main.Navigator.AddToFavoritesCommand}" />
|
||||
</ContentPage.ToolbarItems>
|
||||
<Grid>
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
<ContentPage.ToolbarItems>
|
||||
<ToolbarItem Name="Print" Text="Générer un PDF" Order="Secondary" Icon="round_star.png" Command="{Binding Main.Navigator.GeneratePDFCommand}" CommandParameter="{Binding BindingContext.Items.Markdown, Source={x:Reference This}}" />
|
||||
<ToolbarItem Name="AddToFavorites" Text="Ajouter aux favoris" Order="Primary" Icon="round_star.png" Command="{Binding Main.Navigator.AddToFavoritesCommand}" />
|
||||
</ContentPage.ToolbarItems>
|
||||
<Grid>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
}
|
||||
grid label {
|
||||
text-align: center;
|
||||
font-family: LinuxLibertineCapitalsBold;
|
||||
font-family: LinuxLibertineCapitals;
|
||||
-xf-vertical-text-alignment: end;
|
||||
vertical-align: end;
|
||||
}
|
||||
|
|
@ -87,19 +87,19 @@
|
|||
<!--<Label Text="{Binding Main.Navigator.TestNotify}" TextColor="Transparent" />-->
|
||||
<Frame>
|
||||
<Grid>
|
||||
<Label Text="Personnages" />
|
||||
<Label Text="Personnages" FontFamily="{StaticResource LinuxLibertineCapitals}" />
|
||||
<ImageButton Source="battle_axe.png" Command="{Binding Main.Navigator.PlayerCharacterEditorCommand}" />
|
||||
</Grid>
|
||||
</Frame>
|
||||
<Frame>
|
||||
<Grid>
|
||||
<Label Text="Dés" />
|
||||
<Label Text="Dés" FontFamily="{StaticResource LinuxLibertineCapitals}" />
|
||||
<ImageButton Source="d20.png" Command="{Binding Main.Navigator.DicesCommand}" />
|
||||
</Grid>
|
||||
</Frame>
|
||||
<Frame>
|
||||
<Grid>
|
||||
<Label Text="Bibliothèque" />
|
||||
<Label Text="Bibliothèque" FontFamily="{StaticResource LinuxLibertineCapitals}" />
|
||||
<ImageButton Source="spell_book.png" Command="{Binding Main.Navigator.LibraryCommand}" />
|
||||
</Grid>
|
||||
</Frame>
|
||||
|
|
@ -117,7 +117,7 @@
|
|||
</Frame>-->
|
||||
<Frame>
|
||||
<Grid>
|
||||
<Label Text="A propos de..." />
|
||||
<Label Text="A propos de..." FontFamily="{StaticResource LinuxLibertineCapitals}" />
|
||||
<ImageButton Source="wooden_sign.png" Command="{Binding Main.Navigator.AboutCommand}" />
|
||||
</Grid>
|
||||
</Frame>
|
||||
|
|
|
|||
|
|
@ -12,11 +12,13 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="HtmlAgilityPack" Version="1.11.7" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.4" />
|
||||
<PackageReference Include="sqlite-net-pcl" Version="1.6.258-beta" />
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.1" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.1.0" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.0.0.425677" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.0.0.497661" />
|
||||
<PackageReference Include="XamiTextSharpLGPLv2" Version="1.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using AideDeJeu.Tools;
|
||||
using AideDeJeu.Pdf;
|
||||
using AideDeJeu.Tools;
|
||||
using AideDeJeu.ViewModels;
|
||||
using AideDeJeuLib;
|
||||
using Markdig;
|
||||
|
|
@ -132,16 +133,16 @@ namespace AideDeJeuCmd
|
|||
var anchors = new List<string>();
|
||||
var allitems = new Dictionary<string, Item>();
|
||||
var names = Helpers.GetResourceNames();
|
||||
foreach(var name in names)
|
||||
foreach (var name in names)
|
||||
{
|
||||
//if (name.Contains("_hd."))
|
||||
//{
|
||||
var md = await Helpers.GetResourceStringAsync(name);
|
||||
var item = DependencyService.Get<StoreViewModel>().ToItem(name, md, null);
|
||||
allitems.Add(name, item);
|
||||
var md = await Helpers.GetResourceStringAsync(name);
|
||||
var item = DependencyService.Get<StoreViewModel>().ToItem(name, md, null);
|
||||
allitems.Add(name, item);
|
||||
//}
|
||||
}
|
||||
foreach(var allitem in allitems)
|
||||
foreach (var allitem in allitems)
|
||||
{
|
||||
if (allitem.Value is Items)
|
||||
{
|
||||
|
|
@ -155,7 +156,7 @@ namespace AideDeJeuCmd
|
|||
}
|
||||
}
|
||||
}
|
||||
else if(allitem.Value != null)
|
||||
else if (allitem.Value != null)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(allitem.Value.Name))
|
||||
{
|
||||
|
|
@ -266,15 +267,15 @@ namespace AideDeJeuCmd
|
|||
}
|
||||
else
|
||||
{
|
||||
if(levelType != null)
|
||||
if (levelType != null)
|
||||
{
|
||||
await writer.WriteLineAsync(levelType);
|
||||
if(castingTime != null) await writer.WriteLineAsync(castingTime);
|
||||
if(range != null) await writer.WriteLineAsync(range);
|
||||
if(components != null) await writer.WriteLineAsync(components);
|
||||
if(duration != null) await writer.WriteLineAsync(duration);
|
||||
if(classes != null) await writer.WriteLineAsync(classes);
|
||||
if(source != null) await writer.WriteLineAsync(source);
|
||||
if (castingTime != null) await writer.WriteLineAsync(castingTime);
|
||||
if (range != null) await writer.WriteLineAsync(range);
|
||||
if (components != null) await writer.WriteLineAsync(components);
|
||||
if (duration != null) await writer.WriteLineAsync(duration);
|
||||
if (classes != null) await writer.WriteLineAsync(classes);
|
||||
if (source != null) await writer.WriteLineAsync(source);
|
||||
levelType = null;
|
||||
castingTime = null;
|
||||
range = null;
|
||||
|
|
@ -299,7 +300,7 @@ namespace AideDeJeuCmd
|
|||
|
||||
public static async Task PreloadAllItemsFromFilesAsync(StoreViewModel store)
|
||||
{
|
||||
foreach (var fileName in Directory.GetFiles(inDir, "*.md", new EnumerationOptions() { MatchType = MatchType.Simple, RecurseSubdirectories = false }))
|
||||
foreach (var fileName in Directory.GetFiles(inDir, "*.md", new EnumerationOptions() { MatchType = MatchType.Simple, RecurseSubdirectories = false }))
|
||||
{
|
||||
//foreach (var resourceName in Tools.Helpers.GetResourceNames())
|
||||
//{
|
||||
|
|
@ -318,7 +319,7 @@ namespace AideDeJeuCmd
|
|||
var item = store.ToItem(source, md, store._AllItems);
|
||||
if (item != null)
|
||||
{
|
||||
if(item.NewId == "hd_aasimar_aasimar.md")
|
||||
if (item.NewId == "hd_aasimar_aasimar.md")
|
||||
{
|
||||
Debug.WriteLine("");
|
||||
}
|
||||
|
|
@ -355,6 +356,7 @@ namespace AideDeJeuCmd
|
|||
Console.WriteLine("l : build library");
|
||||
Console.WriteLine("o : check orphan links");
|
||||
Console.WriteLine("p : test pdf");
|
||||
Console.WriteLine("h : extract html");
|
||||
Console.WriteLine("q : quitter");
|
||||
var key = Console.ReadKey(true);
|
||||
switch (key.KeyChar)
|
||||
|
|
@ -368,24 +370,413 @@ namespace AideDeJeuCmd
|
|||
case 'p':
|
||||
await TestPdfAsync();
|
||||
break;
|
||||
case 'h':
|
||||
await ExtractHtmlAsync();
|
||||
break;
|
||||
case 'q':
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static async Task ExtractHtmlAsync()
|
||||
{
|
||||
using (var output = new StreamWriter(@"..\..\..\..\..\Data\tome_of_beasts.md", false, Encoding.UTF8))
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
for (int i = 10; i <= 428; i++)
|
||||
//for (int i = 256; i <= 256; i++)
|
||||
{
|
||||
var doc = new HtmlAgilityPack.HtmlDocument();
|
||||
doc.Load($@"..\..\..\..\..\Ignore\tome_of_beasts\page{i}.html");
|
||||
parser.OutputMarkdown(parser.Parse(doc), output, Console.Error);
|
||||
//parser.OutputMarkdown(parser.Parse(doc), Console.Out, Console.Error);
|
||||
}
|
||||
output.Write("\n<!--/MonsterItem-->\n\n<!--/MonsterItems-->\n");
|
||||
}
|
||||
}
|
||||
|
||||
class HtmlParser
|
||||
{
|
||||
string key = "";
|
||||
string value = "";
|
||||
enum State
|
||||
{
|
||||
Before,
|
||||
Name,
|
||||
Type,
|
||||
TopKeyValues,
|
||||
Abilities,
|
||||
BottomKeyValues,
|
||||
Competencies,
|
||||
Actions,
|
||||
Reactions,
|
||||
|
||||
}
|
||||
|
||||
public class ParsedSpan
|
||||
{
|
||||
public string Text;
|
||||
public string Style;
|
||||
public string IdStyle;
|
||||
public string DivStyle;
|
||||
}
|
||||
public class FullLine : List<ParsedSpan>
|
||||
{
|
||||
}
|
||||
|
||||
public class FullText : List<FullLine>
|
||||
{
|
||||
|
||||
}
|
||||
public FullText Parse(HtmlAgilityPack.HtmlDocument doc)
|
||||
{
|
||||
var styles = doc.DocumentNode.SelectSingleNode("/html/head/style").InnerText.Split('\n');
|
||||
var txtDivs = doc.DocumentNode.SelectNodes("//div[@class='txt']");
|
||||
var fullText = new FullText();
|
||||
var fullLine = new FullLine();
|
||||
if (txtDivs != null)
|
||||
{
|
||||
foreach (var txtDiv in txtDivs)
|
||||
{
|
||||
var spans = txtDiv.Elements("span");
|
||||
for (var i = 0; i < spans.Count(); i++)
|
||||
{
|
||||
var span = spans.ToArray()[i];
|
||||
var spanId = span.GetAttributeValue("id", "");
|
||||
var spanStyle = span.GetAttributeValue("style", "");
|
||||
var spanIdStyle = new string(styles.SingleOrDefault(s => s.StartsWith($"#{spanId} ")).SkipWhile(c => c != '{').ToArray());
|
||||
var divStyle = txtDiv.GetAttributeValue("style", "");
|
||||
var parsedSpan = new ParsedSpan()
|
||||
{
|
||||
Text = span.InnerText.Replace(" ",""),
|
||||
Style = spanStyle,
|
||||
IdStyle = spanIdStyle,
|
||||
DivStyle = divStyle,
|
||||
};
|
||||
if (i == 0)
|
||||
{
|
||||
var previousParsedSpan = fullLine.LastOrDefault();
|
||||
if (previousParsedSpan == null)
|
||||
{
|
||||
var previousFullLine = fullText.LastOrDefault();
|
||||
if (previousFullLine != null)
|
||||
{
|
||||
previousParsedSpan = previousFullLine.LastOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
if (previousParsedSpan != null)
|
||||
{
|
||||
if (previousParsedSpan.Style != parsedSpan.Style || previousParsedSpan.IdStyle != parsedSpan.IdStyle)
|
||||
{
|
||||
fullText.Add(fullLine);
|
||||
fullLine = new FullLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
fullLine.Add(parsedSpan);
|
||||
}
|
||||
}
|
||||
fullText.Add(fullLine);
|
||||
}
|
||||
|
||||
return fullText;
|
||||
}
|
||||
|
||||
string idssnn = "{ font-family:sans-serif; font-weight:normal; font-style:normal; }";
|
||||
string idssni = "{ font-family:sans-serif; font-weight:normal; font-style:italic; }";
|
||||
string idssbn = "{ font-family:sans-serif; font-weight:bold; font-style:normal; }";
|
||||
string idssbi = "{ font-family:sans-serif; font-weight:bold; font-style:italic; }";
|
||||
string idsbn = "{ font-family:serif; font-weight:bold; font-style:normal; }";
|
||||
string idsnn = "{ font-family:serif; font-weight:normal; font-style:normal; }";
|
||||
string idsni = "{ font-family:serif; font-weight:normal; font-style:italic; }";
|
||||
|
||||
string st23_255 = "font-size:23px;vertical-align:baseline;color:rgba(255,207,52,1);";
|
||||
string st16_255 = "font-size:16px;vertical-align:baseline;color:rgba(255,207,52,1);";
|
||||
string st11_255 = "font-size:11px;vertical-align:baseline;color:rgba(255,207,52,1);";
|
||||
string st48_0 = "font-size:48px;vertical-align:baseline;color:rgba(0,0,0,1);";
|
||||
string st14_137 = "font-size:14px;vertical-align:baseline;color:rgba(137,23,26,1);";
|
||||
string st8_0 = "font-size:8px;vertical-align:baseline;color:rgba(0,0,0,1);";
|
||||
string st8_121 = "font-size:8px;vertical-align:baseline;color:rgba(121,27,16,1);";
|
||||
string st8_137 = "font-size:8px;vertical-align:baseline;color:rgba(137,23,26,1);";
|
||||
string st9_203 = "font-size:9px;vertical-align:baseline;color:rgba(203,0,0,1);";
|
||||
|
||||
bool started = false;
|
||||
|
||||
public string MDStyle(string text, string style)
|
||||
{
|
||||
text = text.Trim();
|
||||
if (style.Contains("italic"))
|
||||
{
|
||||
text = $"_{text}_";
|
||||
}
|
||||
if (style.Contains("bold"))
|
||||
{
|
||||
text = $"**{text}**";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
List<KeyValuePair<string, string>> MDSizes = new List<KeyValuePair<string, string>>()
|
||||
{
|
||||
new KeyValuePair<string, string>("Petite/Très Grande", "P/TG"),
|
||||
new KeyValuePair<string, string>("Très Petite", "TP"),
|
||||
new KeyValuePair<string, string>("Très Grande", "TG"),
|
||||
new KeyValuePair<string, string>("Grande", "G"),
|
||||
new KeyValuePair<string, string>("Moyenne", "M"),
|
||||
new KeyValuePair<string, string>("Gigantesque", "Gig"),
|
||||
//new KeyValuePair<string, string>("Moyenne (métamorphe)", "M"),
|
||||
//new KeyValuePair<string, string>("Très Petite taille ", "TP"),
|
||||
new KeyValuePair<string, string>("Petite", "P"),
|
||||
//new KeyValuePair<string, string>("Petite taille (cynome)", "P"),
|
||||
//new KeyValuePair<string, string>("Grande taille d’élémentaires de taille Minuscule", "G"),
|
||||
};
|
||||
|
||||
string ToMDSize(string size)
|
||||
{
|
||||
foreach(var mdsize in MDSizes)
|
||||
{
|
||||
if(size.Contains(mdsize.Key))
|
||||
{
|
||||
return mdsize.Value;
|
||||
}
|
||||
}
|
||||
return size;
|
||||
}
|
||||
public void OutputMarkdown(FullText fullText, TextWriter output, TextWriter error)
|
||||
{
|
||||
var page = fullText.Where(l => l.FirstOrDefault().Style.Contains(st16_255))?.FirstOrDefault()?.FirstOrDefault()?.Text;
|
||||
Console.ForegroundColor = ConsoleColor.Yellow;
|
||||
error.WriteLine($"Page : {page}");
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
string abilities = null;
|
||||
foreach (var line in fullText)
|
||||
{
|
||||
var keySpan = line.FirstOrDefault();
|
||||
string value = "";
|
||||
if (line.Count > 1)
|
||||
{
|
||||
value = line.Skip(1).Select(p => MDStyle(p.Text, p.Style)).Aggregate((p1, p2) => p1.Trim() + " " + p2.Trim());
|
||||
}
|
||||
string text = MDStyle(keySpan.Text, keySpan.Style);
|
||||
Console.ForegroundColor = ConsoleColor.DarkGray;
|
||||
error.Write($"{text}");
|
||||
error.WriteLine($" {value}");
|
||||
|
||||
if (keySpan.Style.Contains(st48_0) && keySpan.IdStyle.Contains(idsnn))
|
||||
{ // titre de page
|
||||
Console.ForegroundColor = ConsoleColor.Blue;
|
||||
error.Write($"{text} {value}\n");
|
||||
}
|
||||
else if (keySpan.Style.Contains(st9_203) && keySpan.IdStyle.Contains(idssnn))
|
||||
{ // bloodmark
|
||||
Console.ForegroundColor = ConsoleColor.Blue;
|
||||
error.Write($"{text} {value}\n");
|
||||
}
|
||||
else if (keySpan.Style.Contains(st16_255) && keySpan.IdStyle.Contains(idsbn))
|
||||
{ // page
|
||||
Console.ForegroundColor = ConsoleColor.Blue;
|
||||
error.Write($"{text} {value}\n");
|
||||
}
|
||||
else if (keySpan.Style.Contains(st8_0) && keySpan.IdStyle.Contains(idsnn))
|
||||
{ // encadré
|
||||
Console.ForegroundColor = ConsoleColor.Blue;
|
||||
error.Write($"{text} {value}\n");
|
||||
}
|
||||
else if (keySpan.Style.Contains(st11_255) && keySpan.IdStyle.Contains(idssnn))
|
||||
{ // nom
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
if(!started)
|
||||
{
|
||||
started = true;
|
||||
output.Write("\n<!--MonsterItems Family=\"TomeOfBeasts\" Types=\"Humanoïde|Aberration|Bête|Céleste|Créature artificielle|Créature monstrueuse|Dragon|Élémentaire|Fée|Fiélon|Géant|Mort-vivant|Plante|Vase\" Challenges=\"0 (0 PX)|1/8 (25 PX)|1/4 (50 PX)|1/2 (100 PX)|1 (200 PX)|2 (450 PX)|3 (700 PX)|4 (1100 PX)|5 (1800 PX)|6 (2300 PX)|7 (2900 PX)|8 (3900 PX)|9 (5000 PX)|10 (5900 PX)|11 (7200 PX)|12 (8400 PX)|13 (10000 PX)|14 (11500 PX)|15 (13000 PX)|16 (15000 PX)|17 (18000 PX)|18 (20000 PX)|19 (22000 PX)|20 (25000 PX)|21 (33000 PX)|22 (41000 PX)|23 (50000 PX)|24 (62000 PX)|30 (155000 PX)\" Sizes=\"TP|P|M|G|TG|Gig\" Sources=\"CEO|SRD\" Terrains=\"Arctique / Subarctique|Bois / Forêt|Collines / Vallées|Désert chaud|Jungle|Littoral|Mangrove / Marécage|Mer / Océan|Montagnes|Plaine / Champs / Prairie / Savane|Plans élémentaires|Caverne aménagée|Caverne naturelle|Caverne sous-marine|Donjon maçonné|Ruines extérieures|Ruines souterraines|Ruines sous-marines\"-->\n\n");
|
||||
output.Write("# <!--Name-->Livre des monstres<!--/Name-->\n\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
output.Write("\n<!--/MonsterItem-->\n\n");
|
||||
}
|
||||
output.Write("<!--MonsterItem Family=\"TomeOfBeasts\"-->\n\n");
|
||||
output.Write($"# <!--Name-->{CultureInfo.CurrentCulture.TextInfo.ToTitleCase(text.ToLower())}<!--/Name-->\n\n- Source: <!--Source-->(LDM p{page})<!--/Source-->\n");
|
||||
}
|
||||
else if (keySpan.Style.Contains(st8_0) && keySpan.IdStyle.Contains(idssni) && text.Contains("taille"))
|
||||
{ // type / size / alignment
|
||||
// todo : découper type / size / alignment
|
||||
var regex = new Regex("^(?<type>.*?) de (taille )?(?<size>.*?)( taille)?, (?<alignment>.*?)$");
|
||||
var match = regex.Match(text);
|
||||
var type = match.Groups["type"].Value;
|
||||
var size = match.Groups["size"].Value;
|
||||
var alignment = match.Groups["alignment"].Value;
|
||||
if (type.Length > 0)
|
||||
{
|
||||
text = text.Replace(type, $"<!--Type-->{type}<!--/Type-->");
|
||||
text = text.Replace(",", $" (<!--Size-->{ToMDSize(size)}<!--/Size-->),");
|
||||
text = text.Replace(alignment, $"<!--Alignment-->{alignment}<!--/Alignment-->");
|
||||
}
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
output.Write($"- {text}\n");
|
||||
}
|
||||
else if (keySpan.Style.Contains(st8_121) && keySpan.IdStyle.Contains(idssbn))
|
||||
{ // key / ...
|
||||
string tag = "";
|
||||
if (KeyTags.ContainsKey(text.Trim()))
|
||||
{
|
||||
tag = KeyTags[text.Trim()];
|
||||
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
output.Write($"- **{text.Trim()}** <!--{tag}-->{value}<!--/{tag}-->\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
//error.WriteLine($"ABILITIES");
|
||||
if (abilities == null)
|
||||
{
|
||||
abilities = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (keySpan.Style.Contains(st8_0) && keySpan.IdStyle.Contains(idssnn))
|
||||
{ // ... / value
|
||||
if (abilities != null)
|
||||
{
|
||||
abilities += text;
|
||||
if(value.Length > 0)
|
||||
{
|
||||
abilities += $" {value}";
|
||||
}
|
||||
if (abilities.Count(c => c == '(') == 6)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
output.Write($"\n|FOR|DEX|CON|INT|SAG|CHA|\n|---|---|---|---|---|---|\n|{abilities.Replace(") ", ")").Replace(")", ")|")}\n\n");
|
||||
abilities = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
output.Write($"{text} {value}\n");
|
||||
}
|
||||
}
|
||||
else if (keySpan.Style.Contains(st14_137) && keySpan.IdStyle.Contains(idsnn))
|
||||
{ // actions / réactions
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
output.Write($"\n## {text}\n{value}\n");
|
||||
}
|
||||
else if (keySpan.Style.Contains(st8_0) && keySpan.IdStyle.Contains(idssnn))
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
output.Write($"{text.Trim()} {value}\n");
|
||||
}
|
||||
else if (keySpan.Style.Contains(st8_0) && keySpan.IdStyle.Contains(idssbi))
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
output.Write($"\n**_{text.Trim()}_** {value}\n");
|
||||
}
|
||||
else if (keySpan.Style.Contains(st8_0) && keySpan.IdStyle.Contains(idssbn))
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
output.Write($"\n**{text.Trim()}** {value}\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
error.Write($"{text} {value}\n");
|
||||
error.Write($"{keySpan.Style}\n");
|
||||
error.Write($"{keySpan.IdStyle}\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StripLine()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Dictionary<string, string> KeyTags = new Dictionary<string, string>()
|
||||
{
|
||||
{ "Jets de sauvegarde", "SavingThrows" },
|
||||
{ "Classe d’armure" , "ArmorClass" },
|
||||
{ "Points de vie", "HitPoints" },
|
||||
{ "Vitesse", "Speed" },
|
||||
{ "Compétences", "Skills" },
|
||||
{ "Sens", "Senses" },
|
||||
{ "Langues", "Languages" },
|
||||
{ "Dangerosité", "Challenge" },
|
||||
{ "Résistance aux dégâts", "DamageResistances" },
|
||||
{ "Immunité contre les dégâts", "DamageImmunities" },
|
||||
{ "Immunité contre les états", "ConditionImmunities" },
|
||||
{ "Immunité contre l’état", "ConditionImmunities" },
|
||||
{ "Vulnérabilité aux dégâts", "DamageVulnerabilities" },
|
||||
//{ "", "" },
|
||||
//{ "", "" },
|
||||
//{ "", "" },
|
||||
//{ "", "" },
|
||||
//{ "", "" },
|
||||
};
|
||||
List<string> KeyCaracs = new List<string>()
|
||||
{
|
||||
"FOR", "DEX", "CON", "INT", "SAG", "CHA"
|
||||
};
|
||||
|
||||
string caracs = null;
|
||||
bool CloseKeyValue()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(key))
|
||||
{
|
||||
if (KeyTags.ContainsKey(key.Trim()))
|
||||
{
|
||||
var tag = KeyTags[key.Trim()];
|
||||
Console.WriteLine($"- **{key.Trim()}** <!--{tag}-->{value.Trim()}<!--/{tag}-->");
|
||||
}
|
||||
else if (KeyCaracs.Contains(key.Trim()))
|
||||
{
|
||||
if (key.Trim() == "FOR")
|
||||
{
|
||||
Console.WriteLine("|FOR|DEX|CON|INT|SAG|CHA|\n|---|---|---|---|---|---|");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine(value);
|
||||
}
|
||||
key = "";
|
||||
value = "";
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
static async Task TestPdfAsync()
|
||||
{
|
||||
Tests.Xamarin.Forms.Mocks.MockForms.Init();
|
||||
SQLitePCL.raw.SetProvider(new SQLitePCL.SQLite3Provider_e_sqlite3());
|
||||
DependencyService.Register<INativeAPI, AideDeJeu.Cmd.Version_CMD>();
|
||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||
//Xamarin.Essentials.Platform.Init(this, bundle);
|
||||
//Xamarin.Essentials.ExperimentalFeatures.Enable(Xamarin.Essentials.ExperimentalFeatures.ShareFileRequest);
|
||||
|
||||
var pc = new AideDeJeu.ViewModels.PlayerCharacter.PlayerCharacterViewModel();
|
||||
var pce = new AideDeJeu.ViewModels.PlayerCharacter.PlayerCharacterEditorViewModel();
|
||||
var stream = new MemoryStream();
|
||||
pce.GeneratePdfToStream(pc, stream);
|
||||
var store = new StoreViewModel();
|
||||
|
||||
var item = await store.GetItemFromDataAsync("spells_hd", "aide");
|
||||
|
||||
using (var context = await StoreViewModel.GetLibraryContextAsync())
|
||||
{
|
||||
var spells = await context.Spells.ToListAsync();
|
||||
|
||||
var pdfService = new PdfService();
|
||||
//var pc = new AideDeJeu.ViewModels.PlayerCharacter.PlayerCharacterViewModel();
|
||||
//var pce = new AideDeJeu.ViewModels.PlayerCharacter.PlayerCharacterEditorViewModel();
|
||||
using (var stream = new FileStream("test.pdf", FileMode.Create))
|
||||
{
|
||||
//pdfService.MarkdownToPdf("# mon titre\n\nhop", stream);
|
||||
pdfService.MarkdownToPdf(spells.Select(s => s.Markdown).Take(3).ToList(), stream);
|
||||
//pdfService.MarkdownToPdf(new List<string>() { item.Markdown }, stream);
|
||||
//var stream = new MemoryStream();
|
||||
//pce.GeneratePdfToStream(pc, stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static async Task BuildLibraryAsync()
|
||||
|
|
@ -670,19 +1061,19 @@ namespace AideDeJeuCmd
|
|||
{
|
||||
//var file = "";
|
||||
var files = new Dictionary<string, string>();
|
||||
foreach(var aalinks in alllinks)
|
||||
foreach (var aalinks in alllinks)
|
||||
{
|
||||
var found = aalinks.Value.FirstOrDefault(t => t.Item2 == Helpers.IdFromName(unlinkedref));
|
||||
if(found != null)
|
||||
if (found != null)
|
||||
{
|
||||
files[found.Item1] = $"{found.Item1}.md";
|
||||
//file = $"{found.Item1}.md";
|
||||
//Console.WriteLine($"[{unlinkedref}]: {file}#{Helpers.IdFromName(unlinkedref)}");
|
||||
}
|
||||
}
|
||||
foreach(var aanchors in allanchors)
|
||||
foreach (var aanchors in allanchors)
|
||||
{
|
||||
if(aanchors.Value.Contains(Helpers.IdFromName(unlinkedref)))
|
||||
if (aanchors.Value.Contains(Helpers.IdFromName(unlinkedref)))
|
||||
{
|
||||
files[aanchors.Key] = $"{aanchors.Key}.md";
|
||||
//file = $"{aanchors.Key}.md";
|
||||
|
|
@ -690,7 +1081,7 @@ namespace AideDeJeuCmd
|
|||
//break;
|
||||
}
|
||||
}
|
||||
if(files.Count == 0)
|
||||
if (files.Count == 0)
|
||||
{
|
||||
files[""] = "";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.4" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.1" />
|
||||
<PackageReference Include="sqlite-net-pcl" Version="1.6.258-beta" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.1.0" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.0.0.425677" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.0.0.497661" />
|
||||
<PackageReference Include="XamiTextSharpLGPLv2" Version="1.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -14,8 +14,9 @@
|
|||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.4" />
|
||||
<PackageReference Include="sqlite-net-pcl" Version="1.6.258-beta" />
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.1" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.1.0" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.0.0.425677" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.0.0.497661" />
|
||||
<PackageReference Include="XamiTextSharpLGPLv2" Version="1.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue