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

Ingame Changelog #17

Merged
merged 28 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
100 changes: 100 additions & 0 deletions .github/workflows/auto-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Update Changelog

on:
pull_request:
types: [closed]

jobs:
update-changelog:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install PyYAML
run: pip install pyyaml

- name: Parse PR and Update Changelog
env:
CHANGELOG_FILE_PATH: 'Resources/Changelog/ChangelogStarlight.yml'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
import os
import yaml
import re
from datetime import datetime
from github import Github

changelog_path = os.getenv("CHANGELOG_FILE_PATH")
pr_number = os.getenv("GITHUB_REF").split('/')[-1]
repo_name = os.getenv("GITHUB_REPOSITORY")
github_token = os.getenv("GITHUB_TOKEN")

g = Github(github_token)
repo = g.get_repo(repo_name)
pr = repo.get_pull(int(pr_number))

def parse_changelog(pr_body):
changelog_entries = []
pattern = r":cl: (.+?)\\n((?:- (add|remove|tweak|fix): .+\\n)+)"
matches = re.finditer(pattern, pr_body, re.MULTILINE)

for match in matches:
author = match.group(1).strip()
changes = match.group(2).strip().splitlines()

for change in changes:
change_type, message = change.split(":", 1)
changelog_entries.append({
"author": author,
"type": change_type.strip('- ').capitalize(),
"message": message.strip()
})
return changelog_entries

def get_last_id(changelog_data):
if not changelog_data or "Entries" not in changelog_data or not changelog_data["Entries"]:
return 0
return max(entry["id"] for entry in changelog_data["Entries"])

if ":cl:" in pr.body:
merge_time = pr.merged_at
entries = parse_changelog(pr.body)

if os.path.exists(changelog_path):
with open(changelog_path, "r") as file:
changelog_data = yaml.safe_load(file) or {"Entries": []}
else:
changelog_data = {"Entries": []}

last_id = get_last_id(changelog_data)
for entry in entries:
last_id += 1
changelog_entry = {
"author": entry["author"],
"changes": [{
"message": entry["message"],
"type": entry["type"]
}],
"id": last_id,
"time": merge_time.isoformat()
}
changelog_data["Entries"].append(changelog_entry)

with open(changelog_path, "w") as file:
yaml.dump(changelog_data, file, allow_unicode=True)

- name: Commit and push changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add $CHANGELOG_FILE_PATH
git commit -m "Update changelog for PR #${{ github.event.pull_request.number }}"
git push
3 changes: 3 additions & 0 deletions Content.Client/Lobby/LobbyState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ protected override void Startup()
_voteManager.SetPopupContainer(Lobby.VoteContainer);
LayoutContainer.SetAnchorPreset(Lobby, LayoutContainer.LayoutPreset.Wide);

// STARLIGHT-START
Lobby.ServerName.Text = "☆ Starlight ☆"; //todo
UpdateLobbyUi();

// STARLIGHT-END

Lobby.CharacterPreview.CharacterSetupButton.OnPressed += OnSetupPressed;
Lobby.ReadyButton.OnPressed += OnReadyPressed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public void CloneAppearance(EntityUid source, EntityUid target, HumanoidAppearan
{
grammar.Gender = sourceHumanoid.Gender;
}
SetTTSVoice(target, sourceHumanoid.Voice, targetHumanoid);
if (sourceHumanoid.Voice != null)
SetTTSVoice(target, sourceHumanoid.Voice, targetHumanoid);
Dirty(target, targetHumanoid);
}

Expand Down
5 changes: 3 additions & 2 deletions Content.Shared/Humanoid/HumanoidAppearanceComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;

namespace Content.Shared.Humanoid;

Expand Down Expand Up @@ -95,8 +96,8 @@ public sealed partial class HumanoidAppearanceComponent : Component
{Sex.Female, "Amina"},
{Sex.Unsexed, "Charlotte"}
};
[DataField]
public ProtoId<VoicePrototype> Voice { get; set; } = "";
[DataField("voice", customTypeSerializer: typeof(PrototypeIdSerializer<VoicePrototype>))]
public string? Voice { get; set; }
}

[DataDefinition]
Expand Down
5 changes: 5 additions & 0 deletions Content.Shared/_Starlight/CCVar/StarlightCCVars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ namespace Content.Shared.Starlight.CCVar;
[CVarDefs]
public sealed partial class StarlightCCVars
{
/// <summary>
/// Basic CCVars
/// </summary>
public static readonly CVarDef<string> LobbyChangelogsList =
CVarDef.Create("lobby_changelog.list", "ChangelogStarlight.yml,Changelog.yml", CVar.SERVER | CVar.REPLICATED);
}
2 changes: 1 addition & 1 deletion Resources/Audio/Lobby/attributions.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- files: ["Chasing-Cosmic-Dreams.ogg.ogg"]
license: "CC-BY-NC-SA-3.0"
copyright: "Darkrell"
source: "Starlight"
source: "https://github.com/ss14Starlight/space-station-14"

- files: ["thunderdome.ogg"]
license: "CC-BY-NC-SA-3.0"
Expand Down
4 changes: 2 additions & 2 deletions Resources/Audio/_Starlight/Announcements/attributions.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- files: ["recallEvac.ogg","callEvac.ogg","attention.ogg"]
license: "Creative Commons NonCommercial"
license: "CC-BY-NC-SA-3.0"
copyright: "darkrell"
source: "darkrell"
source: "https://github.com/ss14Starlight/space-station-14"
2 changes: 1 addition & 1 deletion Resources/Audio/_Starlight/Effects/attributions.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- files: ["chisel","stones_falling"]
license: "CC-BY-4.0"
copyright: 'Darkrell'
source: "Starlight"
source: "https://github.com/ss14Starlight/space-station-14"
22 changes: 10 additions & 12 deletions Resources/Audio/_Starlight/Voice/Cyclorite/attributions.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
- files:
[
"scream_1.ogg",
"scream_2.ogg",
"cough_1.ogg",
"cough_2.ogg",
"yawn.ogg",
"scream4.ogg",
"laugh.ogg",
"whistle.ogg",
]
license: "Creative Commons NonCommercial"
- scream_1.ogg
- scream_2.ogg
- cough_1.ogg
- cough_2.ogg
- yawn.ogg
- scream4.ogg
- laugh.ogg
- whistle.ogg
license: "CC-BY-NC-SA-3.0"
copyright: "Darkrell"
source: "Darkrell"
source: "https://github.com/ss14Starlight/space-station-14"
26 changes: 12 additions & 14 deletions Resources/Audio/_Starlight/Voice/Felionoid/attributions.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
- files:
[
"cat_hiss1.ogg",
"cat_hiss2.ogg",
"cat_scream1.ogg",
"cat_scream2.ogg",
"cat_scream3.ogg",
"cat_scream4.ogg",
"cat_mew1.ogg",
"cat_mew2.ogg",
"cat_mew3.ogg",
"cat_mew4.ogg",
]
license: "Creative Commons NonCommercial"
- cat_hiss1.ogg
- cat_hiss2.ogg
- cat_scream1.ogg
- cat_scream2.ogg
- cat_scream3.ogg
- cat_scream4.ogg
- cat_mew1.ogg
- cat_mew2.ogg
- cat_mew3.ogg
- cat_mew4.ogg
license: "CC-BY-NC-SA-3.0"
copyright: "Darkrell"
source: "Darkrell"
source: "https://github.com/ss14Starlight/space-station-14"
7 changes: 7 additions & 0 deletions Resources/Changelog/ChangelogStarlight.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Entries:
- author: Rinary
changes:
- message: Init
type: Add
id: 1
time: '2024-08-11T11:38:00.059464+00:00'
1 change: 1 addition & 0 deletions Resources/Locale/en-US/changelog/changelog-window.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ changelog-button = Changelog
changelog-button-new-entries = Changelog (new!)

changelog-tab-title-Changelog = Changelog
changelog-tab-title-ChangelogStarlight = STARLIGHT Changelog
changelog-tab-title-Admin = Admin
1 change: 1 addition & 0 deletions Resources/Locale/en-US/metabolism/metabolizer-types.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ metabolizer-type-plant = Plant
metabolizer-type-dwarf = Dwarf
metabolizer-type-moth = Moth
metabolizer-type-arachnid = Arachnid
metabolizer-type-vampire = Vampire
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Traitor single items
steal-target-groups-supermatter-sliver = supermatter sliver
steal-target-groups-hypospray = hypospray
steal-target-groups-handheld-crew-monitor = handheld crew monitor
steal-target-groups-clothing-outer-hardsuit-rd = experimental research hardsuit
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Actions/types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
id: ActionToggleDome
name: Toggle energy dome
description: Turn the energy barrier on or off.
noSpawn: true
categories: [ HideSpawnMenu ]
components:
- type: InstantAction
icon: { sprite: Objects/Weapons/Melee/e_shield.rsi, state: eshield-on }
Expand Down
5 changes: 0 additions & 5 deletions Resources/Prototypes/Entities/Effects/dome.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@

- type: entity
id: EnergyDomeSmallPink
noSpawn: true
categories: [ HideSpawnMenu ]
parent: EnergyDomeBase
components:
Expand All @@ -53,7 +52,6 @@

- type: entity
id: EnergyDomeSmallCap
noSpawn: true
categories: [ HideSpawnMenu ]
parent: EnergyDomeBase
components:
Expand All @@ -65,7 +63,6 @@

- type: entity
id: EnergyDomeSmallRed
noSpawn: true
categories: [ HideSpawnMenu ]
parent: EnergyDomeBase
components:
Expand All @@ -84,7 +81,6 @@

- type: entity
id: EnergyDomeMediumBlue
noSpawn: true
categories: [ HideSpawnMenu ]
parent: EnergyDomeBase
components:
Expand Down Expand Up @@ -113,7 +109,6 @@

- type: entity
id: EnergyDomeSlowing
noSpawn: true
categories: [ HideSpawnMenu ]
parent: EnergyDomeBase
components:
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Objectives/stealTargetGroups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

- type: stealTargetGroup
id: SupermatterSliver
name: supermatter sliver
name: steal-target-groups-supermatter-sliver
sprite:
sprite: Objects/Misc/supermatter_sliver.rsi
state: icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
!type:TattooColoring
fallbackColor: "#666666"
sprites:
- sprite: _Starlight/Mobs/Customization/Felionoid_tattoos.rsi
- sprite: _Starlight/Mobs/Customization/felionoid_tattoos.rsi
state: heart_l_arm

- type: marking
Expand All @@ -23,7 +23,7 @@
!type:TattooColoring
fallbackColor: "#666666"
sprites:
- sprite: _Starlight/Mobs/Customization/Felionoid_tattoos.rsi
- sprite: _Starlight/Mobs/Customization/felionoid_tattoos.rsi
state: heart_r_arm

- type: marking
Expand All @@ -37,7 +37,7 @@
!type:TattooColoring
fallbackColor: "#666666"
sprites:
- sprite: _Starlight/Mobs/Customization/Felionoid_tattoos.rsi
- sprite: _Starlight/Mobs/Customization/felionoid_tattoos.rsi
state: hive_s

- type: marking
Expand All @@ -51,5 +51,5 @@
!type:TattooColoring
fallbackColor: "#666666"
sprites:
- sprite: _Starlight/Mobs/Customization/Felionoid_tattoos.rsi
- sprite: _Starlight/Mobs/Customization/felionoid_tattoos.rsi
state: nightling_s
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- type: entity
name: abductor scientist
parent: BaseMobAbductor
id: MobAbductorLone
id: MobAbductor
components:
- type: AbductorScientist
- type: ActionGrant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
- type: Item
sprite: _Starlight/Objects/Materials/materials.rsi
size: Normal
scale: 0.5, 0.5
- type: PointLight
radius: 3.2
energy: 1.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
- type: Item
sprite: _Starlight/Objects/Materials/ore.rsi
size: Normal
scale: 0.5, 0.5
- type: Material
- type: PhysicalComposition
materialComposition:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- type: dungeonRoom
id: ElderArena
size: 25,25
atlas: Maps/_Starlight/Dungeon/elder-arena.yml
atlas: /Maps/_Starlight/Dungeon/elder-arena.yml
offset: 0,0
tags:
- ElderArena
Loading
Loading