Download scripts/editor/Workbench/DayZ/ResaveTool.c from FelonieZ/DayZ_Scripts: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/datasets/FelonieZ/DayZ_Scripts/resolve/main/scripts/editor/Workbench/DayZ/ResaveTool.c
- Command line
-
hf download hf://datasets/FelonieZ/DayZ_Scripts/scripts/editor/Workbench/DayZ/ResaveTool.c
-
curl -L -o ResaveTool.c https://huggingface.co/datasets/FelonieZ/DayZ_Scripts/resolve/main/scripts/editor/Workbench/DayZ/ResaveTool.c
1.01 kB
| [WorkbenchPluginAttribute("Re-Save Tool", "Saves all files with given extension", "", "", {"ResourceManager"})] | |
| class ResavePlugin: WorkbenchPlugin | |
| { | |
| [Attribute(".layout", "editbox", "File extension" )] | |
| string Extension; | |
| WBModuleDef m_module; | |
| void Resave(string file) | |
| { | |
| Print("Resaving: " + file); | |
| m_module.SetOpenedResource(file); | |
| m_module.Save(); | |
| } | |
| override void Run() | |
| { | |
| if (Workbench.ScriptDialog("Resave", "Which files you want to resave?", this)) | |
| { | |
| m_module = Workbench.GetModule("ResourceManager"); | |
| Workbench.SearchResources(Extension, Resave); | |
| } | |
| } | |
| override void RunCommandline() | |
| { | |
| m_module = Workbench.GetModule("ResourceManager"); | |
| if (m_module.GetCmdLine("-extension", Extension)) | |
| { | |
| Extension.Replace("\"", ""); | |
| } | |
| Workbench.SearchResources(Extension, Resave); | |
| Workbench.GetModule("ResourceManager").Close(); | |
| } | |
| [ButtonAttribute("Re-Save")] | |
| bool OK() | |
| { | |
| return true; | |
| } | |
| [ButtonAttribute("Cancel")] | |
| bool Cancel() | |
| { | |
| return false; | |
| } | |
| }; |