Ejemplo n.º 1
0
        public static void Show_BloxListWindow()
        {
            BloxListWindow obj   = BloxListWindow.Instance = EditorWindow.GetWindow <BloxListWindow>("BloxDefs");
            Texture2D      image = plyEdGUI.LoadTextureResource("BloxEditor.res.icons.blox_mono" + (EditorGUIUtility.isProSkin ? "_p" : "") + ".png", typeof(BloxListWindow).Assembly, FilterMode.Point, TextureWrapMode.Clamp);

            obj.titleContent = new GUIContent("BloxDefs", image);
        }
Ejemplo n.º 2
0
        public static void Show_BloxListWindow()
        {
            Debug.Log(" Show_BloxListWindow", "BloxListWindow", UnityEngine.Color.yellow);
            BloxListWindow obj   = BloxListWindow.Instance = EditorWindow.GetWindow <BloxListWindow>("BloxDefs");
            Texture2D      image = plyEdGUI.LoadTextureResource("BloxEditor.res.icons.blox_mono" + (plyEdGUI.IsDarkSkin() ? "_p" : "") + ".png", typeof(BloxListWindow).Assembly, FilterMode.Point, TextureWrapMode.Clamp);

            obj.titleContent = new GUIContent("BloxDefs", image);
        }
Ejemplo n.º 3
0
        private void AddNewBloxDef()
        {
            Blox blox = BloxEd.CreateNewBloxDef();

            this.Target.bloxIdents.Add(blox.ident);
            this.targetBloxCache.Add(blox);
            this.Save();
            BloxListWindow instance = BloxListWindow.Instance;

            if ((object)instance != null)
            {
                instance.Repaint();
            }
        }
Ejemplo n.º 4
0
        protected void OnEnable()
        {
            Debug.Log("OnEnable", "BloxListWindow", UnityEngine.Color.yellow);
            BloxListWindow.Instance = this;
            Texture2D image = plyEdGUI.LoadTextureResource("BloxEditor.res.icons.blox_mono" + (plyEdGUI.IsDarkSkin() ? "_p" : "") + ".png", typeof(BloxListWindow).Assembly, FilterMode.Point, TextureWrapMode.Clamp);

            base.titleContent = new GUIContent("BloxDefs", image);
            BloxEd.LoadBloxGlobal();
            if (this.listOps == null)
            {
                this.listOps = new plyEdGUI.ListOps
                {
                    emptyMsg       = "No Blox defined",
                    drawBackground = false,
                    onDrawElement  = this.DrawElement,
                    onAction       = this.ListAction,
                    extraButtons   = new plyEdGUI.ListOpsExtraToolbarButton[2]
                    {
                        new plyEdGUI.ListOpsExtraToolbarButton
                        {
                            label    = new GUIContent(Ico._rename, "Rename selected Blox Definition"),
                            callback = delegate
                            {
                                plyTextInputWiz.ShowWiz("Rename Blox", "", BloxEd.BloxGlobalObj.bloxDefs[this.selectedBloxIdx].screenName, this.OnRenameBloxDef, null, 250f);
                            },
                            enabled = (() => this.selectedBloxIdx >= 0)
                        },
                        new plyEdGUI.ListOpsExtraToolbarButton
                        {
                            label    = new GUIContent(Ico._blox + "Edit", "Edit in Blox Editor"),
                            callback = delegate
                            {
                                BloxEditorWindow.Show_BloxEditorWindow(BloxEd.BloxGlobalObj.bloxDefs[this.selectedBloxIdx]);
                            },
                            enabled = (() => this.selectedBloxIdx >= 0)
                        }
                    },
                    canAdd            = true,
                    canDuplicate      = false,
                    canRemove         = true,
                    canChangePosition = false,
                    addLabel          = BloxListWindow.GC_Add,
                    removeLabel       = BloxListWindow.GC_Remove,
                    duplicateLabel    = BloxListWindow.GC_Duplicate
                };
            }
        }
Ejemplo n.º 5
0
        private void OnRenameBloxDef(plyTextInputWiz wiz)
        {
            string text = wiz.text;

            wiz.Close();
            if (!string.IsNullOrEmpty(text))
            {
                this.targetBloxCache[this.list.index].screenName = text;
                plyEdUtil.SetDirty(this.targetBloxCache[this.list.index]);
                BloxEd.SortBloxDefList();
                base.Repaint();
                BloxListWindow instance = BloxListWindow.Instance;
                if ((object)instance != null)
                {
                    instance.Repaint();
                }
                BloxEditorWindow instance2 = BloxEditorWindow.Instance;
                if ((object)instance2 != null)
                {
                    instance2.Repaint();
                }
            }
        }
Ejemplo n.º 6
0
 protected void OnFocus()
 {
     BloxListWindow.Instance = this;
 }
Ejemplo n.º 7
0
 public static void Show_BloxList()
 {
     BloxListWindow.Show_BloxListWindow();
 }