Warning: You are not logged in. Once you make an edit, a temporary account will be created for you.
Learn more.
Log in or
create an account to continue receiving notifications after this account expires, and to access other features.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision |
Your text |
| Line 1: |
Line 1: |
| local p = {}
| |
| local heroes_data = mw.loadJsonData('Data:HeroData.json')
| |
|
| |
|
| -- function for if the hero is released, or in herolabs
| |
| -- logic may change in the future as Valve adds more flags
| |
| function p.get_hero_release_status(hero_key)
| |
| local hero_data = heroes_data[hero_key]
| |
| if (hero_data == nil) then return "hero_key " .. hero_key .. " is not a hero" end
| |
|
| |
| local in_herolabs = hero_data['InHeroLabs'] and hero_data['IsSelectable']
| |
| if in_herolabs == nil then in_herolabs = false end
| |
| if in_herolabs then
| |
| return "HeroLabs"
| |
| elseif not hero_data['IsDisabled'] and not hero_data['InDevelopment'] and hero_data['IsSelectable'] then
| |
| return "Released"
| |
| end
| |
|
| |
| return nil
| |
| end
| |
|
| |
| function p.demo(frame)
| |
| local hero_key = frame.args[1]
| |
| return p.get_hero_release_status(hero_key)
| |
| end
| |
|
| |
| return p
| |