custom challenges watermark + drawstring reward id + fixed language pack loading when it wasn't needed

This commit is contained in:
Asval
2019-06-21 03:17:35 +02:00
parent b432ea1235
commit 4e23d23dfb
9 changed files with 177 additions and 48 deletions

View File

@@ -207,9 +207,23 @@ namespace FModel
/// <param name="myBitmap"></param>
public static void drawWatermark(Bitmap myBitmap)
{
string text = SearchResource.getTextByKey(myItem.DisplayName.Key, myItem.DisplayName.SourceString);
string text = Settings.Default.challengesWatermark;
if (string.IsNullOrWhiteSpace(text))
{
text = "{Bundle_Name} Generated using FModel & JohnWickParse - {Date}";
}
if (text.Contains("{Bundle_Name}"))
{
text = text.Replace("{Bundle_Name}", SearchResource.getTextByKey(myItem.DisplayName.Key, myItem.DisplayName.SourceString));
}
if (text.Contains("{Date}"))
{
text = text.Replace("{Date}", DateTime.Now.ToString("dd/MM/yyyy"));
}
toDrawOn.FillRectangle(new SolidBrush(Color.FromArgb(100, 0, 0, 0)), new Rectangle(0, theY + 240, myBitmap.Width, 40));
toDrawOn.DrawString(text + " Generated using FModel & JohnWickParse - " + DateTime.Now.ToString("dd/MM/yyyy"), new Font(FontUtilities.pfc.Families[0], 20), new SolidBrush(Color.FromArgb(150, 255, 255, 255)), new Point(myBitmap.Width / 2, theY + 250), FontUtilities.centeredString);
toDrawOn.DrawString(text, new Font(FontUtilities.pfc.Families[0], 20), new SolidBrush(Color.FromArgb(150, 255, 255, 255)), new Point(myBitmap.Width / 2, theY + 250), FontUtilities.centeredString);
}
private static void drawForbyteReward()

View File

@@ -71,7 +71,7 @@ namespace FModel
{
ItemIcon.SearchAthIteDefIcon(itemId[i]);
drawIcon();
drawIcon(item);
}
}
}
@@ -127,7 +127,7 @@ namespace FModel
ItemIcon.ItemIconPath = JohnWick.AssetToTexture2D(textureFile);
}
drawIcon();
drawIcon(bannerName);
}
}
}
@@ -139,10 +139,16 @@ namespace FModel
}
}
private static void drawIcon()
private static void drawIcon(string itemId)
{
if (File.Exists(ItemIcon.ItemIconPath))
{
if (Settings.Default.challengesDebug)
{
//draw quest reward id
BundleDesign.toDrawOn.DrawString(itemId, new Font("Courier New", 12), new SolidBrush(Color.White), new RectangleF(2110, BundleDesign.theY + 30, 190, 60), FontUtilities.centeredStringLine);
}
Image itemIcon;
using (var bmpTemp = new Bitmap(ItemIcon.ItemIconPath))
{