コード例 #1
0
        void LoadFonts(FontsIni fonts, RichFontsIni rf, FileSystem fs, string dataPath)
        {
            foreach (var f in fonts.FontFiles)
            {
                var path = fs.Resolve(dataPath + f, false);
                if (path == null)
                {
                    FLLog.Error("Fonts", "Could not find ttf file " + dataPath + f);
                }
                Platform.AddTtfFile(path);
            }
            nicknames = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);
            foreach (var id in fonts.UIFonts)
            {
                nicknames[id.Nickname] = id.Font;
            }
            infocardFonts = new Dictionary <int, FontDescription>();
            var v = new FontDescription()
            {
                FontName = "Agency FB", FontSize = 16
            };

            infocardFonts.Add(-1, v);
            foreach (var f in rf.Fonts)
            {
                var desc = new FontDescription()
                {
                    FontName = f.Name, FontSize = f.Size
                };
                infocardFonts.Add(f.Index, desc);
            }
            _loaded = true;
        }
コード例 #2
0
        void LoadFonts(FontsIni fonts, RichFontsIni rf, FileSystem fs, string dataPath)
        {
            var d = dataPath.Replace('\\', Path.DirectorySeparatorChar);

            foreach (var f in fonts.FontFiles)
            {
                Platform.AddTtfFile(fs.Resolve(Path.Combine(d, f)));
            }
            nicknames = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);
            foreach (var id in fonts.UIFonts)
            {
                nicknames[id.Nickname] = id.Font;
            }
            infocardFonts = new Dictionary <int, FontDescription>();
            var v = new FontDescription()
            {
                FontName = "Agency FB", FontSize = 16
            };

            infocardFonts.Add(-1, v);
            foreach (var f in rf.Fonts)
            {
                var desc = new FontDescription()
                {
                    FontName = f.Name, FontSize = f.Size
                };
                infocardFonts.Add(f.Index, desc);
            }
            _loaded = true;
        }
コード例 #3
0
        public void LoadFontsFromIni(FreelancerIni fl, FileSystem fs)
        {
            var rf = new RichFontsIni();

            foreach (var file in fl.RichFontPaths)
            {
                rf.AddRichFontsIni(file, fs);
            }
            var fn = new FontsIni();

            foreach (var file in fl.FontPaths)
            {
                fn.AddFontsIni(file, fs);
            }
            LoadFonts(fn, rf, fs, fl.DataPath);
        }
コード例 #4
0
ファイル: FreelancerData.cs プロジェクト: gp-alex/Librelancer
 public void LoadData()
 {
     if (Loaded)
     {
         return;
     }
     if (LoadDacom)
     {
         Dacom = new DacomIni();
     }
     if (Freelancer.JsonResources != null)
     {
         var strs = JsonConvert.DeserializeObject <Dictionary <int, string> >(File.ReadAllText(VFS.GetPath("EXE\\" + Freelancer.JsonResources.Item1)));
         var ifcs = JsonConvert.DeserializeObject <Dictionary <int, string> >(File.ReadAllText(VFS.GetPath("EXE\\" + Freelancer.JsonResources.Item2)));
         Infocards = new InfocardManager(strs, ifcs);
     }
     else
     {
         Infocards = new InfocardManager(Freelancer.Resources);
     }
     //Dfm
     Bodyparts = new BodypartsIni(Freelancer.BodypartsPath, this);
     Costumes  = new CostumesIni(Freelancer.CostumesPath, this);
     //Equipment
     Equipment = new EquipmentIni();
     foreach (var eq in Freelancer.EquipmentPaths)
     {
         Equipment.AddEquipmentIni(eq, this);
     }
     //Solars
     Solar = new SolararchIni(Freelancer.SolarPath, this);
     if (Freelancer.StarsPath != null)
     {
         Stars = new StararchIni(Freelancer.StarsPath);
     }
     else
     {
         Stars = new StararchIni("DATA\\SOLAR\\stararch.ini");
     }
     Asteroids = new AsteroidArchIni();
     foreach (var ast in Freelancer.AsteroidPaths)
     {
         Asteroids.AddFile(ast);
     }
     //Loadouts
     Loadouts = new LoadoutsIni();
     foreach (var lo in Freelancer.LoadoutPaths)
     {
         Loadouts.AddLoadoutsIni(lo, this);
     }
     //Universe
     Universe = new UniverseIni(Freelancer.UniversePath, this);
     //Ships
     Ships = new ShiparchIni();
     foreach (var shp in Freelancer.ShiparchPaths)
     {
         Ships.AddShiparchIni(shp, this);
     }
     //Audio
     Audio = new AudioIni();
     foreach (var snd in Freelancer.SoundPaths)
     {
         Audio.AddIni(snd, Freelancer);
     }
     Loaded = true;
     //Graphs
     Graphs = new GraphIni();
     foreach (var g in Freelancer.GraphPaths)
     {
         Graphs.AddGraphIni(g);
     }
     //Shapes
     EffectShapes = new TexturePanels(Freelancer.EffectShapesPath);
     //Effects
     Effects = new EffectsIni();
     foreach (var fx in Freelancer.EffectPaths)
     {
         Effects.AddIni(fx);
     }
     //Mouse
     Mouse = new MouseIni(Freelancer.DataPath + "//mouse.ini");
     //Fonts
     RichFonts = new RichFontsIni();
     foreach (var rf in Freelancer.RichFontPaths)
     {
         RichFonts.AddRichFontsIni(rf);
     }
     //PetalDb
     PetalDb = new PetalDbIni();
     foreach (var pt in Freelancer.PetalDbPaths)
     {
         PetalDb.AddFile(pt);
     }
     //Hud
     Hud = new HudIni();
     Hud.AddIni(Freelancer.HudPath);
     //navbar.ini
     BaseNavBar = new BaseNavBarIni();
     //mbases.ini
     MBases = new MBasesIni();
 }