public string LastGumpInfo() { lock (gumpLock) { if (CurrentGump == null) { return("no gump"); } var processor = new GumpParserDescriptionProcessor(); var parser = new GumpParser(processor); parser.Parse(CurrentGump); var builder = new StringBuilder(); builder.AppendLine($"Id {CurrentGump.Id}, GumpId {CurrentGump.GumpTypeId}"); builder.AppendLine(CurrentGump.Commands); builder.AppendLine("-----------------"); builder.AppendLine(processor.GetDescription()); return(builder.ToString()); } }
public void Can_parse_trigger_button() { var gump = new Gump(new GumpTypeId(0), new GumpInstanceId(1), "{Button 13 158 4005 4007 1 0 2}", new string[] { }); parser.Parse(gump); string description = processor.GetDescription(); description.Should().Be($"Button: x = 13, y = 158, isTrigger, pageId = 0, triggerId = 2{Environment.NewLine}"); }