Removed all other uses of and support for ID numbers

This commit is contained in:
Maruno17
2021-06-19 20:01:12 +01:00
parent 49655165e1
commit c55324145d
15 changed files with 92 additions and 194 deletions

View File

@@ -1,31 +1,31 @@
module GameData
class Ribbon
attr_reader :id
attr_reader :id_number
attr_reader :real_name
attr_reader :real_description
attr_reader :icon_position # Where this ribbon's graphic is within ribbons.png
DATA = {}
DATA_FILENAME = "ribbons.dat"
extend ClassMethods
extend ClassMethodsSymbols
include InstanceMethods
def initialize(hash)
@id = hash[:id]
@id_number = hash[:id_number] || -1
@real_name = hash[:name] || "Unnamed"
@real_description = hash[:description] || "???"
@real_name = hash[:name] || "Unnamed"
@real_description = hash[:description] || "???"
@icon_position = hash[:icon_position] || -1
end
# @return [String] the translated name of this ribbon
def name
return pbGetMessage(MessageTypes::RibbonNames, @id_number)
return pbGetMessageFromHash(MessageTypes::RibbonNames, @real_name)
end
# @return [String] the translated description of this ribbon
def description
return pbGetMessage(MessageTypes::RibbonDescriptions, @id_number)
return pbGetMessageFromHash(MessageTypes::RibbonDescriptions, @real_description)
end
end
end