public EditorGroupMenu(IContextListener owner, bool root = false, SpriteMap image = null)
     : base(owner, image)
 {
     this.itemSize.x = 140f;
     this.itemSize.y = 16f;
     this._root      = root;
     if (this._root)
     {
         return;
     }
     this.greyOut = Main.isDemo || Editor.onlineMode;
 }
Ejemplo n.º 2
0
 public ContextTextbox(string text, IContextListener owner, FieldBinding field = null)
     : base(owner)
 {
     this.itemSize.x = 150f;
     this.itemSize.y = 16f;
     this._text      = text;
     this._field     = field;
     if (field == null)
     {
         this._field = new FieldBinding((object)this, "isChecked");
     }
     this._fancyFont = new FancyBitmapFont("smallFont");
 }
Ejemplo n.º 3
0
 public ContextCheckBox(string text, IContextListener owner, FieldBinding field = null, System.Type myType = null)
     : base(owner)
 {
     this.itemSize.x = 150f;
     this.itemSize.y = 16f;
     this._text      = text;
     this._field     = field;
     this._checkBox  = new SpriteMap("Editor/checkBox", 16, 16);
     this.depth      = new Depth(0.8f);
     this._myType    = myType;
     if (field != null)
     {
         return;
     }
     this._field = new FieldBinding((object)this, nameof(isChecked));
 }
 public ContextRadio(
     string text,
     bool selected,
     object index,
     IContextListener owner,
     FieldBinding field = null)
     : base(owner)
 {
     this.itemSize.x   = 150f;
     this.itemSize.y   = 16f;
     this._text        = text;
     this._selected    = field == null ? selected : field.value == index;
     this._field       = field;
     this._index       = index;
     this.depth        = new Depth(0.8f);
     this._radioButton = new SpriteMap("Editor/radioButton", 16, 16);
 }
Ejemplo n.º 5
0
 public ContextObject(Thing thing, IContextListener owner, bool placement = true)
     : base(owner)
 {
     this._placement = placement;
     this._thing     = thing;
     this._image     = thing.GeneratePreview();
     this.itemSize.y = 16f;
     this._text      = thing.editorName;
     this.itemSize.x = (float)(this._text.Length * 8 + 26);
     this._thingBag  = ContentProperties.GetBag(thing.GetType());
     if (Main.isDemo && !this._thingBag.GetOrDefault <bool>("isInDemo", false))
     {
         this.greyOut = true;
     }
     else
     {
         this.greyOut = false;
     }
 }
Ejemplo n.º 6
0
 public ContextFile(
     string text,
     IContextListener owner,
     FieldBinding field   = null,
     ContextFileType type = ContextFileType.Level)
     : base(owner)
 {
     this.itemSize.x = 150f;
     this.itemSize.y = 16f;
     this._text      = text;
     this._field     = field;
     this.depth      = new Depth(0.8f);
     this._type      = type;
     this.fancy      = true;
     if (field != null)
     {
         return;
     }
     this._field = new FieldBinding((object)this, "isChecked");
 }
Ejemplo n.º 7
0
 public ContextFile(
     string text,
     IContextListener owner,
     FieldBinding field,
     ContextFileType type,
     string valTooltip)
     : base(owner)
 {
     this.itemSize.x = 150f;
     this.itemSize.y = 16f;
     this._text      = text;
     this._field     = field;
     this.depth      = new Depth(0.8f);
     this._type      = type;
     this.fancy      = true;
     if (field == null)
     {
         this._field = new FieldBinding((object)this, "isChecked");
     }
     this.tooltip = valTooltip;
 }
Ejemplo n.º 8
0
        public ContextBackgroundTile(Thing thing, IContextListener owner, bool placement = true)
            : base(owner)
        {
            this._placement = placement;
            this._thing     = thing;
            this._image     = thing.GetEditorImage();
            this.itemSize.x = 180f;
            this.itemSize.y = 16f;
            this._text      = thing.editorName;
            this.itemSize.x = (float)(this._text.Length * 8 + 16);
            this._canExpand = true;
            this.depth      = new Depth(0.8f);
            if (this._thing is CustomBackground)
            {
                this._file = new ContextFile("BURG", (IContextListener)this, new FieldBinding((object)this._thing, "customBackground0" + (object)((thing as CustomBackground).customIndex + 1)), ContextFileType.Background);
            }
            IReadOnlyPropertyBag bag = ContentProperties.GetBag(thing.GetType());

            if (!Main.isDemo || bag.GetOrDefault <bool>("isInDemo", false))
            {
                return;
            }
            this.greyOut = true;
        }