mirror of
https://github.com/LorisYounger/VPet.ModMaker.git
synced 2024-08-30 18:22:21 +00:00
更新
This commit is contained in:
parent
19203ead6c
commit
5831b2d0f7
@ -31,8 +31,6 @@ public class ModMakerHistory
|
||||
}
|
||||
}
|
||||
|
||||
public string LastTimeString => LastTime.ToString("yyyy/MM/dd HH:mm:ss");
|
||||
|
||||
public string InfoFile => Path.Combine(SourcePath, "info.lps");
|
||||
|
||||
[Line(ignoreCase: true)]
|
||||
|
@ -94,7 +94,7 @@ public class FoodModel : I18nModel<I18nFoodModel>
|
||||
Health = Health.Value,
|
||||
Likability = Likability.Value,
|
||||
Price = Price.Value,
|
||||
ImageSource = Image.Value,
|
||||
Exp = Exp.Value,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@ public class ModMakerWindowVM
|
||||
public ObservableCommand CreateNewModCommand { get; } = new();
|
||||
public ObservableCommand LoadModFromFileCommand { get; } = new();
|
||||
public ObservableCommand ClearHistoriesCommand { get; } = new();
|
||||
public ObservableCommand<ModMakerHistory> RemoveHistoryCommand { get; } = new();
|
||||
#endregion
|
||||
public ModMakerWindowVM() { }
|
||||
|
||||
@ -45,9 +46,16 @@ public class ModMakerWindowVM
|
||||
CreateNewModCommand.ExecuteEvent += CreateNewMod;
|
||||
LoadModFromFileCommand.ExecuteEvent += LoadModFromFile;
|
||||
ClearHistoriesCommand.ExecuteEvent += ClearHistories;
|
||||
RemoveHistoryCommand.ExecuteEvent += RemoveHistory;
|
||||
HistoriesSearchText.ValueChanged += ModSearchText_ValueChanged;
|
||||
}
|
||||
|
||||
private void RemoveHistory(ModMakerHistory value)
|
||||
{
|
||||
Histories.Remove(value);
|
||||
SaveHistories();
|
||||
}
|
||||
|
||||
private void LoadHistories()
|
||||
{
|
||||
if (File.Exists(ModMakerInfo.HistoryFile) is false)
|
||||
@ -73,7 +81,7 @@ public class ModMakerWindowVM
|
||||
{
|
||||
new Sub("Id", history.Id),
|
||||
new Sub("SourcePath", history.SourcePath),
|
||||
new Sub("LastTime", history.LastTimeString)
|
||||
new Sub("LastTime", history.LastTime.ToString("yyyy/MM/dd HH:mm"))
|
||||
}
|
||||
);
|
||||
File.WriteAllText(ModMakerInfo.HistoryFile, lps.ToString());
|
||||
|
@ -55,7 +55,16 @@
|
||||
<Grid
|
||||
Margin="5"
|
||||
Background="{DynamicResource PrimaryDark}"
|
||||
Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"
|
||||
ToolTip="{Binding InfoFile}">
|
||||
<Grid.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem
|
||||
Command="{Binding PlacementTarget.Tag.RemoveHistoryCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
|
||||
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
|
||||
Header="{ll:Str 删除此历史}" />
|
||||
</ContextMenu>
|
||||
</Grid.ContextMenu>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
|
Loading…
Reference in New Issue
Block a user