-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
122 additions
and
6 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/Cabinet.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
81 changes: 81 additions & 0 deletions
81
Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/Cabinet/CabinetConfig.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* | ||
* File: CabinetConfig.cs | ||
* Project: DressingTools | ||
* Created Date: Saturday, Aug 24th 2023, 05:08:11 pm | ||
* Author: chocopoi ([email protected]) | ||
* ----- | ||
* Copyright (c) 2023 chocopoi | ||
* | ||
* This file is part of DressingTools. | ||
* | ||
* DressingTools is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | ||
* | ||
* DressingTools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with DressingTools. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using Chocopoi.DressingTools.Lib.Serialization; | ||
using Chocopoi.DressingTools.Lib.Wearable.Modules; | ||
using Chocopoi.DressingTools.Lib.Wearable.Serializers; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Linq; | ||
|
||
namespace Chocopoi.DressingTools.Lib.Wearable | ||
{ | ||
public class CabinetConfig : VersionedObject | ||
{ | ||
public static readonly SerializationVersion CurrentConfigVersion = new SerializationVersion(1, 0, 0); | ||
private static readonly Dictionary<int, ISerializer> Serializers = new Dictionary<int, ISerializer>() { | ||
{ 1, null }, | ||
}; | ||
|
||
public override SerializationVersion Version { get; set; } | ||
|
||
public string AvatarArmatureName { get; set; } | ||
public bool GroupDynamics { get; set; } | ||
public bool GroupDynamicsSeparateGameObjects { get; set; } | ||
public bool AnimationGenerationWriteDefaults { get; set; } | ||
|
||
public CabinetConfig() | ||
{ | ||
} | ||
|
||
public override ISerializer GetSerializerByVersion(SerializationVersion version) | ||
{ | ||
if (version == null) | ||
{ | ||
return null; | ||
} | ||
return Serializers.ContainsKey(version.Major) ? Serializers[version.Major] : null; | ||
} | ||
|
||
public static CabinetConfig Deserialize(string json) | ||
{ | ||
// TODO: perform schema check | ||
var jObject = JObject.Parse(json); | ||
return Deserialize(jObject); | ||
} | ||
|
||
public static CabinetConfig Deserialize(JObject jObject) | ||
{ | ||
var config = new CabinetConfig(); | ||
config.DeserializeFrom(jObject); | ||
return config; | ||
} | ||
|
||
public CabinetConfig Clone() | ||
{ | ||
// a tricky and easier way to copy | ||
return Deserialize(Serialize()); | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return Serialize().ToString(Formatting.None); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/Cabinet/CabinetConfig.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/Cabinet/Modules.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/Cabinet/Serializers.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...s/com.chocopoi.vrc.dressingtools/Lib/Editor/Extensibility/Providers/ModuleProviderBase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* File: ModuleProviderBase.cs | ||
* Project: DressingTools | ||
* Created Date: Saturday, Aug 24nd 2023, 15:31:11 am | ||
* Created Date: Saturday, Aug 24th 2023, 15:31:11 am | ||
* Author: chocopoi ([email protected]) | ||
* ----- | ||
* Copyright (c) 2023 chocopoi | ||
|
2 changes: 1 addition & 1 deletion
2
...ocopoi.vrc.dressingtools/Lib/Editor/Extensibility/Providers/WearableModuleProviderBase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* File: WearableModuleProviderBase.cs | ||
* Project: DressingTools | ||
* Created Date: Saturday, Aug 24nd 2023, 15:31:11 am | ||
* Created Date: Saturday, Aug 24th 2023, 15:31:11 am | ||
* Author: chocopoi ([email protected]) | ||
* ----- | ||
* Copyright (c) 2023 chocopoi | ||
|
2 changes: 1 addition & 1 deletion
2
...poi.vrc.dressingtools/Lib/Editor/Extensibility/Providers/WearableModuleProviderLocator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* File: WearableModuleProviderLocator.cs | ||
* Project: DressingTools | ||
* Created Date: Saturday, Aug 24nd 2023, 03:53:21 pm | ||
* Created Date: Saturday, Aug 24th 2023, 03:53:21 pm | ||
* Author: chocopoi ([email protected]) | ||
* ----- | ||
* Copyright (c) 2023 chocopoi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* File: IWearableConfigSerializer.cs | ||
* File: WearableV1Serializer.cs | ||
* Project: DressingTools | ||
* Created Date: Saturday, Aug 22nd 2023, 16:35:11 pm | ||
* Author: chocopoi ([email protected]) | ||
|
@@ -24,7 +24,7 @@ | |
|
||
namespace Chocopoi.DressingTools.Lib.Wearable.Serializers | ||
{ | ||
public class Version1Serializer : ISerializer | ||
public class WearableV1Serializer : ISerializer | ||
{ | ||
private class ModuleConverter : JsonConverter | ||
{ | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters