Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow script actions to use window for parameter selection #176

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Starkku
Copy link
Contributor

@Starkku Starkku commented Jun 11, 2024

Pretty much what it says in the title, allows setting UseWindowSelection for script actions in ScriptActions.ini to use a selector window for the preset options (OptionN) key. Particularly useful (and needed) for certain Phobos script actions that use a list of values that far exceeds what the context menu can show.

A different button is displayed for opening the window on script actions that use it, from the one that opens the context menu.

Comment on lines 25 to +28
$CC21=btnEditorPresetValues:MenuButton
$CC22=lblActionDescription:XNALabel
$CC23=panelActionDescription:EditorPanel
$CC24=btnEditorPresetValuesWindow:EditorButton
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$CC21=btnEditorPresetValues:MenuButton
$CC22=lblActionDescription:XNALabel
$CC23=panelActionDescription:EditorPanel
$CC24=btnEditorPresetValuesWindow:EditorButton
$CC21=btnEditorPresetValues:MenuButton
$CC22=btnEditorPresetValuesWindow:EditorButton
$CC23=lblActionDescription:XNALabel
$CC24=panelActionDescription:EditorPanel

Since this exists visually in the same space as btnEditorPresetValues, and the [btnEditorPresetValuesWindow] section has been placed under the [btnEditorPresetValues] section, it would be logical for this to also be defined right below btnEditorPresetValues in the list.

Comment on lines +231 to +235
if (editedScript == null)
return;

if (lbActions.SelectedItem == null)
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (editedScript == null)
return;
if (lbActions.SelectedItem == null)
return;
if (editedScript == null || lbActions.SelectedItem == null)
return;

Comment on lines +47 to +48
if (presetOption.Color != null)
item.TextColor = (Color)presetOption.Color;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (presetOption.Color != null)
item.TextColor = (Color)presetOption.Color;
if (presetOption.Color.HasValue)
item.TextColor = presetOption.Color.Value;

Not really a complaint, I just prefer this syntax when working with nullable value types.

{
public int Value;
public string Text;
public Color? Color;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can see, there is currently no way to actually assign this a value? The INI parsing code for preset options is unchanged.

Comment on lines +15 to +17
public ScriptActionPresetOption()
{
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I'm missing something, this constructor is never used, so it can be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants