Esempio n. 1
0
        internal void ContinueCommunityShare()
        {
            LevelMetadata level = CurWorld;

            //TODO: check for broken links?
            //always start the share on the first level in the set
            level = level.FindFirstLink();

            string folderName = Utils.FolderNameFromFlags(level.Genres);
            string fullPath   = BokuGame.Settings.MediaPath + folderName + level.WorldId.ToString() + @".Xml";

            // Share.
            // Check to see if the community server is reachable before sharing level.
            if (!Web.Community.Async_Ping(Callback_Ping, fullPath))
            {
                ShowNoCommunityDialog();
            }
        }   // end of PopupOnCommunityShare()
Esempio n. 2
0
        public CommunityShareMenu()
        {
            // signedInMessage
            {
                ModularMessageDialog.ButtonHandler handlerA = delegate(ModularMessageDialog dialog)
                {
                    // User chose "upload"

                    //find the first link
                    LevelMetadata level = CurWorld;
                    level = level.FindFirstLink();

                    string folderName = Utils.FolderNameFromFlags(level.Genres);
                    string fullPath   = BokuGame.Settings.MediaPath + folderName + level.WorldId.ToString() + @".Xml";

                    // Read it back from disk and start uploading it to the community.
                    BokuShared.Wire.WorldPacket packet = XmlDataHelper.ReadWorldPacketFromDisk(fullPath);

                    UploadWorldData(packet, level);

                    // Deactivate dialog.
                    dialog.Deactivate();
                    Deactivate();
                };
                ModularMessageDialog.ButtonHandler handlerB = delegate(ModularMessageDialog dialog)
                {
                    // User chose "cancel"
                    // Deactivate dialog.
                    dialog.Deactivate();
                    Deactivate();
                };

                ModularMessageDialog.ButtonHandler handlerY = delegate(ModularMessageDialog dialog)
                {
                    // Deactivate dialog.
                    dialog.Deactivate();
                    Deactivate();
                };
            }

            // signedOutMessage
            {
                ModularMessageDialog.ButtonHandler handlerA = delegate(ModularMessageDialog dialog)
                {
                    // Deactivate dialog.
                    dialog.Deactivate();
                };
                ModularMessageDialog.ButtonHandler handlerB = delegate(ModularMessageDialog dialog)
                {
                    // User chose "cancel"
                    // Deactivate dialog.
                    dialog.Deactivate();
                    Deactivate();
                };
                ModularMessageDialog.ButtonHandler handlerY = delegate(ModularMessageDialog dialog)
                {
                    // User chose "upload anonymous"
                    LevelMetadata level = CurWorld;

                    //find the first link
                    level = level.FindFirstLink();

                    string folderName = Utils.FolderNameFromFlags(level.Genres);
                    string fullPath   = BokuGame.Settings.MediaPath + folderName + level.WorldId.ToString() + @".Xml";

                    // Share.
                    // Check to see if the community server is reachable before sharing level.
                    if (!Web.Community.Async_Ping(Callback_Ping, fullPath))
                    {
                        ShowNoCommunityDialog();
                    }

                    // Deactivate dialog.
                    dialog.Deactivate();
                    Deactivate();
                };
            }
        }