コード例 #1
0
ファイル: Folder.cs プロジェクト: CloneDeath/FantasyScape
        public void Add(Resource res)
        {
            Children.Add(res);

            TriggerUpdateEvent(this);
            Package.TriggerOnChangeEvent();
        }
コード例 #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(); };
        }
コード例 #3
0
 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);
     }
 }
コード例 #4
0
ファイル: PixelData.cs プロジェクト: CloneDeath/FantasyScape
 private void FSTextureUpdated(object sender, Resource tex)
 {
     if (sender != this) {
         this.Load(tex as FSTexture);
     }
 }
コード例 #5
0
ファイル: Resource.cs プロジェクト: CloneDeath/FantasyScape
 internal virtual void Copy(Resource other)
 {
     this.Name = other.Name;
 }
コード例 #6
0
 void Tex_OnUpdate(object sender, Resource res)
 {
     this.Invalidate();
 }
コード例 #7
0
ファイル: BlockType.cs プロジェクト: CloneDeath/FantasyScape
        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];
            }
        }