public void OnSettingsUI(UIHelperBase helper)
        {
            var tabTemplate = Resources
                .FindObjectsOfTypeAll<UITabstrip>()[0]
                .GetComponentInChildren<UIButton>();

            _optionsPanel = ((UIHelper)helper).self as UIScrollablePanel;
            _optionsPanel.autoLayout = false;

            UITabstrip strip = _optionsPanel.AddUIComponent<UITabstrip>();
            strip.relativePosition = new Vector3(0, 0);
            strip.size = new Vector2(744, 40);

            UITabContainer container = _optionsPanel.AddUIComponent<UITabContainer>();
            container.relativePosition = new Vector3(0, 40);
            container.size = new Vector3(744, 713);
            strip.tabPages = container;

            int tabIndex = 0;
            foreach (IModule module in Modules)
            {
                strip.AddTab(module.Name, tabTemplate, true);
                strip.selectedIndex = tabIndex;

                // Get the current container and use the UIHelper to have something in there
                UIPanel stripRoot = strip.tabContainer.components[tabIndex++] as UIPanel;
                stripRoot.autoLayout = true;
                stripRoot.autoLayoutDirection = LayoutDirection.Vertical;
                stripRoot.autoLayoutPadding.top = 5;
                stripRoot.autoLayoutPadding.left = 10;
                UIHelper stripHelper = new UIHelper(stripRoot);
                
                module.OnSettingsUI(stripHelper);
            }
        }
Beispiel #2
0
 public static GameObject GetObject(GameObject go, string subnode)
 {
     return(UIHelper.GetObject(go.get_transform(), subnode));
 }
Beispiel #3
0
 public static Component GetComponent(GameObject go, string subnode, string type)
 {
     return(UIHelper.GetComponent(go.get_transform(), subnode, type));
 }
Beispiel #4
0
 public static T Get <T>(GameObject go, string subnode) where T : Component
 {
     return(UIHelper.Get <T>(go.get_transform(), subnode));
 }
Beispiel #5
0
 public static ButtonCustom GetCustomButton(GameObject go, string subnode)
 {
     return(UIHelper.GetCustomButton(go.get_transform(), subnode));
 }
Beispiel #6
0
 public static Image GetImage(GameObject go, string subnode)
 {
     return(UIHelper.GetImage(go.get_transform(), subnode));
 }
Beispiel #7
0
        public override async Task Execute(params object[] args)
        {
            using (one = new OneNote(out var page, out var ns))
            {
                if (!page.ConfirmBodyContext())
                {
                    UIHelper.ShowInfo(one.Window, Resx.FormulaCommand_SelectOne);
                    return;
                }

                // Find first selected cell as anchor point to locate table into which
                // the formula should be inserted; By filtering on selected=all, we avoid
                // including the parent table of a selected nested table.

                var anchor = page.Root.Descendants(ns + "Cell")
                             // first dive down to find the selected T
                             .Elements(ns + "OEChildren").Elements(ns + "OE")
                             .Elements(ns + "T")
                             .Where(e => e.Attribute("selected")?.Value == "all")
                             // now move back up to the Cell
                             .Select(e => e.Parent.Parent.Parent)
                             .FirstOrDefault();

                if (anchor == null)
                {
                    UIHelper.ShowInfo(one.Window, Resx.FormulaCommand_SelectOne);
                    return;
                }

                var table = new Table(anchor.FirstAncestor(ns + "Table"));
                var cells = table.GetSelectedCells(out var range).ToList();

                if (range == TableSelectionRange.Rectangular)
                {
                    UIHelper.ShowInfo(one.Window, Resx.FormulaCommand_Linear);
                    return;
                }

                using (var dialog = new FormulaDialog())
                {
                    // display selected cell names
                    dialog.SetCellNames(
                        string.Join(", ", cells.Select(c => c.Coordinates)));                         // + $" ({rangeType})");

                    var cell = cells.First();

                    // display formula of first cell if any
                    var formula = new Formula(cell);
                    if (formula.Valid)
                    {
                        dialog.Format        = formula.Format;
                        dialog.Formula       = formula.Expression;
                        dialog.DecimalPlaces = formula.DecimalPlaces;
                    }

                    var tagIndex = page.GetTagDefIndex(BoltSymbol);
                    if (!string.IsNullOrEmpty(tagIndex))
                    {
                        if (cell.HasTag(tagIndex))
                        {
                            dialog.Tagged = true;
                        }
                    }

                    if (dialog.ShowDialog(owner) != DialogResult.OK)
                    {
                        return;
                    }

                    if (dialog.Tagged)
                    {
                        tagIndex = page.AddTagDef(BoltSymbol, Resx.AddFormulaCommand_Calculated);
                    }

                    StoreFormula(cells,
                                 dialog.Formula, dialog.Format, dialog.DecimalPlaces,
                                 range, tagIndex);

                    var processor = new Processor(table);
                    processor.Execute(cells);

                    await one.Update(page);
                }
            }
        }
 protected void _RenderLevelEnd(UIHelper ui, StringBuilder str, string cssclass)
 {
 }
Beispiel #9
0
        private void PopulateLabels()
        {
            Title = SiteUtils.FormatPageTitle(siteSettings, Resource.AdminMenuNewsletterAdminLabel);

            heading.Text = Resource.NewsLetterEditLetterHeading;

            lnkAdminMenu.Text        = Resource.AdminMenuLink;
            lnkAdminMenu.ToolTip     = Resource.AdminMenuLink;
            lnkAdminMenu.NavigateUrl = SiteRoot + "/Admin/AdminMenu.aspx";


            lnkLetterAdmin.Text        = Resource.NewsLetterAdministrationHeading;
            lnkLetterAdmin.ToolTip     = Resource.NewsLetterAdministrationHeading;
            lnkLetterAdmin.NavigateUrl = SiteRoot + "/eletter/Admin.aspx";

            lnkDraftList.Text        = Resource.NewsLetterUnsentLettersHeading;
            lnkDraftList.ToolTip     = Resource.NewsLetterUnsentLettersHeading;
            lnkDraftList.NavigateUrl = SiteRoot + "/eletter/LetterDrafts.aspx?l=" + letterInfoGuid.ToString();

            lnkManageTemplates.Text        = Resource.LetterEditManageTemplatesLink;
            lnkManageTemplates.ToolTip     = Resource.LetterEditManageTemplatesToolTip;
            lnkManageTemplates.NavigateUrl = SiteRoot + "/eletter/LetterTemplates.aspx";


            litHtmlTab.Text      = Resource.HtmlTab;
            litPlainTextTab.Text = Resource.PlainTextTab;


            edContent.WebEditor.ToolBar      = ToolBar.Newsletter;
            edContent.WebEditor.FullPageMode = true;
            edContent.WebEditor.EditorCSSUrl = string.Empty;

            edContent.WebEditor.Width  = Unit.Percentage(100);
            edContent.WebEditor.Height = Unit.Pixel(800);

            btnSave.Text    = Resource.NewsLetterSaveLetterButton;
            btnSave.ToolTip = Resource.NewsLetterSaveLetterButton;

            btnDelete.Text    = Resource.NewsLetterDeleteLetterButton;
            btnDelete.ToolTip = Resource.NewsLetterDeleteLetterButton;
            //SiteUtils.SetButtonAccessKey(btnDelete, AccessKeys.NewsLetterEditDeleteButtonAccessKey);
            UIHelper.AddConfirmationDialog(btnDelete, Resource.NewsLetterDeleteLetterButtonWarning);

            btnSendToList.Text    = Resource.NewsLetterSendToSubscribersButton;
            btnSendToList.ToolTip = Resource.NewsLetterSendToSubscribersButton;
            UIHelper.AddConfirmationDialog(btnSendToList, Resource.NewsLetterSendToListButtonWarning);

            btnSendPreview.Text    = Resource.NewsLetterSendPreviewButton;
            btnSendPreview.ToolTip = Resource.NewsLetterSendPreviewButton;

            btnLoadTemplate.Text    = Resource.NewsLetterLoadHtmlTemplateButton;
            btnLoadTemplate.ToolTip = Resource.NewsLetterLoadHtmlTemplateButton;

            btnSaveAsTemplate.Text    = Resource.NewsLetterSaveCurrentAsTemplateButton;
            btnSaveAsTemplate.ToolTip = Resource.NewsLetterSaveCurrentAsTemplateButtonToolTip;

            btnGeneratePlainText.Text    = Resource.NewsletterGeneratePlainTextButton;
            btnGeneratePlainText.ToolTip = Resource.NewsletterGeneratePlainTextButton;

            UIHelper.AddConfirmationDialog(btnGeneratePlainText, Resource.NewsletterGeneratePlainTextButtonWarning);

            reqSubject.ErrorMessage = Resource.SubjectRequiredWarning;

            reqTemplateName.ErrorMessage = Resource.TemplateNameRequired;
        }
Beispiel #10
0
        public ActionResult Window1_Close(JArray Grid1_fields)
        {
            UpdateGrid(Grid1_fields);

            return(UIHelper.Result());
        }
Beispiel #11
0
 /// <summary>
 /// 更新表格数据
 /// </summary>
 /// <param name="Grid1_fields"></param>
 private void UpdateGrid(JArray Grid1_fields)
 {
     UIHelper.Grid("Grid1").DataSource(db.Students.ToList(), Grid1_fields);
 }
Beispiel #12
0
        private void BindingUIInput()
        {
            //键盘事件
            //切换分辨率
            this.ui.InputBindings.Add(new KeyBinding(new RelayCommand(_ => SwitchResolution()), KeyCode.Enter, ModifierKeys.Alt));

            //开关小地图
            this.ui.InputBindings.Add(new KeyBinding(new RelayCommand(_ => this.ui.Minimap.Toggle()), KeyCode.M, ModifierKeys.None)
            {
                IsRepeatEnabled = true
            });
            this.ui.InputBindings.Add(new KeyBinding(new RelayCommand(_ => this.ui.WorldMap.Toggle()), KeyCode.W, ModifierKeys.None)
            {
                IsRepeatEnabled = true
            });

            //选项界面
            this.ui.InputBindings.Add(new KeyBinding(new RelayCommand(_ =>
            {
                var uiWnd = this.ui.Windows.OfType <UIOptions>().FirstOrDefault();
                if (uiWnd == null)
                {
                    uiWnd             = new UIOptions();
                    uiWnd.DataContext = new UIOptionsDataModel();
                    uiWnd.OK         += UIOption_OK;
                    uiWnd.Cancel     += UIOption_Cancel;
                    uiWnd.Visible    += UiWnd_Visible;
                    uiWnd.Visibility  = EmptyKeys.UserInterface.Visibility.Visible;
                    this.ui.Windows.Add(uiWnd);
                    uiWnd.Parent = this.ui;
                }
                else
                {
                    uiWnd.Toggle();
                }
            }), KeyCode.Escape, ModifierKeys.None));

            //截图
            this.ui.InputBindings.Add(new KeyBinding(new RelayCommand(_ => { if (CanCapture())
                                                                             {
                                                                                 prepareCapture = true;
                                                                             }
                                                                      }), KeyCode.Scroll, ModifierKeys.None));

            this.ui.InputBindings.Add(new KeyBinding(new RelayCommand(_ => { renderEnv.Camera.AdjustRectEnabled = !renderEnv.Camera.AdjustRectEnabled; }), KeyCode.U, ModifierKeys.Control));

            //层隐藏
            this.ui.InputBindings.Add(new KeyBinding(new RelayCommand(_ => this.patchVisibility.BackVisible    = !this.patchVisibility.BackVisible), KeyCode.D1, ModifierKeys.Control));
            this.ui.InputBindings.Add(new KeyBinding(new RelayCommand(_ => this.patchVisibility.ReactorVisible = !this.patchVisibility.ReactorVisible), KeyCode.D2, ModifierKeys.Control));
            this.ui.InputBindings.Add(new KeyBinding(new RelayCommand(_ => this.patchVisibility.ObjVisible     = !this.patchVisibility.ObjVisible), KeyCode.D3, ModifierKeys.Control));
            this.ui.InputBindings.Add(new KeyBinding(new RelayCommand(_ => this.patchVisibility.TileVisible    = !this.patchVisibility.TileVisible), KeyCode.D4, ModifierKeys.Control));
            this.ui.InputBindings.Add(new KeyBinding(new RelayCommand(_ => this.patchVisibility.NpcVisible     = !this.patchVisibility.NpcVisible), KeyCode.D5, ModifierKeys.Control));
            this.ui.InputBindings.Add(new KeyBinding(new RelayCommand(_ => this.patchVisibility.MobVisible     = !this.patchVisibility.MobVisible), KeyCode.D6, ModifierKeys.Control));
            this.ui.InputBindings.Add(new KeyBinding(new RelayCommand(_ =>
            {
                var visible = this.patchVisibility.FootHoldVisible;
                this.patchVisibility.FootHoldVisible   = !visible;
                this.patchVisibility.LadderRopeVisible = !visible;
                this.patchVisibility.SkyWhaleVisible   = !visible;
            }), KeyCode.D7, ModifierKeys.Control));
            this.ui.InputBindings.Add(new KeyBinding(new RelayCommand(_ =>
            {
                var portals = this.mapData.Scene.Portals;
                if (!this.patchVisibility.PortalVisible)
                {
                    this.patchVisibility.PortalVisible    = true;
                    this.patchVisibility.PortalInEditMode = false;
                    foreach (var item in portals)
                    {
                        item.View.IsEditorMode = false;
                    }
                }
                else if (!this.patchVisibility.PortalInEditMode)
                {
                    this.patchVisibility.PortalInEditMode = true;
                    foreach (var item in portals)
                    {
                        item.View.IsEditorMode = true;
                    }
                }
                else
                {
                    this.patchVisibility.PortalVisible = false;
                }
            }), KeyCode.D8, ModifierKeys.Control));
            this.ui.InputBindings.Add(new KeyBinding(new RelayCommand(_ => this.patchVisibility.FrontVisible = !this.patchVisibility.FrontVisible), KeyCode.D9, ModifierKeys.Control));

            //移动操作
            #region 移动操作
            {
                //键盘移动
                int boostMoveFlag = 0;
                var direction1    = Vector2.Zero;

                Action <Vector2> calcKeyboardMoveDir = dir =>
                {
                    if (dir.X != 0)
                    {
                        var preMove = dir.X * 10 * (boostMoveFlag != 0 ? 3 : 1);

                        if (Math.Sign(preMove) * Math.Sign(direction1.X) == -1 &&
                            Math.Abs(direction1.X) <= Math.Abs(preMove))
                        {
                            direction1.X = 0;
                        }
                        else
                        {
                            direction1.X += preMove;
                        }
                    }
                    if (dir.Y != 0)
                    {
                        var preMove = dir.Y * 10 * (boostMoveFlag != 0 ? 3 : 1);

                        if (Math.Sign(preMove) * Math.Sign(direction1.Y) == -1 &&
                            Math.Abs(direction1.Y) <= Math.Abs(preMove))
                        {
                            direction1.Y = 0;
                        }
                        else
                        {
                            direction1.Y += preMove;
                        }
                    }
                };

                //键盘动量减速
                Action keyboardMoveSlowDown = () =>
                {
                    if (direction1.X > 2 || direction1.X < -2)
                    {
                        direction1.X *= 0.98f;
                    }
                    else
                    {
                        direction1.X = 0;
                    }
                    if (direction1.Y > 2 || direction1.Y < 2)
                    {
                        direction1.Y *= 0.98f;
                    }
                    else
                    {
                        direction1.Y = 0;
                    }
                };

                EmptyKeys.UserInterface.Input.KeyEventHandler keyEv;

                keyEv = (o, e) =>
                {
                    switch (e.Key)
                    {
                    case KeyCode.Up:
                        calcKeyboardMoveDir(new Vector2(0, -1));
                        break;

                    case KeyCode.Down:
                        calcKeyboardMoveDir(new Vector2(0, 1));
                        break;

                    case KeyCode.Left:
                        calcKeyboardMoveDir(new Vector2(-1, 0));
                        break;

                    case KeyCode.Right:
                        calcKeyboardMoveDir(new Vector2(1, 0));
                        break;

                    case KeyCode.LeftControl:
                        boostMoveFlag |= 0x01;
                        break;

                    case KeyCode.RightControl:
                        boostMoveFlag |= 0x02;
                        break;
                    }
                };
                this.ui.KeyDown += keyEv;
                this.attachedEvent.Add(EventDisposable(keyEv, _ev => this.ui.KeyDown -= _ev));

                keyEv = (o, e) =>
                {
                    switch (e.Key)
                    {
                    case KeyCode.LeftControl:
                        boostMoveFlag &= ~0x01;
                        break;

                    case KeyCode.RightControl:
                        boostMoveFlag &= ~0x02;
                        break;
                    }
                };
                this.ui.PreviewKeyUp += keyEv;
                this.attachedEvent.Add(EventDisposable(keyEv, _ev => this.ui.PreviewKeyUp -= _ev));

                //鼠标移动
                bool isMouseDown = false;
                var  direction2  = Vector2.Zero;

                Action <EmptyKeys.UserInterface.Input.MouseEventArgs> calcMouseMoveDir = e =>
                {
                    var     mousePos = e.GetPosition();
                    Vector2 vec      = new Vector2(2 * mousePos.X / this.ui.Width - 1, 2 * mousePos.Y / this.ui.Height - 1);
                    var     distance = vec.Length();
                    if (distance >= 0.4f)
                    {
                        vec *= (distance - 0.4f) / distance;
                    }
                    else
                    {
                        vec = Vector2.Zero;
                    }
                    direction2 = vec * 20;
                };

                EmptyKeys.UserInterface.Input.MouseEventHandler       mouseEv;
                EmptyKeys.UserInterface.Input.MouseButtonEventHandler mouseBtnEv;

                mouseBtnEv = (o, e) =>
                {
                    if (e.ChangedButton == EmptyKeys.UserInterface.Input.MouseButton.Right)
                    {
                        isMouseDown = true;
                        calcMouseMoveDir(e);
                    }
                };
                this.ui.MouseDown += mouseBtnEv;
                this.attachedEvent.Add(EventDisposable(mouseBtnEv, _ev => this.ui.MouseDown -= _ev));

                mouseEv = (o, e) =>
                {
                    if (isMouseDown)
                    {
                        calcMouseMoveDir(e);
                    }
                };
                this.ui.MouseMove += mouseEv;
                this.attachedEvent.Add(EventDisposable(mouseEv, _ev => this.ui.MouseMove -= _ev));

                mouseBtnEv = (o, e) =>
                {
                    if (e.ChangedButton == EmptyKeys.UserInterface.Input.MouseButton.Right)
                    {
                        isMouseDown = false;
                        direction2  = Vector2.Zero;
                    }
                };
                this.ui.MouseUp += mouseBtnEv;
                this.attachedEvent.Add(EventDisposable(mouseBtnEv, _ev => this.ui.MouseUp -= _ev));

                //更新事件
                EventHandler ev = (o, e) =>
                {
                    this.renderEnv.Camera.Center += direction1 + direction2 * ((boostMoveFlag != 0) ? 3 : 1);
                    keyboardMoveSlowDown();
                };
                this.ui.InputUpdated += ev;
                this.attachedEvent.Add(EventDisposable(ev, _ev => this.ui.InputUpdated -= _ev));
            }
            #endregion

            //点击事件
            var disposable = UIHelper.RegisterClickEvent <SceneItem>(this.ui.ContentControl,
                                                                     (sender, point) =>
            {
                int x           = (int)point.X;
                int y           = (int)point.Y;
                var mouseTarget = this.allItems.Reverse <ItemRect>().FirstOrDefault(item =>
                {
                    return(item.rect.Contains(x, y) && (item.item is PortalItem || item.item is ReactorItem));
                });
                return(mouseTarget.item);
            },
                                                                     this.OnSceneItemClick);
            this.attachedEvent.Add(disposable);

            this.ui.InputBindings.Add(new KeyBinding(new RelayCommand(_ => {
                if (this.ui.Visibility == Visibility.Visible)
                {
                    this.ui.ChatBox.TextBoxChat.Focus();
                }
            }), KeyCode.Enter, ModifierKeys.None));
            this.ui.InputBindings.Add(new KeyBinding(new RelayCommand(_ => this.ui.ChatBox.Toggle()), KeyCode.Oem3, ModifierKeys.None));
            this.ui.WorldMap.MapSpotClick          += WorldMap_MapSpotClick;
            this.ui.ChatBox.TextBoxChat.TextSubmit += ChatBox_TextSubmit;
        }
Beispiel #13
0
        public ActionResult Button1_Click(int activeIndex)
        {
            ShowNotify(String.Format("当前展开的是第 {0} 个面板", activeIndex + 1));

            return(UIHelper.Result());
        }
Beispiel #14
0
 static ImageAdjustColorDialog()
 {
     UIHelper <ImageAdjustColorDialog> .Register();
 }
 void Awake()
 {
     uiHelper = GameObject.Find ("UIHelper").GetComponent<UIHelper> ();
             gameMovement = GetComponent<GameMovement> ();
             gameMovement.enabled = false;
 }
 public void OnSettingsUI(UIHelper helper)
 {
     Options.CreateSettingsUI(helper);
 }
Beispiel #17
0
 public void onChat()
 {
     onSubmit(UIHelper.getByName <UIInput>(toolBar, "input_").value);
     UIHelper.getByName <UIInput>(toolBar, "input_").value = "";
 }
 public UIModOptionsPanelBuilder(UIHelper uiHelper, ConfigurationContainer configuration)
 {
     _uiHelper = uiHelper;
     _configuration = configuration;
     _rootPanel = uiHelper.self as UIScrollablePanel;
 }
Beispiel #19
0
    void ini()
    {
        for (int i = 0; i < 4; i++)
        {
            roomPlayers[i] = null;
        }
        if (gameObject != null)
        {
            ES_quit();
        }
        MonoBehaviour.DestroyImmediate(gameObject);
        if (mode == 2)
        {
            createWindow(Program.I().remaster_tagRoom);
        }
        else
        {
            createWindow(Program.I().remaster_room);
        }
        lazyRoom = gameObject.GetComponent <lazyRoom>();
        fixScreenProblem();
        superScrollView = gameObject.GetComponentInChildren <UIselectableList>();
        superScrollView.selectedAction = onSelected;
        superScrollView.install();
        printFile();
        superScrollView.selectedString = Config.Get("deckInUse", "miaowu");
        superScrollView.toTop();
        if (mode == 0)
        {
            UIHelper.trySetLableText(gameObject, "Rname_", InterString.Get("单局房间"));
        }
        if (mode == 1)
        {
            UIHelper.trySetLableText(gameObject, "Rname_", InterString.Get("比赛房间"));
        }
        if (mode == 2)
        {
            UIHelper.trySetLableText(gameObject, "Rname_", InterString.Get("双打房间"));
        }

        UIHelper.trySetLableText(gameObject, "description_", "");
        for (int i = 0; i < 4; i++)
        {
            realPlayers[i] = UIHelper.getByName <lazyPlayer>(gameObject, i.ToString());
        }

        for (int i = 0; i < 4; i++)
        {
            realPlayers[i].ini();
            realPlayers[i].onKick           = OnKick;
            realPlayers[i].onPrepareChanged = onPrepareChanged;
        }

        UIHelper.shiftButton(startButton(), false);
        UIHelper.registUIEventTriggerForClick(startButton().gameObject, listenerForClicked);
        UIHelper.registUIEventTriggerForClick(exitButton().gameObject, listenerForClicked);
        UIHelper.registUIEventTriggerForClick(duelistButton().gameObject, listenerForClicked);
        UIHelper.registUIEventTriggerForClick(observerButton().gameObject, listenerForClicked);
        UIHelper.registUIEventTriggerForClick(readyButton().gameObject, listenerForClicked);
        realize();
        superScrollView.refreshForOneFrame();
    }
Beispiel #20
0
 public static Image GetImage(Component com, string subnode)
 {
     return(UIHelper.GetImage(com.get_transform(), subnode));
 }
Beispiel #21
0
 private UIButton startButton()
 {
     return(UIHelper.getByName <UIButton>(gameObject, "start_"));
 }
Beispiel #22
0
 public static ButtonCustom GetCustomButton(Component com, string subnode)
 {
     return(UIHelper.GetCustomButton(com.get_transform(), subnode));
 }
Beispiel #23
0
 private UIButton exitButton()
 {
     return(UIHelper.getByName <UIButton>(gameObject, "exit_"));
 }
Beispiel #24
0
 public static T Get <T>(Component com, string subnode) where T : Component
 {
     return(UIHelper.Get <T>(com.get_transform(), subnode));
 }
Beispiel #25
0
 private UIButton duelistButton()
 {
     return(UIHelper.getByName <UIButton>(gameObject, "duelist_"));
 }
Beispiel #26
0
 public static Component GetComponent(Component com, string subnode, string type)
 {
     return(UIHelper.GetComponent(com.get_transform(), subnode, type));
 }
Beispiel #27
0
 private UIButton observerButton()
 {
     return(UIHelper.getByName <UIButton>(gameObject, "observer_"));
 }
Beispiel #28
0
 public static GameObject GetObject(Component com, string subnode)
 {
     return(UIHelper.GetObject(com.get_transform(), subnode));
 }
Beispiel #29
0
 private UIButton readyButton()
 {
     return(UIHelper.getByName <UIButton>(gameObject, "ready_"));
 }
Beispiel #30
0
 public static RectTransform GetRect(Component com, string subnode)
 {
     return(UIHelper.GetRect(com.get_transform(), subnode));
 }
Beispiel #31
0
    void realize()
    {
        string description = "";

        if (mode == 0)
        {
            description += InterString.Get("单局模式");
        }
        if (mode == 1)
        {
            description += InterString.Get("比赛模式");
        }
        if (mode == 2)
        {
            description += InterString.Get("双打模式");
        }
        if (Program.I().ocgcore.MasterRule == 4)
        {
            description += InterString.Get("/新大师规则") + "\r\n";
        }
        else
        {
            description += InterString.Get("/大师规则[?]", Program.I().ocgcore.MasterRule.ToString()) + "\r\n";
        }
        description += InterString.Get("禁限卡表:[?]", YGOSharp.BanlistManager.GetName(lflist)) + "\r\n";
        if (rule == 0)
        {
            description += InterString.Get("(OCG卡池)") + "\r\n";
        }
        if (rule == 1)
        {
            description += InterString.Get("(TCG卡池)") + "\r\n";
        }
        if (rule == 2)
        {
            description += InterString.Get("(混合卡池)") + "\r\n";
        }
        if (no_check_deck)
        {
            description += InterString.Get("*不检查卡组") + "\r\n";
        }
        if (no_shuffle_deck)
        {
            description += InterString.Get("*不洗牌") + "\r\n";
        }
        description += InterString.Get("LP:[?]", start_lp.ToString()) + " ";
        description += InterString.Get("手牌:[?]", start_hand.ToString()) + " \r\n";
        description += InterString.Get("抽卡:[?]", draw_count.ToString()) + " ";
        description += InterString.Get("时间:[?]", time_limit.ToString()) + "\r\n";
        description += InterString.Get("观战者人数:[?]", countOfObserver.ToString());
        UIHelper.trySetLableText(gameObject, "description_", description);
        Program.I().ocgcore.name_0 = "---";
        Program.I().ocgcore.name_1 = "---";
        Program.I().ocgcore.name_0_tag = "---";
        Program.I().ocgcore.name_1_tag = "---";
        for (int i = 0; i < 4; i++)
        {
            realPlayers[i] = UIHelper.getByName <lazyPlayer>(gameObject, i.ToString());
            if (roomPlayers[i] == null)
            {
                realPlayers[i].SetNotNull(false);
            }
            else
            {
                realPlayers[i].SetNotNull(true);
                realPlayers[i].setName(roomPlayers[i].name);
                realPlayers[i].SetIFcanKick(is_host && (i != selftype));
                realPlayers[i].setIfMe(i == selftype);
                realPlayers[i].setIfprepared(roomPlayers[i].prep);
                if (mode != 2)
                {
                    if (i == 0)
                    {
                        Program.I().ocgcore.name_0 = roomPlayers[i].name;
                    }
                    if (i == 1)
                    {
                        Program.I().ocgcore.name_1 = roomPlayers[i].name;
                    }
                    Program.I().ocgcore.name_0_tag = "---";
                    Program.I().ocgcore.name_1_tag = "---";
                }
                else
                {
                    if (i == 0)
                    {
                        Program.I().ocgcore.name_0 = roomPlayers[i].name;
                    }
                    if (i == 1)
                    {
                        Program.I().ocgcore.name_0_tag = roomPlayers[i].name;
                    }
                    if (i == 2)
                    {
                        Program.I().ocgcore.name_1 = roomPlayers[i].name;
                    }
                    if (i == 3)
                    {
                        Program.I().ocgcore.name_1_tag = roomPlayers[i].name;
                    }
                }
            }
        }
    }
Beispiel #32
0
 void Awake()
 {
     instance = this;
 }
        void grdSettings_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            Button button = e.Row.FindControl("btnGridDelete") as Button;

            UIHelper.AddConfirmationDialog(button, Resource.ModuleDefinitionDeleteSettingWarning);
        }
 protected void _RenderItemLink(UIHelper ui, StringBuilder str, Piranha.Models.Sitemap page)
 {
     str.AppendLine(String.Format("<a class=\"element\" href=\"{0}\">{1}</a>", GenerateUrl(page),
                 !String.IsNullOrEmpty(page.NavigationTitle) ? page.NavigationTitle : page.Title));
 }
Beispiel #35
0
        internal static void MakeSettings_General(ExtUITabstrip tabStrip)
        {
            UIHelper panelHelper = tabStrip.AddTabPage(T("Tab:General"));

            UIHelperBase generalGroup = panelHelper.AddGroup(
                T("Tab:General"));

            string[] languageLabels = new string[Translation.AvailableLanguageCodes.Count + 1];
            languageLabels[0] = T("General.Dropdown.Option:Game language");

            for (int i = 0; i < Translation.AvailableLanguageCodes.Count; ++i)
            {
                languageLabels[i + 1] = Translation.Options.Get(
                    Translation.AvailableLanguageCodes[i], "General.Dropdown.Option:Language Name");
            }

            int    languageIndex = 0;
            string curLangCode   = GlobalConfig.Instance.LanguageCode;

            if (curLangCode != null)
            {
                languageIndex = Translation.AvailableLanguageCodes.IndexOf(curLangCode);
                if (languageIndex < 0)
                {
                    languageIndex = 0;
                }
                else
                {
                    ++languageIndex;
                }
            }

            _languageDropdown = generalGroup.AddDropdown(
                T("General.Dropdown:Select language") + ":",
                languageLabels,
                languageIndex,
                OnLanguageChanged) as UIDropDown;
            _lockButtonToggle = generalGroup.AddCheckbox(
                T("General.Checkbox:Lock main menu button position"),
                GlobalConfig.Instance.Main.MainMenuButtonPosLocked,
                OnLockButtonChanged) as UICheckBox;
            _lockMenuToggle = generalGroup.AddCheckbox(
                T("General.Checkbox:Lock main menu window position"),
                GlobalConfig.Instance.Main.MainMenuPosLocked,
                OnLockMenuChanged) as UICheckBox;

            _guiScaleSlider = generalGroup.AddSlider(
                T("General.Slider:GUI scale") + ":",
                65,
                200,
                5,
                GlobalConfig.Instance.Main.GuiScale,
                OnGuiScaleChanged) as UISlider;
            _guiScaleSlider.parent.Find <UILabel>("Label").width = 500;

            _guiTransparencySlider = generalGroup.AddSlider(
                T("General.Slider:Window transparency") + ":",
                0,
                90,
                5,
                GlobalConfig.Instance.Main.GuiTransparency,
                OnGuiTransparencyChanged) as UISlider;
            _guiTransparencySlider.parent.Find <UILabel>("Label").width = 500;

            _overlayTransparencySlider = generalGroup.AddSlider(
                T("General.Slider:Overlay transparency") + ":",
                0,
                90,
                5,
                GlobalConfig.Instance.Main.OverlayTransparency,
                OnOverlayTransparencyChanged) as UISlider;
            _overlayTransparencySlider.parent.Find <UILabel>("Label").width = 500;
            _enableTutorialToggle = generalGroup.AddCheckbox(
                T("General.Checkbox:Enable tutorials"),
                GlobalConfig.Instance.Main.EnableTutorial,
                OnEnableTutorialsChanged) as UICheckBox;
            _showCompatibilityCheckErrorToggle
                = generalGroup.AddCheckbox(
                      T("General.Checkbox:Notify me about TM:PE startup conflicts"),
                      GlobalConfig.Instance.Main.ShowCompatibilityCheckErrorMessage,
                      OnShowCompatibilityCheckErrorChanged) as UICheckBox;
            _scanForKnownIncompatibleModsToggle
                = generalGroup.AddCheckbox(
                      Translation.ModConflicts.Get("Checkbox:Scan for known incompatible mods on startup"),
                      GlobalConfig.Instance.Main.ScanForKnownIncompatibleModsAtStartup,
                      OnScanForKnownIncompatibleModsChanged) as UICheckBox;
            _ignoreDisabledModsToggle = generalGroup.AddCheckbox(
                Translation.ModConflicts.Get("Checkbox:Ignore disabled mods"),
                GlobalConfig.Instance.Main.IgnoreDisabledMods,
                OnIgnoreDisabledModsChanged) as UICheckBox;
            Options.Indent(_ignoreDisabledModsToggle);

            // General: Speed Limits
            SetupSpeedLimitsPanel(generalGroup);

            // General: Simulation
            UIHelperBase simGroup = panelHelper.AddGroup(T("General.Group:Simulation"));

            _instantEffectsToggle = simGroup.AddCheckbox(
                T("General.Checkbox:Apply AI changes right away"),
                Options.instantEffects,
                OnInstantEffectsChanged) as UICheckBox;
        }
Beispiel #36
0
		/// <summary>
		/// Default constructor. Creates a new page.
		/// </summary>
		public BasePage()
			: base() {
			UI = new UIHelper();
			Site = new Web.SiteHelper();
		}
Beispiel #37
0
        public ActionResult btnRegister_Click(FormCollection values)
        {
            Alert.Show("表单验证通过!");

            return(UIHelper.Result());
        }
Beispiel #38
0
 public static Text GetText(Component com, string subnode)
 {
     return(UIHelper.GetText(com.get_transform(), subnode));
 }
 void Awake()
 {
     manager = GameObject.Find("LevelSelectionManager").GetComponent<LevelSelectionManager>();
     SetHalo(false);
     uiHelper = GameObject.Find("UIHelper").GetComponent<UIHelper>();
 }