Class: Deplate::Input::Play::Dialog

Inherits:
List::Description
  • Object
show all
Defined in:
lib/deplate/input/play.rb

Instance Method Summary collapse

Instance Method Details

#finish_itemObject



162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/deplate/input/play.rb', line 162

def finish_item
    # sp_alias = @deplate.variables['alias']
    # if sp_alias
    #     @item.sub!(/^[[:upper:]]+/) do |text|
    #         sp_alias[text] || text
    #     end
    # end
    # m = /^(.+?)\s+\[(.+?)\]$/.match(@item)
    # p = nil
    # if m
    #     p = m[1]
    #     acc = [Deplate::Input::Play.styled_text('play-character', m[1])]
    #     acc << '{nl}' << Deplate::Input::Play.styled_text('play-direct', m[2]) if m[2]
    #     @item = acc.join
    # else
    p = @item.match(/^\S+/)[0]
    @item = Deplate::Input::Play.styled_text('play-character', @item)
    @args['tag'] = [@args['tag'], "#{Deplate::Core.clean_name(p, :extra => ' ')}_speaks"].compact.join(',')
    # update_styles('play')
    super
end

#processObject



184
185
186
187
188
189
190
191
# File 'lib/deplate/input/play.rb', line 184

def process
    if @args['cast'] or tagged_as?('cast')
        push_styles(['play-cast'])
    else
        push_styles(['play-dialog'])
    end
    super
end