コード例 #1
0
        public GrisaiaDatabase()
        {
            string baseDirectory = AppContext.BaseDirectory;

            CachePath = Path.Combine(baseDirectory, "cache");
            DataPath  = Path.Combine(baseDirectory, "data");
            SavedPath = Path.Combine(baseDirectory, "saved");

            if (ViewModelBase.IsInDesignModeStatic)
            {
                string gameJson       = Embedded.ReadAllText(Embedded.Combine("Grisaia.data", "games.json"));
                string charactersJson = Embedded.ReadAllText(Embedded.Combine("Grisaia.data", "characters.json"));
                GameDatabase                      = JsonConvert.DeserializeObject <GameDatabase>(gameJson);
                CharacterDatabase                 = JsonConvert.DeserializeObject <CharacterDatabase>(charactersJson);
                GameDatabase.GrisaiaDatabase      = this;
                CharacterDatabase.GrisaiaDatabase = this;
            }
            else
            {
                string gamePath       = Path.Combine(DataPath, "games.json");
                string charactersPath = Path.Combine(DataPath, "characters.json");

                GameDatabase      = GameDatabase.FromJsonFile(gamePath, this);
                CharacterDatabase = CharacterDatabase.FromJsonFile(charactersPath, this);
            }
            SpriteDatabase = new SpriteDatabase(this);
        }
コード例 #2
0
        public CS2XmlDebugPatch(string xmlFile, bool debugSaveFolder, string resourcePath)
        {
            string debugKeybindsXmlPath = Embedded.Combine(resourcePath, "debug_keybinds.xml");

            DebugKeybindsXmlFragment = Embedded.ReadAllText(debugKeybindsXmlPath);
            XmlFile         = xmlFile;
            DebugSaveFolder = debugSaveFolder;
        }
コード例 #3
0
 public ProgramPatcher(string resourcePath, string targetFile = null)
 {
     ResourcePath = Embedded.Combine(Constants.ResourcesPath, resourcePath);
     TargetFile   = targetFile;
 }