Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert changelog to TGUI #58593

Merged
merged 25 commits into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
59d54ba
Convert changelog to TGUI
celotajstg Apr 21, 2021
20486c6
Remove unused classes
celotajstg Apr 21, 2021
fe545c5
Change changelog example hash
celotajstg Apr 21, 2021
f2e2f0e
Removed reference to old changelog icons in footer
celotajstg Apr 21, 2021
dd0f646
Remove references to tgs
celotajstg Apr 21, 2021
68e2145
Add reference to APGLv3
celotajstg Apr 21, 2021
99120ea
Remove redundant src
celotajstg Apr 21, 2021
757b4d2
Move changelog.dm to code\datums\changelog
celotajstg Apr 21, 2021
15a43d3
Add new file path to tgstation.dme
celotajstg Apr 21, 2021
430e3a7
Split changelog cache, allow browsing changelog history
celotajstg Apr 24, 2021
2560ee4
Show changes in reverse order, set dropdown width
celotajstg Apr 24, 2021
c50aa17
Remove eslint-disable
celotajstg Apr 24, 2021
68e6e77
Remove dot out of link
celotajstg Apr 24, 2021
20cce61
Scroll to top after switching month
celotajstg Apr 24, 2021
56e2b0f
Adjust changelog styling
celotajstg Apr 24, 2021
3be3438
Re-add AGPL 3.0 mention
celotajstg Apr 24, 2021
ed2687b
Set fallback for changelog icon type
celotajstg Apr 24, 2021
2596355
Make experiment yellow
celotajstg Apr 24, 2021
ab1de71
Resolve linting issues
celotajstg Apr 24, 2021
99814e8
Create changelog_item asset
celotajstg Apr 24, 2021
d097999
Add qdel to get_month action
celotajstg Apr 24, 2021
bf5ba00
Adjust how changelog items are loaded
celotajstg Apr 25, 2021
5f3fb89
Sanitize changelog filename
celotajstg Apr 25, 2021
7ee6063
Load individual changelogs correctly
celotajstg Apr 25, 2021
6f4481d
Re-add license to optimized SVGs
celotajstg Apr 25, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/compile_changelogs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/tgui.dm
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
GLOBAL_DATUM(crew_manifest_tgui, /datum/crew_manifest)
GLOBAL_DATUM(changelog_tgui, /datum/changelog)
32 changes: 32 additions & 0 deletions code/datums/changelog/changelog.dm
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion code/game/world.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
18 changes: 18 additions & 0 deletions code/modules/asset_cache/asset_list.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 0 additions & 25 deletions code/modules/asset_cache/asset_list_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 2 additions & 1 deletion code/modules/mob/dead/crew_manifest.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Binary file removed html/88x31.png
Binary file not shown.
9,051 changes: 0 additions & 9,051 deletions html/archivedchangelog.html

This file was deleted.

Binary file removed html/ban.png
Binary file not shown.
Binary file removed html/bug-minus.png
Binary file not shown.
Binary file removed html/burn-exclamation.png
Binary file not shown.
42 changes: 0 additions & 42 deletions html/changelog.css

This file was deleted.

16 changes: 7 additions & 9 deletions html/changelogs/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -29,8 +29,6 @@
# - (fixes spelling or grammar)
# experiment
# - (experimental change)
# tgs
# - (TGS change)
# balance
# - (balance changes)
# code_imp
Expand All @@ -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.
Expand All @@ -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 removed html/chrome-wrench.png
Binary file not shown.
Binary file removed html/coding.png
Binary file not shown.
Binary file removed html/cross-circle.png
Binary file not shown.
Binary file removed html/hard-hat-exclamation.png
Binary file not shown.
Binary file removed html/image-minus.png
Binary file not shown.
Binary file removed html/image-plus.png
Binary file not shown.
Binary file removed html/music-minus.png
Binary file not shown.
Binary file removed html/music-plus.png
Binary file not shown.
Binary file removed html/scales.png
Binary file not shown.
Binary file removed html/spell-check.png
Binary file not shown.
13 changes: 0 additions & 13 deletions html/templates/footer.html

This file was deleted.

53 changes: 0 additions & 53 deletions html/templates/header.html

This file was deleted.

Binary file removed html/tick-circle.png
Binary file not shown.
Binary file removed html/wrench-screwdriver.png
Binary file not shown.
7 changes: 4 additions & 3 deletions interface/interface.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,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"
Expand Down
30 changes: 1 addition & 29 deletions tgui/packages/tgfont/icons/air-tank-slash.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 1 addition & 26 deletions tgui/packages/tgfont/icons/air-tank.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tgui/packages/tgfont/icons/image-minus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tgui/packages/tgfont/icons/image-plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading