Esempio n. 1
0
        public GItemList(int serial, int menuID, string question, AnswerEntry[] answers) : base(0x910, 0x19, 0x19)
        {
            this.m_xLast      = -1234;
            this.m_yLast      = -1234;
            this.m_Serial     = serial;
            this.m_MenuID     = menuID;
            this.m_EntryLabel = new GLabel("", Engine.GetFont(1), Hues.Load(0x75f), 0x27, 0x6a);
            base.m_Children.Add(this.m_EntryLabel);
            GLabel toAdd = new GLabel(question, Engine.GetFont(1), Hues.Load(0x75f), 0x27, 0x13);

            toAdd.Scissor(0, 0, 0xda, 11);
            base.m_Children.Add(toAdd);
            int x = 0x25;

            for (int i = 0; i < answers.Length; i++)
            {
                GItemListEntry entry = new GItemListEntry(x, answers[i], this);
                base.m_Children.Add(entry);
                x += entry.Width;
            }
            x -= 0x25;
            if (x >= 0xde)
            {
                this.m_xOffsetCap = -(x - 0xde);
                this.m_Left       = new GItemListScroller(0x17, this, 150);
                this.m_Right      = new GItemListScroller(0x105, this, -150);
                base.m_Children.Add(this.m_Left);
                base.m_Children.Add(this.m_Right);
            }
        }
Esempio n. 2
0
 public GItemList(int serial, int menuID, string question, AnswerEntry[] answers)
     : base(0x910, 0x19, 0x19)
 {
     this.m_xLast = -1234;
     this.m_yLast = -1234;
     this.m_Serial = serial;
     this.m_MenuID = menuID;
     this.m_EntryLabel = new GLabel("", Engine.GetFont(1), Hues.Load(0x75f), 0x27, 0x6a);
     base.m_Children.Add(this.m_EntryLabel);
     GLabel toAdd = new GLabel(question, Engine.GetFont(1), Hues.Load(0x75f), 0x27, 0x13);
     toAdd.Scissor(0, 0, 0xda, 11);
     base.m_Children.Add(toAdd);
     int x = 0x25;
     for (int i = 0; i < answers.Length; i++)
     {
         GItemListEntry entry = new GItemListEntry(x, answers[i], this);
         base.m_Children.Add(entry);
         x += entry.Width;
     }
     x -= 0x25;
     if (x >= 0xde)
     {
         this.m_xOffsetCap = -(x - 0xde);
         this.m_Left = new GItemListScroller(0x17, this, 150);
         this.m_Right = new GItemListScroller(0x105, this, -150);
         base.m_Children.Add(this.m_Left);
         base.m_Children.Add(this.m_Right);
     }
 }
Esempio n. 3
0
 private static bool Parse_HitSpot(XmlTextReader xml, Gump Parent, string Name)
 {
     int x = 0;
     int y = 0;
     int width = 0;
     int height = 0;
     string method = "";
     bool isEmptyElement = xml.IsEmptyElement;
     while (xml.MoveToNextAttribute())
     {
         switch (xml.Name)
         {
             case "X":
             {
                 x = GetInt(xml.Value);
                 continue;
             }
             case "Y":
             {
                 y = GetInt(xml.Value);
                 continue;
             }
             case "Width":
             {
                 width = GetInt(xml.Value);
                 continue;
             }
             case "Height":
             {
                 height = GetInt(xml.Value);
                 continue;
             }
             case "OnClick":
             {
                 method = GetString(xml.Value);
                 continue;
             }
         }
         return false;
     }
     GHitspot toAdd = new GHitspot(x, y, width, height, (OnClick) Delegate.CreateDelegate(typeof(OnClick), typeof(Engine), method));
     Parent.Children.Add(toAdd);
     if (isEmptyElement)
     {
         return true;
     }
     while (xml.Read())
     {
         XmlNodeType nodeType = xml.NodeType;
         if (nodeType != XmlNodeType.Element)
         {
             if (nodeType != XmlNodeType.Comment)
             {
                 return (nodeType == XmlNodeType.EndElement);
             }
         }
         else if (!Parse_Element(xml, toAdd, Name))
         {
             return false;
         }
     }
     return false;
 }