Skip to content

Commit

Permalink
Merge branch 'master-remote' of https://github.com/coopertrucks/Block…
Browse files Browse the repository at this point in the history
  • Loading branch information
coopertrucks committed Aug 29, 2024
2 parents 41dbe9f + 55a2f9a commit 6abd1ed
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 21 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,9 @@ jobs:
- name: Build
run: dotnet publish ${{ matrix.projectPath }} --configuration Release --runtime ${{ matrix.targetPlatform }} -p:PublishReadyToRun=false -p:TieredCompilation=false -p:PublishSingleFile=true -p:Version=${{ steps.desc.outputs.describe }} --self-contained false --output ./Build/${{ matrix.targetPlatform }}

- name: Zip build
run: |
pushd Build/${{ matrix.targetPlatform }}
zip -r ../../Blocktest-${{ matrix.targetPlatform }}-${{ matrix.dotnet }}.zip .
popd
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.projectPath }}-${{ matrix.targetPlatform }}-${{ matrix.dotnet }}
path: ./Blocktest-${{ matrix.targetPlatform }}-${{ matrix.dotnet }}.zip
name: ${{ matrix.projectPath }}-${{ steps.desc.outputs.describe }}-${{ matrix.targetPlatform }}
path: ./Build/${{ matrix.targetPlatform }}
compression-level: 0
11 changes: 5 additions & 6 deletions .run/Blocktest (Local Multiplayer).run.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Blocktest (Local Multiplayer)" type="DotNetProject" factoryName=".NET Project"
singleton="false">
<option name="EXE_PATH" value="$PROJECT_DIR$/Blocktest/bin/Debug/net7.0/Blocktest.exe" />
<option name="PROGRAM_PARAMETERS" value="connect 127.0.0.1:9050"/>
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/Blocktest/bin/Debug/net7.0" />
<configuration default="false" name="Blocktest (Local Multiplayer)" type="DotNetProject" factoryName=".NET Project" singleton="false">
<option name="EXE_PATH" value="$PROJECT_DIR$/Blocktest/bin/Debug/net8.0/Blocktest.exe" />
<option name="PROGRAM_PARAMETERS" value="connect 127.0.0.1:9050" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/Blocktest/bin/Debug/net8.0" />
<option name="PASS_PARENT_ENVS" value="1" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
Expand All @@ -13,7 +12,7 @@
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
<option name="PROJECT_KIND" value="DotNetCore" />
<option name="PROJECT_TFM" value="net7.0" />
<option name="PROJECT_TFM" value="net8.0" />
<method v="2">
<option name="Build" />
</method>
Expand Down
6 changes: 3 additions & 3 deletions .run/Blocktest.run.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Blocktest" type="DotNetProject" factoryName=".NET Project">
<option name="EXE_PATH" value="$PROJECT_DIR$/Blocktest/bin/Debug/net7.0/Blocktest.exe" />
<option name="EXE_PATH" value="$PROJECT_DIR$/Blocktest/bin/Debug/net8.0/Blocktest.exe" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/Blocktest/bin/Debug/net7.0" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/Blocktest/bin/Debug/net8.0" />
<option name="PASS_PARENT_ENVS" value="1" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
Expand All @@ -12,7 +12,7 @@
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
<option name="PROJECT_KIND" value="DotNetCore" />
<option name="PROJECT_TFM" value="net7.0" />
<option name="PROJECT_TFM" value="net8.0" />
<method v="2">
<option name="Build" />
</method>
Expand Down
6 changes: 3 additions & 3 deletions .run/DedicatedServer.run.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="DedicatedServer" type="DotNetProject" factoryName=".NET Project">
<option name="EXE_PATH" value="$PROJECT_DIR$/DedicatedServer/bin/Debug/net7.0/DedicatedServer.exe"/>
<option name="EXE_PATH" value="$PROJECT_DIR$/DedicatedServer/bin/Debug/net8.0/DedicatedServer.exe" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/DedicatedServer/bin/Debug/net7.0" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/DedicatedServer/bin/Debug/net8.0" />
<option name="PASS_PARENT_ENVS" value="1" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
Expand All @@ -12,7 +12,7 @@
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
<option name="PROJECT_KIND" value="DotNetCore" />
<option name="PROJECT_TFM" value="net7.0" />
<option name="PROJECT_TFM" value="net8.0" />
<method v="2">
<option name="Build" />
</method>
Expand Down
1 change: 1 addition & 0 deletions Blocktest/Blocktest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<PublishReadyToRun>false</PublishReadyToRun>
<TieredCompilation>false</TieredCompilation>
<Nullable>enable</Nullable>
<Version>0.0.0.0</Version>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
Expand Down
2 changes: 2 additions & 0 deletions Blocktest/BlocktestGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public sealed class BlocktestGame : Game {
private IScene? _currentScene;
private GraphicsDeviceManager _graphics;

public readonly Version? BlocktestVersion = typeof(BlocktestGame).Assembly.GetName().Version;

/// <inheritdoc />
public BlocktestGame(IPEndPoint? newIp = null) {
_connect = newIp != null;
Expand Down
2 changes: 1 addition & 1 deletion Blocktest/Code/Scenes/GameScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private void HandleInput() {
_gameUi.BlockSelector.SelectedIndex = BlockSelected;
}

float moveValue = 2.5f;
float moveValue = 2;
if (currentKeyboardState.IsKeyDown(Keys.LeftShift) || currentKeyboardState.IsKeyDown(Keys.RightShift)) {
moveValue *= 4;
}
Expand Down
10 changes: 10 additions & 0 deletions Blocktest/Code/Scenes/MainMenuScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ public MainMenuScene(BlocktestGame game, Window? modal = null) {
_desktop = new Desktop { Root = mainMenu };

modal?.ShowModal(_desktop);

string version = game.BlocktestVersion is { Major: 0, Minor: 0, Build: 0, Revision: 0 } ? "Dev Build" : $"Version {game.BlocktestVersion}";

Label versionLabel = new() {
Text = version,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Bottom
};

_desktop.Widgets.Add(versionLabel);
}

public void Update(GameTime gameTime) { }
Expand Down
7 changes: 7 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"sdk": {
"version": "8.0.0",
"rollForward": "latestMajor",
"allowPrerelease": false
}
}

0 comments on commit 6abd1ed

Please sign in to comment.