/// <summary></summary> public virtual void ListLastMod() { if (FullDetail && !ExcludeROFields) { Buf.Clear(); Buf.Append(Record.LastMod.ToString("MM/dd/yyyy HH:mm:ss")); var listNum = NumberFields ? ListNum++ : 0; gOut.Write("{0}{1}{2}", Environment.NewLine, gEngine.BuildPrompt(27, '.', listNum, GetPrintedName("LastMod"), null), Buf); } }
/// <summary></summary> public virtual void ListDesc() { Buf.Clear(); if (ResolveEffects) { var rc = gEngine.ResolveUidMacros(Record.Desc, Buf, true, true); Debug.Assert(gEngine.IsSuccess(rc)); } else { Buf.Append(Record.Desc); } var listNum = NumberFields ? ListNum++ : 0; gOut.WriteLine("{0}{1}{0}{0}{2}", Environment.NewLine, gEngine.BuildPrompt(27, '.', listNum, GetPrintedName("Desc"), null), Buf); }
/// <summary></summary> public virtual void ListIntroStory() { if (FullDetail) { var listNum = NumberFields ? ListNum++ : 0; if (LookupMsg && Record.IntroStory > 0) { Buf.Clear(); var effect = gEDB[Record.IntroStory]; if (effect != null) { Buf.Append(effect.Desc); if (Buf.Length > 40) { Buf.Length = 40; } if (Buf.Length == 40) { Buf[39] = '.'; Buf[38] = '.'; Buf[37] = '.'; } } gOut.Write("{0}{1}{2}", Environment.NewLine, gEngine.BuildPrompt(27, '.', listNum, GetPrintedName("IntroStory"), null), gEngine.BuildValue(51, ' ', 8, Record.IntroStory, null, effect != null ? Buf.ToString() : gEngine.UnknownName)); } else { gOut.Write("{0}{1}{2}", Environment.NewLine, gEngine.BuildPrompt(27, '.', listNum, GetPrintedName("IntroStory"), null), Record.IntroStory); } } }
/// <summary></summary> protected virtual void ListAnswersElement() { var i = Index; if (FullDetail && i < Record.NumAnswers) { Buf.Clear(); if (ResolveEffects) { var rc = gEngine.ResolveUidMacros(Record.GetAnswers(i), Buf, true, true); Debug.Assert(gEngine.IsSuccess(rc)); } else { Buf.Append(Record.GetAnswers(i)); } var listNum = NumberFields ? ListNum++ : 0; gOut.WriteLine("{0}{1}{0}{0}{2}", Environment.NewLine, gEngine.BuildPrompt(27, '.', listNum, GetPrintedName("AnswersElement"), null), Buf); } }
public override void Execute() { RetCode rc; var showHeader = true; var nlFlag = false; gOut.WriteLine(); gEngine.PrintTitle("BRIEF MAP ROOM RECORD CONNECTIONS", true); if (gEngine.IsAdventureFilesetLoaded()) { gOut.Print("A map of: {0}", Globals.Module != null ? Globals.Module.Name : gEngine.UnknownName); gOut.Print("{0}", Globals.LineSep); } var numDirs = Globals.Module != null ? Globals.Module.NumDirs : 6; var directionValues = EnumUtil.GetValues <Direction>(); var k = Globals.Database.GetRoomsCount(); var i = 0; foreach (var room in Globals.Database.RoomTable.Records) { if (showHeader) { if (numDirs == 10) { Buf.SetFormat("{0}{1,-28}", Environment.NewLine, "Room name:"); for (var j = 0; j < numDirs; j++) { var direction = gEngine.GetDirections(directionValues[j]); Debug.Assert(direction != null); Buf.AppendFormat("{0}:{1}", direction.Abbr, direction.Abbr.Length == 2 ? " " : " "); } } else { Buf.SetFormat("{0}{1,-48}", Environment.NewLine, "Room name:"); for (var j = 0; j < numDirs; j++) { var direction = gEngine.GetDirections(directionValues[j]); Debug.Assert(direction != null); Buf.AppendFormat("{0}: ", direction.Abbr); } } gOut.Write("{0}", Buf); gOut.Write("{0}{1}", Environment.NewLine, Globals.LineSep); showHeader = false; } Buf.SetFormat("{0}{1,3}. {2}", Environment.NewLine, room.Uid, room.Name); if (numDirs == 10) { while (Buf.Length < 29) { Buf.Append('.'); } Buf.Length = 29; } else { while (Buf.Length < 49) { Buf.Append('.'); } Buf.Length = 49; } if (Environment.NewLine.Length == 1) { Buf.Length--; } Buf.Append('.'); for (var j = 0; j < numDirs; j++) { Buf.AppendFormat("{0,-4} ", room.GetDirs(directionValues[j])); } gOut.Write("{0}", Buf); nlFlag = true; if ((i != 0 && (i % (Constants.NumRows - 10)) == 0) || i == k - 1) { nlFlag = false; gOut.WriteLine(); gOut.Print("{0}", Globals.LineSep); gOut.Write("{0}Press any key to continue or X to exit: ", Environment.NewLine); Buf.Clear(); rc = Globals.In.ReadField(Buf, Constants.BufSize02, null, ' ', '\0', true, null, gEngine.ModifyCharToNullOrX, null, gEngine.IsCharAny); Debug.Assert(gEngine.IsSuccess(rc)); gOut.Print("{0}", Globals.LineSep); if (Buf.Length > 0 && Buf[0] == 'X') { break; } showHeader = true; } i++; } if (nlFlag) { gOut.WriteLine(); } gOut.Print("Done briefly mapping room record connections."); }