5 protected bool m_bUseCustomFlags =
false;
10 array<ref SCR_BaseEditorAttributeEntry> entries =
new array<ref SCR_BaseEditorAttributeEntry>;
11 attribute.GetEntries(entries);
13 foreach (SCR_BaseEditorAttributeEntry entry: entries)
16 if (multiSelectPresetEntry)
18 m_bUseCustomFlags = multiSelectPresetEntry.GetUsesCustomFlags();
23 super.Init(w, attribute);
31 int count = m_ToolBoxComponent.GetNumItems();
32 vector flags = var.GetVector();
35 if (!m_bUseCustomFlags)
42 for (
int i = 0; i < count; i++)
45 m_ToolBoxComponent.SetItemSelected(i, (value & flag),
false);
49 if (flagPerIndex >= 31)
65 for (
int i = 0; i < count; i++)
67 m_ToolBoxComponent.SetItemSelected(i, (value & (
int)m_ButtonBoxData.GetEntryFloatValue(i)),
false);
72 m_bButtonValueInitCalled =
true;
74 SetFromVarOrDefault();
78 override bool OnChange(Widget w,
int x,
int y,
bool finished)
80 if (!m_bButtonValueInitCalled)
89 int count = m_ToolBoxComponent.GetNumItems();
90 if (!m_bUseCustomFlags)
92 flags = Vector(0,0,0);
98 for (
int i = 0; i < count; i++)
101 if (m_ToolBoxComponent.IsItemSelected(i))
103 value = flags[
index];
105 flags[
index] = value;
111 if (flagPerIndex >= 31)
124 int flagValues = flags[0];
126 for (
int i = 0; i < count; i++)
128 if (m_ToolBoxComponent.IsItemSelected(i))
129 flagValues |= (
int)m_ButtonBoxData.GetEntryFloatValue(i);
131 flagValues &= ~(
int)m_ButtonBoxData.GetEntryFloatValue(i);
134 flags[0] = flagValues;
136 var.SetVector(flags);
137 AttributeValueChanged();
143 super.OnMultiSelectButton(toolbox,
index, state);
144 OnChange(toolbox.GetRootWidget(),
index, state,
false);