Compare commits
18 commits
release
...
feature/au
Author | SHA1 | Date | |
---|---|---|---|
001ddbb992 | |||
|
91665c92d1 | ||
fb5533dab9 | |||
dbfe38dd4d | |||
cf17e985ff | |||
c1abfe5453 | |||
cf3d34389d | |||
7d7cfcb11c | |||
26f4dfa864 | |||
196e2c43b5 | |||
6b0bfdd5ee | |||
9fff380502 | |||
128b976869 | |||
45430d50a1 | |||
|
2212d661be | ||
|
e2e308b353 | ||
|
af9dafddc8 | ||
|
b18e74e672 |
17 changed files with 99 additions and 28 deletions
20
.github/workflows/auto-pull-request.yaml
vendored
Normal file
20
.github/workflows/auto-pull-request.yaml
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
name: Pull Request on Branch Push
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- develop
|
||||
- release
|
||||
|
||||
jobs:
|
||||
auto-pull-request:
|
||||
name: Open pull request
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: pull-request-action
|
||||
uses: vsoch/pull-request-action@1.0.19
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PULL_REQUEST_BRANCH: "develop"
|
||||
PULL_REQUEST_DRAFT: true
|
||||
PASS_IF_EXISTS: true
|
3
.github/workflows/create-release.yaml
vendored
3
.github/workflows/create-release.yaml
vendored
|
@ -44,6 +44,7 @@ jobs:
|
|||
- name: Draft release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
artifacts: "VoiceAttack-Framework/bin/Release/alterNERDtive.YAVAPF.*nupkg"
|
||||
artifacts: "VoiceAttack-Framework/bin/Release/alterNERDtive.YAVAPF.*nupkg,VoiceAttack-Framework/bin/Release/net48/VoiceAttack-Framework.*"
|
||||
bodyFile: "CHANGELOG.md"
|
||||
draft: true
|
||||
token: ${{ secrets.RELEASE_TOKEN }}
|
||||
|
|
16
.github/workflows/mark-issues-done.yaml
vendored
Normal file
16
.github/workflows/mark-issues-done.yaml
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
name: Update issues on PR close
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- closed
|
||||
|
||||
jobs:
|
||||
run:
|
||||
name: "Mark issues done"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Update Labels
|
||||
uses: RebeccaStevens/issue-closed-labeler-action@latest
|
||||
with:
|
||||
rules: '[{"add": "Done"}]'
|
13
CHANGELOG.md
13
CHANGELOG.md
|
@ -1,3 +1,14 @@
|
|||
# 0.1.0 (2022-07-11)
|
||||
# devel
|
||||
|
||||
## Added
|
||||
|
||||
* [Commands interface](https://alternerdtive.github.io/YAVAPF/commands/).
|
||||
* Optionally suppress the race condition warning on [setting command scoped
|
||||
variables from the cached proxy
|
||||
object](https://alternerdtive.github.io/YAVAPF/variables/#using-proxy-methods-vs-using-plugin-methods).
|
||||
|
||||
-----
|
||||
|
||||
# 0.1.0 (2022-07-11)
|
||||
|
||||
initial release
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
// along with YAVAPF. If not, see <https://www.gnu.org/licenses/>.
|
||||
// </copyright>
|
||||
|
||||
using System;
|
||||
|
||||
using alterNERDtive.Yavapf;
|
||||
using VoiceAttack;
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsPublishable>False</IsPublishable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -18,6 +20,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="VoiceAttack">
|
||||
<HintPath>C:\Program Files\VoiceAttack\VoiceAttack.exe</HintPath>
|
||||
<Private>False</Private>
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
// along with YAVAPF. If not, see <https://www.gnu.org/licenses/>.
|
||||
// </copyright>
|
||||
|
||||
using System;
|
||||
|
||||
using alterNERDtive.Yavapf;
|
||||
|
||||
namespace alterNERDtive.Example
|
||||
|
|
|
@ -17,9 +17,6 @@ the inner workings of VoiceAttack as possible.
|
|||
You can find [comprehensive documentation on Github
|
||||
Pages](https://alterNERDtive.github.io/YAVAPF).
|
||||
|
||||
Or at least you will once this is in a presentable state and I have actually
|
||||
written the documentation :)
|
||||
|
||||
There is also an [example plugin on
|
||||
Github](https://github.com/alterNERDtive/YAVAPF/tree/release/ExamplePlugin).
|
||||
|
||||
|
|
2
StyleCop.ruleset
Normal file
2
StyleCop.ruleset
Normal file
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RuleSet Name="StyleCop.Analyzers rules with default action" Description="StyleCop.Analyzers with default action. Rules with IsEnabledByDefault = false are disabled." ToolsVersion="17.0" />
|
|
@ -10,9 +10,9 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
|
|
|
@ -18,6 +18,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
|||
README.md = README.md
|
||||
requirements.txt = requirements.txt
|
||||
stylecop.json = stylecop.json
|
||||
StyleCop.ruleset = StyleCop.ruleset
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{1BE45F7D-E6DE-49D2-A906-5CC9CD49B639}"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<TargetFrameworks>net48</TargetFrameworks>
|
||||
<RootNamespace>alterNERDtive.Yavapf</RootNamespace>
|
||||
<PackageId>alterNERDtive.YAVAPF</PackageId>
|
||||
<Version>0.1.0</Version>
|
||||
<Version>0.2.0</Version>
|
||||
<Company>alterNERDtive</Company>
|
||||
<Authors>alterNERDtive</Authors>
|
||||
<Description>YAVAPF is yet another VoiceAttack plugin framework.</Description>
|
||||
|
@ -18,7 +18,7 @@
|
|||
<PackageTags>VoiceAttack;plugin;framework</PackageTags>
|
||||
<NeutralLanguage>en</NeutralLanguage>
|
||||
<Nullable>enable</Nullable>
|
||||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||
<Title>Yet Another VoiceAttack Plugin Framework</Title>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
|
||||
|
@ -26,6 +26,8 @@
|
|||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -41,6 +43,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="VoiceAttack">
|
||||
<HintPath>C:\Program Files\VoiceAttack\VoiceAttack.exe</HintPath>
|
||||
<Private>False</Private>
|
||||
|
|
|
@ -17,9 +17,6 @@
|
|||
// along with YAVAPF. If not, see <https://www.gnu.org/licenses/>.
|
||||
// </copyright>
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using VoiceAttack;
|
||||
|
||||
namespace alterNERDtive.Yavapf
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
// along with YAVAPF. If not, see <https://www.gnu.org/licenses/>.
|
||||
// </copyright>
|
||||
|
||||
using System;
|
||||
|
||||
using VoiceAttack;
|
||||
|
||||
namespace alterNERDtive.Yavapf
|
||||
|
|
|
@ -17,10 +17,6 @@
|
|||
// along with YAVAPF. If not, see <https://www.gnu.org/licenses/>.
|
||||
// </copyright>
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
|
@ -139,11 +135,13 @@ namespace alterNERDtive.Yavapf
|
|||
/// </summary>
|
||||
/// <typeparam name="T">The type of the variable.</typeparam>
|
||||
/// <param name="name">The name of the variable.</param>
|
||||
/// <param name="suppressWarning">Whether to suppress the race condition
|
||||
/// warning on accessing command scoped variables.</param>
|
||||
/// <returns>The value of the variable. Can be null.</returns>
|
||||
/// <exception cref="InvalidDataException">Thrown when the variable is of an invalid type.</exception>
|
||||
protected T? Get<T>(string name)
|
||||
protected T? Get<T>(string name, bool suppressWarning = false)
|
||||
{
|
||||
if (name.StartsWith("~"))
|
||||
if (name.StartsWith("~") && !suppressWarning)
|
||||
{
|
||||
this.Log.Warn(
|
||||
$"Accessing command scoped variable '{name}' outside of its context proxy object. This might lead to race conditions.");
|
||||
|
@ -161,10 +159,12 @@ namespace alterNERDtive.Yavapf
|
|||
/// <typeparam name="T">The type of the variable.</typeparam>
|
||||
/// <param name="name">The name of the variable.</param>
|
||||
/// <param name="value">The value of the variable. Can not be null.</param>
|
||||
/// <param name="suppressWarning">Whether to suppress the race condition
|
||||
/// warning on accessing command scoped variables.</param>
|
||||
/// <exception cref="InvalidDataException">Thrown when the variable is of an invalid type.</exception>
|
||||
protected void Set<T>(string name, T? value)
|
||||
protected void Set<T>(string name, T? value, bool suppressWarning = false)
|
||||
{
|
||||
if (name.StartsWith("~"))
|
||||
if (name.StartsWith("~") && !suppressWarning)
|
||||
{
|
||||
this.Log.Warn(
|
||||
$"Accessing command scoped variable '{name}' outside of its context proxy object. This might lead to race conditions.");
|
||||
|
@ -181,10 +181,12 @@ namespace alterNERDtive.Yavapf
|
|||
/// </summary>
|
||||
/// <typeparam name="T">The type of the variable.</typeparam>
|
||||
/// <param name="name">The name of the variable.</param>
|
||||
/// <param name="suppressWarning">Whether to suppress the race condition
|
||||
/// warning on accessing command scoped variables.</param>
|
||||
/// <exception cref="InvalidDataException">Thrown when the variable is of an invalid type.</exception>
|
||||
protected void Unset<T>(string name)
|
||||
protected void Unset<T>(string name, bool suppressWarning = false)
|
||||
{
|
||||
if (name.StartsWith("~"))
|
||||
if (name.StartsWith("~") && !suppressWarning)
|
||||
{
|
||||
this.Log.Warn(
|
||||
$"Accessing command scoped variable '{name}' outside of its context proxy object. This might lead to race conditions.");
|
||||
|
|
|
@ -23,10 +23,21 @@ Github](https://github.com/alterNERDtive/YAVAPF/tree/release/ExamplePlugin).
|
|||
* [x] Handlers for variable changed events
|
||||
* [x] Logging to the VoiceAttack event log
|
||||
* [ ] Logging to a log file
|
||||
* [ ] separate full debug log
|
||||
* [ ] Wrapper for executing commands
|
||||
* [ ] Plugin options, separate from handling “normal” variables
|
||||
* [ ] default values
|
||||
* [ ] descriptions
|
||||
* [ ] auto save / load between VoiceAttack runs¹
|
||||
* [ ] profile specific
|
||||
* [ ] global
|
||||
* [ ] bootstrapping voice commands for changing options
|
||||
* [ ] GUI support
|
||||
* [ ] Miscellaneous VoiceAttack proxy functionality
|
||||
* [ ] Full unit test coverage 😬
|
||||
|
||||
¹ Will probably require changes in VoiceAttack that I have already requested.
|
||||
|
||||
## Need Help / Want to Contribute?
|
||||
|
||||
Have a look at [the FAQ](faq.md). If your problem persists, please [file an
|
||||
|
|
|
@ -93,6 +93,19 @@ private static void TestContext(VoiceAttackInvokeProxyClass vaProxy)
|
|||
}
|
||||
```
|
||||
|
||||
This will log a warning to the VoiceAttack event log.
|
||||
|
||||
You can, if you are sure that you will _not_ run into a race condition, suppress
|
||||
said warning:
|
||||
|
||||
```csharp
|
||||
[Context("test")]
|
||||
private static void TestContext(VoiceAttackInvokeProxyClass vaProxy)
|
||||
{
|
||||
string test = Plugin.Get<string>("~test", suppressWarning: true);
|
||||
}
|
||||
```
|
||||
|
||||
## Getting Variable Values
|
||||
|
||||
To get the value of a variable, invoke the `Get<T>(string name)` method of your
|
||||
|
|
Loading…
Reference in a new issue