mirror of
https://github.com/sp-tarkov/patcher.git
synced 2025-02-13 09:10:46 -05:00
41 lines
967 B
C#
41 lines
967 B
C#
|
using Avalonia.Media;
|
|||
|
using PatchGenerator.Helpers;
|
|||
|
using ReactiveUI;
|
|||
|
using System.Linq;
|
|||
|
|
|||
|
namespace PatchGenerator.Models
|
|||
|
{
|
|||
|
public class PatchItem : ReactiveObject
|
|||
|
{
|
|||
|
private string _Name = "";
|
|||
|
public string Name
|
|||
|
{
|
|||
|
get => _Name;
|
|||
|
set => this.RaiseAndSetIfChanged(ref _Name, value);
|
|||
|
}
|
|||
|
|
|||
|
private IBrush _Color;
|
|||
|
public IBrush Color
|
|||
|
{
|
|||
|
get => _Color;
|
|||
|
set => this.RaiseAndSetIfChanged(ref _Color, value);
|
|||
|
}
|
|||
|
|
|||
|
public PatchItem(string Name)
|
|||
|
{
|
|||
|
this.Name = Name.Replace(".new", "").Replace(".delta", "").Replace(".del", "");
|
|||
|
|
|||
|
IBrush color;
|
|||
|
|
|||
|
if (PatchItemDefinitions.Colors.TryGetValue(Name.Split('.').Last(), out color))
|
|||
|
{
|
|||
|
Color = color;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
Color = PatchItemDefinitions.Colors["exists"];
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|