示例#1
0
    public void writeToLeaderboard(
        int leaderboardID,
        int score,
        TimeSpan time,
        bool win,
        LeaderboardKey key)
    {
        SignedInGamer gamer = XNAConnect.getGamer();

        if (gamer == null)
        {
            return;
        }
        if (TheSims3.IsTrialMode)
        {
            return;
        }
        try
        {
            //LeaderboardIdentity leaderboardId = LeaderboardIdentity.Create(key, leaderboardID);
            //LeaderboardEntry leaderboard = gamer.LeaderboardWriter.GetLeaderboard(leaderboardId);
            //leaderboard.Rating = !Scene.IsScoreLeaderboard(leaderboardID) ? (long) time.TotalMinutes : (long) score;
            //leaderboard.Columns.SetValue("Outcome", win ? LeaderboardOutcome.Win : LeaderboardOutcome.Loss);
        }
        //catch (GameUpdateRequiredException ex)
        //{
        //    XNAConnect.PromptForUpdate();
        //}
        catch (Exception ex)
        {
        }
    }
示例#2
0
    public void readLeaderboard(int leaderboardID, LeaderboardKey key)
    {
        this.LeaderboardsRead = (XNAConnect.LeaderboardResult)null;
        if (TheSims3.IsTrialMode)
        {
            return;
        }
        SignedInGamer gamer = XNAConnect.getGamer();

        if (gamer == null)
        {
            return;
        }
        LeaderboardIdentity leaderboardIdentity = LeaderboardIdentity.Create(key, leaderboardID);

        this.LeaderboardsRead = new XNAConnect.LeaderboardResult(leaderboardIdentity);
        try
        {
            //LeaderboardReader.BeginRead(leaderboardIdentity, (Gamer)gamer, 20, new AsyncCallback(this.LeaderboardCallback), (object)gamer);
        }
        //catch (GameUpdateRequiredException ex)
        //{
        //    XNAConnect.PromptForUpdate();
        //}
        catch (Exception ex)
        {
            XNAConnect.NotifyConnectionLost();
        }
    }
示例#3
0
 public XNAMenu(AppEngine engine, XNAMenuRes resources, Scene scene, XNAConnect connect)
 {
     this.ae      = engine;
     this.res     = resources;
     this.m_scene = scene;
     this.conn    = connect;
 }
示例#4
0
 public AchievementDetailMenu(
     AppEngine ae,
     XNAMenuRes res,
     AchievementsMenu ach_menu,
     Scene scene,
     XNAConnect c)
     : base(ae, res, scene, c)
 {
     this.ach_menu = ach_menu;
 }
    public override void init()
    {
        base.init();
        this.y_offset = 0;
        this.prev_y   = 0;
        XNAButton.AC  = XNAConnect.getAchievements();
        int h = 40;

        for (int index = 0; index < this.buttons.Length; ++index)
        {
            this.buttons[index] = new XNAButton(this.TEXT_AREA_X, this.TEXT_AREA_Y + h * index, this.TEXT_AREA_WIDTH, h, (XNAButton.Type)(10 + index));
        }
        this.buttonArea = new Rectangle(this.TEXT_AREA_X, this.TEXT_AREA_Y, this.TEXT_AREA_WIDTH, this.TEXT_AREA_HEIGHT);
    }
示例#6
0
    private void LeaderboardCallback(IAsyncResult result)
    {
        SignedInGamer asyncState = result.AsyncState as SignedInGamer;

        try
        {
            if (asyncState == null)
            {
                return;
            }
            //this.LeaderboardsRead.Read(LeaderboardReader.EndRead(result));
        }
        //catch (GameUpdateRequiredException ex)
        //{
        //    XNAConnect.PromptForUpdate();
        //}
        catch (Exception ex)
        {
            XNAConnect.NotifyConnectionLost();
            this.LeaderboardsRead = (XNAConnect.LeaderboardResult)null;
        }
    }
示例#7
0
    public static AchievementCollection getAchievements()
    {
        SignedInGamer gamer = XNAConnect.getGamer();

        if (gamer == null)
        {
            return((AchievementCollection)null);
        }
        AchievementCollection achievementCollection = (AchievementCollection)null;

        try
        {
            achievementCollection = gamer.GetAchievements();
        }
        //catch (GameUpdateRequiredException ex)
        //{
        //    XNAConnect.PromptForUpdate();
        //}
        catch (Exception ex)
        {
        }
        return(achievementCollection);
    }
示例#8
0
    public void awardAchievement(string achievementKey)
    {
        if (TheSims3.IsTrialMode)
        {
            return;
        }
        SignedInGamer gamer = XNAConnect.getGamer();

        if (gamer == null)
        {
            return;
        }
        try
        {
            gamer.AwardAchievement(achievementKey);
        }
        //catch (GameUpdateRequiredException ex)
        //{
        //    XNAConnect.PromptForUpdate();
        //}
        catch (Exception ex)
        {
        }
    }
示例#9
0
    public string getInputString(string title, int maxSize)
    {
        this.m_gettingInput = true;
        TextBox     textBox = new TextBox(title, (string)null, maxSize, 0);
        Displayable current = this.m_display.getCurrent();

        textBox.show(this.m_display);
        JavaLibGame.GraphicsDeviceManager.SupportedOrientations = DisplayOrientation.LandscapeLeft;
        JavaLibGame.GraphicsDeviceManager.ApplyChanges();
        string defaultText = "";

        if (XNAConnect.getGamer() != null)
        {
            defaultText = XNAConnect.getGamer().DisplayName;
        }
        //IAsyncResult result = Guide.BeginShowKeyboardInput(PlayerIndex.One, this.m_engine.getTextManager().getString(1823), this.m_engine.getTextManager().getString(1824), defaultText, (AsyncCallback) null, (object) null);
        //while (!result.IsCompleted)
        //JThread.sleep(500);
        string text = /* Guide.EndShowKeyboardInput(result) */ string.IsNullOrWhiteSpace(defaultText) ? "C**t" : defaultText;

        JavaLibGame.GraphicsDeviceManager.SupportedOrientations = DisplayOrientation.Portrait;
        JavaLibGame.GraphicsDeviceManager.ApplyChanges();
        textBox.setString(text);
        if (!this.m_beingDestroyed)
        {
            this.m_display.setCurrent(current);
        }
        else
        {
            this.m_display.setCurrent((Displayable)null);
        }
        string str = textBox.getString();

        this.m_gettingInput = false;
        return(str);
    }
 public AchievementsMenu(AppEngine ae, XNAMenuRes res, Scene menu, XNAConnect c)
     : base(ae, res, menu, c)
 {
     this.buttons = new XNAButton[18];
 }
示例#11
0
 public LeaderboardsMenu(AppEngine ae, XNAMenuRes res, Scene scene, XNAConnect c)
     : base(ae, res, scene, c)
 {
     this.buttons     = new XNAButton[6];
     this.sortButtons = new XNAButton[2];
 }