Exemplo n.º 1
0
        protected override void CompileOptions(MenuGumpOptions list)
        {
            if (typeof(TEnum).IsEnum)
            {
                foreach (var val in EnumerateValues())
                {
                    var e = new ListGumpEntry(GetOptionLabel(val), b => OnSelected(val));

                    if (Equals(val, DefaultValue))
                    {
                        e.Hue = HighlightHue;
                    }

                    list.AppendEntry(e);
                }
            }

            base.CompileOptions(list);
        }
Exemplo n.º 2
0
        protected override void CompileOptions(MenuGumpOptions list)
        {
            if (typeof(TEnum).IsEnum)
            {
                var vals = (default(TEnum) as Enum).EnumerateValues <TEnum>(false);

                foreach (var val in vals)
                {
                    var e = new ListGumpEntry(val.ToString(), b => OnSelected(val));

                    if (Equals(val, DefaultValue))
                    {
                        e.Hue = HighlightHue;
                    }

                    list.AppendEntry(e);
                }
            }

            base.CompileOptions(list);
        }