Module:DisgaeaGameNames

-- The default name for game name initals not in the name database. local failSafeName = "None"

-- For games that can be properly italicised by wrapping the two '' marks around their names. local gamesAbbreviationToFullNameList = { -- Disgaea 1 -- ["D1"] = "Disgaea: Hour of Darkness", ["D1-2"] = "Disgaea: Afternoon of Darkness", ["D1AOD"] = "Disgaea: Afternoon of Darkness", ["DPC"] = "Disgaea PC", ["D1C"] = "Disgaea 1 Complete", ["DDS"] = "Disgaea DS", -- Disgaea D2 -- ["DD2"] = "Disgaea D2: A Brighter Darkness", -- Disgaea 2 -- ["D2"] = "Disgaea 2: Cursed Memories", ["D2-2"] = "Disgaea 2: Dark Hero Days", ["D2DHD"] = "Disgaea 2: Dark Hero Days", ["D2PC"] = "Disgaea 2 PC", -- Disgaea 3 -- ["D3"] = "Disgaea 3: Absence of Justice", ["D3-2"] = "Disgaea 3: Absence of Detention", ["D3AOD"] = "Disgaea 3: Absence of Detention", -- Disgaea 4 -- ["D4"] = "Disgaea 4: A Promise Unforgotten", ["D4-2"] = "Disgaea 4: A Promise Revisited", ["D4APR"] = "Disgaea 4: A Promise Revisited", ["D4C+"] = "Disgaea 4 Complete+", -- Disgaea 5 -- ["D5"] = "Disgaea 5: Alliance of Vengeance", ["D5C"] = "Disgaea 5 Complete", -- Disgaea 6 -- ["D6"] = "Disgaea 6: Defiance of Destiny", -- Disgaea RPG -- ["RPG"] = "Disgaea RPG", ["DRPG"] = "Disgaea RPG", -- Disgaea Infinite -- ["DI"] = "Disgaea Infinite", -- Prinny 1 -- ["PRINNY"] = "Prinny: Can I Really Be the Hero?", -- Prinny 2 -- ["PRINNY2"] = "Prinny 2: Dawn of Operation Panties, Dood!", -- The Disgaea series -- ["SERIES"] = "Disgaea series", }

-- For game/series names that need to be formatted in in a specific way if we are to italicise them. -- This should override the values in gamesAbbreviationToFullNameList. local gamesAbbreviationToFullNameFormattedList = { -- The Disgaea series -- ["SERIES"] = "Disgaea series", }

-- The actual name module to return. local nameConverter = {}

-- Returns the raw name from the abbreviation argument according to the database. function nameConverter.GetRawName(frame) -- We need to use `frame.args` to get the first abbreviation argument. -- `frame.args[1]` refers to the first unnamed parameter given to the module, according to Wikipedia. -- We'll also use a function to convert the argument to be uppercase to remove case-sensitivity -- from the argument. local abbreviation = string.upper(frame.args[1])

-- Return the value from the database. return gamesAbbreviationToFullNameList[abbreviation] or failSafeName end

-- Returns an italicized name from the abbreviation argument according to the database. function nameConverter.ConvertToItalicisedName(frame) -- We need to use `frame.args` to get the first abbreviation argument. -- `frame.args[1]` refers to the first unnamed parameter given to the module, according to Wikipedia. -- We'll also use a function to convert the argument to be uppercase to remove case-sensitivity -- from the argument. local abbreviation = string.upper(frame.args[1]) -- Test to see if name can be italicised manually because there is an entry in the gamesAbbreviationToFullNameList table. local italicisedGameName if gamesAbbreviationToFullNameList[abbreviation] then italicisedGameName = "''" .. gamesAbbreviationToFullNameList[abbreviation] .. "''"   end -- Return the value from the database. return gamesAbbreviationToFullNameFormattedList[abbreviation] or italicisedGameName or failSafeName end

-- Done, return the name converter module. return nameConverter