mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Automated proper enumeration of constants in GameData modules
This commit is contained in:
@@ -788,7 +788,7 @@ def pbSavePokemonData
|
|||||||
has_param = !PBEvolution.hasFunction?(method, "parameterType") || param_type != nil
|
has_param = !PBEvolution.hasFunction?(method, "parameterType") || param_type != nil
|
||||||
if has_param
|
if has_param
|
||||||
if param_type
|
if param_type
|
||||||
if [:Ability, :Item, :Move, :TrainerType, :Type].include?(param_type)
|
if GameData.const_defined?(param_type.to_sym)
|
||||||
pokedata.write("#{parameter.to_s}")
|
pokedata.write("#{parameter.to_s}")
|
||||||
else
|
else
|
||||||
cparameter = (getConstantName(param_type, parameter) rescue parameter)
|
cparameter = (getConstantName(param_type, parameter) rescue parameter)
|
||||||
@@ -1236,7 +1236,7 @@ def pbSavePokemonFormsData
|
|||||||
has_param = !PBEvolution.hasFunction?(method, "parameterType") || param_type != nil
|
has_param = !PBEvolution.hasFunction?(method, "parameterType") || param_type != nil
|
||||||
if has_param
|
if has_param
|
||||||
if param_type
|
if param_type
|
||||||
if [:Ability, :Item, :Move, :TrainerType, :Type].include?(param_type)
|
if GameData.const_defined?(param_type.to_sym)
|
||||||
pokedata.write("#{parameter.to_s}")
|
pokedata.write("#{parameter.to_s}")
|
||||||
else
|
else
|
||||||
cparameter = (getConstantName(param_type, parameter) rescue parameter)
|
cparameter = (getConstantName(param_type, parameter) rescue parameter)
|
||||||
|
|||||||
@@ -311,7 +311,7 @@ module Compiler
|
|||||||
end
|
end
|
||||||
return enumer.const_get(ret.to_sym)
|
return enumer.const_get(ret.to_sym)
|
||||||
elsif enumer.is_a?(Symbol) || enumer.is_a?(String)
|
elsif enumer.is_a?(Symbol) || enumer.is_a?(String)
|
||||||
if [:Ability, :Item, :Move, :TrainerType, :Type].include?(enumer)
|
if GameData.const_defined?(enumer.to_sym)
|
||||||
enumer = GameData.const_get(enumer.to_sym)
|
enumer = GameData.const_get(enumer.to_sym)
|
||||||
begin
|
begin
|
||||||
if ret == "" || !enumer.exists?(ret.to_sym)
|
if ret == "" || !enumer.exists?(ret.to_sym)
|
||||||
@@ -322,7 +322,6 @@ module Compiler
|
|||||||
end
|
end
|
||||||
return ret.to_sym
|
return ret.to_sym
|
||||||
end
|
end
|
||||||
|
|
||||||
enumer = Object.const_get(enumer.to_sym)
|
enumer = Object.const_get(enumer.to_sym)
|
||||||
begin
|
begin
|
||||||
if ret=="" || !enumer.const_defined?(ret)
|
if ret=="" || !enumer.const_defined?(ret)
|
||||||
@@ -353,12 +352,11 @@ module Compiler
|
|||||||
return nil if ret=="" || !(enumer.const_defined?(ret) rescue false)
|
return nil if ret=="" || !(enumer.const_defined?(ret) rescue false)
|
||||||
return enumer.const_get(ret.to_sym)
|
return enumer.const_get(ret.to_sym)
|
||||||
elsif enumer.is_a?(Symbol) || enumer.is_a?(String)
|
elsif enumer.is_a?(Symbol) || enumer.is_a?(String)
|
||||||
if [:Ability, :Item, :Move, :TrainerType, :Type].include?(enumer)
|
if GameData.const_defined?(enumer.to_sym)
|
||||||
enumer = GameData.const_get(enumer.to_sym)
|
enumer = GameData.const_get(enumer.to_sym)
|
||||||
return nil if ret == "" || !enumer.exists?(ret.to_sym)
|
return nil if ret == "" || !enumer.exists?(ret.to_sym)
|
||||||
return ret.to_sym
|
return ret.to_sym
|
||||||
end
|
end
|
||||||
|
|
||||||
enumer = Object.const_get(enumer.to_sym)
|
enumer = Object.const_get(enumer.to_sym)
|
||||||
return nil if ret=="" || !(enumer.const_defined?(ret) rescue false)
|
return nil if ret=="" || !(enumer.const_defined?(ret) rescue false)
|
||||||
return enumer.const_get(ret.to_sym)
|
return enumer.const_get(ret.to_sym)
|
||||||
|
|||||||
Reference in New Issue
Block a user