Merge pull request #289 from CharlesVaneenoo/rename_next_dialogue

Rename get_next_dialogue
This commit is contained in:
Major
2016-03-19 13:52:45 +00:00
+3 -3
View File
@@ -172,7 +172,7 @@ class Dialogue
raise 'Cannot add a continue event on a dialogue with options.' if (@type == :options) raise 'Cannot add a continue event on a dialogue with options.' if (@type == :options)
raise 'Must declare either a type or a block for a continue event.' if (type.nil? && block.nil?) raise 'Must declare either a type or a block for a continue event.' if (type.nil? && block.nil?)
action = get_next_dialogue(type) unless type.nil? action = decode_next_dialogue(type) unless type.nil?
@options[0] = ->(player) { action.call(player) unless type.nil?; block.call(player) unless block.nil? } @options[0] = ->(player) { action.call(player) unless type.nil?; block.call(player) unless block.nil? }
end end
@@ -246,7 +246,7 @@ class Dialogue
raise 'Can only display options on an :options dialogue.' unless @type == :options raise 'Can only display options on an :options dialogue.' unless @type == :options
raise "Cannot display more than #{MAXIMUM_OPTION_COUNT} options on a dialogue." unless @options.size < MAXIMUM_OPTION_COUNT raise "Cannot display more than #{MAXIMUM_OPTION_COUNT} options on a dialogue." unless @options.size < MAXIMUM_OPTION_COUNT
@options[text.size] = get_next_dialogue(type) @options[text.size] = decode_next_dialogue(type)
@text << message @text << message
end end
@@ -360,7 +360,7 @@ class Dialogue
end end
# Decodes the next dialogue interface from the hash, returning a proc. # Decodes the next dialogue interface from the hash, returning a proc.
def get_next_dialogue(hash) # TODO rename def decode_next_dialogue(hash)
hash.each_pair do |key, value| hash.each_pair do |key, value|
case key case key
when :disabled then return ->(player) { } when :disabled then return ->(player) { }