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

◆ OnClick()

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

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

97 {
98 super.OnClick(w,x,y,button);
99
100 CheckBoxWidget cbw = CheckBoxWidget.Cast(w);
101
102 if (w == m_DumpParamButton)
103 {
104 int selectedRowIndex = m_ConfigVariablesTextListbox.GetSelectedRow();
105 string paramFinal;
106 if (selectedRowIndex > -1)
107 {
108 string param;
109 m_ConfigVariablesTextListbox.GetItemText(selectedRowIndex,0,param);
110 int index = param.IndexOf("=");
111 if (index > 0)
112 paramFinal = param.Substring(0, index).Trim();
113 }
114
115 int objects_row_index;
116 objects_row_index = m_ConfigHierarchyTextListbox.GetSelectedRow();
117 if (objects_row_index > -1 && objects_row_index < m_ConfigHierarchyTextListbox.GetNumItems())
118 {
119 ConfigParamsEx params;
120 m_ConfigHierarchyTextListbox.GetItemData(objects_row_index, 0, params);
121 string path = params.param4;
122 TStringArray pathArr = new TStringArray();
123 path.Split(" ", pathArr);
124 string relativePath;
125
126 foreach (int indx, string s:pathArr)
127 {
128 if (indx > 2)
129 {
130 relativePath+= s+" ";
131 }
132 }
133
134 if (relativePath)
135 relativePath = relativePath.Trim();
136
137 Print(relativePath);
138 Print(path);
139 }
140
141 if (paramFinal)
142 DumpParam(paramFinal,relativePath);
143
144 return true;
145 }
146 else if (w == m_ConfigHierarchyTextListbox)
147 {
148 objects_row_index = m_ConfigHierarchyTextListbox.GetSelectedRow();
149 //Print(objects_row_index);
150
151 if (objects_row_index > -1 && objects_row_index < m_ConfigHierarchyTextListbox.GetNumItems())
152 {
153 ConfigParamsEx config_params;
154 m_ConfigHierarchyTextListbox.GetItemData(objects_row_index, 0, config_params);
155
156 if (config_params.param1 == false)
157 {
158 ExpandHierarchy(objects_row_index);
159 }
160 else
161 {
162 CollapseHierarchy(objects_row_index);
163 }
164
165 RenderVariables(objects_row_index);
166 m_Row = objects_row_index;
167 }
168 return true;
169 }
170 else if (cbw && m_ClassCheckboxes.Contains(cbw))
171 {
172 int checkbox_index = m_ClassCheckboxes.Get(cbw);
173 string base_class_name = m_BaseConfigClasses.Get(checkbox_index);
174
175 int index_toggled = m_BaseConfigClassesToggled.Find(base_class_name);
176
177 int flag, new_flag;
178
180 {
181 flag = m_ConfigDebugProfile.GetConfigClassesFlag();
182 }
183
184 if (cbw.IsChecked())
185 {
186 if (index_toggled == -1)//not found
187 {
188 m_BaseConfigClassesToggled.Insert(base_class_name);
189
191 {
192 new_flag = (flag | (int)Math.Pow(2, checkbox_index));
193 }
194 }
195 }
196 else if (index_toggled != -1)
197 {
198 m_BaseConfigClassesToggled.Remove(index_toggled);
199
201 {
202 new_flag = (flag ^ (int)Math.Pow(2, checkbox_index));
203 }
204 }
205 m_ConfigDebugProfile.SetConfigClassesFlag(new_flag);
206 /*
207 Print("-----------------------------------------");
208 Print("flag = " + new_flag);
209 foreach (string text:m_BaseConfigClassesToggled)
210 {
211 Print(text);
212 }
213 Print("-----------------------------------------");
214 */
216 }
217 else if (w == m_SelectedRowCopy)
218 {
220 return true;
221 }
222 return false;
223 }
ActionOverrideData 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:264
void RenderVariables(int row)
Определения ScriptConsoleConfigTab.c:476
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:320
void ExpandHierarchy(int row)
Определения ScriptConsoleConfigTab.c:381
void CollapseHierarchy(int row)
Определения ScriptConsoleConfigTab.c:422
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:87
proto void Print(void var)
Prints content of variable to console/log.
class array< Class T > TStringArray
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(), int, 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(), TStringArray, x и y.