Example #1
0
        public void Add(Resource res)
        {
            Children.Add(res);

            TriggerUpdateEvent(this);
            Package.TriggerOnChangeEvent();
        }
Example #2
0
        public ResourceNode(Base parent, Resource res)
            : base(parent)
        {
            this.Resource = res;

            this.Text = res.Name;
            this.m_Title.Font = new Gwen.Font(MainCanvas.Renderer, "Arial");

            tbRename = new TextBox(m_Title);
            tbRename.SetPosition(16, 0);
            tbRename.Height = 16;
            tbRename.AutoSizeToContents = true;
            tbRename.Hide();

            tbRename.BoundsChanged += new GwenEventHandler<EventArgs>(tbRename_BoundsChanged);

            tbRename.SubmitPressed += delegate(Base sender, EventArgs args) { EndRename(); };
            //this.Unselected += delegate(Base sender, EventArgs args) { EndRename(); };
        }
 private void Send(Resource res, Guid parent)
 {
     if (res.GetType() == typeof(Package)) {
         new AddPackage((Package)res).Reply(NetDeliveryMethod.ReliableOrdered);
         foreach (Resource child in ((Package)res).GetChildren()) {
             Send(child, res.ID);
         }
     } else if (res.GetType() == typeof(Folder)) {
         new AddFolder((Folder)res, parent).Reply(NetDeliveryMethod.ReliableOrdered);
         foreach (Resource child in ((Folder)res).GetChildren()) {
             Send(child, res.ID);
         }
     } else if (res.GetType() == typeof(FSTexture)) {
         new AddTexture((FSTexture)res, parent).Reply(NetDeliveryMethod.ReliableOrdered);
     } else if (res.GetType() == typeof(BlockType)) {
         new AddBlockType((BlockType)res, parent).Reply(NetDeliveryMethod.ReliableOrdered);
     } else if (res.GetType() == typeof(CodeFile)) {
         new AddCode((CodeFile)res, parent).Reply(NetDeliveryMethod.ReliableOrdered);
     }
 }
Example #4
0
 private void FSTextureUpdated(object sender, Resource tex)
 {
     if (sender != this) {
         this.Load(tex as FSTexture);
     }
 }
Example #5
0
 internal virtual void Copy(Resource other)
 {
     this.Name = other.Name;
 }
Example #6
0
 void Tex_OnUpdate(object sender, Resource res)
 {
     this.Invalidate();
 }
Example #7
0
        internal override void Copy(Resource res)
        {
            base.Copy(res);

            BlockType other = res as BlockType;
            this.Liquid = other.Liquid;
            this.Transparent = other.Transparent;
            for (int i = 0; i < (int)BlockSide.Count; i++) {
                Texture[i] = other.Texture[i];
            }
        }