internal UIElement CreateRecipeCataloguePanel() { mainPanel = new UIPanel(); mainPanel.SetPadding(6); // mainPanel.Left.Set(400f, 0f); // mainPanel.Top.Set(400f, 0f); // mainPanel.Width.Set(475f, 0f); // + 30 // mainPanel.MinWidth.Set(415f, 0f); // mainPanel.MaxWidth.Set(784f, 0f); // mainPanel.Height.Set(350, 0f); // mainPanel.MinHeight.Set(243, 0f); // mainPanel.MaxHeight.Set(1000, 0f); mainPanel.BackgroundColor = color; //Append(mainPanel); mainPanel.Top.Set(20, 0f); mainPanel.Height.Set(-20, 1f); mainPanel.Width.Set(0, 1f); queryItem = new UIRecipeCatalogueQueryItemSlot(new Item()); queryItem.Top.Set(2, 0f); queryItem.Left.Set(2, 0f); //queryItem.OnItemChanged += () => { Main.NewText("Item changed?"); TileLookupRadioButton.SetDisabled(queryItem.item.createTile <= -1); }; mainPanel.Append(queryItem); TileLookupRadioButton = new UICheckbox(RBText("Tile"), ""); TileLookupRadioButton.Top.Set(42, 0f); TileLookupRadioButton.Left.Set(0, 0f); TileLookupRadioButton.SetText(" " + RBText("Tile")); TileLookupRadioButton.OnSelectedChanged += (s, e) => { ToggleTileChooser(!mainPanel.HasChild(tileChooserPanel)); updateNeeded = true; }; mainPanel.Append(TileLookupRadioButton); RadioButtonGroup = new UIRadioButtonGroup(); RadioButtonGroup.Left.Pixels = 45; RadioButtonGroup.Width.Set(180, 0f); UIRadioButton AllRecipesRadioButton = new UIRadioButton(RBText("AllRecipes"), ""); NearbyIngredientsRadioBitton = new UIRadioButton(RBText("NearbyChests"), RBText("ClickToRefresh")); ItemChecklistRadioButton = new UIRadioButton(RBText("ItemChecklistOnly"), "???"); RadioButtonGroup.Add(AllRecipesRadioButton); RadioButtonGroup.Add(NearbyIngredientsRadioBitton); RadioButtonGroup.Add(ItemChecklistRadioButton); mainPanel.Append(RadioButtonGroup); AllRecipesRadioButton.Selected = true; NearbyIngredientsRadioBitton.OnSelectedChanged += NearbyIngredientsRadioBitton_OnSelectedChanged; if (RecipeBrowser.itemChecklistInstance != null) { ItemChecklistRadioButton.OnSelectedChanged += ItemChecklistFilter_SelectedChanged; ItemChecklistRadioButton.SetHoverText(RBText("OnlyNewItemsMadeFromSeenItems")); //ItemChecklistRadioButton.OnRightClick += ItemChecklistRadioButton_OnRightClick; } else { ItemChecklistRadioButton.SetDisabled(); ItemChecklistRadioButton.SetHoverText(RBText("InstallItemChecklistToUse", "Common")); } itemNameFilter = new NewUITextBox(RBText("FilterByName", "Common")); itemNameFilter.OnTextChanged += () => { ValidateItemFilter(); updateNeeded = true; }; itemNameFilter.OnTabPressed += () => { itemDescriptionFilter.Focus(); }; itemNameFilter.Top.Pixels = 0f; itemNameFilter.Left.Set(-208, 1f); itemNameFilter.Width.Set(150, 0f); itemNameFilter.Height.Set(25, 0f); mainPanel.Append(itemNameFilter); itemDescriptionFilter = new NewUITextBox(RBText("FilterByTooltip", "Common")); itemDescriptionFilter.OnTextChanged += () => { ValidateItemDescription(); updateNeeded = true; }; itemDescriptionFilter.OnTabPressed += () => { itemNameFilter.Focus(); }; itemDescriptionFilter.Top.Pixels = 30f; itemDescriptionFilter.Left.Set(-208, 1f); itemDescriptionFilter.Width.Set(150, 0f); itemDescriptionFilter.Height.Set(25, 0f); mainPanel.Append(itemDescriptionFilter); recipeGridPanel = new UIPanel(); recipeGridPanel.SetPadding(6); recipeGridPanel.Top.Pixels = 60; recipeGridPanel.Width.Set(-60, 1f); recipeGridPanel.Height.Set(-60 - 121, 1f); recipeGridPanel.BackgroundColor = Color.DarkBlue; mainPanel.Append(recipeGridPanel); recipeGrid = new UIGrid(); recipeGrid.Width.Set(-20f, 1f); recipeGrid.Height.Set(0, 1f); recipeGrid.ListPadding = 2f; recipeGrid.OnScrollWheel += RecipeBrowserUI.OnScrollWheel_FixHotbarScroll; recipeGridPanel.Append(recipeGrid); var lootItemsScrollbar = new FixedUIScrollbar(RecipeBrowserUI.instance.userInterface); lootItemsScrollbar.SetView(100f, 1000f); lootItemsScrollbar.Height.Set(0, 1f); lootItemsScrollbar.Left.Set(-20, 1f); recipeGridPanel.Append(lootItemsScrollbar); recipeGrid.SetScrollbar(lootItemsScrollbar); recipeInfo = new UIRecipeInfo(); recipeInfo.Top.Set(-118, 1f); recipeInfo.Width.Set(-50, 1f); recipeInfo.Height.Set(120, 0f); mainPanel.Append(recipeInfo); UIPanel lootSourcePanel = new UIPanel(); lootSourcePanel.SetPadding(6); lootSourcePanel.Top.Pixels = 0; lootSourcePanel.Width.Set(50, 0f); lootSourcePanel.Left.Set(-50, 1f); lootSourcePanel.Height.Set(-16, 1f); lootSourcePanel.BackgroundColor = Color.CornflowerBlue; mainPanel.Append(lootSourcePanel); lootSourceGrid = new UIGrid(); lootSourceGrid.Width.Set(0, 1f); lootSourceGrid.Height.Set(0, 1f); lootSourceGrid.ListPadding = 2f; lootSourceGrid.OnScrollWheel += RecipeBrowserUI.OnScrollWheel_FixHotbarScroll; lootSourcePanel.Append(lootSourceGrid); var lootSourceScrollbar = new InvisibleFixedUIScrollbar(RecipeBrowserUI.instance.userInterface); lootSourceScrollbar.SetView(100f, 1000f); lootSourceScrollbar.Height.Set(0, 1f); lootSourceScrollbar.Left.Set(-20, 1f); lootSourcePanel.Append(lootSourceScrollbar); lootSourceGrid.SetScrollbar(lootSourceScrollbar); // Tile Chooser tileChooserPanel = new UIPanel(); tileChooserPanel.SetPadding(6); tileChooserPanel.Top.Pixels = 60; tileChooserPanel.Width.Set(50, 0f); tileChooserPanel.Height.Set(-60 - 121, 1f); tileChooserPanel.BackgroundColor = Color.CornflowerBlue; uniqueCheckbox = new UICycleImage(RecipeBrowser.instance.GetTexture("Images/uniqueTile") /* Thanks MiningdiamondsVIII */, 2, new string[] { "Show inherited recipes", "Show unique recipes" }, 36, 20); uniqueCheckbox.Top.Set(0, 0f); uniqueCheckbox.Left.Set(1, 0f); uniqueCheckbox.CurrentState = 1; uniqueCheckbox.OnStateChanged += (s, e) => { updateNeeded = true; }; tileChooserPanel.Append(uniqueCheckbox); tileChooserGrid = new UIGrid(); tileChooserGrid.Width.Set(0, 1f); tileChooserGrid.Height.Set(-24, 1f); tileChooserGrid.Top.Set(24, 0f); tileChooserGrid.ListPadding = 2f; tileChooserGrid.OnScrollWheel += RecipeBrowserUI.OnScrollWheel_FixHotbarScroll; tileChooserPanel.Append(tileChooserGrid); var tileChooserScrollbar = new InvisibleFixedUIScrollbar(RecipeBrowserUI.instance.userInterface); tileChooserScrollbar.SetView(100f, 1000f); tileChooserScrollbar.Height.Set(0, 1f); tileChooserScrollbar.Left.Set(-20, 1f); tileChooserPanel.Append(tileChooserScrollbar); tileChooserGrid.SetScrollbar(tileChooserScrollbar); recipeSlots = new List <UIRecipeSlot>(); tileSlots = new List <UITileSlot>(); updateNeeded = true; return(mainPanel); }
internal UIElement CreateRecipeCataloguePanel() { UIPanel mainPanel = new UIPanel(); mainPanel.SetPadding(6); // mainPanel.Left.Set(400f, 0f); // mainPanel.Top.Set(400f, 0f); // mainPanel.Width.Set(475f, 0f); // + 30 // mainPanel.MinWidth.Set(415f, 0f); // mainPanel.MaxWidth.Set(784f, 0f); // mainPanel.Height.Set(350, 0f); // mainPanel.MinHeight.Set(243, 0f); // mainPanel.MaxHeight.Set(1000, 0f); mainPanel.BackgroundColor = color; //Append(mainPanel); mainPanel.Top.Set(20, 0f); mainPanel.Height.Set(-20, 1f); mainPanel.Width.Set(0, 1f); queryItem = new UIRecipeCatalogueQueryItemSlot(new Item()); queryItem.Top.Set(2, 0f); queryItem.Left.Set(2, 0f); queryItem.OnItemChanged += () => { TileLookupRadioButton.SetDisabled(queryItem.item.createTile <= -1); }; mainPanel.Append(queryItem); TileLookupRadioButton = new UICheckbox("Tile", ""); TileLookupRadioButton.Top.Set(42, 0f); TileLookupRadioButton.Left.Set(0, 0f); TileLookupRadioButton.SetText(" Tile"); TileLookupRadioButton.OnSelectedChanged += (s, e) => { updateNeeded = true; }; TileLookupRadioButton.SetDisabled(true); mainPanel.Append(TileLookupRadioButton); RadioButtonGroup = new UIRadioButtonGroup(); RadioButtonGroup.Left.Pixels = 45; RadioButtonGroup.Width.Set(180, 0f); UIRadioButton AllRecipesRadioButton = new UIRadioButton("All Recipes", ""); NearbyIngredientsRadioBitton = new UIRadioButton("Nearby Chests", "Click to Refresh"); ItemChecklistRadioButton = new UIRadioButton("Item Checklist Only", "???"); RadioButtonGroup.Add(AllRecipesRadioButton); RadioButtonGroup.Add(NearbyIngredientsRadioBitton); RadioButtonGroup.Add(ItemChecklistRadioButton); mainPanel.Append(RadioButtonGroup); AllRecipesRadioButton.Selected = true; NearbyIngredientsRadioBitton.OnSelectedChanged += NearbyIngredientsRadioBitton_OnSelectedChanged; if (RecipeBrowser.itemChecklistInstance != null) { ItemChecklistRadioButton.OnSelectedChanged += ItemChecklistFilter_SelectedChanged; ItemChecklistRadioButton.SetHoverText("Only new Items made from Seen Items"); //ItemChecklistRadioButton.OnRightClick += ItemChecklistRadioButton_OnRightClick; } else { ItemChecklistRadioButton.SetDisabled(); ItemChecklistRadioButton.SetHoverText("Install Item Checklist to use"); } itemNameFilter = new NewUITextBox("Filter by Name"); itemNameFilter.OnTextChanged += () => { ValidateItemFilter(); updateNeeded = true; }; itemNameFilter.OnTabPressed += () => { itemDescriptionFilter.Focus(); }; itemNameFilter.Top.Pixels = 0f; itemNameFilter.Left.Set(-208, 1f); itemNameFilter.Width.Set(150, 0f); itemNameFilter.Height.Set(25, 0f); mainPanel.Append(itemNameFilter); itemDescriptionFilter = new NewUITextBox("Filter by tooltip"); itemDescriptionFilter.OnTextChanged += () => { ValidateItemDescription(); updateNeeded = true; }; itemDescriptionFilter.OnTabPressed += () => { itemNameFilter.Focus(); }; itemDescriptionFilter.Top.Pixels = 30f; itemDescriptionFilter.Left.Set(-208, 1f); itemDescriptionFilter.Width.Set(150, 0f); itemDescriptionFilter.Height.Set(25, 0f); mainPanel.Append(itemDescriptionFilter); recipeGridPanel = new UIPanel(); recipeGridPanel.SetPadding(6); recipeGridPanel.Top.Pixels = 60; recipeGridPanel.Width.Set(-60, 1f); recipeGridPanel.Height.Set(-60 - 121, 1f); recipeGridPanel.BackgroundColor = Color.DarkBlue; mainPanel.Append(recipeGridPanel); recipeGrid = new UIGrid(); recipeGrid.Width.Set(-20f, 1f); recipeGrid.Height.Set(0, 1f); recipeGrid.ListPadding = 2f; recipeGridPanel.Append(recipeGrid); var lootItemsScrollbar = new FixedUIScrollbar(RecipeBrowserUI.instance.userInterface); lootItemsScrollbar.SetView(100f, 1000f); lootItemsScrollbar.Height.Set(0, 1f); lootItemsScrollbar.Left.Set(-20, 1f); recipeGridPanel.Append(lootItemsScrollbar); recipeGrid.SetScrollbar(lootItemsScrollbar); recipeInfo = new UIRecipeInfo(); recipeInfo.Top.Set(-118, 1f); recipeInfo.Width.Set(-50, 1f); recipeInfo.Height.Set(120, 0f); mainPanel.Append(recipeInfo); UIPanel lootSourcePanel = new UIPanel(); lootSourcePanel.SetPadding(6); lootSourcePanel.Top.Pixels = 0; lootSourcePanel.Width.Set(50, 0f); lootSourcePanel.Left.Set(-50, 1f); lootSourcePanel.Height.Set(-16, 1f); lootSourcePanel.BackgroundColor = Color.CornflowerBlue; mainPanel.Append(lootSourcePanel); lootSourceGrid = new UIGrid(); lootSourceGrid.Width.Set(0, 1f); lootSourceGrid.Height.Set(0, 1f); lootSourceGrid.ListPadding = 2f; lootSourcePanel.Append(lootSourceGrid); var lootSourceScrollbar = new InvisibleFixedUIScrollbar(RecipeBrowserUI.instance.userInterface); lootSourceScrollbar.SetView(100f, 1000f); lootSourceScrollbar.Height.Set(0, 1f); lootSourceScrollbar.Left.Set(-20, 1f); lootSourcePanel.Append(lootSourceScrollbar); lootSourceGrid.SetScrollbar(lootSourceScrollbar); recipeSlots = new List <UIRecipeSlot>(); updateNeeded = true; return(mainPanel); }
internal UIElement CreateCraftPanel() { mainPanel = new UIPanel(); mainPanel.SetPadding(6); mainPanel.BackgroundColor = color; mainPanel.Top.Set(20, 0f); mainPanel.Height.Set(-20, 1f); mainPanel.Width.Set(0, 1f); recipeResultItemSlot = new UICraftQueryItemSlot(new Item()); recipeResultItemSlot.emptyHintText = RBText("EmptyQuerySlotHint"); // Not used, UICraftQueryItemSlot calls SetItem on click. // SetItem -> ReplaceWithFake -> OnItemChanged -> SetItem loop issue. //recipeResultItemSlot.OnItemChanged += RecipeResultItemSlot_OnItemChanged; mainPanel.Append(recipeResultItemSlot); UICheckbox extendedCraft = new UICheckbox(RBText("Calc"), RBText("CalcTooltip")); extendedCraft.Top.Set(42, 0f); extendedCraft.Left.Set(0, 0f); extendedCraft.SetText(" " + RBText("Calc")); extendedCraft.Selected = RecipePath.extendedCraft; extendedCraft.OnSelectedChanged += (s, e) => { RecipeCatalogueUI.instance.InvalidateExtendedCraft(); RecipePath.extendedCraft = extendedCraft.Selected; }; mainPanel.Append(extendedCraft); int top = 2; int left = 50; // Problem: Most bosses don't have banner.... UICheckbox lootables = new UICheckbox(RBText("Loot"), RBText("LootTooltip")); lootables.Top.Set(top, 0f); lootables.Left.Set(left, 0f); lootables.Selected = RecipePath.allowLoots; lootables.OnSelectedChanged += (s, e) => { RecipeCatalogueUI.instance.InvalidateExtendedCraft(); RecipePath.allowLoots = lootables.Selected; }; mainPanel.Append(lootables); left += (int)lootables.MinWidth.Pixels + 6; UICheckbox npcShopsCheckbox = new UICheckbox(RBText("Shop"), RBText("ShopTooltip")); npcShopsCheckbox.SetDisabled(); // TODO: implement correctly npcShopsCheckbox.Top.Set(top, 0f); npcShopsCheckbox.Left.Set(left, 0f); npcShopsCheckbox.Selected = RecipePath.allowPurchasable; npcShopsCheckbox.OnSelectedChanged += (s, e) => { RecipeCatalogueUI.instance.InvalidateExtendedCraft(); RecipePath.allowPurchasable = npcShopsCheckbox.Selected; }; mainPanel.Append(npcShopsCheckbox); left += (int)npcShopsCheckbox.MinWidth.Pixels + 6; // Adjacent, Seen, Unseen. This allows Unseen. UICheckbox missingStationsCheckbox = new UICheckbox(RBText("MissingStations"), RBText("MissingStationsTooltip")); missingStationsCheckbox.Top.Set(top, 0f); missingStationsCheckbox.Left.Set(left, 0f); missingStationsCheckbox.Selected = RecipePath.allowMissingStations; missingStationsCheckbox.OnSelectedChanged += (s, e) => { RecipeCatalogueUI.instance.InvalidateExtendedCraft(); RecipePath.allowMissingStations = missingStationsCheckbox.Selected; }; mainPanel.Append(missingStationsCheckbox); left += (int)missingStationsCheckbox.MinWidth.Pixels + 6; // Checkbox for RecipeAvailable? // TODO: Handle other invalidations. Button here for forced refresh? top += 25; left = 50; // Option to skip some items? Hotbar? Starred? UICheckbox sourceInventoryCheckbox = new UICheckbox(RBText("Inventory"), ""); sourceInventoryCheckbox.SetDisabled(); sourceInventoryCheckbox.Top.Set(top, 0f); sourceInventoryCheckbox.Left.Set(left, 0f); sourceInventoryCheckbox.Selected = RecipePath.sourceInventory; sourceInventoryCheckbox.OnSelectedChanged += (s, e) => { RecipeCatalogueUI.instance.InvalidateExtendedCraft(); RecipePath.sourceInventory = sourceInventoryCheckbox.Selected; }; mainPanel.Append(sourceInventoryCheckbox); left += (int)sourceInventoryCheckbox.MinWidth.Pixels + 6; UICheckbox sourceBanksCheckbox = new UICheckbox(RBText("Banks"), RBText("BanksTooltip")); sourceBanksCheckbox.SetDisabled(); sourceBanksCheckbox.Top.Set(top, 0f); sourceBanksCheckbox.Left.Set(left, 0f); sourceBanksCheckbox.Selected = RecipePath.sourceBanks; sourceBanksCheckbox.OnSelectedChanged += (s, e) => { RecipeCatalogueUI.instance.InvalidateExtendedCraft(); RecipePath.sourceBanks = sourceBanksCheckbox.Selected; }; mainPanel.Append(sourceBanksCheckbox); left += (int)sourceBanksCheckbox.MinWidth.Pixels + 6; UICheckbox sourceChestsCheckbox = new UICheckbox(RBText("Chests"), RBText("ChestsTooltip")); sourceChestsCheckbox.SetDisabled(); sourceChestsCheckbox.Top.Set(top, 0f); sourceChestsCheckbox.Left.Set(left, 0f); sourceChestsCheckbox.Selected = RecipePath.sourceChests; sourceChestsCheckbox.OnSelectedChanged += (s, e) => { RecipeCatalogueUI.instance.InvalidateExtendedCraft(); RecipePath.sourceChests = sourceChestsCheckbox.Selected; }; mainPanel.Append(sourceChestsCheckbox); left += (int)sourceChestsCheckbox.MinWidth.Pixels + 6; UICheckbox sourceMagicStorageCheckbox = new UICheckbox(RBText("MagicStorage"), RBText("MagicStorageTooltip")); sourceMagicStorageCheckbox.SetDisabled(); sourceMagicStorageCheckbox.Top.Set(top, 0f); sourceMagicStorageCheckbox.Left.Set(left, 0f); sourceMagicStorageCheckbox.Selected = RecipePath.sourceMagicStorage; sourceMagicStorageCheckbox.OnSelectedChanged += (s, e) => { RecipeCatalogueUI.instance.InvalidateExtendedCraft(); RecipePath.sourceMagicStorage = sourceMagicStorageCheckbox.Selected; }; mainPanel.Append(sourceMagicStorageCheckbox); left += (int)sourceMagicStorageCheckbox.MinWidth.Pixels + 6; top += 37; craftPanel = new UIPanel(); craftPanel.SetPadding(6); craftPanel.Top.Pixels = top; craftPanel.Left.Set(0, 0f); craftPanel.Width.Set(0, 1f); craftPanel.Height.Set(-top - 16, 1f); craftPanel.BackgroundColor = Color.DarkCyan; craftPathList = new UIList(); craftPathList.Width.Set(-24f, 1f); craftPathList.Height.Set(0, 1f); craftPathList.ListPadding = 6f; craftPathList.OnScrollWheel += RecipeBrowserUI.OnScrollWheel_FixHotbarScroll; craftPanel.Append(craftPathList); var craftPathListScrollbar = new FixedUIScrollbar(RecipeBrowserUI.instance.userInterface); craftPathListScrollbar.SetView(100f, 1000f); craftPathListScrollbar.Height.Set(0, 1f); craftPathListScrollbar.Left.Set(-20, 1f); craftPanel.Append(craftPathListScrollbar); craftPathList.SetScrollbar(craftPathListScrollbar); mainPanel.Append(craftPanel); UIText text = new UIText(RBText("BottomInstructions"), 0.85f); text.Top.Set(-14, 1f); text.HAlign = 0.5f; mainPanel.Append(text); additionalDragTargets.Add(text); return(mainPanel); }
//////////////// public override void OnInitialize() { var mymod = (HonorBoundMod)HonorBoundMod.Instance; var myworld = ModContent.GetInstance<HonorBoundWorld>(); if( HonorBoundUI.BackgroundLogo == null ) { HonorBoundUI.BackgroundLogo = mymod.GetTexture( "BackgroundLogo" ); } float top = 0; this.MainPanel = new UIPanel(); this.MainPanel.Left.Set( -(HonorBoundUI.PanelWidth / 2f), 0.5f ); this.MainPanel.Top.Set( 8f - HonorBoundUI.PanelHeight, 0f ); this.MainPanel.Width.Set( HonorBoundUI.PanelWidth, 0f ); this.MainPanel.Height.Set( HonorBoundUI.PanelHeight, 0f ); this.MainPanel.SetPadding( 12f ); this.MainPanel.BackgroundColor = new Color( 0, 0, 64 ); var bg = new UIImage( HonorBoundUI.BackgroundLogo ); bg.Top.Set( 0f, 0.05f ); bg.Left.Set( 0f, 0.4f ); this.MainPanel.Append( bg ); this.MainPanel.Append( new UIText( "Choose your honorifics:", 0.9f ) ); foreach( var kv in HonorBoundLogic.Honorifics ) { top += 20f; string honorific = kv.Key; var uiOption = new UICheckbox( UITheme.Vanilla, honorific, String.Join("\n", kv.Value.Descriptions) ); uiOption.Top.Set( top, 0f ); uiOption.SetText( " "+honorific, 0.8f, false ); uiOption.TextColor = Color.Gray; uiOption.OnSelectedChanged += delegate () { mymod = (HonorBoundMod)ModLoader.GetMod( "HonorBound" ); myworld = ModContent.GetInstance<HonorBoundWorld>(); if( uiOption.Selected ) { myworld.Logic.CurrentActiveHonorifics.Add( honorific ); } else { myworld.Logic.CurrentActiveHonorifics.Remove( honorific ); } }; this.Options[ honorific ] = uiOption; this.MainPanel.Append( uiOption ); } top += 20f; var honorWarnText = new UIText( "Warning: Settings are permanent for your\nworld when honor bound.\nSelect 'No Honor' to play only vanilla.", 0.7f ); honorWarnText.Top.Set( top, 0f ); honorWarnText.Left.Set( 0, 0f ); honorWarnText.TextColor = Color.Yellow; this.MainPanel.Append( honorWarnText ); top += 56f; var forHonorButton = new UITextPanel<string>( "For Honor!" ); forHonorButton.SetPadding( 4f ); forHonorButton.Width.Set( HonorBoundUI.PanelWidth - 24f, 0f ); forHonorButton.Left.Set( 0f, 0 ); forHonorButton.Top.Set( top, 0f ); forHonorButton.OnClick += delegate ( UIMouseEvent evt, UIElement listeningElement ) { this.ActivateForHonor(); }; forHonorButton.OnMouseOver += delegate ( UIMouseEvent evt, UIElement listeningElement ) { forHonorButton.BackgroundColor = HonorBoundUI.ButtonBodyLitColor; }; forHonorButton.OnMouseOut += delegate ( UIMouseEvent evt, UIElement listeningElement ) { forHonorButton.BackgroundColor = HonorBoundUI.ButtonBodyColor; }; this.MainPanel.Append( forHonorButton ); top += 32f; var noHonorButton = new UITextPanel<string>( "No Honor..." ); noHonorButton.SetPadding( 4f ); noHonorButton.Width.Set( HonorBoundUI.PanelWidth - 24f, 0f ); noHonorButton.Left.Set( 0f, 0 ); noHonorButton.Top.Set( top, 0f ); noHonorButton.OnClick += delegate( UIMouseEvent evt, UIElement listeningElement ) { this.ActivateNoHonor(); }; noHonorButton.OnMouseOver += delegate ( UIMouseEvent evt, UIElement listeningElement ) { noHonorButton.BackgroundColor = HonorBoundUI.ButtonBodyLitColor; }; noHonorButton.OnMouseOut += delegate ( UIMouseEvent evt, UIElement listeningElement ) { noHonorButton.BackgroundColor = HonorBoundUI.ButtonBodyColor; }; this.MainPanel.Append( noHonorButton ); this.Append( this.MainPanel ); }