Exemple #1
0
        static void HandleLog(string logString, string stackTrace, LogType type)
        {
            if (type != LogType.Exception)
            {
                return;
            }

            if (!IsPlasticStackTrace(stackTrace))
            {
                return;
            }

            GUIActionRunner.RunGUIAction(delegate {
                mLog.ErrorFormat("[HandleLog] Unexpected error: {0}", logString);
                mLog.DebugFormat("Stack trace: {0}", stackTrace);

                string message = logString;
                if (ExceptionsHandler.DumpStackTrace())
                {
                    message += Environment.NewLine + stackTrace;
                }

                GuiMessage.ShowError(message);
            });
        }
        public WindowArrayVisibilityListBox(Cursor cursor) :
            base(cursor)
        {
            Click += new GuiMessage(SelectWindowArrayVisibility);

            windowScls = new List <Vector2>();
        }
Exemple #3
0
        void OnDestroy()
        {
            if (mException != null)
            {
                return;
            }

            if (mWkInfo == null)
            {
                return;
            }

            if (!mWorkspaceWindow.IsOperationInProgress())
            {
                return;
            }

            bool bCloseWindow = GuiMessage.ShowQuestion(
                PlasticLocalization.GetString(PlasticLocalization.Name.OperationRunning),
                PlasticLocalization.GetString(PlasticLocalization.Name.ConfirmClosingRunningOperation),
                PlasticLocalization.GetString(PlasticLocalization.Name.YesButton));

            if (bCloseWindow)
            {
                return;
            }

            mForceToOpen = true;
            ShowPlasticWindow(this);
        }
Exemple #4
0
        CertOperationResult GetUserResponse(
            string title, string message, PlasticCertInfo serverCertificate)
        {
            GuiMessage.GuiMessageResponseButton result =
                GuiMessage.GuiMessageResponseButton.Third;

            GUIActionRunner.RunGUIAction(delegate {
                result = GuiMessage.ShowQuestion(
                    title, GetCertificateMessageString(message, serverCertificate),
                    PlasticLocalization.GetString(PlasticLocalization.Name.YesButton),
                    PlasticLocalization.GetString(PlasticLocalization.Name.NoButton),
                    PlasticLocalization.GetString(PlasticLocalization.Name.CancelButton),
                    true);
            });

            switch (result)
            {
            case GuiMessage.GuiMessageResponseButton.First:
                return(CertOperationResult.AddToStore);

            case GuiMessage.GuiMessageResponseButton.Second:
                return(CertOperationResult.DoNotAddToStore);

            case GuiMessage.GuiMessageResponseButton.Third:
                return(CertOperationResult.Cancel);

            default:
                return(CertOperationResult.Cancel);
            }
        }
Exemple #5
0
        //public MultiButtonMessageBox(SpriteFrame baseWindow, SpriteFrame buttonBlueprint,
        //    Cursor cursor) :
        //    base(baseWindow, cursor)
        //{
        //    buttonArray = new WindowArray();

        //    this.textObject = TextManager.AddText("");

        //    this.buttonBlueprint = buttonBlueprint;

        //    SpriteManager.RemoveSpriteFrame(buttonBlueprint);

        //    GuiManagerDrawn = false;

        //}

        #endregion

        public void AddButton(string buttonText, GuiMessage message)
        {
            Button buttonAdded;

            if (this.GuiManagerDrawn)
            {
                buttonAdded = new Button(mCursor);
                this.AddWindow(buttonAdded);
            }
            else
            {
                throw new NotImplementedException("Haven't implemented GuiSkin support for MultiButtonMessageBoxes yet");
                //buttonAdded = base.AddButton(this.buttonBlueprint.Clone());
                //buttonAdded.SpriteFrame.Z = this.SpriteFrame.Z - .01f;
                //SpriteManager.AddSpriteFrame(buttonAdded.SpriteFrame);
            }


            buttonAdded.Text = buttonText;

            AddButton(buttonAdded);

            // This used to be made invisible - I don't know why - we should close it!
            buttonAdded.Click += new GuiMessage(RemoveThis);
            buttonAdded.Click += message;
        }
        public override void Render(float elapsedTime)
        {
            drawer2D.BeginDrawSprite();
            drawer2D.DrawSprite(backgroundSprite);
            drawer2D.EndDrawSprite();

            GuiMessage msg = gui.Update(elapsedTime, Input);

            // proceso el msg
            switch (msg.message)
            {
            case MessageType.WM_COMMAND:
                switch (msg.id)
                {
                case ID_CLOSE:
                    show = false;
                    gui.Reset();
                    PlayerModel.ShowFatherNote = false;
                    break;
                }
                break;

            default:
                break;
            }

            if (show)
            {
                gui.Render();
            }
        }
Exemple #7
0
        public override void DidFinishLaunching(NSNotification notification)
        {
            ApplicationArgs appArgs = GetApplicationArgs();

            ExceptionsHandler.SetExceptionHandlers(appArgs.IsTestingMode);

            ThreadWaiterBuilder.Initialize(new MacApplicationTimerBuilder());

            WindowHandler.Initialize(this);
            GuiMessage.Initialize(new MacOsGuiMessage());

            NSApplication.SharedApplication.ActivateIgnoringOtherApps(true);

            if (appArgs.IsTestingMode)
            {
                InstallTestAssembliesResolver(appArgs.PathToAssemblies);
            }

            // Tip: you could launch different windows depending on the
            // argument flags.
            WindowHandler.LaunchApplicationWindow();

            if (appArgs.IsTestingMode)
            {
                RemotingHack.ApplyRemotingConfigurationWorkaround();
                WindowHandler.LaunchTest(appArgs.TestInfoFile, appArgs.PathToAssemblies);
            }
        }
Exemple #8
0
        public override void Render(float elapsedTime)
        {
            drawer2D.BeginDrawSprite();
            drawer2D.DrawSprite(backgroundSprite);
            drawer2D.EndDrawSprite();

            GuiMessage msg = gui.Update(elapsedTime, Input);

            switch (msg.message)
            {
            case MessageType.WM_COMMAND:
                switch (msg.id)
                {
                case ID_CLOSE:
                    ShowHistory = false;
                    break;
                }
                break;

            default:
                break;
            }

            gui.Render();
        }
Exemple #9
0
        static void OnHelpLinkClicked(
            HelpPanel helpPanel,
            HelpLink helpLink)
        {
            HelpLink.LinkType linkType;
            string            content;

            if (!HelpLinkData.TryGet(helpLink.Link, out linkType, out content))
            {
                return;
            }

            switch (linkType)
            {
            case HelpLink.LinkType.Action:
                GuiMessage.ShowInformation(
                    "An ACTION link has been clicked:\n" + content);
                break;

            case HelpLink.LinkType.Help:
                helpPanel.Show(
                    content == "sample1" ?
                    Images.Name.GenericBuho1 :
                    Images.Name.GenericBuhoShe1,
                    content == "sample1" ?
                    TestingHelpData.GetSample1() :
                    TestingHelpData.GetSample2());
                break;

            case HelpLink.LinkType.Link:
                Process.Start(content);
                break;
            }
        }
        public override void Render(float elapsedTime)
        {
            drawer2D.BeginDrawSprite();
            drawer2D.DrawSprite(backgroundSprite);
            drawer2D.EndDrawSprite();

            GuiMessage msg = gui.Update(elapsedTime, Input);

            switch (msg.message)
            {
            case MessageType.WM_COMMAND:
                switch (msg.id)
                {
                case ID_CLOSE:
                    Application.Exit();
                    break;
                }
                break;

            default:
                break;
            }

            gui.Render();

            if (playWinSound)
            {
                playWinSound = false;
                winSound.play();
            }
        }
Exemple #11
0
        public override void Render(float elapsedTime)
        {
            GuiMessage msg = gui.Update(elapsedTime, Input);

            switch (msg.message)
            {
            case MessageType.WM_COMMAND:

                switch (msg.id)
                {
                case ID_CRAFT_SHIP_HELM:
                    CraftShipHelm();
                    break;
                }

                break;
            }

            gui.Render();
            text.render();

            if (showNoElemMsg && msgTime < 5)
            {
                msgTime += elapsedTime;
                noelementsMsg.render();
            }

            if (showCraftElemMsg && msgTime < 5)
            {
                msgTime += elapsedTime;
                craftElementMsg.render();
            }
        }
        static void InviteMemberButton_clicked(object obj)
        {
            WorkspaceInfo wkInfo = (WorkspaceInfo)obj;
            CurrentUserAdminCheckResponse response = null;

            IThreadWaiter waiter = ThreadWaiter.GetWaiter(50);

            waiter.Execute(
                /*threadOperationDelegate*/
                delegate
            {
                RepositorySpec repSpec = PlasticGui.Plastic.API.GetRepositorySpec(wkInfo);

                ServerProfile serverProfile =
                    CmConnection.Get().GetProfileManager().GetProfileForServer(repSpec.Server) ??
                    ClientConfig.Get().GetDefaultProfile();

                string authToken = CmConnection.Get()
                                   .BuildWebApiTokenForCloudEditionForProfileAndOrg(
                    serverProfile);

                response = WebRestApiClient.PlasticScm.IsUserAdmin(
                    ServerOrganizationParser.GetOrganizationFromServer(repSpec.Server),
                    authToken);
            },
                /*afterOperationDelegate*/
                delegate
            {
                if (waiter.Exception != null)
                {
                    ExceptionsHandler.LogException(
                        "IsUserAdmin",
                        waiter.Exception);
                    return;
                }

                if (response.Error != null)
                {
                    Debug.LogErrorFormat(
                        "Error checking if the user is the organization admin: {0}",
                        string.Format("Unable to get IsUserAdminResponse: {0} [code {1}]",
                                      response.Error.Message,
                                      response.Error.ErrorCode));

                    return;
                }

                if (response.IsCurrentUserAdmin)
                {
                    Application.OpenURL("https://www.plasticscm.com/dashboard/cloud/" +
                                        response.OrganizationName +
                                        "/users-and-groups");
                    return;
                }

                GuiMessage.ShowInformation(
                    PlasticLocalization.GetString(PlasticLocalization.Name.InviteMembersTitle),
                    PlasticLocalization.GetString(PlasticLocalization.Name.InviteMembersMessage));
            });
        }
        public override void Render(float elapsedTime)
        {
            drawer2D.BeginDrawSprite();
            drawer2D.DrawSprite(backgroundSprite);
            drawer2D.EndDrawSprite();

            text.render();

            GuiMessage msg = gui.Update(elapsedTime, Input);

            // proceso el msg
            switch (msg.message)
            {
            case MessageType.WM_COMMAND:
                switch (msg.id)
                {
                case IDOK:
                    if (msg_box_app_exit)
                    {
                        Application.Exit();
                    }
                    if (msg_box_nueva_mision)
                    {
                        music.closeFile();
                        GameModel.ChangeLevel();
                    }
                    break;

                case IDCANCEL:
                    gui.EndDialog();
                    break;

                case ID_NUEVA_PARTIDA:
                    gui.MessageBox("Nueva Partida", "TGC Gui Demo");
                    msg_box_nueva_mision = true;
                    msg_box_app_exit     = false;
                    break;

                case ID_APP_EXIT:
                    gui.MessageBox("Desea Salir?", "TGC Gui Demo");
                    msg_box_app_exit     = true;
                    msg_box_nueva_mision = false;
                    break;

                case ID_CONTROLES:
                    gui.MessageBoxControles("Controles", "TGC Gui Demo");
                    break;
                }
                break;

            default:
                break;
            }

            gui.Render();
        }
    private IEnumerator ShowTextForAWhile(GuiMessage msg)
    {
        text.text = msg.Message;
        text.gameObject.SetActive(true);
        yield return(new WaitForSeconds(msg.Duration));

        text.gameObject.SetActive(false);

        msg.Callback?.Invoke();
    }
Exemple #15
0
 void AskCredentialsToUser.IGui.ShowSaveProfileErrorMessage(string message)
 {
     GUIActionRunner.RunGUIAction(delegate
     {
         GuiMessage.ShowError(string.Format(
                                  PlasticLocalization.GetString(
                                      PlasticLocalization.Name.CredentialsErrorSavingProfile),
                                  message));
     });
 }
Exemple #16
0
        internal static void InitializeIfNeeded()
        {
            if (sIsInitialized)
            {
                return;
            }

            sIsInitialized = true;

            PlasticAPI        = new PlasticAPI();
            PlasticWebRestApi = new PlasticWebRestApi();

            ConfigureLogging();

            GuiMessage.Initialize(new UnityPlasticGuiMessage());

            RegisterExceptionHandlers();

            InitLocalization();

            ThreadWaiter.Initialize(new UnityThreadWaiterBuilder());
            ServicePointConfigurator.ConfigureServicePoint();
            CertificateUi.RegisterHandler(new ChannelCertificateUiImpl());

            SetupFsWatcher();

            EditionManager.Get().DisableCapability(
                EnumEditionCapabilities.Extensions);

            ClientHandlers.Register();

            PlasticGuiConfig.SetConfigFile(
                PlasticGuiConfig.UNITY_GUI_CONFIG_FILE);

            sEventSenderScheduler = EventTracking.Configure(
                PlasticApp.PlasticWebRestApi,
                AssetsPath.IsRunningAsUPMPackage() ?
                ApplicationIdentifier.UnityPackage :
                ApplicationIdentifier.UnityAssetStorePlugin,
                IdentifyEventPlatform.Get());

            if (sEventSenderScheduler != null)
            {
                sPingEventLoop = new PingEventLoop();
                sPingEventLoop.Start();
                sPingEventLoop.SetUnityVersion(Application.unityVersion);

                CollabPlugin.GetVersion(pluginVersion => sPingEventLoop.SetPluginVersion(pluginVersion));
            }

            PlasticMethodExceptionHandling.InitializeAskCredentialsUi(
                new CredentialsUiImpl());
            ClientEncryptionServiceProvider.SetEncryptionPasswordProvider(
                new MissingEncryptionPasswordPromptHandler());
        }
Exemple #17
0
        public static void AskIfChangesShouldBeApplied(GuiMessage extraMessage)
        {
            OkCancelWindow tempBox = GuiManager.ShowOkCancelWindow("Apply changes to grid?", "Grid Update");

            tempBox.OkClick     += new GuiMessage(SpriteGridGuiMessages.updateSpriteGridOk);
            tempBox.CancelClick += new GuiMessage(SpriteGridGuiMessages.updateSpriteGridCancel);

            if (extraMessage != null)
            {
                tempBox.OkClick += extraMessage;
            }
        }
Exemple #18
0
 public static bool AskQuestionsAndDelaySaveIfNecessary(GuiMessage guiMessage)
 {
     if (SESpriteGridManager.CurrentSpriteGrid != null && SESpriteGridManager.HasBlueprintChanged())
     {
         SESpriteGridManager.AskIfChangesShouldBeApplied(guiMessage);
         return(false);
     }
     else
     {
         return(true);
     }
 }
        internal bool CheckOperationInProgress()
        {
            if (IsOperationInProgress())
            {
                GuiMessage.ShowInformation(
                    PlasticLocalization.GetString(PlasticLocalization.Name.OperationRunning),
                    PlasticLocalization.GetString(PlasticLocalization.Name.OperationInProgress));
                return(true);
            }

            return(false);
        }
        public void AddElement(
            string element,
            IApplicationWindow window,
            IProgressControls progressControls)
        {
            if (string.IsNullOrEmpty(element))
            {
                progressControls.ShowError(
                    Localization.GetText(
                        Localization.Name.ElementCantBeEmptyErrorMessage));
                return;
            }

            progressControls.ShowProgress(
                Localization.GetText(
                    Localization.Name.AddingElementProgressText,
                    element));

            IThreadWaiter waiter = ThreadWaiter.GetWaiter();

            waiter.Execute(
                threadOperationDelegate: () =>
            {
                DoHeavyWork();

                if (mModel.Contains(element))
                {
                    throw new Exception(
                        Localization.GetText(
                            Localization.Name.ElementInTheListErrorMessage, element));
                }

                mModel.Add(element);
                mModel.Sort(StringComparer.Ordinal);
            },
                afterOperationDelegate: () =>
            {
                progressControls.HideProgress();

                if (waiter.Exception != null)
                {
                    GuiMessage.ShowError(
                        Localization.GetText(Localization.Name.ErrorTitle),
                        waiter.Exception.Message);
                    return;
                }

                window.UpdateItems(mModel);
                window.ClearInput();
            });
        }
Exemple #21
0
        void OnEnable()
        {
            processor.AssetModificationProcessor.ForceCheckout = EditorPrefs.GetBool("forceCheckoutPlasticSCM");
            wantsMouseMove = true;

            if (mException != null)
            {
                return;
            }

            minSize = new Vector2(
                UnityConstants.PLASTIC_WINDOW_MIN_SIZE_WIDTH,
                UnityConstants.PLASTIC_WINDOW_MIN_SIZE_HEIGHT);

            SetupWindowTitle();

            GuiMessage.Initialize(new UnityPlasticGuiMessage(this));

            PlasticApp.InitializeIfNeeded();

            RegisterApplicationFocusHandlers(this);

            PlasticMethodExceptionHandling.InitializeAskCredentialsUi(
                new CredentialsUiImpl(this));
            ClientEncryptionServiceProvider.SetEncryptionPasswordProvider(
                new MissingEncryptionPasswordPromptHandler(this));

            if (mPlasticAPI == null)
            {
                mPlasticAPI = new PlasticAPI();
            }
            mPlasticWebRestApi = new PlasticWebRestApi();

            mEventSenderScheduler = EventTracking.Configure(
                mPlasticWebRestApi,
                AssetsPath.IsRunningAsUPMPackage() ?
                ApplicationIdentifier.UnityPackage : ApplicationIdentifier.UnityAssetStorePlugin,
                IdentifyEventPlatform.Get());

            if (mEventSenderScheduler != null)
            {
                mPingEventLoop = new PingEventLoop();
                mPingEventLoop.Start();
                mPingEventLoop.SetUnityVersion(Application.unityVersion);

                CollabPlugin.GetVersion(pluginVersion => mPingEventLoop.SetPluginVersion(pluginVersion));
            }

            InitializePlastic();
        }
Exemple #22
0
        public bool AcceptInvalidHostname(string certHostname, string serverHostname)
        {
            bool result = false;

            GUIActionRunner.RunGUIAction(delegate {
                result = GuiMessage.ShowQuestion(
                    PlasticLocalization.GetString(
                        PlasticLocalization.Name.InvalidCertificateHostnameTitle),
                    PlasticLocalization.GetString(
                        PlasticLocalization.Name.InvalidCertificateHostnameMessage,
                        certHostname, serverHostname),
                    PlasticLocalization.GetString(PlasticLocalization.Name.YesButton));
            });

            return(result);
        }
Exemple #23
0
        void OnEnable()
        {
            if (mException != null)
            {
                return;
            }

            GuiMessage.Initialize(new UnityPlasticGuiMessage(this));

            ConfigureLogging();

            RegisterExceptionHandlers();
            RegisterApplicationFocusHandlers(this);

            InitLocalization();

            ThreadWaiter.Initialize(new UnityThreadWaiterBuilder());
            ServicePointConfigurator.ConfigureServicePoint();
            CertificateUi.RegisterHandler(new ChannelCertificateUiImpl());
            CredentialsUIRegistrar.RegisterCredentialsUI(
                new CredentialsUiImpl(this));
            ClientEncryptionServiceProvider.SetEncryptionPasswordProvider(
                new MissingEncryptionPasswordPromptHandler(this));
            DisableFsWatcherIfNeeded();
            EditionManager.Get().DisableCapability(
                EnumEditionCapabilities.Extensions);

            mPlasticAPI = new PlasticAPI();
            ClientHandlers.Register();

            PlasticGuiConfig.SetConfigFile(PLASTIC_GUI_CONFIG_FILE);

            mPingEventLoop      = new PingEventLoop();
            mEventSenderRestApi = new SimpleEventSenderRestApi(
                PlasticWebApiUris.GetBaseUri());
            mEventSenderScheduler = EventTracking.Configure(
                mEventSenderRestApi,
                ApplicationIdentifier.UnityPackage,
                IdentifyEventPlatform.Get());

            if (mEventSenderScheduler != null)
            {
                mPingEventLoop.Start();
            }

            InitializePlastic();
        }
Exemple #24
0
        static void Main(string[] args)
        {
            try
            {
                ApplicationArgs appArgs = ApplicationArgs.Parse(args);

                ExceptionsHandler.SetExceptionHandlers(appArgs.IsTestingMode);

                ProcessNameSetter.SetProcessName("linux");

                ThreadWaiterBuilder.Initialize(new GtkApplicationTimerBuilder());

                GuiMessage.Initialize(new GtkGuiMessage());

                if (appArgs.IsTestingMode)
                {
                    InstallTestAssembliesResolver(appArgs.PathToAssemblies);
                }

                // Tip: you could launch different windows depending on the
                // argument flags.
                Application.Init();
                WindowHandler.LaunchApplicationWindow();

                if (appArgs.IsTestingMode)
                {
                    WindowHandler.LaunchTest(appArgs.TestInfoFile, appArgs.PathToAssemblies);
                }

                Application.Run();
            }
            catch (Exception ex)
            {
                // You would track the exception here
                Console.Error.WriteLine($"{ex.GetType()}: {ex.Message}");
                Console.Error.WriteLine(ex.StackTrace);

                ExitCode = 1;
                Application.Quit();
            }
            finally
            {
                // You would dispose everything you need here.
                Environment.Exit(ExitCode);
            }
        }
Exemple #25
0
        public void RenderGUI(float elapsedTime)
        {
            GuiMessage msg = gui.Update(elapsedTime, Input);

            switch (msg.message)
            {
            case MessageType.WM_COMMAND:

                switch (msg.id)
                {
                case 1:
                    active = false;
                    PlayerModel.ShowInventory  = false;
                    PlayerModel.ShowFatherNote = true;
                    break;

                case 2:
                    if (PlayerModel.CanUseShipHelm)
                    {
                        active = false;
                        PlayerModel.ShowInventory = false;
                        ShowShipHelm    = false;
                        RenderShipHelm  = true;
                        PlayerModel.Win = true;
                    }
                    else
                    {
                        showNoUseShipHelmMsg = true;
                        msgTime = 0;
                    }
                    break;
                }

                break;
            }

            gui.Render();
            text.render();

            if (showNoUseShipHelmMsg && msgTime < 3)
            {
                msgTime += elapsedTime;
                noUseShipHelmText.render();
            }
        }
Exemple #26
0
        static void Main(string[] args)
        {
            try
            {
                ApplicationArgs appArgs = ApplicationArgs.Parse(args);

                ExceptionsHandler.SetExceptionHandlers(appArgs.IsTestingMode);

                ThreadWaiterBuilder.Initialize(new WinPlasticTimerBuilder());

                GuiMessage.Initialize(new WindowsGuiMessage());

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                if (appArgs.IsTestingMode)
                {
                    InstallTestAssembliesResolver(appArgs.PathToAssemblies);
                }

                // Tip: you could launch different windows depending on the
                // argument flags.
                WindowHandler.LaunchApplicationWindow();

                if (appArgs.IsTestingMode)
                {
                    WindowHandler.LaunchTest(appArgs.TestInfoFile, appArgs.PathToAssemblies);
                }

                Application.Run();
            }
            catch
            {
                // You would track the exception here.
                ExitCode = 1;
                Application.Exit();
            }
            finally
            {
                // You would dispose everything you need here.
                Environment.Exit(ExitCode);
            }
        }
Exemple #27
0
 /// <summary>
 /// updates the message's text wannted by the user
 /// the user can edit only his messages
 /// </summary>
 /// <param name="newMsg">text of the new message</param>
 /// <param name="msg">the message that the user wants to update</param>
 /// <returns>true if the update was succsseful</returns>
 public bool updateMessage(string newMsg, GuiMessage msg)
 {
     if (!allMessages.updateMessage(msg.Id, newMsg, (DateTime.Now).ToUniversalTime()))
     {
         return(false);
     }
     // removes the old message from the presentation list
     presMsgs.Remove(msg);
     // removes the old message from the presistent list
     for (int i = 0; i < allMessages.List.Count(); i++)
     {
         if (allMessages.List[i].Id.Equals(msg.Id))
         {
             allMessages.List.RemoveAt(i);
             break;
         }
     }
     return(true);
 }
        void OnEnable()
        {
            wantsMouseMove = true;

            if (mException != null)
            {
                return;
            }

            SetupWindowTitle(false);

            GuiMessage.Initialize(new UnityPlasticGuiMessage(this));

            PlasticApp.InitializeIfNeeded();

            RegisterApplicationFocusHandlers(this);

            PlasticMethodExceptionHandling.InitializeAskCredentialsUi(
                new CredentialsUiImpl(this));
            ClientEncryptionServiceProvider.SetEncryptionPasswordProvider(
                new MissingEncryptionPasswordPromptHandler(this));

            mPlasticAPI        = new PlasticAPI();
            mPlasticWebRestApi = new PlasticWebRestApi();

            mEventSenderScheduler = EventTracking.Configure(
                mPlasticWebRestApi,
                ApplicationIdentifier.UnityPackage,
                IdentifyEventPlatform.Get());

            if (mEventSenderScheduler != null)
            {
                mPingEventLoop = new PingEventLoop();
                mPingEventLoop.Start();
                mPingEventLoop.SetUnityVersion(Application.unityVersion);
            }

            InitializePlastic();
        }
Exemple #29
0
        void OnEnable()
        {
            wantsMouseMove = true;

            if (mException != null)
            {
                return;
            }

            GuiMessage.Initialize(new UnityPlasticGuiMessage(this));

            PlasticApp.Initialize();

            RegisterApplicationFocusHandlers(this);

            CredentialsUIRegistrar.RegisterCredentialsUI(
                new CredentialsUiImpl(this));
            ClientEncryptionServiceProvider.SetEncryptionPasswordProvider(
                new MissingEncryptionPasswordPromptHandler(this));

            mPlasticAPI = new PlasticAPI();

            mPingEventLoop      = new PingEventLoop();
            mEventSenderRestApi = new SimpleEventSenderRestApi(
                PlasticWebApiUris.GetBaseUri());
            mEventSenderScheduler = EventTracking.Configure(
                mEventSenderRestApi,
                ApplicationIdentifier.UnityPackage,
                IdentifyEventPlatform.Get());

            if (mEventSenderScheduler != null)
            {
                mPingEventLoop.Start();
            }

            InitializePlastic();

            EditorApplication.update += AutoCommitOperation.AutoCommit;
        }
Exemple #30
0
        public void gui_render(float elapsedTime)
        {
            // ------------------------------------------------
            GuiMessage msg = gui.Update(elapsedTime);

            // proceso el msg
            switch (msg.message)
            {
            case MessageType.WM_COMMAND:
                switch (msg.id)
                {
                case IDOK:
                case IDCANCEL:
                    // Resultados OK, y CANCEL del ultimo messagebox
                    gui.EndDialog();

                    if (dialog_sel == 1)
                    {
                        // Estaba en el dialogo de configurar, paso al dialogo principal
                        dialog_sel = 0;
                    }
                    break;

                case ID_SCOUT:
                    // Abro un nuevo dialogo
                    Configurar();
                    break;

                default:
                    break;
                }
                break;

            default:
                break;
            }
            gui.Render();
        }
 public void AddTextureDragEvent(GuiMessage message)
 {
     mTextureDisplayArea.Dragging += message;
 }
        public static void AskIfChangesShouldBeApplied(GuiMessage extraMessage)
        {
            OkCancelWindow tempBox = GuiManager.ShowOkCancelWindow("Apply changes to grid?", "Grid Update");
            tempBox.OkClick += new GuiMessage(SpriteGridGuiMessages.updateSpriteGridOk);
            tempBox.CancelClick += new GuiMessage(SpriteGridGuiMessages.updateSpriteGridCancel);

            if (extraMessage != null)
            {
                tempBox.OkClick += extraMessage;
            }
        }
        //public MultiButtonMessageBox(SpriteFrame baseWindow, SpriteFrame buttonBlueprint,
        //    Cursor cursor) :
        //    base(baseWindow, cursor)
        //{
        //    buttonArray = new WindowArray();

        //    this.textObject = TextManager.AddText("");

        //    this.buttonBlueprint = buttonBlueprint;

        //    SpriteManager.RemoveSpriteFrame(buttonBlueprint);

        //    GuiManagerDrawn = false;

        //}

        #endregion

        public void AddButton(string buttonText, GuiMessage message)
		{
            Button buttonAdded;

            if (this.GuiManagerDrawn)
            {
                buttonAdded = new Button(mCursor);
                this.AddWindow(buttonAdded);

            }
            else
            {
                throw new NotImplementedException("Haven't implemented GuiSkin support for MultiButtonMessageBoxes yet");
                //buttonAdded = base.AddButton(this.buttonBlueprint.Clone());
                //buttonAdded.SpriteFrame.Z = this.SpriteFrame.Z - .01f;
                //SpriteManager.AddSpriteFrame(buttonAdded.SpriteFrame);
            }


            buttonAdded.Text = buttonText;

            AddButton(buttonAdded);

            // This used to be made invisible - I don't know why - we should close it!
            buttonAdded.Click += new GuiMessage(RemoveThis);
            buttonAdded.Click += message;
        }
        public ModelAnimationControlWindow(PositionedModel model)
            : base(GuiManager.Cursor)
        {
            // Set Window properties
            HasMoveBar = true;
            Resizable = true;
            HasCloseButton = true;
            
            // Set scaling
            ScaleX = 20f;

            // Add combo boxes
            mCurrentAnimation = new ComboBox(mCursor);
            AddWindow(mCurrentAnimation);

            mBlendAnimation = new ComboBox(mCursor);
            AddWindow(mBlendAnimation);

            mCurrentAnimation.ItemClick += new GuiMessage(mCurrentAnimation_ItemClick);
            mBlendAnimation.ItemClick += new GuiMessage(mBlendAnimation_ItemClick);

            // Add text
            mCurrentAnimationText = new TextDisplay(mCursor);
            AddWindow(mCurrentAnimationText);

            mBlendAnimationText = new TextDisplay(mCursor);
            AddWindow(mBlendAnimationText);

            mCurrentAnimationText.Text = "Current Animation";
            mBlendAnimationText.Text = "Blend Animation";

            // Blend controller
            mBlendController = new TimeLine(GuiManager.Cursor);
            this.AddWindow(mBlendController);
            mBlendController.ScaleX = 18f;
            mBlendController.MinimumValue = 0.0;
            mBlendController.MaximumValue = 1.0;
            mBlendController.Start = 0.0;
            mBlendController.ValueWidth = 1.0;
            mBlendController.VerticalBarIncrement = 0.1;
            mBlendController.CurrentValue = 0.0;
            mBlendController.GuiChange += new GuiMessage(mBlendController_onGUIChange);

            // Animation timings
            mAnimationTime = new TimeLine(GuiManager.Cursor);
            this.AddWindow(mAnimationTime);
            mAnimationTime.ScaleX = 9f;
            mAnimationTime.VerticalBarIncrement = 0.2;
            mAnimationTime.SmallVerticalBarIncrement = 0.1;
            mAnimationTime.ValueWidth = 1;
            mAnimationTime.GuiChange += new GuiMessage(mAnimationTime_onGUIChange);

            mBlendTime = new TimeLine(GuiManager.Cursor);
            this.AddWindow(mBlendTime);
            mBlendTime.ScaleX = 9f;
            mBlendTime.VerticalBarIncrement = 0.2;
            mBlendTime.SmallVerticalBarIncrement = 0.1;
            mBlendTime.ValueWidth = 1;
            mBlendTime.GuiChange += new GuiMessage(mBlendTime_onGUIChange);

            // Animation speeds
            mAnimationSpeed = new TimeLine(GuiManager.Cursor);
            this.AddWindow(mAnimationSpeed);
            mAnimationSpeed.ScaleX = 9f;
            mAnimationSpeed.MinimumValue = 0.0;
            mAnimationSpeed.MaximumValue = 2.0;
            mAnimationSpeed.Start = 0.0;
            mAnimationSpeed.ValueWidth = 2.0;
            mAnimationSpeed.VerticalBarIncrement = 0.5;
            mAnimationSpeed.SmallVerticalBarIncrement = 0.1;
            mAnimationSpeed.CurrentValue = 1.0;
            mAnimationSpeed.GuiChange += new GuiMessage(mAnimationSpeed_onGUIChange);

            mBlendSpeed = new TimeLine(GuiManager.Cursor);
            this.AddWindow(mBlendSpeed);
            mBlendSpeed.ScaleX = 9f;
            mBlendSpeed.MinimumValue = 0.0;
            mBlendSpeed.MaximumValue = 2.0;
            mBlendSpeed.Start = 0.0;
            mBlendSpeed.ValueWidth = 2.0;
            mBlendSpeed.VerticalBarIncrement = 0.5;
            mBlendSpeed.SmallVerticalBarIncrement = 0.1;
            mBlendSpeed.CurrentValue = 1.0;
            mBlendSpeed.GuiChange += new GuiMessage(mBlendSpeed_onGUIChange);

            mAnimationStopStart = new Button(GuiManager.Cursor);
            this.AddWindow(mAnimationStopStart);
            mAnimationStopStart.ScaleX = 5f;
            mAnimationStopStart.Text = "Stop";
            mAnimationStopStart.Click += new GuiMessage(mAnimationStopStart_Click);

            // Set scaling
            mCurrentAnimation.ScaleX = 9f;
            mBlendAnimation.ScaleX = 9f;
            mCurrentAnimationText.ScaleY = 1f;// mCurrentAnimation.ScaleY;
            mCurrentAnimationText.ScaleX = mCurrentAnimation.ScaleX;
            mBlendAnimationText.ScaleY = 1f;// mBlendAnimation.ScaleY;
            mBlendAnimationText.ScaleX = mBlendAnimation.ScaleX;

            ScaleY = mCurrentAnimationText.ScaleY + mCurrentAnimation.ScaleY +
                2f * mBlendController.ScaleY + 2f * mAnimationTime.ScaleY +
                2f * mAnimationSpeed.ScaleY + 2f * mAnimationStopStart.ScaleY +
                .5f;
            ScaleX = (mCurrentAnimation.ScaleX + mBlendAnimation.ScaleX) + 4.5f / 2f;

            PositionUIElements();

            Resizing += new GuiMessage(AnimationEditor_Resizing);

            // Add model
            PositionedModel = model;
        }
        public WindowArrayVisibilityListBox(Cursor cursor) : 
            base(cursor)
		{
			Click += new GuiMessage(SelectWindowArrayVisibility);

			windowScls = new List<Vector2>();
        }
 public void AddToListClickEventAdd(GuiMessage AddToListClick)
 {
     mAddToListButton.Click += AddToListClick;
 }
Exemple #37
0
 public void AddToCallGuiCallList(GuiMessage add)
 {
     GuiCallList.Remove(add);
     GuiCallList.Add(add);
 }
Exemple #38
0
        public static bool AskQuestionsAndDelaySaveIfNecessary(GuiMessage guiMessage)
        {
            if (SESpriteGridManager.CurrentSpriteGrid != null && SESpriteGridManager.HasBlueprintChanged())
            {
                SESpriteGridManager.AskIfChangesShouldBeApplied(guiMessage);
                return false;
            }
            else
            {
                return true;
            }

        }