Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
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"
})]
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
};
Attribute
Definition
enentity.c:826
ButtonAttribute
Definition
workbenchapi.c:118
ResavePlugin
Definition
resavetool.c:3
ResavePlugin::Run
override void Run()
Definition
resavetool.c:15
ResavePlugin::Resave
void Resave(string file)
Definition
resavetool.c:8
ResavePlugin::Extension
string Extension
Definition
resavetool.c:5
ResavePlugin::RunCommandline
override void RunCommandline()
Definition
resavetool.c:24
ResavePlugin::OK
bool OK()
Definition
resavetool.c:38
ResavePlugin::Cancel
bool Cancel()
Definition
resavetool.c:44
ResavePlugin::m_module
WBModuleDef m_module
Definition
resavetool.c:6
WBModuleDef
Definition
workbenchapi.c:20
WBModuleDef::Close
proto native external bool Close()
Workbench
Definition
workbenchapi.c:7
Workbench::SearchResources
static proto bool SearchResources(string filter, func callback)
Workbench::GetModule
static proto native WBModuleDef GetModule(string type)
Workbench::ScriptDialog
static proto int ScriptDialog(string caption, string text, Class data)
WorkbenchPlugin::WorkbenchPlugin
void WorkbenchPlugin()
WorkbenchPluginAttribute
RestartDayzTool DayZTool WorkbenchPluginAttribute("DayZ Run", "Just for testing", "ctrl+2", "", {"ScriptEditor"})
Definition
dayztools.c:62
Print
proto void Print(void var)
Prints content of variable to console/log.
Games
Dayz
scripts
editor
workbench
resavetool.c
Generated by
1.17.0