Ejemplo n.º 1
0
 public GPropertyHuePicker(GPropertyEntry entry)
     : base(0, 0, 200, 150)
 {
     int num = (int) entry.Entry.Property.GetValue(entry.Object, null);
     this.m_Entry = entry;
     base.m_CanDrag = false;
     base.FillColor = GumpColors.Control;
     base.BorderColor = GumpColors.ControlDarkDark;
     base.FillAlpha = 1f;
     GHuePicker toAdd = this.m_HuePicker = new GHuePicker(7, 7);
     toAdd.m_CanDrag = false;
     toAdd.OnHueSelect = new OnHueSelect(this.HueSelected);
     base.m_Children.Add(toAdd);
     GBrightnessBar bar = this.m_Bar = new GBrightnessBar((toAdd.X + toAdd.Width) + 1, toAdd.Y, 15, toAdd.Height, toAdd);
     bar.m_CanDrag = false;
     base.m_Children.Add(bar);
     if ((num >= 2) && (num <= 0x3e9))
     {
         num -= 2;
         toAdd.ShadeX = (num / 5) % 20;
         toAdd.ShadeY = (num / 5) / 20;
         toAdd.Brightness = num % 5;
         bar.Refresh();
     }
     GSingleBorder border = new GSingleBorder(bar.X - 1, bar.Y, 1, bar.Height);
     base.m_Children.Add(border);
     this.Width = ((7 + toAdd.Width) + bar.Width) + 7;
     this.Height = (7 + toAdd.Height) + 7;
 }
Ejemplo n.º 2
0
        public GPropertyHuePicker(GPropertyEntry entry) : base(0, 0, 200, 150)
        {
            int num = (int)entry.Entry.Property.GetValue(entry.Object, null);

            this.m_Entry     = entry;
            base.m_CanDrag   = false;
            base.FillColor   = GumpColors.Control;
            base.BorderColor = GumpColors.ControlDarkDark;
            base.FillAlpha   = 1f;
            GHuePicker toAdd = this.m_HuePicker = new GHuePicker(7, 7);

            toAdd.m_CanDrag   = false;
            toAdd.OnHueSelect = new OnHueSelect(this.HueSelected);
            base.m_Children.Add(toAdd);
            GBrightnessBar bar = this.m_Bar = new GBrightnessBar((toAdd.X + toAdd.Width) + 1, toAdd.Y, 15, toAdd.Height, toAdd);

            bar.m_CanDrag = false;
            base.m_Children.Add(bar);
            if ((num >= 2) && (num <= 0x3e9))
            {
                num             -= 2;
                toAdd.ShadeX     = (num / 5) % 20;
                toAdd.ShadeY     = (num / 5) / 20;
                toAdd.Brightness = num % 5;
                bar.Refresh();
            }
            GSingleBorder border = new GSingleBorder(bar.X - 1, bar.Y, 1, bar.Height);

            base.m_Children.Add(border);
            this.Width  = ((7 + toAdd.Width) + bar.Width) + 7;
            this.Height = (7 + toAdd.Height) + 7;
        }
Ejemplo n.º 3
0
        public GQuickHues(GHuePicker Picker, GBrightnessBar Brightness, GFlatButton Okay) : base(3, 0x57, 0x76, 20)
        {
            this.m_CompactHeight  = 20;
            this.m_ExpandedHeight = Engine.GameHeight / 2;
            this.m_Picker         = Picker;
            this.m_Brightness     = Brightness;
            this.m_Okay           = Okay;
            base.m_CanDrag        = false;
            this.m_Timer          = new Timer(new OnTick(this.Roll_OnTick), 0);
            GLabel toAdd = new GLabel("Quick Hues", Engine.GetUniFont(0), Hues.Default, 2, 2);

            this.Height          = 20;
            this.m_CompactHeight = base.m_Height;
            base.m_Children.Add(toAdd);
            toAdd.Center();
            QuickHues.Load();
            int         count   = QuickHues.Entries.Count;
            int         num2    = 0x16;
            Clipper     clipper = new Clipper(base.m_X + 1, base.m_Y + 1, base.m_Width - 2, base.m_Height - 2);
            GTextButton button  = new GTextButton("Create new..", Engine.GetUniFont(0), Hues.Default, Hues.Load(0x35), 2, 2, new OnClick(this.Add_OnClick));

            base.m_Children.Add(button);
            button.Center();
            button.Y = num2;
            button.Scissor(clipper);
            num2 += button.Height;
            OnClick     onClick   = new OnClick(this.Entry_OnClick);
            OnHighlight highlight = new OnHighlight(this.Entry_OnHighlight);

            for (int i = 0; i < count; i++)
            {
                QuickHueEntry entry   = (QuickHueEntry)QuickHues.Entries[i];
                GTextButton   button2 = new GTextButton(entry.Name, Engine.GetUniFont(0), Hues.Load(0x58), Hues.Load(0x35), 2, 2, onClick);
                base.m_Children.Add(button2);
                button2.Center();
                button2.Y = num2;
                button2.Scissor(clipper);
                button2.SetTag("HueID", entry.Hue);
                button2.SetTag("Index", i);
                num2 += button2.Height;
                button2.OnHighlight = highlight;
                button2.Tooltip     = new Tooltip(string.Format("0x{0:X}", entry.Hue));
            }
            num2 += 2;
            this.m_ExpandedHeight = num2;
        }
Ejemplo n.º 4
0
 public GQuickHues(GHuePicker Picker, GBrightnessBar Brightness, GFlatButton Okay)
     : base(3, 0x57, 0x76, 20)
 {
     this.m_CompactHeight = 20;
     this.m_ExpandedHeight = Engine.GameHeight / 2;
     this.m_Picker = Picker;
     this.m_Brightness = Brightness;
     this.m_Okay = Okay;
     base.m_CanDrag = false;
     this.m_Timer = new Timer(new OnTick(this.Roll_OnTick), 0);
     GLabel toAdd = new GLabel("Quick Hues", Engine.GetUniFont(0), Hues.Default, 2, 2);
     this.Height = 20;
     this.m_CompactHeight = base.m_Height;
     base.m_Children.Add(toAdd);
     toAdd.Center();
     QuickHues.Load();
     int count = QuickHues.Entries.Count;
     int num2 = 0x16;
     Clipper clipper = new Clipper(base.m_X + 1, base.m_Y + 1, base.m_Width - 2, base.m_Height - 2);
     GTextButton button = new GTextButton("Create new..", Engine.GetUniFont(0), Hues.Default, Hues.Load(0x35), 2, 2, new OnClick(this.Add_OnClick));
     base.m_Children.Add(button);
     button.Center();
     button.Y = num2;
     button.Scissor(clipper);
     num2 += button.Height;
     OnClick onClick = new OnClick(this.Entry_OnClick);
     OnHighlight highlight = new OnHighlight(this.Entry_OnHighlight);
     for (int i = 0; i < count; i++)
     {
         QuickHueEntry entry = (QuickHueEntry) QuickHues.Entries[i];
         GTextButton button2 = new GTextButton(entry.Name, Engine.GetUniFont(0), Hues.Load(0x58), Hues.Load(0x35), 2, 2, onClick);
         base.m_Children.Add(button2);
         button2.Center();
         button2.Y = num2;
         button2.Scissor(clipper);
         button2.SetTag("HueID", entry.Hue);
         button2.SetTag("Index", i);
         num2 += button2.Height;
         button2.OnHighlight = highlight;
         button2.Tooltip = new Tooltip(string.Format("0x{0:X}", entry.Hue));
     }
     num2 += 2;
     this.m_ExpandedHeight = num2;
 }
Ejemplo n.º 5
0
 public HuePickerTargetHandler(GHuePicker picker, GBrightnessBar bar)
 {
     this.m_Picker = picker;
     this.m_Bar = bar;
 }
Ejemplo n.º 6
0
 private static void OpenDyeWindow(OnClick OnClick, Gump g)
 {
     GAlphaBackground background = new GAlphaBackground(0, 0, 0xb8, 110) {
         m_NonRestrictivePicking = true,
         m_CanDrag = false,
         X = 0,
         Y = g.Parent.Height - 1
     };
     GHuePicker toAdd = new GHuePicker(4, 4) {
         Brightness = 1
     };
     toAdd.SetTag("Dialog", background);
     background.Children.Add(toAdd);
     background.Children.Add(new GSingleBorder(3, 3, 0xa2, 0x52));
     background.Children.Add(new GSingleBorder(0xa4, 3, 0x11, 0x52));
     GBrightnessBar bar = new GBrightnessBar(0xa5, 4, 15, 80, toAdd);
     background.Children.Add(bar);
     bar.Refresh();
     GFlatButton okay = new GFlatButton(0x7b, 0x57, 0x3a, 20, "Okay", OnClick);
     okay.SetTag("Hue Picker", toAdd);
     okay.SetTag("Dialog", background);
     okay.SetTag("Button", g);
     background.Children.Add(new GQuickHues(toAdd, bar, okay));
     background.Children.Add(okay);
     g.Parent.Children.Add(background);
 }
Ejemplo n.º 7
0
 private static void SelectHue(PacketReader pvSrc)
 {
     GItemArt art;
     int num = pvSrc.ReadInt32();
     short num2 = pvSrc.ReadInt16();
     short itemID = pvSrc.ReadInt16();
     GAlphaBackground background = new GAlphaBackground(0, 0, 0xf4, 110) {
         m_NonRestrictivePicking = true
     };
     background.Center();
     art = new GItemArt(0xb7, 3, itemID) {
         X = art.X + (((0x3a - (art.Image.xMax - art.Image.xMin)) / 2) - art.Image.xMin),
         Y = art.Y + (((0x52 - (art.Image.yMax - art.Image.yMin)) / 2) - art.Image.yMin)
     };
     background.Children.Add(art);
     GHuePicker toAdd = new GHuePicker(4, 4) {
         Brightness = 1
     };
     toAdd.SetTag("ItemID", (int) itemID);
     toAdd.SetTag("Item Art", art);
     toAdd.SetTag("Dialog", background);
     toAdd.OnHueSelect = new OnHueSelect(Engine.HuePicker_OnHueSelect);
     background.Children.Add(toAdd);
     background.Children.Add(new GSingleBorder(3, 3, 0xa2, 0x52));
     background.Children.Add(new GSingleBorder(0xa4, 3, 0x11, 0x52));
     GBrightnessBar bar = new GBrightnessBar(0xa5, 4, 15, 80, toAdd);
     background.Children.Add(bar);
     bar.Refresh();
     GFlatButton button = new GFlatButton(0x7b, 0x57, 0x3a, 20, "Picker", new OnClick(Engine.HuePickerPicker_OnClick));
     GFlatButton okay = new GFlatButton(0xb7, 0x57, 0x3a, 20, "Okay", new OnClick(Engine.HuePickerOk_OnClick));
     okay.SetTag("Hue Picker", toAdd);
     okay.SetTag("Dialog", background);
     okay.SetTag("Serial", num);
     okay.SetTag("ItemID", itemID);
     okay.SetTag("Relay", num2);
     button.SetTag("Hue Picker", toAdd);
     button.SetTag("Brightness Bar", bar);
     background.Children.Add(new GQuickHues(toAdd, bar, okay));
     background.Children.Add(button);
     background.Children.Add(okay);
     Gumps.Desktop.Children.Add(background);
     Engine.HuePicker_OnHueSelect(toAdd.Hue, toAdd);
 }