Exemple #1
0
        public ControlGroup CreateOptionGroupControl(int ind, Func <int, bool> ResponseFunc)
        {
            ControlGroup c = new ControlGroup(new Point(Location.X, Location.Y + Offset + QuestionTextHeight + Offset + ind * (OptionHeight + Offset)));

            c.Add(new RelativeLabel(new Point(Offset, 0), new Size(OptionHeight, OptionHeight)), "ButtonLabel");
            c.Add(new RelativeLabel(new Point(Offset + OptionHeight + Offset, 0), new Size(GroupSize.Width - 3 * Offset - OptionHeight, OptionHeight)), "TextLabel");

            c.GetControl("TextLabel").Text     = AllOptions[ind];
            c.GetControl("ButtonLabel").Click += delegate(object sender, EventArgs e)
            {
                ResponseFunc(ind);
                Dispose();
            };

            bool KeywordFound = false;

            string[] Keywords = ButtonImages.Keys.ToArray();
            foreach (string kw in Keywords)
            {
                if (KeywordFound = AllOptions[ind].Contains(kw))
                {
                    c.GetControl("ButtonLabel").BackgroundImage = ButtonImages[kw];
                    break;
                }
            }
            if (!KeywordFound)
            {
                c.GetControl("ButtonLabel").BackgroundImage = ButtonImages["misc"];
            }

            return(c);
        }
Exemple #2
0
 void InitControlGroup(ControlGroup c)         //Add the controls of a ControlGroup
 {
     foreach (ControlGroup c2 in c.SubGroups)
     {
         InitControlGroup(c2);
     }
     this.Controls.AddRange(c.Controls);
     c.Visible  = c.Visible;
     c.Location = c.Location;
     try
     {
         c.GetControl("BackgroundLabel").SendToBack();
     }
     catch {}
 }
Exemple #3
0
        public ControlGroup CreateQuestGroupControl(Quest quest, Player player, int SlotNum, int SpecOffset)
        {
            ControlGroup c = new ControlGroup(new Point(Location.X, SlotNum * (Height + Offset) + SideMenu.EndPoint.Y + 2 * Offset + NameLabelHeight + SpecOffset));

            c.Add(new RelativeLabel(new Point(Offset, 0), new Size(Height, Height)), "ImageLabel");
            c.Add(new RelativeLabel(new Point(Offset + Height + Offset, 0), new Size(Width - 3 * Offset - Height, 50)), "TextLabel");
            c.Add(new RelativeLabel(new Point(Offset + Height + Offset, 50), new Size(Width - 3 * Offset - Height, 50)), "RequirementsLabel");

            string[] TextBuf = QuestText(quest, player);

            c.GetControl("TextLabel").Text             = TextBuf[0];
            c.GetControl("RequirementsLabel").Text     = TextBuf[1];
            c.GetControl("ImageLabel").BackgroundImage = Character.GetCharacter(quest.CharacterID).CharacterImage;

            return(c);
        }
Exemple #4
0
 //Add the controls of a ControlGroup
 void InitControlGroup(ControlGroup c)
 {
     foreach (ControlGroup c2 in c.SubGroups)
     {
         InitControlGroup(c2);
     }
     this.Controls.AddRange(c.Controls);
     c.Visible = c.Visible;
     c.Location = c.Location;
     try
     {
         c.GetControl("BackgroundLabel").SendToBack();
     }
     catch{}
 }
Exemple #5
0
        public ControlGroup CreateOptionGroupControl(int ind, Func<int,bool> ResponseFunc)
        {
            ControlGroup c = new ControlGroup(new Point(Location.X,Location.Y + Offset + QuestionTextHeight + Offset + ind * (OptionHeight+Offset) ));

            c.Add(new RelativeLabel(new Point(Offset,0), new Size(OptionHeight,OptionHeight)), "ButtonLabel");
            c.Add(new RelativeLabel(new Point(Offset+OptionHeight+Offset,0),new Size(GroupSize.Width-3*Offset-OptionHeight,OptionHeight)),"TextLabel");

            c.GetControl("TextLabel").Text = AllOptions[ind];
            c.GetControl("ButtonLabel").Click += delegate(object sender, EventArgs e)
            {
                ResponseFunc(ind);
                Dispose();
            };

            bool KeywordFound = false;
            string[] Keywords = ButtonImages.Keys.ToArray();
            foreach (string kw in Keywords)
            {
                if (KeywordFound = AllOptions[ind].Contains(kw))
                {
                    c.GetControl("ButtonLabel").BackgroundImage = ButtonImages[kw];
                    break;
                }
            }
            if (!KeywordFound)
                c.GetControl("ButtonLabel").BackgroundImage = ButtonImages["misc"];

            return c;
        }
Exemple #6
0
        public ControlGroup CreateQuestGroupControl(Quest quest, Player player, int SlotNum, int SpecOffset)
        {
            ControlGroup c = new ControlGroup(new Point(Location.X,SlotNum*(Height+Offset)+SideMenu.EndPoint.Y+2*Offset+NameLabelHeight+SpecOffset));

            c.Add(new RelativeLabel(new Point(Offset,0), new Size(Height,Height)), "ImageLabel");
            c.Add(new RelativeLabel(new Point(Offset+Height+Offset,0),new Size(Width-3*Offset-Height,50)),"TextLabel");
            c.Add(new RelativeLabel(new Point(Offset+Height+Offset,50),new Size(Width-3*Offset-Height,50)),"RequirementsLabel");

            string[] TextBuf = QuestText(quest,player);

            c.GetControl("TextLabel").Text = TextBuf[0];
            c.GetControl("RequirementsLabel").Text = TextBuf[1];
            c.GetControl("ImageLabel").BackgroundImage = Character.GetCharacter(quest.CharacterID).CharacterImage;

            return c;
        }
Exemple #7
0
 public void Add(ControlGroup c)
 {
     Array.Resize(ref _SubGroups, _SubGroups.Length + 1);
     _SubGroups[_SubGroups.Length - 1] = c;
 }
Exemple #8
0
 public void Add(ControlGroup c)
 {
     Array.Resize(ref _SubGroups,_SubGroups.Length+1);
     _SubGroups[_SubGroups.Length-1] = c;
 }