Skip to content

Commit

Permalink
progress toward purchase products
Browse files Browse the repository at this point in the history
  • Loading branch information
duchuule committed Aug 22, 2015
1 parent 4985445 commit 437db67
Show file tree
Hide file tree
Showing 23 changed files with 281 additions and 141 deletions.
6 changes: 3 additions & 3 deletions App.xaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ void App::CheckProductLicense()
IsPremium = false;


if (CurrentApp::LicenseInformation->ProductLicenses->Lookup("noads_premium")->IsActive)
if (CurrentAppSimulator::LicenseInformation->ProductLicenses->Lookup("noads_premium")->IsActive)
{
HasAds = false;
IsPremium = true;
return; //no need to check for other 2 licenses
}

if (CurrentApp::LicenseInformation->ProductLicenses->Lookup("removeads")->IsActive)
if (CurrentAppSimulator::LicenseInformation->ProductLicenses->Lookup("removeads")->IsActive)
HasAds = false;

if (CurrentApp::LicenseInformation->ProductLicenses->Lookup("premiumfeatures")->IsActive)
if (CurrentAppSimulator::LicenseInformation->ProductLicenses->Lookup("premiumfeatures")->IsActive)
IsPremium = true;


Expand Down
4 changes: 2 additions & 2 deletions App.xaml.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ namespace VBA10
static Platform::String^ ExportFolderID;
static bool HasAds;
static bool IsPremium;

static void CheckProductLicense();


private:
void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
void OnResuming(Platform::Object ^sender, Platform::Object ^args);
void CheckProductLicense();

DirectXPage^ m_directXPage;


Expand Down
5 changes: 2 additions & 3 deletions CheatPane.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
d:DesignWidth="600">


<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" >
<Grid x:Name="LayoutRoot" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
Expand Down Expand Up @@ -209,7 +209,6 @@
</RelativePanel>
</ScrollViewer>

<local:AdControl Grid.Row="2">
</local:AdControl>

</Grid>
</Page>
11 changes: 10 additions & 1 deletion CheatPane.xaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include "stringhelper.h"
#include <string>
#include <sstream>
#include "AdControl.xaml.h"
#include "App.xaml.h"

using namespace std;

Expand All @@ -35,7 +37,14 @@ using namespace Windows::UI::Popups;
CheatPane::CheatPane()
{
InitializeComponent();


//create ad control
if (App::HasAds)
{
AdControl^ adControl = ref new AdControl();
LayoutRoot->Children->Append(adControl);
adControl->SetValue(Grid::RowProperty, 2);
}

if (IsROMLoaded())
{
Expand Down
3 changes: 2 additions & 1 deletion Emulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <GBA.h>
#include <Util.h>
#include <SoundDriver.h>
#include "App.xaml.h"


using namespace Platform;
Expand Down Expand Up @@ -328,7 +329,7 @@ namespace VBA10
this->xboxElapsed += timeDelta;

#ifndef NO_XBOX
if (xboxElapsed < 3600.0f)
if (xboxElapsed < 3600.0f || App::IsPremium)
{
this->p1Controller->Update();
this->HidInput->Update(true);
Expand Down
5 changes: 2 additions & 3 deletions ExportPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
mc:Ignorable="d"
Loaded="Page_Loaded">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid x:Name="LayoutRoot" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
Expand Down Expand Up @@ -70,7 +70,6 @@
</StackPanel>
</ScrollViewer>

<local:AdControl Grid.Row="2">
</local:AdControl>

</Grid>
</Page>
9 changes: 9 additions & 0 deletions ExportPage.xaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "SelectFilesPane.xaml.h"
#include "Definitions.h"
#include "ppltasks_extra.h"
#include "AdControl.xaml.h"


using namespace VBA10;
Expand All @@ -31,6 +32,14 @@ using namespace Windows::UI::Popups;
ExportPage::ExportPage()
{
InitializeComponent();

//create ad control
if (App::HasAds)
{
AdControl^ adControl = ref new AdControl();
LayoutRoot->Children->Append(adControl);
adControl->SetValue(Grid::RowProperty, 2);
}
}


Expand Down
4 changes: 3 additions & 1 deletion FileBrowserPane.xaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "FileBrowserPane.xaml.h"
#include "App.xaml.h"
#include "stringhelper.h"
#include <algorithm>

using namespace VBA10;

Expand Down Expand Up @@ -111,7 +112,7 @@ void FileBrowserPane::client_GetCompleted(web::json::value v)
//get extension
int index = name.find_last_of('.');
wstring ext = name.substr(index + 1);

transform(ext.begin(), ext.end(), ext.begin(), ::tolower);
a->Type = GetOneDriveItemType(ext); //default, will change below
}

Expand Down Expand Up @@ -372,6 +373,7 @@ void FileBrowserPane::OnNavigatingFrom(Windows::UI::Xaml::Navigation::Navigating

OneDriveItemType FileBrowserPane::GetOneDriveItemType(wstring ext)
{

if (ext == L"zip" || ext == L"zib")
{
return OneDriveItemType::Zip;
Expand Down
6 changes: 3 additions & 3 deletions HelpPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
x:Name="LayoutRoot">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
Expand Down Expand Up @@ -107,8 +108,7 @@
</PivotItem>
</Pivot>

<local:AdControl Grid.Row="2">
</local:AdControl>


</Grid>
</Page>
12 changes: 11 additions & 1 deletion HelpPage.xaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
// Implementation of the HelpPage class
//


#include "pch.h"
#include "App.xaml.h"
#include "HelpPage.xaml.h"
#include <ppltasks.h>
#include "AdControl.xaml.h"

using namespace VBA10;

Expand All @@ -26,6 +28,14 @@ HelpPage::HelpPage()
{
InitializeComponent();

//create ad control
if (App::HasAds)
{
AdControl^ adControl = ref new AdControl();
LayoutRoot->Children->Append(adControl);
adControl->SetValue(Grid::RowProperty, 2);
}

//get version
auto myPackage = Windows::ApplicationModel::Package::Current;
auto version = myPackage->Id->Version;
Expand Down
6 changes: 3 additions & 3 deletions ImportPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
Loaded="Page_Loaded"
d:DesignWidth="320">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
x:Name="LayoutRoot">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
Expand Down Expand Up @@ -100,7 +101,6 @@
</StackPanel>
</ScrollViewer>

<local:AdControl Grid.Row="2">
</local:AdControl>

</Grid>
</Page>
9 changes: 9 additions & 0 deletions ImportPage.xaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "SelectFilesPane.xaml.h"
#include "App.xaml.h"
#include "FileBrowserPane.xaml.h"
#include "AdControl.xaml.h"

#include "stringhelper.h"

Expand Down Expand Up @@ -40,6 +41,14 @@ using namespace Concurrency;
ImportPage::ImportPage()
{
InitializeComponent();

//create ad control
if (App::HasAds)
{
AdControl^ adControl = ref new AdControl();
LayoutRoot->Children->Append(adControl);
adControl->SetValue(Grid::RowProperty, 2);
}
}


Expand Down
7 changes: 1 addition & 6 deletions Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<DeviceCapability Name="humaninterfacedevice">
<Device Id="any">
<Function Type="usage:0001 0004" /> <!--joy stick-->
<Function Type="usage:0001 0005" /> <!--gamepad-->
</Device>
</DeviceCapability>
<DeviceCapability Name="humaninterfacedevice" />
</Capabilities>
</Package>
24 changes: 20 additions & 4 deletions PurchasePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
mc:Ignorable="d"
d:DesignWidth="280">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
x:Name="LayoutRoot">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
Expand All @@ -35,9 +36,25 @@
Margin="0,8,0,0"
/>-->
<TextBlock TextWrapping="Wrap"
Text="The ability to purchase products will come in a future release. NOTE: there will be a way for paid users and users with unlock codes of VBA8, VBA8+ and VGBC8 to unlock VBA10 features without paying again. Stay tune!"
Text="To VBA8, VBA8+ and VGBC8 users: if you have paid or have received unlocked codes for one of these apps, please go to the Purchase page of the respective app and follow instruction to get VBA10 unlock codes."
Margin=" 0, 4, 0, 4" />

<TextBlock Text="Loading production list. Please wait..."
TextWrapping="Wrap"
Margin="0,48,0,12"
Visibility="Visible"
x:Name="txtLoading"

/>

<TextBlock Text="Error! No Internet connection or Microsoft server error. Please try again later."
TextWrapping="Wrap"
Margin="0,0,0,12"
Foreground="Red"
Visibility="Collapsed"
x:Name="txtError"
/>

<!--<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
Expand Down Expand Up @@ -103,7 +120,6 @@
</StackPanel>
</ScrollViewer>

<local:AdControl Grid.Row="2">
</local:AdControl>

</Grid>
</Page>
Loading

0 comments on commit 437db67

Please sign in to comment.