コード例 #1
0
        // on click, take quest info from bar and pass to a quest ui.
        private void infoBar_Click(object sender, EventArgs e)
        {
            QuestInfoBarUI infoBar = sender as QuestInfoBarUI;

            if (infoBar != null)
            {
                // make sure the current quest isnt already loaded!
                if (questUI.LoadedQuest != infoBar.LoadedQuest)
                {
                    // get last bar and set that to black
                    // set new one to purple
                    // set last to new.

                    if (currentInfoBar != null)
                    {
                        currentInfoBar.DefaultBorder = new BorderInfo(1, Color.Black);
                    }

                    infoBar.DefaultBorder = new BorderInfo(5, Color.Purple);
                    currentInfoBar        = infoBar;

                    //infoBar.DefaultBorder = new BorderInfo(1, Color.Purple);

                    // load the quest
                    questUI.Load(infoBar.LoadedQuest);

                    // load visuals
                    //questUI.LoadVisuals(Game1.Instance.Content, Game1.Instance.GraphicsDevice);

                    // highlight this infobar.
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// WARNING, hard coded for only 4 quest info bars to display at a time!!
        /// </summary>
        /// <param name="log"></param>
        public void Load(QuestLog log)
        {
            questInfoBars.Clear();
            int count = 0;

            botIndex = 0;
            foreach (Quest quest in log)
            {
                if (count == 4)
                {
                    count = 0;
                }

                QuestInfoBarUI infoBar = new QuestInfoBarUI(new Vector2(200, 80));
                infoBar.Location  = new Vector2(questBarsContainer.Size.X / 2 - infoBar.Size.X / 2, infoBar.Size.Y * count);
                infoBar.Alignment = ControlAlignment.Left;
                infoBar.parent    = questBarsContainer;
                infoBar.Click    += infoBar_Click;
                infoBar.Load(quest);
                //infoBar.LoadVisuals();

                if (questInfoBars.Count < 4)
                {
                    questBarsContainer.Add(infoBar);
                    topIndex = 4;
                    //currentIndex = 4;
                }

                questInfoBars.Add(infoBar);
                count++;
            }
            currentPageLabel.Text = String.Format(currentPageLabel.Text, 1, Math.Ceiling(questInfoBars.Count / 4.0));
            questLog = log;
        }
コード例 #3
0
        // on click, take quest info from bar and pass to a quest ui.
        private void infoBar_Click(object sender, EventArgs e)
        {
            QuestInfoBarUI infoBar = sender as QuestInfoBarUI;
            if(infoBar != null)
            {
                // make sure the current quest isnt already loaded!
                if (questUI.LoadedQuest != infoBar.LoadedQuest)
                {

                    // get last bar and set that to black
                    // set new one to purple
                    // set last to new.

                    if(currentInfoBar != null)
                        currentInfoBar.DefaultBorder = new BorderInfo(1, Color.Black);

                    infoBar.DefaultBorder = new BorderInfo(5, Color.Purple);
                    currentInfoBar = infoBar;

                    //infoBar.DefaultBorder = new BorderInfo(1, Color.Purple);

                    // load the quest
                    questUI.Load(infoBar.LoadedQuest);

                    // load visuals
                    //questUI.LoadVisuals(Game1.Instance.Content, Game1.Instance.GraphicsDevice);

                    // highlight this infobar.

                }
            }
        }
コード例 #4
0
        /// <summary>
        /// WARNING, hard coded for only 4 quest info bars to display at a time!!
        /// </summary>
        /// <param name="log"></param>
        public void Load(QuestLog log)
        {
            questInfoBars.Clear();
            int count = 0;
            botIndex = 0;
            foreach(Quest quest in log)
            {
                if (count == 4)
                    count = 0;

                QuestInfoBarUI infoBar = new QuestInfoBarUI(new Vector2(200, 80));
                infoBar.Location = new Vector2(questBarsContainer.Size.X / 2 - infoBar.Size.X / 2, infoBar.Size.Y * count);
                infoBar.Alignment = ControlAlignment.Left;
                infoBar.parent = questBarsContainer;
                infoBar.Click += infoBar_Click;
                infoBar.Load(quest);
                //infoBar.LoadVisuals();

                if (questInfoBars.Count < 4)
                {
                    questBarsContainer.Add(infoBar);
                    topIndex = 4;
                    //currentIndex = 4;
                }

                questInfoBars.Add(infoBar);
                count++;
            }
            currentPageLabel.Text = String.Format(currentPageLabel.Text, 1, Math.Ceiling(questInfoBars.Count / 4.0));
            questLog = log;
        }