mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 21:24:59 +00:00
Minor refactoring to kill various Rubocop warnings
This commit is contained in:
@@ -212,13 +212,13 @@ class Interpreter
|
||||
# * Freezes all events on the map (for use at the beginning of common events)
|
||||
#-----------------------------------------------------------------------------
|
||||
def pbGlobalLock
|
||||
$game_map.events.values.each { |event| event.minilock }
|
||||
$game_map.events.each_value { |event| event.minilock }
|
||||
end
|
||||
#-----------------------------------------------------------------------------
|
||||
# * Unfreezes all events on the map (for use at the end of common events)
|
||||
#-----------------------------------------------------------------------------
|
||||
def pbGlobalUnlock
|
||||
$game_map.events.values.each { |event| event.unlock }
|
||||
$game_map.events.each_value { |event| event.unlock }
|
||||
end
|
||||
#-----------------------------------------------------------------------------
|
||||
# * Gets the next index in the interpreter, ignoring certain commands between messages
|
||||
|
||||
@@ -13,21 +13,15 @@ class Event
|
||||
end
|
||||
|
||||
# Removes an event handler procedure from the event.
|
||||
def -(method)
|
||||
for i in 0...@callbacks.length
|
||||
next if @callbacks[i]!=method
|
||||
@callbacks.delete_at(i)
|
||||
break
|
||||
end
|
||||
def -(other)
|
||||
@callbacks.delete(other)
|
||||
return self
|
||||
end
|
||||
|
||||
# Adds an event handler procedure from the event.
|
||||
def +(method)
|
||||
for i in 0...@callbacks.length
|
||||
return self if @callbacks[i]==method
|
||||
end
|
||||
@callbacks.push(method)
|
||||
def +(other)
|
||||
return self if @callbacks.include?(other)
|
||||
@callbacks.push(other)
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user