DayZ 1.24
Loading...
Searching...
No Matches
ResavePlugin Class Reference
Inheritance diagram for ResavePlugin:
[legend]
Collaboration diagram for ResavePlugin:
[legend]

Private Member Functions

void Resave (string file)
 
override void Run ()
 
override void RunCommandline ()
 
bool OK ()
 
bool Cancel ()
 

Private Attributes

string Extension
 
WBModuleDef m_module
 

Detailed Description

Definition at line 2 of file ResaveTool.c.

Member Function Documentation

◆ Cancel()

bool ResavePlugin::Cancel ( )
inlineprivate

Definition at line 42 of file ResaveTool.c.

43 {
44 return false;
45 }

◆ OK()

bool ResavePlugin::OK ( )
inlineprivate

Definition at line 36 of file ResaveTool.c.

37 {
38 return true;
39 }

◆ Resave()

void ResavePlugin::Resave ( string file)
inlineprivate

Definition at line 8 of file ResaveTool.c.

9 {
10 Print("Resaving: " + file);
12 m_module.Save();
13 }
WBModuleDef m_module
Definition ResaveTool.c:6
proto native external bool SetOpenedResource(string filename)
proto native external bool Save()
proto void Print(void var)
Prints content of variable to console/log.

References Print(), WBModuleDef::Save(), and WBModuleDef::SetOpenedResource().

◆ Run()

override void ResavePlugin::Run ( )
inlineprivate

Definition at line 15 of file ResaveTool.c.

16 {
17 if (Workbench.ScriptDialog("Resave", "Which files you want to resave?", this))
18 {
19 m_module = Workbench.GetModule("ResourceManager");
21 }
22 }
string Extension
Definition ResaveTool.c:5
void Resave(string file)
Definition ResaveTool.c:8
static proto native WBModuleDef GetModule(string type)
static proto bool SearchResources(string filter, func callback)
static proto int ScriptDialog(string caption, string text, Class data)

References Workbench::GetModule(), Workbench::ScriptDialog(), and Workbench::SearchResources().

◆ RunCommandline()

override void ResavePlugin::RunCommandline ( )
inlineprivate

Definition at line 24 of file ResaveTool.c.

25 {
26 m_module = Workbench.GetModule("ResourceManager");
27
28 if (m_module.GetCmdLine("-extension", Extension))
29 Extension.Replace("\"", "");
30
32 Workbench.GetModule("ResourceManager").Close();
33 }
proto external bool GetCmdLine(string name, out string value)
proto int Replace(string sample, string replace)
Replace all occurrances of 'sample' in 'str' by 'replace'.

References WBModuleDef::GetCmdLine(), Workbench::GetModule(), string::Replace(), and Workbench::SearchResources().

Member Data Documentation

◆ Extension

string ResavePlugin::Extension
private

Definition at line 5 of file ResaveTool.c.

◆ m_module

WBModuleDef ResavePlugin::m_module
private

Definition at line 6 of file ResaveTool.c.


The documentation for this class was generated from the following file: