mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Made party screen use MenuHandlers
This commit is contained in:
@@ -71,6 +71,7 @@ end
|
||||
# Menus that use this module are:
|
||||
#-------------------------------------------------------------------------------
|
||||
# Pause menu
|
||||
# Party screen main interact menu
|
||||
# Pokégear main menu
|
||||
# Options screen
|
||||
# PC main menu
|
||||
@@ -97,14 +98,14 @@ module MenuHandlers
|
||||
@@handlers[menu].each { |option, hash| yield option, hash }
|
||||
end
|
||||
|
||||
def self.each_available(menu)
|
||||
def self.each_available(menu, *args)
|
||||
return if !@@handlers.has_key?(menu)
|
||||
options = @@handlers[menu]
|
||||
keys = options.keys
|
||||
sorted_keys = keys.sort_by { |option| options[option]["order"] || keys.index(option) }
|
||||
sorted_keys.each do |option|
|
||||
hash = options[option]
|
||||
next if hash["condition"] && !hash["condition"].call
|
||||
next if hash["condition"] && !hash["condition"].call(*args)
|
||||
if hash["name"].is_a?(Proc)
|
||||
name = hash["name"].call
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user