Convert changelog to TGUI (#58593)

This pull request converts the changelog to TGUI. 
Note: Old unused changelog files will be automatically removed on the next changelog run
Why It's Good For The Game

More consistent UI, ability to view all historic logs.
Changelog

cl Celotajs
refactor: Converted the changelog popup to TGUI
/cl
This commit is contained in:
Celotajs
2021-04-27 08:41:56 +12:00
committed by GitHub
parent d59baece0e
commit 76fb2e1712
53 changed files with 486 additions and 9411 deletions
-2
View File
@@ -42,5 +42,3 @@
## Force tab indents on dm files
*.dm whitespace=indent-with-non-tab
## Force changelog merging to use union
html/changelog.html text eol=lf merge=union
+1 -1
View File
@@ -36,7 +36,7 @@ jobs:
- name: "Compile"
if: steps.value_holder.outputs.CL_ENABLED
run: |
python tools/ss13_genchangelog.py html/changelog.html html/changelogs
python tools/ss13_genchangelog.py html/changelogs
- name: "Convert Lineendings"
if: steps.value_holder.outputs.CL_ENABLED
run: |
+1
View File
@@ -1 +1,2 @@
GLOBAL_DATUM(crew_manifest_tgui, /datum/crew_manifest)
GLOBAL_DATUM(changelog_tgui, /datum/changelog)
+32
View File
@@ -0,0 +1,32 @@
/datum/changelog
var/static/list/changelog_items = list()
/datum/changelog/ui_state()
return GLOB.always_state
/datum/changelog/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if (!ui)
ui = new(user, src, "Changelog")
ui.open()
/datum/changelog/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
if(.)
return
if(action == "get_month")
var/datum/asset/changelog_item/changelog_item = changelog_items[params["date"]]
if (!changelog_item)
changelog_item = new /datum/asset/changelog_item(params["date"])
changelog_items[params["date"]] = changelog_item
return ui.send_asset(changelog_item)
/datum/changelog/ui_static_data()
var/list/data = list( "dates" = list() )
var/regex/ymlRegex = regex(@"\.yml", "g")
for(var/archive_file in flist("[global.config.directory]/../html/changelogs/archive/"))
var/archive_date = ymlRegex.Replace(archive_file, "")
data["dates"] = list(archive_date) + data["dates"]
return data
+2 -1
View File
@@ -165,7 +165,8 @@ GLOBAL_VAR(restart_counter)
start_log(GLOB.tgui_log)
start_log(GLOB.world_shuttle_log)
GLOB.changelog_hash = md5('html/changelog.html') //for telling if the changelog has changed recently
var/latest_changelog = file("[global.config.directory]/../html/changelogs/archive/" + time2text(world.timeofday, "YYYY-MM") + ".yml")
GLOB.changelog_hash = fexists(latest_changelog) ? md5(latest_changelog) : 0 //for telling if the changelog has changed recently
if(fexists(GLOB.config_error_log))
fcopy(GLOB.config_error_log, "[GLOB.log_directory]/config_error.log")
fdel(GLOB.config_error_log)
+18
View File
@@ -248,6 +248,24 @@ GLOBAL_LIST_EMPTY(asset_datums)
#undef SPRSZ_STRIPPED
/datum/asset/changelog_item
_abstract = /datum/asset/changelog_item
var/item_filename
/datum/asset/changelog_item/New(date)
item_filename = sanitize_filename("[date].yml")
SSassets.transport.register_asset(item_filename, file("html/changelogs/archive/" + item_filename))
/datum/asset/changelog_item/send(client)
if (!item_filename)
return
. = SSassets.transport.send_assets(client, item_filename)
/datum/asset/changelog_item/get_url_mappings()
if (!item_filename)
return
. = list("[item_filename]" = SSassets.transport.get_asset_url(item_filename))
/datum/asset/spritesheet/simple
_abstract = /datum/asset/spritesheet/simple
var/list/assets
@@ -125,31 +125,6 @@
/datum/asset/simple/irv
)
/datum/asset/simple/namespaced/changelog
assets = list(
"88x31.png" = 'html/88x31.png',
"bug-minus.png" = 'html/bug-minus.png',
"cross-circle.png" = 'html/cross-circle.png',
"hard-hat-exclamation.png" = 'html/hard-hat-exclamation.png',
"image-minus.png" = 'html/image-minus.png',
"image-plus.png" = 'html/image-plus.png',
"music-minus.png" = 'html/music-minus.png',
"music-plus.png" = 'html/music-plus.png',
"tick-circle.png" = 'html/tick-circle.png',
"wrench-screwdriver.png" = 'html/wrench-screwdriver.png',
"spell-check.png" = 'html/spell-check.png',
"burn-exclamation.png" = 'html/burn-exclamation.png',
"chevron.png" = 'html/chevron.png',
"chevron-expand.png" = 'html/chevron-expand.png',
"scales.png" = 'html/scales.png',
"coding.png" = 'html/coding.png',
"ban.png" = 'html/ban.png',
"chrome-wrench.png" = 'html/chrome-wrench.png',
"changelog.css" = 'html/changelog.css'
)
parents = list("changelog.html" = 'html/changelog.html')
/datum/asset/simple/jquery
legacy = TRUE
assets = list(
+2 -1
View File
@@ -13,7 +13,8 @@
ui.open()
/datum/crew_manifest/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
if (..())
. = ..()
if(.)
return
/datum/crew_manifest/ui_data(mob/user)
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 604 B

-42
View File
@@ -1,42 +0,0 @@
.top{font-family:Tahoma,sans-serif;font-size:12px;}
h2{font-family:Tahoma,sans-serif;}
a img {border:none;}
.bgimages16 li {
padding:2px 10px 2px 30px;
background-position:6px center;
background-repeat:no-repeat;
border:1px solid #ddd;
border-left:4px solid #999;
margin-bottom:2px;
}
.bugfix {background-image:url(bug-minus.png)}
.wip {background-image:url(hard-hat-exclamation.png)}
.tweak {background-image:url(wrench-screwdriver.png)}
.qol {background-image:url(wrench-screwdriver.png)}
.soundadd {background-image:url(music-plus.png)}
.sounddel {background-image:url(music-minus.png)}
.rscdel {background-image:url(cross-circle.png)}
.rscadd {background-image:url(tick-circle.png)}
.imageadd {background-image:url(image-plus.png)}
.imagedel {background-image:url(image-minus.png)}
.spellcheck {background-image:url(spell-check.png)}
.experiment {background-image:url(burn-exclamation.png)}
.refactor {background-image:url(burn-exclamation.png)}
.code_imp {background-image:url(coding.png)}
.config {background-image:url(chrome-wrench.png)}
.admin {background-image:url(ban.png)}
.server {background-image:url(hard-hat-exclamation.png)}
.balance {background-image:url(scales.png)}
.sansserif {font-family:Tahoma,sans-serif;font-size:12px;}
.commit {margin-bottom:20px;font-size:100%;font-weight:normal;}
.changes {list-style:none;margin:5px 0;padding:0 0 0 25px;font-size:0.8em;}
.date {margin:10px 0;color:blue;border-bottom:2px solid #00f;width:60%;padding:2px 0;font-size:1em;font-weight:bold;}
.author {padding-left:10px;margin:0;font-weight:bold;font-size:0.9em;}
.drop {cursor:pointer;border:1px solid #999;display:inline;font-size:0.9em;padding:1px 20px 1px 5px;line-height:16px;}
.hidden {display:none;}
.indrop {margin:2px 0 0 0;clear:both;background:#fff;border:1px solid #ddd;padding:5px 10px;}
.indrop p {margin:0;font-size:0.8em;line-height:16px;margin:1px 0;}
.indrop img {margin-right:5px;vertical-align:middle;}
.closed {background:url(chevron-expand.png) right center no-repeat;}
.open {background:url(chevron.png) right center no-repeat;}
.lic {font-size:9px;}
+7 -9
View File
@@ -6,20 +6,20 @@
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# Valid Prefixes:
# bugfix
# - (fixes bugs)
# wip
# - (work in progress)
# tweak
# - (tweaks something)
# qol
# - (quality of life)
# soundadd
# - (adds a sound)
# sounddel
# - (removes a sound)
# rscdel
# - (adds a feature)
# rscadd
# - (adds a feature)
# rscdel
# - (removes a feature)
# imageadd
# - (adds an image or sprite)
@@ -29,8 +29,6 @@
# - (fixes spelling or grammar)
# experiment
# - (experimental change)
# tgs
# - (TGS change)
# balance
# - (balance changes)
# code_imp
@@ -45,7 +43,7 @@
# - (miscellaneous changes to server)
#################################
# Your name.
# Your name.
author: "
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
@@ -56,6 +54,6 @@ delete-after: True
# SCREW THIS UP AND IT WON'T WORK.
# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit.
# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog.
changes:
changes:
- rscadd: "Added a changelog editing system that should cause fewer conflicts and more accurate timestamps."
- rscdel: "Killed innocent kittens."
Binary file not shown.

Before

Width:  |  Height:  |  Size: 571 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 477 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 619 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 538 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 388 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 386 B

-13
View File
@@ -1,13 +0,0 @@
</div>
<b>GoonStation 13 Development Team</b>
<div class = "top">
<b>Coders:</b> Stuntwaffle, Showtime, Pantaloons, Nannek, Keelin, Exadv1, hobnob, Justicefries, 0staf, sniperchance, AngriestIBM, BrianOBlivion<br>
<b>Spriters:</b> Supernorn, Haruhi, Stuntwaffle, Pantaloons, Rho, SynthOrange, I Said No<br>
</div>
<br>
<p class="lic"><a name="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/"><img src="88x31.png" alt="Creative Commons License" /></a><br><i>Except where otherwise noted, Goon Station 13 is licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 License</a>.<br>Rights are currently extended to <a href="http://forums.somethingawful.com/">SomethingAwful Goons</a> only.</i></p>
<p class="lic">Some icons by <a href="http://p.yusukekamiyamane.com/">Yusuke Kamiyamane</a>. All rights reserved. Licensed under a <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 License</a>.</p>
</td></tr></table>
</body>
</html>
-53
View File
@@ -1,53 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>/tg/ Station 13 Changelog</title>
<link rel="stylesheet" type="text/css" href="changelog.css">
<base target="_blank" />
<script type='text/javascript'>
function changeText(tagID, newText, linkTagID){
var tag = document.getElementById(tagID);
tag.innerHTML = newText;
var linkTag = document.getElementById(linkTagID);
linkTag.removeAttribute("href");
linkTag.removeAttribute("onclick");
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<table align='center' width='650'><tr><td>
<table align='center' class="top">
<tr>
<td valign='top'>
<div align='center'><font size='3'><b>Traditional Games Space Station 13</b></font></div>
<p><div align='center'><font size='3'><a href="http://www.tgstation13.org/phpBB/">Forum</a> | <a href="http://www.tgstation13.org/wiki/Main_Page">Wiki</a> | <a href="https://github.com/tgstation/tgstation">Source Code</a></font></div></p>
<font size='2'><b>Join our <a href="https://tgstation13.org/phpBB/viewforum.php?f=60">Discord channel</a></b></font>
</td>
</tr>
</table>
<table align='center' class="top">
<tr>
<td valign='top'>
<font size='2'><b><a href='https://github.com/tgstation?tab=members'>Current Project Maintainers</a></b><br></font>
<font size='2'><b><a href='https://github.com/tgstation/tgstation/pulse/monthly'>Recent GitHub contributors</a></b><br></font>
<font size='2'><b>Thanks to:</b> Baystation 12, /vg/station, NTstation, CDK Station devs, FacepunchStation, GoonStation devs, the original Space Station 13 developers, Invisty for the title image and the countless others who have contributed to the game, issue tracker or wiki over the years.</font>
<font size='2' color='red'><b><br>Have a bug to report?</b> Visit our <a href="https://github.com/tgstation/-tg-station/issues">Issue Tracker</a>.<br></font>
<font size='2'>Please search first to ensure that the bug has not already been reported.</font>
</td>
</tr>
</table>
<!--
TO ADD AN ENTRY, ADD AND MAINTAIN YOUR OWN changelog/USERNAME.yml FILE.
*** DO NOT FUCK WITH THIS FILE OR YOU WILL CAUSE MERGE CONFLICTS. ***
-->
<div class="commit sansserif">
Binary file not shown.

Before

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 484 B

+4 -3
View File
@@ -101,9 +101,10 @@
/client/verb/changelog()
set name = "Changelog"
set category = "OOC"
var/datum/asset/simple/namespaced/changelog = get_asset_datum(/datum/asset/simple/namespaced/changelog)
changelog.send(src)
src << browse(changelog.get_htmlloader("changelog.html"), "window=changes;size=675x650")
if(!GLOB.changelog_tgui)
GLOB.changelog_tgui = new /datum/changelog()
GLOB.changelog_tgui.ui_interact(usr)
if(prefs.lastchangelog != GLOB.changelog_hash)
prefs.lastchangelog = GLOB.changelog_hash
prefs.save_preferences()
+1
View File
@@ -467,6 +467,7 @@
#include "code\datums\brain_damage\severe.dm"
#include "code\datums\brain_damage\special.dm"
#include "code\datums\brain_damage\split_personality.dm"
#include "code\datums\changelog\changelog.dm"
#include "code\datums\components\_component.dm"
#include "code\datums\components\acid.dm"
#include "code\datums\components\anti_magic.dm"
+1 -29
View File
@@ -1,29 +1 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 437.4 434.4" style="enable-background:new 0 0 437.4 434.4;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;stroke:#000000;stroke-width:0.57;stroke-miterlimit:10;}
.st1{fill:none;stroke:#000000;stroke-width:0.5;stroke-miterlimit:10;}
.st2{stroke:#000000;stroke-width:18;stroke-miterlimit:10;}
</style>
<g id="Layer_2">
</g>
<g id="Layer_1">
<g id="Layer_3">
</g>
<path class="st0" d="M41.18,306.18l84.43,84.43l-19.53,20.8c-11.26,11.99-26.1,17.98-40.93,17.98c-14.84,0-29.68-5.99-40.93-17.98
c-22.52-23.97-22.52-63.2,0-87.18L41.18,306.18z"/>
<path class="st0" d="M351.66,149.88L139.65,375.65l-84.43-84.43L269.8,62.7c22.51-23.98,59.34-23.98,81.86,0
C374.17,86.67,374.17,125.9,351.66,149.88z"/>
<path class="st1" d="M426.11,88.46c-24.57-26.71-49.15-53.42-73.72-80.13c-5.87,0.15-12.84-0.21-20.56-1.73
c-3.76-0.74-7.22-1.66-10.37-2.66l0,0c-6.96,7.41-6.96,19.53,0,26.94l79.36,84.52c6.96,7.41,18.34,7.41,25.29,0
C433.07,107.99,433.07,95.87,426.11,88.46z"/>
<path class="st1" d="M248.07,35.83c13.66,16.01,4.9,48.19-19.57,71.87c-24.47,23.68-33.21,29.27-46.88,13.25
c-13.66-16.01-2.33-26.15,22.14-49.83C228.23,47.45,234.41,19.82,248.07,35.83z"/>
<line class="st0" x1="139.93" y1="375.93" x2="139.65" y2="375.65"/>
<line class="st0" x1="125.93" y1="390.93" x2="125.61" y2="390.61"/>
<rect x="191.43" y="-6.09" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -86.5159 210.9892)" class="st2" width="40" height="432.04"/>
</g>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 437.4 434.4" style="enable-background:new 0 0 437.4 434.4" xml:space="preserve"><style>.st0{fill:none;stroke:#000;stroke-width:.57;stroke-miterlimit:10}</style><g id="Layer_1"><path class="st0" d="m41.18 306.18 84.43 84.43-19.53 20.8c-11.26 11.99-26.1 17.98-40.93 17.98-14.84 0-29.68-5.99-40.93-17.98-22.52-23.97-22.52-63.2 0-87.18l16.96-18.05zm310.48-156.3L139.65 375.65l-84.43-84.43L269.8 62.7c22.51-23.98 59.34-23.98 81.86 0 22.51 23.97 22.51 63.2 0 87.18z"/><path d="M426.11 88.46c-24.57-26.71-49.15-53.42-73.72-80.13a93.834 93.834 0 0 1-30.93-4.39c-6.96 7.41-6.96 19.53 0 26.94l79.36 84.52c6.96 7.41 18.34 7.41 25.29 0 6.96-7.41 6.96-19.53 0-26.94zM248.07 35.83c13.66 16.01 4.9 48.19-19.57 71.87-24.47 23.68-33.21 29.27-46.88 13.25-13.66-16.01-2.33-26.15 22.14-49.83 24.47-23.67 30.65-51.3 44.31-35.29z" style="stroke-width:.5;fill:none;stroke:#000;stroke-miterlimit:10"/><path class="st0" d="m139.93 375.93-.28-.28m-13.72 15.28-.32-.32"/><path transform="rotate(-45.001 211.427 209.932)" style="stroke:#000;stroke-width:18;stroke-miterlimit:10" d="M191.43-6.09h40v432.04h-40z"/></g></svg>

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

+1 -26
View File
@@ -1,26 +1 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 437.4 434.4" style="enable-background:new 0 0 437.4 434.4;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;stroke:#000000;stroke-width:0.57;stroke-miterlimit:10;}
.st1{fill:none;stroke:#000000;stroke-width:0.5;stroke-miterlimit:10;}
</style>
<g id="Layer_2">
</g>
<g id="Layer_1">
<g id="Layer_3">
</g>
<path class="st0" d="M41.18,306.18l84.43,84.43l-19.53,20.8c-11.26,11.99-26.1,17.98-40.93,17.98c-14.84,0-29.68-5.99-40.93-17.98
c-22.52-23.97-22.52-63.2,0-87.18L41.18,306.18z"/>
<path class="st0" d="M351.66,149.88L139.65,375.65l-84.43-84.43L269.8,62.7c22.51-23.98,59.34-23.98,81.86,0
C374.17,86.67,374.17,125.9,351.66,149.88z"/>
<path class="st1" d="M426.11,88.46c-24.57-26.71-49.15-53.42-73.72-80.13c-5.87,0.15-12.84-0.21-20.56-1.73
c-3.76-0.74-7.22-1.66-10.37-2.66l0,0c-6.96,7.41-6.96,19.53,0,26.94l79.36,84.52c6.96,7.41,18.34,7.41,25.29,0
C433.07,107.99,433.07,95.87,426.11,88.46z"/>
<path class="st1" d="M248.07,35.83c13.66,16.01,4.9,48.19-19.57,71.87c-24.47,23.68-33.21,29.27-46.88,13.25
c-13.66-16.01-2.33-26.15,22.14-49.83C228.23,47.45,234.41,19.82,248.07,35.83z"/>
<line class="st0" x1="139.93" y1="375.93" x2="139.65" y2="375.65"/>
<line class="st0" x1="125.93" y1="390.93" x2="125.61" y2="390.61"/>
</g>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 437.4 434.4" style="enable-background:new 0 0 437.4 434.4" xml:space="preserve"><style>.st0{fill:none;stroke:#000;stroke-width:.57;stroke-miterlimit:10}</style><g id="Layer_1"><path class="st0" d="m41.18 306.18 84.43 84.43-19.53 20.8c-11.26 11.99-26.1 17.98-40.93 17.98-14.84 0-29.68-5.99-40.93-17.98-22.52-23.97-22.52-63.2 0-87.18l16.96-18.05zm310.48-156.3L139.65 375.65l-84.43-84.43L269.8 62.7c22.51-23.98 59.34-23.98 81.86 0 22.51 23.97 22.51 63.2 0 87.18z"/><path d="M426.11 88.46c-24.57-26.71-49.15-53.42-73.72-80.13a93.834 93.834 0 0 1-30.93-4.39c-6.96 7.41-6.96 19.53 0 26.94l79.36 84.52c6.96 7.41 18.34 7.41 25.29 0 6.96-7.41 6.96-19.53 0-26.94zM248.07 35.83c13.66 16.01 4.9 48.19-19.57 71.87-24.47 23.68-33.21 29.27-46.88 13.25-13.66-16.01-2.33-26.15 22.14-49.83 24.47-23.67 30.65-51.3 44.31-35.29z" style="stroke-width:.5;fill:none;stroke:#000;stroke-miterlimit:10"/><path class="st0" d="m139.93 375.93-.28-.28m-13.72 15.28-.32-.32"/></g></svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1007 B

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="670" height="512"><path d="M655.714 228H484.286c-7.857 0-14.286 6.412-14.286 14.25v28.5c0 7.838 6.429 14.25 14.286 14.25h171.428c7.857 0 14.286-6.413 14.286-14.25v-28.5c0-7.838-6.429-14.25-14.286-14.25z" style="stroke-width:.89174"/><path d="M384 121.941V128H256V0h6.059a24 24 0 0 1 16.97 7.029l97.941 97.941a24.002 24.002 0 0 1 7.03 16.971zM248 160c-13.2 0-24-10.8-24-24V0H24C10.745 0 0 10.745 0 24v464c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24V160zm-135.46 16c26.51 0 48 21.49 48 48s-21.49 48-48 48-48-21.49-48-48 21.491-48 48-48zm208 240h-256l.485-48.485L104.54 328c4.686-4.686 11.799-4.201 16.485.485L160.54 368l103.52-103.52c4.686-4.686 12.284-4.686 16.971 0l39.514 39.515z"/></svg>

After

Width:  |  Height:  |  Size: 746 B

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="670" height="512"><path d="M655.714 228.429h-57.143v-57.143c0-7.857-6.428-14.286-14.285-14.286h-28.572c-7.857 0-14.285 6.429-14.285 14.286v57.143h-57.143c-7.857 0-14.286 6.428-14.286 14.285v28.572c0 7.857 6.429 14.285 14.286 14.285h57.143v57.143c0 7.857 6.428 14.286 14.285 14.286h28.572c7.857 0 14.285-6.429 14.285-14.286v-57.143h57.143c7.857 0 14.286-6.428 14.286-14.285v-28.572c0-7.857-6.429-14.285-14.286-14.285z" style="stroke-width:.892857"/><path d="M384 121.941V128H256V0h6.059a24 24 0 0 1 16.97 7.029l97.941 97.941a24.002 24.002 0 0 1 7.03 16.971zM248 160c-13.2 0-24-10.8-24-24V0H24C10.745 0 0 10.745 0 24v464c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24V160zm-135.46 16c26.51 0 48 21.49 48 48s-21.49 48-48 48-48-21.49-48-48 21.491-48 48-48zm208 240h-256l.485-48.485L104.54 328c4.686-4.686 11.799-4.201 16.485.485L160.54 368l103.52-103.52c4.686-4.686 12.284-4.686 16.971 0l39.514 39.515z"/></svg>

After

Width:  |  Height:  |  Size: 961 B

@@ -1,8 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 425 200" opacity=".33">
<path d="m 178.00399,0.03869 -71.20393,0 a 6.7613422,6.0255495 0 0 0 -6.76134,6.02555 l 0,187.87147 a 6.7613422,6.0255495 0 0 0 6.76134,6.02554 l 53.1072,0 a 6.7613422,6.0255495 0 0 0 6.76135,-6.02554 l 0,-101.544018 72.21628,104.699398 a 6.7613422,6.0255495 0 0 0 5.76015,2.87016 l 73.55487,0 a 6.7613422,6.0255495 0 0 0 6.76135,-6.02554 l 0,-187.87147 a 6.7613422,6.0255495 0 0 0 -6.76135,-6.02555 l -54.71644,0 a 6.7613422,6.0255495 0 0 0 -6.76133,6.02555 l 0,102.61935 L 183.76413,2.90886 a 6.7613422,6.0255495 0 0 0 -5.76014,-2.87017 z" />
<path d="M 4.8446333,22.10875 A 13.412039,12.501842 0 0 1 13.477588,0.03924 l 66.118315,0 a 5.3648158,5.000737 0 0 1 5.364823,5.00073 l 0,79.87931 z" />
<path d="m 420.15535,177.89119 a 13.412038,12.501842 0 0 1 -8.63295,22.06951 l -66.11832,0 a 5.3648152,5.000737 0 0 1 -5.36482,-5.00074 l 0,-79.87931 z" />
</svg>
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 425 200" opacity=".33"><path d="M178.004.039H106.8a6.761 6.026 0 0 0-6.761 6.025v187.872a6.761 6.026 0 0 0 6.761 6.025h53.107a6.761 6.026 0 0 0 6.762-6.025V92.392l72.216 104.7a6.761 6.026 0 0 0 5.76 2.87H318.2a6.761 6.026 0 0 0 6.761-6.026V6.064A6.761 6.026 0 0 0 318.2.04h-54.717a6.761 6.026 0 0 0-6.76 6.025v102.62L183.763 2.909a6.761 6.026 0 0 0-5.76-2.87zM4.845 22.109A13.412 12.502 0 0 1 13.478.039h66.118A5.365 5 0 0 1 84.96 5.04v79.88zm415.31 155.782a13.412 12.502 0 0 1-8.633 22.07h-66.118a5.365 5 0 0 1-5.365-5.001v-79.88z"/></svg>
<!-- This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. -->
<!-- http://creativecommons.org/licenses/by-sa/4.0/ -->

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 770 B

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="542" height="512"><path d="M215.03 71.05 126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97z"/><path d="M527.714 228H356.286c-7.857 0-14.286 6.412-14.286 14.25v28.5c0 7.838 6.429 14.25 14.286 14.25h171.428c7.857 0 14.286-6.413 14.286-14.25v-28.5c0-7.838-6.429-14.25-14.286-14.25z" style="stroke-width:.89174"/></svg>

After

Width:  |  Height:  |  Size: 469 B

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="542" height="512"><path d="M527.714 227.929h-57.143v-57.143c0-7.857-6.428-14.286-14.285-14.286h-28.572c-7.857 0-14.285 6.429-14.285 14.286v57.143h-57.143c-7.857 0-14.286 6.428-14.286 14.285v28.572c0 7.857 6.429 14.285 14.286 14.285h57.143v57.143c0 7.857 6.428 14.286 14.285 14.286h28.572c7.857 0 14.285-6.429 14.285-14.286v-57.143h57.143c7.857 0 14.286-6.428 14.286-14.285v-28.572c0-7.857-6.429-14.285-14.286-14.285z" style="stroke-width:.892857"/><path d="M215.03 71.05 126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97z"/></svg>

After

Width:  |  Height:  |  Size: 684 B

@@ -1,6 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 200 289.742" opacity=".33">
<path d="m 93.537677,0 c -18.113125,0 -34.220133,3.11164 -48.323484,9.33437 -13.965092,6.22167 -24.612442,15.07114 -31.940651,26.5471 -7.1899398,11.33789 -10.3012266,24.74911 -10.3012266,40.23478 0,10.64662 2.7250026,20.46465 8.1751116,29.45258 5.615277,8.98686 14.038277,17.35204 25.268821,25.09436 11.230544,7.60531 26.507421,15.41835 45.830514,23.43782 19.983748,8.29557 34.848848,15.55471 44.592998,21.77638 9.74414,6.22273 16.7617,12.8585 21.05572,19.90951 4.29404,7.05208 6.44193,15.76408 6.44193,26.13459 0,16.17702 -5.20196,28.48222 -15.60673,36.91682 -10.2396,8.4347 -25.02203,12.6523 -44.345169,12.6523 -14.038171,0 -25.515247,-1.6594 -34.433618,-4.9777 -8.91837,-3.4566 -16.185572,-8.7113 -21.800839,-15.7633 -5.615277,-7.0521 -10.074795,-16.66088 -13.377899,-28.82812 l -24.7731626293945,0 0,56.82632 C 33.856769,286.07601 63.74904,289.74201 89.678383,289.74201 c 16.020027,0 30.719787,-1.3827 44.097337,-4.1479 13.54272,-2.9043 25.1041,-7.4676 34.68309,-13.6893 9.74413,-6.3597 17.34042,-14.5195 22.79052,-24.4748 5.4501,-10.09332 8.17511,-22.39959 8.17511,-36.91682 0,-12.99764 -3.3021,-24.33539 -9.90829,-34.0146 -6.44105,-9.81725 -15.52545,-18.52707 -27.25146,-26.13133 -11.56085,-7.60427 -27.91083,-15.83142 -49.05066,-24.68022 -17.50644,-7.19012 -30.719668,-13.68948 -39.638038,-19.49701 -8.918371,-5.80752 -18.607474,-12.43409 -24.096524,-18.87417 -5.426043,-6.36616 -9.658826,-15.07003 -9.658826,-24.88729 0,-9.26401 2.075414,-17.21345 6.223454,-23.85033 11.098298,-14.39748 41.286638,-1.79507 45.075609,24.34762 4.839392,6.77491 8.84935,16.24729 12.029515,28.4156 l 20.53234,0 0,-55.99967 c -4.47825,-5.92448 -9.95488,-10.63222 -15.90837,-14.37411 1.64055,0.47905 3.19039,1.02376 4.63865,1.64024 6.49861,2.62607 12.16793,7.32747 17.0073,14.10345 4.83939,6.77491 8.84935,16.24567 12.02952,28.41397 0,0 8.48128,-0.12894 8.48978,-0.002 0.41776,6.41494 -1.75339,9.45286 -4.12342,12.56104 -2.4174,3.16978 -5.14486,6.78973 -4.00278,13.0029 1.50786,8.20318 10.18354,10.59642 14.62194,9.31154 -3.31842,-0.49911 -5.31855,-1.74948 -5.31855,-1.74948 0,0 1.87646,0.99868 5.65117,-1.35981 -3.27695,0.95571 -10.70529,-0.79738 -11.80125,-6.76313 -0.95752,-5.20861 0.94654,-7.29514 3.40113,-10.51482 2.45462,-3.21968 5.28426,-6.95831 4.6843,-14.48824 l 0.003,0.002 8.92676,0 0,-55.99967 c -15.07125,-3.87168 -27.65314,-6.36042 -37.74671,-7.46586 -9.95531,-1.10755 -20.18823,-1.65981 -30.696613,-1.65981 z m 70.321603,17.30893 0.23805,40.3049 c 1.31808,1.22666 2.43965,2.27815 3.34081,3.10602 4.83939,6.77491 8.84934,16.24566 12.02951,28.41397 l 20.53234,0 0,-55.99967 c -6.67731,-4.59381 -19.83643,-10.47309 -36.14071,-15.82522 z m -28.12049,5.60551 8.56479,17.71655 c -11.97037,-6.46697 -13.84678,-9.71726 -8.56479,-17.71655 z m 22.79705,0 c 2.7715,7.99929 1.78741,11.24958 -4.49354,17.71655 l 4.49354,-17.71655 z m 15.22195,24.00848 8.56479,17.71655 c -11.97038,-6.46697 -13.84679,-9.71726 -8.56479,-17.71655 z m 22.79704,0 c 2.7715,7.99929 1.78741,11.24958 -4.49354,17.71655 l 4.49354,-17.71655 z m -99.11384,2.20764 8.56479,17.71655 c -11.970382,-6.46697 -13.846782,-9.71726 -8.56479,-17.71655 z m 22.79542,0 c 2.7715,7.99929 1.78741,11.24958 -4.49354,17.71655 l 4.49354,-17.71655 z" />
</svg>
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 200 289.742" opacity=".33"><path d="M93.538 0c-18.113 0-34.22 3.112-48.324 9.334-13.965 6.222-24.612 15.072-31.94 26.547C6.084 47.22 2.972 60.631 2.972 76.116c0 10.647 2.725 20.465 8.175 29.453 5.616 8.987 14.039 17.352 25.27 25.094 11.23 7.606 26.507 15.419 45.83 23.438 19.984 8.296 34.849 15.555 44.593 21.776 9.744 6.223 16.761 12.859 21.055 19.91 4.295 7.052 6.442 15.764 6.442 26.134 0 16.178-5.202 28.483-15.606 36.917-10.24 8.435-25.022 12.653-44.345 12.653-14.039 0-25.516-1.66-34.434-4.978-8.918-3.457-16.186-8.711-21.8-15.763-5.616-7.052-10.076-16.661-13.379-28.829H0v56.827c33.857 7.328 63.749 10.994 89.678 10.994 16.02 0 30.72-1.383 44.098-4.148 13.542-2.904 25.104-7.467 34.683-13.69 9.744-6.359 17.34-14.519 22.79-24.474 5.45-10.093 8.175-22.4 8.175-36.917 0-12.997-3.302-24.335-9.908-34.014-6.44-9.818-15.525-18.527-27.251-26.132-11.561-7.604-27.911-15.831-49.051-24.68-17.506-7.19-30.72-13.69-39.638-19.497S54.969 93.756 49.479 87.316c-5.426-6.366-9.658-15.07-9.658-24.887 0-9.264 2.075-17.214 6.223-23.85C57.142 24.18 87.331 36.782 91.12 62.925c4.84 6.775 8.85 16.247 12.03 28.415h20.532v-56c-4.479-5.924-9.955-10.631-15.909-14.373 1.64.479 3.19 1.023 4.639 1.64 6.498 2.626 12.168 7.327 17.007 14.103 4.84 6.775 8.85 16.246 12.03 28.414 0 0 8.48-.129 8.49-.002.417 6.415-1.754 9.453-4.124 12.561-2.417 3.17-5.145 6.79-4.003 13.003 1.508 8.203 10.184 10.597 14.622 9.312-3.318-.5-5.318-1.75-5.318-1.75s1.876.999 5.65-1.36c-3.276.956-10.704-.797-11.8-6.763-.958-5.208.946-7.295 3.4-10.514 2.455-3.22 5.285-6.959 4.685-14.489l.003.002h8.927v-56c-15.072-3.871-27.653-6.36-37.747-7.465C114.279.552 104.046 0 93.537 0zm70.321 17.309.238 40.305c1.318 1.226 2.44 2.278 3.341 3.106 4.84 6.775 8.85 16.246 12.03 28.414H200v-56c-6.677-4.594-19.836-10.473-36.14-15.825zm-28.12 5.605 8.565 17.717c-11.97-6.467-13.847-9.717-8.565-17.717zm22.797 0c2.771 8 1.787 11.25-4.494 17.717l4.494-17.717zm15.222 24.009 8.565 17.716c-11.97-6.466-13.847-9.717-8.565-17.716zm22.797 0c2.771 8 1.787 11.25-4.494 17.716l4.494-17.716zM97.44 49.13l8.565 17.716c-11.97-6.467-13.847-9.717-8.565-17.716zm22.795 0c2.772 7.999 1.788 11.25-4.493 17.716l4.493-17.716z"/></svg>
<!-- This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. -->
<!-- http://creativecommons.org/licenses/by-sa/4.0/ -->

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

+1 -5
View File
@@ -14,8 +14,4 @@ import './ie8';
import './dom4';
import './css-om';
import './inferno';
// Fetch is required for Webpack HMR
if (module.hot) {
require('whatwg-fetch');
}
import 'unfetch/polyfill';
+1 -1
View File
@@ -5,6 +5,6 @@
"dependencies": {
"core-js": "^3.10.1",
"regenerator-runtime": "^0.13.8",
"whatwg-fetch": "^3.6.2"
"unfetch": "^4.2.0"
}
}
+296
View File
@@ -0,0 +1,296 @@
import { classes } from 'common/react';
import { useBackend } from '../backend';
import { Component, Fragment } from 'inferno';
import {
Box,
Button,
Dropdown,
Icon,
Section,
Stack,
Table,
} from '../components';
import { Window } from '../layouts';
import { resolveAsset } from '../assets';
import dateformat from 'dateformat';
import yaml from 'js-yaml';
const icons = {
bugfix: { icon: 'bug', color: 'green' },
wip: { icon: 'hammer', color: 'orange' },
qol: { icon: 'hand-holding-heart', color: 'green' },
soundadd: { icon: 'tg-sound-plus', color: 'green' },
sounddel: { icon: 'tg-sound-minus', color: 'red' },
add: { icon: 'check-circle', color: 'green' },
rscadd: { icon: 'check-circle', color: 'green' },
rscdel: { icon: 'times-circle', color: 'red' },
imageadd: { icon: 'tg-image-plus', color: 'green' },
imagedel: { icon: 'tg-image-minus', color: 'red' },
spellcheck: { icon: 'spell-check', color: 'green' },
experiment: { icon: 'radiation', color: 'yellow' },
balance: { icon: 'balance-scale-right', color: 'yellow' },
code_imp: { icon: 'code', color: 'green' },
refactor: { icon: 'tools', color: 'green' },
config: { icon: 'cogs', color: 'purple' },
admin: { icon: 'user-shield', color: 'purple' },
server: { icon: 'server', color: 'purple' },
tgs: { icon: 'toolbox', color: 'purple' },
tweak: { icon: 'wrench', color: 'green' },
unknown: { icon: 'info-circle', color: 'label' },
};
export class Changelog extends Component {
constructor() {
super();
this.state = {
data: 'Loading changelog data...',
selectedDate: '',
selectedIndex: 0,
};
this.dateChoices = [];
}
setData(data) {
this.setState({ data });
}
setSelectedDate(selectedDate) {
this.setState({ selectedDate });
}
setSelectedIndex(selectedIndex) {
this.setState({ selectedIndex });
}
getData = (date, attemptNumber = 0) => {
const { act } = useBackend(this.context);
const self = this;
if (attemptNumber > 2) {
return this.setData('Failed to load data after 3 attempts');
}
act('get_month', { date });
fetch(resolveAsset(date + '.yml'))
.then(async (changelogData) => {
const result = await changelogData.text();
const errorRegex = /^Cannot find/;
if (errorRegex.test(result)) {
const timeout = 250 + attemptNumber * 500;
self.setData(
'Loading changelog data' + '.'.repeat(attemptNumber + 3)
);
setTimeout(() => {
self.getData(date, attemptNumber + 1);
}, timeout);
} else {
self.setData(yaml.load(result, { schema: yaml.CORE_SCHEMA }));
}
});
}
componentDidMount() {
const { data: { dates = [] } } = useBackend(this.context);
if (dates) {
dates.forEach(
date => this.dateChoices.push(dateformat(date, 'mmmm yyyy'))
);
this.setSelectedDate(this.dateChoices[0]);
this.getData(dates[0]);
}
}
render() {
const { data, selectedDate, selectedIndex } = this.state;
const { data: { dates } } = useBackend(this.context);
const { dateChoices } = this;
const dateDropdown = dateChoices.length > 0 && (
<Stack mb={1}>
<Stack.Item>
<Button
className="Changelog__Button"
disabled={selectedIndex === 0}
icon={'chevron-left'}
onClick={() => {
const index = selectedIndex - 1;
this.setData('Loading changelog data...');
this.setSelectedIndex(index);
this.setSelectedDate(dateChoices[index]);
window.scrollTo(
0,
document.body.scrollHeight
|| document.documentElement.scrollHeight
);
return this.getData(dates[index]);
}} />
</Stack.Item>
<Stack.Item>
<Dropdown
displayText={selectedDate}
options={dateChoices}
onSelected={value => {
const index = dateChoices.indexOf(value);
this.setData('Loading changelog data...');
this.setSelectedIndex(index);
this.setSelectedDate(value);
window.scrollTo(
0,
document.body.scrollHeight
|| document.documentElement.scrollHeight
);
return this.getData(dates[index]);
}}
selected={selectedDate}
width={'150px'} />
</Stack.Item>
<Stack.Item>
<Button
className="Changelog__Button"
disabled={selectedIndex === dateChoices.length - 1}
icon={'chevron-right'}
onClick={() => {
const index = selectedIndex + 1;
this.setData('Loading changelog data...');
this.setSelectedIndex(index);
this.setSelectedDate(dateChoices[index]);
window.scrollTo(
0,
document.body.scrollHeight
|| document.documentElement.scrollHeight
);
return this.getData(dates[index]);
}} />
</Stack.Item>
</Stack>
);
const header = (
<Section>
<h1>Traditional Games Space Station 13</h1>
<p>
<b>Thanks to: </b>
Baystation 12, /vg/station, NTstation, CDK Station devs,
FacepunchStation, GoonStation devs, the original Space Station 13
developers, Invisty for the title image and the countless others who
have contributed to the game, issue tracker or wiki over the years.
</p>
<p>
{'Current project maintainers can be found '}
<a href="https://github.com/tgstation?tab=members">
here
</a>
{', recent GitHub contributors can be found '}
<a href="https://github.com/tgstation/tgstation/pulse/monthly">
here
</a>.
</p>
<p>
{'You can also join our discord '}
<a href="https://tgstation13.org/phpBB/viewforum.php?f=60">
here
</a>.
</p>
{dateDropdown}
</Section>
);
const footer = (
<Section>
{dateDropdown}
<h3>GoonStation 13 Development Team</h3>
<p>
<b>Coders: </b>
Stuntwaffle, Showtime, Pantaloons, Nannek, Keelin, Exadv1, hobnob,
Justicefries, 0staf, sniperchance, AngriestIBM, BrianOBlivion
</p>
<p>
<b>Spriters: </b>
Supernorn, Haruhi, Stuntwaffle, Pantaloons, Rho, SynthOrange,
I Said No
</p>
<p>
{'Except where otherwise noted, Goon Station 13 is licensed under a '}
<a href="https://creativecommons.org/licenses/by-nc-sa/3.0/">
Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
</a>
{'. Rights are currently extended to '}
<a href="http://forums.somethingawful.com/">SomethingAwful Goons</a>
{' only.'}
</p>
<p>
{'Traditional Games Space Station 13 is licensed under a '}
<a href="https://www.gnu.org/licenses/agpl-3.0.en.html">
GNU Affero General Public 3.0 License
</a>
.
</p>
</Section>
);
const changes = typeof data === 'object' && Object.keys(data).length > 0 && (
Object.entries(data).reverse().map(([date, authors]) => (
<Section key={date} title={dateformat(date, 'd mmmm yyyy')}>
<Box ml={3}>
{Object.entries(authors).map(([name, changes]) => (
<Fragment key={name}>
<h4>{name} changed:</h4>
<Box ml={3}>
<Table>
{changes.map(change => {
const changeType = Object.keys(change)[0];
return (
<Table.Row key={changeType + change[changeType]}>
<Table.Cell
className={classes([
'Changelog__Cell',
'Changelog__Cell--Icon',
])}
>
<Icon
color={
icons[changeType]
? icons[changeType].color
: icons['unknown'].color
}
name={
icons[changeType]
? icons[changeType].icon
: icons['unknown'].icon
}
/>
</Table.Cell>
<Table.Cell className="Changelog__Cell">
{change[changeType]}
</Table.Cell>
</Table.Row>
);
})}
</Table>
</Box>
</Fragment>
))}
</Box>
</Section>
))
);
return (
<Window title="Changelog" width={675} height={650}>
<Window.Content scrollable>
{header}
{changes}
{typeof data === 'string' && <p>{data}</p>}
{footer}
</Window.Content>
</Window>
);
}
}
+2
View File
@@ -4,9 +4,11 @@
"version": "4.3.0",
"dependencies": {
"common": "workspace:*",
"dateformat": "^4.5.1",
"dompurify": "^2.2.7",
"inferno": "^7.4.8",
"inferno-vnode-flags": "^7.4.8",
"js-yaml": "^4.1.0",
"marked": "^2.0.3",
"tgui-dev-server": "workspace:*",
"tgui-polyfill": "workspace:*"
@@ -0,0 +1,10 @@
@use '../colors.scss';
a {
&:link, &:visited {
color: colors.$blue;
}
&:hover, &:active {
color: colors.$primary;
}
}
@@ -0,0 +1,13 @@
.Changelog {
&__Button {
height: 22px;
}
&__Cell {
padding: 3px 0;
&--Icon {
width: 25px;
}
}
}
+2
View File
@@ -13,6 +13,7 @@
@include meta.load-css('./atomic/candystripe.scss');
@include meta.load-css('./atomic/color.scss');
@include meta.load-css('./atomic/debug-layout.scss');
@include meta.load-css('./atomic/links.scss');
@include meta.load-css('./atomic/outline.scss');
@include meta.load-css('./atomic/text.scss');
@@ -45,6 +46,7 @@
@include meta.load-css('./interfaces/ListInput.scss');
@include meta.load-css('./interfaces/AlertModal.scss');
@include meta.load-css('./interfaces/CameraConsole.scss');
@include meta.load-css('./interfaces/Changelog.scss');
@include meta.load-css('./interfaces/CrewManifest.scss');
@include meta.load-css('./interfaces/ExperimentConfigure.scss');
@include meta.load-css('./interfaces/NuclearBomb.scss');
+35 -8
View File
@@ -2275,6 +2275,13 @@ __metadata:
languageName: node
linkType: hard
"argparse@npm:^2.0.1":
version: 2.0.1
resolution: "argparse@npm:2.0.1"
checksum: 160b7a25d2a7097fd5fdf25eb8a99e037340078f70e6c7cfdef305837ed14d54570b2b13261bcae26c8cd44ad6e9a7136a0110d815ac65a7891c69c7bf2f4afd
languageName: node
linkType: hard
"arr-diff@npm:^4.0.0":
version: 4.0.0
resolution: "arr-diff@npm:4.0.0"
@@ -3245,6 +3252,13 @@ __metadata:
languageName: node
linkType: hard
"dateformat@npm:^4.5.1":
version: 4.5.1
resolution: "dateformat@npm:4.5.1"
checksum: d5d08fd36f0987570cacada467145c722b4051285fae32969d62ef4bfc3c392f310bf6982a3ecbe62f0b42a944846d94a2bff53b8051ad1540bcaf118732fbf4
languageName: node
linkType: hard
"debug@npm:^2.2.0, debug@npm:^2.3.3":
version: 2.6.9
resolution: "debug@npm:2.6.9"
@@ -5630,6 +5644,17 @@ __metadata:
languageName: node
linkType: hard
"js-yaml@npm:^4.1.0":
version: 4.1.0
resolution: "js-yaml@npm:4.1.0"
dependencies:
argparse: ^2.0.1
bin:
js-yaml: bin/js-yaml.js
checksum: 8973cf4296c944cc2551d1e3d3d064e7de0d0a6db3f7bafe40339ee9e5e0329560b52c4b8492b9b22365404c9be0822b62340ab49884e1dedfcc7ff80158abe0
languageName: node
linkType: hard
"jsbn@npm:~0.1.0":
version: 0.1.1
resolution: "jsbn@npm:0.1.1"
@@ -8316,7 +8341,7 @@ resolve@^2.0.0-next.3:
dependencies:
core-js: ^3.10.1
regenerator-runtime: ^0.13.8
whatwg-fetch: ^3.6.2
unfetch: ^4.2.0
languageName: unknown
linkType: soft
@@ -8366,9 +8391,11 @@ resolve@^2.0.0-next.3:
resolution: "tgui@workspace:packages/tgui"
dependencies:
common: "workspace:*"
dateformat: ^4.5.1
dompurify: ^2.2.7
inferno: ^7.4.8
inferno-vnode-flags: ^7.4.8
js-yaml: ^4.1.0
marked: ^2.0.3
tgui-dev-server: "workspace:*"
tgui-polyfill: "workspace:*"
@@ -8682,6 +8709,13 @@ typescript@^4.2.4:
languageName: node
linkType: hard
"unfetch@npm:^4.2.0":
version: 4.2.0
resolution: "unfetch@npm:4.2.0"
checksum: a1ec2f1d0fd6e0e9d46d659b6639dac490eefde4dcb5d9a060b78e380a543182bbdf395c7772685a023fb76c8e5d2c8b843f199d727c5f3af3cced88b3dcc741
languageName: node
linkType: hard
"unicode-canonical-property-names-ecmascript@npm:^1.0.4":
version: 1.0.4
resolution: "unicode-canonical-property-names-ecmascript@npm:1.0.4"
@@ -9063,13 +9097,6 @@ typescript@^4.2.4:
languageName: node
linkType: hard
"whatwg-fetch@npm:^3.6.2":
version: 3.6.2
resolution: "whatwg-fetch@npm:3.6.2"
checksum: eaa370015f81fbf7fc69d5410a13c2200d3342fa783397e9a7e64215498276459993c05e826ed736d28a8abe4e7cc3f97e9b2ffadbc58129a55f443abdfea494
languageName: node
linkType: hard
"whatwg-mimetype@npm:^2.3.0":
version: 2.3.0
resolution: "whatwg-mimetype@npm:2.3.0"
@@ -737,9 +737,6 @@ function checkchangelog($payload, $compile = true) {
$currentchangelogblock[] = array('type' => 'balance', 'body' => $item);
}
break;
case 'tgs':
$currentchangelogblock[] = array('type' => 'tgs', 'body' => $item);
break;
case 'code_imp':
case 'code':
if($item != 'changed some code'){
+2 -2
View File
@@ -1,5 +1,5 @@
#!/bin/bash
set -euo pipefail
md5sum -c - <<< "364a16f858a957486eaeb1e12673c39c *html/changelogs/example.yml"
python3 tools/ss13_genchangelog.py html/changelog.html html/changelogs
md5sum -c - <<< "4d783933c74290b3a219068790b2046f *html/changelogs/example.yml"
python3 tools/ss13_genchangelog.py html/changelogs
+1 -1
View File
@@ -1,4 +1,4 @@
@echo off
rem Cheridan asked for this. - N3X
call "%~dp0\bootstrap\python" ss13_genchangelog.py ../html/changelog.html ../html/changelogs
call "%~dp0\bootstrap\python" ss13_genchangelog.py ../html/changelogs
pause
+45 -123
View File
@@ -1,6 +1,6 @@
'''
Usage:
$ python ss13_genchangelog.py [--dry-run] html/changelog.html html/changelogs/
$ python ss13_genchangelog.py html/changelogs/
ss13_genchangelog.py - Generate changelog from YAML.
@@ -32,31 +32,29 @@ from time import time
today = date.today()
dateformat = "%d %B %Y"
fileDateFormat = "%Y-%m"
opt = argparse.ArgumentParser()
opt.add_argument('-d', '--dry-run', dest='dryRun', default=False, action='store_true', help='Only parse changelogs and, if needed, the targetFile. (A .dry_changelog.yml will be output for debugging purposes.)')
opt.add_argument('-t', '--time-period', dest='timePeriod', default=9, type=int, help='Define how many weeks back the changelog should display')
opt.add_argument('targetFile', help='The HTML changelog we wish to update.')
opt.add_argument('ymlDir', help='The directory of YAML changelogs we will use.')
args = opt.parse_args()
archiveDir = os.path.join(args.ymlDir, 'archive')
all_changelog_entries = {}
# Do not change the order, add to the bottom of the array if necessary
validPrefixes = [
'bugfix',
'wip',
'qol',
'soundadd',
'sounddel',
'rscdel',
'rscadd',
'rscdel',
'imageadd',
'imagedel',
'spellcheck',
'experiment',
'tgs',
'balance',
'code_imp',
'refactor',
@@ -68,85 +66,60 @@ validPrefixes = [
def dictToTuples(inp):
return [(k, v) for k, v in inp.items()]
changelog_cache = os.path.join(args.ymlDir, '.all_changelog.yml')
old_changelog_cache = os.path.join(args.ymlDir, '.all_changelog.yml')
failed_cache_read = True
if os.path.isfile(changelog_cache):
if os.path.isfile(old_changelog_cache):
try:
with open(changelog_cache,encoding='utf-8') as f:
print('Reading old changelog cache...')
data = {}
with open(old_changelog_cache,encoding='utf-8') as f:
(_, all_changelog_entries) = yaml.load_all(f, Loader=yaml.SafeLoader)
failed_cache_read = False
# Convert old timestamps to newer format.
new_entries = {}
# Categorize changes by year and month
for _date in all_changelog_entries.keys():
ty = type(_date).__name__
# print(ty)
if ty in ['str', 'unicode']:
temp_data = all_changelog_entries[_date]
_date = datetime.strptime(_date, dateformat).date()
new_entries[_date] = temp_data
else:
new_entries[_date] = all_changelog_entries[_date]
all_changelog_entries = new_entries
formattedDate = _date.strftime(fileDateFormat)
if not formattedDate in data:
data[formattedDate] = {}
data[formattedDate][_date] = all_changelog_entries[_date]
# Write files with changes by year and month
for month in data.keys():
print("Writing " + month + ".yml...")
if not os.path.exists(archiveDir):
os.makedirs(archiveDir)
currentFile = os.path.join(archiveDir, month + '.yml')
with open(currentFile, 'w', encoding='utf-8') as f:
yaml.dump(data[month], f, default_flow_style=False)
# Remove the old changelog cache, as we won't use it anymore
print("Removing old changelog cache...")
os.remove(old_changelog_cache)
old_changelog_html = os.path.join(args.ymlDir, '..', 'changelog.html')
if os.path.isfile(old_changelog_html):
print("Removing old changelog html...")
os.remove(old_changelog_html)
except Exception as e:
print("Failed to read cache:")
print("Failed to read old changelog cache:")
print(e, file=sys.stderr)
if args.dryRun:
changelog_cache = os.path.join(args.ymlDir, '.dry_changelog.yml')
if failed_cache_read and os.path.isfile(args.targetFile):
from bs4 import BeautifulSoup
from bs4.element import NavigableString
print(' Generating cache...')
with open(args.targetFile, 'r', encoding='utf-8') as f:
soup = BeautifulSoup(f)
for e in soup.find_all('div', {'class':'commit'}):
entry = {}
date = datetime.strptime(e.h2.string.strip(), dateformat).date() # key
for authorT in e.find_all('h3', {'class':'author'}):
author = authorT.string
# Strip suffix
if author.endswith('updated:'):
author = author[:-8]
author = author.strip()
# Find <ul>
ulT = authorT.next_sibling
while(ulT.name != 'ul'):
ulT = ulT.next_sibling
changes = []
for changeT in ulT.children:
if changeT.name != 'li': continue
val = changeT.decode_contents(formatter="html")
newdat = {changeT['class'][0] + '': val + ''}
if newdat not in changes:
changes += [newdat]
if len(changes) > 0:
entry[author] = changes
if date in all_changelog_entries:
all_changelog_entries[date].update(entry)
else:
all_changelog_entries[date] = entry
del_after = []
print('Reading changelogs...')
for fileName in glob.glob(os.path.join(args.ymlDir, "*.yml")):
name, ext = os.path.splitext(os.path.basename(fileName))
if name.startswith('.'): continue
if name == 'example': continue
fileName = os.path.abspath(fileName)
formattedDate = today.strftime(fileDateFormat)
monthFile = os.path.join(archiveDir, formattedDate + '.yml')
print(' Reading {}...'.format(fileName))
cl = {}
with open(fileName, 'r',encoding='utf-8') as f:
cl = yaml.load(f, Loader=yaml.SafeLoader)
f.close()
if today not in all_changelog_entries:
all_changelog_entries[today] = {}
author_entries = all_changelog_entries[today].get(cl['author'], [])
currentEntries = {}
if os.path.exists(monthFile):
with open(monthFile,'r',encoding='utf-8') as f:
currentEntries = yaml.load(f, Loader=yaml.SafeLoader)
if today not in currentEntries:
currentEntries[today] = {}
author_entries = currentEntries[today].get(cl['author'], [])
if len(cl['changes']):
new = 0
for change in cl['changes']:
@@ -156,65 +129,14 @@ for fileName in glob.glob(os.path.join(args.ymlDir, "*.yml")):
print(' {0}: Invalid prefix {1}'.format(fileName, change_type), file=sys.stderr)
author_entries += [change]
new += 1
all_changelog_entries[today][cl['author']] = author_entries
currentEntries[today][cl['author']] = author_entries
if new > 0:
print(' Added {0} new changelog entries.'.format(new))
if cl.get('delete-after', False):
if os.path.isfile(fileName):
if args.dryRun:
print(' Would delete {0} (delete-after set)...'.format(fileName))
else:
del_after += [fileName]
if args.dryRun: continue
cl['changes'] = []
with open(fileName, 'w', encoding='utf-8') as f:
yaml.dump(cl, f, default_flow_style=False)
targetDir = os.path.dirname(args.targetFile)
with open(args.targetFile.replace('.htm', '.dry.htm') if args.dryRun else args.targetFile, 'w', encoding='utf-8') as changelog:
with open(os.path.join(targetDir, 'templates', 'header.html'), 'r', encoding='utf-8') as h:
for line in h:
changelog.write(line)
weekstoshow = timedelta(weeks=args.timePeriod)
for _date in reversed(sorted(all_changelog_entries.keys())):
if not (today - _date < weekstoshow):
continue
entry_htm = '\n'
entry_htm += '\t\t\t<h2 class="date">{date}</h2>\n'.format(date=_date.strftime(dateformat))
write_entry = False
for author in sorted(all_changelog_entries[_date].keys()):
if len(all_changelog_entries[_date]) == 0: continue
author_htm = '\t\t\t<h3 class="author">{author} updated:</h3>\n'.format(author=author)
author_htm += '\t\t\t<ul class="changes bgimages16">\n'
changes_added = []
for (css_class, change) in (dictToTuples(e)[0] for e in all_changelog_entries[_date][author]):
if change in changes_added: continue
write_entry = True
changes_added += [change]
author_htm += '\t\t\t\t<li class="{css_class}">{change}</li>\n'.format(css_class=css_class, change=change.strip())
author_htm += '\t\t\t</ul>\n'
if len(changes_added) > 0:
entry_htm += author_htm
if write_entry:
changelog.write(entry_htm)
with open(os.path.join(targetDir, 'templates', 'footer.html'), 'r', encoding='utf-8') as h:
for line in h:
changelog.write(line)
with open(changelog_cache, 'w') as f:
cache_head = 'DO NOT EDIT THIS FILE BY HAND! AUTOMATICALLY GENERATED BY ss13_genchangelog.py.'
yaml.dump_all([cache_head, all_changelog_entries], f, default_flow_style=False)
if len(del_after):
print('Cleaning up...')
for fileName in del_after:
if os.path.isfile(fileName):
print(' Deleting {0} (delete-after set)...'.format(fileName))
print(' Deleting {0} (delete-after set)...'.format(fileName))
os.remove(fileName)
with open(monthFile, 'w', encoding='utf-8') as f:
yaml.dump(currentEntries, f, default_flow_style=False)
+1 -1
View File
@@ -12,7 +12,7 @@ if(!$?){
}
Write-Host "Running changelog script..."
python3 tools/ss13_genchangelog.py html/changelog.html html/changelogs
python3 tools/ss13_genchangelog.py html/changelogs
if(!$?){
Write-Host "python3 returned non-zero!"
exit $LASTEXITCODE
+1 -1
View File
@@ -26,7 +26,7 @@ pip3 install PyYaml beautifulsoup4
cd $1
echo "Running changelog script..."
python3 tools/ss13_genchangelog.py html/changelog.html html/changelogs
python3 tools/ss13_genchangelog.py html/changelogs
echo "Committing changes..."
git add html