Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13 int…
Browse files Browse the repository at this point in the history
…o hair-fix
  • Loading branch information
AmoryBlaine committed Sep 14, 2024
2 parents f4ef041 + aaa1bf7 commit 13564eb
Show file tree
Hide file tree
Showing 2,325 changed files with 767,170 additions and 893,318 deletions.
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@
/tools/docker/ @Fira
/Dockerfile @Fira

# Nanu

/maps @Nanu308

# Zonespace

/code/datums/tutorial/ @Zonespace27
/code/modules/admin/verbs/SDQL2/ @Zonespace27
/maps/tutorial/ @Zonespace27

# MULTIPLE OWNERS
15 changes: 11 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ There is no strict process when it comes to merging pull requests. Pull requests

* After leaving reviews on an open pull request, maintainers should convert it to a draft. Once you have addressed all their comments to the best of your ability, feel free to mark the pull as `Ready for Review` again.

* We ask that you refrain from pinging staff about getting your pull request reviewed until after it is automatically marked stale pending review. If it ends up stale exempt, give it a week, but usually this situation will be explained such as when a relevant maintainer is currently unavailable.

* Whenever sprites are added, please include screenshots or video(s) of them in game in the pull request description.

### A note on balance impacting PRs

Certain PRs, such as those which directly change number values (i.e. health, recoil, damage) or add large pieces of content to the game (i.e. a new gun, a new dropship weapon, or a new xeno structure) can have the potential to highly impact game balance or gameflow.
Expand All @@ -174,7 +178,7 @@ If you are porting features/tools from other codebases, you must give them credi
Regarding sprites & sounds, you must credit the artist and possibly the codebase.

## Things you can work on
The following list is non-exhaustive, but should give you a good idea of what the dev team would like to see in Pull Requests.
The following list is non-exhaustive, but should give you a good idea of what we would like to see in Pull Requests.

### Spriting

Expand All @@ -199,7 +203,7 @@ The following list is non-exhaustive, but should give you a good idea of what th
- Bug fixes and inconsistency fixes

**A note on new maps.**
Entirely new maps are generally considered to be stepping stones into the Development team’s mapping dept. proper. However, making a new map is a months long process that requires dedication and constant communication and oversight from mappers on the Maintainer team. Mapping, like spriting and coding is an acquired skill, and it is highly likely your first map is going to suck. Maps are fluid entities that are never absolutely complete, don’t wed yourself to your initial layout, always be prepared to remap half the project when going in.
Entirely new maps are generally considered to be stepping stones into the maintainers’ mapping dept. proper. However, making a new map is a months long process that requires dedication and constant communication and oversight from mappers on the Maintainer team. Mapping, like spriting and coding is an acquired skill, and it is highly likely your first map is going to suck. Maps are fluid entities that are never absolutely complete, don’t wed yourself to your initial layout, always be prepared to remap half the project when going in.


### Coding
Expand All @@ -216,7 +220,7 @@ Entirely new maps are generally considered to be stepping stones into the Develo
- New TGUI

## What we don't want
The following list is non-exhaustive, but should give you a good idea of what the dev team don't want to see in Pull Requests.
The following list is non-exhaustive, but should give you a good idea of what we don't want to see in Pull Requests.

### Spriting
- Resprites of recently updated content, such as uniforms, guns, marine armor
Expand All @@ -236,7 +240,10 @@ The following list is non-exhaustive, but should give you a good idea of what th
- Player-facing HTML UIs
- Prior denied content/PRs (without approval)

Remember that the following lists are not exhaustive. And you can freely contribute an PR with content that can be shuffled into the “What we don’t want” category, and still get it merged. It is just unlikely without prior talk/approval from a maintainer.
### Frozen
- See pinned [issues](https://github.com/cmss13-devs/cmss13/issues) for anything that requires explicit permission.

Remember that the list is not exhaustive. And you can freely contribute an PR with content that can be shuffled into the “What we don’t want” category, and still get it merged. It is just unlikely without prior talk/approval from a maintainer.

## Banned content
Do not add any of the following in a Pull Request or risk getting the PR closed:
Expand Down
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Remember: something that is self-evident to you might not be to others. Explain

# Testing Photographs and Procedure
<!-- Include any screenshots/videos/debugging steps of the modified code functioning successfully, ideally including edge cases. -->

<!-- !! If you are modifying sprites, you **must** include one or more in-game screenshots or videos of the new sprites. !! -->

<details>
<summary>Screenshots & Videos</summary>

Expand Down
158 changes: 88 additions & 70 deletions .github/add_labels.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import os, re
from github import Github
from github import Github, GithubException

# Format - Key: Array[Label, [StringsToIgnore]]
changelogToPrefix = {
'fix': ["Fix", ["fixed a few things"]],
'qol': ["Quality of Life", ["made something easier to use"]],
'add': ["Feature", ["Added new mechanics or gameplay changes", "Added more things"]],
'del': ["Removal", ["Removed old things"]],
'spellcheck': ["Grammar and Formatting", ["fixed a few typos"]],
'balance': ["Balance", ["rebalanced something"]],
'code': ["Code Improvement", ["changed some code"]],
'refactor': ["Refactor", ["refactored some code"]],
'config': ["Config", ["changed some config setting"]],
'admin': ["Admin", ["messed with admin stuff"]],
'server': ["Server", ["something server ops should know"]],
'fix': ["Fix", ["fixed a few things"]],
'qol': ["Quality of Life", ["made something easier to use"]],
'add': ["Feature", ["Added new mechanics or gameplay changes", "Added more things"]],
'del': ["Removal", ["Removed old things"]],
'spellcheck': ["Grammar and Formatting", ["fixed a few typos"]],
'balance': ["Balance", ["rebalanced something"]],
'code': ["Code Improvement", ["changed some code"]],
'refactor': ["Refactor", ["refactored some code"]],
'config': ["Config", ["changed some config setting"]],
'admin': ["Admin", ["messed with admin stuff"]],
'server': ["Server", ["something server ops should know"]],
'soundadd': ["Sound", ["added a new sound thingy"]],
'sounddel': ["Sound", ["removed an old sound thingy"]],
'imageadd': ["Sprites", ["added some icons and images"]],
Expand All @@ -24,78 +24,96 @@
}

fileToPrefix = {
'wav': 'Sound',
'ogg': 'Sound',
'wav': 'Sound',
'ogg': 'Sound',
'mp3': 'Sound', ## Can't believe they forgot about the best sound format
'dmm': 'Mapping',
'dmm': 'Mapping',

'js': 'UI',
'tsx': 'UI',
'ts': 'UI',
'jsx': 'UI',
'scss': 'UI',
'js': 'UI',
'tsx': 'UI',
'ts': 'UI',
'jsx': 'UI',
'scss': 'UI',

'dmi': "Sprites",
'dmi': "Sprites",
}

githubLabel = "Github"
missingLogLabel = "Missing Changelog"

def get_labels(pr):
labels = {}

files = pr.get_files()
for file in files:
prefix = file.filename.split(".")[-1]
if file.filename.startswith(".github"):
labels[githubLabel] = True
if not prefix in fileToPrefix:
continue
labels[fileToPrefix[prefix]] = True

changelog_match = re.search(r"🆑(.*)/🆑", pr.body, re.S | re.M)
if changelog_match is None:
changelog_match = re.search(r":cl:(.*)/:cl:", pr.body, re.S | re.M)
if changelog_match is None:
return labels
lines = changelog_match.group(1).split('\n')
for line in lines:
line = line.strip()
if not line:
continue

contentSplit = line.split(":")

key = contentSplit.pop(0).strip()
content = ":".join(contentSplit).strip()

if not key in changelogToPrefix:
continue

if content in changelogToPrefix[key][1]:
continue

labels[changelogToPrefix[key][0]] = True

return list(labels)
labels = {}
failed = False

files = pr.get_files()
for file in files:
prefix = file.filename.split(".")[-1]
if file.filename.startswith(".github"):
labels[githubLabel] = True
if not prefix in fileToPrefix:
continue
labels[fileToPrefix[prefix]] = True

changelog_match = re.search(r"🆑(.*)/🆑", pr.body, re.S | re.M)
if changelog_match is None:
changelog_match = re.search(r":cl:(.*)/:cl:", pr.body, re.S | re.M)
if changelog_match is None:
print("::warning ::No changelog detected.")
labels[missingLogLabel] = True
return labels, False

lines = changelog_match.group(1).split('\n')
failed = len(lines) <= 2 # Make sure its not an empty changelog
if failed:
print("::error ::Empty changelog.")

for line in lines[1:-1]: # Skip first line with authors and last
line = line.strip()
if not line:
continue

contentSplit = line.split(":")

key = contentSplit.pop(0).strip()
content = ":".join(contentSplit).strip()

if not key in changelogToPrefix: # Some key that we didn't expect
print(f"::error ::Invalid changelog entry: {line}")
failed = True
continue

if content in changelogToPrefix[key][1]: # They left the template entry in
print(f"::error ::Invalid changelog entry: {line}")
failed = True
continue

labels[changelogToPrefix[key][0]] = True

return list(labels), failed

def main():
g = Github(os.environ["TOKEN"])
repo = g.get_repo(os.environ['REPO'])
g = Github(os.environ["TOKEN"])
repo = g.get_repo(os.environ['REPO'])

pr = repo.get_pull(int(os.environ["PR_NUMBER"]))
if not pr:
print("Not a PR.")
return
pr = repo.get_pull(int(os.environ["PR_NUMBER"]))
if not pr:
print("::warning ::Not a PR.")
return

labels = get_labels(pr)
labels, failed = get_labels(pr)

if labels is None: # no labels to add
print("No labels to add.")
return
if not missingLogLabel in labels:
try:
pr.remove_from_labels(missingLogLabel)
except GithubException as e:
if e.status == 404:
pass # 404 if we try to remove a label that isn't set

for label in labels:
pr.add_to_labels(label)
for label in labels:
pr.add_to_labels(label)

if failed:
exit(1)

if __name__ == '__main__':
main()
main()
Binary file added .github/assets/discord-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/discord-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/docs-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/docs-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/website-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/website-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/wiki-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/wiki-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions .github/guides/AUTODOC.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# dmdoc
[DOCUMENTATION]: **PUT DOCUMENTATION LINK HERE**
[DOCUMENTATION]: https://docs.cm-ss13.com/

[BYOND]: https://secure.byond.com/

[DMDOC]: https://github.com/SpaceManiac/SpacemanDMM/tree/master/src/dmdoc
[DMDOC]: https://github.com/SpaceManiac/SpacemanDMM/tree/master/crates/dmdoc

[DMDOC] is a documentation generator for DreamMaker, the scripting language
of the [BYOND] game engine. It produces simple static HTML files based on
Expand All @@ -13,9 +13,9 @@ We use **dmdoc** to generate [DOCUMENTATION] for our code, and that documentatio
is automatically generated and built on every new commit to the master branch

This gives new developers a clickable reference [DOCUMENTATION] they can browse to better help
gain understanding of the /tg/station codebase structure and api reference.
gain understanding of the CM-SS13 codebase structure and api reference.

## Documenting code on /tg/station
## Documenting code on CM-SS13
We use block comments to document procs and classes, and we use `///` line comments
when documenting individual variables.

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Labeling
name: Labeling and Verification
on:
pull_request_target:
types: [opened]
types: [opened, reopened, synchronize, edited]
jobs:
label:
runs-on: ubuntu-latest
Expand All @@ -13,7 +13,7 @@ jobs:
run: |
unset SECRET_EXISTS
if [ -n "$ENABLER_SECRET" ]; then SECRET_EXISTS=true ; fi
echo "::set-output name=ACTIONS_ENABLED::$SECRET_EXISTS"
echo "ACTIONS_ENABLED=$SECRET_EXISTS" >> $GITHUB_OUTPUT
- name: Get The Script
if: steps.value_holder.outputs.ACTIONS_ENABLED
run: |
Expand All @@ -29,7 +29,7 @@ jobs:
python -m pip install --upgrade pip
python -m pip install pygithub
sudo apt-get install dos2unix
- name: Add Labels
- name: Add and verify labels
if: steps.value_holder.outputs.ACTIONS_ENABLED
run: |
python add_labels.py
Expand Down
13 changes: 13 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,19 @@
],
"group": "build",
"label": "tgui: sonar"
},
{
"type": "shell",
"command": "bin/tgfont",
"windows": {
"command": ".\\bin\\tgfont.cmd"
},
"problemMatcher": [
"$tsc",
"$eslint-stylish"
],
"group": "build",
"label": "tgui: rebuild tgfont"
}
]
}
Loading

0 comments on commit 13564eb

Please sign in to comment.