Dayz Explorer
1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
resavetool.c
Go to the documentation of this file.
1
[
WorkbenchPluginAttribute
(
"Re-Save Tool"
,
"Saves all files with given extension"
,
""
,
""
, {
"ResourceManager"
})]
2
class
ResavePlugin
:
WorkbenchPlugin
3
{
4
[
Attribute
(
".layout"
,
"editbox"
,
"File extension"
)]
5
string
Extension;
6
WBModuleDef
m_module;
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"
);
20
Workbench
.SearchResources(Extension, Resave);
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
33
Workbench
.SearchResources(Extension, Resave);
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
};
ButtonAttribute
Definition:
workbenchapi.c:108
Print
proto void Print(void var)
Prints content of variable to console/log.
OK
@ OK
0 - No error. Can be returned from any call.
Definition:
bioserrormodule.c:9
Workbench
Definition:
workbenchapi.c:6
WBModuleDef
Definition:
workbenchapi.c:19
WorkbenchPluginAttribute
CheckLocalisationPlugin WorkbenchPluginAttribute
WorkbenchPlugin
Definition:
workbenchapi.c:101
ResavePlugin
Definition:
resavetool.c:2
Cancel
proto native void Cancel()
cancels action
Attribute
Definition:
enentity.c:823
Run
override void Run()
Definition:
dayztools.c:8
DAYZ
scripts_v1.24.157551
scripts
editor
workbench
resavetool.c
Generated by
1.8.17