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

5 #15

Closed
wants to merge 9 commits into from
Closed

5 #15

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
34 changes: 0 additions & 34 deletions .github/workflows/prtitlecase.yml

This file was deleted.

4 changes: 3 additions & 1 deletion BuildChecker/BuildChecker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild
-->
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Python>python3</Python>
<Python Condition="'$(OS)'=='Windows_NT' Or '$(OS)'=='Windows'">py -3</Python>
<ProjectGuid>{C899FCA4-7037-4E49-ABC2-44DE72487110}</ProjectGuid>
<TargetFrameworkMoniker>.NETFramework, Version=v4.7.2</TargetFrameworkMoniker>
<RestorePackages>false</RestorePackages>
Expand All @@ -37,7 +39,7 @@ https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild
<OutputPath>bin\DebugOpt\</OutputPath>
</PropertyGroup>
<Target Name="Build">
<Exec Command="git submodule update --init --recursive"/>
<Exec Command="$(Python) git_helper.py" CustomErrorRegularExpression="^Error" />
</Target>
<Target Name="Rebuild" DependsOnTargets="Build" />
<Target Name="Clean">
Expand Down
110 changes: 110 additions & 0 deletions BuildChecker/git_helper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#!/usr/bin/env python3
# Installs git hooks, updates them, updates submodules, that kind of thing.

import subprocess
import sys
import os
import shutil
from pathlib import Path
from typing import List

SOLUTION_PATH = Path("..") / "SpaceStation14.sln"
# If this doesn't match the saved version we overwrite them all.
CURRENT_HOOKS_VERSION = "2"
QUIET = len(sys.argv) == 2 and sys.argv[1] == "--quiet"


def run_command(command: List[str], capture: bool = False) -> subprocess.CompletedProcess:
"""
Runs a command with pretty output.
"""
text = ' '.join(command)
if not QUIET:
print("$ {}".format(text))

sys.stdout.flush()

completed = None

if capture:
completed = subprocess.run(command, cwd="..", stdout=subprocess.PIPE)
else:
completed = subprocess.run(command, cwd="..")

if completed.returncode != 0:
print("Error: command exited with code {}!".format(completed.returncode))

return completed


def update_submodules():
"""
Updates all submodules.
"""

if ('GITHUB_ACTIONS' in os.environ):
return

if os.path.isfile("DISABLE_SUBMODULE_AUTOUPDATE"):
return

if shutil.which("git") is None:
raise FileNotFoundError("git not found in PATH")

# If the status doesn't match, force VS to reload the solution.
# status = run_command(["git", "submodule", "status"], capture=True)
run_command(["git", "submodule", "update", "--init", "--recursive"])
# status2 = run_command(["git", "submodule", "status"], capture=True)

# Something changed.
# if status.stdout != status2.stdout:
# print("Git submodules changed. Reloading solution.")
# reset_solution()


def install_hooks():
"""
Installs the necessary git hooks into .git/hooks.
"""

# Read version file.
if os.path.isfile("INSTALLED_HOOKS_VERSION"):
with open("INSTALLED_HOOKS_VERSION", "r") as f:
if f.read() == CURRENT_HOOKS_VERSION:
if not QUIET:
print("No hooks change detected.")
return

with open("INSTALLED_HOOKS_VERSION", "w") as f:
f.write(CURRENT_HOOKS_VERSION)

print("Hooks need updating.")

hooks_target_dir = Path("..")/".git"/"hooks"
hooks_source_dir = Path("hooks")

# Clear entire tree since we need to kill deleted files too.
for filename in os.listdir(str(hooks_target_dir)):
os.remove(str(hooks_target_dir/filename))

for filename in os.listdir(str(hooks_source_dir)):
print("Copying hook {}".format(filename))
shutil.copy2(str(hooks_source_dir/filename),
str(hooks_target_dir/filename))


def reset_solution():
"""
Force VS to think the solution has been changed to prompt the user to reload it, thus fixing any load errors.
"""

with SOLUTION_PATH.open("r") as f:
content = f.read()

with SOLUTION_PATH.open("w") as f:
f.write(content)


if __name__ == '__main__':
install_hooks()
update_submodules()
13 changes: 13 additions & 0 deletions BuildChecker/hooks/post-checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

gitroot=`git rev-parse --show-toplevel`

cd "$gitroot/BuildChecker"

if [[ `uname` == MINGW* || `uname` == CYGWIN* ]]; then
# Windows
py -3 git_helper.py --quiet
else
# Not Windows, so probably some other Unix thing.
python3 git_helper.py --quiet
fi
5 changes: 5 additions & 0 deletions BuildChecker/hooks/post-merge
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

# Just call post-checkout since it does the same thing.
gitroot=`git rev-parse --show-toplevel`
bash "$gitroot/.git/hooks/post-checkout"
10 changes: 8 additions & 2 deletions Content.Packaging/ClientPackaging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ public static async Task WriteResources(
var graph = new RobustClientAssetGraph();
pass.Dependencies.Add(new AssetPassDependency(graph.Output.Name));

AssetGraph.CalculateGraph(graph.AllPasses.Append(pass).ToArray(), logger);
var dropSvgPass = new AssetPassFilterDrop(f => f.Path.EndsWith(".svg"))
{
Name = "DropSvgPass",
};
dropSvgPass.AddDependency(graph.Input).AddBefore(graph.PresetPasses);

AssetGraph.CalculateGraph([pass, dropSvgPass, ..graph.AllPasses], logger);

var inputPass = graph.Input;

Expand All @@ -72,7 +78,7 @@ await RobustSharedPackaging.WriteContentAssemblies(
new[] { "Content.Client", "Content.Shared", "Content.Shared.Database" },
cancel: cancel);

await RobustClientPackaging.WriteClientResources(contentDir, pass, cancel);
await RobustClientPackaging.WriteClientResources(contentDir, inputPass, cancel);

inputPass.InjectFinished();
}
Expand Down
5 changes: 5 additions & 0 deletions Content.Packaging/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

if (parsed.WipeRelease)
WipeRelease();
else
{
// Ensure the release directory exists. Otherwise, the packaging will fail.
Directory.CreateDirectory("release");
}

if (!parsed.SkipBuild)
WipeBin();
Expand Down
3 changes: 3 additions & 0 deletions Content.Packaging/ServerPackaging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ public static class ServerPackaging
private static readonly List<PlatformReg> Platforms = new()
{
new PlatformReg("win-x64", "Windows", true),
new PlatformReg("win-arm64", "Windows", true),
new PlatformReg("linux-x64", "Linux", true),
new PlatformReg("linux-arm64", "Linux", true),
new PlatformReg("osx-x64", "MacOS", true),
new PlatformReg("osx-arm64", "MacOS", true),
// Non-default platforms (i.e. for Watchdog Git)
new PlatformReg("win-x86", "Windows", false),
new PlatformReg("linux-x86", "Linux", false),
new PlatformReg("linux-arm", "Linux", false),
new PlatformReg("freebsd-x64", "FreeBSD", false),
};

private static List<string> PlatformRids => Platforms
Expand Down
21 changes: 21 additions & 0 deletions LICENSE.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017-2025 Space Wizards Federation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
13 changes: 13 additions & 0 deletions RUN_THIS.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env python3

# Import future so people on py2 still get the clear error that they need to upgrade.
from __future__ import print_function
import sys
import subprocess

version = sys.version_info
if version.major < 3 or (version.major == 3 and version.minor < 5):
print("ERROR: You need at least Python 3.5 to build SS14.")
sys.exit(1)

subprocess.run([sys.executable, "git_helper.py"], cwd="BuildChecker")
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
32 changes: 32 additions & 0 deletions Resources/Prototypes/_WH40K/Entities/Clothing/Belt/belts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
- type: entity
parent: [ClothingBeltBase, ClothingSlotBase]
id: WHClothingBeltSheath
name: ножны для сабли
description: Предназначены для силового меча Империума!
components:
- type: Sprite
sprite: _WH40K/Clothing/Belt/sheath_for_power_saber.rsi
state: sheath
- type: Clothing
sprite: _WH40K/Clothing/Belt/sheath_for_power_saber.rsi
- type: Item
size: Ginormous
- type: ItemSlots
slots:
item:
name: Sabre
insertVerbText: sheath-insert-verb
ejectVerbText: sheath-eject-verb
insertSound: /Audio/SimpleStation14/Items/Handling/sword_sheath.ogg
ejectSound: /Audio/SimpleStation14/Items/Handling/sword_unsheath.ogg
whitelist:
tags:
- CaptainSabre
- type: ItemMapper
mapLayers:
sheath-sabre:
whitelist:
tags:
- CaptainSabre
- type: Appearance

Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
- type: entity
id: WHBulletPlasmaPistol
name: Снаряд плазмы
parent: BaseBulletTrigger
categories: [ HideSpawnMenu ]
components:
- type: Sprite
sprite: Objects/Weapons/Guns/Projectiles/projectiles_tg.rsi
layers:
- state: omnilaser
shader: unshaded
- type: ExplodeOnTrigger
- type: Explosive
explosionType: Plasma
maxIntensity: 3 # max 30 per tile
intensitySlope: 1
totalIntensity: 4 # 60 total damage to distribute over tiles
maxTileBreak: 1
- type: TimedDespawn
lifetime: 0.65 # Примерно 17 тайлов
- type: PointLight
radius: 3.5
color: Blue
energy: 0.5

- type: entity
id: WHBulletPlasmaRifle
name: Снаряд плазмы
parent: BaseBulletTrigger
categories: [ HideSpawnMenu ]
components:
- type: Sprite
sprite: Objects/Weapons/Guns/Projectiles/projectiles_tg.rsi
layers:
- state: omnilaser
shader: unshaded
- type: ExplodeOnTrigger
- type: Explosive
explosionType: Plasma
maxIntensity: 3 # max 30 per tile
intensitySlope: 1
totalIntensity: 4 # 60 total damage to distribute over tiles
maxTileBreak: 1
- type: TimedDespawn
lifetime: 1.3 # Примерно 34 тайлов
- type: PointLight
radius: 3.5
color: Blue
energy: 0.5
Loading
Loading