public RwWorldWrapper(string text, RwNode resource) : base(text, resource) { }
public RwNodeWrapperBase(string text, RwNode resource) : base(text, (TNode)resource) { }
protected override void Initialize() { CommonContextMenuOptions = CommonContextMenuOptions.Export | CommonContextMenuOptions.Replace | CommonContextMenuOptions.Move | CommonContextMenuOptions.Delete; RegisterFileExportAction(SupportedFileType.RwNode, (res, path) => res.Save(path)); RegisterFileReplaceAction(SupportedFileType.RwNode, (res, path) => (TNode)RwNode.Load(path)); }
protected override void Initialize() { CommonContextMenuOptions = CommonContextMenuOptions.Export | CommonContextMenuOptions.Replace | CommonContextMenuOptions.Add | CommonContextMenuOptions.Move | CommonContextMenuOptions.Rename | CommonContextMenuOptions.Delete; RegisterFileExportAction(SupportedFileType.RwTextureDictionaryNode, (res, path) => res.Save(path)); RegisterCustomAction("Export All", Keys.None, (o, s) => { using (FolderBrowserDialog dialog = new FolderBrowserDialog()) { dialog.ShowNewFolderButton = true; if (dialog.ShowDialog() != DialogResult.OK) { return; } foreach (var texture in Resource.Textures) { var path = Path.Combine(dialog.SelectedPath, Path.ChangeExtension(texture.Name, "png")); var bitmap = texture.GetBitmap(); bitmap.Save(path); } } }); RegisterFileReplaceAction(SupportedFileType.RwTextureDictionaryNode, (res, path) => (RwTextureDictionaryNode)RwNode.Load(path)); RegisterFileAddAction(SupportedFileType.RwTextureNativeNode, DefaultFileAddAction); RegisterFileAddAction(SupportedFileType.Bitmap, (path, wrap) => { var resWrap = (BitmapWrapper)ResourceWrapperFactory.GetResourceWrapper(path); var name = Path.GetFileNameWithoutExtension(path); wrap.Nodes.Add(new RwTextureNativeNodeWrapper(new RwTextureNativeNode(name, resWrap.Resource))); }); RegisterRebuildAction(wrap => { var textureDictionary = new RwTextureDictionaryNode(); foreach (RwTextureNativeNodeWrapper textureNodeWrapper in Nodes) { textureDictionary.Textures.Add(textureNodeWrapper.Resource); } return(textureDictionary); }); }