private void _listBox_SelectedItemChanged(object sender, ListBox.SelectedItemEventArgs e) { var baseItem = e.Item as BaseItem; _itemConsole.Clear(); _itemConsole.Print(1, 1, $"{Coloring.Orange(baseItem.Name)} [{Coloring.DarkGrey(baseItem.GetType().Name)}]"); _itemConsole.Print(1, 2, $"Weigth: {Coloring.Gainsboro(baseItem.Weight.ToString("######0.00").PadLeft(10))} lbs.", Color.Gainsboro); _itemConsole.Print(1, 3, $"Cost: {Coloring.Gold(baseItem.Cost.ToString("######0.00").PadLeft(10))} Gold", Color.Gainsboro); if (baseItem is Weapon weapon) { _itemConsole.Print(1, 5, $"{Coloring.DarkGrey("Damage:")} {Coloring.Green(weapon.MinDmg.ToString())} - {Coloring.Green(weapon.MaxDmg.ToString())}", Color.Gainsboro); _itemConsole.Print(1, 6, $"{Coloring.DarkGrey("Critical:")} {Coloring.Yellow(weapon.CriticalMinRoll)} / {Coloring.Yellow(weapon.CriticalMultiplier)}x ", Color.Gainsboro); _itemConsole.Print(1, 7, $"{Coloring.DarkGrey("Range:")} {weapon.Range}", Color.Gainsboro); _itemConsole.Print(1, 8, $"{Coloring.DarkGrey("Damage:")} {string.Join(",",weapon.WeaponDamageTypes)}", Color.Gainsboro); _itemConsole.Print(1, 9, $"{Coloring.DarkGrey("Effort:")} {weapon.WeaponEffortType}", Color.Gainsboro); } else if (baseItem is Armor armor) { _itemConsole.Print(1, 5, $"{Coloring.DarkGrey("Armor:")} {Coloring.Green(armor.ArmorBonus.ToString())}", Color.Gainsboro); _itemConsole.Print(1, 6, $"{Coloring.DarkGrey("Penaltiy:")} {Coloring.Red(armor.ArmorCheckPenalty.ToString())}", Color.Gainsboro); _itemConsole.Print(1, 7, $"{Coloring.DarkGrey("Max Dex:")} {armor.MaxDexterityBonus}", Color.Gainsboro); _itemConsole.Print(1, 8, $"{Coloring.DarkGrey("Spellf.:")} {armor.ArcaneSpellFailureChance}", Color.Gainsboro); _itemConsole.Print(1, 9, $"{Coloring.DarkGrey("Effort:")} {armor.ArmorEffortType}", Color.Gainsboro); } //_itemConsole.Print(1, 15, $"{baseItem.Description}", Color.Gainsboro); }
private void Listbox_SelectedItemChanged(object sender, ListBox.SelectedItemEventArgs e) { var item = (ConsoleListboxItem)e.Item; _isReadingConsole = true; _labelConsoleTitle.DisplayText = item.ToString().Trim('-'); _labelConsoleWidth.DisplayText = item.Console.Width.ToString(); _labelConsoleHeight.DisplayText = item.Console.Height.ToString(); _labelConsolePosition.DisplayText = $"{item.Console.Position.X},{item.Console.Position.Y}"; _checkIsVisible.IsSelected = item.Console.IsVisible; _isReadingConsole = false; _surfaceView.SetTargetSurface(item.Console); }
private void colorsListBox_SelectedItemChanged(object sender, ListBox.SelectedItemEventArgs e) { if (e.Item != null) { _colorShadeText = new ColoredString(new string((char)303, 8)); Color color = ((ValueTuple <Color, string>)e.Item).Item1; _colorShadeText.SetForeground(color.GetBrightest()); _colorShadeFieldBrightest.Print(_colorShadeText); _colorShadeText.SetForeground(color.GetBright()); _colorShadeFieldBrighter.Print(_colorShadeText); _colorShadeText.SetForeground(color); _colorShadeFieldNormal.Print(_colorShadeText); _colorShadeText.SetForeground(color.GetDark()); _colorShadeFieldDarker.Print(_colorShadeText); _colorShadeText.SetForeground(color.GetDarkest()); _colorShadeFieldDarkest.Print(_colorShadeText); } }
private void OnItemClicked(object?sender, ListBox.SelectedItemEventArgs e) { var item = _inventory.Items[_itemsList.SelectedIndex]; // var inventory = _player.GetGoRogueComponent<Inventory>(); if (_inventory == null) { return; } if (!_inventory.UseItem(item)) { return; } PopulateItemList(); }
private void ListOnSelectedItemChanged(object sender, ListBox.SelectedItemEventArgs e) { if (e.Item == null) return; var subPath = e.Item.ToString(); if (string.Equals(subPath, "..")) { Path = Path.Substring(0, Path.LastIndexOf(@"\")); } else { Path = System.IO.Path.Combine(Path, subPath); } InitList(); okButton.IsEnabled = File.Exists(Path); }
public void On_NodeToggled(object s, ListBox.SelectedItemEventArgs e) { List <BodyPart> visibleAnatomy = new List <BodyPart>(); foreach (BodyPart bodyPart in GameLoop.World.Player.anatomy) { if (bodyPart.IsNodeVisible()) { visibleAnatomy.Add(bodyPart); } } BodyPart selection = visibleAnatomy[_listBox.SelectedIndex]; selection.isNodeExpanded = !selection.isNodeExpanded; RefreshAnatomy(); //TODO: Will probably need to maintain VisibleAnatomy within Player. // Ensure that the list writing method is pulling from there. }
//private void WriteColorProperties() //{ // int y = 10; // int fg = Width - 6; // DefaultForeground = Color.White; // Print( fg, y, "Fg", Color.White ); // Print( PropertyX, y++, "Color", Color.White ); // Print( PropertyX, y, "Accent", Color.White ); // Cells[GetIndexFromPoint( new Point( fg, y++ ) )].Foreground = _current.Accent; // Print( PropertyX, y, "ControlBack", Color.White ); // Cells[GetIndexFromPoint( new Point( fg, y++ ) )].Foreground = _current.ControlBack; // Print( PropertyX, y, "ControlBackLight", Color.White ); // Cells[GetIndexFromPoint( new Point( fg, y++ ) )].Foreground = _current.ControlBackLight; // Print( PropertyX, y, "ControlBackSelected", Color.White ); // Cells[GetIndexFromPoint( new Point( fg, y++ ) )].Foreground = _current.ControlBackSelected; // Print( PropertyX, y, "ControlHostBack", Color.White ); // Cells[GetIndexFromPoint( new Point( fg, y++ ) )].Foreground = _current.ControlHostBack; // Print( PropertyX, y, "ControlHostFore", Color.White ); // Cells[GetIndexFromPoint( new Point( fg, y++ ) )].Foreground = _current.ControlHostFore; // Print( PropertyX, y, "Text", Color.White ); // Cells[GetIndexFromPoint( new Point( fg, y++ ) )].Foreground = _current.Text; // Print( PropertyX, y, "TextBright", Color.White ); // Cells[GetIndexFromPoint( new Point( fg, y++ ) )].Foreground = _current.TextBright; // Print( PropertyX, y, "TextDark", Color.White ); // Cells[GetIndexFromPoint( new Point( fg, y++ ) )].Foreground = _current.TextDark; // Print( PropertyX, y, "TextLight", Color.White ); // Cells[GetIndexFromPoint( new Point( fg, y++ ) )].Foreground = _current.TextLight; // Print( PropertyX, y, "TextSelected", Color.White ); // Cells[GetIndexFromPoint( new Point( fg, y++ ) )].Foreground = _current.TextSelected; // Print( PropertyX, y, "TextSelectedDark", Color.White ); // Cells[GetIndexFromPoint( new Point( fg, y++ ) )].Foreground = _current.TextSelectedDark; // Print( PropertyX, y, "MenuBack", Color.White ); // Cells[GetIndexFromPoint( new Point( fg, y++ ) )].Foreground = _current.MenuBack; // Print( PropertyX, y, "MenuLines", Color.White ); // Cells[GetIndexFromPoint( new Point( fg, y++ ) )].Foreground = _current.MenuLines; // Print( PropertyX, y, "TitleText", Color.White ); // Cells[GetIndexFromPoint( new Point( fg, y++ ) )].Foreground = _current.TitleText; // Print( PropertyX, y, "ModalBackground", Color.White ); // Cells[GetIndexFromPoint( new Point( fg, y++ ) )].Foreground = _current.ModalBackground; //} private void SampleThemesList_SelectedItemChanged(object sender, ListBox.SelectedItemEventArgs e) { throw new NotImplementedException(); }