Changelog. (#3398)

This commit is contained in:
Pieter-Jan Briers
2021-02-25 09:50:45 +01:00
committed by GitHub
parent fdcbece63d
commit cca23f2812
29 changed files with 1082 additions and 78 deletions

View File

@@ -0,0 +1,53 @@
using Content.Client.UserInterface.Stylesheets;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
namespace Content.Client.Changelog
{
public sealed class ChangelogButton : Button
{
[Dependency] private readonly ChangelogManager _changelogManager = default!;
public ChangelogButton()
{
IoCManager.InjectDependencies(this);
OnPressed += OnOnPressed;
}
protected override void EnteredTree()
{
base.EnteredTree();
_changelogManager.NewChangelogEntriesChanged += UpdateStuff;
UpdateStuff();
}
protected override void ExitedTree()
{
base.ExitedTree();
_changelogManager.NewChangelogEntriesChanged -= UpdateStuff;
}
private void OnOnPressed(ButtonEventArgs obj)
{
new ChangelogWindow().OpenCentered();
}
private void UpdateStuff()
{
if (_changelogManager.NewChangelogEntries)
{
Text = Loc.GetString("changelog-button-new-entries");
StyleClasses.Add(StyleBase.ButtonCaution);
}
else
{
Text = Loc.GetString("changelog-button");
StyleClasses.Remove(StyleBase.ButtonCaution);
}
}
}
}

View File

@@ -0,0 +1,124 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Robust.Shared.ContentPack;
using Robust.Shared.IoC;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
using YamlDotNet.RepresentationModel;
#nullable enable
namespace Content.Client.Changelog
{
public sealed class ChangelogManager
{
// If you fork SS14, change this to have the changelog "last seen" date stored separately.
public const string ForkId = "Wizards";
[Dependency] private readonly IResourceManager _resource = default!;
public bool NewChangelogEntries { get; private set; }
public int LastReadId { get; private set; }
public int MaxId { get; private set; }
public event Action? NewChangelogEntriesChanged;
/// <summary>
/// Ran when the user opens ("read") the changelog,
/// stores the new ID to disk and clears <see cref="NewChangelogEntries"/>.
/// </summary>
/// <remarks>
/// <see cref="LastReadId"/> is NOT cleared
/// since that's used in the changelog menu to show the "since you last read" bar.
/// </remarks>
public void SaveNewReadId()
{
NewChangelogEntries = false;
NewChangelogEntriesChanged?.Invoke();
using var file = _resource.UserData.Create(new ResourcePath($"/changelog_last_seen_{ForkId}"));
using var sw = new StreamWriter(file);
sw.Write(MaxId.ToString());
}
public async void Initialize()
{
// Open changelog purely to compare to the last viewed date.
var changelog = await LoadChangelog();
if (changelog.Count == 0)
{
return;
}
MaxId = changelog.Max(c => c.Id);
var path = new ResourcePath($"/changelog_last_seen_{ForkId}");
if (_resource.UserData.Exists(path))
{
LastReadId = int.Parse(_resource.UserData.ReadAllText(path));
}
NewChangelogEntries = LastReadId < MaxId;
NewChangelogEntriesChanged?.Invoke();
}
public Task<List<ChangelogEntry>> LoadChangelog()
{
return Task.Run(() =>
{
var yamlData = _resource.ContentFileReadYaml(new ResourcePath("/Changelog/Changelog.yml"));
if (yamlData.Documents.Count == 0)
return new List<ChangelogEntry>();
var serializer = YamlObjectSerializer.NewReader((YamlMappingNode) yamlData.Documents[0].RootNode);
return serializer.ReadDataField<List<ChangelogEntry>>("Entries");
});
}
public sealed class ChangelogEntry : IExposeData
{
public int Id { get; private set; }
public string Author { get; private set; } = "";
public DateTime Time { get; private set; }
public List<ChangelogChange> Changes { get; private set; } = default!;
void IExposeData.ExposeData(ObjectSerializer serializer)
{
Id = serializer.ReadDataField<int>("id");
Author = serializer.ReadDataField<string>("author");
Time = DateTime.Parse(serializer.ReadDataField<string>("time"), null, DateTimeStyles.RoundtripKind);
Changes = serializer.ReadDataField<List<ChangelogChange>>("changes");
}
}
public sealed class ChangelogChange : IExposeData
{
public ChangelogLineType Type { get; private set; }
public string Message { get; private set; } = "";
void IExposeData.ExposeData(ObjectSerializer serializer)
{
Type = serializer.ReadDataField<ChangelogLineType>("type");
Message = serializer.ReadDataField<string>("message");
}
}
public enum ChangelogLineType
{
Add,
Remove,
Fix,
Tweak,
}
}
}

View File

@@ -0,0 +1,23 @@
<changelog:ChangelogWindow xmlns="https://spacestation14.io"
xmlns:cui="clr-namespace:Content.Client.UserInterface"
xmlns:cuic="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:changelog="clr-namespace:Content.Client.Changelog"
MinSize="500 400" MouseFilter="Stop">
<PanelContainer StyleClasses="AngleRect" />
<VBoxContainer>
<HBoxContainer>
<Label Margin="6 0 0 0" HorizontalExpand="True" Text="{Loc 'changelog-window-title'}" VAlign="Center"
StyleClasses="LabelHeading" />
<TextureButton Margin="0 0 8 0" Name="CloseButton" StyleClasses="windowCloseButton"
VerticalAlignment="Center" />
</HBoxContainer>
<cuic:HighDivider />
<ScrollContainer VerticalExpand="True" HScrollEnabled="False">
<VBoxContainer Name="ChangelogBody" />
</ScrollContainer>
<PanelContainer StyleClasses="LowDivider" />
<Label Name="VersionLabel" HorizontalAlignment="Right" StyleClasses="LabelSubText" Margin="4 0" />
</VBoxContainer>
</changelog:ChangelogWindow>

View File

@@ -0,0 +1,207 @@
using System;
using System.Linq;
using Content.Client.UserInterface.Stylesheets;
using Content.Client.Utility;
using JetBrains.Annotations;
using Robust.Client.AutoGenerated;
using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Console;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Utility;
using static Content.Client.Changelog.ChangelogManager;
namespace Content.Client.Changelog
{
[GenerateTypedNameReferences]
public sealed partial class ChangelogWindow : BaseWindow
{
[Dependency] private readonly ChangelogManager _changelog = default!;
[Dependency] private readonly IResourceCache _resourceCache = default!;
public ChangelogWindow()
{
IoCManager.InjectDependencies(this);
RobustXamlLoader.Load(this);
Stylesheet = IoCManager.Resolve<IStylesheetManager>().SheetSpace;
CloseButton.OnPressed += _ => Close();
}
protected override void Opened()
{
base.Opened();
_changelog.SaveNewReadId();
PopulateChangelog();
}
private async void PopulateChangelog()
{
// Changelog is not kept in memory so load it again.
var changelog = await _changelog.LoadChangelog();
var byDay = changelog
.GroupBy(e => e.Time.ToLocalTime().Date)
.OrderByDescending(c => c.Key);
var hasRead = _changelog.MaxId <= _changelog.LastReadId;
foreach (var dayEntries in byDay)
{
var day = dayEntries.Key;
var groupedEntries = dayEntries
.GroupBy(c => (c.Author, Read: c.Id <= _changelog.LastReadId))
.OrderBy(c => c.Key.Read)
.ThenBy(c => c.Key.Author);
string dayNice;
var today = DateTime.Today;
if (day == today)
dayNice = Loc.GetString("changelog-today");
else if (day == today.AddDays(-1))
dayNice = Loc.GetString("changelog-yesterday");
else
dayNice = day.ToShortDateString();
ChangelogBody.AddChild(new Label
{
Text = dayNice,
StyleClasses = {"LabelHeading"},
Margin = new Thickness(4, 6, 0, 0)
});
var first = true;
foreach (var groupedEntry in groupedEntries)
{
var (author, read) = groupedEntry.Key;
if (!first)
{
ChangelogBody.AddChild(new Control {Margin = new Thickness(4)});
}
if (read && !hasRead)
{
hasRead = true;
var upArrow =
_resourceCache.GetTexture("/Textures/Interface/Changelog/up_arrow.svg.192dpi.png");
var readDivider = new VBoxContainer();
var hBox = new HBoxContainer
{
HorizontalAlignment = HAlignment.Center,
Children =
{
new TextureRect
{
Texture = upArrow,
ModulateSelfOverride = Color.FromHex("#888"),
TextureScale = (0.5f, 0.5f),
Margin = new Thickness(4, 3),
VerticalAlignment = VAlignment.Bottom
},
new Label
{
Align = Label.AlignMode.Center,
Text = Loc.GetString("changelog-new-changes"),
FontColorOverride = Color.FromHex("#888"),
},
new TextureRect
{
Texture = upArrow,
ModulateSelfOverride = Color.FromHex("#888"),
TextureScale = (0.5f, 0.5f),
Margin = new Thickness(4, 3),
VerticalAlignment = VAlignment.Bottom
}
}
};
readDivider.AddChild(hBox);
readDivider.AddChild(new PanelContainer {StyleClasses = {"LowDivider"}});
ChangelogBody.AddChild(readDivider);
if (first)
readDivider.SetPositionInParent(ChangelogBody.ChildCount - 2);
}
first = false;
var authorLabel = new RichTextLabel
{
Margin = new Thickness(6, 0, 0, 0),
};
authorLabel.SetMessage(
FormattedMessage.FromMarkup(Loc.GetString("changelog-author-changed", ("author", author))));
ChangelogBody.AddChild(authorLabel);
foreach (var change in groupedEntry.SelectMany(c => c.Changes))
{
var text = new RichTextLabel();
text.SetMessage(FormattedMessage.FromMarkup(change.Message));
ChangelogBody.AddChild(new HBoxContainer
{
Margin = new Thickness(14, 1, 10, 2),
Children =
{
GetIcon(change.Type),
text
}
});
}
}
}
var version = typeof(ChangelogWindow).Assembly.GetName().Version ?? new Version(1, 0);
VersionLabel.Text = Loc.GetString("changelog-version-tag", ("version", version.ToString()));
}
private TextureRect GetIcon(ChangelogLineType type)
{
var (file, color) = type switch
{
ChangelogLineType.Add => ("plus.svg.192dpi.png", "#6ED18D"),
ChangelogLineType.Remove => ("minus.svg.192dpi.png", "#D16E6E"),
ChangelogLineType.Fix => ("bug.svg.192dpi.png", "#D1BA6E"),
ChangelogLineType.Tweak => ("wrench.svg.192dpi.png", "#6E96D1"),
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null)
};
return new TextureRect
{
Texture = _resourceCache.GetTexture(new ResourcePath($"/Textures/Interface/Changelog/{file}")),
VerticalAlignment = VAlignment.Top,
TextureScale = (0.5f, 0.5f),
Margin = new Thickness(2, 4, 6, 2),
ModulateSelfOverride = Color.FromHex(color)
};
}
protected override DragMode GetDragModeFor(Vector2 relativeMousePos)
{
return DragMode.Move;
}
}
[UsedImplicitly]
public sealed class ChangelogCommand : IConsoleCommand
{
public string Command => "changelog";
public string Description => "Opens the changelog";
public string Help => "Usage: changelog";
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
new ChangelogWindow().OpenCentered();
}
}
}

View File

@@ -1,4 +1,5 @@
using Content.Client.Administration;
using Content.Client.Changelog;
using Content.Client.Chat;
using Content.Client.Eui;
using Content.Client.GameTicking;
@@ -45,6 +46,7 @@ namespace Content.Client
IoCManager.Register<IClientAdminManager, ClientAdminManager>();
IoCManager.Register<EuiManager, EuiManager>();
IoCManager.Register<IVoteManager, VoteManager>();
IoCManager.Register<ChangelogManager, ChangelogManager>();
}
}
}

View File

@@ -1,5 +1,6 @@
using System;
using Content.Client.Administration;
using Content.Client.Changelog;
using Content.Client.Eui;
using Content.Client.GameObjects.Components.Actor;
using Content.Client.Input;
@@ -98,6 +99,7 @@ namespace Content.Client
IoCManager.Resolve<IBaseClient>().PlayerJoinedServer += SubscribePlayerAttachmentEvents;
IoCManager.Resolve<IStylesheetManager>().Initialize();
IoCManager.Resolve<IScreenshotHook>().Initialize();
IoCManager.Resolve<ChangelogManager>().Initialize();
IoCManager.InjectDependencies(this);

View File

@@ -1,5 +1,6 @@
using System;
using System.Text.RegularExpressions;
using Content.Client.Changelog;
using Content.Client.UserInterface;
using Robust.Client;
using Robust.Client.ResourceManagement;
@@ -309,6 +310,8 @@ namespace Content.Client.State
vBox.AddChild(QuitButton);
vBox.AddChild(new ChangelogButton());
VersionLabel = new Label
{
Text = "v0.1"

View File

@@ -1,4 +1,5 @@
using Robust.Client.UserInterface;
using Content.Client.Changelog;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
@@ -35,10 +36,17 @@ namespace Content.Client.UserInterface
var creditsButton = new Button { Text = Loc.GetString("Credits") };
creditsButton.OnPressed += args => new CreditsWindow().Open();
var changelogButton = new ChangelogButton
{
HorizontalExpand = true,
HorizontalAlignment = HAlignment.Right
};
buttons.AddChild(discordButton);
buttons.AddChild(websiteButton);
buttons.AddChild(reportButton);
buttons.AddChild(creditsButton);
buttons.AddChild(changelogButton);
}
public void SetInfoBlob(string markup)

View File

@@ -94,6 +94,36 @@ namespace Content.Client.UserInterface.Stylesheets
};
BaseAngleRect.SetPatchMargin(StyleBox.Margin.All, 10);
var vScrollBarGrabberNormal = new StyleBoxFlat
{
BackgroundColor = Color.Gray.WithAlpha(0.35f), ContentMarginLeftOverride = 10,
ContentMarginTopOverride = 10
};
var vScrollBarGrabberHover = new StyleBoxFlat
{
BackgroundColor = new Color(140, 140, 140).WithAlpha(0.35f), ContentMarginLeftOverride = 10,
ContentMarginTopOverride = 10
};
var vScrollBarGrabberGrabbed = new StyleBoxFlat
{
BackgroundColor = new Color(160, 160, 160).WithAlpha(0.35f), ContentMarginLeftOverride = 10,
ContentMarginTopOverride = 10
};
var hScrollBarGrabberNormal = new StyleBoxFlat
{
BackgroundColor = Color.Gray.WithAlpha(0.35f), ContentMarginTopOverride = 10
};
var hScrollBarGrabberHover = new StyleBoxFlat
{
BackgroundColor = new Color(140, 140, 140).WithAlpha(0.35f), ContentMarginTopOverride = 10
};
var hScrollBarGrabberGrabbed = new StyleBoxFlat
{
BackgroundColor = new Color(160, 160, 160).WithAlpha(0.35f), ContentMarginTopOverride = 10
};
BaseRules = new[]
{
// Default font.
@@ -138,6 +168,52 @@ namespace Content.Client.UserInterface.Stylesheets
new StyleProperty(Control.StylePropertyModulateSelf, Color.FromHex("#753131")),
}),
// Scroll bars
new StyleRule(new SelectorElement(typeof(VScrollBar), null, null, null),
new[]
{
new StyleProperty(ScrollBar.StylePropertyGrabber,
vScrollBarGrabberNormal),
}),
new StyleRule(
new SelectorElement(typeof(VScrollBar), null, null, new[] {ScrollBar.StylePseudoClassHover}),
new[]
{
new StyleProperty(ScrollBar.StylePropertyGrabber,
vScrollBarGrabberHover),
}),
new StyleRule(
new SelectorElement(typeof(VScrollBar), null, null, new[] {ScrollBar.StylePseudoClassGrabbed}),
new[]
{
new StyleProperty(ScrollBar.StylePropertyGrabber,
vScrollBarGrabberGrabbed),
}),
new StyleRule(new SelectorElement(typeof(HScrollBar), null, null, null),
new[]
{
new StyleProperty(ScrollBar.StylePropertyGrabber,
hScrollBarGrabberNormal),
}),
new StyleRule(
new SelectorElement(typeof(HScrollBar), null, null, new[] {ScrollBar.StylePseudoClassHover}),
new[]
{
new StyleProperty(ScrollBar.StylePropertyGrabber,
hScrollBarGrabberHover),
}),
new StyleRule(
new SelectorElement(typeof(HScrollBar), null, null, new[] {ScrollBar.StylePseudoClassGrabbed}),
new[]
{
new StyleProperty(ScrollBar.StylePropertyGrabber,
hScrollBarGrabberGrabbed),
}),
};
}
}

View File

@@ -31,7 +31,6 @@ namespace Content.Client.UserInterface.Stylesheets
public const string StyleClassActionSearchBox = "actionSearchBox";
public const string StyleClassActionMenuItemRevoked = "actionMenuItemRevoked";
public const string StyleClassSliderRed = "Red";
public const string StyleClassSliderGreen = "Green";
public const string StyleClassSliderBlue = "Blue";
@@ -237,35 +236,6 @@ namespace Content.Client.UserInterface.Stylesheets
var tabContainerBoxInactive = new StyleBoxFlat {BackgroundColor = new Color(32, 32, 32)};
tabContainerBoxInactive.SetContentMarginOverride(StyleBox.Margin.Horizontal, 5);
var vScrollBarGrabberNormal = new StyleBoxFlat
{
BackgroundColor = Color.Gray.WithAlpha(0.35f), ContentMarginLeftOverride = 10,
ContentMarginTopOverride = 10
};
var vScrollBarGrabberHover = new StyleBoxFlat
{
BackgroundColor = new Color(140, 140, 140).WithAlpha(0.35f), ContentMarginLeftOverride = 10,
ContentMarginTopOverride = 10
};
var vScrollBarGrabberGrabbed = new StyleBoxFlat
{
BackgroundColor = new Color(160, 160, 160).WithAlpha(0.35f), ContentMarginLeftOverride = 10,
ContentMarginTopOverride = 10
};
var hScrollBarGrabberNormal = new StyleBoxFlat
{
BackgroundColor = Color.Gray.WithAlpha(0.35f), ContentMarginTopOverride = 10
};
var hScrollBarGrabberHover = new StyleBoxFlat
{
BackgroundColor = new Color(140, 140, 140).WithAlpha(0.35f), ContentMarginTopOverride = 10
};
var hScrollBarGrabberGrabbed = new StyleBoxFlat
{
BackgroundColor = new Color(160, 160, 160).WithAlpha(0.35f), ContentMarginTopOverride = 10
};
var progressBarBackground = new StyleBoxFlat
{
BackgroundColor = new Color(0.25f, 0.25f, 0.25f)
@@ -585,53 +555,6 @@ namespace Content.Client.UserInterface.Stylesheets
new StyleProperty(TabContainer.StylePropertyTabStyleBoxInactive, tabContainerBoxInactive),
}),
// Scroll bars
new StyleRule(new SelectorElement(typeof(VScrollBar), null, null, null),
new[]
{
new StyleProperty(ScrollBar.StylePropertyGrabber,
vScrollBarGrabberNormal),
}),
new StyleRule(
new SelectorElement(typeof(VScrollBar), null, null, new[] {ScrollBar.StylePseudoClassHover}),
new[]
{
new StyleProperty(ScrollBar.StylePropertyGrabber,
vScrollBarGrabberHover),
}),
new StyleRule(
new SelectorElement(typeof(VScrollBar), null, null, new[] {ScrollBar.StylePseudoClassGrabbed}),
new[]
{
new StyleProperty(ScrollBar.StylePropertyGrabber,
vScrollBarGrabberGrabbed),
}),
new StyleRule(new SelectorElement(typeof(HScrollBar), null, null, null),
new[]
{
new StyleProperty(ScrollBar.StylePropertyGrabber,
hScrollBarGrabberNormal),
}),
new StyleRule(
new SelectorElement(typeof(HScrollBar), null, null, new[] {ScrollBar.StylePseudoClassHover}),
new[]
{
new StyleProperty(ScrollBar.StylePropertyGrabber,
hScrollBarGrabberHover),
}),
new StyleRule(
new SelectorElement(typeof(HScrollBar), null, null, new[] {ScrollBar.StylePseudoClassGrabbed}),
new[]
{
new StyleProperty(ScrollBar.StylePropertyGrabber,
hScrollBarGrabberGrabbed),
}),
// ProgressBar
new StyleRule(new SelectorElement(typeof(ProgressBar), null, null, null),
new[]

View File

View File

View File

@@ -0,0 +1,11 @@
### Stuff for the changelog window.
changelog-window-title = Changelog
changelog-author-changed = [color=#EEE]{ $author }[/color] changed:
changelog-today = Today
changelog-yesterday = Yesterday
changelog-new-changes = new changes
changelog-version-tag = version v{ $version }
changelog-button = Changelog
changelog-button-new-entries = Changelog (new!)

View File

@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="16.0px"
height="16.0px"
viewBox="0 0 16.0 16.0"
version="1.1"
id="SVGRoot"
sodipodi:docname="bug.svg"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
inkscape:export-filename="C:\Users\Pieter-Jan Briers\Projects\space-station-14\Resources\Textures\Interface\Changelog\bug.svg.192dpi.png"
inkscape:export-xdpi="192"
inkscape:export-ydpi="192">
<defs
id="defs8135" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="31.678384"
inkscape:cx="10.09241"
inkscape:cy="9.2243662"
inkscape:document-units="px"
inkscape:current-layer="layer1"
inkscape:document-rotation="0"
showgrid="true"
inkscape:window-width="1920"
inkscape:window-height="1051"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:pagecheckerboard="true">
<inkscape:grid
type="xygrid"
id="grid8705"
empspacing="4" />
</sodipodi:namedview>
<metadata
id="metadata8138">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<g
id="g8754"
transform="matrix(1.1064506,0,0,1.1064506,-0.11268035,-1.5322532)">
<path
d="M 7.2750335,4.0303188 A 4.0947255,5.2023163 0 0 0 3.1805623,9.2325525 4.0947255,5.2023163 0 0 0 6.501489,14.34149 a 0.75582938,0.75582938 0 0 1 0,-0.02834 L 6.5369162,8.1578609 A 0.75582938,0.75582938 0 0 1 7.2951078,7.4079357 0.75582938,0.75582938 0 0 1 8.0450329,8.1673088 l -0.030705,6.1552882 a 0.75582938,0.75582938 0 0 1 -0.00122,0.02834 A 4.0947255,5.2023163 0 0 0 11.369467,9.2325458 4.0947255,5.2023163 0 0 0 7.275026,4.0303121 Z"
style="opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.52339;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="path2786" />
<path
style="font-variation-settings:normal;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:1.71381px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stop-color:#000000;stop-opacity:1"
d="M 5.7549076,11.38442 2.3893507,14.394025"
id="path2790" />
<path
style="font-variation-settings:normal;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:1.71381px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stop-color:#000000;stop-opacity:1"
d="m 9.4170987,11.691324 3.0076553,2.487001 v 0"
id="path2792" />
<path
style="font-variation-settings:normal;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:1.71381px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stop-color:#000000;stop-opacity:1"
d="M 8.8759086,9.4455411 13.545469,9.3827338"
id="path2794" />
<path
style="fill:none;stroke:#ffffff;stroke-width:1.71381px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 6.4649896,7.4883305 1.7709979,4.9026751"
id="path2796"
sodipodi:nodetypes="cc"
inkscape:transform-center-x="0.077447549"
inkscape:transform-center-y="0.080029012" />
<path
id="path2794-56"
d="M 1.058522,9.4283938 5.7280823,9.3655876"
style="font-variation-settings:normal;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:1.71381px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stop-color:#000000;stop-opacity:1" />
<path
inkscape:transform-center-y="0.1086333"
inkscape:transform-center-x="-0.024527052"
sodipodi:nodetypes="cc"
id="path2796-2"
d="M 12.768261,5 8.033707,7.5106113"
style="fill:none;stroke:#ffffff;stroke-width:1.71381px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<ellipse
style="font-variation-settings:normal;opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.81399;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stop-color:#000000;stop-opacity:1"
id="path3479"
cx="7.275034"
cy="4.2213764"
rx="2.0416076"
ry="1.9667845" />
</g>
</g>
</svg>

Binary file not shown.

After

Width:  |  Height:  |  Size: 728 B

View File

@@ -0,0 +1,2 @@
sample:
filter: true

View File

@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="16.0px"
height="16.0px"
viewBox="0 0 16.0 16.0"
version="1.1"
id="SVGRoot"
sodipodi:docname="minus.svg"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
inkscape:export-filename="C:\Users\Pieter-Jan Briers\Projects\space-station-14\Resources\Textures\Interface\Changelog\minus.svg.192dpi.png"
inkscape:export-xdpi="192"
inkscape:export-ydpi="192">
<defs
id="defs6959" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="44.8"
inkscape:cx="7.7756568"
inkscape:cy="7.7484636"
inkscape:document-units="px"
inkscape:current-layer="layer1"
inkscape:document-rotation="0"
showgrid="true"
inkscape:window-width="1566"
inkscape:window-height="1033"
inkscape:window-x="192"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:pagecheckerboard="true"
inkscape:snap-object-midpoints="true">
<inkscape:grid
type="xygrid"
id="grid7529"
empspacing="4" />
</sodipodi:namedview>
<metadata
id="metadata6962">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<rect
style="fill:#ffffff;stroke-width:4.40315;stop-color:#000000;fill-opacity:1"
id="rect2663"
width="14"
height="3"
x="1"
y="6.5"
ry="0.5" />
</g>
</svg>

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

View File

@@ -0,0 +1,2 @@
sample:
filter: true

View File

@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="16.0px"
height="16.0px"
viewBox="0 0 16.0 16.0"
version="1.1"
id="SVGRoot"
sodipodi:docname="plus.svg"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
inkscape:export-filename="C:\Users\Pieter-Jan Briers\Projects\space-station-14\Resources\Textures\Interface\Changelog\plus.svg.192dpi.png"
inkscape:export-xdpi="192"
inkscape:export-ydpi="192">
<defs
id="defs2084" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="45.254834"
inkscape:cx="8.3513389"
inkscape:cy="8.3521631"
inkscape:document-units="px"
inkscape:current-layer="layer1"
inkscape:document-rotation="0"
showgrid="true"
inkscape:window-width="1920"
inkscape:window-height="1051"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:pagecheckerboard="true"
inkscape:snap-object-midpoints="true">
<inkscape:grid
type="xygrid"
id="grid2654"
empspacing="4"
enabled="true" />
</sodipodi:namedview>
<metadata
id="metadata2087">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<rect
style="fill:#ffffff;stroke-width:4.40315;stop-color:#000000;fill-opacity:1"
id="rect2663"
width="14"
height="3"
x="1"
y="6.5"
ry="0.5" />
<rect
style="fill:#ffffff;stroke-width:4.40315;stop-color:#000000;fill-opacity:1"
id="rect2663-4"
width="14"
height="3"
x="1"
y="-9.5"
transform="rotate(90)"
ry="0.5" />
</g>
</svg>

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

View File

@@ -0,0 +1,2 @@
sample:
filter: true

View File

@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="12"
height="12"
viewBox="0 0 12 12"
version="1.1"
id="SVGRoot"
sodipodi:docname="up_arrow.svg"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
inkscape:export-filename="C:\Users\Pieter-Jan Briers\Projects\space-station-14\Resources\Textures\Interface\Changelog\up_arrow.svg.192dpi.png"
inkscape:export-xdpi="192"
inkscape:export-ydpi="192">
<defs
id="defs1402" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="45.254834"
inkscape:cx="7.8565809"
inkscape:cy="5.1035566"
inkscape:document-units="px"
inkscape:current-layer="g1985"
inkscape:document-rotation="0"
showgrid="true"
inkscape:window-width="1920"
inkscape:window-height="1051"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:pagecheckerboard="true"
inkscape:snap-grids="true"
inkscape:snap-page="true">
<inkscape:grid
type="xygrid"
id="grid1972"
empspacing="4" />
</sodipodi:namedview>
<metadata
id="metadata1405">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<g
id="g1985"
transform="translate(0,-0.5)">
<path
style="fill:none;stroke:#ffffff;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 6,11.5 V 1.5"
id="path1979"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#ffffff;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 3,5.5 3,-4 3,4"
id="path1981"
sodipodi:nodetypes="ccc" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 B

View File

@@ -0,0 +1,2 @@
sample:
filter: true

View File

@@ -0,0 +1,147 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="16"
height="16"
viewBox="0 0 0.32253968 0.22805837"
version="1.1"
id="svg2701"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
sodipodi:docname="wrench.svg"
inkscape:export-filename="C:\Users\Pieter-Jan Briers\Projects\space-station-14\Resources\Textures\Interface\Changelog\wrench.svg.192dpi.png"
inkscape:export-xdpi="192.00002"
inkscape:export-ydpi="192.00002">
<defs
id="defs2695">
<inkscape:path-effect
effect="fillet_chamfer"
id="path-effect3293"
is_visible="false"
lpeversion="1"
satellites_param="F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1"
unit="px"
method="auto"
mode="F"
radius="0"
chamfer_steps="1"
flexible="false"
use_knot_distance="true"
apply_no_radius="true"
apply_with_radius="true"
only_selected="false"
hide_knots="false" />
<inkscape:path-effect
effect="mirror_symmetry"
start_point="112.25918,24.05928"
end_point="112.25918,175.62773"
center_point="112.25918,99.843507"
id="path-effect3285"
is_visible="true"
lpeversion="1"
mode="free"
discard_orig_path="false"
fuse_paths="true"
oposite_fuse="true"
split_items="false" />
<inkscape:path-effect
effect="mirror_symmetry"
start_point="85.543127,56.35961"
end_point="81.847932,190.21749"
center_point="83.69553,123.28855"
id="path-effect3270"
is_visible="true"
lpeversion="1"
mode="free"
discard_orig_path="false"
fuse_paths="true"
oposite_fuse="true"
split_items="false" />
<inkscape:path-effect
effect="mirror_symmetry"
start_point="134.15333,63.888624"
end_point="134.15333,240.30901"
center_point="134.15333,152.09882"
id="path-effect3266"
is_visible="true"
lpeversion="1"
mode="free"
discard_orig_path="false"
fuse_paths="true"
oposite_fuse="true"
split_items="false" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
inkscape:cx="8.660981"
inkscape:cy="6.1740838"
inkscape:document-units="px"
inkscape:current-layer="layer1"
inkscape:document-rotation="0"
showgrid="true"
inkscape:snap-bbox="true"
inkscape:bbox-paths="true"
showguides="true"
inkscape:guide-bbox="true"
units="px"
inkscape:pagecheckerboard="true"
inkscape:bbox-nodes="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:snap-bbox-midpoints="true"
inkscape:object-paths="false"
inkscape:object-nodes="true"
inkscape:snap-grids="false"
inkscape:snap-smooth-nodes="true"
inkscape:window-width="1920"
inkscape:window-height="1051"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1">
<sodipodi:guide
position="-0.048108514,0.14774252"
orientation="1,0"
id="guide3875" />
<inkscape:grid
type="xygrid"
id="grid6951"
empspacing="4"
enabled="true"
visible="true" />
</sodipodi:namedview>
<metadata
id="metadata2698">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<path
style="fill:#fffffe;fill-opacity:1;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 112.25918,217.69257 15.87475,-15.87475 V 109.63455 L 144.3869,93.381579 V 73.614223 L 128.13393,57.361248 v 29.288144 l -9.28263,9.282623 h -6.59212 -6.59212 L 96.38443,86.649392 V 57.361248 L 80.13146,73.614223 v 19.767356 l 16.25297,16.252971 v 92.18327 z"
id="path3268"
sodipodi:nodetypes="cccccccccc"
transform="matrix(0.00160166,0.00160166,-0.00160166,0.00160166,0.18902718,-0.27333023)"
inkscape:path-effect="#path-effect3285"
inkscape:original-d="m 112.25918,217.69257 15.87475,-15.87475 v -92.18327 l 16.25297,-16.252971 0,-19.767356 -16.25297,-16.252975 v 29.288144 l -9.28263,9.282623 -6.59212,0 z" />
</g>
</svg>

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

View File

@@ -0,0 +1,2 @@
sample:
filter: true

70
Tools/update_changelog.py Executable file
View File

@@ -0,0 +1,70 @@
#!/usr/bin/env python3
import sys
import os
from typing import List, Any
import yaml
import argparse
import datetime
MAX_ENTRIES = 500
HEADER_RE = r"(?::cl:|🆑) *\r?\n(.+)$"
ENTRY_RE = r"^ *[*-]? *(\S[^\n\r]+)\r?$"
def main():
parser = argparse.ArgumentParser()
parser.add_argument("changelog_file")
parser.add_argument("parts_dir")
args = parser.parse_args()
with open(args.changelog_file, "r", encoding="utf-8-sig") as f:
current_data = yaml.safe_load(f)
entries_list: List[Any]
if current_data is None:
entries_list = []
else:
entries_list = current_data["Entries"]
max_id = max(map(lambda e: e["id"], entries_list), default=0)
for partname in os.listdir(args.parts_dir):
if not partname.endswith(".yml"):
continue
partpath = os.path.join(args.parts_dir, partname)
print(partpath)
partyaml = yaml.safe_load(open(partpath, "r", encoding="utf-8-sig"))
author = partyaml["author"]
time = partyaml.get(
"time", datetime.datetime.now(datetime.timezone.utc).isoformat()
)
changes = partyaml["changes"]
max_id += 1
new_id = max_id
entries_list.append(
{"author": author, "time": time, "changes": changes, "id": new_id}
)
os.remove(partpath)
print(f"Have {len(entries_list)} changelog entries")
entries_list.sort(key=lambda e: e["id"])
overflow = len(entries_list) - MAX_ENTRIES
if overflow > 0:
print(f"Removing {overflow} old entries.")
entries_list = entries_list[overflow:]
with open(args.changelog_file, "w") as f:
yaml.safe_dump({"Entries": entries_list}, f)
main()