Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # LM² - Ignore near_screen - Ignorar near_screen
- # 26/02/18 - by LeonM²
- # Log:
- # 03/05/18 - Update - Better code | Atualização - Melhor código
- # En:
- # To ignore near_screen
- # Put a comment with
- # <ignore_near>
- # To stop ignore when changing to a new event page
- # Put a coment in the new page with
- # <stop_ignore_near>
- # Pt-Br:
- # Para ignorar near_screen
- # Adicione um comentário com
- # <ignore_near>
- # Para parar de ignorar o evento numa nova página
- # Adicione um comentário com
- # <stop_ignore_near>
- class Game_Event < Game_Character
- alias lmm_initialize_ge initialize
- def initialize(map_id, event)
- lmm_initialize_ge(map_id, event)
- @lmm_ignore_near = false
- get_setup
- end
- def get_setup
- return if !@page or !@page.list or @page.list.size <= 0
- @page.list.each do |item|
- next unless item && (item.code == 108 || item.code == 408)
- if item.parameters[0].match(/<ignore_near>/)
- @lmm_ignore_near = true
- elsif item.parameters[0].match(/<stop_ignore_near>/)
- @lmm_ignore_near = false
- end
- end
- end
- alias lmm_near_screen_ge near_the_screen?
- def near_the_screen?(dx = 12, dy = 8)
- return true if @lmm_ignore_near
- lmm_near_screen_ge(dx, dy)
- end
- alias lmm_setup_page_ge setup_page
- def setup_page(new_page)
- lmm_setup_page_ge(new_page)
- get_setup
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement