Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
resavetool.c
Go to the documentation of this file.
1[WorkbenchPluginAttribute("Re-Save Tool", "Saves all files with given extension", "", "", {"ResourceManager"})]
3{
4 [Attribute(".layout", "editbox", "File extension" )]
5 string Extension;
7
8 void Resave(string file)
9 {
10 Print("Resaving: " + file);
11 m_module.SetOpenedResource(file);
12 m_module.Save();
13 }
14
15 override void Run()
16 {
17 if (Workbench.ScriptDialog("Resave", "Which files you want to resave?", this))
18 {
19 m_module = Workbench.GetModule("ResourceManager");
21 }
22 }
23
24 override void RunCommandline()
25 {
26 m_module = Workbench.GetModule("ResourceManager");
27
28 if (m_module.GetCmdLine("-extension", Extension))
29 {
30 Extension.Replace("\"", "");
31 }
32
34 Workbench.GetModule("ResourceManager").Close();
35 }
36
37 [ButtonAttribute("Re-Save")]
38 bool OK()
39 {
40 return true;
41 }
42
43 [ButtonAttribute("Cancel")]
44 bool Cancel()
45 {
46 return false;
47 }
48};
override void Run()
Definition resavetool.c:15
void Resave(string file)
Definition resavetool.c:8
string Extension
Definition resavetool.c:5
override void RunCommandline()
Definition resavetool.c:24
bool Cancel()
Definition resavetool.c:44
WBModuleDef m_module
Definition resavetool.c:6
proto native external bool Close()
static proto bool SearchResources(string filter, func callback)
static proto native WBModuleDef GetModule(string type)
static proto int ScriptDialog(string caption, string text, Class data)
void WorkbenchPlugin()
RestartDayzTool DayZTool WorkbenchPluginAttribute("DayZ Run", "Just for testing", "ctrl+2", "", {"ScriptEditor"})
Definition dayztools.c:62
proto void Print(void var)
Prints content of variable to console/log.