52 w.GetParent().Unlink();
58 super.OnChange(w,
x,
y, finished);
75 super.OnItemSelected(w,
x,
y, row, column, oldRow, oldColumn);
79 TextListboxWidget wgt = TextListboxWidget.Cast(w);
96 super.OnClick(w,
x,
y,button);
98 CheckBoxWidget cbw = CheckBoxWidget.Cast(w);
104 if (selectedRowIndex > -1)
108 int index = param.
IndexOf(
"=");
113 int objects_row_index;
119 string path = params.param4;
121 path.Split(
" ", pathArr);
124 foreach (
int indx,
string s:pathArr)
128 relativePath+= s+
" ";
133 relativePath = relativePath.
Trim();
154 if (config_params.param1 ==
false)
164 m_Row = objects_row_index;
184 if (index_toggled == -1)
190 new_flag = (flag | (
int)
Math.
Pow(2, checkbox_index));
194 else if (index_toggled != -1)
200 new_flag = (flag ^ (
int)
Math.
Pow(2, checkbox_index));
225 super.Update(timeslice);
243 CheckBoxWidget cbw = CheckBoxWidget.Cast(w.FindAnyWidget(
"Item"));
250 if (flag1 & (
int)
Math.
Pow(2, indx))
254 cbw.SetChecked(
true);
262 protected void DumpParam(
string param,
string relativePath)
266 relativePath =
" " + relativePath;
274 for (
int j = 0; j < objects_count; j++ )
283 string path = config_path +
" " + child_name + relativePath +
" " + param;
288 Print(child_name +
"," + param +
"," + value);
323 string config_path =
"configfile";
325 for (
int i = 0; i < variables.Count(); i++)
327 string variable = variables.Get(i);
333 string new_config_path = (config_path +
" " + variable).Trim();
346 string config_base_path =
"configfile";
352 filter_lower.
Split(
" ", filters);
357 string config_path = config_base_path +
" " + config_root;
360 for (
int j = 0; j < variables.Count(); j++)
362 string variable = variables.Get(j);
363 string variable_lower = variable;
366 for (
int k = 0; k < filters.Count(); k++)
368 if (variable_lower.
Contains(filters.Get(k)))
370 string new_config_path = (config_path +
" " + variable).Trim();
392 string config_path = config_params.param4;
393 int deep = config_params.param5;
397 for (
int i = 0; i < deep; i++)
399 offset = offset +
" ";
404 int childrens_count = variables.Count();
407 offset = offset +
" ";
412 for (i = variables.Count() - 1; i >= 0; i--)
414 string new_config_path = (config_path +
" " + variables.Get(i)).Trim();
432 if (!config_params || !config_params_next)
434 int deep = config_params.param5;
435 int deep_next = config_params_next.param5;
437 int remove_lines_count = 0;
439 for (
int i = row + 1; i < max_count; i++)
441 if (deep < deep_next && i <= max_count)
443 remove_lines_count = remove_lines_count + 1;
445 deep_next = config_params_next.param5;
451 for (i = 1; i < remove_lines_count; i++)
461 for (i = 0; i < deep; i++)
463 offset = offset +
" ";
482 filter_lower.
Split(
" ", filters);
489 string path = config_params.param4;
492 for (
int i = 0; i < variables.Count(); i++)
494 string var = variables.Get(i);
496 if (filters.Count() == 0)
502 foreach (
string f: filters)
class OptionSelectorMultistate extends OptionSelector class_name
PluginBase GetPlugin(typename plugin_type)
Param5< bool, string, int, string, int > ConfigParams
Param6< bool, string, int, string, int, string > ConfigParamsEx
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
proto native WorkspaceWidget GetWorkspace()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
static void GetBaseConfigClasses(out TStringArray base_classes)
Returns some of base config classes strings like CfgVehicles, CfgWeapons, etc. for searching purposes...
override bool OnClick(Widget w, int x, int y, int button)
override bool OnChange(Widget w, int x, int y, bool finished)
TextListboxWidget m_ConfigVariablesTextListbox
void FindInHierarchy(string class_name)
void DumpParam(string param, string relativePath)
override void Update(float timeslice)
void RenderVariables(int row)
ref TStringArray m_BaseConfigClasses
ref map< CheckBoxWidget, int > m_ClassCheckboxes
Widget m_WgtClassesConfig
EditBoxWidget m_VariableConfigFilter
TextListboxWidget m_ConfigHierarchyTextListbox
static string m_VariableTextField
void ~ScriptConsoleConfigTab()
EditBoxWidget m_ObjectConfigFilter
void ExpandHierarchy(int row)
void ChangeConfigFilter()
void CollapseHierarchy(int row)
PluginConfigViewer m_ModuleConfigViewer
void ScriptConsoleConfigTab(Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent=null)
override bool OnItemSelected(Widget w, int x, int y, int row, int column, int oldRow, int oldColumn)
static ref ConfigParamsEx m_ConfigData
ref TStringArray m_BaseConfigClassesToggled
ButtonWidget m_DumpParamButton
ButtonWidget m_SelectedRowCopy
static string m_ConfigTextField
PluginConfigDebugProfile m_ConfigDebugProfile
void ScriptConsoleTabBase(Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent=null)
void AddItemToClipboard(TextListboxWidget text_listbox_widget)
proto native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.
array< string > TStringArray
static proto float Pow(float v, float power)
Return power of v ^ power.
proto string Trim()
Returns trimmed string with removed leading and trailing whitespaces.
bool Contains(string sample)
Returns true if sample is substring of string.
void Split(string sample, out array< string > output)
Splits string into array of strings separated by 'sample'.
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.
proto int ToLower()
Changes string to lowercase. Returns length.