Module:HeroData/nav: Difference between revisions

Sur (talk | contribs)
m Hero card2 now uses link param for localization
Sur (talk | contribs)
m now uses Module:HeroData/release
Line 1: Line 1:
local p = {}
local p = {}
local heroes_data = mw.loadJsonData("Data:HeroData.json")
local heroes_data = mw.loadJsonData("Data:HeroData.json")
local hero_release_module = require('Module:HeroData/release')
local lang_module = require('Module:Lang')
local lang_module = require('Module:Lang')


Line 31: Line 32:
-- if herolabs is requested, only needs to have herolabs=true
-- if herolabs is requested, only needs to have herolabs=true
-- otherwise, needs to be not disabled, in development, nd herolabs is nil or false
-- otherwise, needs to be not disabled, in development, nd herolabs is nil or false
this_in_herolabs = hero_data['InHeroLabs']
local this_hero_status = hero_release_module.get_hero_release_status(hero_key)
if this_in_herolabs == nil then this_in_herolabs = false end
if this_in_herolabs == nil then this_in_herolabs = false end
if ((in_herolabs == 'true' and this_in_herolabs) or
if ((in_herolabs == 'true' and this_hero_status == 'HeroLabs') or
(in_herolabs == 'false' and not hero_data['IsDisabled'] and not hero_data['InDevelopment'] and not this_in_herolabs)) then
(in_herolabs == 'false' and this_hero_status == 'Released')) then
local is_recommended = hero_data['IsRecommended']
local is_recommended = hero_data['IsRecommended']