| 1 |
|
| 2 |
投稿ウィジェット |
| 3 |
|
| 4 |
require_relative 'cuscadable' |
| 5 |
require_relative 'hierarchy_child' |
| 6 |
require_relative 'window' |
| 7 |
require_relative 'timeline' |
| 8 |
require_relative 'widget' |
| 9 |
|
| 10 |
class Plugin::GUI::Postbox |
| 11 |
|
| 12 |
module PostboxParent; end |
| 13 |
|
| 14 |
include Plugin::GUI::Cuscadable |
| 15 |
include Plugin::GUI::HierarchyChild |
| 16 |
include Plugin::GUI::Widget |
| 17 |
|
| 18 |
role :postbox |
| 19 |
|
| 20 |
set_parent_event :gui_postbox_join_widget |
| 21 |
|
| 22 |
set_parent_class Plugin::GUI::Postbox::PostboxParent |
| 23 |
|
| 24 |
attr_accessor :options |
| 25 |
|
| 26 |
class << self |
| 27 |
力中に他のロールに対するmikutterコマンドを実行すべきでない。 |
| 28 |
stboxの時だけ有効な値を返す |
| 29 |
|
| 30 |
すロール |
| 31 |
|
| 32 |
を、それ以外ならnil |
| 33 |
def find_role_ancestor(find) |
| 34 |
self if role == find end |
| 35 |
end |
| 36 |
|
| 37 |
def initialize(*args) |
| 38 |
super |
| 39 |
@options = {} |
| 40 |
Plugin.call(:postbox_created, self) end |
| 41 |
|
| 42 |
内容を投稿する |
| 43 |
|
| 44 |
を与えた場合は自動選択。 |
| 45 |
|
| 46 |
|
| 47 |
def post_it!(world: nil) |
| 48 |
Plugin.call(:gui_postbox_post, self, {world: world}) |
| 49 |
self |
| 50 |
end |
| 51 |
|
| 52 |
入力を受け付けているなら真。 |
| 53 |
理中か、投稿が完了して破棄されたもの |
| 54 |
|
| 55 |
中なら真 |
| 56 |
def editable? |
| 57 |
editable = Plugin.filtering(:gui_postbox_input_editable, self, false) |
| 58 |
editable.last if editable end |
| 59 |
|
| 60 |
end |
| 61 |
|
| 62 |
class Plugin::GUI::Window |
| 63 |
include Plugin::GUI::Postbox::PostboxParent end |
| 64 |
|
| 65 |
class Plugin::GUI::Timeline |
| 66 |
include Plugin::GUI::Postbox::PostboxParent end |