mirror of
https://github.com/LorisYounger/VPet.ModMaker.git
synced 2024-08-30 18:22:21 +00:00
AnimeEdit 实装 StateONE 和 StateTWO
This commit is contained in:
parent
c6806e03b5
commit
395e054f13
@ -21,6 +21,7 @@ public class AnimeTypeModel
|
||||
public static ObservableCollection<GameSave.ModeType> ModeTypes { get; } =
|
||||
new(Enum.GetValues(typeof(GameSave.ModeType)).Cast<GameSave.ModeType>());
|
||||
|
||||
public ObservableValue<string> Name { get; } = new();
|
||||
public ObservableValue<GraphInfo.GraphType> GraphType { get; } = new();
|
||||
|
||||
public ObservableCollection<AnimeModel> HappyAnimes { get; } = new();
|
||||
@ -32,6 +33,7 @@ public class AnimeTypeModel
|
||||
|
||||
public AnimeTypeModel(AnimeTypeModel model)
|
||||
{
|
||||
Name.Value = model.Name.Value;
|
||||
GraphType.Value = model.GraphType.Value;
|
||||
foreach (var anime in model.HappyAnimes)
|
||||
HappyAnimes.Add(anime.Copy());
|
||||
@ -77,6 +79,8 @@ public class AnimeTypeModel
|
||||
or GraphInfo.GraphType.Touch_Body
|
||||
or GraphInfo.GraphType.Sleep
|
||||
or GraphInfo.GraphType.Raised_Static
|
||||
or GraphInfo.GraphType.StateONE
|
||||
or GraphInfo.GraphType.StateTWO
|
||||
)
|
||||
LoadMultiType(path);
|
||||
else
|
||||
@ -176,25 +180,25 @@ public class AnimeTypeModel
|
||||
else
|
||||
{
|
||||
// 判断 Happy/A 型文件夹
|
||||
var mode = Enum.Parse(typeof(GameSave.ModeType), Path.GetFileName(dirName), true);
|
||||
var mode = Enum.Parse(typeof(GameSave.ModeType), dirName, true);
|
||||
foreach (var typePath in Directory.EnumerateDirectories(dir))
|
||||
{
|
||||
var type = GetAnimatType(Path.GetFileName(typePath)[0]);
|
||||
if (mode is GameSave.ModeType.Happy)
|
||||
{
|
||||
AddAnime(HappyAnimes, dir, type);
|
||||
AddAnime(HappyAnimes, typePath, type);
|
||||
}
|
||||
else if (mode is GameSave.ModeType.Nomal)
|
||||
{
|
||||
AddAnime(NomalAnimes, dir, type);
|
||||
AddAnime(NomalAnimes, typePath, type);
|
||||
}
|
||||
else if (mode is GameSave.ModeType.PoorCondition)
|
||||
{
|
||||
AddAnime(PoorConditionAnimes, dir, type);
|
||||
AddAnime(PoorConditionAnimes, typePath, type);
|
||||
}
|
||||
else if (mode is GameSave.ModeType.Ill)
|
||||
{
|
||||
AddAnime(IllAnimes, dir, type);
|
||||
AddAnime(IllAnimes, typePath, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -265,6 +269,15 @@ public class AnimeTypeModel
|
||||
or GraphInfo.GraphType.Raised_Static
|
||||
)
|
||||
SaveRaise(path, this);
|
||||
else if (GraphType.Value is GraphInfo.GraphType.StateONE or GraphInfo.GraphType.StateTWO)
|
||||
SaveState(path, this);
|
||||
}
|
||||
|
||||
void SaveState(string path, AnimeTypeModel animeTypeModel)
|
||||
{
|
||||
var animePath = Path.Combine(path, "State");
|
||||
Directory.CreateDirectory(animePath);
|
||||
SaveWithModeType(animePath, animeTypeModel);
|
||||
}
|
||||
|
||||
void SaveRaise(string path, AnimeTypeModel animeTypeModel)
|
||||
|
@ -127,6 +127,22 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
|
||||
petModel.Animes.Add(switchModel);
|
||||
}
|
||||
}
|
||||
else if (dirName.Equals("State", StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
foreach (var dir in Directory.EnumerateDirectories(animeDir))
|
||||
{
|
||||
Enum.TryParse<GraphInfo.GraphType>(
|
||||
Path.GetFileName(dir),
|
||||
true,
|
||||
out var switchType
|
||||
);
|
||||
if (
|
||||
AnimeTypeModel.Create(switchType, Path.Combine(animeDir, dir))
|
||||
is AnimeTypeModel switchModel
|
||||
)
|
||||
petModel.Animes.Add(switchModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ public class AnimeEditWindowVM
|
||||
public ObservableValue<bool> Loop { get; } = new();
|
||||
|
||||
public ObservableValue<bool> HasMultiType { get; } = new(false);
|
||||
public ObservableValue<bool> HasAnimeName { get; } = new(false);
|
||||
#region Command
|
||||
public ObservableCommand PlayCommand { get; } = new();
|
||||
public ObservableCommand StopCommand { get; } = new();
|
||||
@ -68,6 +69,9 @@ public class AnimeEditWindowVM
|
||||
or GraphInfo.GraphType.Sleep
|
||||
)
|
||||
HasMultiType.Value = true;
|
||||
|
||||
if (model.GraphType.Value is GraphInfo.GraphType.Idel)
|
||||
HasAnimeName.Value = true;
|
||||
}
|
||||
|
||||
private void CurrentAnimeModel_ValueChanged(AnimeModel oldValue, AnimeModel newValue)
|
||||
|
@ -174,12 +174,21 @@
|
||||
</Grid.RowDefinitions>
|
||||
<!--<Label Content="{ll:Str 动画Id}" />
|
||||
<TextBox Grid.Column="1" />-->
|
||||
<Label Grid.Row="1" Content="{ll:Str 动画类型}" />
|
||||
<Label Content="{ll:Str 动画类型}" />
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
IsEnabled="True"
|
||||
Text="{Binding Anime.Value.GraphType.Value}" />
|
||||
<Label
|
||||
Grid.Row="1"
|
||||
Content="{ll:Str 动画名称}"
|
||||
Visibility="{Binding HasAnimeName.Value, Converter={StaticResource FalseToHiddenConverter}}" />
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
IsEnabled="True"
|
||||
Text="{Binding Anime.Value.GraphType.Value}" />
|
||||
Text="{Binding Anime.Value.GraphType.Value}"
|
||||
Visibility="{Binding HasAnimeName.Value, Converter={StaticResource FalseToHiddenConverter}}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid Grid.Column="1">
|
||||
|
Loading…
Reference in New Issue
Block a user