private void Navigation_FocusedChanged(UIDataViewList dataViewList) { // Clear the buttons displayed at the bottom of the UI. ControlList.Clear(); // Select the first item when the Items list is focused. if (dataViewList == Items) { // Mark the currently highlighted category as Selected. categoriesDataView.Select(); // If the same category is selected, leave the highlighted view alone. if (categoriesDataView.CurrentData.CategoryType != selectedCategory) { // Otherwise highlight the first item. itemsDataView.ResetAll(); itemsDataView.MoveToStart(); itemsDataView.Highlight(); } // Display controls. ControlList.AddControl(new ControlData(InputAction.Equip, "Equip")); ControlList.AddControl(new ControlData(InputAction.Drop, "Drop")); } if (dataViewList == Categories) { categoriesDataView.Highlight(); } }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { ControlList.Clear(); //Keyboard.enableRepeatEvents(true); ControlList.Add(new GuiButton(0, Width / 2 - 100, Height / 4 + 120, "Done")); EntitySign.Func_50006_a(false); }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { ControlList.Clear(); if (Mc.TheWorld.GetWorldInfo().IsHardcoreModeEnabled()) { ControlList.Add(new GuiButton(1, Width / 2 - 100, Height / 4 + 96, StatCollector.TranslateToLocal("deathScreen.deleteWorld"))); } else { ControlList.Add(new GuiButton(1, Width / 2 - 100, Height / 4 + 72, StatCollector.TranslateToLocal("deathScreen.respawn"))); ControlList.Add(new GuiButton(2, Width / 2 - 100, Height / 4 + 96, StatCollector.TranslateToLocal("deathScreen.titleScreen"))); if (Mc.Session == null) { ControlList[1].Enabled = false; } } for (IEnumerator <GuiButton> iterator = ControlList.GetEnumerator(); iterator.MoveNext();) { GuiButton guibutton = iterator.Current; guibutton.Enabled = false; } }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { StringTranslate stringtranslate = StringTranslate.GetInstance(); ControlList.Clear(); ControlList.Add(new GuiButton(0, Width / 2 - 100, Height / 4 + 120 + 12, stringtranslate.TranslateKey("gui.toMenu"))); }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { LoadServerList(); //Keyboard.enableRepeatEvents(true); ControlList.Clear(); ServerSlotContainer = new GuiSlotServer(this); InitGuiControls(); }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { if (!Mc.PlayerController.IsInCreativeMode()) { Mc.DisplayGuiScreen(new GuiInventory(Mc.ThePlayer)); } else { base.InitGui(); ControlList.Clear(); } }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { StringTranslate stringtranslate = StringTranslate.GetInstance(); //Keyboard.EnableRepeatEvents(true); ControlList.Clear(); ControlList.Add(new GuiButton(0, Width / 2 - 100, Height / 4 + 96 + 12, stringtranslate.TranslateKey("selectServer.select"))); ControlList.Add(new GuiButton(1, Width / 2 - 100, Height / 4 + 120 + 12, stringtranslate.TranslateKey("gui.cancel"))); ServerTextField = new GuiTextField(FontRenderer, Width / 2 - 100, 116, 200, 20); ServerTextField.SetMaxStringLength(128); ServerTextField.setFocused(true); ServerTextField.SetText(Field_52009_d); ControlList[0].Enabled = ServerTextField.GetText().Length > 0 && StringHelperClass.StringSplit(ServerTextField.GetText(), ":", true).Length > 0; }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { StringTranslate stringtranslate = StringTranslate.GetInstance(); //Keyboard.EnableRepeatEvents(true); ControlList.Clear(); ControlList.Add(new GuiButton(0, Width / 2 - 100, Height / 4 + 96 + 12, stringtranslate.TranslateKey("addServer.add"))); ControlList.Add(new GuiButton(1, Width / 2 - 100, Height / 4 + 120 + 12, stringtranslate.TranslateKey("gui.cancel"))); ServerName = new GuiTextField(FontRenderer, Width / 2 - 100, 76, 200, 20); ServerName.setFocused(true); ServerName.SetText(ServerNBTStorage.Name); ServerAddress = new GuiTextField(FontRenderer, Width / 2 - 100, 116, 200, 20); ServerAddress.SetMaxStringLength(128); ServerAddress.SetText(ServerNBTStorage.Host); ControlList[0].Enabled = ServerAddress.GetText().Length > 0 && StringHelperClass.StringSplit(ServerAddress.GetText(), ":", true).Length > 0 && ServerName.GetText().Length > 0; }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { StringTranslate stringtranslate = StringTranslate.GetInstance(); //Keyboard.EnableRepeatEvents(true); ControlList.Clear(); ControlList.Add(new GuiButton(0, Width / 2 - 100, Height / 4 + 96 + 12, stringtranslate.TranslateKey("selectWorld.renameButton"))); ControlList.Add(new GuiButton(1, Width / 2 - 100, Height / 4 + 120 + 12, stringtranslate.TranslateKey("gui.cancel"))); ISaveFormat isaveformat = Mc.GetSaveLoader(); WorldInfo worldinfo = isaveformat.GetWorldInfo(WorldName); string s = worldinfo.GetWorldName(); TheGuiTextField = new GuiTextField(FontRenderer, Width / 2 - 100, 60, 200, 20); TheGuiTextField.setFocused(true); TheGuiTextField.SetText(s); }
//增加节点并添加属性值列表 public void SetAttributesValue(string pKey, string key) { XmlNode iNode = xmlDoc.SelectSingleNode("//" + pKey); if (null != iNode) { iNode.AppendChild(xmlDoc.CreateElement(key)); XmlNodeList cNodeList = iNode.SelectNodes("//" + key); foreach (KeyValuePair <string, string> d in ControlList) { XmlAttribute iAttribute = xmlDoc.CreateAttribute(d.Key); iAttribute.Value = d.Value; cNodeList[cNodeList.Count - 1].Attributes.Append(iAttribute); } } ControlList.Clear(); }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { UpdateCounter2 = 0; ControlList.Clear(); sbyte byte0 = -16; ControlList.Add(new GuiButton(1, Width / 2 - 100, Height / 4 + 120 + byte0, StatCollector.TranslateToLocal("menu.returnToMenu"))); if (Mc.IsMultiplayerWorld()) { ((GuiButton)ControlList[0]).DisplayString = StatCollector.TranslateToLocal("menu.disconnect"); } ControlList.Add(new GuiButton(4, Width / 2 - 100, Height / 4 + 24 + byte0, StatCollector.TranslateToLocal("menu.returnToGame"))); ControlList.Add(new GuiButton(0, Width / 2 - 100, Height / 4 + 96 + byte0, StatCollector.TranslateToLocal("menu.options"))); ControlList.Add(new GuiButton(5, Width / 2 - 100, Height / 4 + 48 + byte0, 98, 20, StatCollector.TranslateToLocal("gui.achievements"))); ControlList.Add(new GuiButton(6, Width / 2 + 2, Height / 4 + 48 + byte0, 98, 20, StatCollector.TranslateToLocal("gui.stats"))); }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { ControlList.Clear(); if (Mc.PlayerController.IsInCreativeMode()) { Mc.DisplayGuiScreen(new GuiContainerCreative(Mc.ThePlayer)); } else { base.InitGui(); if (Mc.ThePlayer.GetActivePotionEffects().Count != 0) { GuiLeft = 160 + (Width - XSize - 200) / 2; } } }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { StringTranslate stringtranslate = StringTranslate.GetInstance(); //Keyboard.enableRepeatEvents(true); ControlList.Clear(); ControlList.Add(new GuiButton(0, Width / 2 - 155, Height - 28, 150, 20, stringtranslate.TranslateKey("selectWorld.create"))); ControlList.Add(new GuiButton(1, Width / 2 + 5, Height - 28, 150, 20, stringtranslate.TranslateKey("gui.cancel"))); ControlList.Add(GameModeButton = new GuiButton(2, Width / 2 - 75, 100, 150, 20, stringtranslate.TranslateKey("selectWorld.gameMode"))); ControlList.Add(MoreWorldOptions = new GuiButton(3, Width / 2 - 75, 172, 150, 20, stringtranslate.TranslateKey("selectWorld.moreWorldOptions"))); ControlList.Add(GenerateStructuresButton = new GuiButton(4, Width / 2 - 155, 100, 150, 20, stringtranslate.TranslateKey("selectWorld.mapFeatures"))); GenerateStructuresButton.ShowButton = false; ControlList.Add(WorldTypeButton = new GuiButton(5, Width / 2 + 5, 100, 150, 20, stringtranslate.TranslateKey("selectWorld.mapType"))); WorldTypeButton.ShowButton = false; TextboxWorldName = new GuiTextField(FontRenderer, Width / 2 - 100, 60, 200, 20); TextboxWorldName.setFocused(true); TextboxWorldName.SetText(LocalizedNewWorldText); TextboxSeed = new GuiTextField(FontRenderer, Width / 2 - 100, 60, 200, 20); TextboxSeed.SetText(Seed); MakeUseableName(); Func_35363_g(); }
private void SelectTemplateQuestion() { ControlList.Clear(); if (SelectedTemplateQuestion == null) { return; } ITemplateWrapper control; switch (SelectedTemplateQuestion.Question.QuestionType.Name) { case QuestionType.MultipleChoice: // multiple choice case QuestionType.SingleChoice: // single choice control = new TemplateChoiceViewModel(SelectedTemplateQuestion.Question, _answerSetValueRepository); break; case QuestionType.Text: // text case QuestionType.Number: // numeric case QuestionType.Decimal: // decimal case QuestionType.Date: // date case QuestionType.Time: // time case QuestionType.DateTime: // datetime case QuestionType.Photo: // photo control = new TemplateViewModel(SelectedTemplateQuestion.Question); break; default: control = null; break; } if (control != null) { ControlList.Add(control); } }
///<summary> /// Adds the buttons (and other controls) to the screen in question. ///</summary> public new void InitGui() { ControlList.Clear(); ControlList.Add(new GuiSmallButton(1, Width / 2 + 24, Height / 2 + 74, 80, 20, StatCollector.TranslateToLocal("gui.done"))); }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { ControlList.Clear(); ControlList.Add(new GuiButton(0, Width / 2 - 100, Height / 4 + 120 + 12, "Back to title screen")); }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { ControlList.Clear(); }
public void Clear() { ControlList.Clear(); }