public static MessageEntryBuilder.MessageBuilder RuntimeArticle(this MessageEntryBuilder.MessageBuilder @this, Item item, Item location, string indefiniteArticle = null) { return(@this .RuntimeArticleStart(location) .Text(MessageUtils.GetArticle(item, indefiniteArticle)) .RuntimeGenericStop()); }
/// <summary> /// Appends the start quick text control character (0x17) to the message, executes the specified action, and /// appends the stop quick text control character(0x18) to the end of the message. /// </summary> /// <param name="this"></param> /// <param name="action"></param> /// <returns></returns> public static MessageEntryBuilder.MessageBuilder QuickText(this MessageEntryBuilder.MessageBuilder @this, Action action) { @this.QuickTextStart(); action(); @this.QuickTextStop(); return(@this); }
/// <summary> /// Appends the start light blue text control character (0x05) to the message, and executes the specified action. /// </summary> /// <param name="this"></param> /// <param name="action"></param> /// <returns></returns> public static MessageEntryBuilder.MessageBuilder LightBlue(this MessageEntryBuilder.MessageBuilder @this, Action action) { @this.StartLightBlueText(); action(); @this.PopTextColor(); return(@this); }
public static MessageEntryBuilder.MessageBuilder RuntimePronounOrAmount(this MessageEntryBuilder.MessageBuilder @this, Item item, Item location) { return(@this .RuntimeAmountStart(location) .Text(MessageUtils.GetPronounOrAmount(item)) .RuntimeGenericStop()); }
/// <summary> /// Appends the start autowrap control character (0x09 0x11) to the message, executes the specified action, and /// appends the stop autowrap control character(0x09 0x012) to the end of the message. /// </summary> /// <param name="this"></param> /// <param name="action"></param> /// <returns></returns> public static MessageEntryBuilder.MessageBuilder RuntimeWrap(this MessageEntryBuilder.MessageBuilder @this, Action action) { @this.AutoWrapStart(); action(); @this.AutoWrapStop(); return(@this); }
public static MessageEntryBuilder.MessageBuilder RuntimeVerb(this MessageEntryBuilder.MessageBuilder @this, Item item, Item location) { return(@this .RuntimeVerbStart(location) .Text(MessageUtils.GetVerb(item)) .RuntimeGenericStop()); }
public static MessageEntryBuilder.MessageBuilder RuntimeItemName(this MessageEntryBuilder.MessageBuilder @this, string text, Item location) { return(@this .RuntimeItemNameStart(location) .Text(text) .RuntimeGenericStop()); }
/// <summary> /// Appends the start pink text control character (0x06) to the message, and executes the specified action. /// </summary> /// <param name="this"></param> /// <param name="action"></param> /// <returns></returns> public static MessageEntryBuilder.MessageBuilder Pink(this MessageEntryBuilder.MessageBuilder @this, Action action) { @this.StartPinkText(); action(); @this.PopTextColor(); return(@this); }
/// <summary> /// Appends the given text color control character to the message, and executes the specified action. /// </summary> /// <param name="this">this message builder</param> /// <param name="action"></param> /// <returns></returns> public static MessageEntryBuilder.MessageBuilder TextColor(this MessageEntryBuilder.MessageBuilder @this, char color, Action action) { @this.PushTextColor(color); action(); @this.PopTextColor(); return(@this); }
/// <summary> /// Creates a new message builder and runs <see cref="StringExtensions.Wrap"/> on the result with width 35 and newline "\u0011". /// </summary> /// <param name="this"></param> /// <param name="action"></param> /// <returns></returns> public static MessageEntryBuilder.MessageBuilder CompileTimeWrap(this MessageEntryBuilder.MessageBuilder @this, Action <MessageEntryBuilder.MessageBuilder> action) { var wrappedMessageBuilder = new MessageEntryBuilder.MessageBuilder(); action(wrappedMessageBuilder); var message = wrappedMessageBuilder.Build().Wrap(35, "\u0011", "\u0010"); return(@this.Text(message)); }
/// <summary> /// Appends the start light blue text control character (0x05) to the message, and writes the specified text. /// </summary> /// <param name="this">this message builder</param> /// <param name="text"></param> /// <returns></returns> public static MessageEntryBuilder.MessageBuilder LightBlue(this MessageEntryBuilder.MessageBuilder @this, string text) => @this.LightBlue(() => @this.Text(text));
/// <summary> /// Appends the start yellow text control character (0x04) to the message, and writes the specified text. /// </summary> /// <param name="this">this message builder</param> /// <param name="text"></param> /// <returns></returns> public static MessageEntryBuilder.MessageBuilder Yellow(this MessageEntryBuilder.MessageBuilder @this, string text) => @this.Yellow(() => @this.Text(text));
/// <summary> /// Appends the start green text control character (0x02) to the message, and writes the specified text. /// </summary> /// <param name="this">this message builder</param> /// <param name="text"></param> /// <returns></returns> public static MessageEntryBuilder.MessageBuilder Green(this MessageEntryBuilder.MessageBuilder @this, string text) => @this.Green(() => @this.Text(text));
/// <summary> /// Appends the start white text control character (0x00) to the message, and writes the specified text. /// </summary> /// <param name="this">this message builder</param> /// <param name="text"></param> /// <returns></returns> public static MessageEntryBuilder.MessageBuilder White(this MessageEntryBuilder.MessageBuilder @this, string text) => @this.White(() => @this.Text(text));
/// <summary> /// Appends the start white text control character (0x00) to the message, and writes the specified text. /// </summary> /// <param name="this">this message builder</param> /// <param name="text"></param> /// <returns></returns> public static MessageEntryBuilder.MessageBuilder TextColor(this MessageEntryBuilder.MessageBuilder @this, char color, string text) => @this.TextColor(color, () => @this.Text(text));
public static MessageEntryBuilder.MessageBuilder RuntimeItemDescription(this MessageEntryBuilder.MessageBuilder @this, Item item, ShopInventoryAttribute.ShopKeeper shopKeeper, Item location) { var shopTexts = item.ShopTexts(); string description; switch (shopKeeper) { case ShopInventoryAttribute.ShopKeeper.WitchShop: description = shopTexts.WitchShop; break; case ShopInventoryAttribute.ShopKeeper.TradingPostMain: description = shopTexts.TradingPostMain; break; case ShopInventoryAttribute.ShopKeeper.TradingPostPartTimer: description = shopTexts.TradingPostPartTimer; break; case ShopInventoryAttribute.ShopKeeper.CuriosityShop: description = shopTexts.CuriosityShop; break; case ShopInventoryAttribute.ShopKeeper.BombShop: description = shopTexts.BombShop; break; case ShopInventoryAttribute.ShopKeeper.ZoraShop: description = shopTexts.ZoraShop; break; case ShopInventoryAttribute.ShopKeeper.GoronShop: description = shopTexts.GoronShop; break; case ShopInventoryAttribute.ShopKeeper.GoronShopSpring: description = shopTexts.GoronShopSpring; break; default: description = null; break; } if (description == null) { description = shopTexts.Default; } var getItemIndex = location.GetItemIndex().Value; var upper = (char)(getItemIndex >> 8); var lower = (char)(getItemIndex & 0xFF); if (description.Contains("\u0009\u0001\u0000\u0000")) { return(@this.Text(description.Replace("\u0009\u0001\u0000\u0000", $"\u0009\u0001{upper}{lower}"))); } return(@this .RuntimeItemDescriptionStart(location) .Text(description) .RuntimeGenericStop()); }
/// <summary> /// Appends the start autowrap control character (0x09 0x11) to the message, appends the specified text, and /// appends the stop autowrap control character(0x09 0x012) to the end of the message. /// </summary> /// <param name="this"></param> /// <param name="action"></param> /// <returns></returns> public static MessageEntryBuilder.MessageBuilder RuntimeWrap(this MessageEntryBuilder.MessageBuilder @this, string text) => @this.RuntimeWrap(() => @this.Text(text));
/// <summary> /// Appends the start pink text control character (0x06) to the message, and writes the specified text. /// </summary> /// <param name="this">this message builder</param> /// <param name="text"></param> /// <returns></returns> public static MessageEntryBuilder.MessageBuilder Pink(this MessageEntryBuilder.MessageBuilder @this, string text) => @this.Pink(() => @this.Text(text));
/// <summary> /// Runs <see cref="StringExtensions.Wrap"/> on the text with width 35 and newline "\u0011" and appends the result. /// </summary> /// <param name="this"></param> /// <param name="text"></param> /// <returns></returns> public static MessageEntryBuilder.MessageBuilder CompileTimeWrap(this MessageEntryBuilder.MessageBuilder @this, string text) { return(@this.Text(text.Wrap(35, "\u0011", "\u0010"))); }