Compare commits
64 commits
releases/4
...
release
Author | SHA1 | Date | |
---|---|---|---|
f034ae4220 | |||
d97499778c | |||
d78cf17b6b | |||
0d44828422 | |||
022c3ac25c | |||
fd0bbaa3a9 | |||
cc2694fc49 | |||
9db6785ef1 | |||
1135efd761 | |||
7c361e9bf7 | |||
54cd1e6fa2 | |||
3775d3f911 | |||
|
1357bde807 | ||
db85c2b793 | |||
4f9e4799bf | |||
5af0aff95c | |||
e2789623cd | |||
c615af5324 | |||
|
4e9a9b4517 | ||
|
38ea143ea7 | ||
|
0ee7701590 | ||
|
05a56d5d85 | ||
|
2ec9c2afbe | ||
|
3cbfe62ae1 | ||
|
9cc9965d7c | ||
acf43b42a0 | |||
55fa3579cf | |||
d1af3ebdcc | |||
b10e2bb2c4 | |||
91c47efbef | |||
1cdd9c98bd | |||
35c26e930f | |||
bb8d1067b5 | |||
6ec8d7c35e | |||
55f10a1117 | |||
35057b3f35 | |||
a2f6cc864c | |||
9beb6dfa41 | |||
2dae2abc4c | |||
99305cfb5d | |||
bc5addd22a | |||
64a096dae7 | |||
33a4fb8e3d | |||
3cbca1e542 | |||
55a031686c | |||
02a401a047 | |||
e36358be9f | |||
999d2b6883 | |||
e73b8c04f9 | |||
931ee4c4e7 | |||
751f80461f | |||
c9d39f6cc7 | |||
f8dd1ff464 | |||
f7328e31e2 | |||
2b0d2245e2 | |||
dc42912cbe | |||
b3ad1ae799 | |||
5421478d6e | |||
d771d0b403 | |||
b371523910 | |||
8572d0ec4c | |||
c00c1d9bbe | |||
3c46b20a23 | |||
1d6ee3953e |
56 changed files with 3041 additions and 1720 deletions
|
@ -1,4 +1,4 @@
|
|||
[*]
|
||||
[*]
|
||||
guidelines = 80
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
|
@ -6,3 +6,9 @@ charset = utf-8-bom
|
|||
|
||||
[*.cs]
|
||||
guidelines = 80, 120
|
||||
|
||||
# IDE0021: Use block body for constructors
|
||||
csharp_style_expression_bodied_constructors = when_on_single_line
|
||||
|
||||
# IDE0024: Use block body for operators
|
||||
csharp_style_expression_bodied_operators = when_on_single_line
|
||||
|
|
2
.github/FUNDING.yml
vendored
Normal file
2
.github/FUNDING.yml
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
github: alterNERDtive
|
||||
ko_fi: alterNERDtive
|
12
.github/dependabot.yaml
vendored
Normal file
12
.github/dependabot.yaml
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "nuget"
|
||||
directory: "/"
|
||||
target-branch: "develop"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
target-branch: "develop"
|
||||
schedule:
|
||||
interval: "daily"
|
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:
|
||||
- devel
|
||||
- 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: "devel"
|
||||
PULL_REQUEST_DRAFT: true
|
||||
PASS_IF_EXISTS: true
|
23
.github/workflows/create-release.yaml
vendored
Normal file
23
.github/workflows/create-release.yaml
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
name: Create release on tag push
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'releases/*.*'
|
||||
- 'releases/*.*.*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Create draft release
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Draft release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
bodyFile: "CHANGELOG.md"
|
||||
draft: true
|
||||
token: ${{ secrets.RELEASE_TOKEN }}
|
22
.github/workflows/gh-pages.yaml
vendored
Normal file
22
.github/workflows/gh-pages.yaml
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
name: Deploy github pages on tag push
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'release/*.*'
|
||||
- 'release/*.*.*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Deploy documentation
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Deploy docs
|
||||
uses: mhausenblas/mkdocs-deploy-gh-pages@nomaterial
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
REQUIREMENTS: requirements.txt
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -358,3 +358,4 @@ MigrationBackup/
|
|||
/Makefile
|
||||
/site
|
||||
/src
|
||||
/build.csproj
|
||||
|
|
97
CHANGELOG.md
97
CHANGELOG.md
|
@ -1,4 +1,94 @@
|
|||
# 4.3 (2022-05-19)
|
||||
# 4.5 (2022-09-19)
|
||||
|
||||
This might very well be the last release of this. With how the “Horizons 4.0”
|
||||
launch went, Frontier’s communication around it, and just _how_ horrible 4.0 is,
|
||||
I currently do not see me being motivated to actually port stuff to 4.0. And,
|
||||
let’s face it, 3.8 will go EoL eventually.
|
||||
|
||||
Anyway, I still have some programming pet projects around this stuff that I
|
||||
might continue with and adapt this for, so I might sneak some fixes / updates
|
||||
in, and I’m not going to say never because who knows how I’ll feel about this in
|
||||
the future. Obviously there’s also still the option to _pay_ me to do stuff =p
|
||||
|
||||
### Fixed
|
||||
|
||||
* Race condition in all plugins that might lead to commands using command-scoped
|
||||
variables (`~<name>`) not working as intended. This was introduced in
|
||||
refactoring work that was done for 4.4.
|
||||
* Documentation proof read and fixed by @ACyprus. Thanks!
|
||||
|
||||
### Changed
|
||||
|
||||
* Some behind the scenes things regarding how builds work. This will make it
|
||||
possible to build this entirely on Github (= less potential for human error)
|
||||
once I have dealt with #62 (see #143 as well).
|
||||
|
||||
## EliteAttack 8.5
|
||||
|
||||
### Added
|
||||
|
||||
* `target nearest […]` commands now log the result (with log level “INFO”).
|
||||
* `include outdated settlements` option: Include Odyssey settlements in the
|
||||
outdated stations list. Default: true.
|
||||
|
||||
### Fixed
|
||||
|
||||
* `Docked` event now handles Odyssey settlements properly (they have no hangar).
|
||||
(#145)
|
||||
* Fixed potential race condition with the discovery scan event command queue.
|
||||
Might have an impact on #64.
|
||||
|
||||
## RatAttack 6.4
|
||||
|
||||
### Fixed
|
||||
|
||||
* Support for new Horizons 3 / Horizons 4 / Odyssey RATSIGNALs. (#159)
|
||||
* Made case list thread safe. Probably only ever impacted my own specific setup,
|
||||
but still a huge 🤦.
|
||||
* Apparently `^` can be part of both CMDR names and IRC nicks (fixed RATSIGNAL
|
||||
regex).
|
||||
|
||||
-----
|
||||
|
||||
# 4.4 (2022-05-31)
|
||||
|
||||
### Added
|
||||
|
||||
* The Configuration GUI now has an “Apply” button.
|
||||
|
||||
### Fixed
|
||||
|
||||
* Configuration GUI now `.Activate()`s immediately to prevent it from hiding
|
||||
behind other windows.
|
||||
|
||||
## EliteAttack 8.4
|
||||
|
||||
### Added
|
||||
|
||||
* `auto retract landing gear` setting: Automatically retract landing gear when
|
||||
lifting off a planet / undocking from a station. Default: true. (#133)
|
||||
* `auto disable s r v lights` setting: Automatically turn SRV lights off when
|
||||
deploying one. Default: true. (#133)
|
||||
|
||||
### Fixed
|
||||
|
||||
* `auto enter station services` option. (#142)
|
||||
|
||||
## RatAttack 6.3.1
|
||||
|
||||
* Added error message to the CLI tool for running VoiceAttack with elevated
|
||||
privileges which will cause an `UnAuthorizedAccessException` trying to
|
||||
communicate with the plugin. (#138)
|
||||
* Added warning to VoiceAttack when running it with elevated privileges. (#138)
|
||||
|
||||
## SpashAttack 7.2.2
|
||||
|
||||
* Fixed getting current jump range from EDDI; no longer fails on the first try,
|
||||
no longer sometimes reports the last requested range instead of current.
|
||||
|
||||
-----
|
||||
|
||||
# 4.3 (2022-05-19)
|
||||
|
||||
**NOTE**: Further development is on hold and Odyssey compatibility will not be
|
||||
worked on for the time being. See [the corresponding issue on
|
||||
|
@ -52,7 +142,7 @@ the job.
|
|||
|
||||
### Added
|
||||
|
||||
* Now gives feedback after asking for call confirmation: “Call aborted.”
|
||||
* Now gives feedback after asking for call confirmation: “Call aborted.” /
|
||||
“Calling <…>.”.
|
||||
* `auto copy rat case system` setting: Automatically copy the client’s system to
|
||||
the clipboard when you open a rat case. Default: true.
|
||||
|
@ -1045,8 +1135,7 @@ up to date in EDDN.
|
|||
* Added `open [rat;] dispatch board` command. Opens the web dispatch board in
|
||||
your default browser.
|
||||
* Added proper handling for multiple ratsignals hitting at once. That’s mainly
|
||||
an IRC client config thing,
|
||||
[see the docs](docs/RatAttack.md#getting-case-data-from-irc).
|
||||
an IRC client config thing, [see the docs](docs/configuration/RatAttack.md).
|
||||
* Renamed `RatAttack.getInfoFromRatsignal` to
|
||||
`RatAttack.announceCaseFromRatsignal`. Removed the “open case?” voice input
|
||||
prompt.
|
||||
|
|
25
Directory.build.props
Normal file
25
Directory.build.props
Normal file
|
@ -0,0 +1,25 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<LangVersion>10.0</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
<!-- StyleCop Analyzers configuration -->
|
||||
<PropertyGroup>
|
||||
<CodeAnalysisRuleSet>$(SolutionDir)StyleCop.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="StyleCop.Analyzers.Error" Version="1.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="StyleCop.CSharp.Async.Rules" Version="6.1.41">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<AdditionalFiles Include="$(SolutionDir)stylecop.json" Link="stylecop.json" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -37,3 +37,6 @@ issue](https://github.com/alterNERDtive/VoiceAttack-profiles/issues). Thanks! :)
|
|||
|
||||
You can also [say “Hi” on Discord](https://discord.gg/kXtXm54) if that is your
|
||||
thing.
|
||||
|
||||
[![GitHub Sponsors](https://img.shields.io/github/sponsors/alterNERDtive?style=for-the-badge)](https://github.com/sponsors/alterNERDtive)
|
||||
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/S6S1DLYBS)
|
||||
|
|
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" />
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
4.3
|
||||
4.5
|
||||
|
|
|
@ -35,7 +35,7 @@ the edit window ready to send. They will _not_ hit Enter on their own.
|
|||
|
||||
## Navigation
|
||||
|
||||
There are so many navigation-focused commands now, they deserve there own
|
||||
There are so many navigation-focused commands now, they deserve their own
|
||||
category. Basically anything that helps you plot anywhere. A lot of those are
|
||||
powered by awesome EDDI so I don’t have to do the work myself!
|
||||
|
||||
|
@ -72,10 +72,9 @@ Basically anything that is related to directly doing something with your ship.
|
|||
* `[close;deploy;extend;open;retract;] [cargo scoop;hard points; landing gear] [up;down;]`:
|
||||
Overly complicated command to handle everything related to Cargo Scoop, Hard
|
||||
Points, Landing Gear. You get the gist, I guess. Works in SRV too.
|
||||
* `[dis;]engage silent running`: Handles silent running.
|
||||
* `[disco;discovery scan]`: Executes a discovery scan. Expects the Discovery
|
||||
Scanner in your first fire group, secondary fire. [You can change
|
||||
that](/configuration/EliteAttack/#settings).
|
||||
that](configuration/EliteAttack.md#settings).
|
||||
* `[dis;]engage silent running`: Turns silent running on and off.
|
||||
* `[head;spot;] lights [on;off]`: Turns your lights on and off. Works in SRV
|
||||
too, kinda; turning lights off there relies on the state updating fast enough,
|
||||
|
@ -96,7 +95,7 @@ Basically anything that is related to directly doing something with your ship.
|
|||
given “when ready” will wait for mass lock to clear and your FSD to cool down
|
||||
first.
|
||||
|
||||
## SRV controls
|
||||
## SRV Controls
|
||||
|
||||
Things relevant to your SRV, but not your ship.
|
||||
|
||||
|
@ -107,13 +106,12 @@ Things relevant to your SRV, but not your ship.
|
|||
|
||||
## Targeting
|
||||
|
||||
Well … targeting stuff, I guess. Not really sure why I made that it’s own
|
||||
Well … targeting stuff, I guess. Not really sure why I made that its own
|
||||
category, but oh well :)
|
||||
|
||||
* `target the [drive;drives;power plant;frame shift drive;f s d;shield
|
||||
generator]`:*
|
||||
Targets the given submodule on your current target, or your next target if you
|
||||
don’t have one currently. Does not persist between targets.
|
||||
generator]`: Targets the given submodule on your current target, or your next
|
||||
target if you don’t have one currently. Does not persist between targets.
|
||||
* `clear sub [module;system] target`: Clears the current submodule target.
|
||||
* `target next system`: Selects the next system on your route.
|
||||
* `target wing man [1;2;3]`: Targets your wingmen.
|
||||
|
@ -272,7 +270,7 @@ the (rough) range you still have on the fumes left in your tank.
|
|||
|
||||
### Material Threshold
|
||||
|
||||
Warns you when a monitored material falls below it’s minimum stock level and
|
||||
Warns you when a monitored material falls below its minimum stock level and
|
||||
tells you when you reach your desired level or fill up.
|
||||
|
||||
You will have to set minimum and desired amounts in EDDI’s material monitor
|
||||
|
@ -308,7 +306,7 @@ Reports on the synthesis type and quality.
|
|||
|
||||
### System Scan Complete
|
||||
|
||||
Lists you all bodies EDDI considers worth mapping in the current system.
|
||||
Lists all bodies EDDI considers worth mapping in the current system.
|
||||
|
||||
### Undocked
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ client or use the “General IRC Integration”, see below.
|
|||
login to the game or have to take off from your current
|
||||
station/port/outpost/planet.
|
||||
* `call jumps [left;]`: Calls jumps for the currently open case based on a
|
||||
neutron trip (requires Spanshattack) or a plotted ingame route.
|
||||
neutron trip (requires SpanshAttack) or a plotted ingame route.
|
||||
* `call friend [positive;negative] [in pg;in private group;in solo;in main menu;sysconf;system confirmed;]`:
|
||||
Friend request confirmations, with all the
|
||||
things you might want to / should call with it.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
# SpanshAttack
|
||||
|
||||
This profile uses the
|
||||
[ED-NeutronRouter](https://github.com/sc-pulgan/ED-NeutronRouter) plugin to plot
|
||||
neutron jumps using [spansh](https://spansh.co.uk/plotter). It fully does
|
||||
everything you need from within the game and VoiceAttack, you won’t have to
|
||||
visit the site at any point.
|
||||
[ED-NeutronRouter](https://github.com/sc-pulgan/ED-NeutronRouter) plugin to
|
||||
plot neutron jumps using [Spansh](https://spansh.co.uk/plotter). It does
|
||||
everything you need fully from within the game and VoiceAttack, you won’t have
|
||||
to visit the site at any point.
|
||||
|
||||
## Plotting a Route
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# StreamAttack
|
||||
# StreamAttack
|
||||
|
||||
This profile uses the [EDDI](https://github.com/EDCD/EDDI) plugin to write
|
||||
a bunch of information about your commander, your current location and your ship
|
||||
|
@ -23,6 +23,10 @@ Default folder is `%appdata%\StreamAttack\`.
|
|||
|
||||
### Elite
|
||||
|
||||
Please do note that information in the output files is only updated when a
|
||||
journal event that contains the information is detected. E.g. the distance to
|
||||
your jump target is not constantly calculated, but only updated after a jump.
|
||||
|
||||
#### Commander
|
||||
|
||||
* `Elite\cmdr\name`: The current commander’s name.
|
||||
|
|
|
@ -14,10 +14,14 @@ Toggles:
|
|||
true.
|
||||
* `auto restock`: Automatically restock after docking at a station. Default:
|
||||
true.
|
||||
* `auto move to hangar`: Automatically move the ship to the hanger after docking
|
||||
* `auto move to hangar`: Automatically move the ship to the hangar after docking
|
||||
at a station. Default: true.
|
||||
* `auto enter station services`: Automatically enter the Station Services menu
|
||||
after docking at a station. Default: true.
|
||||
* `auto retract landing gear`: Automatically retract landing gear when lifting
|
||||
off a planet / undocking from a station. Default: true. (#133)
|
||||
* `auto disable s r v lights`: Automatically turn SRV lights off when deploying
|
||||
one. Default: true. (#133)
|
||||
* `edsm system status`: Pull system data from EDSM and compare it
|
||||
against your discovery scan. Default: true.
|
||||
* `discovery scan on primary fire`: Use primary fire for honking instead of
|
||||
|
@ -33,6 +37,8 @@ Toggles:
|
|||
Ammonia Worlds that have not been mapped yet.) Default: true.
|
||||
* `outdated stations`: Announce stations with outdated data in the online
|
||||
databases. Default: true.
|
||||
* `include outdated settlements` option: Include Odyssey settlements in the
|
||||
outdated stations list. Default: true.
|
||||
* `repair reports`: Report on AFMU repairs. Default: true.
|
||||
* `road to riches`: Announce bodies worth scanning if you are looking for some
|
||||
starting cash on the Road to Riches. Default: false.
|
||||
|
|
|
@ -13,7 +13,7 @@ For any ships that you regularly use for neutron jumping, e.g. long range Fuel
|
|||
Rat ships, I recommend telling SpanshAttack about the range they are supposed to
|
||||
have with full fuel and your preferred amount of cargo/limpets.
|
||||
|
||||
In oder to do that, copy the `SpanshAttack.getShipRange` command from
|
||||
In order to do that, copy the `SpanshAttack.getShipRange` command from
|
||||
SpanshAttack or the example profile to your custom profile and add your ships.
|
||||
Any ship listed in there will automatically have its jump range used instead of
|
||||
EDDI’s reported laden range or VoiceAttack prompting you to manually supply it.
|
||||
|
|
|
@ -7,8 +7,8 @@ configuration is stored in a bunch of VoiceAttack variables which in turn are
|
|||
stored in your custom profile. You could even have different custom profiles
|
||||
with their own distinct settings.
|
||||
|
||||
The easiest way to change setings is to say `customize settings`. That will
|
||||
bring up a rudminteary settings UI.
|
||||
The easiest way to change settings is to say `customize settings`. That will
|
||||
bring up a rudimentary settings UI.
|
||||
|
||||
You change also change the configuration directly via voice commands:
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## Configuration
|
||||
|
||||
The base profile provides voice commands for changing the profiles settings.
|
||||
The base profile provides voice commands for changing the profiles’ settings.
|
||||
See [the configuration section](../configuration/general#settings).
|
||||
|
||||
## Chat
|
||||
|
@ -10,7 +10,7 @@ See [the configuration section](../configuration/general#settings).
|
|||
* `paste text`: Pastes the contents of your current clipboard. Note that this
|
||||
command is supposed to be used for pasting _into Elite_ and hence uses the
|
||||
configured paste key. If you’re using a non-standard layout that means that
|
||||
you can _not_ use this command to paste text into other applications.
|
||||
you _cannot_ use this command to paste text into other applications.
|
||||
|
||||
## Updating
|
||||
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
@ -8,9 +8,9 @@ Rats](https://fuelrats.com) and [Hull Seals](https://hullseals.space) work.
|
|||
**NOTE**: Further development is on hold and Odyssey compatibility will not be
|
||||
worked on for the time being. See [the corresponding issue on
|
||||
Github](https://github.com/alterNERDtive/VoiceAttack-profiles/issues/113). This
|
||||
might or might not change after the Horizons/Odyssey merge when console release
|
||||
is upon us. Feel free to file issues for anything that is broken on Odyssey and
|
||||
it will be worked on when it is worked on.
|
||||
might or might not change after the Horizons/Odyssey merge. Feel free to file
|
||||
issues for anything that is broken on Odyssey and it will be worked on when it
|
||||
is worked on.
|
||||
|
||||
## Available Profiles
|
||||
|
||||
|
@ -31,10 +31,13 @@ Well, you are in the right place. You can find comprehensive documentation right
|
|||
here.
|
||||
|
||||
If you run into any errors, please make sure you are running the latest version
|
||||
of the profiles and all requirements.
|
||||
of the profiles and all [requirements](requirements.md).
|
||||
|
||||
If your problem persists, please [file an
|
||||
issue](https://github.com/alterNERDtive/VoiceAttack-profiles/issues). Thanks! :)
|
||||
|
||||
You can also [say “Hi” on Discord](https://discord.gg/kXtXm54) if that is your
|
||||
thing.
|
||||
|
||||
[![GitHub Sponsors](https://img.shields.io/github/sponsors/alterNERDtive?style=for-the-badge)](https://github.com/sponsors/alterNERDtive)
|
||||
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/S6S1DLYBS)
|
||||
|
|
|
@ -7,9 +7,7 @@ version](https://voiceattack.com/#download-1) off the official site and install
|
|||
it.
|
||||
|
||||
If you are using the standalone version you should probably download the
|
||||
executable installer. If you are using the Steam version of VoiceAttack, you
|
||||
will have to download the zipped folder and replace your installed version with
|
||||
its contents.
|
||||
executable installer.
|
||||
|
||||
![[VoiceAttack-download.png]]
|
||||
|
||||
|
@ -55,12 +53,12 @@ hit `Enter`) and do
|
|||
```
|
||||
|
||||
If you have installed the non-Steam version of VoiceAttack to the default folder
|
||||
within “ProgramFiles” you will have to run the command prompt as admin (Windows
|
||||
within “Program Files” you will have to run the command prompt as admin (Windows
|
||||
key + `R`, enter “cmd”, hit `Control` + `Shift` + `Enter`).
|
||||
|
||||
## Install ED-NeutronRouter
|
||||
|
||||
[Grab the latest release release from
|
||||
Grab [the latest release release from
|
||||
Github](https://github.com/sc-pulgan/ED-NeutronRouter/releases/latest) (The
|
||||
`EDNeutronRouter.vX.YZ.zip` under “Assets”). You will have to extract the
|
||||
contents of the release .zip file to your VoiceAttack Apps folder:
|
||||
|
@ -99,7 +97,7 @@ the profiles that you want to change and add voice triggers or hotkeys.
|
|||
|
||||
You can either use an existing profile, create a new one or use the provided
|
||||
profile example as a basis. Regardless of which way you choose, make sure to
|
||||
read the [[#Include Profiles]] section and follow the instructions there!
|
||||
read the [Include Profiles](#include-profiles) section and follow the instructions there!
|
||||
|
||||
### Option 1: Create a New Profile Or Use an Existing One
|
||||
|
||||
|
@ -123,7 +121,7 @@ will now have to create the startup command. Hit the “New Command” button.
|
|||
![[VoiceAttack-edit-new-command.png]]
|
||||
|
||||
You can name it anything you want but I recommend calling it “startup” or
|
||||
similar, and to deactivate the “when i say”checkbox in the command options to
|
||||
similar, and to deactivate the “when I say” checkbox in the command options to
|
||||
make sure you do not accidentally run it via voice.
|
||||
|
||||
![[VoiceAttack-edit-startup.png]]
|
||||
|
@ -148,7 +146,7 @@ action. You do not have to set any configuration options, this can be done way
|
|||
more elegantly! More on this [later on](general.md#settings).
|
||||
|
||||
After adding the startup command you will have to right click VoiceAttack’s
|
||||
title bar and choose “Reload Active Profile” or restart VoiceAttack to it
|
||||
title bar and choose “Reload Active Profile” or restart VoiceAttack to see it
|
||||
executed for the first time.
|
||||
|
||||
### Option 2: Use the Profile Example
|
||||
|
@ -185,8 +183,8 @@ button.
|
|||
|
||||
![[VoiceAttack-profile-options-include.png]]
|
||||
|
||||
Add all my profiles (“alterNERDtive-base”, “EliteDangerous”, “RatAttack”,
|
||||
“SpanshAttack”,“StreamAttack”).
|
||||
Add all my profiles (“alterNERDtive-base”, “EliteAttack”, “RatAttack”,
|
||||
“SpanshAttack”, “StreamAttack”).
|
||||
|
||||
![[VoiceAttack-profile-options-includelist.png]]
|
||||
|
||||
|
@ -202,6 +200,14 @@ earlier.
|
|||
|
||||
![[VoiceAttack-profile-options-startup.png]]
|
||||
|
||||
## Reload the Profile
|
||||
|
||||
To make sure everything is loaded correctly, you now need to either reload the
|
||||
profile by right clicking on VoiceAttack’s title bar → “Reset Active Profile” or
|
||||
by simply restarting VoiceAttack.
|
||||
|
||||
You should see a bunch of initialization messages pop up in the VoiceAttack log.
|
||||
|
||||
## Set Elite Keyboard Binds
|
||||
|
||||
You need to have keyboard binds setup at least as secondary bindings in Elite’s
|
||||
|
|
|
@ -59,10 +59,11 @@ version is available.
|
|||
|
||||
## ED-NeutronRouter
|
||||
|
||||
(required for SpanshAttack)
|
||||
|
||||
[ED-NeutronRouter](https://github.com/sc-pulgan/ED-NeutronRouter) interfaces
|
||||
with [Spansh’s neutron plotter](https://spansh.uk/plotter) and makes the result
|
||||
available to VoiceAttack.
|
||||
|
||||
This plugin is _only_ required if you intend to use the SpanshAttack profile for
|
||||
neutron routing. Otherwise you do not have to install it.
|
||||
|
||||
This will also eventually be replaced by my own plugins.
|
||||
|
|
|
@ -89,3 +89,12 @@ EDDI does have a mechanism to detect if it is currently speaking – it sets a
|
|||
corresponding VoiceAttack variable. HCS neither does anything similar nor checks
|
||||
if EDDI is speaking to prevent conflicts. Refer to them if you want that
|
||||
changed.
|
||||
|
||||
## This does not work with Geforce Now
|
||||
|
||||
Nope. Just won’t. Geforce Now obviously has Elite’s files, journals and keybinds
|
||||
stored on some random PC in the cloud. Your local VoiceAttack has no way of
|
||||
accessing those.
|
||||
|
||||
If you can get VoiceAttack to run _on Geforce Now_ in parallel to Elite, I don’t
|
||||
see why it wouldn’t work.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Upgrading
|
||||
# Upgrading
|
||||
|
||||
To upgrade to the latest version, follow these simple steps:
|
||||
|
||||
|
@ -29,6 +29,13 @@ Please do not fiddle with the configuration variables from your startup command
|
|||
entirely unnecessary since configuration will be saved to and loaded from the
|
||||
profile anyway.
|
||||
|
||||
### EDDI Events
|
||||
|
||||
The process for adding your own handlers for EDDI events has changed. You no
|
||||
longer have to check which of my profiles handle them and add the commands for
|
||||
those manually; instead you need to [run the `eddi.event` context of the
|
||||
`alterNERDtive-base` plugin](../configuration/general#eddi-events).
|
||||
|
||||
### bindED
|
||||
|
||||
If you have done anything non-standard with bindED before, it might break. The
|
||||
|
|
|
@ -4,7 +4,7 @@ repo_url: https://github.com/alterNERDtive/VoiceAttack-profiles
|
|||
edit_uri: "edit/devel/docs/"
|
||||
site_description: "alterNERDtive VoiceAttack profiles for Elite: Dangerous"
|
||||
site_author: "alterNERDtive"
|
||||
remote_name: "ssh-origin"
|
||||
remote_name: "origin"
|
||||
|
||||
theme:
|
||||
name: readthedocs
|
||||
|
|
22
plugins.sln
22
plugins.sln
|
@ -1,7 +1,7 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30413.136
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.3.32519.111
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VoiceAttack-base", "plugins\VoiceAttack-base\VoiceAttack-base.csproj", "{1C05DB3F-3449-4664-B363-A379892995E5}"
|
||||
EndProject
|
||||
|
@ -16,8 +16,12 @@ EndProject
|
|||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C2B4D94B-8D73-431A-880B-B1E7ADF064B2}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.editorconfig = .editorconfig
|
||||
CHANGELOG.md = CHANGELOG.md
|
||||
.github\workflows\create-release.yaml = .github\workflows\create-release.yaml
|
||||
Directory.build.props = Directory.build.props
|
||||
mkdocs.yml = mkdocs.yml
|
||||
README.md = README.md
|
||||
stylecop.json = stylecop.json
|
||||
VERSION = VERSION
|
||||
EndProjectSection
|
||||
EndProject
|
||||
|
@ -45,6 +49,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "configuration", "configurat
|
|||
docs\configuration\StreamAttack.md = docs\configuration\StreamAttack.md
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{A68BA76B-47FA-4D25-805E-66EBDD8C5223}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.github\dependabot.yaml = .github\dependabot.yaml
|
||||
.github\FUNDING.yml = .github\FUNDING.yml
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{0147AF7E-BB7F-4D5F-96EC-8734393DFF56}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.github\workflows\create-release.yaml = .github\workflows\create-release.yaml
|
||||
.github\workflows\gh-pages.yaml = .github\workflows\gh-pages.yaml
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -78,6 +94,8 @@ Global
|
|||
GlobalSection(NestedProjects) = preSolution
|
||||
{5401ADF7-CB6D-448B-A4AC-D8A17B2D841F} = {C2B4D94B-8D73-431A-880B-B1E7ADF064B2}
|
||||
{1AFD9AE6-7D22-4EF4-B0DE-51C9E91370FB} = {5401ADF7-CB6D-448B-A4AC-D8A17B2D841F}
|
||||
{A68BA76B-47FA-4D25-805E-66EBDD8C5223} = {C2B4D94B-8D73-431A-880B-B1E7ADF064B2}
|
||||
{0147AF7E-BB7F-4D5F-96EC-8734393DFF56} = {A68BA76B-47FA-4D25-805E-66EBDD8C5223}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {339E6747-C7BF-43C3-99C6-9249C9849A84}
|
||||
|
|
|
@ -1,29 +1,144 @@
|
|||
#nullable enable
|
||||
// <copyright file="EliteAttack.cs" company="alterNERDtive">
|
||||
// Copyright 2019–2022 alterNERDtive.
|
||||
//
|
||||
// This file is part of alterNERDtive VoiceAttack profiles for Elite Dangerous.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with alterNERDtive VoiceAttack profiles for Elite Dangerous. If not, see <https://www.gnu.org/licenses/>.
|
||||
// </copyright>
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
|
||||
using alterNERDtive.util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EliteAttack
|
||||
{
|
||||
public class EliteAttack {
|
||||
/// <summary>
|
||||
/// VoiceAttack plugin for the EliteAttack profile.
|
||||
/// </summary>
|
||||
public class EliteAttack
|
||||
{
|
||||
private static readonly Version VERSION = new ("8.5");
|
||||
|
||||
private static VoiceAttackLog? log;
|
||||
private static VoiceAttackCommands? commands;
|
||||
|
||||
private static dynamic? VA { get; set; }
|
||||
|
||||
private static VoiceAttackLog Log
|
||||
=> log ??= new VoiceAttackLog(VA, "EliteAttack");
|
||||
private static VoiceAttackLog? log;
|
||||
private static VoiceAttackLog Log => log ??= new (VA, "EliteAttack");
|
||||
|
||||
private static VoiceAttackCommands Commands
|
||||
=> commands ??= new VoiceAttackCommands(VA, Log);
|
||||
private static VoiceAttackCommands? commands;
|
||||
private static VoiceAttackCommands Commands => commands ??= new (VA, Log);
|
||||
|
||||
/*========================================\
|
||||
| required VoiceAttack plugin shenanigans |
|
||||
\========================================*/
|
||||
|
||||
/// <summary>
|
||||
/// The plugin’s GUID, as required by the VoiceAttack plugin API.
|
||||
/// </summary>
|
||||
/// <returns>The GUID.</returns>
|
||||
public static Guid VA_Id()
|
||||
=> new ("{5B46321D-2935-4550-BEEA-36C2145547B8}");
|
||||
|
||||
/// <summary>
|
||||
/// The plugin’s display name, as required by the VoiceAttack plugin API.
|
||||
/// </summary>
|
||||
/// <returns>The display name.</returns>
|
||||
public static string VA_DisplayName()
|
||||
=> $"EliteAttack {VERSION}";
|
||||
|
||||
/// <summary>
|
||||
/// The plugin’s description, as required by the VoiceAttack plugin API.
|
||||
/// </summary>
|
||||
/// <returns>The description.</returns>
|
||||
public static string VA_DisplayInfo()
|
||||
=> "EliteAttack: a plugin for doing Elite-y things.";
|
||||
|
||||
/// <summary>
|
||||
/// The Init method, as required by the VoiceAttack plugin API.
|
||||
/// Runs when the plugin is initially loaded.
|
||||
/// </summary>
|
||||
/// <param name="vaProxy">The VoiceAttack proxy object.</param>
|
||||
public static void VA_Init1(dynamic vaProxy)
|
||||
{
|
||||
VA = vaProxy;
|
||||
Log.Notice("Initializing …");
|
||||
VA.SetText("EliteAttack.version", VERSION.ToString());
|
||||
Log.Notice("Init successful.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The Invoke method, as required by the VoiceAttack plugin API.
|
||||
/// Runs whenever a plugin context is invoked.
|
||||
/// </summary>
|
||||
/// <param name="vaProxy">The VoiceAttack proxy object.</param>
|
||||
public static void VA_Invoke1(dynamic vaProxy)
|
||||
{
|
||||
string context = vaProxy.Context.ToLower();
|
||||
Log.Debug($"Running context '{context}' …");
|
||||
try
|
||||
{
|
||||
switch (context)
|
||||
{
|
||||
case "startup":
|
||||
Context_Startup(vaProxy);
|
||||
break;
|
||||
case "log.log":
|
||||
// log
|
||||
Context_Log(vaProxy);
|
||||
break;
|
||||
default:
|
||||
// invalid
|
||||
Log.Error($"Invalid plugin context '{vaProxy.Context}'.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (ArgumentNullException e)
|
||||
{
|
||||
Log.Error($"Missing parameter '{e.ParamName}' for context '{context}'");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error($"Unhandled exception while executing plugin context '{context}'. ({e.Message})");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The Exit method, as required by the VoiceAttack plugin API.
|
||||
/// Runs when VoiceAttack is shut down.
|
||||
/// </summary>
|
||||
/// <param name="vaProxy">The VoiceAttack proxy object.</param>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "required by VoiceAttack plugin API")]
|
||||
public static void VA_Exit1(dynamic vaProxy)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The StopCommand method, as required by the VoiceAttack plugin API.
|
||||
/// Runs whenever all commands are stopped using the “Stop All Commands”
|
||||
/// button or action.
|
||||
/// </summary>
|
||||
public static void VA_StopCommand()
|
||||
{
|
||||
}
|
||||
|
||||
/*================\
|
||||
| plugin contexts |
|
||||
\================*/
|
||||
|
||||
#pragma warning disable IDE0060 // Remove unused parameter
|
||||
private static void Context_Log(dynamic vaProxy)
|
||||
{
|
||||
string message = vaProxy.GetText("~message");
|
||||
|
@ -39,7 +154,10 @@ namespace EliteAttack
|
|||
{
|
||||
Log.Log(message, (LogLevel)Enum.Parse(typeof(LogLevel), level.ToUpper()));
|
||||
}
|
||||
catch (ArgumentNullException) { throw; }
|
||||
catch (ArgumentNullException)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
Log.Error($"Invalid log level '{level}'.");
|
||||
|
@ -50,64 +168,8 @@ namespace EliteAttack
|
|||
private static void Context_Startup(dynamic vaProxy)
|
||||
{
|
||||
Log.Notice("Starting up …");
|
||||
VA = vaProxy;
|
||||
Log.Notice("Finished startup.");
|
||||
}
|
||||
|
||||
/*========================================\
|
||||
| required VoiceAttack plugin shenanigans |
|
||||
\========================================*/
|
||||
|
||||
static readonly Version VERSION = new Version("8.3");
|
||||
|
||||
public static Guid VA_Id()
|
||||
=> new Guid("{5B46321D-2935-4550-BEEA-36C2145547B8}");
|
||||
public static string VA_DisplayName()
|
||||
=> $"EliteAttack {VERSION}";
|
||||
public static string VA_DisplayInfo()
|
||||
=> "EliteAttack: a plugin for doing Elite-y things.";
|
||||
|
||||
public static void VA_Init1(dynamic vaProxy)
|
||||
{
|
||||
VA = vaProxy;
|
||||
Log.Notice("Initializing …");
|
||||
VA.SetText("EliteAttack.version", VERSION.ToString());
|
||||
Log.Notice("Init successful.");
|
||||
}
|
||||
|
||||
public static void VA_Invoke1(dynamic vaProxy)
|
||||
{
|
||||
string context = vaProxy.Context.ToLower();
|
||||
Log.Debug($"Running context '{context}' …");
|
||||
try
|
||||
{
|
||||
switch (context)
|
||||
{
|
||||
case "startup":
|
||||
Context_Startup(vaProxy);
|
||||
break;
|
||||
// log
|
||||
case "log.log":
|
||||
Context_Log(vaProxy);
|
||||
break;
|
||||
// invalid
|
||||
default:
|
||||
Log.Error($"Invalid plugin context '{vaProxy.Context}'.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (ArgumentNullException e)
|
||||
{
|
||||
Log.Error($"Missing parameter '{e.ParamName}' for context '{context}'");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error($"Unhandled exception while executing plugin context '{context}'. ({e.Message})");
|
||||
}
|
||||
}
|
||||
|
||||
public static void VA_Exit1(dynamic vaProxy) { }
|
||||
|
||||
public static void VA_StopCommand() { }
|
||||
#pragma warning restore IDE0060 // Remove unused parameter
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
<DocumentationFile>..\build\alterNERDtive\EliteAttack.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>none</DebugType>
|
||||
|
@ -30,7 +30,7 @@
|
|||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
<DocumentationFile>..\build\alterNERDtive\EliteAttack.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
|
|
|
@ -1,4 +1,23 @@
|
|||
using System.Reflection;
|
||||
// <copyright file="AssemblyInfo.cs" company="alterNERDtive">
|
||||
// Copyright 2019–2022 alterNERDtive.
|
||||
//
|
||||
// This file is part of alterNERDtive VoiceAttack profiles for Elite Dangerous.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with alterNERDtive VoiceAttack profiles for Elite Dangerous. If not, see <https://www.gnu.org/licenses/>.
|
||||
// </copyright>
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
|
|
@ -1,4 +1,23 @@
|
|||
using System.Reflection;
|
||||
// <copyright file="AssemblyInfo.cs" company="alterNERDtive">
|
||||
// Copyright 2019–2022 alterNERDtive.
|
||||
//
|
||||
// This file is part of alterNERDtive VoiceAttack profiles for Elite Dangerous.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with alterNERDtive VoiceAttack profiles for Elite Dangerous. If not, see <https://www.gnu.org/licenses/>.
|
||||
// </copyright>
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Pipes;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace RatAttack
|
||||
{
|
||||
class RatAttack_cli
|
||||
{
|
||||
static string stripIrcCodes(string message)
|
||||
{
|
||||
return Regex.Replace(message, @"[\x02\x11\x0F\x1D\x1E\x1F\x16]|\x03(\d\d?(,\d\d?)?)?", String.Empty);
|
||||
}
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
RatAttack.Ratsignal ratsignal = new RatAttack.Ratsignal(stripIrcCodes(args[0]), args.Length > 1 && args[1].ToLower() == "true");
|
||||
|
||||
using (NamedPipeClientStream pipeClient = new NamedPipeClientStream(".", "RatAttack", PipeDirection.Out))
|
||||
{
|
||||
try
|
||||
{
|
||||
// try connecting for up to 2 minutes; then we’ll assume VoiceAttack just isn’t up and won’t come up
|
||||
pipeClient.Connect(120000);
|
||||
using (StreamWriter writer = new StreamWriter(pipeClient))
|
||||
{
|
||||
writer.WriteLine(ratsignal);
|
||||
}
|
||||
}
|
||||
catch (TimeoutException)
|
||||
{
|
||||
Console.Error.WriteLine("Connection to RatAttack pipe has timed out.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -25,7 +25,7 @@
|
|||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
<DocumentationFile>..\build\alterNERDtive\RatAttack-cli.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
|
@ -35,7 +35,7 @@
|
|||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
<DocumentationFile>..\build\alterNERDtive\RatAttack-cli.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
|
@ -50,8 +50,8 @@
|
|||
<Reference Include="System.Xml.Serialization" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="RatAttack-cli.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="RatAttack_cli.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\RatAttack\RatAttack.csproj">
|
||||
|
|
68
plugins/RatAttack-cli/RatAttack_cli.cs
Normal file
68
plugins/RatAttack-cli/RatAttack_cli.cs
Normal file
|
@ -0,0 +1,68 @@
|
|||
// <copyright file="RatAttack_cli.cs" company="alterNERDtive">
|
||||
// Copyright 2019–2022 alterNERDtive.
|
||||
//
|
||||
// This file is part of alterNERDtive VoiceAttack profiles for Elite Dangerous.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with alterNERDtive VoiceAttack profiles for Elite Dangerous. If not, see <https://www.gnu.org/licenses/>.
|
||||
// </copyright>
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Pipes;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace RatAttack
|
||||
{
|
||||
/// <summary>
|
||||
/// CLI helper tool for the RatAttack VoiceAttack plugin. Accepts RATSIGNALs
|
||||
/// e.g. from an IRC client and passes them to the plugin via named pipe.
|
||||
/// </summary>
|
||||
public class RatAttack_cli
|
||||
{
|
||||
/// <summary>
|
||||
/// Main entry point.
|
||||
/// </summary>
|
||||
/// <param name="args">The command line arguments.</param>
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
RatAttack.Ratsignal ratsignal = new (StripIrcCodes(args[0]), args.Length > 1 && args[1].ToLower() == "true");
|
||||
|
||||
using (NamedPipeClientStream pipeClient = new (".", "RatAttack", PipeDirection.Out))
|
||||
{
|
||||
try
|
||||
{
|
||||
// try connecting for up to 2 minutes; then we’ll assume VoiceAttack just isn’t up and won’t come up
|
||||
pipeClient.Connect(120000);
|
||||
using StreamWriter writer = new (pipeClient);
|
||||
writer.WriteLine(ratsignal);
|
||||
}
|
||||
catch (TimeoutException)
|
||||
{
|
||||
Console.Error.WriteLine("Connection to RatAttack pipe has timed out.");
|
||||
}
|
||||
catch (UnauthorizedAccessException)
|
||||
{
|
||||
Console.Error.WriteLine("Cannot connect to RatAttack pipe. Are you running VoiceAttack as Admin?");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static string StripIrcCodes(string message)
|
||||
{
|
||||
return Regex.Replace(message, @"[\x02\x11\x0F\x1D\x1E\x1F\x16]|\x03(\d\d?(,\d\d?)?)?", string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,23 @@
|
|||
using System.Reflection;
|
||||
// <copyright file="AssemblyInfo.cs" company="alterNERDtive">
|
||||
// Copyright 2019–2022 alterNERDtive.
|
||||
//
|
||||
// This file is part of alterNERDtive VoiceAttack profiles for Elite Dangerous.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with alterNERDtive VoiceAttack profiles for Elite Dangerous. If not, see <https://www.gnu.org/licenses/>.
|
||||
// </copyright>
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
|
|
@ -1,93 +1,182 @@
|
|||
#nullable enable
|
||||
// <copyright file="RatAttack.cs" company="alterNERDtive">
|
||||
// Copyright 2019–2022 alterNERDtive.
|
||||
//
|
||||
// This file is part of alterNERDtive VoiceAttack profiles for Elite Dangerous.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with alterNERDtive VoiceAttack profiles for Elite Dangerous. If not, see <https://www.gnu.org/licenses/>.
|
||||
// </copyright>
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Diagnostics;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
using alterNERDtive.util;
|
||||
|
||||
namespace RatAttack
|
||||
{
|
||||
/// <summary>
|
||||
/// VoiceAttack plugin for the RatAttack profile.
|
||||
/// </summary>
|
||||
public class RatAttack
|
||||
{
|
||||
private static Dictionary<int,RatCase> CaseList { get; } = new Dictionary<int, RatCase>();
|
||||
private static dynamic? VA { get; set; }
|
||||
private static alterNERDtive.util.PipeServer<Ratsignal> RatsignalPipe
|
||||
=> ratsignalPipe ??= new alterNERDtive.util.PipeServer<Ratsignal>(Log, "RatAttack",
|
||||
new alterNERDtive.util.PipeServer<Ratsignal>.SignalHandler(On_Ratsignal));
|
||||
private static alterNERDtive.util.PipeServer<Ratsignal>? ratsignalPipe;
|
||||
private static readonly Version VERSION = new ("6.4");
|
||||
|
||||
private static readonly Regex RatsignalRegex = new Regex(
|
||||
@"^RATSIGNAL Case #(?<number>\d+) (?<platform>(PC|Xbox|Playstation))(?<oxygen> \(Code Red\))?(?<odyssey> \(Odyssey\))? – CMDR (?<cmdr>.+) – System: (None|u\u200bnknown system|""(?<system>.+)"" \((?<systemInfo>([a-zA-Z0-9\s\(\)\-/]*(~?[0-9,\.]+ LY (""[a-zA-Z\-]+"" of|from) [a-zA-Z0-9\s\*\-]+)?( \([a-zA-Z\s]+\))?|Not found in galaxy database|Invalid system name))\)(?<permit> \(((?<permitName>.*) )?Permit Required\))?) – Language: (?<language>[a-zA-z0-9\x7f-\xff\-\(\)&,\s\.]+)( – Nick: (?<nick>[a-zA-Z0-9_\[\]\-]+))? \((PC|XB|PS)_SIGNAL\)\v*$"
|
||||
);
|
||||
private static readonly Regex RatsignalRegex = new (
|
||||
@"^RATSIGNAL Case #(?<number>\d+) (?<platform>(PC|Xbox|Playstation))( )?(?<mode>H3.8|H4.0|ODY)?(?<oxygen> \(Code Red\))? – CMDR (?<cmdr>.+) – System: (None|u\u200bnknown system|""(?<system>.+)"" \((?<systemInfo>([a-zA-Z0-9\s\(\)\-/]*(~?[0-9,\.]+ LY (""[a-zA-Z\-]+"" of|from) [a-zA-Z0-9\s\*\-]+)?( \([a-zA-Z\s]+\))?|Not found in galaxy database|Invalid system name))\)(?<permit> \(((?<permitName>.*) )?Permit Required\))?) – Language: (?<language>[a-zA-z0-9\x7f-\xff\-\(\)&,\s\.]+)( – Nick: (?<nick>[a-zA-Z0-9_\[\]\-\^]+))? \((H3|H4|ODY|XB|PS)_SIGNAL\)\v*$");
|
||||
|
||||
private static VoiceAttackLog Log
|
||||
=> log ??= new VoiceAttackLog(VA, "RatAttack");
|
||||
private static PipeServer<Ratsignal>? ratsignalPipe;
|
||||
private static VoiceAttackLog? log;
|
||||
|
||||
private static VoiceAttackCommands Commands
|
||||
=> commands ??= new VoiceAttackCommands(VA, Log);
|
||||
private static VoiceAttackCommands? commands;
|
||||
|
||||
private class RatCase
|
||||
private static ConcurrentDictionary<int, RatCase> CaseList { get; } = new ();
|
||||
|
||||
private static dynamic? VA { get; set; }
|
||||
|
||||
private static PipeServer<Ratsignal> RatsignalPipe
|
||||
=> ratsignalPipe ??= new (
|
||||
Log,
|
||||
"RatAttack",
|
||||
new PipeServer<Ratsignal>.SignalHandler(On_Ratsignal));
|
||||
|
||||
private static VoiceAttackLog Log => log ??= new (VA, "RatAttack");
|
||||
|
||||
private static VoiceAttackCommands Commands => commands ??= new (VA, Log);
|
||||
|
||||
/*========================================\
|
||||
| required VoiceAttack plugin shenanigans |
|
||||
\========================================*/
|
||||
|
||||
/// <summary>
|
||||
/// The plugin’s GUID, as required by the VoiceAttack plugin API.
|
||||
/// </summary>
|
||||
/// <returns>The GUID.</returns>
|
||||
public static Guid VA_Id()
|
||||
=> new ("{F2ADF0AE-4837-4E4A-9C87-8A7E2FA63E5F}");
|
||||
|
||||
/// <summary>
|
||||
/// The plugin’s display name, as required by the VoiceAttack plugin API.
|
||||
/// </summary>
|
||||
/// <returns>The display name.</returns>
|
||||
public static string VA_DisplayName()
|
||||
=> $"RatAttack {VERSION}";
|
||||
|
||||
/// <summary>
|
||||
/// The plugin’s description, as required by the VoiceAttack plugin API.
|
||||
/// </summary>
|
||||
/// <returns>The description.</returns>
|
||||
public static string VA_DisplayInfo()
|
||||
=> "RatAttack: a plugin to handle FuelRats cases.";
|
||||
|
||||
/// <summary>
|
||||
/// The Init method, as required by the VoiceAttack plugin API.
|
||||
/// Runs when the plugin is initially loaded.
|
||||
/// </summary>
|
||||
/// <param name="vaProxy">The VoiceAttack proxy object.</param>
|
||||
public static void VA_Init1(dynamic vaProxy)
|
||||
{
|
||||
public string Cmdr;
|
||||
public string? Language;
|
||||
public string? System;
|
||||
public string? SystemInfo;
|
||||
public bool PermitLocked;
|
||||
public string? PermitName;
|
||||
public string Platform;
|
||||
public bool Odyssey;
|
||||
public bool CodeRed;
|
||||
public int Number;
|
||||
|
||||
public RatCase(string cmdr, string? language, string? system, string? systemInfo, bool permitLocked, string? permitName, string platform, bool odyssey, bool codeRed, int number)
|
||||
=> (Cmdr, Language, System, SystemInfo, PermitLocked, PermitName, Platform, Odyssey, CodeRed, Number) = (cmdr, language, system, systemInfo, permitLocked, permitName, platform, odyssey, codeRed, number);
|
||||
|
||||
public string ShortInfo
|
||||
{
|
||||
get => $"#{Number}, {Platform}{(Odyssey ? " (Odyssey)" : "")}{(CodeRed ? ", code red" : "")}, {System ?? "None"}{(SystemInfo != null ? $" ({SystemInfo}{(PermitLocked ? ", permit required" : "")})" : "")}";
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
=> ShortInfo;
|
||||
VA = vaProxy;
|
||||
Log.Notice("Initializing …");
|
||||
VA.SetText("RatAttack.version", VERSION.ToString());
|
||||
vaProxy.ProfileChanged += new Action<Guid?, Guid?, string, string>(On_ProfileChanged);
|
||||
Log.Notice("Init successful.");
|
||||
}
|
||||
|
||||
public class Ratsignal : IPipable
|
||||
/// <summary>
|
||||
/// The Invoke method, as required by the VoiceAttack plugin API.
|
||||
/// Runs whenever a plugin context is invoked.
|
||||
/// </summary>
|
||||
/// <param name="vaProxy">The VoiceAttack proxy object.</param>
|
||||
public static void VA_Invoke1(dynamic vaProxy)
|
||||
{
|
||||
public string Signal { get; set; }
|
||||
public bool Announce { get; set; }
|
||||
private readonly char separator = '\x1F';
|
||||
|
||||
public Ratsignal()
|
||||
=> (Signal, Announce) = ("", false);
|
||||
|
||||
public Ratsignal(string signal, bool announce)
|
||||
=> (Signal, Announce) = (signal, announce);
|
||||
|
||||
public void ParseString(string serialization)
|
||||
string context = vaProxy.Context.ToLower();
|
||||
Log.Debug($"Running context '{context}' …");
|
||||
try
|
||||
{
|
||||
try
|
||||
switch (context)
|
||||
{
|
||||
string[] parts = serialization.Split(separator);
|
||||
Signal = parts[0];
|
||||
Announce = Boolean.Parse(parts[1]);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new ArgumentException($"Invalid serialized RATSIGNAL: '{serialization}'", e);
|
||||
case "getcasedata":
|
||||
// plugin methods
|
||||
Context_GetCaseData(vaProxy);
|
||||
break;
|
||||
case "parseratsignal":
|
||||
Context_ParseRatsignal(vaProxy);
|
||||
break;
|
||||
case "startup":
|
||||
Context_Startup(vaProxy);
|
||||
break;
|
||||
case "edsm.getnearestcmdr":
|
||||
// EDSM
|
||||
Context_EDSM_GetNearestCMDR(vaProxy);
|
||||
break;
|
||||
case "log.log":
|
||||
// log
|
||||
Context_Log(vaProxy);
|
||||
break;
|
||||
default:
|
||||
// invalid
|
||||
Log.Error($"Invalid plugin context '{vaProxy.Context}'.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
=> $"{Signal}{separator}{Announce}";
|
||||
catch (ArgumentNullException e)
|
||||
{
|
||||
Log.Error($"Missing parameter '{e.ParamName}' for context '{context}'");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error($"Unhandled exception while executing plugin context '{context}'. ({e.Message})");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The Exit method, as required by the VoiceAttack plugin API.
|
||||
/// Runs when VoiceAttack is shut down.
|
||||
/// </summary>
|
||||
/// <param name="vaProxy">The VoiceAttack proxy object.</param>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "required by VoiceAttack plugin API")]
|
||||
public static void VA_Exit1(dynamic vaProxy)
|
||||
{
|
||||
Log.Debug("Starting teardown …");
|
||||
Log.Debug("Closing RATSIGNAL pipe …");
|
||||
RatsignalPipe.Stop();
|
||||
Log.Debug("Teardown finished.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The StopCommand method, as required by the VoiceAttack plugin API.
|
||||
/// Runs whenever all commands are stopped using the “Stop All Commands”
|
||||
/// button or action.
|
||||
/// </summary>
|
||||
public static void VA_StopCommand()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parses a RATSIGNAL and extracts case data for storage.
|
||||
/// </summary>
|
||||
/// <param name="ratsignal">The incoming RATSIGNAL.</param>
|
||||
/// <returns>The case number.</returns>
|
||||
/// <exception cref="ArgumentException">Thrown on invalid RATSIGNAL.</exception>
|
||||
private static int ParseRatsignal(string ratsignal)
|
||||
{
|
||||
if (!RatsignalRegex.IsMatch(ratsignal))
|
||||
{
|
||||
throw new ArgumentException($"Invalid RATSIGNAL format: '{ratsignal}'.", "ratsignal");
|
||||
}
|
||||
|
||||
Match match = RatsignalRegex.Match(ratsignal);
|
||||
|
||||
|
@ -99,18 +188,18 @@ namespace RatAttack
|
|||
string? permitName = match.Groups["permitName"].Value;
|
||||
string platform = match.Groups["platform"].Value;
|
||||
bool codeRed = match.Groups["oxygen"].Success;
|
||||
bool odyssey = match.Groups["odyssey"].Success;
|
||||
string? mode = match.Groups["mode"].Value;
|
||||
|
||||
int number = int.Parse(match.Groups["number"].Value);
|
||||
|
||||
if (String.IsNullOrEmpty(system))
|
||||
if (string.IsNullOrEmpty(system))
|
||||
{
|
||||
system = "None";
|
||||
}
|
||||
|
||||
Log.Debug($"New rat case: CMDR “{cmdr}” in “{system}”{(systemInfo != null ? $" ({systemInfo})" : "")} on {platform}{(odyssey ? " (Odyssey)" : "")}, permit locked: {permitLocked}{(permitLocked && permitName != null ? $" (permit name: {permitName})" : "")}, code red: {codeRed} (#{number}).");
|
||||
Log.Debug($"New rat case: CMDR “{cmdr}” in “{system}”{(!string.IsNullOrEmpty(systemInfo) ? $" ({systemInfo})" : string.Empty)} on {platform}{(!string.IsNullOrEmpty(mode) ? $" ({mode})" : string.Empty)}, permit locked: {permitLocked}{(permitLocked && !string.IsNullOrEmpty(permitName) ? $" (permit name: {permitName})" : string.Empty)}, code red: {codeRed} (#{number}).");
|
||||
|
||||
CaseList[number] = new RatCase(cmdr, language, system, systemInfo, permitLocked, permitName, platform, odyssey, codeRed, number);
|
||||
CaseList[number] = new RatCase(cmdr, language, system, systemInfo, permitLocked, permitName, platform, mode, codeRed, number);
|
||||
|
||||
return number;
|
||||
}
|
||||
|
@ -141,6 +230,7 @@ namespace RatAttack
|
|||
| plugin contexts |
|
||||
\================*/
|
||||
|
||||
#pragma warning disable IDE0060 // Remove unused parameter
|
||||
private static void Context_EDSM_GetNearestCMDR(dynamic vaProxy)
|
||||
{
|
||||
int caseNo = vaProxy.GetInt("~caseNo") ?? throw new ArgumentNullException("~caseNo");
|
||||
|
@ -150,6 +240,7 @@ namespace RatAttack
|
|||
{
|
||||
throw new ArgumentNullException("~cmdrs");
|
||||
}
|
||||
|
||||
string system = CaseList[caseNo]?.System ?? throw new ArgumentException($"Case #{caseNo} has no system information", "~caseNo");
|
||||
|
||||
string path = $@"{vaProxy.SessionState["VA_SOUNDS"]}\Scripts\edsm-getnearest.exe";
|
||||
|
@ -164,7 +255,7 @@ namespace RatAttack
|
|||
|
||||
string message = stdout;
|
||||
string? errorMessage = null;
|
||||
bool error = true;
|
||||
bool error;
|
||||
|
||||
switch (p.ExitCode)
|
||||
{
|
||||
|
@ -185,7 +276,6 @@ namespace RatAttack
|
|||
Log.Error(stderr);
|
||||
errorMessage = "Unrecoverable error in plugin.";
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
vaProxy.SetText("~message", message);
|
||||
|
@ -209,7 +299,7 @@ namespace RatAttack
|
|||
vaProxy.SetBoolean("~~permitLocked", rc?.PermitLocked);
|
||||
vaProxy.SetText("~~permitName", rc?.PermitName);
|
||||
vaProxy.SetText("~~platform", rc?.Platform);
|
||||
vaProxy.SetBoolean("~~odyssey", rc?.Odyssey);
|
||||
vaProxy.SetText("~~mode", rc?.Mode);
|
||||
vaProxy.SetBoolean("~~codeRed", rc?.CodeRed);
|
||||
}
|
||||
else
|
||||
|
@ -233,7 +323,10 @@ namespace RatAttack
|
|||
{
|
||||
Log.Log(message, (LogLevel)Enum.Parse(typeof(LogLevel), level.ToUpper()));
|
||||
}
|
||||
catch (ArgumentNullException) { throw; }
|
||||
catch (ArgumentNullException)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
Log.Error($"Invalid log level '{level}'.");
|
||||
|
@ -244,89 +337,109 @@ namespace RatAttack
|
|||
private static void Context_Startup(dynamic vaProxy)
|
||||
{
|
||||
Log.Notice("Starting up …");
|
||||
VA = vaProxy;
|
||||
_ = RatsignalPipe.Run();
|
||||
Log.Notice("Finished startup.");
|
||||
}
|
||||
|
||||
private static void Context_ParseRatsignal(dynamic vaProxy)
|
||||
{
|
||||
Log.Warn("Passing a RATSIGNAL from VoiceAttack (through the clipboard or a file) is DEPRECATED and will no longer be supported in the future.");
|
||||
On_Ratsignal(new Ratsignal(vaProxy.GetText("~ratsignal"), vaProxy.GetBoolean("~announceRatsignal")));
|
||||
Log.Warn("Passing a RATSIGNAL to VoiceAttack through the clipboard or a file is DEPRECATED and will no longer be supported in the future.");
|
||||
On_Ratsignal(new Ratsignal(vaProxy.GetText("~ratsignal"), vaProxy.GetBoolean("~announceRatsignal") ?? false));
|
||||
}
|
||||
#pragma warning restore IDE0060 // Remove unused parameter
|
||||
|
||||
/*========================================\
|
||||
| required VoiceAttack plugin shenanigans |
|
||||
\========================================*/
|
||||
|
||||
static readonly Version VERSION = new Version("6.3");
|
||||
|
||||
public static Guid VA_Id()
|
||||
=> new Guid("{F2ADF0AE-4837-4E4A-9C87-8A7E2FA63E5F}");
|
||||
public static string VA_DisplayName()
|
||||
=> $"RatAttack {VERSION}";
|
||||
public static string VA_DisplayInfo()
|
||||
=> "RatAttack: a plugin to handle FuelRats cases.";
|
||||
|
||||
public static void VA_Init1(dynamic vaProxy)
|
||||
/// <summary>
|
||||
/// Encapsulates a RATSIGNAL for sending between the CLI helper tool and
|
||||
/// the plugin via named pipe.
|
||||
/// </summary>
|
||||
public class Ratsignal : IPipable
|
||||
{
|
||||
VA = vaProxy;
|
||||
Log.Notice("Initializing …");
|
||||
VA.SetText("RatAttack.version", VERSION.ToString());
|
||||
vaProxy.ProfileChanged += new Action<Guid?, Guid?, String, String>(On_ProfileChanged);
|
||||
Log.Notice("Init successful.");
|
||||
}
|
||||
private readonly char separator = '\x1F';
|
||||
|
||||
public static void VA_Invoke1(dynamic vaProxy)
|
||||
{
|
||||
string context = vaProxy.Context.ToLower();
|
||||
Log.Debug($"Running context '{context}' …");
|
||||
try
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Ratsignal"/> class.
|
||||
/// </summary>
|
||||
public Ratsignal()
|
||||
=> (this.Signal, this.Announce) = (string.Empty, false);
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Ratsignal"/> class.
|
||||
/// </summary>
|
||||
/// <param name="signal">The RATSIGNAL.</param>
|
||||
/// <param name="announce">Whether or not to announce the new case.</param>
|
||||
public Ratsignal(string signal, bool announce)
|
||||
=> (this.Signal, this.Announce) = (signal, announce);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the RATSIGNAL.
|
||||
/// </summary>
|
||||
public string Signal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets a value indicating whether to announce the incoming
|
||||
/// case.
|
||||
/// </summary>
|
||||
public bool Announce { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the <see cref="Ratsignal"/> instance from a
|
||||
/// serialized representation.
|
||||
/// FIXXME: should probably make this a static factory method.
|
||||
/// </summary>
|
||||
/// <param name="serialization">The serialized <see cref="Ratsignal"/>.</param>
|
||||
/// <exception cref="ArgumentException">Thrown on receiving an invalid signal.</exception>
|
||||
public void ParseString(string serialization)
|
||||
{
|
||||
switch (context)
|
||||
try
|
||||
{
|
||||
// plugin methods
|
||||
case "getcasedata":
|
||||
Context_GetCaseData(vaProxy);
|
||||
break;
|
||||
case "parseratsignal":
|
||||
Context_ParseRatsignal(vaProxy);
|
||||
break;
|
||||
case "startup":
|
||||
Context_Startup(vaProxy);
|
||||
break;
|
||||
// EDSM
|
||||
case "edsm.getnearestcmdr":
|
||||
Context_EDSM_GetNearestCMDR(vaProxy);
|
||||
break;
|
||||
// log
|
||||
case "log.log":
|
||||
Context_Log(vaProxy);
|
||||
break;
|
||||
// invalid
|
||||
default:
|
||||
Log.Error($"Invalid plugin context '{vaProxy.Context}'.");
|
||||
break;
|
||||
string[] parts = serialization.Split(this.separator);
|
||||
this.Signal = parts[0];
|
||||
this.Announce = bool.Parse(parts[1]);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new ArgumentException($"Invalid serialized RATSIGNAL: '{serialization}'", e);
|
||||
}
|
||||
}
|
||||
catch (ArgumentNullException e)
|
||||
{
|
||||
Log.Error($"Missing parameter '{e.ParamName}' for context '{context}'");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error($"Unhandled exception while executing plugin context '{context}'. ({e.Message})");
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override string ToString()
|
||||
=> $"{this.Signal}{this.separator}{this.Announce}";
|
||||
}
|
||||
|
||||
public static void VA_Exit1(dynamic vaProxy)
|
||||
private class RatCase
|
||||
{
|
||||
Log.Debug("Starting teardown …");
|
||||
Log.Debug("Closing RATSIGNAL pipe …");
|
||||
RatsignalPipe.Stop();
|
||||
Log.Debug("Teardown finished.");
|
||||
}
|
||||
public RatCase(string cmdr, string? language, string? system, string? systemInfo, bool permitLocked, string? permitName, string platform, string mode, bool codeRed, int number)
|
||||
=> (this.Cmdr, this.Language, this.System, this.SystemInfo, this.PermitLocked, this.PermitName, this.Platform, this.Mode, this.CodeRed, this.Number)
|
||||
= (cmdr, language, system, systemInfo, permitLocked, permitName, platform, mode, codeRed, number);
|
||||
|
||||
public static void VA_StopCommand() { }
|
||||
public string Cmdr { get; }
|
||||
|
||||
public string? Language { get; }
|
||||
|
||||
public string? System { get; }
|
||||
|
||||
public string? SystemInfo { get; }
|
||||
|
||||
public bool PermitLocked { get; }
|
||||
|
||||
public string? PermitName { get; }
|
||||
|
||||
public string Platform { get; }
|
||||
|
||||
public string? Mode { get; }
|
||||
|
||||
public bool CodeRed { get; }
|
||||
|
||||
public int Number { get; }
|
||||
|
||||
public string ShortInfo
|
||||
{
|
||||
get => $"#{this.Number}, {this.Platform}{(!string.IsNullOrEmpty(this.Mode) ? $" ({this.Mode})" : string.Empty)}{(this.CodeRed ? ", code red" : string.Empty)}, {this.System ?? "None"}{(!string.IsNullOrEmpty(this.SystemInfo) ? $" ({this.SystemInfo}{(this.PermitLocked ? ", permit required" : string.Empty)})" : string.Empty)}";
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
=> this.ShortInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
<DocumentationFile>..\build\alterNERDtive\RatAttack.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>none</DebugType>
|
||||
|
@ -34,7 +34,7 @@
|
|||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
<DocumentationFile>..\build\alterNERDtive\RatAttack.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
|
|
|
@ -1,4 +1,23 @@
|
|||
using System.Reflection;
|
||||
// <copyright file="AssemblyInfo.cs" company="alterNERDtive">
|
||||
// Copyright 2019–2022 alterNERDtive.
|
||||
//
|
||||
// This file is part of alterNERDtive VoiceAttack profiles for Elite Dangerous.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with alterNERDtive VoiceAttack profiles for Elite Dangerous. If not, see <https://www.gnu.org/licenses/>.
|
||||
// </copyright>
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
|
|
@ -1,29 +1,158 @@
|
|||
#nullable enable
|
||||
// <copyright file="SpanshAttack.cs" company="alterNERDtive">
|
||||
// Copyright 2019–2022 alterNERDtive.
|
||||
//
|
||||
// This file is part of alterNERDtive VoiceAttack profiles for Elite Dangerous.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with alterNERDtive VoiceAttack profiles for Elite Dangerous. If not, see <https://www.gnu.org/licenses/>.
|
||||
// </copyright>
|
||||
|
||||
#nullable enable
|
||||
|
||||
using alterNERDtive.util;
|
||||
using alterNERDtive.edts;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
using alterNERDtive.edts;
|
||||
using alterNERDtive.util;
|
||||
|
||||
namespace SpanshAttack
|
||||
{
|
||||
/// <summary>
|
||||
/// VoiceAttack plugin for the SpanshAttack profile.
|
||||
/// </summary>
|
||||
public class SpanshAttack
|
||||
{
|
||||
private static readonly Version VERSION = new ("7.2.2");
|
||||
|
||||
private static VoiceAttackLog? log;
|
||||
private static VoiceAttackCommands? commands;
|
||||
|
||||
private static dynamic? VA { get; set; }
|
||||
|
||||
private static VoiceAttackLog Log
|
||||
=> log ??= new VoiceAttackLog(VA, "SpanshAttack");
|
||||
private static VoiceAttackLog? log;
|
||||
private static VoiceAttackLog Log => log ??= new (VA, "SpanshAttack");
|
||||
|
||||
private static VoiceAttackCommands Commands
|
||||
=> commands ??= new VoiceAttackCommands(VA, Log);
|
||||
private static VoiceAttackCommands? commands;
|
||||
private static VoiceAttackCommands Commands => commands ??= new (VA, Log);
|
||||
|
||||
/*========================================\
|
||||
| required VoiceAttack plugin shenanigans |
|
||||
\========================================*/
|
||||
|
||||
/// <summary>
|
||||
/// The plugin’s GUID, as required by the VoiceAttack plugin API.
|
||||
/// </summary>
|
||||
/// <returns>The GUID.</returns>
|
||||
public static Guid VA_Id()
|
||||
=> new ("{e722b29d-898e-47dd-a843-a409c87e0bd8}");
|
||||
|
||||
/// <summary>
|
||||
/// The plugin’s display name, as required by the VoiceAttack plugin API.
|
||||
/// </summary>
|
||||
/// <returns>The display name.</returns>
|
||||
public static string VA_DisplayName()
|
||||
=> $"SpanshAttack {VERSION}";
|
||||
|
||||
/// <summary>
|
||||
/// The plugin’s description, as required by the VoiceAttack plugin API.
|
||||
/// </summary>
|
||||
/// <returns>The description.</returns>
|
||||
public static string VA_DisplayInfo()
|
||||
=> "SpanshAttack: a plugin for doing routing with spansh.co.uk for Elite: Dangerous.";
|
||||
|
||||
/// <summary>
|
||||
/// The Init method, as required by the VoiceAttack plugin API.
|
||||
/// Runs when the plugin is initially loaded.
|
||||
/// </summary>
|
||||
/// <param name="vaProxy">The VoiceAttack proxy object.</param>
|
||||
public static void VA_Init1(dynamic vaProxy)
|
||||
{
|
||||
VA = vaProxy;
|
||||
Log.Notice("Initializing …");
|
||||
VA.SetText("SpanshAttack.version", VERSION.ToString());
|
||||
Log.Notice("Init successful.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The Invoke method, as required by the VoiceAttack plugin API.
|
||||
/// Runs whenever a plugin context is invoked.
|
||||
/// </summary>
|
||||
/// <param name="vaProxy">The VoiceAttack proxy object.</param>
|
||||
public static void VA_Invoke1(dynamic vaProxy)
|
||||
{
|
||||
string context = vaProxy.Context.ToLower();
|
||||
Log.Debug($"Running context '{context}' …");
|
||||
try
|
||||
{
|
||||
switch (context)
|
||||
{
|
||||
case "startup":
|
||||
Context_Startup(vaProxy);
|
||||
break;
|
||||
case "edts.getcoordinates":
|
||||
// EDTS
|
||||
Context_EDTS_GetCoordinates(vaProxy);
|
||||
break;
|
||||
case "log.log":
|
||||
// log
|
||||
Context_Log(vaProxy);
|
||||
break;
|
||||
case "spansh.systemexists":
|
||||
// Spansh
|
||||
Context_Spansh_SytemExists(vaProxy);
|
||||
break;
|
||||
case "spansh.nearestsystem":
|
||||
Context_Spansh_Nearestsystem(vaProxy);
|
||||
break;
|
||||
default:
|
||||
// invalid
|
||||
Log.Error($"Invalid plugin context '{vaProxy.Context}'.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (ArgumentNullException e)
|
||||
{
|
||||
Log.Error($"Missing parameter '{e.ParamName}' for context '{context}'");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error($"Unhandled exception while executing plugin context '{context}'. ({e.Message})");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The Exit method, as required by the VoiceAttack plugin API.
|
||||
/// Runs when VoiceAttack is shut down.
|
||||
/// </summary>
|
||||
/// <param name="vaProxy">The VoiceAttack proxy object.</param>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "required by VoiceAttack plugin API")]
|
||||
public static void VA_Exit1(dynamic vaProxy)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The StopCommand method, as required by the VoiceAttack plugin API.
|
||||
/// Runs whenever all commands are stopped using the “Stop All Commands”
|
||||
/// button or action.
|
||||
/// </summary>
|
||||
public static void VA_StopCommand()
|
||||
{
|
||||
}
|
||||
|
||||
/*================\
|
||||
| plugin contexts |
|
||||
\================*/
|
||||
|
||||
#pragma warning disable IDE0060 // Remove unused parameter
|
||||
private static void Context_EDTS_GetCoordinates(dynamic vaProxy)
|
||||
{
|
||||
string name = vaProxy.GetText("~system") ?? throw new ArgumentNullException("~system");
|
||||
|
@ -51,11 +180,13 @@ namespace SpanshAttack
|
|||
vaProxy.SetInt("~precision", system.Coords.Precision);
|
||||
|
||||
success = true;
|
||||
} catch (ArgumentException e)
|
||||
}
|
||||
catch (ArgumentException e)
|
||||
{
|
||||
errorType = "invalid name";
|
||||
errorMessage = e.Message;
|
||||
} catch (Exception e)
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
errorType = "connection error";
|
||||
errorMessage = e.Message;
|
||||
|
@ -85,7 +216,10 @@ namespace SpanshAttack
|
|||
{
|
||||
Log.Log(message, (LogLevel)Enum.Parse(typeof(LogLevel), level.ToUpper()));
|
||||
}
|
||||
catch (ArgumentNullException) { throw; }
|
||||
catch (ArgumentNullException)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
Log.Error($"Invalid log level '{level}'.");
|
||||
|
@ -104,11 +238,11 @@ namespace SpanshAttack
|
|||
|
||||
Process p = PythonProxy.SetupPythonScript(path, arguments);
|
||||
|
||||
Dictionary<char, decimal> coords = new Dictionary<char, decimal> { { 'x', 0 }, { 'y', 0 }, { 'z', 0 } };
|
||||
string system = "";
|
||||
Dictionary<char, decimal> coords = new () { { 'x', 0 }, { 'y', 0 }, { 'z', 0 } };
|
||||
string system = string.Empty;
|
||||
decimal distance = 0;
|
||||
bool error = false;
|
||||
string errorMessage = "";
|
||||
string errorMessage = string.Empty;
|
||||
|
||||
p.Start();
|
||||
string stdout = p.StandardOutput.ReadToEnd();
|
||||
|
@ -159,7 +293,7 @@ namespace SpanshAttack
|
|||
|
||||
bool exists = true;
|
||||
bool error = false;
|
||||
string errorMessage = "";
|
||||
string errorMessage = string.Empty;
|
||||
|
||||
p.Start();
|
||||
string stdout = p.StandardOutput.ReadToEnd();
|
||||
|
@ -195,75 +329,8 @@ namespace SpanshAttack
|
|||
private static void Context_Startup(dynamic vaProxy)
|
||||
{
|
||||
Log.Notice("Starting up …");
|
||||
VA = vaProxy;
|
||||
Log.Notice("Finished startup.");
|
||||
}
|
||||
|
||||
/*========================================\
|
||||
| required VoiceAttack plugin shenanigans |
|
||||
\========================================*/
|
||||
|
||||
static readonly Version VERSION = new Version("7.2.1");
|
||||
|
||||
public static Guid VA_Id()
|
||||
=> new Guid("{e722b29d-898e-47dd-a843-a409c87e0bd8}");
|
||||
public static string VA_DisplayName()
|
||||
=> $"SpanshAttack {VERSION}";
|
||||
public static string VA_DisplayInfo()
|
||||
=> "SpanshAttack: a plugin for doing routing with spansh.co.uk for Elite: Dangerous.";
|
||||
|
||||
public static void VA_Init1(dynamic vaProxy)
|
||||
{
|
||||
VA = vaProxy;
|
||||
Log.Notice("Initializing …");
|
||||
VA.SetText("SpanshAttack.version", VERSION.ToString());
|
||||
Log.Notice("Init successful.");
|
||||
}
|
||||
|
||||
public static void VA_Invoke1(dynamic vaProxy)
|
||||
{
|
||||
string context = vaProxy.Context.ToLower();
|
||||
Log.Debug($"Running context '{context}' …");
|
||||
try
|
||||
{
|
||||
switch (context)
|
||||
{
|
||||
case "startup":
|
||||
Context_Startup(vaProxy);
|
||||
break;
|
||||
// EDTS
|
||||
case "edts.getcoordinates":
|
||||
Context_EDTS_GetCoordinates(vaProxy);
|
||||
break;
|
||||
// log
|
||||
case "log.log":
|
||||
Context_Log(vaProxy);
|
||||
break;
|
||||
// Spansh
|
||||
case "spansh.systemexists":
|
||||
Context_Spansh_SytemExists(vaProxy);
|
||||
break;
|
||||
case "spansh.nearestsystem":
|
||||
Context_Spansh_Nearestsystem(vaProxy);
|
||||
break;
|
||||
// invalid
|
||||
default:
|
||||
Log.Error($"Invalid plugin context '{vaProxy.Context}'.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (ArgumentNullException e)
|
||||
{
|
||||
Log.Error($"Missing parameter '{e.ParamName}' for context '{context}'");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error($"Unhandled exception while executing plugin context '{context}'. ({e.Message})");
|
||||
}
|
||||
}
|
||||
|
||||
public static void VA_Exit1(dynamic vaProxy) { }
|
||||
|
||||
public static void VA_StopCommand() { }
|
||||
#pragma warning restore IDE0060 // Remove unused parameter
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
<DocumentationFile>..\build\alterNERDtive\SpanshAttack.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
|
@ -30,7 +30,7 @@
|
|||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
<DocumentationFile>..\build\alterNERDtive\SpanshAttack.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
|
|
28
plugins/VoiceAttack-base/GlobalSuppressions.cs
Normal file
28
plugins/VoiceAttack-base/GlobalSuppressions.cs
Normal file
|
@ -0,0 +1,28 @@
|
|||
// <copyright file="GlobalSuppressions.cs" company="alterNERDtive">
|
||||
// Copyright 2019–2022 alterNERDtive.
|
||||
//
|
||||
// This file is part of alterNERDtive VoiceAttack profiles for Elite Dangerous.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with alterNERDtive VoiceAttack profiles for Elite Dangerous. If not, see <https://www.gnu.org/licenses/>.
|
||||
// </copyright>
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This file is used by Code Analysis to maintain SuppressMessage
|
||||
// attributes that are applied to this project.
|
||||
// Project-level suppressions either have no target or are given
|
||||
// a specific target and scoped to a namespace, type, member, etc.
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "just cause", Scope = "namespace", Target = "~N:alterNERDtive")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "just cause", Scope = "namespace", Target = "~N:alterNERDtive.edts")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "just cause", Scope = "namespace", Target = "~N:alterNERDtive.util")]
|
|
@ -1,4 +1,23 @@
|
|||
using System.Reflection;
|
||||
// <copyright file="AssemblyInfo.cs" company="alterNERDtive">
|
||||
// Copyright 2019–2022 alterNERDtive.
|
||||
//
|
||||
// This file is part of alterNERDtive VoiceAttack profiles for Elite Dangerous.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with alterNERDtive VoiceAttack profiles for Elite Dangerous. If not, see <https://www.gnu.org/licenses/>.
|
||||
// </copyright>
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
@ -10,7 +29,7 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("VoiceAttack-base")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020–2022")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
|
|
@ -16,8 +16,9 @@
|
|||
<TabItem Name="StreamAttack" Header="StreamAttack"></TabItem>
|
||||
</TabControl>
|
||||
<WrapPanel VerticalAlignment="Bottom" HorizontalAlignment="Right">
|
||||
<Button Name="cancelButton" Click="cancelButton_Click" Padding="5" Margin="5">Cancel</Button>
|
||||
<Button Name="okButton" Click="okButton_Click" Padding="5" Margin="5">OK</Button>
|
||||
<Button Name="applyButton" Click="ApplyButton_Click" Padding="5" Margin="5" Width="100">Apply</Button>
|
||||
<Button Name="okButton" Click="OkButton_Click" Padding="5" Margin="5" Width="100">Done</Button>
|
||||
<Button Name="cancelButton" Click="CancelButton_Click" Padding="5" Margin="5" Width="100">Cancel</Button>
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
|
|
@ -1,4 +1,25 @@
|
|||
using System;
|
||||
// <copyright file="SettingsDialog.xaml.cs" company="alterNERDtive">
|
||||
// Copyright 2019–2022 alterNERDtive.
|
||||
//
|
||||
// This file is part of alterNERDtive VoiceAttack profiles for Elite Dangerous.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with alterNERDtive VoiceAttack profiles for Elite Dangerous. If not, see <https://www.gnu.org/licenses/>.
|
||||
// </copyright>
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
@ -6,33 +27,27 @@ using System.Windows.Controls;
|
|||
namespace alterNERDtive
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for SettingsDialog.xaml
|
||||
/// Interaction logic for SettingsDialog.xaml.
|
||||
/// </summary>
|
||||
public partial class SettingsDialog : UserControl
|
||||
{
|
||||
private struct Setting
|
||||
{
|
||||
public string Profile { get; }
|
||||
public dynamic Option { get; }
|
||||
public dynamic Value { get; }
|
||||
public dynamic UiElement { get; }
|
||||
|
||||
public Setting(string profile, dynamic option, dynamic value, dynamic uiElement)
|
||||
=> (Profile, Option, Value, UiElement) = (profile, option, value, uiElement);
|
||||
}
|
||||
|
||||
private List<Setting> values = new List<Setting>();
|
||||
private readonly List<Setting> values = new List<Setting>();
|
||||
private util.Configuration config;
|
||||
private util.VoiceAttackLog log;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SettingsDialog"/> class.
|
||||
/// </summary>
|
||||
/// <param name="config">The plugin Configuration.</param>
|
||||
/// <param name="log">The plugin Log.</param>
|
||||
public SettingsDialog(util.Configuration config, util.VoiceAttackLog log)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.InitializeComponent();
|
||||
|
||||
this.config = config;
|
||||
this.log = log;
|
||||
|
||||
foreach (TabItem tab in tabs.Items)
|
||||
foreach (TabItem tab in this.tabs.Items)
|
||||
{
|
||||
string profile = tab.Name;
|
||||
if (profile == "general")
|
||||
|
@ -43,7 +58,7 @@ namespace alterNERDtive
|
|||
tab.IsEnabled = BasePlugin.IsProfileActive(profile);
|
||||
|
||||
StackPanel panel = new StackPanel();
|
||||
util.Configuration.OptDict<string, util.Configuration.Option> options = config.GetOptions(profile);
|
||||
util.Configuration.OptDict<string, util.Configuration.Option> options = util.Configuration.GetOptions(profile);
|
||||
|
||||
foreach (dynamic option in options.Values)
|
||||
{
|
||||
|
@ -57,7 +72,7 @@ namespace alterNERDtive
|
|||
checkBox.IsChecked = value;
|
||||
checkBox.VerticalAlignment = VerticalAlignment.Center;
|
||||
row.Children.Add(checkBox);
|
||||
values.Add(new Setting(profile, option, value, checkBox));
|
||||
this.values.Add(new Setting(profile, option, value, checkBox));
|
||||
|
||||
Label label = new Label();
|
||||
label.Content = option.Description;
|
||||
|
@ -76,7 +91,7 @@ namespace alterNERDtive
|
|||
TextBox input = new TextBox();
|
||||
input.Text = value.ToString();
|
||||
row.Children.Add(input);
|
||||
values.Add(new Setting(profile, option, value, input));
|
||||
this.values.Add(new Setting(profile, option, value, input));
|
||||
|
||||
panel.Children.Add(row);
|
||||
}
|
||||
|
@ -86,19 +101,13 @@ namespace alterNERDtive
|
|||
}
|
||||
}
|
||||
|
||||
private void cancelButton_Click(object sender, RoutedEventArgs e)
|
||||
private bool ApplySettings()
|
||||
{
|
||||
Window.GetWindow(this).Close();
|
||||
log.Log("Settings dialog cancelled.", util.LogLevel.DEBUG);
|
||||
}
|
||||
bool success = true;
|
||||
|
||||
private void okButton_Click(object sender, RoutedEventArgs reargs)
|
||||
{
|
||||
bool error = false;
|
||||
|
||||
foreach (Setting setting in values)
|
||||
foreach (Setting setting in this.values)
|
||||
{
|
||||
dynamic state = null;
|
||||
dynamic? state = null;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -129,21 +138,51 @@ namespace alterNERDtive
|
|||
|
||||
if (state != setting.Value)
|
||||
{
|
||||
log.Log($@"Configuration changed via settings dialog: ""{setting.Profile}.{setting.Option.Name}"" → ""{state}""", util.LogLevel.DEBUG);
|
||||
config.SetConfig(setting.Profile, setting.Option.Name, state);
|
||||
this.log.Log($@"Configuration changed via settings dialog: ""{setting.Profile}.{setting.Option.Name}"" → ""{state}""", util.LogLevel.DEBUG);
|
||||
this.config.SetConfig(setting.Profile, setting.Option.Name, state);
|
||||
}
|
||||
}
|
||||
catch (Exception e) when (e is ArgumentNullException || e is FormatException || e is OverflowException)
|
||||
{
|
||||
log.Log($@"Invalid value for ""{setting.Profile}.{setting.Option.Name}"": ""{((TextBox)setting.UiElement).Text}""", util.LogLevel.ERROR);
|
||||
error = true;
|
||||
this.log.Log($@"Invalid value for ""{setting.Profile}.{setting.Option.Name}"": ""{((TextBox)setting.UiElement).Text}""", util.LogLevel.ERROR);
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!error)
|
||||
return success;
|
||||
}
|
||||
|
||||
private void CancelButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Window.GetWindow(this).Close();
|
||||
this.log.Log("Settings dialog cancelled.", util.LogLevel.DEBUG);
|
||||
}
|
||||
|
||||
private void OkButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.ApplySettings())
|
||||
{
|
||||
Window.GetWindow(this).Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplyButton_Click(object sender, RoutedEventArgs reeargs)
|
||||
{
|
||||
this.ApplySettings();
|
||||
}
|
||||
|
||||
private struct Setting
|
||||
{
|
||||
public Setting(string profile, dynamic option, dynamic value, dynamic uiElement)
|
||||
=> (this.Profile, this.Option, this.Value, this.UiElement) = (profile, option, value, uiElement);
|
||||
|
||||
public string Profile { get; }
|
||||
|
||||
public dynamic Option { get; }
|
||||
|
||||
public dynamic Value { get; }
|
||||
|
||||
public dynamic UiElement { get; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
<DocumentationFile>..\build\alterNERDtive\base.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>none</DebugType>
|
||||
|
@ -33,46 +33,50 @@
|
|||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
<DocumentationFile>..\build\alterNERDtive\base.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Net.Http.Formatting, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="base.cs" />
|
||||
<Compile Include="edts.cs" />
|
||||
<Compile Include="edts.cs">
|
||||
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
|
||||
</Compile>
|
||||
<Compile Include="GlobalSuppressions.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SettingsDialog.xaml.cs">
|
||||
<DependentUpon>SettingsDialog.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="util.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="SettingsDialog.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNet.WebApi.Client">
|
||||
<Version>5.2.9</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Newtonsoft.Json">
|
||||
<Version>13.0.1</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="System.Net.Http">
|
||||
<Version>4.3.4</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
|
@ -1,6 +1,24 @@
|
|||
#nullable enable
|
||||
// <copyright file="base.cs" company="alterNERDtive">
|
||||
// Copyright 2019–2022 alterNERDtive.
|
||||
//
|
||||
// This file is part of alterNERDtive VoiceAttack profiles for Elite Dangerous.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with alterNERDtive VoiceAttack profiles for Elite Dangerous. If not, see <https://www.gnu.org/licenses/>.
|
||||
// </copyright>
|
||||
|
||||
#nullable enable
|
||||
|
||||
using alterNERDtive.util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
@ -9,31 +27,190 @@ using System.Net;
|
|||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
|
||||
using alterNERDtive.util;
|
||||
|
||||
namespace alterNERDtive
|
||||
{
|
||||
/// <summary>
|
||||
/// This is the base plugin orchestrating all the profile-specific plugins
|
||||
/// to work together properly. It handles things like configuration or
|
||||
/// subscribing to VoiceAttack-triggered events.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "F off :)")]
|
||||
public class BasePlugin
|
||||
{
|
||||
private static dynamic? VA { get; set; }
|
||||
private static readonly Dictionary<Guid, string> Profiles = new Dictionary<Guid, string> {
|
||||
private static readonly Version VERSION = new ("4.5");
|
||||
|
||||
private static readonly Dictionary<Guid, string> Profiles = new ()
|
||||
{
|
||||
{ new Guid("{F7F59CFD-1AE2-4A7E-8F62-C62372418BAC}"), "alterNERDtive-base" },
|
||||
{ new Guid("{f31b575b-6ce4-44eb-91fc-7459e55013cf}"), "EliteAttack" },
|
||||
{ new Guid("{87276668-2a6e-4d80-af77-80651daa58b7}"), "RatAttack" },
|
||||
{ new Guid("{e722b29d-898e-47dd-a843-a409c87e0bd8}"), "SpanshAttack" },
|
||||
{ new Guid("{05580e6c-442c-46cd-b36f-f5a1f967ec59}"), "StreamAttack" }
|
||||
{ new Guid("{05580e6c-442c-46cd-b36f-f5a1f967ec59}"), "StreamAttack" },
|
||||
};
|
||||
private static readonly List<string> ActiveProfiles = new List<string>();
|
||||
private static readonly List<string> InstalledProfiles = new List<string>();
|
||||
|
||||
private static readonly Regex ConfigurationVariableRegex = new Regex(@$"(?<id>({String.Join("|", Profiles.Values)}))\.(?<name>.+)#");
|
||||
private static readonly List<string> ActiveProfiles = new ();
|
||||
private static readonly List<string> InstalledProfiles = new ();
|
||||
|
||||
private static VoiceAttackLog Log => log ??= new VoiceAttackLog(VA, "alterNERDtive-base");
|
||||
private static readonly Regex ConfigurationVariableRegex = new (@$"(?<id>({string.Join("|", Profiles.Values)}))\.(?<name>.+)#");
|
||||
|
||||
private static VoiceAttackCommands? commands;
|
||||
private static Configuration? config;
|
||||
private static VoiceAttackLog? log;
|
||||
|
||||
private static VoiceAttackCommands Commands => commands ??= new VoiceAttackCommands(VA, Log);
|
||||
private static VoiceAttackCommands? commands;
|
||||
private static VoiceAttackCommands Commands => commands ??= new (VA, Log);
|
||||
|
||||
private static Configuration Config => config ??= new Configuration(VA, Log, Commands, "alterNERDtive-base");
|
||||
private static Configuration? config;
|
||||
private static Configuration Config => config ??= new (VA, Log, Commands, "alterNERDtive-base");
|
||||
|
||||
private static VoiceAttackLog Log => log ??= new (VA, "alterNERDtive-base");
|
||||
|
||||
private static dynamic? VA { get; set; }
|
||||
|
||||
/*========================================\
|
||||
| required VoiceAttack plugin shenanigans |
|
||||
\========================================*/
|
||||
|
||||
/// <summary>
|
||||
/// The plugin’s GUID, as required by the VoiceAttack plugin API.
|
||||
/// </summary>
|
||||
/// <returns>The GUID.</returns>
|
||||
public static Guid VA_Id()
|
||||
=> new ("{F7F59CFD-1AE2-4A7E-8F62-C62372418BAC}");
|
||||
|
||||
/// <summary>
|
||||
/// The plugin’s display name, as required by the VoiceAttack plugin API.
|
||||
/// </summary>
|
||||
/// <returns>The display name.</returns>
|
||||
public static string VA_DisplayName()
|
||||
=> $"alterNERDtive-base {VERSION}";
|
||||
|
||||
/// <summary>
|
||||
/// The plugin’s description, as required by the VoiceAttack plugin API.
|
||||
/// </summary>
|
||||
/// <returns>The description.</returns>
|
||||
public static string VA_DisplayInfo()
|
||||
=> "The alterNERDtive plugin to manage all the alterNERDtive profiles!";
|
||||
|
||||
/// <summary>
|
||||
/// The Init method, as required by the VoiceAttack plugin API.
|
||||
/// Runs when the plugin is initially loaded.
|
||||
/// </summary>
|
||||
/// <param name="vaProxy">The VoiceAttack proxy object.</param>
|
||||
public static void VA_Init1(dynamic vaProxy)
|
||||
{
|
||||
VA = vaProxy;
|
||||
Log.Notice("Initializing …");
|
||||
VA.SetText("alterNERDtive-base.version", VERSION.ToString());
|
||||
vaProxy.BooleanVariableChanged += new Action<string, bool?, bool?, Guid?>((name, from, to, id) => { ConfigurationChanged(name, from, to, id); });
|
||||
vaProxy.DateVariableChanged += new Action<string, DateTime?, DateTime?, Guid?>((name, from, to, id) => { ConfigurationChanged(name, from, to, id); });
|
||||
vaProxy.DecimalVariableChanged += new Action<string, decimal?, decimal?, Guid?>((name, from, to, id) => { ConfigurationChanged(name, from, to, id); });
|
||||
vaProxy.IntegerVariableChanged += new Action<string, int?, int?, Guid?>((name, from, to, id) => { ConfigurationChanged(name, from, to, id); });
|
||||
vaProxy.TextVariableChanged += new Action<string, string, string, Guid?>((name, from, to, id) => { ConfigurationChanged(name, from, to, id); });
|
||||
VA.SetBoolean("alterNERDtive-base.initialized", true);
|
||||
Commands.TriggerEvent("alterNERDtive-base.initialized", wait: false, logMissing: false);
|
||||
Log.Notice("Init successful.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The Invoke method, as required by the VoiceAttack plugin API.
|
||||
/// Runs whenever a plugin context is invoked.
|
||||
/// </summary>
|
||||
/// <param name="vaProxy">The VoiceAttack proxy object.</param>
|
||||
public static void VA_Invoke1(dynamic vaProxy)
|
||||
{
|
||||
string context = vaProxy.Context.ToLower();
|
||||
Log.Debug($"Running context '{context}' …");
|
||||
try
|
||||
{
|
||||
switch (context)
|
||||
{
|
||||
case "startup":
|
||||
Context_Startup(vaProxy);
|
||||
break;
|
||||
case "config.dialog":
|
||||
// config
|
||||
Context_Config_Dialog(vaProxy);
|
||||
break;
|
||||
case "config.dump":
|
||||
Context_Config_Dump(vaProxy);
|
||||
break;
|
||||
case "config.getvariables":
|
||||
Context_Config_SetVariables(vaProxy);
|
||||
break;
|
||||
case "config.list":
|
||||
Context_Config_List(vaProxy);
|
||||
break;
|
||||
case "config.setup":
|
||||
Context_Config_Setup(vaProxy);
|
||||
break;
|
||||
case "config.versionmigration":
|
||||
Context_Config_VersionMigration(vaProxy);
|
||||
break;
|
||||
case "edsm.bodycount":
|
||||
// EDSM
|
||||
Context_EDSM_BodyCount(vaProxy);
|
||||
break;
|
||||
case "edsm.distancebetween":
|
||||
Context_EDSM_DistanceBetween(vaProxy);
|
||||
break;
|
||||
case "eddi.event":
|
||||
// EDDI
|
||||
Context_Eddi_Event(vaProxy);
|
||||
break;
|
||||
case "spansh.outdatedstations":
|
||||
// Spansh
|
||||
Context_Spansh_OutdatedStations(vaProxy);
|
||||
break;
|
||||
case "log.log":
|
||||
// log
|
||||
Context_Log(vaProxy);
|
||||
break;
|
||||
case "update.check":
|
||||
// update
|
||||
Context_Update_Check(vaProxy);
|
||||
break;
|
||||
default:
|
||||
// invalid
|
||||
Log.Error($"Invalid plugin context '{vaProxy.Context}'.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (ArgumentNullException e)
|
||||
{
|
||||
Log.Error($"Missing parameter '{e.ParamName}' for context '{context}'");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error($"Unhandled exception while executing plugin context '{context}'. ({e.Message})");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The Exit method, as required by the VoiceAttack plugin API.
|
||||
/// Runs when VoiceAttack is shut down.
|
||||
/// </summary>
|
||||
/// <param name="vaProxy">The VoiceAttack proxy object.</param>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "required by VoiceAttack plugin API")]
|
||||
public static void VA_Exit1(dynamic vaProxy)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The StopCommand method, as required by the VoiceAttack plugin API.
|
||||
/// Runs whenever all commands are stopped using the “Stop All Commands”
|
||||
/// button or action.
|
||||
/// </summary>
|
||||
public static void VA_StopCommand()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether a given profile is currently active.
|
||||
/// </summary>
|
||||
/// <param name="profileName">The name of the profile in question.</param>
|
||||
/// <returns>The state of the profile in question.</returns>
|
||||
public static bool IsProfileActive(string profileName) => ActiveProfiles.Contains(profileName);
|
||||
|
||||
private static void CheckProfiles(dynamic vaProxy)
|
||||
{
|
||||
|
@ -43,20 +220,21 @@ namespace alterNERDtive
|
|||
foreach (KeyValuePair<Guid, string> profile in Profiles)
|
||||
{
|
||||
if (vaProxy.Command.Exists($"(({profile.Value}.startup))"))
|
||||
// Sadly there is no way to find _active_ profiles, so we have to check the one command that always is in them.
|
||||
{
|
||||
// Sadly there is no way to find _active_ profiles, so we have to check the one command that always is in them.
|
||||
ActiveProfiles.Add(profile.Value);
|
||||
}
|
||||
|
||||
if (vaProxy.Profile.Exists(profile.Key))
|
||||
{
|
||||
InstalledProfiles.Add(profile.Value);
|
||||
}
|
||||
}
|
||||
|
||||
Log.Debug($"Profiles found: {string.Join<string>(", ", ActiveProfiles)}");
|
||||
}
|
||||
|
||||
public static bool IsProfileActive(string profileName) => ActiveProfiles.Contains(profileName);
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "required by VoiceAttack plugin API")]
|
||||
private static void ConfigurationChanged(string option, dynamic? from, dynamic? to, Guid? guid = null)
|
||||
{
|
||||
try
|
||||
|
@ -68,7 +246,8 @@ namespace alterNERDtive
|
|||
string name = match.Groups["name"].Value;
|
||||
Log.Debug($"Configuration has changed, '{id}.{name}': '{from}' → '{to}'");
|
||||
|
||||
dynamic o = Config.GetOption(id, name);
|
||||
dynamic o = Configuration.GetOption(id, name);
|
||||
|
||||
// When loaded from profile but not explicitly set, will be null.
|
||||
// Then load default.
|
||||
// Same applies to resetting a saved option (= saving null to the profile).
|
||||
|
@ -105,7 +284,8 @@ namespace alterNERDtive
|
|||
}
|
||||
}
|
||||
|
||||
if (option == "alterNERDtive-base.eddi.quietMode#" && VA!.GetText("EDDI version") != null) // if null, EDDI isn’t up yet
|
||||
// if null, EDDI isn’t up yet
|
||||
if (option == "alterNERDtive-base.eddi.quietMode#" && VA!.GetText("EDDI version") != null)
|
||||
{
|
||||
Log.Debug($"Resetting speech responder ({(to ?? false ? "off" : "on")}) …");
|
||||
Commands.Run("alterNERDtive-base.setEDDISpeechResponder");
|
||||
|
@ -137,7 +317,8 @@ namespace alterNERDtive
|
|||
|
||||
Log.Notice($"Local version: {VERSION}, latest release: {latestVersion}.");
|
||||
|
||||
Commands.TriggerEvent("alterNERDtive-base.updateCheck",
|
||||
Commands.TriggerEvent(
|
||||
"alterNERDtive-base.updateCheck",
|
||||
parameters: new dynamic[] { new string[] { VERSION.ToString(), latestVersion.ToString() }, new bool[] { VERSION.CompareTo(latestVersion) < 0 } });
|
||||
}
|
||||
|
||||
|
@ -145,18 +326,21 @@ namespace alterNERDtive
|
|||
| plugin contexts |
|
||||
\================*/
|
||||
|
||||
#pragma warning disable IDE0060 // Remove unused parameter
|
||||
private static void Context_Config_Dialog(dynamic vaProxy)
|
||||
{
|
||||
Thread dialogThread = new Thread(new ThreadStart(() =>
|
||||
{
|
||||
_ = new System.Windows.Window
|
||||
System.Windows.Window options = new ()
|
||||
{
|
||||
Title = "alterNERDtive Profile Options",
|
||||
Content = new SettingsDialog(Config, Log),
|
||||
SizeToContent = System.Windows.SizeToContent.WidthAndHeight,
|
||||
ResizeMode = System.Windows.ResizeMode.NoResize,
|
||||
WindowStyle = System.Windows.WindowStyle.ToolWindow
|
||||
}.ShowDialog();
|
||||
WindowStyle = System.Windows.WindowStyle.ToolWindow,
|
||||
};
|
||||
options.ShowDialog();
|
||||
options.Activate();
|
||||
}));
|
||||
dialogThread.SetApartmentState(ApartmentState.STA);
|
||||
dialogThread.IsBackground = true;
|
||||
|
@ -181,6 +365,7 @@ namespace alterNERDtive
|
|||
{
|
||||
Config.SetVoiceTriggers(type);
|
||||
}
|
||||
|
||||
Config.LoadFromProfile();
|
||||
Log.Debug("Finished loading configuration.");
|
||||
}
|
||||
|
@ -194,6 +379,25 @@ namespace alterNERDtive
|
|||
|
||||
private static void Context_Config_VersionMigration(dynamic vaProxy)
|
||||
{
|
||||
// =============
|
||||
// === 4.3.1 ===
|
||||
// =============
|
||||
|
||||
// EliteAttack
|
||||
foreach (string option in new string[] { "autoStationService" })
|
||||
{
|
||||
string name = $"EliteAttack.{option}s#";
|
||||
string oldName = $"EliteAttack.{option}#";
|
||||
Commands.Run("alterNERDtive-base.loadVariableFromProfile", wait: true, parameters: new dynamic[] { new string[] { $"{oldName}", "boolean" } });
|
||||
bool? value = vaProxy.GetBoolean(oldName);
|
||||
if (value != null)
|
||||
{
|
||||
Log.Info($"Migrating option {oldName} …");
|
||||
Commands.Run("alterNERDtive-base.saveVariableToProfile", wait: true, parameters: new dynamic[] { new string[] { $"{name}" }, new bool[] { (bool)value } });
|
||||
Commands.Run("alterNERDtive-base.unsetVariableFromProfile", wait: true, parameters: new dynamic[] { new string[] { $"{oldName}", "boolean" } });
|
||||
}
|
||||
}
|
||||
|
||||
// ===========
|
||||
// === 4.2 ===
|
||||
// ===========
|
||||
|
@ -217,7 +421,7 @@ namespace alterNERDtive
|
|||
string name = $"{prefix}.{option}";
|
||||
string oldName = $"{oldPrefix}.{option}";
|
||||
Commands.Run("alterNERDtive-base.loadVariableFromProfile", wait: true, parameters: new dynamic[] { new string[] { $"{oldName}", "boolean" } });
|
||||
bool? value = VA!.GetBoolean(oldName);
|
||||
bool? value = vaProxy.GetBoolean(oldName);
|
||||
if (value != null)
|
||||
{
|
||||
Log.Info($"Migrating option {oldName} …");
|
||||
|
@ -232,7 +436,7 @@ namespace alterNERDtive
|
|||
{
|
||||
string name = $"{prefix}.{option}";
|
||||
Commands.Run("alterNERDtive-base.loadVariableFromProfile", wait: true, parameters: new dynamic[] { new string[] { $"{name}", "boolean" } });
|
||||
bool? value = VA!.GetBoolean(name);
|
||||
bool? value = vaProxy.GetBoolean(name);
|
||||
if (value != null)
|
||||
{
|
||||
Log.Info($"Migrating option {name} …");
|
||||
|
@ -240,11 +444,12 @@ namespace alterNERDtive
|
|||
Commands.Run("alterNERDtive-base.unsetVariableFromProfile", wait: true, parameters: new dynamic[] { new string[] { $"{name}", "boolean" } });
|
||||
}
|
||||
}
|
||||
|
||||
foreach (string option in new string[] { "CMDRs", "platforms" })
|
||||
{
|
||||
string name = $"{prefix}.{option}";
|
||||
Commands.Run("alterNERDtive-base.loadVariableFromProfile", wait: true, parameters: new dynamic[] { new string[] { $"{name}", "text" } });
|
||||
string value = VA!.GetText(name);
|
||||
string value = vaProxy.GetText(name);
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
Log.Info($"Migrating option {name} …");
|
||||
|
@ -259,7 +464,7 @@ namespace alterNERDtive
|
|||
{
|
||||
string name = $"{prefix}.{option}";
|
||||
Commands.Run("alterNERDtive-base.loadVariableFromProfile", wait: true, parameters: new dynamic[] { new string[] { $"{name}", "boolean" } });
|
||||
bool? value = VA!.GetBoolean(name);
|
||||
bool? value = vaProxy.GetBoolean(name);
|
||||
if (value != null)
|
||||
{
|
||||
Log.Info($"Migrating option {name} …");
|
||||
|
@ -267,11 +472,12 @@ namespace alterNERDtive
|
|||
Commands.Run("alterNERDtive-base.unsetVariableFromProfile", wait: true, parameters: new dynamic[] { new string[] { $"{name}", "boolean" } });
|
||||
}
|
||||
}
|
||||
|
||||
foreach (string option in new string[] { "announceJumpsLeft" })
|
||||
{
|
||||
string name = $"{prefix}.{option}";
|
||||
Commands.Run("alterNERDtive-base.loadVariableFromProfile", wait: true, parameters: new dynamic[] { new string[] { $"{name}", "text" } });
|
||||
string value = VA!.GetText(name);
|
||||
string value = vaProxy.GetText(name);
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
Log.Info($"Migrating option {name} …");
|
||||
|
@ -286,7 +492,7 @@ namespace alterNERDtive
|
|||
{
|
||||
string name = $"{prefix}.{option}";
|
||||
Commands.Run("alterNERDtive-base.loadVariableFromProfile", wait: true, parameters: new dynamic[] { new string[] { $"{name}", "text" } });
|
||||
string value = VA!.GetText(name);
|
||||
string value = vaProxy.GetText(name);
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
Log.Info($"Migrating option {name} …");
|
||||
|
@ -315,7 +521,7 @@ namespace alterNERDtive
|
|||
|
||||
int bodyCount = 0;
|
||||
bool error = false;
|
||||
string errorMessage = "";
|
||||
string errorMessage = string.Empty;
|
||||
|
||||
p.Start();
|
||||
string stdout = p.StandardOutput.ReadToEnd();
|
||||
|
@ -363,7 +569,7 @@ namespace alterNERDtive
|
|||
|
||||
decimal distance = 0;
|
||||
bool error = false;
|
||||
string errorMessage = "";
|
||||
string errorMessage = string.Empty;
|
||||
|
||||
p.Start();
|
||||
string stdout = p.StandardOutput.ReadToEnd();
|
||||
|
@ -386,7 +592,6 @@ namespace alterNERDtive
|
|||
Log.Error(stderr);
|
||||
errorMessage = "Unrecoverable error in plugin.";
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
vaProxy.SetDecimal("~distance", distance);
|
||||
|
@ -410,7 +615,10 @@ namespace alterNERDtive
|
|||
{
|
||||
Log.Log(message, (LogLevel)Enum.Parse(typeof(LogLevel), level.ToUpper()));
|
||||
}
|
||||
catch (ArgumentNullException) { throw; }
|
||||
catch (ArgumentNullException)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
Log.Error($"Invalid log level '{level}'.");
|
||||
|
@ -422,13 +630,13 @@ namespace alterNERDtive
|
|||
{
|
||||
string system = vaProxy.GetText("~system") ?? throw new ArgumentNullException("~system");
|
||||
int minage = vaProxy.GetInt("~minage") ?? throw new ArgumentNullException("~minage");
|
||||
bool includeSettlements = vaProxy.GetBoolean("~includeSettlements") ?? throw new ArgumentNullException("~includeSettlements");
|
||||
|
||||
string path = $@"{vaProxy.SessionState["VA_SOUNDS"]}\Scripts\spansh.exe";
|
||||
string arguments = $@"oldstations --system ""{system}"" --minage {minage}";
|
||||
string arguments = $@"oldstations --system ""{system}"" --minage {minage}{(includeSettlements ? string.Empty : " --nofeet")}";
|
||||
|
||||
Process p = PythonProxy.SetupPythonScript(path, arguments);
|
||||
|
||||
|
||||
p.Start();
|
||||
string stdout = p.StandardOutput.ReadToEnd();
|
||||
string stderr = p.StandardError.ReadToEnd();
|
||||
|
@ -457,7 +665,6 @@ namespace alterNERDtive
|
|||
Log.Error(stderr);
|
||||
errorMessage = "Unrecoverable error in plugin.";
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
vaProxy.SetText("~message", message);
|
||||
|
@ -469,7 +676,7 @@ namespace alterNERDtive
|
|||
private static void Context_Startup(dynamic vaProxy)
|
||||
{
|
||||
Log.Notice("Starting up …");
|
||||
CheckProfiles(VA);
|
||||
CheckProfiles(vaProxy);
|
||||
Log.Notice($"Active profiles: {string.Join(", ", ActiveProfiles)}");
|
||||
Commands.TriggerEventAll(ActiveProfiles, "startup", logMissing: false);
|
||||
Log.Notice("Finished startup.");
|
||||
|
@ -479,108 +686,6 @@ namespace alterNERDtive
|
|||
{
|
||||
UpdateCheck();
|
||||
}
|
||||
|
||||
/*========================================\
|
||||
| required VoiceAttack plugin shenanigans |
|
||||
\========================================*/
|
||||
|
||||
static readonly Version VERSION = new Version("4.3");
|
||||
|
||||
public static Guid VA_Id()
|
||||
=> new Guid("{F7F59CFD-1AE2-4A7E-8F62-C62372418BAC}");
|
||||
public static string VA_DisplayName()
|
||||
=> $"alterNERDtive-base {VERSION}";
|
||||
public static string VA_DisplayInfo()
|
||||
=> "The alterNERDtive plugin to manage all the alterNERDtive profiles!";
|
||||
|
||||
public static void VA_Init1(dynamic vaProxy)
|
||||
{
|
||||
VA = vaProxy;
|
||||
Log.Notice("Initializing …");
|
||||
VA.SetText("alterNERDtive-base.version", VERSION.ToString());
|
||||
vaProxy.BooleanVariableChanged += new Action<String, Boolean?, Boolean?, Guid?>((name, from, to, id) => { ConfigurationChanged(name, from, to, id); });
|
||||
vaProxy.DateVariableChanged += new Action<String, DateTime?, DateTime?, Guid?>((name, from, to, id) => { ConfigurationChanged(name, from, to, id); });
|
||||
vaProxy.DecimalVariableChanged += new Action<String, decimal?, decimal?, Guid?>((name, from, to, id) => { ConfigurationChanged(name, from, to, id); });
|
||||
vaProxy.IntegerVariableChanged += new Action<String, int?, int?, Guid?>((name, from, to, id) => { ConfigurationChanged(name, from, to, id); });
|
||||
vaProxy.TextVariableChanged += new Action<String, String, String, Guid?>((name, from, to, id) => { ConfigurationChanged(name, from, to, id); });
|
||||
VA.SetBoolean("alterNERDtive-base.initialized", true);
|
||||
Commands.TriggerEvent("alterNERDtive-base.initialized", wait: false, logMissing: false);
|
||||
Log.Notice("Init successful.");
|
||||
}
|
||||
|
||||
public static void VA_Invoke1(dynamic vaProxy)
|
||||
{
|
||||
VA = vaProxy;
|
||||
|
||||
string context = vaProxy.Context.ToLower();
|
||||
Log.Debug($"Running context '{context}' …");
|
||||
try
|
||||
{
|
||||
switch (context)
|
||||
{
|
||||
case "startup":
|
||||
Context_Startup(vaProxy);
|
||||
break;
|
||||
// config
|
||||
case "config.dialog":
|
||||
Context_Config_Dialog(vaProxy);
|
||||
break;
|
||||
case "config.dump":
|
||||
Context_Config_Dump(vaProxy);
|
||||
break;
|
||||
case "config.getvariables":
|
||||
Context_Config_SetVariables(vaProxy);
|
||||
break;
|
||||
case "config.list":
|
||||
Context_Config_List(vaProxy);
|
||||
break;
|
||||
case "config.setup":
|
||||
Context_Config_Setup(vaProxy);
|
||||
break;
|
||||
case "config.versionmigration":
|
||||
Context_Config_VersionMigration(vaProxy);
|
||||
break;
|
||||
// EDSM
|
||||
case "edsm.bodycount":
|
||||
Context_EDSM_BodyCount(vaProxy);
|
||||
break;
|
||||
case "edsm.distancebetween":
|
||||
Context_EDSM_DistanceBetween(vaProxy);
|
||||
break;
|
||||
// EDDI
|
||||
case "eddi.event":
|
||||
Context_Eddi_Event(vaProxy);
|
||||
break;
|
||||
// Spansh
|
||||
case "spansh.outdatedstations":
|
||||
Context_Spansh_OutdatedStations(vaProxy);
|
||||
break;
|
||||
// log
|
||||
case "log.log":
|
||||
Context_Log(vaProxy);
|
||||
break;
|
||||
// update
|
||||
case "update.check":
|
||||
Context_Update_Check(vaProxy);
|
||||
break;
|
||||
// invalid
|
||||
default:
|
||||
Log.Error($"Invalid plugin context '{vaProxy.Context}'.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (ArgumentNullException e)
|
||||
{
|
||||
Log.Error($"Missing parameter '{e.ParamName}' for context '{context}'");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error($"Unhandled exception while executing plugin context '{context}'. ({e.Message})");
|
||||
}
|
||||
}
|
||||
|
||||
public static void VA_Exit1(dynamic vaProxy) { }
|
||||
|
||||
public static void VA_StopCommand() { }
|
||||
#pragma warning restore IDE0060 // Remove unused parameter
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,31 @@
|
|||
#nullable enable
|
||||
// <auto-generated/>
|
||||
// Not really, but this file will not bow to StyleCop tyranny.
|
||||
// Why? Because it will be obsolete mid term anyway ;)
|
||||
|
||||
// <copyright file="edts.cs" company="alterNERDtive">
|
||||
// Copyright 2019–2022 alterNERDtive.
|
||||
//
|
||||
// This file is part of alterNERDtive VoiceAttack profiles for Elite Dangerous.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// alterNERDtive VoiceAttack profiles for Elite Dangerous is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with alterNERDtive VoiceAttack profiles for Elite Dangerous. If not, see <https://www.gnu.org/licenses/>.
|
||||
// </copyright>
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace alterNERDtive.edts
|
||||
{
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.7" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net48" />
|
||||
</packages>
|
File diff suppressed because it is too large
Load diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1
requirements.txt
Normal file
1
requirements.txt
Normal file
|
@ -0,0 +1 @@
|
|||
mkdocs-roamlinks-plugin
|
16
stylecop.json
Normal file
16
stylecop.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
|
||||
"settings": {
|
||||
"orderingRules": {
|
||||
"usingDirectivesPlacement": "outsideNamespace"
|
||||
},
|
||||
"documentationRules": {
|
||||
"companyName": "alterNERDtive",
|
||||
"copyrightText": "Copyright {year} {companyName}.\n\nThis file is part of {application}.\n\n{application} is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\n{application} is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with {application}. If not, see <https://www.gnu.org/licenses/>.",
|
||||
"variables": {
|
||||
"application": "alterNERDtive VoiceAttack profiles for Elite Dangerous",
|
||||
"year": "2019–2022"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue