Skip to content

Commit

Permalink
Version 1.4.2. Advertising system changed from AdMediator to AdContro…
Browse files Browse the repository at this point in the history
…l because AdMediator is no longer supported by Microsoft.
  • Loading branch information
NikolayIT committed Oct 13, 2016
1 parent 805c5cf commit 424f4ef
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\ARM\Release\Upload\Santase.UI.WindowsUniversal_1.4.1.0_ARM.appx
MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\ARM\Release\Upload\Santase.UI.WindowsUniversal_1.4.2.0_ARM.appx
SymbolPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\AppPackages\Santase.UI.WindowsUniversal_1.4.2.0\Santase.UI.WindowsUniversal_1.4.2.0_ARM.appxsym
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\x64\Release\Upload\Santase.UI.WindowsUniversal_1.4.1.0_x64.appx
MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\x64\Release\Upload\Santase.UI.WindowsUniversal_1.4.2.0_x64.appx
SymbolPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\AppPackages\Santase.UI.WindowsUniversal_1.4.2.0\Santase.UI.WindowsUniversal_1.4.2.0_x64.appxsym
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\x86\Release\Upload\Santase.UI.WindowsUniversal_1.4.1.0_x86.appx
MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\x86\Release\Upload\Santase.UI.WindowsUniversal_1.4.2.0_x86.appx
SymbolPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\AppPackages\Santase.UI.WindowsUniversal_1.4.2.0\Santase.UI.WindowsUniversal_1.4.2.0_x86.appxsym
4 changes: 2 additions & 2 deletions Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/arm.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\ARM\Release\Santase.UI.WindowsUniversal_1.4.1.0_ARM.appx
SymbolPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\AppPackages\Santase.UI.WindowsUniversal_1.4.1.0_Test\Santase.UI.WindowsUniversal_1.4.1.0_ARM.appxsym
MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\ARM\Release\Santase.UI.WindowsUniversal_1.4.2.0_ARM.appx
SymbolPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\AppPackages\Santase.UI.WindowsUniversal_1.4.2.0_Test\Santase.UI.WindowsUniversal_1.4.2.0_ARM.appxsym
4 changes: 2 additions & 2 deletions Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/x64.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\x64\Release\Santase.UI.WindowsUniversal_1.4.1.0_x64.appx
SymbolPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\AppPackages\Santase.UI.WindowsUniversal_1.4.1.0_Test\Santase.UI.WindowsUniversal_1.4.1.0_x64.appxsym
MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\x64\Release\Santase.UI.WindowsUniversal_1.4.2.0_x64.appx
SymbolPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\AppPackages\Santase.UI.WindowsUniversal_1.4.2.0_Test\Santase.UI.WindowsUniversal_1.4.2.0_x64.appxsym
4 changes: 2 additions & 2 deletions Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/x86.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\x86\Release\Santase.UI.WindowsUniversal_1.4.1.0_x86.appx
SymbolPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\AppPackages\Santase.UI.WindowsUniversal_1.4.1.0_Test\Santase.UI.WindowsUniversal_1.4.1.0_x86.appxsym
MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\x86\Release\Santase.UI.WindowsUniversal_1.4.2.0_x86.appx
SymbolPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\AppPackages\Santase.UI.WindowsUniversal_1.4.2.0_Test\Santase.UI.WindowsUniversal_1.4.2.0_x86.appxsym
8 changes: 3 additions & 5 deletions Source/UI/Santase.UI.WindowsUniversal/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
xmlns:local="using:Santase.UI.WindowsUniversal"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:universal="using:Microsoft.AdMediator.Universal"
x:Class="Santase.UI.WindowsUniversal.MainPage"
mc:Ignorable="d" Background="DarkGreen">
<Grid>
<Grid x:Name="MainGrid">
<Grid.RowDefinitions>
<RowDefinition Height="7*"/>
<RowDefinition Height="20*"/>
<RowDefinition Height="8*"/>
<RowDefinition Height="100"/>
<RowDefinition Height="90"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20*"/>
Expand Down Expand Up @@ -56,8 +55,7 @@
<TextBlock x:Name="PlayerRoundPoints" Grid.Row="1" Grid.Column="3" HorizontalAlignment="Right" TextWrapping="Wrap" Text="0" VerticalAlignment="Bottom" FontSize="32" FontWeight="Bold" Foreground="WhiteSmoke"/>
<TextBlock x:Name="OtherPlayerTotalPoints" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" TextWrapping="Wrap" Text="0" VerticalAlignment="Top" FontSize="36" FontWeight="ExtraBold" Foreground="WhiteSmoke"/>
<TextBlock x:Name="PlayerTotalPoints" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" TextWrapping="Wrap" Text="0" VerticalAlignment="Bottom" FontSize="36" FontWeight="ExtraBold" Foreground="WhiteSmoke"/>
<universal:AdMediatorControl Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="5" HorizontalAlignment="Stretch" Id="AdMediator-Id-9EF27C9E-AEA0-4FC0-9307-462B7AA56267" VerticalAlignment="Stretch"/>
<TextBlock x:Name="ProgramVersion" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Stretch" TextWrapping="Wrap" Text="Santase v1.4.1" VerticalAlignment="Top" FontSize="20" Foreground="Azure" FontWeight="Bold"/>
<TextBlock x:Name="ProgramVersion" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Stretch" TextWrapping="Wrap" Text="Santase v1.4.2" VerticalAlignment="Top" FontSize="20" Foreground="Azure" FontWeight="Bold"/>
<TextBlock x:Name="TotalResult" Grid.Row="0" Grid.Column="4" HorizontalAlignment="Right" TextWrapping="Wrap" Text="0-0" VerticalAlignment="Top" FontSize="22" Foreground="WhiteSmoke" FontWeight="ExtraBold"/>
</Grid>
</Page>
47 changes: 47 additions & 0 deletions Source/UI/Santase.UI.WindowsUniversal/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,26 @@
using System.Linq;
using System.Threading.Tasks;

using Microsoft.Advertising.WinRT.UI;

using Santase.AI.SmartPlayer;
using Santase.Logic.Cards;
using Santase.Logic.GameMechanics;
using Santase.Logic.Players;

using Windows.System.Profile;
using Windows.UI.Core;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;

public sealed partial class MainPage
{
private const string WApplicationId = "6118df2d-165d-41e3-8d27-c41e1a9b7747";
private const string WAdUnitId = "247332";
private const string MApplicationId = "5a691b07-171c-4390-a623-63dd1d3a1d47";
private const string MAdUnitId = "247334";

private readonly UiPlayer uiPlayer;

private readonly SantaseGame game;
Expand All @@ -24,10 +33,14 @@ public sealed partial class MainPage

private readonly CardControl[] playerCardControls;

private AdControl adControl;

public MainPage()
{
this.InitializeComponent();

this.InitializeAdControl();

this.resultPersister = new TotalResultPersister();
this.TotalResult.Text =
$"{this.resultPersister.PlayerScore}-{this.resultPersister.OtherPlayerScore}";
Expand Down Expand Up @@ -63,6 +76,39 @@ public MainPage()
Task.Run(() => this.game.Start());
}

private void InitializeAdControl()
{
// Initialize the AdControl.
this.adControl = new AdControl
{
IsAutoRefreshEnabled = true,
HorizontalAlignment = HorizontalAlignment.Stretch,
VerticalAlignment = VerticalAlignment.Stretch
};

// For mobile device families, use the mobile ad unit info.
if (AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Mobile")
{
this.adControl.ApplicationId = MApplicationId;
this.adControl.AdUnitId = MAdUnitId;
this.adControl.Width = 480;
this.adControl.Height = 80;
}
else
{
this.adControl.ApplicationId = WApplicationId;
this.adControl.AdUnitId = WAdUnitId;
this.adControl.Width = 728;
this.adControl.Height = 90;
}

this.adControl.SetValue(Grid.RowProperty, 3);
this.adControl.SetValue(Grid.ColumnProperty, 0);
this.adControl.SetValue(Grid.ColumnSpanProperty, 5);

this.MainGrid.Children.Add(this.adControl);
}

private void PlayerCardTapped(object sender, TappedRoutedEventArgs eventArgs)
{
this.uiPlayer.Action(PlayerAction.PlayCard((sender as CardControl)?.Card));
Expand Down Expand Up @@ -117,6 +163,7 @@ private void UiPlayerOnRedrawPlayerPlayedCard(object sender, Card card)
//// this.PlayerCard.SetCard(card);
//// }
});

//// Task.Delay(2000);
}

Expand Down
2 changes: 1 addition & 1 deletion Source/UI/Santase.UI.WindowsUniversal/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
<Identity Name="33379NikolayKostov.Santase" Publisher="CN=55564A70-3FC4-4AA9-B0AC-B0943F3261F0" Version="1.4.1.0" />
<Identity Name="33379NikolayKostov.Santase" Publisher="CN=55564A70-3FC4-4AA9-B0AC-B0943F3261F0" Version="1.4.2.0" />
<mp:PhoneIdentity PhoneProductId="28afd61e-cd46-4565-b1c4-b15e1b61c62d" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>Santase</DisplayName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.1.0")]
[assembly: AssemblyFileVersion("1.4.1.0")]
[assembly: AssemblyVersion("1.4.2.0")]
[assembly: AssemblyFileVersion("1.4.2.0")]
[assembly: ComVisible(false)]
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<AssemblyName>Santase.UI.WindowsUniversal</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.10586.0</TargetPlatformVersion>
<TargetPlatformVersion>10.0.14393.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
Expand Down Expand Up @@ -187,9 +187,6 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<SDKReference Include="Microsoft.AdMediator.Universal, Version=1.0">
<Name>Microsoft.AdMediator.Universal</Name>
</SDKReference>
<SDKReference Include="Microsoft.Advertising.Xaml, Version=10.0">
<Name>Microsoft Advertising SDK for XAML</Name>
</SDKReference>
Expand Down
2 changes: 1 addition & 1 deletion Source/UI/Santase.UI.WindowsUniversal/_pkginfo.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\AppPackages\Santase.UI.WindowsUniversal_1.4.1.0\Santase.UI.WindowsUniversal_1.4.1.0_x86_x64_arm.appxbundle
C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\AppPackages\Santase.UI.WindowsUniversal_1.4.2.0\Santase.UI.WindowsUniversal_1.4.2.0_x86_x64_arm.appxbundle

0 comments on commit 424f4ef

Please sign in to comment.