-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from splaplapla/splatoon2-inertia-cancel
スティックを傾けるとマクロを発動できる機能
- Loading branch information
Showing
16 changed files
with
458 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# スプラトゥーン2: 惰性キャンセル マクロの設定方法 | ||
|
||
* 本マクロは実験段階で、オプション名などの仕様が変更される可能性が高いです | ||
* procon_bypass_man: 0.1.21以上が必要です | ||
|
||
## 1. install_macro_pluginでマクロを有効化します | ||
* `setting.yml` に`install_macro_plugin ProconBypassMan::Plugin::Splatoon2::Macro::DaseiCancel` と書きます | ||
* これを記述することで、layer内でmacroを呼び出せるようになります | ||
|
||
```ruby | ||
install_macro_plugin ProconBypassMan::Plugin::Splatoon2::Macro::DaseiCancel | ||
``` | ||
|
||
## 2. どのlayerで発動するかを宣言します | ||
* `setting.yml` のlayer内に`macro ProconBypassMan::Plugin::Splatoon2::Macro::DaseiCancel, if_pressed: [:zl]` と書きます | ||
* `if_pressed` がどのボタンを押したときにこのマクロが発動するかの設定です | ||
* 惰性キャンセルなのでイカ状態になるためにzlを押します | ||
* `if_tilted_left_stick` がスティックを倒した時に発動するオプションで、trueを渡すと有効になります | ||
* また、傾けた時の閾値を変更することができて、trueの代わりに `{ threshold: 500 }` と書くことができます | ||
* デフォルトが500で、ここの数値を上げると、スティックを倒した判定がより厳しくなります。最大1400くらいです。 | ||
* 連打中に、マクロの発動を無効にしたい場合は `disable_macro` で無効にできます | ||
|
||
```ruby | ||
layer :up do | ||
macro ProconBypassMan::Plugin::Splatoon2::Macro::DaseiCancel, if_tilted_left_stick: true, if_pressed: [:zl] | ||
end | ||
``` | ||
```ruby | ||
layer :up do | ||
macro ProconBypassMan::Plugin::Splatoon2::Macro::DaseiCancel, if_tilted_left_stick: { threshold: 500 }, if_pressed: [:zl] | ||
end | ||
``` | ||
```ruby | ||
layer :up do | ||
disable_macro :all, if_pressed: :a | ||
disable_macro :all, if_pressed: :zr | ||
macro ProconBypassMan::Plugin::Splatoon2::Macro::DaseiCancel, if_tilted_left_stick: true, if_pressed: [:zl] | ||
end | ||
``` | ||
|
||
## 3. 設定を反映させる | ||
* 上記の記述を加えたsetting.ymlを起動中のprocon_bypass_manプロセスで読み込むには、プロセスにその旨を伝える必要があります | ||
* ラズベリーパイを再起動して、プロセスを立ち上げ直す、でも目的は達成できますが、もっと簡単にsetting.ymlを再読み込みする必要があります | ||
* 書き換えたsetting.ymlを、起動中のprocon_bypass_manプロセスへ即時反映するには、procon_bypass_manプロセスを動かしたまま、別のshellから 以下をを実行してください | ||
* setting.ymlのシンタックスが正しければ、switchとの接続が継続したままsetting.ymlの内容を読み込んでいるはずです | ||
|
||
## 設定例1 | ||
```yaml | ||
version: 1.0 | ||
setting: |- | ||
prefix_keys_for_changing_layer [:zr, :zl, :l] | ||
install_macro_plugin ProconBypassMan::Plugin::Splatoon2::Macro::DaseiCancel | ||
layer :up do | ||
disable_macro :all, if_pressed: :a | ||
disable_macro :all, if_pressed: :zr | ||
macro ProconBypassMan::Plugin::Splatoon2::Macro::DaseiCancel, if_tilted_left_stick: true, if_pressed: [:zl] | ||
end | ||
``` | ||
## 設定例2 | ||
* `open_macro` キーワードを使っても同じことが実行可能です。 | ||
* この場合は、 `install_macro_plugin` が不要です。 | ||
|
||
```yaml | ||
version: 1.0 | ||
setting: |- | ||
prefix_keys_for_changing_layer [:zr, :zl, :l] | ||
layer :up do | ||
open_macro :dacan, steps: [:pressing_r_for_0_03sec, :pressing_r_and_pressing_zl_for_0_2sec], if_tilted_left_stick: true, if_pressed: [:zl] | ||
end | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
lib/procon_bypass_man/plugin/splatoon2/macro/dasei_cancel.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module ProconBypassMan | ||
module Plugin | ||
module Splatoon2 | ||
module Macro | ||
module DaseiCancel | ||
def self.display_name | ||
:dasei_cancel | ||
end | ||
|
||
def self.steps | ||
[:pressing_r_for_0_03sec, :pressing_r_and_pressing_zl_for_0_2sec].freeze | ||
end | ||
|
||
def self.description | ||
'惰性キャンセル' | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.