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();
        }
    }
Example #2
0
 public void UserSubMenu(VRCExpressionsMenu subMenu, string paramName, float wantedValue)
 {
     MenuStack.Add(new MenuConditional(subMenu, new LyumaAv3Runtime.FloatParam {
         name = paramName, value = wantedValue
     }));
     DoSetRuntimeX(paramName, wantedValue);
 }
Example #3
0
    private void Awake()
    {
        if (Instance != null && Instance != this)
        {
            Destroy(gameObject);
            return;
        }
        Instance = this;

        _gameTime = Resources.Load <GameTime>("GameTime");
        if (_gameTime == null)
        {
            Debug.LogError("GameTime not found");
        }

        _menuStack = Resources.Load <MenuStack>("MenuStack");
        if (_menuStack == null)
        {
            Debug.LogError("MenuStack not found");
        }

        _gameData = Resources.Load <GameData>("GameData");
        if (_menuStack == null)
        {
            Debug.LogError("GameData not found");
        }

        _gameData.EnsureUISceneLoaded();
    }
    public void Process(MenuStack stack)
    {
        bool enabled = User.get_IsSignedInPSN() && !Commerce.IsBusy();

        this.menu.Update();
        if (this.menu.AddItem("Store", enabled))
        {
            stack.PushMenu(this.store.GetMenu());
        }
        if (this.menu.AddItem("In Game Store", true))
        {
            stack.PushMenu(this.inGameStore.GetMenu());
        }
        if (this.menu.AddItem("Downloads", true))
        {
            Commerce.DisplayDownloadList();
        }
        if (this.menu.AddItem("Entitlements", true))
        {
            stack.PushMenu(this.entitlements.GetMenu());
        }
        if (this.menu.AddItem("Find Installed Content", true))
        {
            this.EnumerateDRMContent();
        }
        if (this.menu.AddBackIndex("Back", true))
        {
            stack.PopMenu();
        }
    }
Example #5
0
    public void MenuUser(MenuStack menuStack)
    {
        bool isSignedInPSN = User.IsSignedInPSN;

        menuUser.Update();
        if (menuUser.AddItem("Get My Profile", !User.IsUserProfileBusy) && User.RequestUserProfile() != 0)
        {
            ResultCode result = default(ResultCode);
            User.GetLastUserProfileError(out result);
            OnScreenLog.Add(result.className + ": " + result.lastError + ", sce error 0x" + result.lastErrorSCE.ToString("X8"));
        }
        if (menuUser.AddItem("Get Remote Profile (onlineID)", isSignedInPSN && !User.IsUserProfileBusy) && User.RequestRemoteUserProfileForOnlineID(remoteOnlineID) != 0)
        {
            ResultCode result2 = default(ResultCode);
            User.GetLastUserProfileError(out result2);
            OnScreenLog.Add(result2.className + ": " + result2.lastError + ", sce error 0x" + result2.lastErrorSCE.ToString("X8"));
        }
        if (menuUser.AddItem("Get Remote NpID", isSignedInPSN && !User.IsUserProfileBusy) && User.RequestRemoteUserNpID(remoteOnlineID) != 0)
        {
            ResultCode result3 = default(ResultCode);
            User.GetLastUserProfileError(out result3);
            OnScreenLog.Add(result3.className + ": " + result3.lastError + ", sce error 0x" + result3.lastErrorSCE.ToString("X8"));
        }
        if (menuUser.AddItem("Get Remote Profile (npID)", remoteNpID != null && isSignedInPSN && !User.IsUserProfileBusy) && User.RequestRemoteUserProfileForNpID(remoteNpID) != 0)
        {
            ResultCode result4 = default(ResultCode);
            User.GetLastUserProfileError(out result4);
            OnScreenLog.Add(result4.className + ": " + result4.lastError + ", sce error 0x" + result4.lastErrorSCE.ToString("X8"));
        }
        if (menuUser.AddBackIndex("Back"))
        {
            menuStack.PopMenu();
        }
    }
    public void Process(MenuStack stack)
    {
        bool enabled = User.IsSignedInPSN && !Commerce.IsBusy();

        menu.Update();
        if (menu.AddItem("Store", enabled))
        {
            stack.PushMenu(store.GetMenu());
        }
        if (menu.AddItem("In Game Store"))
        {
            stack.PushMenu(inGameStore.GetMenu());
        }
        if (menu.AddItem("Downloads"))
        {
            Commerce.DisplayDownloadList();
        }
        if (menu.AddItem("Entitlements"))
        {
            stack.PushMenu(entitlements.GetMenu());
        }
        if (menu.AddItem("Find Installed Content"))
        {
            EnumerateDRMContent();
        }
        if (menu.AddBackIndex("Back"))
        {
            stack.PopMenu();
        }
    }
    public void Process(MenuStack stack)
    {
        menuTicketing.Update();
        bool enabled = User.IsSignedInPSN && !Ticketing.IsBusy();

        if (menuTicketing.AddItem("Request Ticket", enabled))
        {
            ErrorHandler(Ticketing.RequestTicket());
        }
        if (menuTicketing.AddItem("Request Cached Ticket", enabled))
        {
            ErrorHandler(Ticketing.RequestCachedTicket());
        }
        if (menuTicketing.AddItem("Get Ticket Entitlements", gotTicket))
        {
            Ticketing.TicketEntitlement[] ticketEntitlements = Ticketing.GetTicketEntitlements(ticket);
            OnScreenLog.Add("Ticket contains " + ticketEntitlements.Length + " entitlements");
            for (int i = 0; i < ticketEntitlements.Length; i++)
            {
                OnScreenLog.Add("Entitlement " + i);
                OnScreenLog.Add(" " + ticketEntitlements[i].id + " rc: " + ticketEntitlements[i].remainingCount + " cc: " + ticketEntitlements[i].consumedCount + " type: " + ticketEntitlements[i].type);
            }
        }
        if (menuTicketing.AddBackIndex("Back"))
        {
            stack.PopMenu();
        }
    }
    private void Awake()
    {
        _gameTime = Resources.Load <GameTime>("GameTime");
        if (_gameTime == null)
        {
            Debug.LogError("GameTime not found");
        }
        _menuStack = Resources.Load <MenuStack>("MenuStack");
        if (_menuStack == null)
        {
            Debug.LogError("MenuStack not found");
        }
        _gamedata = Resources.Load <GameData>("GameData");
        if (_gamedata == null)
        {
            Debug.LogError("GameData not found");
        }

        if (Application.platform == RuntimePlatform.WebGLPlayer)
        {
            _quitButton.gameObject.SetActive(false);
        }
        if (!Input.mousePresent)
        {
            EventSystem.current.SetSelectedGameObject(GameObject.Find("NewGameButton").gameObject);
        }

        AudioManager.PlayMusic(AudioClips.game_jam_ludum_dare_piano_nocturne_BASE);
    }
Example #9
0
 public void Process(MenuStack stack)
 {
     menu.Update();
     if (menu.AddBackIndex("Back"))
     {
         stack.PopMenu();
     }
 }
Example #10
0
 public void Process(MenuStack stack)
 {
     this.menu.Update();
     if (this.menu.AddBackIndex("Back", true))
     {
         stack.PopMenu();
     }
 }
Example #11
0
 private void Awake()
 {
     _menuStack = Resources.Load <MenuStack>("MenuStack");
     if (_menuStack == null)
     {
         Debug.LogError("MenuStack not found");
     }
 }
Example #12
0
    private void Start()
    {
        // Initialize & configure network.
        NetworkTransport.Init();

        MenuStack = new MenuStack();
        EnterMainMenu();
    }
Example #13
0
        public void Init(Transform character, Transform camera)
        {
            m_CharacterTargetRot = character.localRotation;
            m_CameraTargetRot    = camera.localRotation;

            m_menuStack = Resources.Load <MenuStack>("MenuStack");
            if (m_menuStack == null)
            {
                Debug.LogError("MenuStack not found");
            }
        }
Example #14
0
        public MainContainer(TabbedViewContainer mainStack, MenuStack menuStack)
            : base(Containers.Main.ToString())
        {
            page = new MasterDetailPage();
            var mdp = new MasterDetailProxy(page);

            NativeView  = mdp.View;
            Proxy       = mdp;
            DetailStack = mainStack;
            MasterStack = menuStack;
            RegionMapping.Add(Regions.Menu, ContainerType.Master);
            RegionMapping.Add(Regions.Main, ContainerType.Detail);
        }
Example #15
0
    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();
        }
    }
Example #17
0
 public void MenuFriends(MenuStack menuStack)
 {
     this.menuFriends.Update();
     if (this.menuFriends.AddItem("Friends", User.get_IsSignedInPSN() && !Friends.FriendsListIsBusy()))
     {
         this.ErrorHandlerFriends(Friends.RequestFriendsList());
     }
     if (this.menuFriends.AddItem("Set Presence", User.get_IsSignedInPSN() && !User.OnlinePresenceIsBusy()))
     {
         this.ErrorHandlerPresence(User.SetOnlinePresence("Testing UnityNpToolkit"));
     }
     if (this.menuFriends.AddItem("Clear Presence", User.get_IsSignedInPSN() && !User.OnlinePresenceIsBusy()))
     {
         this.ErrorHandlerPresence(User.SetOnlinePresence(string.Empty));
     }
     if (this.menuFriends.AddItem("Post On Facebook", User.get_IsSignedInPSN() && !Facebook.IsBusy()))
     {
         this.ErrorHandlerFacebook(Facebook.PostMessage(new Facebook.PostFacebook
         {
             appID            = 701792156521339L,
             userText         = "I'm testing Unity's facebook integration !",
             photoURL         = "http://uk.playstation.com/media/RZXT_744/159/PlayStationNetworkFeaturedImage.jpg",
             photoTitle       = "Title",
             photoCaption     = "This is the caption",
             photoDescription = "This is the description",
             actionLinkName   = "Go To Unity3d.com",
             actionLinkURL    = "http://unity3d.com/"
         }));
     }
     if (this.menuFriends.AddItem("Post On Twitter", User.get_IsSignedInPSN() && !Twitter.IsBusy()))
     {
         this.ErrorHandlerTwitter(Twitter.PostMessage(new Twitter.PostTwitter
         {
             userText             = "I'm testing Unity's Twitter integration !",
             imagePath            = Application.get_streamingAssetsPath() + "/TweetUnity.png",
             forbidAttachPhoto    = false,
             disableEditTweetMsg  = true,
             forbidOnlyImageTweet = false,
             forbidNoImageTweet   = false,
             disableChangeImage   = false,
             limitToScreenShot    = true
         }));
     }
     if (this.menuFriends.AddBackIndex("Back", true))
     {
         menuStack.PopMenu();
     }
 }
 public void MenuCloud(MenuStack stack)
 {
     this.menuCloud.Update();
     if (this.menuCloud.AddItem("Title User Storage", true))
     {
         stack.PushMenu(this.tus.GetMenu());
     }
     if (this.menuCloud.AddItem("Title Small Storage", true))
     {
         stack.PushMenu(this.tss.GetMenu());
     }
     if (this.menuCloud.AddBackIndex("Back", true))
     {
         stack.PopMenu();
     }
 }
Example #19
0
    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.");
        }
    }
 public void MenuUtilities(MenuStack menuStack)
 {
     menu.Update();
     if (menu.AddItem("Get Network Time", Sony.NP.System.IsConnected))
     {
         DateTime dateTime = new DateTime(Sony.NP.System.GetNetworkTime(), DateTimeKind.Utc);
         OnScreenLog.Add("networkTime: " + dateTime.ToLongDateString() + " - " + dateTime.ToLongTimeString());
     }
     if (menu.AddItem("Bandwidth", Sony.NP.System.IsConnected && !Sony.NP.System.RequestBandwidthInfoIsBusy()))
     {
         ErrorHandlerSystem(Sony.NP.System.RequestBandwidthInfo());
     }
     if (menu.AddItem("Net Info", !Sony.NP.System.RequestBandwidthInfoIsBusy()))
     {
         ErrorHandlerSystem(Sony.NP.System.RequestNetInfo());
     }
     if (menu.AddItem("Net Device Type"))
     {
         Sony.NP.System.NetDeviceType networkDeviceType = Sony.NP.System.GetNetworkDeviceType();
         OnScreenLog.Add("Network device: " + networkDeviceType);
     }
     if (User.IsSignedInPSN)
     {
         if (menu.AddItem("Dialogs"))
         {
             menuStack.PushMenu(dialogs.GetMenu());
         }
         if (menu.AddItem("Auth Ticketing"))
         {
             menuStack.PushMenu(ticketing.GetMenu());
         }
         if (menu.AddItem("Censor Bad Comment", Sony.NP.System.IsConnected && !WordFilter.IsBusy()))
         {
             WordFilter.CensorComment("Censor a shit comment");
         }
         if (menu.AddItem("Sanitize Bad Comment", Sony.NP.System.IsConnected && !WordFilter.IsBusy()))
         {
             WordFilter.SanitizeComment("Sanitize a shit comment");
         }
     }
     if (menu.AddBackIndex("Back"))
     {
         menuStack.PopMenu();
     }
 }
    public void MenuSession(MenuStack menuStack)
    {
        bool isSignedInPSN = User.get_IsSignedInPSN();
        bool inSession     = Matching.get_InSession();

        if (!this.matchingIsReady && isSignedInPSN)
        {
            this.matchingIsReady = true;
        }
        if (inSession)
        {
            this.MenuInSession(menuStack);
        }
        else
        {
            this.MenuSetupSession(menuStack);
        }
    }
Example #22
0
        static IMenuStack getMenuStackFromEnum(MenuStack stack)
        {
            switch (stack)
            {
            case MenuStack.Main:
                return(mainMenuSystem);

            case MenuStack.Paused:
                return(pausedSystem);

            case MenuStack.PostRace:
                return(postRaceSystem);

            default:
                throw new Exception();
                return(null);
            }
        }
Example #23
0
    public void MenuSession(MenuStack menuStack)
    {
        bool isSignedInPSN = User.IsSignedInPSN;
        bool inSession     = Matching.InSession;

        if (!matchingIsReady && isSignedInPSN)
        {
            matchingIsReady = true;
        }
        if (inSession)
        {
            MenuInSession(menuStack);
        }
        else
        {
            MenuSetupSession(menuStack);
        }
    }
Example #24
0
    public void MenuTss(MenuStack menuStack)
    {
        menuTss.Update();
        bool enabled = User.IsSignedInPSN && !TusTss.IsTssBusy();

        if (menuTss.AddItem("TSS Request Data", enabled))
        {
            ErrorHandler(TusTss.RequestTssData());
        }
        if (menuTss.AddItem("TSS Request Data from slot", enabled))
        {
            int slot = 1;
            ErrorHandler(TusTss.RequestTssDataFromSlot(slot));
        }
        if (menuTss.AddBackIndex("Back"))
        {
            menuStack.PopMenu();
        }
    }
    public void MenuTss(MenuStack menuStack)
    {
        this.menuTss.Update();
        bool enabled = User.get_IsSignedInPSN() && !TusTss.IsTssBusy();

        if (this.menuTss.AddItem("TSS Request Data", enabled))
        {
            this.ErrorHandler(TusTss.RequestTssData());
        }
        if (this.menuTss.AddItem("TSS Request Data from slot", enabled))
        {
            int num = 1;
            this.ErrorHandler(TusTss.RequestTssDataFromSlot(num));
        }
        if (this.menuTss.AddBackIndex("Back", true))
        {
            menuStack.PopMenu();
        }
    }
    public void MenuTrophies(MenuStack menuStack)
    {
        this.menuTrophies.Update();
        bool trophiesAreAvailable = Trophies.get_TrophiesAreAvailable();

        if (this.menuTrophies.AddItem("Game Info", trophiesAreAvailable))
        {
            this.DumpGameInfo();
        }
        if (this.menuTrophies.AddItem("Group Info", trophiesAreAvailable && !Trophies.RequestGroupInfoIsBusy()))
        {
            this.ErrorHandler(Trophies.RequestGroupInfo());
        }
        if (this.menuTrophies.AddItem("Trophy Info", trophiesAreAvailable && !Trophies.RequestTrophyInfoIsBusy()))
        {
            this.ErrorHandler(Trophies.RequestTrophyInfo());
        }
        if (this.menuTrophies.AddItem("Trophy Progress", trophiesAreAvailable && !Trophies.RequestTrophyProgressIsBusy()))
        {
            this.ErrorHandler(Trophies.RequestTrophyProgress());
        }
        if (this.menuTrophies.AddItem("Award Trophy", trophiesAreAvailable) && this.ErrorHandler(Trophies.AwardTrophy(this.nextTrophyIndex)) == null)
        {
            this.nextTrophyIndex++;
            if (this.nextTrophyIndex == this.gameInfo.numTrophies)
            {
                this.nextTrophyIndex = 1;
            }
        }
        if (this.menuTrophies.AddItem("Award All Trophies", trophiesAreAvailable))
        {
            for (int i = 1; i < this.gameInfo.numTrophies; i++)
            {
                this.ErrorHandler(Trophies.AwardTrophy(i));
            }
        }
        if (this.menuTrophies.AddBackIndex("Back", true))
        {
            menuStack.PopMenu();
        }
    }
Example #27
0
    public void MenuRanking(MenuStack menuStack)
    {
        bool isSignedInPSN = User.IsSignedInPSN;

        rankingMenu.Update();
        if (rankingMenu.AddItem("Register Score", isSignedInPSN && !Ranking.RegisterScoreIsBusy()))
        {
            OnScreenLog.Add("Registering score: " + currentScore);
            ErrorHandler(Ranking.RegisterScore(rankBoardID, currentScore, "Insert comment here"));
            currentScore++;
        }
        if (rankingMenu.AddItem("Register score & data", isSignedInPSN && !Ranking.RegisterScoreIsBusy()))
        {
            OnScreenLog.Add("Registering score: " + currentScore);
            byte[] array = new byte[64];
            for (byte b = 0; b < 64; b = (byte)(b + 1))
            {
                array[b] = b;
            }
            ErrorHandler(Ranking.RegisterScoreWithData(rankBoardID, currentScore, "Insert comment here", array));
            currentScore++;
        }
        if (rankingMenu.AddItem("Own Rank", isSignedInPSN && !Ranking.RefreshOwnRankIsBusy()))
        {
            ErrorHandler(Ranking.RefreshOwnRank(rankBoardID));
        }
        if (rankingMenu.AddItem("Friend Rank", isSignedInPSN && !Ranking.RefreshFriendRankIsBusy()))
        {
            ErrorHandler(Ranking.RefreshFriendRank(rankBoardID));
        }
        if (rankingMenu.AddItem("Rank List", isSignedInPSN && !Ranking.RefreshRankListIsBusy()))
        {
            int num   = LastRankDisplayed + 1;
            int count = Math.Min(10, LastRankingMaxCount - num + 1);
            ErrorHandler(Ranking.RefreshRankList(rankBoardID, num, count));
        }
        if (rankingMenu.AddBackIndex("Back"))
        {
            menuStack.PopMenu();
        }
    }
Example #28
0
    public void MenuTrophies(MenuStack menuStack)
    {
        menuTrophies.Update();
        bool trophiesAreAvailable = Trophies.TrophiesAreAvailable;

        if (menuTrophies.AddItem("Game Info", trophiesAreAvailable))
        {
            DumpGameInfo();
        }
        if (menuTrophies.AddItem("Group Info", trophiesAreAvailable && !Trophies.RequestGroupInfoIsBusy()))
        {
            ErrorHandler(Trophies.RequestGroupInfo());
        }
        if (menuTrophies.AddItem("Trophy Info", trophiesAreAvailable && !Trophies.RequestTrophyInfoIsBusy()))
        {
            ErrorHandler(Trophies.RequestTrophyInfo());
        }
        if (menuTrophies.AddItem("Trophy Progress", trophiesAreAvailable && !Trophies.RequestTrophyProgressIsBusy()))
        {
            ErrorHandler(Trophies.RequestTrophyProgress());
        }
        if (menuTrophies.AddItem("Award Trophy", trophiesAreAvailable) && ErrorHandler(Trophies.AwardTrophy(nextTrophyIndex)) == ErrorCode.NP_OK)
        {
            nextTrophyIndex++;
            if (nextTrophyIndex == gameInfo.numTrophies)
            {
                nextTrophyIndex = 1;
            }
        }
        if (menuTrophies.AddItem("Award All Trophies", trophiesAreAvailable))
        {
            for (int i = 1; i < gameInfo.numTrophies; i++)
            {
                ErrorHandler(Trophies.AwardTrophy(i));
            }
        }
        if (menuTrophies.AddBackIndex("Back"))
        {
            menuStack.PopMenu();
        }
    }
    public void MenuRanking(MenuStack menuStack)
    {
        bool isSignedInPSN = User.get_IsSignedInPSN();

        this.rankingMenu.Update();
        if (this.rankingMenu.AddItem("Register Score", isSignedInPSN && !Ranking.RegisterScoreIsBusy()))
        {
            OnScreenLog.Add("Registering score: " + this.currentScore);
            this.ErrorHandler(Ranking.RegisterScore(this.rankBoardID, this.currentScore, "Insert comment here"));
            this.currentScore += 1uL;
        }
        if (this.rankingMenu.AddItem("Register score & data", isSignedInPSN && !Ranking.RegisterScoreIsBusy()))
        {
            OnScreenLog.Add("Registering score: " + this.currentScore);
            byte[] array = new byte[64];
            for (byte b = 0; b < 64; b += 1)
            {
                array[(int)b] = b;
            }
            this.ErrorHandler(Ranking.RegisterScoreWithData(this.rankBoardID, this.currentScore, "Insert comment here", array));
            this.currentScore += 1uL;
        }
        if (this.rankingMenu.AddItem("Own Rank", isSignedInPSN && !Ranking.RefreshOwnRankIsBusy()))
        {
            this.ErrorHandler(Ranking.RefreshOwnRank(this.rankBoardID));
        }
        if (this.rankingMenu.AddItem("Friend Rank", isSignedInPSN && !Ranking.RefreshFriendRankIsBusy()))
        {
            this.ErrorHandler(Ranking.RefreshFriendRank(this.rankBoardID));
        }
        if (this.rankingMenu.AddItem("Rank List", isSignedInPSN && !Ranking.RefreshRankListIsBusy()))
        {
            int num  = this.LastRankDisplayed + 1;
            int num2 = Math.Min(10, this.LastRankingMaxCount - num + 1);
            this.ErrorHandler(Ranking.RefreshRankList(this.rankBoardID, num, num2));
        }
        if (this.rankingMenu.AddBackIndex("Back", true))
        {
            menuStack.PopMenu();
        }
    }
Example #30
0
    public void UserBack()
    {
        if (MenuStack.Count == 0)
        {
            return;
        }
        if (_activeControlIndex != null)
        {
            return;
        }

        var lastIndex = MenuStack.Count - 1;

        var last = MenuStack[lastIndex];

        if (last.MandatedParam != null)
        {
            DoSetRuntimeX(last.MandatedParam.name, 0.0f);
        }
        MenuStack.RemoveAt(lastIndex);
    }
Example #31
0
 public static void EnableSystem(MenuStack stack)
 {
     DisableAllMenus();
     getMenuStackFromEnum(stack).isActive = true;
     getMenuStackFromEnum(stack).resetToMain();
 }
Example #32
0
 static IMenuStack getMenuStackFromEnum(MenuStack stack)
 {
     switch (stack)
     {
         case MenuStack.Main:
             return mainMenuSystem;
         case MenuStack.Paused:
             return pausedSystem;
         case MenuStack.PostRace:
             return postRaceSystem;
         default:
             throw new Exception();
             return null;
     }
 }