mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Scripting - Added script creation
This commit is contained in:
1 parent
8c729055ea
commit
4a69baebb7
11 files changed
+366
-49
No files matched your search
@@ -94,15 +94,18 @@
|
||||
Command="{s:Action Paste}"
|
||||
InputGestureText="Ctrl+V" />
|
||||
</MenuItem>
|
||||
<MenuItem Header="_Scripting" IsEnabled="False">
|
||||
<MenuItem Header="_Scripting">
|
||||
<MenuItem Header="_Profile scripts"
|
||||
Icon="{materialDesign:PackIcon Kind=BookEdit}" />
|
||||
Icon="{materialDesign:PackIcon Kind=BookEdit}"
|
||||
Command="{s:Action OpenProfileScripts}"/>
|
||||
<MenuItem Header="_Layer scripts"
|
||||
Icon="{materialDesign:PackIcon Kind=Layers}"
|
||||
IsEnabled="{Binding HasSelectedElement}"/>
|
||||
IsEnabled="{Binding HasSelectedElement}"
|
||||
Command="{s:Action OpenLayerScripts}"/>
|
||||
<MenuItem Header="_Property scripts"
|
||||
Icon="{materialDesign:PackIcon Kind=FormTextbox}"
|
||||
IsEnabled="{Binding HasSelectedElement}"/>
|
||||
IsEnabled="{Binding HasSelectedElement}"
|
||||
Command="{s:Action OpenLayerPropertyScripts}"/>
|
||||
</MenuItem>
|
||||
<MenuItem Header="_Help">
|
||||
<MenuItem Header="Artemis wiki"
|
||||
|
||||
@@ -11,6 +11,7 @@ using Artemis.UI.Screens.ProfileEditor.DisplayConditions;
|
||||
using Artemis.UI.Screens.ProfileEditor.LayerProperties;
|
||||
using Artemis.UI.Screens.ProfileEditor.ProfileTree;
|
||||
using Artemis.UI.Screens.ProfileEditor.Visualization;
|
||||
using Artemis.UI.Screens.Scripting;
|
||||
using Artemis.UI.Screens.Sidebar.Dialogs;
|
||||
using Artemis.UI.Services;
|
||||
using Artemis.UI.Shared;
|
||||
@@ -24,8 +25,9 @@ namespace Artemis.UI.Screens.ProfileEditor
|
||||
{
|
||||
private readonly IMessageService _messageService;
|
||||
private readonly IDebugService _debugService;
|
||||
private readonly IWindowManager _windowManager;
|
||||
private readonly IScriptVmFactory _scriptVmFactory;
|
||||
private readonly ISidebarVmFactory _sidebarVmFactory;
|
||||
private readonly IEventAggregator _eventAggregator;
|
||||
private readonly IProfileEditorService _profileEditorService;
|
||||
private readonly IProfileService _profileService;
|
||||
private readonly ISettingsService _settingsService;
|
||||
@@ -46,8 +48,10 @@ namespace Artemis.UI.Screens.ProfileEditor
|
||||
IProfileService profileService,
|
||||
IDialogService dialogService,
|
||||
ISettingsService settingsService,
|
||||
IMessageService messageService,
|
||||
IMessageService messageService,
|
||||
IDebugService debugService,
|
||||
IWindowManager windowManager,
|
||||
IScriptVmFactory scriptVmFactory,
|
||||
ISidebarVmFactory sidebarVmFactory)
|
||||
{
|
||||
_profileEditorService = profileEditorService;
|
||||
@@ -55,6 +59,8 @@ namespace Artemis.UI.Screens.ProfileEditor
|
||||
_settingsService = settingsService;
|
||||
_messageService = messageService;
|
||||
_debugService = debugService;
|
||||
_windowManager = windowManager;
|
||||
_scriptVmFactory = scriptVmFactory;
|
||||
_sidebarVmFactory = sidebarVmFactory;
|
||||
|
||||
DisplayName = "Profile Editor";
|
||||
@@ -241,6 +247,22 @@ namespace Artemis.UI.Screens.ProfileEditor
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenProfileScripts()
|
||||
{
|
||||
_windowManager.ShowDialog(_scriptVmFactory.ScriptsDialogViewModel(ProfileConfiguration.Profile));
|
||||
}
|
||||
|
||||
public void OpenLayerScripts()
|
||||
{
|
||||
if (_profileEditorService.SelectedProfileElement is Layer layer)
|
||||
_windowManager.ShowDialog(_scriptVmFactory.ScriptsDialogViewModel(layer));
|
||||
}
|
||||
|
||||
public void OpenLayerPropertyScripts()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OpenDebugger()
|
||||
{
|
||||
_debugService.ShowDebugger();
|
||||
@@ -286,6 +308,7 @@ namespace Artemis.UI.Screens.ProfileEditor
|
||||
{
|
||||
NotifyOfPropertyChange(nameof(HasSelectedElement));
|
||||
}
|
||||
|
||||
private void LoadWorkspaceSettings()
|
||||
{
|
||||
SidePanelsWidth = _settingsService.GetSetting("ProfileEditor.SidePanelsWidth", new GridLength(385));
|
||||
|
||||
Reference in new issue
Block a user