using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Windows.Forms; using System.IO; using AC_e_Reader_Card_Creator.Decompression.Functions; using System.Drawing.Text; using System.Runtime.InteropServices; using System.Diagnostics; using AC_e_Reader_Card_Creator.References; namespace AC_e_Reader_Card_Creator { public partial class eReaderCCC : Form { private readonly Dictionary itemIDs = []; private readonly Dictionary stationeryFontRGB = []; private readonly PrivateFontCollection AC_Letter_Font = new(); private bool isDarkModeEnabled = false; public eReaderCCC() { InitializeComponent(); LoadDirectories(); LoadStationeryIDs(); LoadItemIDs(); LoadSenderIDs(); LoadGreetings(); HandleFonts(); Common.LoadBlankVPKs(); label_Version.Text = Common.VERSION; comboBox_Stationery.SelectedIndex = 0; comboBox_Greeting.SelectedIndex = 5; label_Greeting.Text = comboBox_Greeting.Text; } private void LoadDirectories() { string[] directoryPath = [@"Project Files\Decompression\eCard", Common.RAW_OUTPUT, Common.BIN_OUTPUT, Common.VPK_OUTPUT, Common.DEC_OUTPUT, Common.BMP_OUTPUT]; foreach (string dir in directoryPath) { if (!Directory.Exists(dir)) { Directory.CreateDirectory(dir); } } } private void ItemIDChanged(object sender, EventArgs e) { string itemID = "0x" + textBox_ItemID.Text; if (itemID.Length == 6) { string item_name = Common.LookupListValue(itemID, Common.ITEM_LIST); if (item_name != null) { comboBox_ItemName.SelectedItem = item_name; } else { comboBox_ItemName.SelectedItem = "Invalid"; } } else { comboBox_ItemName.SelectedItem = null; } } private void LetterBodyChanged(object sender, EventArgs e) { int currentCharCount = textBox_Body.Text.Length; int maxCharBody = textBox_Body.MaxLength; header_Body.Text = $"Body ( {currentCharCount} / {maxCharBody} )"; List