Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
checkloctool.c
Go to the documentation of this file.
1
[
WorkbenchPluginAttribute
(
"Check localisation in UI"
,
"Find non localised text in UI"
,
"ctrl+l"
,
""
, {
"ResourceManager"
})]
2
class
CheckLocalisationPlugin
:
WorkbenchPlugin
3
{
4
ref
array<string>
m_results
=
new
array<string>
;
5
WBModuleDef
m_module
;
6
7
void
FindTexts
(
WidgetSource
src)
8
{
9
if
(src)
10
{
11
int
idx = src.
VarIndex
(
"text"
);
12
13
if
(idx != -1)
14
{
15
string
text;
16
if
(src.
Get
(idx, text) && !text.
Contains
(
"#"
))
17
{
18
m_results
.Insert(
"Text = \""
+ text +
"\" in Widget: "
+ src.
GetName
());
19
}
20
}
21
22
FindTexts
(src.
GetChildren
());
23
FindTexts
(src.
GetSibling
());
24
}
25
}
26
27
void
CheckTextIDs
(
string
file)
28
{
29
m_module
.SetOpenedResource(file);
30
WidgetSource
cont =
m_module
.GetContainer();
31
int
lastIndex =
m_results
.Count();
32
FindTexts
(cont);
33
if
(lastIndex !=
m_results
.Count())
34
{
35
m_results
.InsertAt(file +
":"
, lastIndex);
36
m_results
.Insert(
""
);
37
}
38
}
39
40
override
void
Run
()
41
{
42
m_module
=
Workbench
.
GetModule
(
"ResourceManager"
);
43
Workbench
.
SearchResources
(
".layout"
,
CheckTextIDs
);
44
45
if
(
m_results
.Count())
46
{
47
string
res;
48
foreach
(
string
file:
m_results
)
49
{
50
res += file;
51
res +=
"\n"
;
52
}
53
}
54
else
55
{
56
res =
"All texts are localised."
;
57
}
58
59
Workbench
.
Dialog
(
"Results"
, res);
60
}
61
};
CheckLocalisationPlugin
Definition
checkloctool.c:3
CheckLocalisationPlugin::Run
override void Run()
Definition
checkloctool.c:40
CheckLocalisationPlugin::CheckTextIDs
void CheckTextIDs(string file)
Definition
checkloctool.c:27
CheckLocalisationPlugin::FindTexts
void FindTexts(WidgetSource src)
Definition
checkloctool.c:7
CheckLocalisationPlugin::m_results
ref array< string > m_results
Definition
checkloctool.c:4
CheckLocalisationPlugin::m_module
WBModuleDef m_module
Definition
checkloctool.c:5
WBModuleDef
Definition
workbenchapi.c:20
WidgetSource
Definition
enentity.c:23
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::Dialog
static proto native void Dialog(string caption, string text)
WorkbenchPlugin::WorkbenchPlugin
void WorkbenchPlugin()
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition
isboxcollidinggeometryproxyclasses.c:28
WorkbenchPluginAttribute
RestartDayzTool DayZTool WorkbenchPluginAttribute("DayZ Run", "Just for testing", "ctrl+2", "", {"ScriptEditor"})
Definition
dayztools.c:62
BaseContainer::Get
proto bool Get(int varIndex, out void val)
BaseContainer::VarIndex
proto native int VarIndex(string varName)
WidgetSource::GetSibling
proto native WidgetSource GetSibling()
BaseContainer::GetName
proto native owned string GetName()
WidgetSource::GetChildren
proto native WidgetSource GetChildren()
string::Contains
bool Contains(string sample)
Returns true if sample is substring of string.
Definition
enstring.c:286
Games
Dayz
scripts
editor
workbench
checkloctool.c
Generated by
1.17.0