//public virtual float PropSet(string sPropName, float nValue) { //###CHECK: Needed by scripting? // int nPropEnumOrdinal = (int)Enum.Parse(_oTypeFieldsEnum, sPropName); //###NOTROBUST!!! // CProp oProp = PropFind(nPropEnumOrdinal); // return oProp.PropSet(nValue); //} public CPropGroup PropGroupBegin(string sNamePropGrp, string sDescPropGrp, bool bInvisible = false, int nNumWidgetColumns = 1) { // Indicate the beginning of a 'property group' = a Client-side-only entity that groups our flat property array into user-friendly groups (used for GUI separation) _oPropGroup_LastAdded = new CPropGroup(sNamePropGrp, sDescPropGrp, bInvisible, nNumWidgetColumns); _aPropGroups.Add(_oPropGroup_LastAdded); return _oPropGroup_LastAdded; }
//--------------------------------------------------------------------------- GUI public int CreateWidget(CPropGroup oPropGrp) { if ((_nPropFlags & CProp.Hide) != 0) // We don't show in GUI properties marked as hidden... these can only be changed through code. return 0; if (_oTypeChoice != null) { FieldInfo[] aFieldsEnum = _oTypeChoice.GetFields(); _oUIWidget = CUIDropdown.Create(oPropGrp._oUIPanel, this, aFieldsEnum); } else if ((_nPropFlags & CProp.AsCheckbox) != 0) { _oUIWidget = CUIToggle.Create(oPropGrp._oUIPanel, this); } else if ((_nPropFlags & CProp.AsButton) != 0) { _oUIWidget = CUIButton.Create(oPropGrp._oUIPanel, this); } else { _oUIWidget = CUISlider.Create(oPropGrp._oUIPanel, this); } //_oWidgetGUI.variableName = _sNameProp; //###CHECK: Safe with spaces in-between?? //_oWidgetGUI.label.text = _sLabel; //_oWidgetGUI.label.tooltip = _sDescription; //if (oPropGrp._nNumWidgetColumns == 1) // If our panel group only has a single column, every widget addition expands our height. If not a single column group then we only have one row and we never grow (size was set during group creation) // oPropGrp._oContainer.setHeight(oPropGrp._oContainer.positionAndSize.height + G.C_Gui_WidgetsHeight); CProp.SetValueGUI(_oUIWidget, _sLabel, PropGet()); return 1; //###BUG???: We should return zero on multi-controls per line but strangely I don't see problem in GUI! Check!! }