Rewrote party screen, implemented redesign of it

This commit is contained in:
Maruno17
2024-09-07 21:51:54 +01:00
parent fab5fc0641
commit 2190f7c251
26 changed files with 2236 additions and 562 deletions

View File

@@ -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

View File

@@ -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