Esempio n. 1
0
 protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
 {
     //Enable the ON ColorSelected
     OnSelectedColor?.Invoke(imgColor.SelectedColor);
     base.OnPropertyChanged(e);
 }
Esempio n. 2
0
 public ColorPickerGump(Mobile m, OnSelectedColor osc, bool esm, int cs, int ce) : this(m, osc, esm, cs, ce, cs, DEFAULT_IMAGE, DEFAULT_SPACE, DEFAULT_LENGTH)
 {
 }
Esempio n. 3
0
            public ColorPickerGump(Mobile m, OnSelectedColor osc, bool esm, int cs, int ce, int cc, int i, int s, int l) : base(100, 100)
            {
                m_Selector       = m;
                m_Action         = osc;
                m_First          = cs;
                m_Last           = ce;
                m_Current        = cc;
                m_ItemImage      = i;
                m_Space          = s;
                m_Length         = l;
                m_EnableSetModel = esm;

                //###### Initialization
                Closable   = true;
                Disposable = true;
                Dragable   = true;
                Resizable  = false;

                int width  = 140;
                int height = m_Length * (m_Space + 2) + 70;

                AddBackground(0, 0, width, height, 0xE10);
                AddAlphaRegion(15, 15, width - 30, height - 30);
                AddLabel(35, 15, 168, "Pick a Color");

                if (m_EnableSetModel)
                {
                    AddButton((width / 2) - 7, height - 40, 0x2C89, 0x2C8A, BUTTON_MODEL, GumpButtonType.Reply, 0); //Select new model
                }
                //###### Show Colors
                int total = Math.Min(m_Length, m_Last - m_Current);
                int ey    = 40;

                for (int index = 0; index < total; index++)
                {
                    int cy  = ey + (index * m_Space);
                    int hue = m_Current + index;

                    AddItem(10, cy, m_ItemImage, hue);
                    AddLabel(65, cy, 371, hue.ToString());
                    AddButton(width - 35, cy, 0x2622, 0x2623, hue, GumpButtonType.Reply, 0);  //Set new Color
                }

                //###### Buttons next and previous
                if (m_Current - m_Length >= m_First)  //Previous m_Length hues
                {
                    AddButton(20, height - 40, 0x26B6, 0x26B7, BUTTON_PREV, GumpButtonType.Reply, 0);
                }
                if (m_Current - (m_Length * 5) >= m_First) //Previous m_Length * 5 hues
                {
                    AddButton(40, height - 40, 0x26B5, 0x26B5, BUTTON_PREV5, GumpButtonType.Reply, 0);
                }
                if (m_Current + m_Length <= m_Last)   //Next m_Length hues
                {
                    AddButton(width - 40, height - 40, 0x26B0, 0x26B1, BUTTON_NEXT, GumpButtonType.Reply, 0);
                }
                if (m_Current + (m_Length * 5) <= m_Last)   //Next m_Length * 5 hues
                {
                    AddButton(width - 60, height - 40, 0x26AF, 0x26BAF, BUTTON_NEXT5, GumpButtonType.Reply, 0);
                }
            }
Esempio n. 4
0
 public ColorPickerGump(Mobile m, OnSelectedColor osc, int i, int cs, int ce) : this(m, osc, false, cs, ce, cs, i, DEFAULT_SPACE, DEFAULT_LENGTH)
 {
 }