config_tool: add config tool solution (#198)

Co-authored-by: Marcin Kurczewski <dash@wind.garden>
This commit is contained in:
lahm86 2024-09-06 07:36:33 +01:00 committed by GitHub
parent 60a106aa43
commit 7271da050f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
26 changed files with 264 additions and 6 deletions

View File

@ -12,7 +12,7 @@ jobs:
matrix:
include:
- platform: win
just_target: package-win
just_target: package-win-all
steps:
- name: Install dependencies

2
.gitignore vendored
View File

@ -6,3 +6,5 @@ __pycache__/
subprojects/packagecache/
subprojects/dwarfstack-*/
subprojects/dwarfstack.wrap
.dotnet/
.local/

View File

@ -14,6 +14,7 @@
- added `/tp` console command's ability to teleport to specific items
- added `/fly` console command's ability to open nearest doors
- added an option to fix M16 accuracy while running (#45)
- added a .NET-based configuration tool (#197)
- fixed explosions sometimes being drawn too dark (#187)
- fixed killing the T-Rex with a grenade launcher crashing the game (#168)
- fixed secret rewards not displaying shotgun ammo (#159)

View File

@ -41,13 +41,16 @@ _docker_run *args:
{{args}}
image-win force="1": (_docker_build "tools/docker/game-win/Dockerfile" "rrdash/tr2x" force)
image-win force="1": (_docker_build "tools/docker/game-win/Dockerfile" "rrdash/tr2x" force)
image-win-config force="1": (_docker_build "tools/docker/config/Dockerfile" "rrdash/tr2x-config" force)
push-image-win: (image-win "0") (_docker_push "rrdash/tr2x")
push-image-win: (image-win "0") (_docker_push "rrdash/tr2x")
build-win target='debug': (image-win "0") (_docker_run "-e" "TARGET="+target "rrdash/tr2x")
build-win target='debug': (image-win "0") (_docker_run "-e" "TARGET="+target "rrdash/tr2x")
build-win-config: (image-win-config "0") (_docker_run "rrdash/tr2x-config")
package-win target='release': (build-win target) (_docker_run "rrdash/tr2x" "package")
package-win target='release': (build-win target) (_docker_run "rrdash/tr2x" "package")
package-win-all target='release': (build-win target) (build-win-config) (_docker_run "rrdash/tr2x" "package")
output-current-version:
tools/get_version

@ -1 +1 @@
Subproject commit 83c36bc04590bbb972e492740dd2d8293cd6bda5
Subproject commit 87b67a3d4df3df4e10b94518f6a39e06de2b5ab7

16
tools/config/.gitignore vendored Normal file
View File

@ -0,0 +1,16 @@
*.suo
*.o
*.obj
*.pdb
*.lib
*.exp
[Dd]ebug/
[Rr]elease/
[Oo]bj/
*.user
*.ipch
.vs/
*.vcxproj
*.filters
*.pubxml
out/

View File

@ -0,0 +1,30 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32407.343
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TR2X_ConfigTool", "TR2X_ConfigTool\TR2X_ConfigTool.csproj", "{DCFCB544-9B88-41D6-A995-EA2D06FE405E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DCFCB544-9B88-41D6-A995-EA2D06FE405E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DCFCB544-9B88-41D6-A995-EA2D06FE405E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DCFCB544-9B88-41D6-A995-EA2D06FE405E}.Debug|x64.ActiveCfg = Debug|x64
{DCFCB544-9B88-41D6-A995-EA2D06FE405E}.Debug|x64.Build.0 = Debug|x64
{DCFCB544-9B88-41D6-A995-EA2D06FE405E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DCFCB544-9B88-41D6-A995-EA2D06FE405E}.Release|Any CPU.Build.0 = Release|Any CPU
{DCFCB544-9B88-41D6-A995-EA2D06FE405E}.Release|x64.ActiveCfg = Release|x64
{DCFCB544-9B88-41D6-A995-EA2D06FE405E}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {49C0A7F4-2D17-424B-BD94-A8FC6E95931D}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,4 @@
<Application
x:Class="TR2X_ConfigTool.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"/>

View File

@ -0,0 +1,13 @@
using System.Windows;
using TRX_ConfigToolLib;
namespace TR2X_ConfigTool;
public partial class App : Application
{
public App()
{
Current.MainWindow = new TRXConfigWindow();
Current.MainWindow.Show();
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

View File

@ -0,0 +1,15 @@
{
"Controls": {
"window_title_main": "TR2X Config Tool",
"command_launch_gold": "Launch Golden Mask",
"file_dialog_filter": "TR2X Config Files",
"window_title_about": "About TR2X Config Tool",
"label_about_details": "Visit the TR2X GitHub page for further information."
},
"Properties": {
"fix_m16_accuracy": {
"Title": "Fix M16 accuracy",
"Description": "Fixes the accuracy of the M16 while Lara is running."
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -0,0 +1,7 @@
{
"AppImage": "TR2X.png",
"ConfigPath": "cfg\\TR2X.json5",
"ExecutableName": "TR2X.exe",
"GoldSupported": false,
"GitHubURL": "https://github.com/LostArtefacts/TR2X"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

View File

@ -0,0 +1,57 @@
{
"CategorisedProperties": [
{
"ID": "controls",
"Image": "Graphics/graphic1.jpg",
"Properties": [
]
},
{
"ID": "gameplay_fixes",
"Image": "Graphics/graphic2.jpg",
"Properties": [
{
"Field": "fix_m16_accuracy",
"DataType": "Bool",
"DefaultValue": true
}
]
},
{
"ID": "gameplay_modifications",
"Image": "Graphics/graphic3.jpg",
"Properties": [
]
},
{
"ID": "gameplay_options",
"Image": "Graphics/graphic4.jpg",
"Properties": [
]
},
{
"ID": "graphics",
"Image": "Graphics/graphic5.jpg",
"Properties": [
]
},
{
"ID": "sound",
"Image": "Graphics/graphic6.jpg",
"Properties": [
]
},
{
"ID": "ui",
"Image": "Graphics/graphic7.jpg",
"Properties": [
]
}
]
}

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>disable</Nullable>
<UseWpf>true</UseWpf>
<UseWindowsForms>true</UseWindowsForms>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<AssemblyName>TR2X_ConfigTool</AssemblyName>
<ProduceReferenceAssembly>True</ProduceReferenceAssembly>
<ApplicationManifest>app.manifest</ApplicationManifest>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<PublishSingleFile>true</PublishSingleFile>
<PublishTrimmed>false</PublishTrimmed>
<PublishReadyToRun>true</PublishReadyToRun>
<EnableCompressionInSingleFile>false</EnableCompressionInSingleFile>
<SelfContained>false</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<ApplicationIcon>Resources\icon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Compile Remove="out\**" />
<EmbeddedResource Remove="out\**" />
<None Remove="out\**" />
<Page Remove="out\**" />
</ItemGroup>
<ItemGroup>
<None Remove="Resources\Graphics\graphic1.jpg" />
<None Remove="Resources\Graphics\graphic2.jpg" />
<None Remove="Resources\Graphics\graphic3.jpg" />
<None Remove="Resources\Graphics\graphic4.jpg" />
<None Remove="Resources\Graphics\graphic5.jpg" />
<None Remove="Resources\Graphics\graphic6.jpg" />
<None Remove="Resources\Graphics\graphic7.jpg" />
<None Remove="Resources\const.json" />
<None Remove="Resources\icon.ico" />
<None Remove="Resources\Lang\en.json" />
<None Remove="Resources\specification.json" />
<None Remove="Resources\TR2X.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Graphics\graphic1.jpg" />
<Resource Include="Resources\Graphics\graphic2.jpg" />
<Resource Include="Resources\Graphics\graphic3.jpg" />
<Resource Include="Resources\Graphics\graphic4.jpg" />
<Resource Include="Resources\Graphics\graphic5.jpg" />
<Resource Include="Resources\Graphics\graphic6.jpg" />
<Resource Include="Resources\Graphics\graphic7.jpg" />
<Resource Include="Resources\icon.ico" />
<Resource Include="Resources\TR2X.png" />
<EmbeddedResource Include="Resources\const.json" />
<EmbeddedResource Include="Resources\Lang\en.json" />
<EmbeddedResource Include="Resources\specification.json" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<Reference Include="TRX_ConfigToolLib">
<HintPath>..\..\..\subprojects\libtrx\tools\config\TRX_ConfigToolLib\bin\Release\publish\TRX_ConfigToolLib.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="TR2X_ConfigTool.app"/>
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>

View File

@ -0,0 +1,5 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
ENV HOME /app
WORKDIR /app
ENTRYPOINT ["/app/tools/docker/config/entrypoint.sh"]

View File

@ -0,0 +1,19 @@
#!/bin/bash
set -x
set -e
export DOTNET_CLI_HOME="/tmp/DOTNET_CLI_HOME"
echo $HOME
shopt -s globstar
# Build the common lib DLL
cd /app/subprojects/libtrx/tools/config/
rm -rf **/bin **/obj
dotnet restore -p:EnableWindowsTargeting=true
dotnet publish -c Release -p:EnableWindowsTargeting=true
# Build the main executable
cd /app/tools/config/
rm -rf **/bin **/obj **/out/*
dotnet restore
dotnet publish -c Release -o out

View File

@ -14,6 +14,10 @@ run_script(
release_zip_files=[
(Path("/app/build/win/TR2X.exe"), "TR2X.exe"),
(Path("/app/build/win/TR2X.dll"), "TR2X.dll"),
(
Path("/app/tools/config/out/TR2X_ConfigTool.exe"),
"TR2X_ConfigTool.exe",
),
],
compressable_exes=[
Path("/app/build/win/TR2X.exe"),