mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 05:34:58 +00:00
Rewrote party screen, implemented redesign of it
This commit is contained in:
@@ -104,6 +104,10 @@ class HandlerHash
|
||||
return nil
|
||||
end
|
||||
|
||||
def keys
|
||||
return @hash.keys
|
||||
end
|
||||
|
||||
def add(id, handler = nil, &handlerBlock)
|
||||
if ![Proc, Hash].include?(handler.class) && !block_given?
|
||||
raise ArgumentError, "#{self.class.name} for #{id.inspect} has no valid handler (#{handler.inspect} was given)"
|
||||
@@ -160,6 +164,10 @@ class HandlerHashSymbol
|
||||
return nil
|
||||
end
|
||||
|
||||
def keys
|
||||
return @hash.keys
|
||||
end
|
||||
|
||||
def add(sym, handler = nil, &handlerBlock)
|
||||
if ![Proc, Hash].include?(handler.class) && !block_given?
|
||||
raise ArgumentError, "#{self.class.name} for #{sym.inspect} has no valid handler (#{handler.inspect} was given)"
|
||||
@@ -225,6 +233,10 @@ class HandlerHashEnum
|
||||
return ret
|
||||
end
|
||||
|
||||
def keys
|
||||
return @hash.keys
|
||||
end
|
||||
|
||||
def fromSymbol(sym)
|
||||
return sym unless sym.is_a?(Symbol) || sym.is_a?(String)
|
||||
mod = Object.const_get(@mod) rescue nil
|
||||
|
||||
@@ -114,6 +114,17 @@ module MenuHandlers
|
||||
sorted_keys.each do |option|
|
||||
hash = options[option]
|
||||
next if hash["condition"] && !hash["condition"].call(*args)
|
||||
if hash["multi_options"]
|
||||
extra_options = hash["multi_options"].call(*args)
|
||||
if extra_options && extra_options.length > 0
|
||||
if extra_options[0].is_a?(Array)
|
||||
extra_options.each { |opt| yield *opt }
|
||||
else
|
||||
yield *extra_options
|
||||
end
|
||||
end
|
||||
next
|
||||
end
|
||||
if hash["name"].is_a?(Proc)
|
||||
name = hash["name"].call
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user