コード例 #1
0
ファイル: Lore.cs プロジェクト: Zelknolf/Mundasia_SRD5
 public static void Load()
 {
     string file = System.IO.Directory.GetCurrentDirectory() + "\\DataArrays\\Lore.txt";
     FileStream strLib = File.Open(file, FileMode.Open);
     using (StreamReader read = new StreamReader(strLib, Encoding.UTF7))
     {
         while (read.Peek() >= 0)
         {
             Lore toAdd = new Lore(read.ReadLine());
             if (!Categories.Contains(toAdd.Category))
             {
                 Categories.Add(toAdd.Category);
             }
             if(!CategoryLists.ContainsKey(toAdd.Category))
             {
                 CategoryLists.Add(toAdd.Category, new List<Lore>());
             }
             CategoryLists[toAdd.Category].Add(toAdd);
             _library.Add(toAdd.Id, toAdd);
             _sortedLores.Add(toAdd);
         }
     }
     Categories.Sort();
     _sortedLores.Sort();
 }
コード例 #2
0
ファイル: LoreText.cs プロジェクト: Zelknolf/Mundasia_SRD5
        public void SetActiveLore(Lore lore)
        {
            Image loadedImage = new Bitmap(System.IO.Directory.GetCurrentDirectory() + "\\Images\\Lore\\" + lore.Image);
            ImagePanel.BackgroundImage = loadedImage;

            Title.Text = Environment.NewLine + lore.Name;

            DescriptionText.Text = StringLibrary.GetString(lore.Description);
        }