Module:Changelog: Difference between revisions
m write_tag_tree now doesnt mess up formatting with <instance tags> |
m Now uses frontfacing_date_id |
||
Line 78: | Line 78: | ||
else | else | ||
local date = config["date"] | local date = config["date"] | ||
local frontfacing_date_id = config["frontfacing_date_id"] | |||
local template_title_row = "Update history table/row" | local template_title_row = "Update history table/row" | ||
local template_args_row = {} | local template_args_row = {} | ||
local changes | local changes | ||
--05-03-2024 to May 3, 2024 | --05-03-2024 to May 3, 2024 | ||
template_args_row["update"] = frontfacing_date_id | |||
template_args_row["update"] = | |||
template_args_row["changes"] = write_changelog_lines(id, config, tag) | template_args_row["changes"] = write_changelog_lines(id, config, tag) | ||
if (template_args_row["changes"] ~= "") then | if (template_args_row["changes"] ~= "") then | ||
Line 118: | Line 118: | ||
p.write_changelog_by_date_id = function(frame) | p.write_changelog_by_date_id = function(frame) | ||
local date_id_to_write = frame.args[1] | local date_id_to_write = frame.args[1] | ||
-- Convert the date_id to frontfacing_date_id | |||
local config = changelog_configs[date_id_to_write] | |||
if config == nil then return "date id " .. date_id_to_write .. " not found" end | |||
local frontfacing_date_id_to_write = config["frontfacing_date_id"] | |||
-- Determine the previous and next update | -- Determine the previous and next update | ||
-- Find the index in dates list | -- Find the index in dates list | ||
--ordered_ids defined at global scope | --ordered_ids defined at global scope | ||
local | local previous_ff_id = '' | ||
local | local the_ff_id = '' | ||
local | local next_ff_id = '' | ||
local id_found = false | local id_found = false | ||
local frontfacing_date_id | |||
for i, id in ipairs(ordered_ids) do | for i, id in ipairs(ordered_ids) do | ||
if | frontfacing_date_id = changelog_configs[id]["frontfacing_date_id"] | ||
if frontfacing_date_id == frontfacing_date_id_to_write then | |||
--id found | --id found | ||
the_ff_id = frontfacing_date_id | |||
the_id = id | the_id = id | ||
id_found = true | id_found = true | ||
elseif id_found and | elseif id_found and next_ff_id == '' then --on next iteration, save the next id | ||
next_ff_id = frontfacing_date_id | |||
break | break | ||
end | end | ||
if not id_found then | if not id_found then | ||
previous_ff_id = frontfacing_date_id -- only update previous if the_id isnt found | |||
end | end | ||
end | end | ||
Line 144: | Line 152: | ||
end | end | ||
local template_title = 'Update layout' | local template_title = 'Update layout' | ||
local template_args = { | local template_args = { | ||
['prev_update'] = | ['prev_update'] = prev_ff_id, | ||
['current_update'] = | ['current_update'] = the_ff_id, | ||
['next_update'] = | ['next_update'] = next_ff_id, | ||
['source'] = config[link], | ['source'] = config[link], | ||
['source_title'] = | ['source_title'] = the_ff_id .. ' Update', | ||
['notes'] = mw.getCurrentFrame():preprocess(write_changelog_lines(the_id, config, 'All')) | ['notes'] = mw.getCurrentFrame():preprocess(write_changelog_lines(the_id, config, 'All')) | ||
} | } | ||
Line 179: | Line 186: | ||
-- Iterate changelog dates | -- Iterate changelog dates | ||
local frontfacing_date_id | |||
for i, id in ipairs(list) do | for i, id in ipairs(list) do | ||
-- Get frontfacing date from id | |||
frontfacing_date_id = changelog_configs[id]["frontfacing_date_id"] | |||
-- If next changelog data page doesn't yet exist, return latest page that exists | -- If next changelog data page doesn't yet exist, return latest page that exists | ||
local page_name = id_to_changelog_data_page(id) | local page_name = id_to_changelog_data_page(id) | ||
local title = mw.title.new(page_name) | local title = mw.title.new(page_name) | ||
if not (title and title.exists) then | if not (title and title.exists) then | ||
return '[[Update:' .. | return '[[Update:' .. frontfacing_date_id .. '|' .. frontfacing_date_id .. ']]' | ||
end | end | ||
Line 196: | Line 207: | ||
for _, tag in ipairs(tags) do | for _, tag in ipairs(tags) do | ||
if tag_to_search == tag then | if tag_to_search == tag then | ||
return '[[Update:' .. | return '[[Update:' .. frontfacing_date_id .. '|' .. frontfacing_date_id .. ']]' | ||
end | end | ||
end | end |
Revision as of 21:14, 24 December 2024
Overview
Generates lines of changes for all data pages. See [[Category:Changelog Dates]] for the dates of all changelogs, and Changelogs for list of all the data pages that contain a Changelog.
Functions
All of these functions are callable by wikitext, i.e. {{#invoke|Changelog|invokable_name|param1|paramN}}
write_changelog_by_tag
The main invokable that will be used. Given a specific tag, it outputs all relevant changelogs from all dates in a Template:Update history table.
Parameters
- tag - Tag to search relevant changelogs for. Should be localized, i.e. Abrams for hero_atlas in english.
- num_dates - (OPTIONAL) Number of dates to add, recommend 3 for articles. If unprovided, defaults to all.
Examples
For use on Pocket/Update history:
{{#invoke:Changelog|write_changelog_by_tag|Pocket}}
Outputs
Update | Changes |
---|---|
| |
| |
| |
| |
| |
|
For use on Pocket#Update history:
{{#invoke:Changelog|write_changelog_by_tag|Pocket|3}}
Outputs
Update | Changes |
---|---|
| |
|
write_changelog_by_date_id
Write's a specific date's changelog, as opposed to a specific tag's changelog.
Parameters
- date_id_to_write - Date-id to write, format yyyy-mm-dd, view all at [[Category:Changelog Dates]]
Examples
For a non-herolab patch page
{{#invoke:Changelog|write_changelog_by_date_id|2024-05-03}}
Updates | ||
---|---|---|
← N/A | May 3, 2024 | May 10, 2024 → |
Patch notes
General Changes
* Added a Recommend A Friend button to the dashboard that you can use to send us requests for people to include in our playtesting
* Added a Resources page to the dashboard which contains a browsable item
![](/images/thumb/3/3e/ShopIcon.png/25px-ShopIcon.png)
* Added overhead text display when another hero uses active items
* The hotkeys F1-F5 to change cameras to allied heroes now maps directly to the order of heroes on the top bar left to right
* Added the
![](/images/thumb/6/6a/Patron.png/25px-Patron.png)
* Added support for Flex Items in the Hero Sandbox
* Increased the range of the mouse sensitivity slider from 0.5→4.0 to 0.05→8.0
* Increased the default framerate cap from 120 to 400
* Improved UI display when endgame objectives are being attacked
* Added music for when the base is under attack
* Changed the local player icon on the the
![](/images/thumb/4/43/Map.png/25px-Map.png)
*
![](/images/thumb/3/3e/ShopIcon.png/25px-ShopIcon.png)
![](/images/thumb/3/3e/ShopIcon.png/25px-ShopIcon.png)
* Postgame graphs now default to team stats rather than individual
* Added borders around hero icons on the
![](/images/thumb/4/43/Map.png/25px-Map.png)
* Top bar now shows incoming players before they are fully connected
* Added console command to hide the bar at the bottom in replays ('
citadel_hide_replay_hud 1
' to hide it, 'citadel_hide_replay_hud 0
' to bring it back)* Various VOIP improvements
* Fixed open mic threshold
* Fixed various consistency issues with the presentation of
![](/images/thumb/4/45/Souls.png/25px-Souls.png)
* Fixed
![](/images/thumb/d/d5/Flying_Cloak.png/25px-Flying_Cloak.png)
* Fixed
![](/images/thumb/4/4f/Warp_Stone.png/25px-Warp_Stone.png)
* Fixed
![](/images/thumb/6/63/Fixation.png/25px-Fixation.png)
* Fixed Parry animation not playing
* Fixed various issues with the spectate UI display
* Removed the slow climbing vertical recoil on
![](/images/thumb/6/64/Yamato.png/25px-Yamato.png)
* Fixed AP count not showing if you are dead, spectating a team mate or when holding alt/tab to upgrade your abilities
Gameplay Changes
*
![](/images/thumb/9/9d/Trooper.png/25px-Trooper.png)
![](/images/thumb/f/fd/Guardian.png/25px-Guardian.png)
* Objectives now have 80% damage reduction anti-backdoor defense when there haven't been creeps nearby in a while
* The uncapturable zipline nodes near your base now extend out 2 more nodes (this means attackers can't capture ziplines quite as close to the enemy base)
* You are now silenced while carrying the Urn
* Urn bounty increased from 900 + 160/minute to 900 + 200/minute
*
![](/images/thumb/b/b4/Sinner%27s_Sacrifice.png/25px-Sinner%27s_Sacrifice.png)
*
![](/images/thumb/e/e0/Abrams.png/25px-Abrams.png)
*
![](/images/thumb/e/e0/Abrams.png/25px-Abrams.png)
![](/images/thumb/f/fd/Siphon_Life.png/25px-Siphon_Life.png)
*
![](/images/thumb/4/46/Bebop.png/25px-Bebop.png)
*
![](/images/thumb/0/05/Dynamo.png/25px-Dynamo.png)
![](/images/thumb/d/d0/Singularity.png/25px-Singularity.png)
*
![](/images/thumb/0/05/Dynamo.png/25px-Dynamo.png)
![](/images/thumb/d/d0/Singularity.png/25px-Singularity.png)
*
![](/images/thumb/8/8b/Grey_Talon.png/25px-Grey_Talon.png)
*
![](/images/thumb/8/8b/Grey_Talon.png/25px-Grey_Talon.png)
*
![](/images/thumb/8/8b/Grey_Talon.png/25px-Grey_Talon.png)
![](/images/thumb/e/e7/Guided_Owl.png/25px-Guided_Owl.png)
*
![](/images/thumb/e/e8/Haze.png/25px-Haze.png)
![](/images/thumb/7/7d/Bullet_Dance.png/25px-Bullet_Dance.png)
*
![](/images/thumb/e/e8/Haze.png/25px-Haze.png)
![](/images/thumb/e/eb/Smoke_Bomb.png/25px-Smoke_Bomb.png)
*
![](/images/thumb/d/d2/Infernus.png/25px-Infernus.png)
![](/images/thumb/b/b2/Catalyst.png/25px-Catalyst.png)
![](/images/thumb/d/d2/Infernus.png/25px-Infernus.png)
*
![](/images/thumb/d/d2/Infernus.png/25px-Infernus.png)
![](/images/thumb/a/a7/Concussive_Combustion.png/25px-Concussive_Combustion.png)
*
![](/images/thumb/2/22/Kelvin.png/25px-Kelvin.png)
![](/images/thumb/5/5d/Frost_Grenade.png/25px-Frost_Grenade.png)
*
![](/images/thumb/a/a9/Lady_Geist.png/25px-Lady_Geist.png)
*
![](/images/thumb/a/a9/Lady_Geist.png/25px-Lady_Geist.png)
*
![](/images/thumb/a/a9/Lady_Geist.png/25px-Lady_Geist.png)
*
![](/images/thumb/a/a9/Lady_Geist.png/25px-Lady_Geist.png)
![](/images/thumb/d/d4/Malice.png/25px-Malice.png)
*
![](/images/thumb/b/bb/Lash.png/25px-Lash.png)
![](/images/thumb/c/c7/Grapple.png/25px-Grapple.png)
*
![](/images/thumb/b/bb/Lash.png/25px-Lash.png)
![](/images/thumb/d/d4/Flog.png/25px-Flog.png)
*
![](/images/thumb/b/bb/Lash.png/25px-Lash.png)
![](/images/thumb/d/d4/Flog.png/25px-Flog.png)
*
![](/images/thumb/b/bb/Lash.png/25px-Lash.png)
![](/images/thumb/d/d4/Flog.png/25px-Flog.png)
*
![](/images/thumb/b/bb/Lash.png/25px-Lash.png)
![](/images/thumb/8/80/Death_Slam.png/25px-Death_Slam.png)
*
![](/images/thumb/b/bb/Lash.png/25px-Lash.png)
![](/images/thumb/8/80/Death_Slam.png/25px-Death_Slam.png)
*
![](/images/thumb/b/bb/Lash.png/25px-Lash.png)
![](/images/thumb/8/80/Death_Slam.png/25px-Death_Slam.png)
*
![](/images/thumb/d/da/McGinnis.png/25px-McGinnis.png)
![](/images/thumb/c/cc/Heavy_Barrage.png/25px-Heavy_Barrage.png)
*
![](/images/thumb/d/da/McGinnis.png/25px-McGinnis.png)
![](/images/thumb/c/cc/Heavy_Barrage.png/25px-Heavy_Barrage.png)
![](/images/thumb/c/cf/Fleetfoot.png/25px-Fleetfoot.png)
*
![](/images/thumb/e/e5/Mo_%26_Krill.png/25px-Mo_%26_Krill.png)
![](/images/thumb/7/72/Sand_Blast.png/25px-Sand_Blast.png)
*
![](/images/thumb/e/e5/Mo_%26_Krill.png/25px-Mo_%26_Krill.png)
![](/images/thumb/7/72/Sand_Blast.png/25px-Sand_Blast.png)
*
![](/images/thumb/e/e5/Mo_%26_Krill.png/25px-Mo_%26_Krill.png)
![](/images/thumb/7/72/Sand_Blast.png/25px-Sand_Blast.png)
*
![](/images/thumb/e/e5/Mo_%26_Krill.png/25px-Mo_%26_Krill.png)
![](/images/thumb/2/21/Burrow.png/25px-Burrow.png)
*
![](/images/thumb/e/e5/Mo_%26_Krill.png/25px-Mo_%26_Krill.png)
![](/images/thumb/2/21/Burrow.png/25px-Burrow.png)
*
![](/images/thumb/e/e5/Mo_%26_Krill.png/25px-Mo_%26_Krill.png)
![](/images/thumb/1/1a/Combo.png/25px-Combo.png)
*
![](/images/thumb/e/e5/Mo_%26_Krill.png/25px-Mo_%26_Krill.png)
*
![](/images/thumb/f/f3/Vindicta.png/25px-Vindicta.png)
*
![](/images/thumb/f/f3/Vindicta.png/25px-Vindicta.png)
*
![](/images/thumb/f/f3/Vindicta.png/25px-Vindicta.png)
![](/images/thumb/6/65/Stake.png/25px-Stake.png)
*
![](/images/thumb/f/f3/Vindicta.png/25px-Vindicta.png)
*
![](/images/thumb/6/64/Yamato.png/25px-Yamato.png)
![](/images/thumb/6/69/Crimson_Slash.png/25px-Crimson_Slash.png)
*
![](/images/thumb/6/64/Yamato.png/25px-Yamato.png)
![](/images/thumb/6/69/Crimson_Slash.png/25px-Crimson_Slash.png)
*
![](/images/thumb/6/64/Yamato.png/25px-Yamato.png)
![](/images/thumb/6/69/Crimson_Slash.png/25px-Crimson_Slash.png)
*
![](/images/thumb/6/64/Yamato.png/25px-Yamato.png)
![](/images/thumb/6/69/Crimson_Slash.png/25px-Crimson_Slash.png)
*
![](/images/thumb/6/64/Yamato.png/25px-Yamato.png)
![](/images/thumb/a/a7/Power_Slash.png/25px-Power_Slash.png)
*
![](/images/thumb/6/64/Yamato.png/25px-Yamato.png)
![](/images/thumb/e/eb/Flying_Strike.png/25px-Flying_Strike.png)
*
![](/images/thumb/6/64/Yamato.png/25px-Yamato.png)
![](/images/thumb/e/eb/Flying_Strike.png/25px-Flying_Strike.png)
*
![](/images/thumb/6/64/Yamato.png/25px-Yamato.png)
![](/images/thumb/e/eb/Flying_Strike.png/25px-Flying_Strike.png)
*
![](/images/thumb/6/64/Yamato.png/25px-Yamato.png)
![](/images/thumb/3/3f/Shadow_Transformation.png/25px-Shadow_Transformation.png)
*
![](/images/thumb/6/64/Yamato.png/25px-Yamato.png)
![](/images/thumb/3/3f/Shadow_Transformation.png/25px-Shadow_Transformation.png)
*
![](/images/thumb/6/64/Yamato.png/25px-Yamato.png)
![](/images/thumb/3/3f/Shadow_Transformation.png/25px-Shadow_Transformation.png)
For a herolab patch page
{{#invoke:Changelog|write_changelog_by_date_id|2024-12-06_HeroLab}}
date id 2024-12-06_HeroLab not found
write_data_pages_list
Writes list of all changelog data pages using the list of patches at Data:ChangelogConfigs.json. Used on [[Category:Changelog Dates]].
Parameters
None
Examples
{{#invoke:Changelog|write_data_pages_list}}
Outputs
Data:Changelog 2024-05-03.json
Data:Changelog 2024-05-10.json
Data:Changelog 2024-05-13.json
Data:Changelog 2024-05-16.json
Data:Changelog 2024-05-19.json
Data:Changelog 2024-05-23.json
Data:Changelog 2024-05-24.json
Data:Changelog 2024-05-30.json
Data:Changelog 2024-06-01.json
Data:Changelog 2024-06-06.json
Data:Changelog 2024-06-07.json
Data:Changelog 2024-06-13.json
Data:Changelog 2024-06-14.json
Data:Changelog 2024-06-16.json
Data:Changelog 2024-06-20.json
get_last_updated
Retrieve the last (or first) date that a tag was updated on. Planned to be used on a given tag's page, i.e. Abrams's infobox could mention that it was last updated on 2024-05-03, or that Mirage was released on 2024-05-03, etc.
Parameters
- tag - Tag to search
- last_or_first - Named optional - Must be last or first - defaults to last - Retrieves last or first date
Examples
Example using last
{{#invoke:Changelog|get_last_updated|Basic Magazine}}
Outputs
Example using first
{{#invoke:Changelog|get_last_updated|Basic Magazine|last_or_first=first}}
Outputs
local p = {};
local date_module = require('Module:Date')
local changelog_configs = mw.loadJsonData("Data:ChangelogConfigs.json")
local tag_tree = mw.loadJsonData("Data:ChangelogTagTree.json")
local dictionary_module = require('Module:Dictionary')
-- Takes in changelog_configs
-- Returns [oldest_id, next_oldest_id, ..., newest_id]
local function get_ordered_ids(data)
-- Collect the keys into a table
local keys = {}
for key in pairs(data) do
table.insert(keys, key)
end
-- Sort the keys (ascending order)
table.sort(keys)
-- Build an ordered array
local ordered_array = {}
for _, key in ipairs(keys) do
table.insert(ordered_array, key)
end
return ordered_array
end
--Global scope
local ordered_ids = get_ordered_ids(changelog_configs)
--Only Data:Changelog_05-03-2024.json is loaded right now, as it still needs work and for now it was uploaded manually, need an uploader script to handle it
--Returns all lines of a given date that has that tag
local function write_changelog_lines(id, config, tag_to_filter)
-- Get the data for the respective line
local page_name = id_to_changelog_data_page(id)
local title = mw.title.new(page_name)
if not (title and title.exists) then
return ""
end
local changelog_data = mw.loadJsonData(page_name)
local lines = ""
for index, line in ipairs(changelog_data) do
description = line["Description"]
if tag_to_filter == 'All' then
lines = lines .. description .. "<br>"
else
for index2, tag in ipairs(line["Tags"]) do
if tag == tag_to_filter then
lines = lines .. description .. "<br>"
end
end
end
end
return lines
end
-- Write changelogs table
p.write_changelog_by_tag = function(frame)
tag = frame.args[1]
num_dates_str = frame.args[2]
local num_dates
if (tag == nil) then return "tag parameter must be provided" end
if (num_dates_str ~= nil) then
num_dates = tonumber(num_dates_str)
if (num_dates == nil) then return "num_dates parameter must be numerical" end
end
local template_title = "Update history table"
local template_args = {}
local content = "\n"
-- Write changelog for each date
for index, id in ipairs(ordered_ids) do
config = changelog_configs[id]
if (num_dates_str ~= nil and index > num_dates) then
break
else
local date = config["date"]
local frontfacing_date_id = config["frontfacing_date_id"]
local template_title_row = "Update history table/row"
local template_args_row = {}
local changes
--05-03-2024 to May 3, 2024
template_args_row["update"] = frontfacing_date_id
template_args_row["changes"] = write_changelog_lines(id, config, tag)
if (template_args_row["changes"] ~= "") then
changes = mw.getCurrentFrame():expandTemplate{ title = template_title_row, args = template_args_row }
else
changes = ""
end
content = content .. mw.getCurrentFrame():preprocess(changes) .. "\n"
end
index = index+1
end
template_args["contents"] = content
return mw.getCurrentFrame():expandTemplate{ title = template_title, args = template_args }
end
function id_to_changelog_data_page(id)
return "Data:Changelog " .. id .. ".json"
end
--Shows all changelog date data pages as a list of pages
p.write_data_pages_list = function(frame)
local str = ""
for i, id in ipairs(ordered_ids) do
str = str .. "[[" .. id_to_changelog_data_page(id) .. "]]<br>"
end
return str
end
p.write_changelog_by_date_id = function(frame)
local date_id_to_write = frame.args[1]
-- Convert the date_id to frontfacing_date_id
local config = changelog_configs[date_id_to_write]
if config == nil then return "date id " .. date_id_to_write .. " not found" end
local frontfacing_date_id_to_write = config["frontfacing_date_id"]
-- Determine the previous and next update
-- Find the index in dates list
--ordered_ids defined at global scope
local previous_ff_id = ''
local the_ff_id = ''
local next_ff_id = ''
local id_found = false
local frontfacing_date_id
for i, id in ipairs(ordered_ids) do
frontfacing_date_id = changelog_configs[id]["frontfacing_date_id"]
if frontfacing_date_id == frontfacing_date_id_to_write then
--id found
the_ff_id = frontfacing_date_id
the_id = id
id_found = true
elseif id_found and next_ff_id == '' then --on next iteration, save the next id
next_ff_id = frontfacing_date_id
break
end
if not id_found then
previous_ff_id = frontfacing_date_id -- only update previous if the_id isnt found
end
end
if not id_found then
return "date_id " .. date_id_to_write .. " not found"
end
local template_title = 'Update layout'
local template_args = {
['prev_update'] = prev_ff_id,
['current_update'] = the_ff_id,
['next_update'] = next_ff_id,
['source'] = config[link],
['source_title'] = the_ff_id .. ' Update',
['notes'] = mw.getCurrentFrame():preprocess(write_changelog_lines(the_id, config, 'All'))
}
return mw.getCurrentFrame():expandTemplate{title = template_title, args = template_args}
end
p.get_last_updated = function(frame)
local tag_to_search = frame.args[1]
local last_or_first = frame.args["last_or_first"]
if last_or_first == nil or last_or_first == 'last' then
last_or_first = 'last'
else
last_or_first = 'first'
end
local list = {}
if last_or_first == 'last' then
list = ordered_ids
else
-- Create the list in reverse
for i = #ordered_ids, 1, -1 do
table.insert(list, ordered_ids[i])
end
end
-- Iterate changelog dates
local frontfacing_date_id
for i, id in ipairs(list) do
-- Get frontfacing date from id
frontfacing_date_id = changelog_configs[id]["frontfacing_date_id"]
-- If next changelog data page doesn't yet exist, return latest page that exists
local page_name = id_to_changelog_data_page(id)
local title = mw.title.new(page_name)
if not (title and title.exists) then
return '[[Update:' .. frontfacing_date_id .. '|' .. frontfacing_date_id .. ']]'
end
local changelog_data = mw.loadJsonData(page_name)
-- Iterate lines
for _, line in ipairs(changelog_data) do
local tags = line['Tags']
-- Iterate tags
for _, tag in ipairs(tags) do
if tag_to_search == tag then
return '[[Update:' .. frontfacing_date_id .. '|' .. frontfacing_date_id .. ']]'
end
end
end
end
return dictionary_module.translate('N/A')
end
function p.write_tag_tree(frame)
return p.write_branch(tag_tree, 1)
end
function p.write_branch(branch, depth)
local list_str = ""
if branch == nil then return "" end
for parent, children in pairs(branch) do
-- If parent starts with < or ends with >, its referencing individual page
-- the link won't work, so instead we just display the parent raw
local parent_str
if string.sub(parent, 1, 1) == '<' or string.sub(parent, -1) == '>' then
parent_str = parent
else
parent_str = string.format("[[%s#Update history|%s]]", parent, parent)
end
list_str = list_str .. string.rep("*", depth) .. parent_str .. "\n"
if children ~= nil then
list_str = list_str .. p.write_branch(children, depth+1)
end
end
return list_str
end
return p