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

Updated ModSDK files to playtest-20241116 #30

Merged
merged 2 commits into from
Dec 18, 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
824 changes: 584 additions & 240 deletions .editorconfig

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:

steps:
- name: Clone Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install .NET 6.0
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'

Expand All @@ -43,7 +43,7 @@ jobs:

steps:
- name: Clone Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Prepare Environment
run: |
Expand All @@ -67,10 +67,10 @@ jobs:

steps:
- name: Clone Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install .NET 6.0
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ jobs:
tag: ${{ github.ref }}
overwrite: true
file_glob: true
file: build/windows/*
file: build/windows/*
6 changes: 3 additions & 3 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ members of the project's leadership.
## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
available at [https://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
[homepage]: https://contributor-covenant.org
[version]: https://contributor-covenant.org/version/1/4/
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Please note that this repository is specifically for the scripts and infrastruct
When developing new features, it is important to make sure that they work on all our supported platforms. Right now, this means Windows >= 7 (with PowerShell >= 3), macOS >= 10.7, and Linux. We would like to also support *BSD, but do not currently have a means to test this.

Some issues to be aware of include:
* Use http://www.shellcheck.net/ to confirm POSIX compatibility of *.sh scripts.
* Use https://www.shellcheck.net/ to confirm POSIX compatibility of *.sh scripts.
* Avoid non-standard gnu extensions to common Unix tools (e.g. the `-f` flag from GNU `readlink`)

While your pull-request is in review it will be helpful if you join IRC to discuss the changes.

See also the in-depth guide on [contributing](https://github.com/OpenRA/OpenRA/wiki/Contributing) on the main OpenRA project wiki. Most of the content on this page also applies to the Mod SDK.
See also the in-depth guide on [contributing](https://github.com/OpenRA/OpenRA/wiki/Contributing) on the main OpenRA project wiki. Most of the content on this page also applies to the Mod SDK.
8 changes: 4 additions & 4 deletions COPYING
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Expand Down Expand Up @@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

Expand All @@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.

The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<https://www.gnu.org/philosophy/why-not-lgpl.html>.
22 changes: 15 additions & 7 deletions OpenRA.Mods.Mobius/RemasterSpriteSequence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#endregion

using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using OpenRA.Graphics;
Expand Down Expand Up @@ -63,14 +64,15 @@ public class RemasterSpriteSequenceLoader : ClassicTilesetSpecificSpriteSequence
public RemasterSpriteSequenceLoader(ModData modData)
: base(modData) { }

public override ISpriteSequence CreateSequence(ModData modData, string tileset, SpriteCache cache, string image, string sequence, MiniYaml data, MiniYaml defaults)
public override ISpriteSequence CreateSequence(ModData modData, string tileset, SpriteCache cache,
string image, string sequence, MiniYaml data, MiniYaml defaults)
{
return new RemasterSpriteSequence(cache, this, image, sequence, data, defaults);
}
}

[Desc("A sprite sequence that can have tileset-specific variants and has the oddities " +
"that come with first-generation Westwood titles.")]
"that come with first-generation Westwood titles.")]
public class RemasterSpriteSequence : ClassicTilesetSpecificSpriteSequence
{
[Desc("File name of the remastered sprite to use for this sequence.")]
Expand Down Expand Up @@ -112,7 +114,9 @@ IEnumerable<ReservationInfo> ParseRemasterFilenames(ModData modData, string tile
{
string filename = null;
MiniYamlNode.SourceLocation location = default;
var remasteredTilesetFilenamesPatternNode = data.Nodes.FirstOrDefault(n => n.Key == RemasteredTilesetFilenamesPattern.Key) ?? defaults.Nodes.FirstOrDefault(n => n.Key == RemasteredTilesetFilenamesPattern.Key);
var remasteredTilesetFilenamesPatternNode = data.Nodes.FirstOrDefault(n => n.Key == RemasteredTilesetFilenamesPattern.Key)
?? defaults.Nodes.FirstOrDefault(n => n.Key == RemasteredTilesetFilenamesPattern.Key);

if (remasteredTilesetFilenamesPatternNode != null)
{
var tilesetNode = remasteredTilesetFilenamesPatternNode.Value.Nodes.FirstOrDefault(n => n.Key == tileset);
Expand All @@ -122,11 +126,13 @@ IEnumerable<ReservationInfo> ParseRemasterFilenames(ModData modData, string tile
var patternCount = LoadField("Count", 1, tilesetNode.Value);

return Enumerable.Range(patternStart, patternCount).Select(i =>
new ReservationInfo(string.Format(tilesetNode.Value.Value, i), FirstFrame, FirstFrame, tilesetNode.Location));
new ReservationInfo(string.Format(CultureInfo.InvariantCulture, tilesetNode.Value.Value, i), FirstFrame, FirstFrame, tilesetNode.Location));
}
}

var remasteredTilesetFilenamesNode = data.Nodes.FirstOrDefault(n => n.Key == RemasteredTilesetFilenames.Key) ?? defaults.Nodes.FirstOrDefault(n => n.Key == RemasteredTilesetFilenames.Key);
var remasteredTilesetFilenamesNode = data.Nodes.FirstOrDefault(n => n.Key == RemasteredTilesetFilenames.Key)
?? defaults.Nodes.FirstOrDefault(n => n.Key == RemasteredTilesetFilenames.Key);

if (!string.IsNullOrEmpty(remasteredTilesetFilenamesNode?.Value.Value))
{
var tilesetNode = remasteredTilesetFilenamesNode.Value.Nodes.FirstOrDefault(n => n.Key == tileset);
Expand All @@ -138,14 +144,16 @@ IEnumerable<ReservationInfo> ParseRemasterFilenames(ModData modData, string tile
}
else
{
var remasteredFilenamePatternNode = data.Nodes.FirstOrDefault(n => n.Key == RemasteredFilenamePattern.Key) ?? defaults.Nodes.FirstOrDefault(n => n.Key == RemasteredFilenamePattern.Key);
var remasteredFilenamePatternNode = data.Nodes.FirstOrDefault(n => n.Key == RemasteredFilenamePattern.Key)
?? defaults.Nodes.FirstOrDefault(n => n.Key == RemasteredFilenamePattern.Key);

if (!string.IsNullOrEmpty(remasteredFilenamePatternNode?.Value.Value))
{
var patternStart = LoadField("Start", 0, remasteredFilenamePatternNode.Value);
var patternCount = LoadField("Count", 1, remasteredFilenamePatternNode.Value);

return Enumerable.Range(patternStart, patternCount).Select(i =>
new ReservationInfo(string.Format(remasteredFilenamePatternNode.Value.Value, i),
new ReservationInfo(string.Format(CultureInfo.InvariantCulture, remasteredFilenamePatternNode.Value.Value, i),
FirstFrame, FirstFrame, remasteredFilenamePatternNode.Location));
}
}
Expand Down
10 changes: 7 additions & 3 deletions OpenRA.Mods.Mobius/Traits/World/RemasterTerrainRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ public void UpdateCell(CPos cell)
int t;
void ITick.Tick(Actor self)
{
t += 1;
if (t > 2)
if (++t > 2)
{
t = 0;
frame = (frame + 1) % 8;
Expand Down Expand Up @@ -160,7 +159,12 @@ Rectangle ITiledTerrainRenderer.TemplateBounds(TerrainTemplateInfo template)
var v = map.Grid.Type == MapGridType.Rectangular ? y : (x + y) / 2f;

var tl = new float2(u * tileSize.Width, (v - 0.5f * tileInfo.Height) * tileSize.Height) - 0.5f * scale * sprite.Size;
var rect = new Rectangle((int)(tl.X + scale * sprite.Offset.X), (int)(tl.Y + scale * sprite.Offset.Y), (int)(scale * sprite.Size.X), (int)(scale * sprite.Size.Y));
var rect = new Rectangle(
(int)(tl.X + scale * sprite.Offset.X),
(int)(tl.Y + scale * sprite.Offset.Y),
(int)(scale * sprite.Size.X),
(int)(scale * sprite.Size.Y));

templateRect = templateRect.HasValue ? Rectangle.Union(templateRect.Value, rect) : rect;
}
}
Expand Down
2 changes: 1 addition & 1 deletion make.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ if (Test-Path "user.config")

$modID = $env:MOD_ID

$env:MOD_SEARCH_PATHS = "./mods,$env:ENGINE_DIRECTORY/mods"
$env:MOD_SEARCH_PATHS = "./mods"
$env:ENGINE_DIR = ".." # Set to potentially be used by the Utility and different than $env:ENGINE_DIRECTORY, which is for the script.

# Fetch the engine if required
Expand Down
4 changes: 2 additions & 2 deletions mod.config
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ PACKAGING_DISPLAY_NAME="Tiberian Dawn HD"
# The URL for the project homepage.
# This is used in:
# - Windows "Add/Remove Programs" list
PACKAGING_WEBSITE_URL="http://openra.net"
PACKAGING_WEBSITE_URL="https://openra.net"

# The URL that is displayed in the crash dialog.
PACKAGING_FAQ_URL="http://wiki.openra.net/FAQ"
PACKAGING_FAQ_URL="https://wiki.openra.net/FAQ"

# The human-readable project authors.
# This is used in:
Expand Down