示例#1
0
        void GUITick(object sender, EventArgs e)
        {
            LoginLoaderRotation.Angle += 5;
            UserAvatarLoaderRotation.Angle += 5;
            if (!FirstSetup)
            {
                List<Utils.Schedule.Task> Tasks = Utils.Schedule.GetTasks("GUI");
                foreach (Utils.Schedule.Task task in Tasks)
                {
                    if (!task.BeingHandled)
                    {
                        switch (task.Name)
                        {
                            case "SpecifyGamePath":
                                ModAPI.Windows.SubWindows.SpecifyGamePath win = new ModAPI.Windows.SubWindows.SpecifyGamePath("Lang.Windows.SpecifyGamePath", task);
                                win.ShowSubWindow();
                                //win.Show();
                                task.BeingHandled = true;
                                break;
                            case "SpecifySteamPath":
                                ModAPI.Windows.SubWindows.SpecifySteamPath win2 = new ModAPI.Windows.SubWindows.SpecifySteamPath("Lang.Windows.SpecifySteamPath", task);
                                win2.ShowSubWindow();
                                //win2.Show();
                                task.BeingHandled = true;
                                break;
                            case "RestoreGameFiles":
                                ModAPI.Windows.SubWindows.RestoreGameFiles win3 = new ModAPI.Windows.SubWindows.RestoreGameFiles("Lang.Windows.RestoreGameFiles", task);
                                win3.ShowSubWindow();
                                //win3.Show();
                                task.BeingHandled = true;
                                break;
                            case "OperationPending":
                                ModAPI.Windows.SubWindows.OperationPending win4 = new ModAPI.Windows.SubWindows.OperationPending("Lang.Windows.OperationPending", task);
                                if (!win4.Completed)
                                {
                                    win4.ShowSubWindow();
                                  //  win4.Show();
                                }
                                task.BeingHandled = true;
                                break;
                            case "SelectNewestModVersions":
                                if (Mods != null)
                                {
                                    Mods.SelectNewestModVersions = true;
                                    task.BeingHandled = true;
                                }
                                break;
                        }
                    }
                }
            }
            if (BlendIn)
            {
                if (Opacity < 1f)
                {
                    Opacity += GUIDeltaTime * 5f;
                    if (Opacity >= 1f)
                    {
                        Opacity = 1f;
                    }
                }
            }

            if (currentWindow != null)
            {
                if (FadeBackground.Visibility == System.Windows.Visibility.Collapsed)
                    FadeBackground.Visibility = System.Windows.Visibility.Visible;
                if (FadeBackground.Opacity < 0.8f)
                {
                    FadeBackground.Opacity += GUIDeltaTime * 5f;
                    if (FadeBackground.Opacity >= 0.8f)
                    {
                        FadeBackground.Opacity = 0.8f;
                    }
                }
            }
            else
            {
                if (FadeBackground.Opacity > 0f)
                {
                    FadeBackground.Opacity -= GUIDeltaTime * 5f;
                    if (FadeBackground.Opacity <= 0f)
                    {
                        FadeBackground.Opacity = 0f;
                        FadeBackground.Visibility = System.Windows.Visibility.Collapsed;
                    }
                }
            }
        }
示例#2
0
        void GUITick(object sender, EventArgs e)
        {
            LoginLoaderRotation.Angle      += 5;
            UserAvatarLoaderRotation.Angle += 5;
            if (!FirstSetup)
            {
                List <Utils.Schedule.Task> Tasks = Utils.Schedule.GetTasks("GUI");
                foreach (Utils.Schedule.Task task in Tasks)
                {
                    if (!task.BeingHandled)
                    {
                        switch (task.Name)
                        {
                        case "SpecifyGamePath":
                            ModAPI.Windows.SubWindows.SpecifyGamePath win = new ModAPI.Windows.SubWindows.SpecifyGamePath("Lang.Windows.SpecifyGamePath", task);
                            win.ShowSubWindow();
                            //win.Show();
                            task.BeingHandled = true;
                            break;

                        case "SpecifySteamPath":
                            ModAPI.Windows.SubWindows.SpecifySteamPath win2 = new ModAPI.Windows.SubWindows.SpecifySteamPath("Lang.Windows.SpecifySteamPath", task);
                            win2.ShowSubWindow();
                            //win2.Show();
                            task.BeingHandled = true;
                            break;

                        case "RestoreGameFiles":
                            ModAPI.Windows.SubWindows.RestoreGameFiles win3 = new ModAPI.Windows.SubWindows.RestoreGameFiles("Lang.Windows.RestoreGameFiles", task);
                            win3.ShowSubWindow();
                            //win3.Show();
                            task.BeingHandled = true;
                            break;

                        case "OperationPending":
                            ModAPI.Windows.SubWindows.OperationPending win4 = new ModAPI.Windows.SubWindows.OperationPending("Lang.Windows.OperationPending", task);
                            if (!win4.Completed)
                            {
                                win4.ShowSubWindow();
                                //  win4.Show();
                            }
                            task.BeingHandled = true;
                            break;

                        case "SelectNewestModVersions":
                            if (Mods != null)
                            {
                                Mods.SelectNewestModVersions = true;
                                task.BeingHandled            = true;
                            }
                            break;
                        }
                    }
                }
            }
            if (BlendIn)
            {
                if (Opacity < 1f)
                {
                    Opacity += GUIDeltaTime * 5f;
                    if (Opacity >= 1f)
                    {
                        Opacity = 1f;
                    }
                }
            }

            if (currentWindow != null)
            {
                if (FadeBackground.Visibility == System.Windows.Visibility.Collapsed)
                {
                    FadeBackground.Visibility = System.Windows.Visibility.Visible;
                }
                if (FadeBackground.Opacity < 0.8f)
                {
                    FadeBackground.Opacity += GUIDeltaTime * 5f;
                    if (FadeBackground.Opacity >= 0.8f)
                    {
                        FadeBackground.Opacity = 0.8f;
                    }
                }
            }
            else
            {
                if (FadeBackground.Opacity > 0f)
                {
                    FadeBackground.Opacity -= GUIDeltaTime * 5f;
                    if (FadeBackground.Opacity <= 0f)
                    {
                        FadeBackground.Opacity    = 0f;
                        FadeBackground.Visibility = System.Windows.Visibility.Collapsed;
                    }
                }
            }
        }