Exemple #1
0
 public TreeNodeObject toTreeNode()
 {
     TreeNodeObject treeNode = new TreeNodeObject();
     treeNode.id = this.id;
     treeNode.text = this.text;
     treeNode.iconCls = this.iconCls;
     treeNode.state = this.state;
     treeNode.attributes.Add("url",this.url);
     treeNode.attributes.Add("parma", this.parma);
     return treeNode;
 }
Exemple #2
0
 public static void PCSSInitialization(ref OCILight __result, OILightInfo _info, ObjectCtrlInfo _parent, TreeNodeObject _parentNode, bool _addInfo, int _initialPosition)
 {
     Graphics.Instance?.LightManager?.Light();
 }
        public static void ministates_run_elem(VNNeoController game, TreeNodeObject elem)
        {
            var state = ministates_get_elem(game, elem);

            ministates_run_savedstate(game, state);
        }
 private static void TreeNodeCtrl_SelectSingle_Postfix(TreeNodeCtrl __instance, TreeNodeObject _node, bool _deselect)
 {
     OnSelectSingle?.Invoke(__instance, new TreeNodeEventArgs(_node));
 }
 private static void TreeNodeCtrl_SelectMultiple_Postfix(TreeNodeCtrl __instance, TreeNodeObject _start, TreeNodeObject _end)
 {
     OnSelectSingle?.Invoke(__instance, new TreeNodeEventArgs(_start));
     OnSelectMultiple?.Invoke(__instance, null);
 }
Exemple #6
0
        /// <summary>
        /// 創建設定資料夾結構,或是變更設定中的特定項目
        /// </summary>
        /// <param name="textTreeNodeObject">要變更的OCIFolder.treeNodeObject</param>
        /// <param name="config">要設定的項目</param>
        public static void MakeAndSetConfigStructure(TreeNodeObject textTreeNodeObject, Config config = Config.All)
        {
            Patches.isCreatingTextStructure = true;
            OCIFolder    textOCIFolder = Studio.Studio.GetCtrlInfo(textTreeNodeObject) as OCIFolder;
            TextMesh     t             = textOCIFolder.objectItem.GetComponentInChildren <TextMesh>(true);
            MeshRenderer m             = textOCIFolder.objectItem.GetComponentInChildren <MeshRenderer>(true);
            TreeNodeCtrl treeNodeCtrl  = Singleton <Studio.Studio> .Instance.treeNodeCtrl;

            TreeNodeObject nConfig = doMain(Patches.TextConfigPrefix, "", textTreeNodeObject);

            if (config == Config.Font || config == Config.All)
            {
                doMain(Patches.TextConfigFontPrefix, t.font.name, nConfig);
            }
            if (config == Config.FontSize || config == Config.All)
            {
                doMain(Patches.TextConfigFontSizePrefix, (t.characterSize * 500).ToString(), nConfig);
            }
            if (config == Config.FontStyle || config == Config.All)
            {
                doMain(Patches.TextConfigFontStylePrefix, t.fontStyle.ToString(), nConfig);
            }
            if (config == Config.Color || config == Config.All)
            {
                doMain(Patches.TextConfigColorPrefix, '#' + ColorUtility.ToHtmlStringRGBA(m.material.color), nConfig);
            }
            if (config == Config.Anchor || config == Config.All)
            {
                doMain(Patches.TextConfigAnchorPrefix, t.anchor.ToString(), nConfig);
            }
            if (config == Config.Align || config == Config.All)
            {
                doMain(Patches.TextConfigAlignPrefix, t.alignment.ToString(), nConfig);
            }

            Patches.isCreatingTextStructure = false;

            TreeNodeObject doMain(string prefix, string value, TreeNodeObject nRoot)
            {
                TreeNodeObject node = nRoot.child?.Where((x) =>
                                                         Studio.Studio.GetCtrlInfo(x).objectInfo.kind == 3 &&
                                                         (Studio.Studio.GetCtrlInfo(x) is OCIFolder y) &&
                                                         y.name.Contains(prefix)
                                                         ).FirstOrDefault();
                OCIFolder folder;

                if (null == node)
                {
                    //沒有找到就創建
                    folder = AddObjectFolder.Add();
                    treeNodeCtrl.SetParent(folder.treeNodeObject, nRoot);
                    folder.objectInfo.changeAmount.Reset();
                    node = folder.treeNodeObject;
                }
                else
                {
                    folder = Studio.Studio.GetCtrlInfo(node) as OCIFolder;
                }
                folder.name = folder.objectItem.name = prefix + value;
                return(node);
            }
        }
 public TreeNodeEventArgs(TreeNodeObject _node)
 {
     SelectNode = _node;
 }
 //load languages
 public override void LoadNextLevel(TreeViewObjectExplorer tv, TreeNodeObject parentNode)
 {
 }
 private static void DeleteNode(TreeNodeObject _node) => StudioCustomMasking.SceneControllerInstance.ItemDeleteEvent(_node);
Exemple #10
0
 public void Undo()
 {
     Studio.Studio.DeleteNode(this.tno);
     this.tno = (TreeNodeObject)null;
 }
 private static void OnDelete(TreeNodeObject node) => UpdateTargetObjects();
Exemple #12
0
            public void Do()
            {
                OCILight ociLight = AddObjectLight.Load(new OILightInfo(this.no, this.dicKey), (ObjectCtrlInfo)null, (TreeNodeObject)null, true, this.initialPosition);

                this.tno = ociLight == null ? (TreeNodeObject)null : ociLight.treeNodeObject;
            }
Exemple #13
0
            public void Do()
            {
                OCIItem ociItem = AddObjectItem.Load(new OIItemInfo(this.group, this.category, this.no, this.dicKey), (ObjectCtrlInfo)null, (TreeNodeObject)null, true, this.initialPosition);

                this.tno = ociItem == null ? (TreeNodeObject)null : ociItem.treeNodeObject;
            }
 public TreeNodeHtmlPropertyCollection(TreeViewObjectExplorer tv, TreeNodeObject parentNode, HtmlElement_Base objectPointer, UInt32 scopeMethodId)
     : base(tv, parentNode, false, objectPointer, scopeMethodId)
 {
     Text = "Properties inherited";
     Nodes.Add(new HtmlPropertyLoader());
 }
        public override void LoadNextLevel(TreeViewObjectExplorer tv, TreeNodeObject parentNode)
        {
            UInt32 scopeId = parentNode.ScopeMethodId;
            SortedList <string, TreeNode> newNodes = new SortedList <string, TreeNode>();
            HtmlElement_BodyBase          heb      = (HtmlElement_BodyBase)parentNode.OwnerIdentity;
            PropertyDescriptorCollection  pifs     = TypeDescriptor.GetProperties(heb.GetType());
            TreeNodeClassRoot             topClass = parentNode.TopLevelRootClassNode;
            Dictionary <UInt32, IAction>  actions  = null;

            if (topClass != null)
            {
                if (!topClass.StaticScope)
                {
                    actions = topClass.GetActions();
                }
            }
            else
            {
                if (tv != null)
                {
                    if (tv.RootClassNode != null)
                    {
                        actions = tv.RootClassNode.GetActions();
                    }
                }
                if (actions == null)
                {
                    TreeNodeClassType rootType = parentNode.TopLevelNode as TreeNodeClassType;
                    if (rootType != null)
                    {
                        actions = rootType.GetActions();
                    }
                }
            }
            for (int i = 0; i < pifs.Count; i++)
            {
                if (NotForProgrammingAttribute.IsNotForProgramming(pifs[i]))
                {
                    continue;
                }
                if (!WebClientMemberAttribute.IsClientProperty(pifs[i]) && !WebServerMemberAttribute.IsServerProperty(pifs[i]))
                {
                    continue;
                }
                TreeNodeProperty nodeProperty;
                PropertyPointer  pp;
                pp       = new PropertyPointer();
                pp.Owner = new HtmlElementPointer(heb);
                pp.SetPropertyInfo(pifs[i]);
                if (!newNodes.ContainsKey(pp.Name))
                {
                    nodeProperty = new TreeNodeProperty(ForStatic, pp);
                    try
                    {
                        newNodes.Add(pp.Name, nodeProperty);
                    }
                    catch (Exception err)
                    {
                        MathNode.Log(tv != null ? tv.FindForm() : null, err);
                    }
                    //load actions
                    bool bHasActions = false;
                    if (string.CompareOrdinal(pp.Name, "Cursor") == 0)
                    {
                        bHasActions = false;
                    }
                    if (actions != null)
                    {
                        foreach (IAction a in actions.Values)
                        {
                            if (a != null && a.IsStatic == parentNode.IsStatic)
                            {
                                if (nodeProperty.IncludeAction(a, tv, scopeId, false))
                                {
                                    bHasActions = true;
                                    break;
                                }
                            }
                        }
                        if (bHasActions)
                        {
                            nodeProperty.OnShowActionIcon();
                        }
                    }
                }
            }
            parentNode.AddSortedNodes(newNodes);
        }
Exemple #16
0
            private static bool TreeNodeCtrl_AddNode(TreeNodeCtrl __instance, TreeNodeObject _parent, ref TreeNodeObject __result, ref List <TreeNodeObject> ___m_TreeNodeObject)
            {
                if (IsStudio)
                {
                    return(true);
                }

                GameObject     gob = new GameObject();
                TreeNodeObject com = gob.AddComponent <TreeNodeObject>();

                Traverse.Create(com).Field("m_TreeNodeCtrl").SetValue(__instance);
                if (_parent != null)
                {
                    com.SetParent(_parent);
                }
                else
                {
                    ___m_TreeNodeObject.Add(com);
                }

                __result = com;
                return(false);
            }