private void OnShowDialog(object sender, EventArgs e)
        {
            var application = (DTE)GetService(typeof(SDTE));

            if (application.Solution == null || !application.Solution.IsOpen)
            {
                MessageBox.Show("Please open a solution first. ", "No solution", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                if (application.Solution.IsDirty) // solution must be saved otherwise adding/removing projects will raise errors
                {
                    MessageBox.Show("Please save your solution first. \n" +
                                    "Select the solution in the Solution Explorer and press Ctrl-S. ",
                                    "Solution not saved", MessageBoxButton.OK, MessageBoxImage.Stop);
                }
                else if (application.Solution.Projects.OfType <Project>().Any(p => p.IsDirty))
                {
                    MessageBox.Show("Please save your projects first. \n" +
                                    "Select the project in the Solution Explorer and press Ctrl-S. ",
                                    "Project not saved");
                }
                else
                {
                    var window = new MainDialog(application, GetType().Assembly);
                    var helper = new WindowInteropHelper(window);
                    helper.Owner = (IntPtr)application.MainWindow.HWnd;
                    window.ShowDialog();
                }
            }
        }
Пример #2
0
    void Update()
    {
        if (isShown && Input.GetKeyDown(KeyCode.Space))
        {
            GameObject go = GameObject.Find("Player");
            go.GetComponent <CharacterMovement>().canMove = true;
            if (assetName == "pitch")
            {
                Asset      info    = collectionCore.GetAssetInfoByName("pitch");
                string[]   pitches = ((string)(info.GetCustom("title", ""))).Split(";" [0]);
                string     pitch   = pitches [Random.Range(0, pitches.Length)];
                GameObject obj     = GameObject.Find("MainDialog");

                MainDialog dialog = obj.GetComponent <MainDialog>();
                dialog.ShowDialog("Now go show Woo your pitch for " + pitch + "!", null, null);

                GameController gameCtrler = (GameController)AppController.Instance.GetController(Controller.GAME);
                gameCtrler.hasPitch = true;
            }

            isShown = false;
            gameObject.SetActive(false);
            Destroy(iconObject);
        }
    }
Пример #3
0
        private static void Main()
        {
            // настройки
            Settings = new Settings("settings.xml");

            System.Environment.SetEnvironmentVariable("NLS_LANG", "AMERICAN_AMERICA.CL8MSWIN1251");

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

#if DEBUG
            //ui_lib.MdiFormBase form = new ui_lib.MdiFormBase();
            //Application.Run(new ui_lib.MdiFormBase());

            // соединение с Oracle
            OracleConnectionStringBuilder oraBuilder = new OracleConnectionStringBuilder
            {
                DataSource = "omega",
                UserID     = "omp_adm",
                Password   = "******"
            };

            OracleConnection connection = new OracleConnection(oraBuilder.ToString());
            connection.Open();

            // контекст
            obj_lib.Module.ConnectionString = oraBuilder.ConnectionString;

            // дополнительное подключение
            obj_lib.Module.Connection = connection;

            // запуск приложения
            Application.Run(new MainForm());
#else
            try
            {
                MainDialog dialog = new MainDialog(
                    Assembly.GetExecutingAssembly().GetName().Version,
                    Settings.Connections);

                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    // соединение с Oracle
                    obj_lib.Module.Connection = dialog.Connection;

                    // контекст
                    obj_lib.Module.ConnectionString = dialog.ConnectionString;

                    // запуск приложения
                    Application.Run(new MainForm());
                }
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
#endif
        }
Пример #4
0
    void OnTriggerEnter(Collider other)
    {
        GameObject obj        = GameObject.Find("MainDialog");
        MainDialog mainDialog = obj.GetComponent <MainDialog>();

        if (!entered && other.gameObject.name == "Player")
        {
            if (assetName != "Woo" && talkCount > 2)
            {
                mainDialog.ShowDialog("Half day!", null, null);
                return;
            }

            GameController gameCtrler = (GameController)AppController.Instance.GetController(Controller.GAME);

            //check if user has won
            if (assetName == "Woo" && gameCtrler.hasPitch)
            {
                gameCtrler.EndGame(true);
                return;
            }

            EnergyController energyCtrler = (EnergyController)AppController.Instance.GetController(Controller.ENERGY);

            string     sku   = (assetName == "Henry") ? "expensive fight" : "fight";
            GachaInput price = GachaInput.GetCachedBySku(sku);

            if (energyCtrler.currentEnergy >= price.Price.Amount)
            {
                int    i      = Random.Range(0, dialogs.Length);
                string dialog = dialogs [i];
                _animator.SetFloat("HorizontalInput", other.gameObject.transform.position.x - transform.position.x);
                _animator.SetFloat("VerticalInput", other.gameObject.transform.position.y - transform.position.y);

                mainDialog.ShowDialog(dialog, asset);
                talkCount++;
                StartCoroutine(CancelAnimation());
            }
            else
            {
                mainDialog.ShowDialog("Go away...", null, null);
            }
        }
    }
Пример #5
0
    public void IsNetworkError(NPNFError error)
    {
        GameObject obj    = GameObject.Find("MainDialog");
        MainDialog dialog = obj.GetComponent <MainDialog>();

        if (error.RequestException == "No such host is known" || error.Messages [0] == "Network not reachable")
        {
            dialog.ShowDialog("Network not reachable. Please check the internet connection and possibly restart the game.", null, null);
        }
    }
Пример #6
0
        public void ShowDialogTest()
        {
            LanguagePair[] languagePairs = new[] { new LanguagePair("en-US", "de-DE"), new LanguagePair("ru-RU", "en-GB") };
            ITranslationProviderCredentialStore translationProviderCredentialStore = null;
            var target = new MainDialog(languagePairs, translationProviderCredentialStore);


            IWin32Window owner = null;

            target.ShowDialog(owner);
        }
Пример #7
0
        /// <summary>
        /// Displays a dialog to interactively browse for one or more translation providers.
        /// </summary>
        /// <param name="owner">The window that will own the dialog</param>
        /// <param name="languagePairs">A collection of language pairs. If provided, the list of available translation providers will be filtered by these language directions.</param>
        /// <param name="credentialStore">A credential store object that can be used to retrieve credentials required.</param>
        /// <returns>
        /// A collection of translation providers selected by the user, or <c>null</c> if none were selected or available or the browse was cancelled.
        /// </returns>
        public ITranslationProvider[] Browse(IWin32Window owner, LanguagePair[] languagePairs, ITranslationProviderCredentialStore credentialStore)
        {
            MainDialog dialog = new MainDialog(languagePairs, credentialStore);
            var        result = dialog.ShowDialog(owner);

            if (result == DialogResult.OK)
            {
                return(new ITranslationProvider[] { dialog.SelectedTranslationProvider });
            }

            return(null);
        }
Пример #8
0
    private void OnUserReady()
    {
        LoadingSpinner.Instance.DisableLoadingSpinner();

        GameObject obj = GameObject.Find("MainDialog");

        MainDialog dialog = obj.GetComponent <MainDialog>();

        dialog.ShowDialog("Let's start your first day at npnf!", null, () => {
            Application.LoadLevel("MainScene");
        });
    }
Пример #9
0
    // Use this for initialization
    void Start()
    {
        hasPitch    = false;
        currentTime = startTime;
        gameEnded   = false;

        int    seconds = (int)(currentTime % 60);
        int    minutes = (int)(currentTime / 60);
        string time    = minutes.ToString("00") + ":" + seconds.ToString("00");

        timer.text = time;

        //uiRoot.SetActive(true);
        GameObject obj    = GameObject.Find("MainDialog");
        MainDialog dialog = obj.GetComponent <MainDialog>();

        dialog.ShowDialog("Welcome to your first day at npnf! Woo expects your first game pitch in 3 minutes! Find the other npnfers to help you with your game pitch.", null, null);
    }
Пример #10
0
 public static void Main()
 {
     MainDialog maindialog = new MainDialog();
     maindialog.ShowDialog();
 }