Пример #1
0
        public uiDialogResult()
        {
            Set_Size(450, 300);
            Center();

            message = Create <uiTextArea>("msg", this);
            message.Autosize_Method = AutosizeMethod.BLOCK;
            message.Autosize        = true;
            message.Text            = "Lorum Ipsum Lorum Ipsum\nLorum Ipsum Lorum Ipsum";
            message.TextColor       = new Color(0.6f, 0.6f, 0.6f, 1f);

            contentPanel = Create <uiScrollPanel>("content", this);
            contentPanel.Set_Margin(0, 6);

            btnPanel = Create <uiWrapperPanel>("btn_panel", this);
            btnPanel.Autosize_Method = AutosizeMethod.BLOCK;
            btnPanel.Autosize        = true;
            btnPanel.onLayout       += BtnPanel_onLayout;

            btn_ok            = Create <uiButton>("btn_ok", btnPanel);
            btn_ok.Text       = "OK";
            btn_ok.onClicked += (uiControl c) => { Result = DialogResult.OK; };
            btn_ok.Set_Padding(5, 2);

            btn_later            = Create <uiButton>("btn_later", btnPanel);
            btn_later.Text       = "Later";
            btn_later.onClicked += (uiControl c) => { Result = DialogResult.CANCEL; };
            btn_later.Set_Padding(5, 2);
        }
        public Plugin_Update_Viewer()
        {
            onLayout += Plugin_Update_Viewer_onLayout;
            Title     = "Updates Available";
            Set_Size(400, 500);
            CenterVertically();
            alignLeftSide(5f);
            onShown += Plugin_Update_Viewer_onShown;


            list                     = Create <uiScrollPanel>(this);
            list.Margin              = new RectOffset(5, 5, 0, 5);
            list.Padding             = new RectOffset(2, 2, 2, 2);
            list.onLayout           += List_onLayout;
            list.Border.normal.color = Color.grey;

            mark_all           = Create <uiCheckbox>(this);
            mark_all.text      = "Mark/Unmark All";
            mark_all.isChecked = true;
            mark_all.onChange += Mark_all_onChange;

            btn_update      = Create <uiButton>(this);
            btn_update.Text = "Update";
            btn_update.local_style.fontSize = 18;
            btn_update.onClicked           += Btn_start_onClicked;

            msg_instruct        = Create <uiTextArea>(this);
            msg_instruct.Margin = new RectOffset(3, 3, 3, 3);
            msg_instruct.Text   = "<b>Some of your plugins have updates available</b>\n<i><color=#BBBBBB>Select plugins to update then click the button at the bottom to begin!</color></i>";
        }
Пример #3
0
        public uiWindow() : base(uiControlType.Window)
        {
            ALL.Add(ID);

            isDraggable = true;  // among other things; this control cannot have it's position assigned via auto-positioners.
            Autosize    = false;
            isVisible   = false; //hidden by default
            Title       = "Window";
            //selfPadding = new RectOffset(0, 0, title_bar_height, 0);
            //local_style.fontStyle = FontStyle.Bold;
            //local_style.fontSize = 32;

            Setup_Titlebar();


            closeBtn = Create <uiButton>();
            GUIStyle sty = new GUIStyle();

            sty.normal.background       = TextureHelper.icon_close_dark;
            sty.hover.background        = TextureHelper.icon_close;
            closeBtn.Border.hover.size  = new RectOffset(1, 1, 1, 1);
            closeBtn.Border.hover.color = new Color(1f, 1f, 1f, 0.2f);
            closeBtn.Border.type        = uiBorderType.NONE;//we don't ever want the close button to render a border.

            closeBtn.Set_Size(title_bar_height, title_bar_height);
            closeBtn.Set_Style(sty);
            closeBtn.onClicked += CloseBtn_onClicked;
            closeBtn.Set_Margin(6);


            content_panel = Create <uiScrollPanel>();
            content_panel.Set_Margin(5, 5, 0, 5);
            content_panel.Autosize            = true;
            content_panel.Autosize_Method     = AutosizeMethod.FILL;
            content_panel.Border.normal.color = new Color(0f, 0f, 0f, 0.35f);// A semi-transparent black to darken the edges around the content area so it's more distinguishable.

            this.Add_Control(content_panel);
            this.Add_Control(closeBtn);

            this.layout_content_area();
        }
Пример #4
0
        public PluginManager()
        {
            onLayout += PluginManager_onLayout;
            Title     = "Plugin Manager";
            Set_Size(650, 400);
            Center();
            onShown  += PluginManager_onShown;
            onHidden += PluginManager_onHidden;

            list = Create <uiListView>(this);
            list.Set_Width(200f);
            list.Set_Margin(2, 0, 2, 2);


            top_wrapper = Create <uiWrapperPanel>(this);
            top_wrapper.Autosize_Method = AutosizeMethod.BLOCK;
            top_wrapper.Set_Margin(0, 0, 0, 2);
            top_wrapper.Set_Padding(2);
            top_wrapper.onLayout += Top_wrapper_onLayout;


            btn_store                     = Create <uiIconButton>(top_wrapper);
            btn_store.Text                = "Plugin Store";
            btn_store.Icon                = TextureHelper.icon_arrow_left;
            btn_store.Border.type         = uiBorderType.NONE;
            btn_store.Border.normal.color = Color.white;
            btn_store.Border.normal.size  = new RectOffset(1, 1, 1, 1);
            btn_store.onClicked          += (uiControl c) => { uiWindow.Switch(PluginStore.Instance); };


            btn_donate                 = Create <uiIcon>(top_wrapper);
            btn_donate.Text            = null;
            btn_donate.Image           = (Texture2D)TextureHelper.Load_From_Resource("donate_btn.png", "SR_PluginLoader", (TextureOpFlags.NO_MIPMAPPING & TextureOpFlags.NO_WRAPPING));
            btn_donate.Image_MouseOver = Util.Tint_Texture((Texture2D)TextureHelper.Load_From_Resource("donate_btn.png", "SR_PluginLoader", (TextureOpFlags.NO_MIPMAPPING & TextureOpFlags.NO_WRAPPING)), new Color(0.7f, 0.7f, 0.7f));
            btn_donate.Border.type     = uiBorderType.NONE;
            btn_donate.onClicked      += (uiControl c) => { Process.Start("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DYGPA5XA4MWC2"); };


            //CONTROL PANEL
            control_panel = Create <uiCollapser>("control_panel", this);
            control_panel.Autosize_Method = AutosizeMethod.BLOCK;
            control_panel.Set_Margin(2, 2, 2, 0);
            control_panel.Set_Padding(2);
            Util.Set_BG_Color(control_panel.local_style.normal, new Color(0f, 0f, 0f, 0.2f));
            control_panel.onLayout += Control_panel_onLayout;
            control_panel.Collapse();


            pl_toggle           = Create <uiToggle>("pl_toggle", control_panel);
            pl_toggle.onChange += Pl_toggle_onChange;

            btn_copy_json      = Create <uiButton>("copy_json", control_panel);
            btn_copy_json.Text = "Copy Json";
            btn_copy_json.Set_Margin(3, 0);
            btn_copy_json.onClicked += Btn_copy_json_onClicked;


            // TABBED PANEL
            tabPanel = Create <uiTabPanel>(this);
            tabPanel.Autosize_Method = AutosizeMethod.FILL;
            tabPanel.disableBG       = true;
            tabPanel.Set_Margin(2);// This margin gives us that light colored area surrounding the list and tabpanel
            pl_tab = tabPanel.Add_Tab(PLUGIN_TAB_NAME);
            tabPanel.CurrentTab.onLayout += tabPanel_onLayout;
            tabPanel.onChanged           += TabPanel_onChanged;

            pl_tab.Set_Padding(3);// so we can distinguish where the plugin thumbnail's borders are


            // PLUGIN ERRORS PANEL
            pl_errors           = Create <uiCollapser>(pl_tab);
            pl_errors.onLayout += Clps_errors_onLayout;
            pl_errors.Collapse();

            var err_ico = Create <uiIcon>("err_ico", pl_errors);

            err_ico.Image = TextureHelper.icon_alert;
            err_ico.Set_Height(26);

            var err_lbl = Create <uiText>("err_lbl", pl_errors);

            err_lbl.TextColor = Color.red;
            err_lbl.Text      = "Plugin experienced errors while loading!";
            err_lbl.TextAlign = TextAnchor.MiddleLeft;
            err_lbl.Set_Margin(2, 0, 0, 0);


            // PLUGIN INFO

            pl_title = Create <uiText>("pl_title", pl_tab);
            pl_title.local_style.fontSize  = 22;
            pl_title.local_style.fontStyle = FontStyle.Bold;


            pl_auth = Create <uiText>("pl_author", pl_tab);
            pl_vers = Create <uiText>("pl_vers", pl_tab);
            pl_desc = Create <uiTextArea>("pl_desc", pl_tab);

            pl_thumb = Create <uiIcon>("pl_thumb", pl_tab);
            pl_thumb.Border.normal.color = new Color(0f, 0f, 0f, 0.3f);

            pl_desc.Set_Margin(2);
            pl_desc.Set_Background(new Color(0.1f, 0.1f, 0.1f, 0.4f));
            pl_desc.Set_Padding(2);
            pl_desc.Border.normal.color = new Color(0f, 0f, 0f, 0.3f);
            pl_desc.Autosize_Method     = AutosizeMethod.BLOCK;

            // INSTRUCTIONS TAB
            tab_ins = tabPanel.Add_Tab(INSTRUCTION_TAB_NAME);
            tabPanel.CurrentTab.onLayout += InstructionsTab_onLayout;

            ins_title           = Create <uiTextArea>(tabPanel);
            ins_title.Text      = "Settings";
            ins_title.TextSize  = 20;
            ins_title.TextStyle = FontStyle.Bold;

            ins_text           = Create <uiTextArea>(tabPanel);
            ins_text.Text      = "Select a plugin from the list on the left to manage it's settings.\nOr, to browse more plugins for download, click the \"Plugin Store\" button at the top left of this window!";
            ins_text.TextStyle = FontStyle.Italic;
            ins_text.Autosize  = true;


            tab_need_plugins              = tabPanel.Add_Tab(NEED_PLUGINS_TAB_NAME);
            tabPanel.CurrentTab.onLayout += NeedPluginsTab_onLayout;

            nop_wrapper           = Create <uiWrapperPanel>(tabPanel);
            nop_wrapper.onLayout += Nop_Wrapper_onLayout;

            ins_no_plugins_text           = Create <uiTextArea>(nop_wrapper);
            ins_no_plugins_text.Text      = "You do not have any plugins installed!\nVisit the plugin store to find and install new plugins.";
            ins_no_plugins_text.TextSize  = 16;
            ins_no_plugins_text.TextColor = new Color(1f, 0.1f, 0.1f, 0.9f);
            ins_no_plugins_text.TextStyle = FontStyle.Bold;
            ins_no_plugins_text.TextAlign = TextAnchor.UpperCenter;
            ins_no_plugins_text.Autosize  = true;
        }
        public PluginStore()
        {
            onLayout += PluginStore_onLayout;
            Title     = "Plugin Store";
            Set_Size(800, 600);
            Center();


            lbl_pl_count       = Create <uiVarText>(this);
            lbl_pl_count.Text  = "Total Plugins:";
            lbl_pl_count.Value = "0";
            lbl_pl_count.text_style.fontStyle = FontStyle.Bold;

            search           = uiControl.Create <uiTextbox>(this);
            search.onChange += Search_onChange;

            lbl_search      = uiControl.Create <uiText>(this);
            lbl_search.Text = "Search ";


            btn_config             = Create <uiIconButton>(this);
            btn_config.Text        = "Settings";
            btn_config.Icon        = TextureHelper.icon_arrow_left;
            btn_config.Border.type = uiBorderType.NONE;
            //btn_config.Skin = uiSkinPreset.FLAT;
            btn_config.Border.normal.color = Color.white;
            btn_config.Border.normal.size  = new RectOffset(1, 1, 1, 1);
            btn_config.onClicked          += Btn_config_onClicked;


            tabPanel = Create <uiTabPanel>(this);
            tabPanel.Add_Tab(MAIN_TAB_NAME);
            tabPanel.CurrentTab.onLayout += InfoTab_onLayout;
            tabPanel.Set_Margin(2);// This margin gives us that light colored area surrounding the list and tabpanel


            pl_title      = uiControl.Create <uiText>(tabPanel);
            pl_title.Text = "";
            var sty = new GUIStyle(pl_title.Style);

            sty.fontStyle = FontStyle.Bold;
            sty.fontSize  = 22;
            pl_title.Set_Style(sty);


            pl_auth      = uiControl.Create <uiText>(tabPanel);
            pl_auth.Text = "";

            pl_desc      = uiControl.Create <uiTextArea>(tabPanel);
            pl_desc.Text = "";
            pl_desc.Set_Padding(2);
            pl_desc.Border.normal.color = new Color(0f, 0f, 0f, 0.3f);


            install_btn = uiControl.Create <uiButton>(tabPanel);
            install_btn.local_style.fontSize  = 18;
            install_btn.local_style.fontStyle = FontStyle.Bold;
            install_btn.Text       = "Download";
            install_btn.onClicked += Install_btn_onClicked;
            Color blue = new Color(0.2f, 0.4f, 1f, 1f);

            Util.Set_BG_Gradient(install_btn.local_style.normal, 64, GRADIENT_DIR.TOP_BOTTOM, blue, new Color(0.5f, 0.5f, 0.5f, 1f) * blue);


            // INSTRUCTIONS TAB
            tabPanel.Add_Tab(INSTRUCTION_TAB_NAME);
            tabPanel.CurrentTab.onLayout += InstructionsTab_onLayout;;

            ins_title           = Create <uiTextArea>(tabPanel);
            ins_title.Text      = "Welcome";
            ins_title.TextSize  = 22;
            ins_title.TextStyle = FontStyle.Bold;

            ins_text           = Create <uiTextArea>(tabPanel);
            ins_text.Text      = "Here you can find and download new plugins.\nTo get started select a plugin from the list on the left to see more information about it.\nWhen you find a plugin you wish to install you can do so by clicking the \"Install\" button!";
            ins_text.TextStyle = FontStyle.Italic;
            ins_text.TextAlign = TextAnchor.UpperCenter;
            ins_text.Autosize  = true;

            statusPanel = Create <uiTabPanel>(this);
            statusPanel.Set_Width(200);
            statusPanel.Set_Margin(2, 0, 2, 2);
            statusPanel.onLayout += StatusPanel_onLayout;

            loading_tab       = statusPanel.Add_Tab("loading_tab");
            ld_text           = Create <uiTextArea>("ld_text", statusPanel);
            ld_text.Text      = "...";
            ld_text.TextSize  = 16;
            ld_text.TextAlign = TextAnchor.MiddleCenter;

            retry_pl_list_btn = Create <uiButton>(statusPanel);
            retry_pl_list_btn.Set_Margin(0, 0, 4, 0);
            retry_pl_list_btn.Text     = "Refresh";
            retry_pl_list_btn.TextSize = 16;
            Util.Set_BG_Gradient(retry_pl_list_btn.local_style.normal, 64, GRADIENT_DIR.TOP_BOTTOM, blue, new Color(0.5f, 0.5f, 0.5f, 1f) * blue);
            retry_pl_list_btn.onClicked += retry_btn_onClicked;
            retry_pl_list_btn.isVisible  = false;

            statusPanel.CurrentTab.onLayout += CurrentTab_onLayout;

            plugins_tab          = statusPanel.Add_Tab("plugins_tab");
            list                 = Create <uiListView>(plugins_tab);
            list.disableBG       = true;
            list.Autosize_Method = AutosizeMethod.FILL;
            list.FloodXY();

            loading_tab.Select();
        }