Ejemplo n.º 1
0
        public void RaiseWarning(string message)
        {
            var warning = new PopupNotification()
            {
                PopupType    = "Warning",
                PopupMessage = message,
                IsEnabled    = false,
                Opacity      = 0.9
            };

            if (PopupPanel.Children.Count >= 3)
            {
                PopupPanel.Children.RemoveRange(0, PopupPanel.Children.Count - 2);
            }
            PopupPanel.Children.Add(warning);
            Task.Run(new Action(() =>
            {
                Thread.Sleep(5000);
                double op = 0;
                Dispatcher.Invoke(new Action(() => { op = warning.Opacity; }));
                while (op > 0)
                {
                    op -= 0.1;
                    if (op < 0)
                    {
                        op = 0;
                    }
                    Dispatcher.Invoke(new Action(() => { try { warning.Opacity = op; } catch (Exception) { } }));
                    Thread.Sleep(50);
                }
                Dispatcher.Invoke(new Action(() => { PopupPanel.Children.Remove(warning); }));
            }));
        }
Ejemplo n.º 2
0
    public override void click()
    {
        if (is_paused)
        {
            return;
        }

        if (clock.Press())
        {
            GetComponent <Animator>().SetTrigger("bounce");
            if (last_popup != null)
            {
                last_popup.animation_controller.SetTrigger("drop");
            }

            if (history_manager.is_empty())
            {
                is_paused = true;
                date.text = "2017 AD";
                world_animation_controller.SetTrigger("boss");
            }
            else
            {
                var historical_event = history_manager.get_next_event();
                date.text = historical_event.time;
                var popup = Instantiate(notification_prefab, this.transform);
                popup.activate(historical_event.text, Color.green);
                last_popup = popup;
                if (sprite_index < dude_sprites.Length && timing == timings[sprite_index])
                {
                    dude_sprite_renderer.sprite = dude_sprites[sprite_index];
                    sprite_index++;
                }
                timing++;

                if (historical_event.minigame != null)
                {
                    var minigame = historical_event.minigame;
                    minigame.start_minigame(this);
                    do_enable_actor(false);
                }

                clock.speed += 0.17f;
            }
        }
        else
        {
            if (last_popup != null)
            {
                last_popup.animation_controller.SetTrigger("drop");
            }

            GetComponent <Animator>().SetTrigger("bzz");
            var popup = Instantiate(notification_prefab, this.transform);
            popup.activate("Too early !", Color.red);

            last_popup = popup;
        }
    }
Ejemplo n.º 3
0
        private void PopupWindowRequestCallback(PopupNotification n)
        {
            var list = n.PopupRegionManager.Regions.Select(r => r.Name).ToList();
            var ret  = list.Aggregate(true, (b, name) => b && n.PopupRegionManager.Regions.Remove(name));

            if (ret == false)
            {
                System.Windows.MessageBox.Show("IRegionのRemoveに失敗");
            }
        }
Ejemplo n.º 4
0
    public void PopUpFollowerIsAlreadyonQuest()
    {
        PopupNotification.SetActive(true);

        GameObject.Find("PopupText").GetComponent <Text>().text = "Follower is already on a Quest.";
        GameObject.Find("FollowerSlots").GetComponent <FollowerSlotsManager>().ActiveFollowerSlotID = 0;
        if (NodeisActive == true)
        {
            ResetNodeIDofFollower();
        }
    }
Ejemplo n.º 5
0
    private void Start()
    {
        //GameObject.Find("TestNPCList").GetComponent<TestNPCList>().FollowerIDnumber = 0;

        gameObject.GetComponent <Button>().onClick.AddListener(ShowQuest);
        PopupNotification.GetComponent <Button>().onClick.AddListener(KillPopup);
        SendFollowertoQuest.GetComponent <Button>().onClick.AddListener(SendFollower);
        QuestDiplomacyMenuButton.GetComponent <Button>().onClick.AddListener(TurnoffNode);
        QuestMenuExitButton.GetComponent <Button>().onClick.AddListener(TurnoffQuestMenu);

        TimerBaar = GameObject.Find("TimerBaar");
    }
Ejemplo n.º 6
0
 private void ClickHereCommandHandler(object obj)
 {
     popupNotification         = new PopupNotification();
     popupNotification.Message = "You Clicked Test View 1 Button. Thankyou!!!";
     popupNotification.Title   = "Test View 1 Popup";
     Application.Current.Dispatcher.Invoke(() =>
     {
         this.PopupNotificationRequest.Raise(popupNotification, returned =>
         {
             if (returned.Confirmed)
             {
                 //Perform some action..
             }
         });
     });
 }
Ejemplo n.º 7
0
        internal static void TrayPopup(string title, string message, NotifyUserType type, bool sound, Image image = null, int timeoutSec = 10, MouseEventHandler onClick = null)
        {
            MainWindow.Instance.BeginInvoke((MethodInvoker) delegate
            {
#pragma warning disable CC0022
                var trayPopup = new PopupNotification(title, message, image, Settings2.Instance.StyleColor);
#pragma warning restore CC0022
                if (image == null)
                {
                    if (type == NotifyUserType.Error)
                    {
                        trayPopup.Icon = Resources.DialogError;
                    }
                    else if (type == NotifyUserType.Warn)
                    {
                        trayPopup.Icon = Resources.DialogWarning;
                    }
                    else
                    {
                        trayPopup.Icon = Resources.DialogInfo;
                    }
                }
                if (onClick != null)
                {
                    trayPopup.Click += onClick;
                    trayPopup.Click += (sender, args) => trayPopup.Close();
                }
                trayPopup.Show(timeoutSec);
                if (sound)
                {
                    if (type == NotifyUserType.Error || type == NotifyUserType.Warn)
                    {
                        Utils.PlaySystemExclamationAsync();
                    }
                    else
                    {
                        Utils.PlaySystemNotificationAsync();
                    }
                }
            });
        }
Ejemplo n.º 8
0
    //POPUPS...POPUPS...POPUPS...POPUPS...POPUPS...POPUPS...POPUPS...POPUPS...POPUPS...POPUPS...POPUPS...POPUPS...POPUPS...POPUPS...POPUPS...POPUPS...POPUPS...POPUPS...POPUPS

    void PopUpActiveQuestStatus()
    {
        if (QuestisDone == true) //WHEN THE QUEST IS FINISHED
        {
            ReapRewards();
        }


        else
        {
            GameObject.Find("QuestList").GetComponent <QuestList>().FetchQuest(QuestNumber);
            GameObject Follower = GameObject.Find("FollowerSlots").GetComponent <FollowerSlotsManager>().FetchFollowerSlotDetails(IDofFollowerdoingQuest); //MINUS 1 BECAUSE ALL ARRAYS START FROM ZERO

            PopupNotification.SetActive(true);
            GameObject.Find("PopupText").GetComponent <Text>().text = "The Quest is currently being fulfilled by " + Follower.GetComponent <FollowerSlot>().FollowerRace
                                                                      + " " + Follower.GetComponent <FollowerSlot>().FollowerClass + " "
                                                                      + Follower.GetComponent <FollowerSlot>().FollowerName + "\nDays Left = "
                                                                      + (QuestTimeRequired - (TimerBaar.GetComponent <Timer2>().calen - QuestTimeStart));
            ResetQuestIDofFollower();
        }
    }
Ejemplo n.º 9
0
    //REAP THE REWARDS OF THE QUEST. CALLS SUBMIT QUESTREWARDS IN QUESTLISTS WHICH THEN CALLS UPDATEREWARDSINTOPOOL IN QUESTDIPLOMACYMANAGER
    void ReapRewards()
    {
        //SETTING UP THE RELEVANT FOLLOWER FOR THE QUESTLIST REWARD
        GameObject.Find("FollowerSlots").GetComponent <FollowerSlotsManager>().ActiveFollowerSlotID = IDofFollowerdoingQuest;
        GameObject.Find("QuestList").GetComponent <QuestList>().SetFollowerDetails();

        GameObject.Find("FollowerSlots").GetComponent <FollowerSlotsManager>().ChangeFollowerStatebetweenBusyandIdle(IDofFollowerdoingQuest);
        GameObject.Find("QuestList").GetComponent <QuestList>().FetchQuest(QuestNumber);
        PopupNotification.SetActive(true);

        GameObject.Find("PopupText").GetComponent <Text>().text = GameObject.Find("QuestList").GetComponent <QuestList>().ListofRewards;
        GameObject.Find("QuestList").GetComponent <QuestList>().SubmitQuestRewards();

        QuestisActive = false;
        QuestisDone   = false;
        ChangeColourofNode();


        ResetNodeIDofFollower();
        gameObject.SetActive(false);
    }
Ejemplo n.º 10
0
        public void RaiseError(string message)
        {
            var error = new PopupNotification()
            {
                PopupType        = "Error",
                PopupMessage     = message,
                IsEnabled        = false,
                IsHitTestVisible = false,
                Opacity          = 0.9
            };

            if (PopupPanel.Children.Count >= 3)
            {
                PopupPanel.Children.RemoveRange(0, PopupPanel.Children.Count - 2);
            }
            PopupPanel.Children.Add(error);
            Task.Run(new Action(() =>
            {
                Thread.Sleep(5000);
                double op = 0;
                Dispatcher.Invoke(new Action(() => { try { op = error.Opacity; } catch (Exception) { } }));
                while (op > 0)
                {
                    op -= 0.1;
                    if (op < 0)
                    {
                        op = 0;
                    }
                    Dispatcher.Invoke(new Action(() =>
                    {
                        error.Opacity = op;
                    }));
                    Thread.Sleep(50);
                }
                Dispatcher.Invoke(new Action(() => { PopupPanel.Children.Remove(error); }));
            }));
        }
Ejemplo n.º 11
0
 public PopupStep(ProductsSteps productSteps, PopupNotification popupNotification)
 {
     this.popupNotification = popupNotification;
     this.productSteps      = productSteps;
 }
Ejemplo n.º 12
0
 void KillPopup()
 {
     PopupNotification.SetActive(false);
 }
Ejemplo n.º 13
0
 void PopUpNoFollowerSelected()
 {
     PopupNotification.SetActive(true);
     GameObject.Find("PopupText").GetComponent <Text>().text = "No follower selected.";
 }
Ejemplo n.º 14
0
        public override void SetContext(StepEditContext context, PopupNotification notification)
        {
            base.SetContext(context, notification);

            //Nothing to do here...
        }
Ejemplo n.º 15
0
 public PopupNotificationEditor(StepEditContext context, PopupNotification notification)
     : this()
 {
     this.SetContext(context, notification);
 }