DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
CheckLocTool.c
См. документацию.
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};
RestartDayzTool DayZTool WorkbenchPluginAttribute("DayZ Run", "Just for testing", "ctrl+2", "", {"ScriptEditor"})
Определения DayZTools.c:62
void CheckTextIDs(string file)
Определения CheckLocTool.c:27
WBModuleDef m_module
Определения CheckLocTool.c:5
void FindTexts(WidgetSource src)
Определения CheckLocTool.c:7
ref array< string > m_results
Определения CheckLocTool.c:4
override void Run()
Определения CheckLocTool.c:40
Определения workbenchApi.c:20
Определения EnEntity.c:23
static proto native void Dialog(string caption, string text)
static proto native WBModuleDef GetModule(string type)
static proto bool SearchResources(string filter, func callback)
Определения workbenchApi.c:7
Определения workbenchApi.c:102
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native WidgetSource GetSibling()
proto bool Get(int varIndex, out void val)
proto native WidgetSource GetChildren()
proto native owned string GetName()
proto native int VarIndex(string varName)
bool Contains(string sample)
Returns true if sample is substring of string.
Определения EnString.c:286