private void LoadItems() { ReadStream nameStream = ROM.From("ItemNames"); for (int i = 0; i < 256; i++) { string name; if (i > 0x0 && i <= 0x61) { name = Charmap.Decode(nameStream.Until(Charmap.Terminator)); } else if (i >= 0xc4 && i <= 0xc8) { name = String.Format("HM{0}", (i + 1 - 0xc4).ToString("D2")); } else if (i >= 0xc9 && i <= 0xff) { name = String.Format("TM{0}", (i + 1 - 0xc9).ToString("D2")); } else { name = String.Format("hex{0:X2}", i); } Items.Add(new RbyItem(this, (byte)i, name)); } }
public GscData() { // See https://github.com/pret/pokegold/blob/master/charmap.asm Charmap = new Charmap("A B C D E F G H I J K L M N O P " + "Q R S T U V W X Y Z ( ) : ; [ ] " + "a b c d e f g h i j k l m n o p " + "q r s t u v w x y z _ _ _ _ _ _ " + "Ä Ö Ü ä ö ü _ _ _ _ _ _ _ _ _ _ " + "'d 'l 'm 'r 's 't 'v _ _ _ _ _ _ _ _ _ " + "' PM MN - _ _ ? ! . & é _ _ _ _ _M " + "$ * . / , _F 0 1 2 3 4 5 6 7 8 9"); Charmap.Map[0x54] = "POKE"; Species.NameCallback = obj => obj.Name; Species.IndexCallback = obj => obj.Id; Moves.NameCallback = obj => obj.Name; Moves.IndexCallback = obj => obj.Id; Items.NameCallback = obj => obj.Name; Items.IndexCallback = obj => obj.Id; Tilesets.IndexCallback = obj => obj.Id; Maps.NameCallback = obj => obj.Name; Maps.IndexCallback = obj => obj.Group << 8 | obj.Id; }
public RbyData() { // See https://github.com/pret/pokered/blob/master/charmap.asm Charmap = new Charmap("A B C D E F G H I J K L M N O P " + "Q R S T U V W X Y Z ( ) : ; [ ] " + "a b c d e f g h i j k l m n o p " + "q r s t u v w x y z E 'd 'l 's 't 'v " + "_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ " + "_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ " + "' PK MN - 'r 'm ? ! . _ _ _ _ _ _ M " + "$ * . / , F 0 1 2 3 4 5 6 7 8 9 "); Charmap.Map[0x4A] = "PkMn"; Charmap.Map[0x54] = "POKE"; Charmap.Map[0x52] = "<PLAYER>"; Charmap.Map[0x53] = "<RIVAL"; Moves.NameCallback = obj => obj.Name; Moves.IndexCallback = obj => obj.Id; Species.NameCallback = obj => obj.Name; Species.IndexCallback = obj => obj.Id; Items.NameCallback = obj => obj.Name; Items.IndexCallback = obj => obj.Id; TrainerClasses.NameCallback = obj => obj.Name; TrainerClasses.IndexCallback = obj => obj.Id; Tilesets.IndexCallback = obj => obj.Id; Maps.NameCallback = obj => obj.Name; Maps.IndexCallback = obj => obj.Id; }
private void DrawCornerBorders() { Charmap[0, 0] = BorderDesign.GetBorderChar(Style, BorderPosition.LeftUpper); Charmap[0, Charmap.GetLength(1) - 1] = BorderDesign.GetBorderChar(Style, BorderPosition.RightUpper); Charmap[Charmap.GetLength(0) - 1, 0] = BorderDesign.GetBorderChar(Style, BorderPosition.LeftLower); Charmap[Charmap.GetLength(0) - 1, Charmap.GetLength(1) - 1] = BorderDesign.GetBorderChar(Style, BorderPosition.RightLower); }
/// <summary> /// Setting higher window border /// </summary> private void GenerateTopBorder() { // Setting left upper window corner char charmap[0, 0] = BorderDesign.GetBorderChar(BorderStyle.Rounded, BorderPosition.LeftUpper); // Setting right upper window corner char charmap[0, Width - 1] = BorderDesign.GetBorderChar(BorderStyle.Rounded, BorderPosition.RightUpper); // Filling higher border between left and right upper corners for (int i = 1; i < Charmap.GetLength(1) - 1; i++) { charmap[0, i] = BorderDesign.GetBorderChar(BorderStyle.Rounded, BorderPosition.Horizontal); } }
private void DrawBorders() { for (int i = 1; i < Charmap.GetLength(0) - 1; i++) { Charmap[i, 0] = BorderDesign.GetBorderChar(Style, BorderPosition.Vertical); Charmap[i, Charmap.GetLength(1) - 1] = BorderDesign.GetBorderChar(Style, BorderPosition.Vertical); } for (int i = 1; i < Charmap.GetLength(1) - 1; i++) { Charmap[0, i] = BorderDesign.GetBorderChar(Style, BorderPosition.Horizontal); Charmap[Charmap.GetLength(0) - 1, i] = BorderDesign.GetBorderChar(Style, BorderPosition.Horizontal); } }
/// <summary> /// Redisplay all children controls and builds new char matrix if required /// </summary> public virtual void Redraw(bool sizeChanged) { if (sizeChanged) { ResizeBitmap(); } // Sorts controls by zIndex Controls.Sort((control1, control2) => control1.Position.Z.CompareTo(control2.Position.Z)); foreach (var control in Controls) { Charmap.AddInnerBitmap(control.Charmap, control.Position.X, control.Position.Y); } DrawBorders(); }
private void DrawInnerBitmap() { Charmap.AddInnerBitmap(innerElement.Charmap, 1, 1); }