Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
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"})]
3{
6
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
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");
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};
override void Run()
void CheckTextIDs(string file)
void FindTexts(WidgetSource src)
Definition checkloctool.c:7
ref array< string > m_results
Definition checkloctool.c:4
static proto bool SearchResources(string filter, func callback)
static proto native WBModuleDef GetModule(string type)
static proto native void Dialog(string caption, string text)
void WorkbenchPlugin()
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
RestartDayzTool DayZTool WorkbenchPluginAttribute("DayZ Run", "Just for testing", "ctrl+2", "", {"ScriptEditor"})
Definition dayztools.c:62
proto bool Get(int varIndex, out void val)
proto native int VarIndex(string varName)
proto native WidgetSource GetSibling()
proto native owned string GetName()
proto native WidgetSource GetChildren()
bool Contains(string sample)
Returns true if sample is substring of string.
Definition enstring.c:286