Profile editor - Continue updating datamodel in editor

Display conditions - Added setting to display current values while selecting condition targets
This commit is contained in:
SpoinkyNL committed 2020-08-06 22:09:28 +02:00
1 parent 35c46a4825
commit f3cbd819f5
26 files changed
+382 -93

No files matched your search

@@ -1,9 +1,22 @@
using Artemis.Plugins.Modules.General.DataModel.Windows;
using System;
using Artemis.Plugins.Modules.General.DataModel.Windows;
namespace Artemis.Plugins.Modules.General.DataModel
{
public class GeneralDataModel : Core.Plugins.Abstract.DataModels.DataModel
{
public GeneralDataModel()
{
TimeDataModel = new TimeDataModel();
}
public WindowDataModel ActiveWindow { get; set; }
public TimeDataModel TimeDataModel { get; set; }
}
public class TimeDataModel : Core.Plugins.Abstract.DataModels.DataModel
{
public DateTime CurrentTime { get; set; }
public DateTime CurrentTimeUTC { get; set; }
}
}
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Plugins.Abstract.ViewModels;
@@ -18,6 +19,9 @@ namespace Artemis.Plugins.Modules.General
public override void Update(double deltaTime)
{
DataModel.TimeDataModel.CurrentTime = DateTime.Now;
DataModel.TimeDataModel.CurrentTimeUTC = DateTime.UtcNow;
UpdateCurrentWindow();
base.Update(deltaTime);
}
@@ -38,7 +42,7 @@ namespace Artemis.Plugins.Modules.General
public void UpdateCurrentWindow()
{
var processId = WindowUtilities.GetActiveProcessId();
if (DataModel.ActiveWindow == null || DataModel.ActiveWindow.Process.Id != processId)
if (DataModel.ActiveWindow == null || DataModel.ActiveWindow.Process.Id != processId)
DataModel.ActiveWindow = new WindowDataModel(Process.GetProcessById(processId));
if (DataModel.ActiveWindow != null && string.IsNullOrWhiteSpace(DataModel.ActiveWindow.WindowTitle))
DataModel.ActiveWindow.WindowTitle = Process.GetProcessById(WindowUtilities.GetActiveProcessId()).MainWindowTitle;
@@ -1,12 +1,24 @@
using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Plugins.Abstract.ViewModels;
using Artemis.Core.Plugins.Abstract.ViewModels;
namespace Artemis.Plugins.Modules.General.ViewModels
{
public class GeneralViewModel : ModuleViewModel
{
public GeneralViewModel(Module module) : base(module, "General")
public GeneralModule GeneralModule { get; }
public GeneralViewModel(GeneralModule module) : base(module, "General")
{
GeneralModule = module;
}
public void ShowUTCTimeInDataModel()
{
GeneralModule.ShowProperty(model => model.TimeDataModel.CurrentTimeUTC);
}
public void HideUTCTimeInDataModel()
{
GeneralModule.HideProperty(model => model.TimeDataModel.CurrentTimeUTC);
}
}
}
@@ -4,9 +4,20 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Artemis.Plugins.Modules.General.Views"
xmlns:s="https://github.com/canton7/Stylet"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Label>Test</Label>
<Grid VerticalAlignment="Center" HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Style="{StaticResource MaterialDesignRaisedLightButton}" Command="{s:Action ShowUTCTimeInDataModel}" Margin="0 0 25 0">
ShowUTCTimeInDataModel
</Button>
<Button Grid.Column="1" Style="{StaticResource MaterialDesignRaisedButton}" Command="{s:Action HideUTCTimeInDataModel}" Margin="25 0 0 0">
HideUTCTimeInDataModel
</Button>
</Grid>
</UserControl>