DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ OnClick()

override bool ScriptConsoleConfigTab::OnClick ( Widget w,
int x,
int y,
int button )
inlineprotected

См. определение в файле ScriptConsoleConfigTab.c строка 94

95 {
96 super.OnClick(w,x,y,button);
97
98 CheckBoxWidget cbw = CheckBoxWidget.Cast(w);
99
100 if (w == m_DumpParamButton)
101 {
102 int selectedRowIndex = m_ConfigVariablesTextListbox.GetSelectedRow();
103 string paramFinal;
104 if (selectedRowIndex > -1)
105 {
106 string param;
107 m_ConfigVariablesTextListbox.GetItemText(selectedRowIndex,0,param);
108 int index = param.IndexOf("=");
109 if (index > 0)
110 paramFinal = param.Substring(0, index).Trim();
111 }
112
113 int objects_row_index;
114 objects_row_index = m_ConfigHierarchyTextListbox.GetSelectedRow();
115 if (objects_row_index > -1 && objects_row_index < m_ConfigHierarchyTextListbox.GetNumItems())
116 {
117 ConfigParamsEx params;
118 m_ConfigHierarchyTextListbox.GetItemData(objects_row_index, 0, params);
119 string path = params.param4;
120 TStringArray pathArr = new TStringArray();
121 path.Split(" ", pathArr);
122 string relativePath;
123
124 foreach (int indx, string s:pathArr)
125 {
126 if (indx > 2)
127 {
128 relativePath+= s+" ";
129 }
130 }
131
132 if (relativePath)
133 relativePath = relativePath.Trim();
134
135 Print(relativePath);
136 Print(path);
137 }
138
139 if (paramFinal)
140 DumpParam(paramFinal,relativePath);
141
142 return true;
143 }
144 else if (w == m_ConfigHierarchyTextListbox)
145 {
146 objects_row_index = m_ConfigHierarchyTextListbox.GetSelectedRow();
147 //Print(objects_row_index);
148
149 if (objects_row_index > -1 && objects_row_index < m_ConfigHierarchyTextListbox.GetNumItems())
150 {
151 ConfigParamsEx config_params;
152 m_ConfigHierarchyTextListbox.GetItemData(objects_row_index, 0, config_params);
153
154 if (config_params.param1 == false)
155 {
156 ExpandHierarchy(objects_row_index);
157 }
158 else
159 {
160 CollapseHierarchy(objects_row_index);
161 }
162
163 RenderVariables(objects_row_index);
164 m_Row = objects_row_index;
165 }
166 return true;
167 }
168 else if (cbw && m_ClassCheckboxes.Contains(cbw))
169 {
170 int checkbox_index = m_ClassCheckboxes.Get(cbw);
171 string base_class_name = m_BaseConfigClasses.Get(checkbox_index);
172
173 int index_toggled = m_BaseConfigClassesToggled.Find(base_class_name);
174
175 int flag, new_flag;
176
178 {
179 flag = m_ConfigDebugProfile.GetConfigClassesFlag();
180 }
181
182 if (cbw.IsChecked())
183 {
184 if (index_toggled == -1)//not found
185 {
186 m_BaseConfigClassesToggled.Insert(base_class_name);
187
189 {
190 new_flag = (flag | (int)Math.Pow(2, checkbox_index));
191 }
192 }
193 }
194 else if (index_toggled != -1)
195 {
196 m_BaseConfigClassesToggled.Remove(index_toggled);
197
199 {
200 new_flag = (flag ^ (int)Math.Pow(2, checkbox_index));
201 }
202 }
203 m_ConfigDebugProfile.SetConfigClassesFlag(new_flag);
204 /*
205 Print("-----------------------------------------");
206 Print("flag = " + new_flag);
207 foreach (string text:m_BaseConfigClassesToggled)
208 {
209 Print(text);
210 }
211 Print("-----------------------------------------");
212 */
214 }
215 else if (w == m_SelectedRowCopy)
216 {
218 return true;
219 }
220 return false;
221 }
Param3 int
Icon x
Icon y
string path
Определения OptionSelectorMultistate.c:142
Param6< bool, string, int, string, int, string > ConfigParamsEx
Определения ScriptConsoleConfigTab.c:2
TextListboxWidget m_ConfigVariablesTextListbox
Определения ScriptConsoleConfigTab.c:17
void DumpParam(string param, string relativePath)
Определения ScriptConsoleConfigTab.c:262
void RenderVariables(int row)
Определения ScriptConsoleConfigTab.c:474
ref TStringArray m_BaseConfigClasses
Определения ScriptConsoleConfigTab.c:10
ref map< CheckBoxWidget, int > m_ClassCheckboxes
Определения ScriptConsoleConfigTab.c:12
TextListboxWidget m_ConfigHierarchyTextListbox
Определения ScriptConsoleConfigTab.c:16
void ClearHierarchy()
Определения ScriptConsoleConfigTab.c:318
void ExpandHierarchy(int row)
Определения ScriptConsoleConfigTab.c:379
void CollapseHierarchy(int row)
Определения ScriptConsoleConfigTab.c:420
ref TStringArray m_BaseConfigClassesToggled
Определения ScriptConsoleConfigTab.c:11
ButtonWidget m_DumpParamButton
Определения ScriptConsoleConfigTab.c:19
ButtonWidget m_SelectedRowCopy
Определения ScriptConsoleConfigTab.c:18
PluginConfigDebugProfile m_ConfigDebugProfile
Определения ScriptConsoleTabBase.c:11
void AddItemToClipboard(TextListboxWidget text_listbox_widget)
Определения ScriptConsoleTabBase.c:90
proto void Print(void var)
Prints content of variable to console/log.
array< string > TStringArray
Определения EnScript.c:685
proto string Trim()
Returns trimmed string with removed leading and trailing whitespaces.
void Split(string sample, out array< string > output)
Splits string into array of strings separated by 'sample'.
Определения EnString.c:396
proto string Substring(int start, int len)
Substring of 'str' from 'start' position 'len' number of characters.
proto native int IndexOf(string sample)
Finds 'sample' in 'str'. Returns -1 when not found.

Перекрестные ссылки ScriptConsoleTabBase::AddItemToClipboard(), ClearHierarchy(), CollapseHierarchy(), DumpParam(), ExpandHierarchy(), string::IndexOf(), m_BaseConfigClasses, m_BaseConfigClassesToggled, m_ClassCheckboxes, ScriptConsoleTabBase::m_ConfigDebugProfile, m_ConfigHierarchyTextListbox, m_ConfigVariablesTextListbox, m_DumpParamButton, m_Row, m_SelectedRowCopy, path, Math::Pow(), Print(), RenderVariables(), string::Substring(), string::Trim(), x и y.