예제 #1
0
        public override void doLayout()
        {
            base.doLayout();
            float icon_sz = this.inner_area.height;

            pl_icon.Set_Pos(0, 0);
            pl_icon.Set_Size(icon_sz, icon_sz);

            const float xPad = 4f;

            pl_title.moveRightOf(pl_icon, xPad);

            pl_version.moveRightOf(pl_icon, xPad);
            pl_version.moveBelow(pl_title);

            pl_status.alignBottom();
            pl_status.alignRightSide();
        }
        public PluginLoader_Watermark_Component() : base()
        {
            Autosize_Method = AutosizeMethod.GROW;
            Name            = "Watermark";
            //local_style.normal.background = null;
            Set_Padding(2);

            label           = Create <uiText>(this);
            label.TextColor = new Color(1f, 1f, 1f, 0.6f);
            label.TextSize  = 16;
            label.TextStyle = FontStyle.Bold;
            label.Text      = Loader.TITLE;


            icon = Create <uiIcon>(this);
            icon.local_style.normal.background = null;
            icon.Image = TextureHelper.icon_logo;
            icon.Tint  = new Color(1f, 1f, 1f, 0.6f);
            icon.Set_Size(36, 36);
        }
예제 #3
0
        private void Select_Plugin(Plugin p)
        {
            set_layout_dirty();
            if (!list.isEmpty)
            {
                pl_tab.Select();
                //set ALL selectors to inactive first.
                foreach (var sel in list.Get_Children())
                {
                    ((Plugin_Manager_List_Item)sel).Active = false;
                }
            }
            else
            {
                tab_ins.Select();
            }

            // Unregister our error event hook for the last plugin we had selected
            Plugin last = GetPlugin();

            if (last != null)
            {
                last.onError -= onPluginError;
            }

            selected = null;
            if (p != null)
            {
                selected = p.Hash;
                Plugin_Manager_List_Item sel = list[p.Hash] as Plugin_Manager_List_Item;
                if (sel != null)
                {
                    sel.Active = true;
                }
            }
            p.onError += onPluginError;

            control_panel.Set_Collapsed(selected == null);

            float thumb_aspect = 1f;
            float thumb_sz     = 256f;

            if (p == null || p.data == null)
            {
                this.pl_title.Text = "";
                this.pl_auth.Text  = "";
                this.pl_desc.Text  = "";
                //this.pl_desc.isDisabled = true;

                this.pl_vers.Text        = "";
                this.pl_thumb.Image      = null;
                this.pl_toggle.isVisible = false;
                this.pl_toggle.isChecked = false;
                this.pl_errors.Collapse();
            }
            else
            {
                this.pl_title.Text = p.data.NAME;
                this.pl_auth.Text  = String.Format("<color=#808080ff>Author:</color> {0}", p.data.AUTHOR);
                this.pl_desc.Text  = (string.IsNullOrEmpty(p.data.DESCRIPTION) ? "<b><color=#808080ff>No Description</color></b>" : p.data.DESCRIPTION);
                //this.pl_desc.isDisabled = false;

                this.pl_vers.Text        = p.data.VERSION.ToString();
                this.pl_thumb.Image      = p.thumbnail;
                this.pl_toggle.isVisible = true;
                this.pl_toggle.isChecked = p.Enabled;
                this.pl_errors.Set_Collapsed(!p.HasErrors);
            }

            if (this.pl_thumb.Image == null)
            {
                thumb_sz = 0f;
            }
            else
            {
                thumb_aspect = ((float)this.pl_thumb.Image.height / (float)this.pl_thumb.Image.width);
            }

            float thumb_height = (thumb_sz * thumb_aspect);

            pl_thumb.Set_Size(thumb_sz, thumb_height);
        }