Esempio n. 1
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
                };
            }
        }
Esempio n. 2
0
        protected void OnEnable()
        {
            Texture2D image = plyEdGUI.LoadTextureResource("BloxEditor.res.icons.blox_mono" + (plyEdGUI.IsDarkSkin() ? "_p" : "") + ".png", typeof(BloxListWindow).Assembly, FilterMode.Point, TextureWrapMode.Clamp);

            base.titleContent = new GUIContent("Blox Definitions", image);
            BloxEd.LoadBloxGlobal();
            if (this.listOps == null)
            {
                this.listOps = new plyEdGUI.ListOps
                {
                    emptyMsg          = "No Blox defined",
                    drawBackground    = false,
                    onDrawElement     = this.DrawElement,
                    canAdd            = false,
                    canDuplicate      = false,
                    canRemove         = false,
                    canChangePosition = false
                };
            }
        }