Skip to content

Commit

Permalink
Add show filter to nvidia ar move filter settings
Browse files Browse the repository at this point in the history
  • Loading branch information
exeldro committed Jan 25, 2024
1 parent 6819d23 commit ea9442c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 22 deletions.
20 changes: 1 addition & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -292,20 +292,6 @@ jobs:
with:
name: 'installer-files'
path: .
- name: Create Code Signing Certificate
if: success() && github.event_name != 'pull_request'
run: |
New-Item -ItemType directory -Path certificate
Set-Content -Path certificate\certificate.txt -Value '${{ secrets.CERTIFICATE }}'
certutil -decode certificate\certificate.txt certificate\certificate.pfx
- name: Code Sign 32
if: success() && github.event_name != 'pull_request'
run: |
& 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.20348.0/x86/signtool.exe' sign /f certificate\certificate.pfx /p '${{ secrets.CERTIFICATE_PASS }}' /t http://timestamp.comodoca.com/authenticode .\package\obs-plugins\32bit\${{ env.PLUGIN_NAME }}.dll
- name: Code Sign 64
if: success() && github.event_name != 'pull_request'
run: |
& 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.20348.0/x64/signtool.exe' sign /f certificate\certificate.pfx /p '${{ secrets.CERTIFICATE_PASS }}' /t http://timestamp.comodoca.com/authenticode .\package\obs-plugins\64bit\${{ env.PLUGIN_NAME }}.dll
- name: Publish zip
if: success()
uses: actions/upload-artifact@v3.1.1
Expand All @@ -319,10 +305,6 @@ jobs:
- name: "Package Installer (Compile)"
run: |
& 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe' /Qp ".\installer.iss"
- name: Code Sign Installer
if: success() && github.event_name != 'pull_request'
run: |
& 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.20348.0/x64/signtool.exe' sign /f certificate\certificate.pfx /p '${{ secrets.CERTIFICATE_PASS }}' /t http://timestamp.comodoca.com/authenticode .\package\${{ env.PLUGIN_NAME }}-installer.exe
- name: Publish installer
if: success()
uses: actions/upload-artifact@v3.1.1
Expand All @@ -332,4 +314,4 @@ jobs:
- name: Remove temp artifacts
uses: geekyeggo/delete-artifact@v2.0.0
with:
name: "${{ env.FILE_NAME_X86 }}\n${{ env.FILE_NAME_X64 }}\ninstaller-files"
name: "${{ env.FILE_NAME_X86 }}\n${{ env.FILE_NAME_X64 }}"
1 change: 1 addition & 0 deletions data/locale/en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ StopTrigger="Stop Trigger"
StopTrigger.None="None: stop only when the move is done or this filter is disabled"
Actions="Actions"
Action="Action"
Show="Show"
SimultaneousMove="Simultaneous Move"
SimultaneousMove.None="None"
NextMove="Next Move"
Expand Down
38 changes: 35 additions & 3 deletions nvidia-move-filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1453,12 +1453,37 @@ bool nv_move_actions_changed(void *priv, obs_properties_t *props,
struct dstr name = {0};
long long actions = obs_data_get_int(settings, "actions");
bool changed = false;
obs_property_t *show = obs_properties_get(props, "show");
long long f = obs_data_get_int(settings, "show");
for (long long i = 1; i <= MAX_ACTIONS; i++) {
dstr_printf(&name, "action_%lld_group", i);
obs_property_t *group = obs_properties_get(props, name.array);
if (obs_property_visible(group) == (i <= actions))

if (i > actions) {
obs_property_list_item_remove(show, (size_t)i);
} else {
const char *od =
obs_property_list_item_name(show, (size_t)i);
dstr_printf(&name, "action_%lld_description", i);
const char *nd =
obs_data_get_string(settings, name.array);
if (strlen(nd)) {
dstr_copy(&name, nd);
} else {
dstr_printf(&name, "%s %lld",
obs_module_text("Action"), i);
}
if (!od || strcmp(od, name.array) != 0) {
obs_property_list_item_remove(show, (size_t)i);
obs_property_list_insert_int(show, (size_t)i,
name.array, i);
changed = true;
}
}
bool visible = (i <= actions) && (f > 0 ? i == f : true);
if (obs_property_visible(group) == visible)
continue;
obs_property_set_visible(group, i <= actions);
obs_property_set_visible(group, visible);
changed = true;
}
dstr_free(&name);
Expand Down Expand Up @@ -1858,7 +1883,7 @@ static obs_properties_t *nv_move_properties(void *data)
struct nvidia_move_info *filter = (struct nvidia_move_info *)data;
obs_properties_t *props = obs_properties_create();

if (filter->last_error) {
if (filter && filter->last_error) {
obs_property_text_set_info_type(
obs_properties_add_text(props, "last_error",
filter->last_error,
Expand All @@ -1872,6 +1897,13 @@ static obs_properties_t *nv_move_properties(void *data)

obs_property_set_modified_callback2(p, nv_move_actions_changed, data);

p = obs_properties_add_list(props, "show", obs_module_text("Show"),
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);

obs_property_list_add_int(p, obs_module_text("All"), 0);

obs_property_set_modified_callback2(p, nv_move_actions_changed, data);

struct dstr name = {0};
struct dstr description = {0};
for (long long i = 1; i <= MAX_ACTIONS; i++) {
Expand Down

0 comments on commit ea9442c

Please sign in to comment.