mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Scripting - Enabled scripting (#638)
* Scripting - Simplified view model structure * Scripting - Removed Layer and LayerProperty scripts
This commit is contained in:
1 parent
ee16d69fb3
commit
631d8de2c3
26 files changed
+278
-578
No files matched your search
@@ -234,7 +234,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties
|
||||
NotifyOfPropertyChange(nameof(TimeCaretPosition));
|
||||
}
|
||||
|
||||
private void ProfileEditorServiceOnSuspendEditingChanged(object? sender, EventArgs e)
|
||||
private void ProfileEditorServiceOnSuspendEditingChanged(object sender, EventArgs e)
|
||||
{
|
||||
NotifyOfPropertyChange(nameof(SuspendedEditing));
|
||||
}
|
||||
|
||||
@@ -65,6 +65,9 @@
|
||||
<MenuItem Header="View Properties"
|
||||
Icon="{materialDesign:PackIcon Kind=Settings}"
|
||||
Command="{s:Action ViewProperties}"/>
|
||||
<MenuItem Header="_View Scripts"
|
||||
Icon="{materialDesign:PackIcon Kind=BookEdit}"
|
||||
Command="{s:Action ViewScripts}"/>
|
||||
<MenuItem Header="Adapt Profile"
|
||||
Icon="{materialDesign:PackIcon Kind=Magic}"
|
||||
Command="{s:Action AdaptProfile}"/>
|
||||
@@ -110,19 +113,6 @@
|
||||
IsChecked="{Binding StopOnFocusLoss.Value}"
|
||||
InputGestureText="Shift+F5" />
|
||||
</MenuItem>
|
||||
<MenuItem Header="_Scripting" IsEnabled="False">
|
||||
<MenuItem Header="_Profile Scripts"
|
||||
Icon="{materialDesign:PackIcon Kind=BookEdit}"
|
||||
Command="{s:Action OpenProfileScripts}"/>
|
||||
<MenuItem Header="_Layer Scripts"
|
||||
Icon="{materialDesign:PackIcon Kind=Layers}"
|
||||
IsEnabled="{Binding HasSelectedElement}"
|
||||
Command="{s:Action OpenLayerScripts}"/>
|
||||
<MenuItem Header="_Property Scripts"
|
||||
Icon="{materialDesign:PackIcon Kind=FormTextbox}"
|
||||
IsEnabled="{Binding HasSelectedElement}"
|
||||
Command="{s:Action OpenLayerPropertyScripts}"/>
|
||||
</MenuItem>
|
||||
<MenuItem Header="_Options">
|
||||
<MenuItem Header="Focus Selected Layer"
|
||||
ToolTip="If enabled, displays only the layer you currently have selected"
|
||||
|
||||
@@ -249,6 +249,11 @@ namespace Artemis.UI.Screens.ProfileEditor
|
||||
await _sidebarVmFactory.SidebarProfileConfigurationViewModel(_profileEditorService.SelectedProfileConfiguration).ViewProperties();
|
||||
}
|
||||
|
||||
public void ViewScripts()
|
||||
{
|
||||
_windowManager.ShowWindow(_scriptVmFactory.ScriptsDialogViewModel(ProfileConfiguration.Profile));
|
||||
}
|
||||
|
||||
public async Task AdaptProfile()
|
||||
{
|
||||
if (_profileEditorService.SelectedProfileConfiguration?.Profile == null)
|
||||
@@ -304,22 +309,7 @@ namespace Artemis.UI.Screens.ProfileEditor
|
||||
_profileEditorService.PasteProfileElement(rootFolder, rootFolder.Children.Count);
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenProfileScripts()
|
||||
{
|
||||
_windowManager.ShowWindow(_scriptVmFactory.ScriptsDialogViewModel(ProfileConfiguration.Profile));
|
||||
}
|
||||
|
||||
public void OpenLayerScripts()
|
||||
{
|
||||
if (_profileEditorService.SelectedProfileElement is Layer layer)
|
||||
_windowManager.ShowWindow(_scriptVmFactory.ScriptsDialogViewModel(layer));
|
||||
}
|
||||
|
||||
public void OpenLayerPropertyScripts()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public void OpenDebugger()
|
||||
{
|
||||
_debugService.ShowDebugger();
|
||||
|
||||
@@ -391,7 +391,7 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization
|
||||
ActivateToolByIndex(2);
|
||||
}
|
||||
|
||||
private void ProfileEditorServiceOnSuspendEditingChanged(object? sender, EventArgs e)
|
||||
private void ProfileEditorServiceOnSuspendEditingChanged(object sender, EventArgs e)
|
||||
{
|
||||
NotifyOfPropertyChange(nameof(SuspendedEditing));
|
||||
UpdateCanSelectEditTool();
|
||||
|
||||
Reference in new issue
Block a user