| 1 |
|
| 2 |
|
| 3 |
require 'pathname' |
| 4 |
|
| 5 |
require_relative 'phantom' |
| 6 |
require_relative 'listener' |
| 7 |
|
| 8 |
Plugin.create(:settings) do |
| 9 |
antomの配列で得る。 |
| 10 |
defevent :settings, prototype: [Pluggaloid::COLLECT] |
| 11 |
|
| 12 |
command(:open_setting, |
| 13 |
name: _('設定'), |
| 14 |
condition: :itself.to_proc, |
| 15 |
visible: true, |
| 16 |
icon: Skin[:settings], |
| 17 |
role: :window) do |_opt| |
| 18 |
Plugin.call(:open_setting) |
| 19 |
end |
| 20 |
|
| 21 |
画面を作る |
| 22 |
|
| 23 |
イトル |
| 24 |
面を作る無名関数 |
| 25 |
defdsl :settings do |name, &proc| |
| 26 |
name = -name |
| 27 |
|
| 28 |
collection(:settings) do |mutation| |
| 29 |
mutation << Plugin::Settings::Phantom.new( |
| 30 |
title: name, |
| 31 |
plugin: self, |
| 32 |
&proc |
| 33 |
) |
| 34 |
end |
| 35 |
|
| 36 |
性のため |
| 37 |
add_event_filter(:defined_settings) do |tabs| |
| 38 |
[tabs.melt << [name, proc, self.name]] |
| 39 |
end |
| 40 |
end |
| 41 |
end |