NamedEvents can now be overwritten, fixed error in validating all types, replaced wiki shortcut

This commit is contained in:
Maruno17
2023-09-10 15:59:14 +01:00
parent efea53aa5a
commit 02e45ebf19
4 changed files with 6 additions and 6 deletions

View File

@@ -70,7 +70,7 @@ class NamedEvent
# Adds an event handler procedure from the event.
def add(key, proc)
@callbacks[key] = proc if !@callbacks.has_key?(key)
@callbacks[key] = proc
end
# Removes an event handler procedure from the event.

View File

@@ -190,7 +190,7 @@ module GameData
return self::DATA.keys
end
# Yields all data in numberical order.
# Yields all data in numerical order.
def each
keys = self::DATA.keys.sort
keys.each { |key| yield self::DATA[key] }

View File

@@ -159,15 +159,15 @@ module Compiler
# Ensure all weaknesses/resistances/immunities are valid types
type.weaknesses.each do |other_type|
next if GameData::Type.exists?(other_type)
raise _INTL("'{1}' is not a defined type ({2}, section {3}, Weaknesses).", other_type.to_s, path, type.id)
raise _INTL("'{1}' is not a defined type (type {2}, Weaknesses).", other_type.to_s, type.id)
end
type.resistances.each do |other_type|
next if GameData::Type.exists?(other_type)
raise _INTL("'{1}' is not a defined type ({2}, section {3}, Resistances).", other_type.to_s, path, type.id)
raise _INTL("'{1}' is not a defined type (type {2}, Resistances).", other_type.to_s, type.id)
end
type.immunities.each do |other_type|
next if GameData::Type.exists?(other_type)
raise _INTL("'{1}' is not a defined type ({2}, section {3}, Immunities).", other_type.to_s, path, type.id)
raise _INTL("'{1}' is not a defined type (type {2}, Immunities).", other_type.to_s, type.id)
end
# Get type names for translating
type_names.push(type.real_name)