Exemple #1
0
        public UnderworldPuzzleGump(Mobile from, UnderworldPuzzleItem item, int row)
            : base(5, 30)
        {
            if (row > 3)
            {
                row = 3;
            }
            if (row < 0)
            {
                row = 0;
            }

            m_From = from;
            m_Item = item;
            m_Row  = row;

            m_Solution        = item.Solution;
            m_CurrentSolution = item.CurrentSolution;

            AddBackground(55, 45, 500, 200, 0x2422);
            AddImage(75, 83, 0x2423);
            AddImage(65, 118, 0x2423);
            AddImage(75, 153, 0x2423);
            AddImage(65, 188, 0x2423);
            AddImage(108, 55, 0x2427);
            AddImage(86, 65, 0x2427);
            AddBackground(75, 65, 86, 153, 0x2422);
            AddBackground(192, 65, 137, 153, 0x2422);
            AddBackground(397, 65, 137, 153, 0x2422);
            AddBackground(55, 270, 195, 110, 0x2422);
            AddImage(205, 77, 0x52);
            AddImage(205, 110, 0x52);
            AddImage(205, 143, 0x52);
            AddImage(410, 77, 0x52);
            AddImage(410, 110, 0x52);
            AddImage(410, 143, 0x52);
            AddImage(5, 5, 0x28C8);

            AddButton(160, 320, 0xF2, 0xF1, 8, GumpButtonType.Reply, 0);   // Cancel
            AddButton(80, 320, 0xEF, 0xF0, 7, GumpButtonType.Reply, 0);    // Apply
            AddButton(120, 345, 0x7DB, 0x7DB, 0, GumpButtonType.Reply, 0); // Log out

            AddHtmlLocalized(72, 285, 170, 20, 1150180, false, false);     // Command Functions:
            AddHtml(200, 285, 100, 20, string.Format("{0}/{1}", m_Item.Attempts, m_Solution.MaxAttempts), false, false);

            if (from.Skills[SkillName.Lockpicking].Base >= 100.0)
            {
                int locked = m_Solution.GetMatches(m_CurrentSolution);
                AddHtmlLocalized(72, 300, 170, 20, 1150179, false, false); // Crystals Locked  :
                AddHtml(200, 300, 100, 20, locked.ToString(), false, false);
            }

            AddButton(108, 82, row == 0 ? 208 : 209, row == 0 ? 209 : 208, 1, GumpButtonType.Reply, 0);
            AddButton(108, 115, row == 1 ? 208 : 209, row == 0 ? 209 : 208, 2, GumpButtonType.Reply, 0);
            AddButton(108, 148, row == 2 ? 208 : 209, row == 0 ? 209 : 208, 3, GumpButtonType.Reply, 0);
            AddButton(108, 181, row == 3 ? 208 : 209, row == 0 ? 209 : 208, 4, GumpButtonType.Reply, 0);

            AddPiece(0, true, m_Solution.First);
            AddPiece(1, true, m_Solution.Second);
            AddPiece(2, true, m_Solution.Third);
            AddPiece(3, true, m_Solution.Fourth);

            AddPiece(0, false, m_CurrentSolution.First);
            AddPiece(1, false, m_CurrentSolution.Second);
            AddPiece(2, false, m_CurrentSolution.Third);
            AddPiece(3, false, m_CurrentSolution.Fourth);

            for (int i = 0; i < 4; i++)
            {
                if (i == row && m_CurrentSolution.Rows[i] != PuzzlePiece.None && m_Item.Attempts < m_Solution.MaxAttempts)
                {
                    AddButton(88, 82 + (i * 33), 2650, 2650, 5, GumpButtonType.Reply, 0);  //Up
                    AddButton(128, 82 + (i * 33), 2648, 2648, 6, GumpButtonType.Reply, 0); //Down
                }
                else
                {
                    AddImage(88, 82 + (i * 33), 2709);
                    AddImage(128, 82 + (i * 33), 2709);
                }
            }

            AddButton(88, 82 + (row * 35), 2650, 2650, 5, GumpButtonType.Reply, 0);  //Up
            AddButton(128, 82 + (row * 35), 2648, 2648, 6, GumpButtonType.Reply, 0); //Down
        }
Exemple #2
0
 public UnderworldPuzzleGump(Mobile from, UnderworldPuzzleItem item)
     : this(from, item, 0)
 {
 }