forked from goonstation/goonstation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
changelog.dm
223 lines (206 loc) · 7.45 KB
/
changelog.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
/*
(t)
(u)
(*)
(+)
*/
/datum/changelog
// var/changelog_path = "icons/changelog.txt"
var/html = null
/*
New auto-generated changelog:
Format:
Use (t) for the timestamp, (u) for the user, and (*)for the line to add.
Use (+) instead for minor changes (will be collapsed and grouped up at the end of the day's log).
Be sure to add a \ before a [
Examples:
Single update for a given day:
(t)mon jan 01 12
(u)Pantaloons
(*)Did a thing.
Multiple updates in a day:
(t)mon jan 01 12
(u)Pantaloons
(*)Did a thing.
(+)Fixed a bug.
(u)Nannek
(*)Also did a thing.
WIRE NOTE: You don't need to use (-) anymore (although doing so doesn't break anything)
OTHER NOTE:
(t)mon dec 1 14
returns "Monday, December 1 th, 204"
so you'll want your single-digit days to have 0s in front
*/
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ATTENTION: The changelog has moved into its own file: strings/changelog.txt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/proc/changelog_parse(var/changes, var/title, var/logclasses)
var/list/html = list()
var/text = changes
if (!text)
logDiary("Failed to load changelog.")
else
html += "<ul class=\"log[logclasses]\"><li class=\"title\"><i class=\"icon-bookmark\"></i> [title] as of [copytext(vcs_revision, 1, 8)]</li>" //truncate to 7 long
var/list/collapsible_html = list()
var/added_collapsible_author = 0
var/added_author = 0
var/author = null
var/pr_num = null
var/emoji_labels = null
var/list/lines = splittext(text, "\n")
for(var/line in lines)
if (!line)
continue
if (copytext(line, 1, 2) == "#")
continue
switch(copytext(line, 1, 4))
if("(p)")
pr_num = copytext(line, 4, 0)
if("(e)")
emoji_labels = copytext(line, 4, 0)
if("(t)")
if(collapsible_html.len)
html += "<li class=\"collapse-button\">Minor Changes</li><div class='collapsible'>[collapsible_html.Join()]</div>"
collapsible_html.Cut()
author = null
added_collapsible_author = 0
added_author = 0
var/day = copytext(line, 4, 7)
html += "<li class=\"date\">"
switch(day)
if("sun")
html += "Sunday, "
if("mon")
html += "Monday, "
if("tue")
html += "Tuesday, "
if("wed")
html += "Wednesday, "
if("thu")
html += "Thursday, "
if("fri")
html += "Friday, "
if("sat")
html += "Saturday, "
else
html += "Whoopsday, "
var/month = copytext(line, 8, 11)
switch(month)
if("jan")
html += "January "
if("feb")
html += "February "
if("mar")
html += "March "
if("apr")
html += "April "
if("may")
html += "May "
if("jun")
html += "June "
if("jul")
html += "July "
if("aug")
html += "August "
if("sep")
html += "September "
if("oct")
html += "October "
if("nov")
html += "November "
if("dec")
html += "December "
else
html += "Whoops"
var/date1 = copytext(line, 12, 13)
var/date2 = copytext(line, 13, 14)
switch(date1)
if("0")
html += date2
switch(date2)
if("1")
html += "st, "
if("2")
html += "nd, "
if("3")
html += "rd, "
else
html += "th, "
if("1")
html += "[date1][date2]th, "
else
html += date1
html += date2
switch(date2)
if("1")
html += "st, "
if("2")
html += "nd, "
if("3")
html += "rd, "
else
html += "th, "
html += "20[copytext(line, 15, 17)]</li>"
if("(u)")
author = copytext(line, 4, 0)
added_collapsible_author = 0
added_author = 0
pr_num = null
emoji_labels = null
if("(*)")
if(!added_author && author)
html += "<li class=\"admin\"><span><i class=\"icon-check\"></i> [author]</span> updated:"
if(emoji_labels)
var/list/emoji_parts = splittext(emoji_labels, "|")
html += "<span class='emoji'>[emoji_parts[1]]"
if(emoji_parts.len > 1)
html += "<span class='tooltiptext'>[emoji_parts[2]]</span>"
html += "</span>"
if(pr_num)
html += "<a target='_blank' href='https://github.com/goonstation/goonstation/pull/[pr_num]' class='pr_link'><span class='pr_number'>#[pr_num]</span>></a>"
html += "</li>"
added_author = 1
html += "<li>[copytext(line, 4, 0)]</li>"
if("(+)")
if(!added_collapsible_author && author)
collapsible_html += "<li class=\"admin\"><span><i class=\"icon-check\"></i> [author]</span> updated:"
if(emoji_labels)
var/list/emoji_parts = splittext(emoji_labels, "|")
collapsible_html += "<span class='emoji'>[emoji_parts[1]]"
if(emoji_parts.len > 1)
collapsible_html += "<span class='tooltiptext'>[emoji_parts[2]]</span>"
collapsible_html += "</span>"
if(pr_num)
collapsible_html += "<a target='_blank' href='https://github.com/goonstation/goonstation/pull/[pr_num]' class='pr_link'><span class='pr_number'>#[pr_num]</span>></a>"
collapsible_html += "</li>"
added_collapsible_author = 1
collapsible_html += "<li>[copytext(line, 4, 0)]</li>"
else continue
if(collapsible_html.len)
html += "<li class=\"collapse-button\">Minor Changes</li><div class='collapsible'>[collapsible_html.Join()]</div>"
html += "</ul>"
return html.Join()
/datum/changelog/New()
..()
//<img alt="Goon Station 13" src="[resource("images/changelog/postcardsmall.jpg")]" class="postcard" />
html = {"
<h1>Goon Station 13 <a href="#license"><img alt="Creative Commons CC-BY-NC-SA License" src="[resource("images/changelog/88x31.png")]" /></a></h1>
<ul class="links cf">
<li>Official Wiki<br><strong><a target="_blank" href="http://wiki.ss13.co/">https://wiki.ss13.co</a></strong><span></span></li>
<li>Official Forums<br><strong><a target="_blank" href="https://forum.ss13.co/">https://forum.ss13.co</a></strong></li>
</ul>"}
html += changelog_parse(file2text("strings/changelog.txt"), "Changelog")
html += {"
<h3>GoonStation 13 Development Team</h3>
<p class="team">
<strong>Host:</strong> Wire (#1, #2, Wiki, Forums, & more)<br>
<strong>Coders:</strong> stuntwaffle, Showtime, Pantaloons, Nannek, Keelin, Exadv1, hobnob, 0staf, sniperchance, AngriestIBM, BrianOBlivion, I Said No, Harmar, Dropsy, ProcitizenSA, Pacra, LLJK-Mosheninkov, JackMassacre, Jewel, Dr. Singh, Infinite Monkeys, Cogwerks, Aphtonites, Wire, BurntCornMuffin, Tobba, Haine, Marquesas, SpyGuy, Conor12, Daeren, Somepotato, MyBlueCorners, ZeWaka, Gannets, Kremlin, Flourish, Mordent, Cirrial, Grayshift, Firebarrage, Kyle, Azungar, Warcrimes, HydroFloric, Zamujasa, Gerhazo, Readster, pali6, Tarmunora, & UrsulaMejor.
<br>
<strong>Spriters:</strong> Supernorn, Haruhi, Stuntwaffle, Pantaloons, Rho, SynthOrange, I Said No, Cogwerks, Aphtonites, Hempuli, Gannets, Haine, SLthePyro, Sundance, Azungar, Flaborized, Erinexx, and a bunch of awesome people from the forums!
</p>
<p id="license" class="lic">
<a target="_blank" href="http://creativecommons.org/licenses/by-nc-sa/3.0/" name="license"><img alt="Creative Commons CC-BY-NC-SA License" src="[resource("images/changelog/88x31.png")]" /></a><br/>
<em>
Except where otherwise noted, Goon Station 13 is licensed under a <a target="_blank" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 License</a>.
</em>
</p>"}