コード例 #1
0
        public void AddEditorUI(string id, ITreeNodeView view, IProperty property)
        {
            _property = property;
            var label = view.TreeItem;
            var panel = _factory.UI.GetPanel(id, 0f, 0f, 0f, 0f, label.TreeNode.Parent);

            _combobox = SelectEditor.GetCombobox($"{id}_Combobox", _factory, panel, 200f);
            _text     = _combobox.TextBox;
            _combobox.DropDownPanelList.MinWidth = 200f;
            _combobox.DropDownPanelList.Items.AddRange(_colorList);
            _combobox.Z = label.Z;

            _colorLabel             = _factory.UI.GetLabel($"{id}_ColorLabel", "", 50f, 25f, 250f, 0f, panel);
            _colorLabel.TextVisible = false;

            var layout = view.HorizontalPanel.GetComponent <ITreeTableRowLayoutComponent>();

            if (layout != null)
            {
                layout.RestrictionList.RestrictionList.AddRange(new List <string> {
                    panel.ID
                });
            }

            RefreshUI();
            _text.OnPressingKey.Subscribe(onTextboxPressingKey);
            _combobox.SuggestMode = ComboSuggest.Suggest;
            _combobox.DropDownPanelList.OnSelectedItemChanged.Subscribe(args =>
            {
                setColor(Color.FromHexa(NamedColorsMap.NamedColors[args.Item.Text]));
            });
        }
コード例 #2
0
 public InstancePropertyEditor(IGameFactory factory, ActionManager actions, StateModel model, AGSEditor editor,
                               IForm parentForm, Action refreshNode)
 {
     _refreshNode  = refreshNode;
     _parentForm   = parentForm;
     _editor       = editor;
     _selectEditor = new SelectEditor(factory, actions, model, getOptions, getValue);
 }
コード例 #3
0
 public EnumPropertyEditor(IGameFactory factory, ActionManager actions, StateModel model)
 {
     _editor = new SelectEditor(factory, actions, model, getOptions, getValue);
 }