This commit is contained in:
Hakoyu 2023-11-02 23:43:47 +08:00
parent e7fcbb0050
commit 0122ba8f5e
4 changed files with 22 additions and 12 deletions

View File

@ -130,7 +130,7 @@ public class FoodModel : I18nModel<I18nFoodModel>
Likability.Value = model.Likability.Value; Likability.Value = model.Likability.Value;
Price.Value = model.Price.Value; Price.Value = model.Price.Value;
Exp.Value = model.Exp.Value; Exp.Value = model.Exp.Value;
Image.Value = model.Image.Value; Image.Value = model.Image.Value.Copy();
foreach (var item in model.I18nDatas) foreach (var item in model.I18nDatas)
I18nDatas[item.Key] = item.Value.Copy(); I18nDatas[item.Key] = item.Value.Copy();
CurrentI18nData.Value = I18nDatas[I18nHelper.Current.CultureName.Value]; CurrentI18nData.Value = I18nDatas[I18nHelper.Current.CultureName.Value];

View File

@ -170,6 +170,8 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
/// <param name="path">路径</param> /// <param name="path">路径</param>
static void LoadAnime(PetModel petModel, string path) static void LoadAnime(PetModel petModel, string path)
{ {
if (Directory.Exists(path) is false)
return;
foreach (var animeDir in Directory.EnumerateDirectories(path)) foreach (var animeDir in Directory.EnumerateDirectories(path))
{ {
var dirName = Path.GetFileName(animeDir); var dirName = Path.GetFileName(animeDir);

View File

@ -119,9 +119,12 @@ public class ModMakerWindowVM
lps.Add( lps.Add(
new Line(nameof(history)) new Line(nameof(history))
{ {
new Sub("PetName", history.Id), new Sub(nameof(ModMakeHistory.Id), history.Id),
new Sub("SourcePath", history.SourcePath), new Sub(nameof(ModMakeHistory.SourcePath), history.SourcePath),
new Sub("LastTime", history.LastTime.ToString("yyyy/MM/dd HH:mm")) new Sub(
nameof(ModMakeHistory.LastTime),
history.LastTime.ToString("yyyy/MM/dd HH:mm")
)
} }
); );
} }

View File

@ -14,10 +14,10 @@
d:DataContext="{d:DesignInstance Type=vm:ModEditWindowVM}" d:DataContext="{d:DesignInstance Type=vm:ModEditWindowVM}"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d"> mc:Ignorable="d">
<Window.Resources> <Window.Resources>
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" /> <ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
</Window.Resources> </Window.Resources>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition /> <ColumnDefinition />
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
@ -64,7 +64,7 @@
Command="{Binding ChangeImageCommand}" Command="{Binding ChangeImageCommand}"
Content="{ll:Str 添加图片}"> Content="{ll:Str 添加图片}">
<Button.Style> <Button.Style>
<Style BasedOn="{StaticResource {x:Type Button}}" TargetType="Button"> <Style BasedOn="{StaticResource ThemedButtonStyle}" TargetType="Button">
<Setter Property="Visibility" Value="Hidden" /> <Setter Property="Visibility" Value="Hidden" />
<Style.Triggers> <Style.Triggers>
<DataTrigger Binding="{Binding ModInfo.Value.Image.Value}" Value="{x:Null}"> <DataTrigger Binding="{Binding ModInfo.Value.Image.Value}" Value="{x:Null}">
@ -271,7 +271,10 @@
<RowDefinition /> <RowDefinition />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Button Command="{Binding AddCultureCommand}" Content="{ll:Str 添加文化}" /> <Button
Command="{Binding AddCultureCommand}"
Content="{ll:Str 添加文化}"
Style="{DynamicResource ThemedButtonStyle}" />
<ListBox <ListBox
x:Name="ListBox_Cultures" x:Name="ListBox_Cultures"
Grid.Row="1" Grid.Row="1"
@ -304,11 +307,13 @@
<Button <Button
x:Name="Button_Save" x:Name="Button_Save"
Command="{Binding SaveCommand}" Command="{Binding SaveCommand}"
Content="{ll:Str 保存}" /> Content="{ll:Str 保存}"
Style="{DynamicResource ThemedButtonStyle}" />
<Button <Button
x:Name="Button_SaveTo" x:Name="Button_SaveTo"
Command="{Binding SaveToCommand}" Command="{Binding SaveToCommand}"
Content="{ll:Str 保存至}" /> Content="{ll:Str 保存至}"
Style="{DynamicResource ThemedButtonStyle}" />
</StackPanel> </StackPanel>
</Grid> </Grid>
</Grid> </Grid>