mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 14:44:58 +00:00
Created and implemented GameData::TrainerType, fixed free text entry text mispositioning
This commit is contained in:
@@ -311,7 +311,7 @@ module Compiler
|
||||
end
|
||||
return enumer.const_get(ret.to_sym)
|
||||
elsif enumer.is_a?(Symbol) || enumer.is_a?(String)
|
||||
if [:Ability, :Item, :Move].include?(enumer)
|
||||
if [:Ability, :Item, :Move, :TrainerType].include?(enumer)
|
||||
enumer = GameData.const_get(enumer.to_sym)
|
||||
begin
|
||||
if ret == "" || !enumer.exists?(ret.to_sym)
|
||||
@@ -353,7 +353,7 @@ module Compiler
|
||||
return nil if ret=="" || !(enumer.const_defined?(ret) rescue false)
|
||||
return enumer.const_get(ret.to_sym)
|
||||
elsif enumer.is_a?(Symbol) || enumer.is_a?(String)
|
||||
if [:Ability, :Item, :Move].include?(enumer)
|
||||
if [:Ability, :Item, :Move, :TrainerType].include?(enumer)
|
||||
enumer = GameData.const_get(enumer.to_sym)
|
||||
return nil if ret == "" || !enumer.exists?(ret.to_sym)
|
||||
return ret.to_sym
|
||||
@@ -568,7 +568,7 @@ module Compiler
|
||||
clonitem.sub!(/\s*$/,"")
|
||||
itm = GameData::Item.try_get(clonitem)
|
||||
if !itm
|
||||
raise _INTL("Undefined item constant name: %s\r\nName must consist only of letters, numbers and\r\nunderscores, and can't begin with a number.\r\nMake sure the item is defined in\r\nPBS/items.txt.\r\n{1}", item, FileLineData.linereport)
|
||||
raise _INTL("Undefined item constant name: {1}\r\nName must consist only of letters, numbers and\r\nunderscores, and can't begin with a number.\r\nMake sure the item is defined in\r\nPBS/items.txt.\r\n{2}", item, FileLineData.linereport)
|
||||
end
|
||||
return itm.id.to_s
|
||||
end
|
||||
@@ -589,7 +589,7 @@ module Compiler
|
||||
mov = GameData::Move.try_get(clonmove)
|
||||
if !mov
|
||||
return nil if skip_unknown
|
||||
raise _INTL("Undefined move constant name: %s\r\nName must consist only of letters, numbers and\r\nunderscores, and can't begin with a number.\r\nMake sure the move is defined in\r\nPBS/moves.txt.\r\n{1}", move, FileLineData.linereport)
|
||||
raise _INTL("Undefined move constant name: {1}\r\nName must consist only of letters, numbers and\r\nunderscores, and can't begin with a number.\r\nMake sure the move is defined in\r\nPBS/moves.txt.\r\n{2}", move, FileLineData.linereport)
|
||||
end
|
||||
return mov.id.to_s
|
||||
end
|
||||
@@ -603,11 +603,15 @@ module Compiler
|
||||
end
|
||||
|
||||
# Unused
|
||||
def parseTrainer(item)
|
||||
clonitem = item.clone
|
||||
clonitem.sub!(/^\s*/,"")
|
||||
clonitem.sub!(/\s*$/,"")
|
||||
return pbGetConst(PBTrainers,clonitem,_INTL("Undefined Trainer constant name: %s\r\nName must consist only of letters, numbers, and\r\nunderscores and can't begin with a number.\r\nIn addition, the name must be defined\r\nin trainertypes.txt.\r\n{1}",FileLineData.linereport))
|
||||
def parseTrainer(type)
|
||||
clontype = type.clone
|
||||
clontype.sub!(/^\s*/, "")
|
||||
clontype.sub!(/\s*$/, "")
|
||||
typ = GameData::TrainerType.try_get(clontype)
|
||||
if !typ
|
||||
raise _INTL("Undefined Trainer type constant name: {1}\r\nName must consist only of letters, numbers and\r\nunderscores, and can't begin with a number.\r\nMake sure the trainer type is defined in\r\ntrainertypes.txt.\r\n{2}", type, FileLineData.linereport)
|
||||
end
|
||||
return typ.id.to_s
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -644,11 +648,11 @@ module Compiler
|
||||
yield(_INTL("Compiling Trainer data"))
|
||||
compile_trainers # Depends on PBSpecies, Item, Move
|
||||
yield(_INTL("Compiling phone data"))
|
||||
compile_phone # Depends on PBTrainers
|
||||
compile_phone
|
||||
yield(_INTL("Compiling metadata"))
|
||||
compile_metadata # Depends on PBTrainers
|
||||
compile_metadata # Depends on TrainerType
|
||||
yield(_INTL("Compiling battle Trainer data"))
|
||||
compile_trainer_lists # Depends on PBTrainers
|
||||
compile_trainer_lists # Depends on TrainerType
|
||||
yield(_INTL("Compiling encounter data"))
|
||||
compile_encounters # Depends on PBSpecies
|
||||
yield(_INTL("Compiling shadow moveset data"))
|
||||
|
||||
Reference in New Issue
Block a user