public void Process(MenuStack stack) { bool enabled = User.IsSignedInPSN && sessionCreated && !Commerce.IsBusy(); menu.Update(); if (menu.AddItem("Category Info", enabled)) { SonyNpCommerce.ErrorHandler(Commerce.RequestCategoryInfo(string.Empty)); } if (menu.AddItem("Product List", enabled)) { SonyNpCommerce.ErrorHandler(Commerce.RequestProductList(testCategoryID)); } if (menu.AddItem("Product Info", enabled)) { SonyNpCommerce.ErrorHandler(Commerce.RequestDetailedProductInfo(testProductID)); } if (menu.AddItem("Browse Product", enabled)) { SonyNpCommerce.ErrorHandler(Commerce.BrowseProduct(testProductID)); } if (menu.AddItem("Checkout", enabled)) { Commerce.GetProductList(); SonyNpCommerce.ErrorHandler(Commerce.Checkout(testProductSkuIDs)); } if (menu.AddItem("Redeem Voucher", enabled)) { SonyNpCommerce.ErrorHandler(Commerce.VoucherInput()); } if (menu.AddBackIndex("Back")) { stack.PopMenu(); } }
private void Start() { //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Invalid comparison between Unknown and I4 avatars[0] = new Avatar(GameObject.Find("UserAvatar")); avatars[1] = new Avatar(GameObject.Find("RemoteUserAvatar")); menuMain = new MenuLayout(this, 500, 34); menuStack = new MenuStack(); menuStack.SetMenu(menuMain); Main.OnNPInitialized += OnNPInitialized; OnScreenLog.Add("Initializing NP"); Main.enableInternalLogging = true; Main.OnLog += OnLog; Main.OnLogWarning += OnLogWarning; Main.OnLogError += OnLogError; int kNpToolkitCreate_CacheTrophyIcons = Main.kNpToolkitCreate_CacheTrophyIcons; Main.Initialize(kNpToolkitCreate_CacheTrophyIcons); string sessionImage = Application.streamingAssetsPath + "/PSP2SessionImage.jpg"; Main.SetSessionImage(sessionImage); Sony.NP.System.OnConnectionUp += OnSomeEvent; Sony.NP.System.OnConnectionDown += OnConnectionDown; Sony.NP.System.OnSysResume += OnSomeEvent; Sony.NP.System.OnSysNpMessageArrived += OnSomeEvent; Sony.NP.System.OnSysStorePurchase += OnSomeEvent; Sony.NP.System.OnSysStoreRedemption += OnSomeEvent; Sony.NP.System.OnSysEvent += OnSomeEvent; Messaging.OnSessionInviteMessageRetrieved += OnMessagingSessionInviteRetrieved; Messaging.OnMessageSessionInviteReceived += OnMessagingSessionInviteReceived; Messaging.OnMessageSessionInviteAccepted += OnMessagingSessionInviteAccepted; User.OnSignedIn += OnSignedIn; User.OnSignedOut += OnSomeEvent; User.OnSignInError += OnSignInError; user = new SonyNpUser(); friends = new SonyNpFriends(); trophies = new SonyNpTrophy(); ranking = new SonyNpRanking(); sessions = new SonyNpSession(); messaging = new SonyNpMessaging(); commerce = new SonyNpCommerce(); cloudStorage = new SonyNpCloud(); utilities = new SonyNpUtilities(); Utility.SkuFlags skuFlags = Utility.skuFlags; if ((int)skuFlags == 1) { OnScreenLog.Add("Trial Mode, purchase the full app to get extra features."); } }
public void Process(MenuStack stack) { bool enabled = User.get_IsSignedInPSN() && !Commerce.IsBusy(); this.menu.Update(); if (this.menu.AddItem("Browse Category", enabled)) { SonyNpCommerce.ErrorHandler(Commerce.BrowseCategory(string.Empty)); } if (this.menu.AddBackIndex("Back", true)) { stack.PopMenu(); } }
private void Start() { SonyNpMain.avatars[0] = new SonyNpMain.Avatar(GameObject.Find("UserAvatar")); SonyNpMain.avatars[1] = new SonyNpMain.Avatar(GameObject.Find("RemoteUserAvatar")); this.menuMain = new MenuLayout(this, 500, 34); this.menuStack = new MenuStack(); this.menuStack.SetMenu(this.menuMain); Main.add_OnNPInitialized(new Messages.EventHandler(this.OnNPInitialized)); OnScreenLog.Add("Initializing NP"); Main.set_enableInternalLogging(true); Main.add_OnLog(new Messages.EventHandler(this.OnLog)); Main.add_OnLogWarning(new Messages.EventHandler(this.OnLogWarning)); Main.add_OnLogError(new Messages.EventHandler(this.OnLogError)); int kNpToolkitCreate_CacheTrophyIcons = Main.kNpToolkitCreate_CacheTrophyIcons; Main.Initialize(kNpToolkitCreate_CacheTrophyIcons); string sessionImage = Application.get_streamingAssetsPath() + "/PSP2SessionImage.jpg"; Main.SetSessionImage(sessionImage); System.add_OnConnectionUp(new Messages.EventHandler(this.OnSomeEvent)); System.add_OnConnectionDown(new Messages.EventHandler(this.OnConnectionDown)); System.add_OnSysResume(new Messages.EventHandler(this.OnSomeEvent)); System.add_OnSysNpMessageArrived(new Messages.EventHandler(this.OnSomeEvent)); System.add_OnSysStorePurchase(new Messages.EventHandler(this.OnSomeEvent)); System.add_OnSysStoreRedemption(new Messages.EventHandler(this.OnSomeEvent)); System.add_OnSysEvent(new Messages.EventHandler(this.OnSomeEvent)); Messaging.add_OnSessionInviteMessageRetrieved(new Messages.EventHandler(this.OnMessagingSessionInviteRetrieved)); Messaging.add_OnMessageSessionInviteReceived(new Messages.EventHandler(this.OnMessagingSessionInviteReceived)); Messaging.add_OnMessageSessionInviteAccepted(new Messages.EventHandler(this.OnMessagingSessionInviteAccepted)); User.add_OnSignedIn(new Messages.EventHandler(this.OnSignedIn)); User.add_OnSignedOut(new Messages.EventHandler(this.OnSomeEvent)); User.add_OnSignInError(new Messages.EventHandler(this.OnSignInError)); this.user = new SonyNpUser(); this.friends = new SonyNpFriends(); this.trophies = new SonyNpTrophy(); this.ranking = new SonyNpRanking(); this.sessions = new SonyNpSession(); this.messaging = new SonyNpMessaging(); this.commerce = new SonyNpCommerce(); this.cloudStorage = new SonyNpCloud(); this.utilities = new SonyNpUtilities(); Utility.SkuFlags skuFlags = Utility.get_skuFlags(); if (skuFlags == 1) { OnScreenLog.Add("Trial Mode, purchase the full app to get extra features."); } }
private void OnGotCategoryInfo(Messages.PluginMessage msg) { OnScreenLog.Add("Got Category Info"); Commerce.CommerceCategoryInfo categoryInfo = Commerce.GetCategoryInfo(); OnScreenLog.Add("Category Id: " + categoryInfo.categoryId); OnScreenLog.Add("Category Name: " + categoryInfo.categoryName); OnScreenLog.Add("Category num products: " + categoryInfo.countOfProducts); OnScreenLog.Add("Category num sub categories: " + categoryInfo.countOfSubCategories); for (int i = 0; i < categoryInfo.countOfSubCategories; i++) { Commerce.CommerceCategoryInfo subCategoryInfo = Commerce.GetSubCategoryInfo(i); OnScreenLog.Add("SubCategory Id: " + subCategoryInfo.categoryId); OnScreenLog.Add("SubCategory Name: " + subCategoryInfo.categoryName); if (i == 0) { SonyNpCommerce.ErrorHandler(Commerce.RequestCategoryInfo(subCategoryInfo.categoryId)); } } }
public void Process(MenuStack stack) { bool enabled = User.get_IsSignedInPSN() && !Commerce.IsBusy(); this.menu.Update(); if (this.menu.AddItem("Get Entitlement List", enabled)) { SonyNpCommerce.ErrorHandler(Commerce.RequestEntitlementList()); } if (this.menu.AddItem("Consume Entitlement", enabled)) { Commerce.CommerceEntitlement[] entitlementList = Commerce.GetEntitlementList(); if (entitlementList.Length > 0) { SonyNpCommerce.ErrorHandler(Commerce.ConsumeEntitlement(entitlementList[0].get_id(), entitlementList[0].remainingCount)); } } if (this.menu.AddBackIndex("Back", true)) { stack.PopMenu(); } }
public void CreateSession() { SonyNpCommerce.ErrorHandler(Commerce.CreateSession()); }
private void OnCommerceError(Messages.PluginMessage msg) { SonyNpCommerce.ErrorHandler(3); }